AWS v6.71.0 published on Friday, Mar 7, 2025 by Pulumi
aws.codebuild.getFleet
Explore with Pulumi AI
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,
});
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)
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
	})
}
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,
    });
});
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());
    }
}
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}
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = aws.codebuild.getFleet({
    name: "my-codebuild-fleet-name",
});
import pulumi
import pulumi_aws as aws
example = aws.codebuild.get_fleet(name="my-codebuild-fleet-name")
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
	})
}
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",
    });
});
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());
    }
}
variables:
  example:
    fn::invoke:
      function: aws:codebuild:getFleet
      arguments:
        name: my-codebuild-fleet-name
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>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]func LookupFleet(ctx *Context, args *LookupFleetArgs, opts ...InvokeOption) (*LookupFleetResult, error)
func LookupFleetOutput(ctx *Context, args *LookupFleetOutputArgs, opts ...InvokeOption) LookupFleetResultOutput> 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)
}public static CompletableFuture<GetFleetResult> getFleet(GetFleetArgs args, InvokeOptions options)
public static Output<GetFleetResult> getFleet(GetFleetArgs args, InvokeOptions options)
fn::invoke:
  function: aws:codebuild/getFleet:getFleet
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Name string
- Fleet name.
- Dictionary<string, string>
- Mapping of Key-Value tags for the resource.
- Name string
- Fleet name.
- map[string]string
- Mapping of Key-Value tags for the resource.
- name String
- Fleet name.
- Map<String,String>
- Mapping of Key-Value tags for the resource.
- name string
- Fleet name.
- {[key: string]: string}
- Mapping of Key-Value tags for the resource.
- name str
- Fleet name.
- Mapping[str, str]
- Mapping of Key-Value tags for the resource.
- name String
- Fleet name.
- 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<GetFleet Compute Configuration> 
- 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.
- FleetService stringRole 
- 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<GetFleet Scaling Configuration> 
- Nested attribute containing information about the scaling configuration.
- Statuses
List<GetFleet Status> 
- Nested attribute containing information about the current status of the fleet.
- Dictionary<string, string>
- Mapping of Key-Value tags for the resource.
- VpcConfigs List<GetFleet Vpc Config> 
- Nested attribute containing information about the VPC configuration.
- Arn string
- ARN of the Fleet.
- BaseCapacity int
- Number of machines allocated to the fleet.
- ComputeConfigurations []GetFleet Compute Configuration 
- 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.
- FleetService stringRole 
- 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 []GetFleet Scaling Configuration 
- Nested attribute containing information about the scaling configuration.
- Statuses
[]GetFleet Status 
- Nested attribute containing information about the current status of the fleet.
- map[string]string
- Mapping of Key-Value tags for the resource.
- VpcConfigs []GetFleet Vpc Config 
- 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<GetFleet Compute Configuration> 
- 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.
- fleetService StringRole 
- 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<GetFleet Scaling Configuration> 
- Nested attribute containing information about the scaling configuration.
- statuses
List<GetFleet Status> 
- Nested attribute containing information about the current status of the fleet.
- Map<String,String>
- Mapping of Key-Value tags for the resource.
- vpcConfigs List<GetFleet Vpc Config> 
- Nested attribute containing information about the VPC configuration.
- arn string
- ARN of the Fleet.
- baseCapacity number
- Number of machines allocated to the fleet.
- computeConfigurations GetFleet Compute Configuration[] 
- 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.
- fleetService stringRole 
- 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 GetFleet Scaling Configuration[] 
- Nested attribute containing information about the scaling configuration.
- statuses
GetFleet Status[] 
- Nested attribute containing information about the current status of the fleet.
- {[key: string]: string}
- Mapping of Key-Value tags for the resource.
- vpcConfigs GetFleet Vpc Config[] 
- 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[GetFleet Compute Configuration] 
- 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_ strrole 
- 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[GetFleet Scaling Configuration] 
- Nested attribute containing information about the scaling configuration.
- statuses
Sequence[GetFleet Status] 
- Nested attribute containing information about the current status of the fleet.
- Mapping[str, str]
- Mapping of Key-Value tags for the resource.
- vpc_configs Sequence[GetFleet Vpc Config] 
- 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.
- fleetService StringRole 
- 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.
- 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 int
- Amount of disk space of the instance type included in the fleet.
- MachineType string
- Machine type of the instance type included in the fleet.
- Memory int
- Amount of memory of the instance type included in the fleet.
- Vcpu int
- Number of vCPUs of the instance type included in the fleet.
- Disk int
- Amount of disk space of the instance type included in the fleet.
- MachineType string
- Machine type of the instance type included in the fleet.
- Memory int
- Amount of memory of the instance type included in the fleet.
- Vcpu int
- Number of vCPUs of the instance type included in the fleet.
- disk Integer
- Amount of disk space of the instance type included in the fleet.
- machineType String
- Machine type of the instance type included in the fleet.
- memory Integer
- Amount of memory of the instance type included in the fleet.
- vcpu Integer
- Number of vCPUs of the instance type included in the fleet.
- disk number
- Amount of disk space of the instance type included in the fleet.
- machineType string
- Machine type of the instance type included in the fleet.
- memory number
- Amount of memory of the instance type included in the fleet.
- vcpu number
- Number of vCPUs of the instance type included in the fleet.
- disk int
- Amount of disk space of the instance type included in the fleet.
- machine_type str
- Machine type of the instance type included in the fleet.
- memory int
- Amount of memory of the instance type included in the fleet.
- vcpu int
- Number of vCPUs of the instance type included in the fleet.
- disk Number
- Amount of disk space of the instance type included in the fleet.
- machineType String
- Machine type of the instance type included in the fleet.
- memory Number
- Amount of memory of the instance type included in the fleet.
- vcpu Number
- Number of vCPUs of the instance type included in the fleet.
GetFleetScalingConfiguration   
- DesiredCapacity int
- The desired number of instances in the fleet when auto-scaling.
- MaxCapacity int
- The maximum number of instances in the fleet when auto-scaling.
- ScalingType string
- The scaling type for a compute fleet.
- TargetTracking List<GetScaling Configs Fleet Scaling Configuration Target Tracking Scaling Config> 
- Nested attribute containing information about thresholds when new instance is auto-scaled into the compute fleet.
- DesiredCapacity int
- The desired number of instances in the fleet when auto-scaling.
- MaxCapacity int
- The maximum number of instances in the fleet when auto-scaling.
- ScalingType string
- The scaling type for a compute fleet.
- TargetTracking []GetScaling Configs Fleet Scaling Configuration Target Tracking Scaling Config 
- Nested attribute containing information about thresholds when new instance is auto-scaled into the compute fleet.
- desiredCapacity Integer
- The desired number of instances in the fleet when auto-scaling.
- maxCapacity Integer
- The maximum number of instances in the fleet when auto-scaling.
- scalingType String
- The scaling type for a compute fleet.
- targetTracking List<GetScaling Configs Fleet Scaling Configuration Target Tracking Scaling Config> 
- Nested attribute containing information about thresholds when new instance is auto-scaled into the compute fleet.
- desiredCapacity number
- The desired number of instances in the fleet when auto-scaling.
- maxCapacity number
- The maximum number of instances in the fleet when auto-scaling.
- scalingType string
- The scaling type for a compute fleet.
- targetTracking GetScaling Configs Fleet Scaling Configuration Target Tracking Scaling Config[] 
- Nested attribute containing information about thresholds when new instance is auto-scaled into the compute fleet.
- desired_capacity int
- The desired number of instances in the fleet when auto-scaling.
- max_capacity int
- The maximum number of instances in the fleet when auto-scaling.
- scaling_type str
- The scaling type for a compute fleet.
- target_tracking_ Sequence[Getscaling_ configs Fleet Scaling Configuration Target Tracking Scaling Config] 
- Nested attribute containing information about thresholds when new instance is auto-scaled into the compute fleet.
- desiredCapacity Number
- The desired number of instances in the fleet when auto-scaling.
- maxCapacity Number
- The maximum number of instances in the fleet when auto-scaling.
- scalingType String
- The scaling type for a compute fleet.
- targetTracking List<Property Map>Scaling Configs 
- Nested attribute containing information about thresholds when new instance is auto-scaled into the compute fleet.
GetFleetScalingConfigurationTargetTrackingScalingConfig       
- MetricType string
- The metric type to determine auto-scaling.
- TargetValue double
- The value of metric_type when to start scaling.
- MetricType string
- The metric type to determine auto-scaling.
- TargetValue float64
- The value of metric_type when to start scaling.
- metricType String
- The metric type to determine auto-scaling.
- targetValue Double
- The value of metric_type when to start scaling.
- metricType string
- The metric type to determine auto-scaling.
- targetValue number
- The value of metric_type when to start scaling.
- metric_type str
- The metric type to determine auto-scaling.
- target_value float
- The value of metric_type when to start scaling.
- metricType String
- The metric type to determine auto-scaling.
- targetValue Number
- The value of metric_type when to start scaling.
GetFleetStatus  
- Context string
- Additional information about a compute fleet.
- Message string
- Message associated with the status of a compute fleet.
- StatusCode string
- Status code of the compute fleet.
- Context string
- Additional information about a compute fleet.
- Message string
- Message associated with the status of a compute fleet.
- StatusCode string
- Status code of the compute fleet.
- context String
- Additional information about a compute fleet.
- message String
- Message associated with the status of a compute fleet.
- statusCode String
- Status code of the compute fleet.
- context string
- Additional information about a compute fleet.
- message string
- Message associated with the status of a compute fleet.
- statusCode string
- Status code of the compute fleet.
- context str
- Additional information about a compute fleet.
- message str
- Message associated with the status of a compute fleet.
- status_code str
- Status code of the compute fleet.
- context String
- Additional information about a compute fleet.
- message String
- Message associated with the status of a compute fleet.
- statusCode String
- Status code of the compute fleet.
GetFleetVpcConfig   
- SecurityGroup List<string>Ids 
- A list of one or more security groups IDs in your Amazon VPC.
- Subnets List<string>
- A list of one or more subnet IDs in your Amazon VPC.
- VpcId string
- The ID of the Amazon VPC.
- SecurityGroup []stringIds 
- A list of one or more security groups IDs in your Amazon VPC.
- Subnets []string
- A list of one or more subnet IDs in your Amazon VPC.
- VpcId string
- The ID of the Amazon VPC.
- securityGroup List<String>Ids 
- A list of one or more security groups IDs in your Amazon VPC.
- subnets List<String>
- A list of one or more subnet IDs in your Amazon VPC.
- vpcId String
- The ID of the Amazon VPC.
- securityGroup string[]Ids 
- A list of one or more security groups IDs in your Amazon VPC.
- subnets string[]
- A list of one or more subnet IDs in your Amazon VPC.
- vpcId string
- The ID of the Amazon VPC.
- security_group_ Sequence[str]ids 
- A list of one or more security groups IDs in your Amazon VPC.
- subnets Sequence[str]
- A list of one or more subnet IDs in your Amazon VPC.
- vpc_id str
- The ID of the Amazon VPC.
- securityGroup List<String>Ids 
- A list of one or more security groups IDs in your Amazon VPC.
- subnets List<String>
- A list of one or more subnet IDs in your Amazon VPC.
- vpcId 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 awsTerraform Provider.