1. Packages
  2. AWS
  3. API Docs
  4. codebuild
  5. getFleet
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi

aws.codebuild.getFleet

Explore with Pulumi AI

AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi

Retrieve information about an CodeBuild Fleet.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const testFleet = new aws.codebuild.Fleet("test", {
    baseCapacity: 2,
    computeType: "BUILD_GENERAL1_SMALL",
    environmentType: "LINUX_CONTAINER",
    name: "full-example-codebuild-fleet",
    overflowBehavior: "QUEUE",
    scalingConfiguration: {
        maxCapacity: 5,
        scalingType: "TARGET_TRACKING_SCALING",
        targetTrackingScalingConfigs: [{
            metricType: "FLEET_UTILIZATION_RATE",
            targetValue: 97.5,
        }],
    },
});
const test = aws.codebuild.getFleetOutput({
    name: testFleet.name,
});
Copy
import pulumi
import pulumi_aws as aws

test_fleet = aws.codebuild.Fleet("test",
    base_capacity=2,
    compute_type="BUILD_GENERAL1_SMALL",
    environment_type="LINUX_CONTAINER",
    name="full-example-codebuild-fleet",
    overflow_behavior="QUEUE",
    scaling_configuration={
        "max_capacity": 5,
        "scaling_type": "TARGET_TRACKING_SCALING",
        "target_tracking_scaling_configs": [{
            "metric_type": "FLEET_UTILIZATION_RATE",
            "target_value": 97.5,
        }],
    })
