AWS v6.77.1 published on Friday, Apr 18, 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.
 - Base
Capacity int - Number of machines allocated to the fleet.
 - Compute
Configurations List<GetFleet Compute Configuration>  - Compute configuration of the compute fleet.
 - Compute
Type string - Compute resources the compute fleet uses.
 - Created string
 - Creation time of the fleet.
 - Environment
Type string - Environment type of the compute fleet.
 - Fleet
Service stringRole  - The service role associated with the compute fleet.
 - Id string
 - ARN of the Fleet.
 - Image
Id string - The Amazon Machine Image (AMI) of the compute fleet.
 - Last
Modified string - Last modification time of the fleet.
 - Name string
 - Overflow
Behavior string - Overflow behavior for compute fleet.
 - Scaling
Configurations List<GetFleet Scaling Configuration>  - Nested attribute containing information about the scaling configuration.
 - Statuses
List<Get
Fleet Status>  - Nested attribute containing information about the current status of the fleet.
 - Dictionary<string, string>
 - Mapping of Key-Value tags for the resource.
 - Vpc
Configs List<GetFleet Vpc Config>  - Nested attribute containing information about the VPC configuration.
 
- Arn string
 - ARN of the Fleet.
 - Base
Capacity int - Number of machines allocated to the fleet.
 - Compute
Configurations []GetFleet Compute Configuration  - Compute configuration of the compute fleet.
 - Compute
Type string - Compute resources the compute fleet uses.
 - Created string
 - Creation time of the fleet.
 - Environment
Type string - Environment type of the compute fleet.
 - Fleet
Service stringRole  - The service role associated with the compute fleet.
 - Id string
 - ARN of the Fleet.
 - Image
Id string - The Amazon Machine Image (AMI) of the compute fleet.
 - Last
Modified string - Last modification time of the fleet.
 - Name string
 - Overflow
Behavior string - Overflow behavior for compute fleet.
 - Scaling
Configurations []GetFleet Scaling Configuration  - Nested attribute containing information about the scaling configuration.
 - Statuses
[]Get
Fleet Status  - Nested attribute containing information about the current status of the fleet.
 - map[string]string
 - Mapping of Key-Value tags for the resource.
 - Vpc
Configs []GetFleet Vpc Config  - Nested attribute containing information about the VPC configuration.
 
- arn String
 - ARN of the Fleet.
 - base
Capacity Integer - Number of machines allocated to the fleet.
 - compute
Configurations List<GetFleet Compute Configuration>  - Compute configuration of the compute fleet.
 - compute
Type String - Compute resources the compute fleet uses.
 - created String
 - Creation time of the fleet.
 - environment
Type String - Environment type of the compute fleet.
 - fleet
Service StringRole  - The service role associated with the compute fleet.
 - id String
 - ARN of the Fleet.
 - image
Id String - The Amazon Machine Image (AMI) of the compute fleet.
 - last
Modified String - Last modification time of the fleet.
 - name String
 - overflow
Behavior String - Overflow behavior for compute fleet.
 - scaling
Configurations List<GetFleet Scaling Configuration>  - Nested attribute containing information about the scaling configuration.
 - statuses
List<Get
Fleet Status>  - Nested attribute containing information about the current status of the fleet.
 - Map<String,String>
 - Mapping of Key-Value tags for the resource.
 - vpc
Configs List<GetFleet Vpc Config>  - Nested attribute containing information about the VPC configuration.
 
- arn string
 - ARN of the Fleet.
 - base
Capacity number - Number of machines allocated to the fleet.
 - compute
Configurations GetFleet Compute Configuration[]  - Compute configuration of the compute fleet.
 - compute
Type string - Compute resources the compute fleet uses.
 - created string
 - Creation time of the fleet.
 - environment
Type string - Environment type of the compute fleet.
 - fleet
Service stringRole  - The service role associated with the compute fleet.
 - id string
 - ARN of the Fleet.
 - image
Id string - The Amazon Machine Image (AMI) of the compute fleet.
 - last
Modified string - Last modification time of the fleet.
 - name string
 - overflow
Behavior string - Overflow behavior for compute fleet.
 - scaling
Configurations GetFleet Scaling Configuration[]  - Nested attribute containing information about the scaling configuration.
 - statuses
Get
Fleet Status[]  - Nested attribute containing information about the current status of the fleet.
 - {[key: string]: string}
 - Mapping of Key-Value tags for the resource.
 - vpc
Configs 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[Get
Fleet 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.
 - base
Capacity Number - Number of machines allocated to the fleet.
 - compute
Configurations List<Property Map> - Compute configuration of the compute fleet.
 - compute
Type String - Compute resources the compute fleet uses.
 - created String
 - Creation time of the fleet.
 - environment
Type String - Environment type of the compute fleet.
 - fleet
Service StringRole  - The service role associated with the compute fleet.
 - id String
 - ARN of the Fleet.
 - image
Id String - The Amazon Machine Image (AMI) of the compute fleet.
 - last
Modified String - Last modification time of the fleet.
 - name String
 - overflow
Behavior String - Overflow behavior for compute fleet.
 - scaling
Configurations 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.
 - vpc
Configs 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.
 - Machine
Type 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.
 - Machine
Type 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.
 - machine
Type 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.
 - machine
Type 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.
 - machine
Type 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   
- 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 string - The scaling type for a compute fleet.
 - Target
Tracking 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.
 
- 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 string - The scaling type for a compute fleet.
 - Target
Tracking []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 Integer - The desired number of instances in the fleet when auto-scaling.
 - max
Capacity Integer - The maximum number of instances in the fleet when auto-scaling.
 - scaling
Type String - The scaling type for a compute fleet.
 - target
Tracking 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.
 
- desired
Capacity number - The desired number of instances in the fleet when auto-scaling.
 - max
Capacity number - The maximum number of instances in the fleet when auto-scaling.
 - scaling
Type string - The scaling type for a compute fleet.
 - target
Tracking 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.
 
- desired
Capacity Number - The desired number of instances in the fleet when auto-scaling.
 - max
Capacity Number - The maximum number of instances in the fleet when auto-scaling.
 - scaling
Type String - The scaling type for a compute fleet.
 - target
Tracking List<Property Map>Scaling Configs  - Nested attribute containing information about thresholds when new instance is auto-scaled into the compute fleet.
 
GetFleetScalingConfigurationTargetTrackingScalingConfig       
- Metric
Type string - The metric type to determine auto-scaling.
 - Target
Value double - The value of metric_type when to start scaling.
 
- Metric
Type string - The metric type to determine auto-scaling.
 - Target
Value float64 - The value of metric_type when to start scaling.
 
- metric
Type String - The metric type to determine auto-scaling.
 - target
Value Double - The value of metric_type when to start scaling.
 
- metric
Type string - The metric type to determine auto-scaling.
 - target
Value 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.
 
- metric
Type String - The metric type to determine auto-scaling.
 - target
Value 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.
 - Status
Code 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.
 - Status
Code 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.
 - status
Code 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.
 - status
Code 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.
 - status
Code String - Status code of the compute fleet.
 
GetFleetVpcConfig   
- Security
Group 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.
 - Vpc
Id string - The ID of the Amazon VPC.
 
- Security
Group []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.
 - Vpc
Id string - The ID of the Amazon VPC.
 
- security
Group 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.
 - vpc
Id String - The ID of the Amazon VPC.
 
- security
Group 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.
 - vpc
Id 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.
 
- security
Group 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.
 - vpc
Id 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.