test = aws.codebuild.get_fleet_output(name=test_fleet.name)
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/codebuild"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		testFleet, err := codebuild.NewFleet(ctx, "test", &codebuild.FleetArgs{
			BaseCapacity:     pulumi.Int(2),
			ComputeType:      pulumi.String("BUILD_GENERAL1_SMALL"),
			EnvironmentType:  pulumi.String("LINUX_CONTAINER"),
			Name:             pulumi.String("full-example-codebuild-fleet"),
			OverflowBehavior: pulumi.String("QUEUE"),
			ScalingConfiguration: &codebuild.FleetScalingConfigurationArgs{
				MaxCapacity: pulumi.Int(5),
				ScalingType: pulumi.String("TARGET_TRACKING_SCALING"),
				TargetTrackingScalingConfigs: codebuild.FleetScalingConfigurationTargetTrackingScalingConfigArray{
					&codebuild.FleetScalingConfigurationTargetTrackingScalingConfigArgs{
						MetricType:  pulumi.String("FLEET_UTILIZATION_RATE"),
						TargetValue: pulumi.Float64(97.5),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		_ = codebuild.LookupFleetOutput(ctx, codebuild.GetFleetOutputArgs{
			Name: testFleet.Name,
		}, nil)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var testFleet = new Aws.CodeBuild.Fleet("test", new()
    {
        BaseCapacity = 2,
        ComputeType = "BUILD_GENERAL1_SMALL",
        EnvironmentType = "LINUX_CONTAINER",
        Name = "full-example-codebuild-fleet",
        OverflowBehavior = "QUEUE",
        ScalingConfiguration = new Aws.CodeBuild.Inputs.FleetScalingConfigurationArgs
        {
            MaxCapacity = 5,
            ScalingType = "TARGET_TRACKING_SCALING",
            TargetTrackingScalingConfigs = new[]
            {
                new Aws.CodeBuild.Inputs.FleetScalingConfigurationTargetTrackingScalingConfigArgs
                {
                    MetricType = "FLEET_UTILIZATION_RATE",
                    TargetValue = 97.5,
                },
            },
        },
    });

    var test = Aws.CodeBuild.GetFleet.Invoke(new()
    {
        Name = testFleet.Name,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.codebuild.Fleet;
import com.pulumi.aws.codebuild.FleetArgs;
import com.pulumi.aws.codebuild.inputs.FleetScalingConfigurationArgs;
import com.pulumi.aws.codebuild.CodebuildFunctions;
import com.pulumi.aws.codebuild.inputs.GetFleetArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var testFleet = new Fleet("testFleet", FleetArgs.builder()
            .baseCapacity(2)
            .computeType("BUILD_GENERAL1_SMALL")
            .environmentType("LINUX_CONTAINER")
            .name("full-example-codebuild-fleet")
            .overflowBehavior("QUEUE")
            .scalingConfiguration(FleetScalingConfigurationArgs.builder()
                .maxCapacity(5)
                .scalingType("TARGET_TRACKING_SCALING")
                .targetTrackingScalingConfigs(FleetScalingConfigurationTargetTrackingScalingConfigArgs.builder()
                    .metricType("FLEET_UTILIZATION_RATE")
                    .targetValue(97.5)
                    .build())
                .build())
            .build());

        final var test = CodebuildFunctions.getFleet(GetFleetArgs.builder()
            .name(testFleet.name())
            .build());

    }
}
Copy
resources:
  testFleet:
    type: aws:codebuild:Fleet
    name: test
    properties:
      baseCapacity: 2
      computeType: BUILD_GENERAL1_SMALL
      environmentType: LINUX_CONTAINER
      name: full-example-codebuild-fleet
      overflowBehavior: QUEUE
      scalingConfiguration:
        maxCapacity: 5
        scalingType: TARGET_TRACKING_SCALING
        targetTrackingScalingConfigs:
          - metricType: FLEET_UTILIZATION_RATE
            targetValue: 97.5
variables:
  test:
    fn::invoke:
      function: aws:codebuild:getFleet
      arguments:
        name: ${testFleet.name}
Copy

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = aws.codebuild.getFleet({
    name: "my-codebuild-fleet-name",
});
Copy
import pulumi
import pulumi_aws as aws

example = aws.codebuild.get_fleet(name="my-codebuild-fleet-name")
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/codebuild"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := codebuild.LookupFleet(ctx, &codebuild.LookupFleetArgs{
			Name: "my-codebuild-fleet-name",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = Aws.CodeBuild.GetFleet.Invoke(new()
    {
        Name = "my-codebuild-fleet-name",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.codebuild.CodebuildFunctions;
import com.pulumi.aws.codebuild.inputs.GetFleetArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var example = CodebuildFunctions.getFleet(GetFleetArgs.builder()
            .name("my-codebuild-fleet-name")
            .build());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: aws:codebuild:getFleet
      arguments:
        name: my-codebuild-fleet-name
Copy

Using getFleet

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getFleet(args: GetFleetArgs, opts?: InvokeOptions): Promise<GetFleetResult>
function getFleetOutput(args: GetFleetOutputArgs, opts?: InvokeOptions): Output<GetFleetResult>
Copy
def get_fleet(name: Optional[str] = None,
              tags: Optional[Mapping[str, str]] = None,
              opts: Optional[InvokeOptions] = None) -> GetFleetResult
def get_fleet_output(name: Optional[pulumi.Input[str]] = None,
              tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
              opts: Optional[InvokeOptions] = None) -> Output[GetFleetResult]
Copy
func LookupFleet(ctx *Context, args *LookupFleetArgs, opts ...InvokeOption) (*LookupFleetResult, error)
func LookupFleetOutput(ctx *Context, args *LookupFleetOutputArgs, opts ...InvokeOption) LookupFleetResultOutput
Copy

> Note: This function is named LookupFleet in the Go SDK.

public static class GetFleet 
{
    public static Task<GetFleetResult> InvokeAsync(GetFleetArgs args, InvokeOptions? opts = null)
    public static Output<GetFleetResult> Invoke(GetFleetInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetFleetResult> getFleet(GetFleetArgs args, InvokeOptions options)
public static Output<GetFleetResult> getFleet(GetFleetArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: aws:codebuild/getFleet:getFleet
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
Fleet name.
Tags Dictionary<string, string>
Mapping of Key-Value tags for the resource.
Name This property is required. string
Fleet name.
Tags map[string]string
Mapping of Key-Value tags for the resource.
name This property is required. String
Fleet name.
tags Map<String,String>
Mapping of Key-Value tags for the resource.
name This property is required. string
Fleet name.
tags {[key: string]: string}
Mapping of Key-Value tags for the resource.
name This property is required. str
Fleet name.
tags Mapping[str, str]
Mapping of Key-Value tags for the resource.
name This property is required. String
Fleet name.
tags Map<String>
Mapping of Key-Value tags for the resource.

getFleet Result

The following output properties are available:

Arn string
ARN of the Fleet.
BaseCapacity int
Number of machines allocated to the fleet.
ComputeConfigurations List<GetFleetComputeConfiguration>
Compute configuration of the compute fleet.
ComputeType string
Compute resources the compute fleet uses.
Created string
Creation time of the fleet.
EnvironmentType string
Environment type of the compute fleet.
FleetServiceRole string
The service role associated with the compute fleet.
Id string
ARN of the Fleet.
ImageId string
The Amazon Machine Image (AMI) of the compute fleet.
LastModified string
Last modification time of the fleet.
Name string
OverflowBehavior string
Overflow behavior for compute fleet.
ScalingConfigurations List<GetFleetScalingConfiguration>
Nested attribute containing information about the scaling configuration.
Statuses List<GetFleetStatus>
Nested attribute containing information about the current status of the fleet.
Tags Dictionary<string, string>
Mapping of Key-Value tags for the resource.
VpcConfigs List<GetFleetVpcConfig>
Nested attribute containing information about the VPC configuration.
Arn string
ARN of the Fleet.
BaseCapacity int
Number of machines allocated to the fleet.
ComputeConfigurations []GetFleetComputeConfiguration
Compute configuration of the compute fleet.
ComputeType string
Compute resources the compute fleet uses.
Created string
Creation time of the fleet.
EnvironmentType string
Environment type of the compute fleet.
FleetServiceRole string
The service role associated with the compute fleet.
Id string
ARN of the Fleet.
ImageId string
The Amazon Machine Image (AMI) of the compute fleet.
LastModified string
Last modification time of the fleet.
Name string
OverflowBehavior string
Overflow behavior for compute fleet.
ScalingConfigurations []GetFleetScalingConfiguration
Nested attribute containing information about the scaling configuration.
Statuses []GetFleetStatus
Nested attribute containing information about the current status of the fleet.
Tags map[string]string
Mapping of Key-Value tags for the resource.
VpcConfigs []GetFleetVpcConfig
Nested attribute containing information about the VPC configuration.
arn String
ARN of the Fleet.
baseCapacity Integer
Number of machines allocated to the fleet.
computeConfigurations List<GetFleetComputeConfiguration>
Compute configuration of the compute fleet.
computeType String
Compute resources the compute fleet uses.
created String
Creation time of the fleet.
environmentType String
Environment type of the compute fleet.
fleetServiceRole String
The service role associated with the compute fleet.
id String
ARN of the Fleet.
imageId String
The Amazon Machine Image (AMI) of the compute fleet.
lastModified String
Last modification time of the fleet.
name String
overflowBehavior String
Overflow behavior for compute fleet.
scalingConfigurations List<GetFleetScalingConfiguration>
Nested attribute containing information about the scaling configuration.
statuses List<GetFleetStatus>
Nested attribute containing information about the current status of the fleet.
tags Map<String,String>
Mapping of Key-Value tags for the resource.
vpcConfigs List<GetFleetVpcConfig>
Nested attribute containing information about the VPC configuration.
arn string
ARN of the Fleet.
baseCapacity number
Number of machines allocated to the fleet.
computeConfigurations GetFleetComputeConfiguration[]
Compute configuration of the compute fleet.
computeType string
Compute resources the compute fleet uses.
created string
Creation time of the fleet.
environmentType string
Environment type of the compute fleet.
fleetServiceRole string
The service role associated with the compute fleet.
id string
ARN of the Fleet.
imageId string
The Amazon Machine Image (AMI) of the compute fleet.
lastModified string
Last modification time of the fleet.
name string
overflowBehavior string
Overflow behavior for compute fleet.
scalingConfigurations GetFleetScalingConfiguration[]
Nested attribute containing information about the scaling configuration.
statuses GetFleetStatus[]
Nested attribute containing information about the current status of the fleet.
tags {[key: string]: string}
Mapping of Key-Value tags for the resource.
vpcConfigs GetFleetVpcConfig[]
Nested attribute containing information about the VPC configuration.
arn str
ARN of the Fleet.
base_capacity int
Number of machines allocated to the fleet.
compute_configurations Sequence[GetFleetComputeConfiguration]
Compute configuration of the compute fleet.
compute_type str
Compute resources the compute fleet uses.
created str
Creation time of the fleet.
environment_type str
Environment type of the compute fleet.
fleet_service_role str
The service role associated with the compute fleet.
id str
ARN of the Fleet.
image_id str
The Amazon Machine Image (AMI) of the compute fleet.
last_modified str
Last modification time of the fleet.
name str
overflow_behavior str
Overflow behavior for compute fleet.
scaling_configurations Sequence[GetFleetScalingConfiguration]
Nested attribute containing information about the scaling configuration.
statuses Sequence[GetFleetStatus]
Nested attribute containing information about the current status of the fleet.
tags Mapping[str, str]
Mapping of Key-Value tags for the resource.
vpc_configs Sequence[GetFleetVpcConfig]
Nested attribute containing information about the VPC configuration.
arn String
ARN of the Fleet.
baseCapacity Number
Number of machines allocated to the fleet.
computeConfigurations List<Property Map>
Compute configuration of the compute fleet.
computeType String
Compute resources the compute fleet uses.
created String
Creation time of the fleet.
environmentType String
Environment type of the compute fleet.
fleetServiceRole String
The service role associated with the compute fleet.
id String
ARN of the Fleet.
imageId String
The Amazon Machine Image (AMI) of the compute fleet.
lastModified String
Last modification time of the fleet.
name String
overflowBehavior String
Overflow behavior for compute fleet.
scalingConfigurations List<Property Map>
Nested attribute containing information about the scaling configuration.
statuses List<Property Map>
Nested attribute containing information about the current status of the fleet.
tags Map<String>
Mapping of Key-Value tags for the resource.
vpcConfigs List<Property Map>
Nested attribute containing information about the VPC configuration.

Supporting Types

GetFleetComputeConfiguration

Disk This property is required. int
Amount of disk space of the instance type included in the fleet.
MachineType This property is required. string
Machine type of the instance type included in the fleet.
Memory This property is required. int
Amount of memory of the instance type included in the fleet.
Vcpu This property is required. int
Number of vCPUs of the instance type included in the fleet.
Disk This property is required. int
Amount of disk space of the instance type included in the fleet.
MachineType This property is required. string
Machine type of the instance type included in the fleet.
Memory This property is required. int
Amount of memory of the instance type included in the fleet.
Vcpu This property is required. int
Number of vCPUs of the instance type included in the fleet.
disk This property is required. Integer
Amount of disk space of the instance type included in the fleet.
machineType This property is required. String
Machine type of the instance type included in the fleet.
memory This property is required. Integer
Amount of memory of the instance type included in the fleet.
vcpu This property is required. Integer
Number of vCPUs of the instance type included in the fleet.
disk This property is required. number
Amount of disk space of the instance type included in the fleet.
machineType This property is required. string
Machine type of the instance type included in the fleet.
memory This property is required. number
Amount of memory of the instance type included in the fleet.
vcpu This property is required. number
Number of vCPUs of the instance type included in the fleet.
disk This property is required. int
Amount of disk space of the instance type included in the fleet.
machine_type This property is required. str
Machine type of the instance type included in the fleet.
memory This property is required. int
Amount of memory of the instance type included in the fleet.
vcpu This property is required. int
Number of vCPUs of the instance type included in the fleet.
disk This property is required. Number
Amount of disk space of the instance type included in the fleet.
machineType This property is required. String
Machine type of the instance type included in the fleet.
memory This property is required. Number
Amount of memory of the instance type included in the fleet.
vcpu This property is required. Number
Number of vCPUs of the instance type included in the fleet.

GetFleetScalingConfiguration

DesiredCapacity This property is required. int
The desired number of instances in the fleet when auto-scaling.
MaxCapacity This property is required. int
The maximum number of instances in the fleet when auto-scaling.
ScalingType This property is required. string
The scaling type for a compute fleet.
TargetTrackingScalingConfigs This property is required. List<GetFleetScalingConfigurationTargetTrackingScalingConfig>
Nested attribute containing information about thresholds when new instance is auto-scaled into the compute fleet.
DesiredCapacity This property is required. int
The desired number of instances in the fleet when auto-scaling.
MaxCapacity This property is required. int
The maximum number of instances in the fleet when auto-scaling.
ScalingType This property is required. string
The scaling type for a compute fleet.
TargetTrackingScalingConfigs This property is required. []GetFleetScalingConfigurationTargetTrackingScalingConfig
Nested attribute containing information about thresholds when new instance is auto-scaled into the compute fleet.
desiredCapacity This property is required. Integer
The desired number of instances in the fleet when auto-scaling.
maxCapacity This property is required. Integer
The maximum number of instances in the fleet when auto-scaling.
scalingType This property is required. String
The scaling type for a compute fleet.
targetTrackingScalingConfigs This property is required. List<GetFleetScalingConfigurationTargetTrackingScalingConfig>
Nested attribute containing information about thresholds when new instance is auto-scaled into the compute fleet.
desiredCapacity This property is required. number
The desired number of instances in the fleet when auto-scaling.
maxCapacity This property is required. number
The maximum number of instances in the fleet when auto-scaling.
scalingType This property is required. string
The scaling type for a compute fleet.
targetTrackingScalingConfigs This property is required. GetFleetScalingConfigurationTargetTrackingScalingConfig[]
Nested attribute containing information about thresholds when new instance is auto-scaled into the compute fleet.
desired_capacity This property is required. int
The desired number of instances in the fleet when auto-scaling.
max_capacity This property is required. int
The maximum number of instances in the fleet when auto-scaling.
scaling_type This property is required. str
The scaling type for a compute fleet.
target_tracking_scaling_configs This property is required. Sequence[GetFleetScalingConfigurationTargetTrackingScalingConfig]
Nested attribute containing information about thresholds when new instance is auto-scaled into the compute fleet.
desiredCapacity This property is required. Number
The desired number of instances in the fleet when auto-scaling.
maxCapacity This property is required. Number
The maximum number of instances in the fleet when auto-scaling.
scalingType This property is required. String
The scaling type for a compute fleet.
targetTrackingScalingConfigs This property is required. List<Property Map>
Nested attribute containing information about thresholds when new instance is auto-scaled into the compute fleet.

GetFleetScalingConfigurationTargetTrackingScalingConfig

MetricType This property is required. string
The metric type to determine auto-scaling.
TargetValue This property is required. double
The value of metric_type when to start scaling.
MetricType This property is required. string
The metric type to determine auto-scaling.
TargetValue This property is required. float64
The value of metric_type when to start scaling.
metricType This property is required. String
The metric type to determine auto-scaling.
targetValue This property is required. Double
The value of metric_type when to start scaling.
metricType This property is required. string
The metric type to determine auto-scaling.
targetValue This property is required. number
The value of metric_type when to start scaling.
metric_type This property is required. str
The metric type to determine auto-scaling.
target_value This property is required. float
The value of metric_type when to start scaling.
metricType This property is required. String
The metric type to determine auto-scaling.
targetValue This property is required. Number
The value of metric_type when to start scaling.

GetFleetStatus

Context This property is required. string
Additional information about a compute fleet.
Message This property is required. string
Message associated with the status of a compute fleet.
StatusCode This property is required. string
Status code of the compute fleet.
Context This property is required. string
Additional information about a compute fleet.
Message This property is required. string
Message associated with the status of a compute fleet.
StatusCode This property is required. string
Status code of the compute fleet.
context This property is required. String
Additional information about a compute fleet.
message This property is required. String
Message associated with the status of a compute fleet.
statusCode This property is required. String
Status code of the compute fleet.
context This property is required. string
Additional information about a compute fleet.
message This property is required. string
Message associated with the status of a compute fleet.
statusCode This property is required. string
Status code of the compute fleet.
context This property is required. str
Additional information about a compute fleet.
message This property is required. str
Message associated with the status of a compute fleet.
status_code This property is required. str
Status code of the compute fleet.
context This property is required. String
Additional information about a compute fleet.
message This property is required. String
Message associated with the status of a compute fleet.
statusCode This property is required. String
Status code of the compute fleet.

GetFleetVpcConfig

SecurityGroupIds This property is required. List<string>
A list of one or more security groups IDs in your Amazon VPC.
Subnets This property is required. List<string>
A list of one or more subnet IDs in your Amazon VPC.
VpcId This property is required. string
The ID of the Amazon VPC.
SecurityGroupIds This property is required. []string
A list of one or more security groups IDs in your Amazon VPC.
Subnets This property is required. []string
A list of one or more subnet IDs in your Amazon VPC.
VpcId This property is required. string
The ID of the Amazon VPC.
securityGroupIds This property is required. List<String>
A list of one or more security groups IDs in your Amazon VPC.
subnets This property is required. List<String>
A list of one or more subnet IDs in your Amazon VPC.
vpcId This property is required. String
The ID of the Amazon VPC.
securityGroupIds This property is required. string[]
A list of one or more security groups IDs in your Amazon VPC.
subnets This property is required. string[]
A list of one or more subnet IDs in your Amazon VPC.
vpcId This property is required. string
The ID of the Amazon VPC.
security_group_ids This property is required. Sequence[str]
A list of one or more security groups IDs in your Amazon VPC.
subnets This property is required. Sequence[str]
A list of one or more subnet IDs in your Amazon VPC.
vpc_id This property is required. str
The ID of the Amazon VPC.
securityGroupIds This property is required. List<String>
A list of one or more security groups IDs in your Amazon VPC.
subnets This property is required. List<String>
A list of one or more subnet IDs in your Amazon VPC.
vpcId This property is required. String
The ID of the Amazon VPC.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi