FleetProps Struct
Construction properties of a CodeBuild Fleet.
Example
import { Size } from 'aws-cdk-lib';
const fleet = new codebuild.Fleet(this, 'MyFleet', {
baseCapacity: 1,
computeType: codebuild.FleetComputeType.CUSTOM_INSTANCE_TYPE,
environmentType: codebuild.EnvironmentType.LINUX_CONTAINER,
computeConfiguration: {
instanceType: ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.MEDIUM),
// By default, 64 GiB of disk space is included. Any value optionally
// specified here is _incremental_ on top of the included disk space.
disk: Size.gibibytes(10),
},
});
Properties
baseCapacitynumberbase_capacityint | floatbaseCapacityNumberBaseCapacitydoubleBaseCapacity*float64required#Minimum value of 1.
computeConfigurationoptionalComputeConfigurationcompute_configurationoptionalComputeConfigurationcomputeConfigurationoptionalComputeConfigurationComputeConfigurationoptionalComputeConfigurationComputeConfigurationoptionalComputeConfiguration#Default: do not specify compute configuration
This is only permitted if computeType is set to ATTRIBUTE_BASED or CUSTOM_INSTANCE_TYPE. In such cases, this is required.
computeTypeFleetComputeTypecompute_typeFleetComputeTypecomputeTypeFleetComputeTypeComputeTypeFleetComputeTypeComputeTypeFleetComputeTyperequired#environmentTypeEnvironmentTypeenvironment_typeEnvironmentTypeenvironmentTypeEnvironmentTypeEnvironmentTypeEnvironmentTypeEnvironmentTypeEnvironmentTyperequired#fleetNameoptionalstringfleet_nameoptionalstrfleetNameoptionalStringFleetNameoptionalstringFleetNameoptional*string#Default: CloudFormation generated name
overflowBehavioroptionalFleetOverflowBehavioroverflow_behavioroptionalFleetOverflowBehavioroverflowBehavioroptionalFleetOverflowBehaviorOverflowBehavioroptionalFleetOverflowBehaviorOverflowBehavioroptionalFleetOverflowBehavior#Default: undefined - AWS CodeBuild default behavior is QUEUE
For overflow behavior QUEUE, overflow builds need to wait on the existing fleet instances to become available.
For overflow behavior ON_DEMAND, overflow builds run on CodeBuild on-demand.
Default: A role will be created if any permissions are granted
This Role is not used by Project builds running on Fleet instances; Project builds assume the role on Project instead.
securityGroupsoptionalISecurityGroup[]security_groupsoptionaltyping.List[ISecurityGroup]securityGroupsoptionalList<ISecurityGroup>SecurityGroupsoptionalISecurityGroup[]SecurityGroupsoptional*[]ISecurityGroup#Default: A security group will be automatically created.
Only used if vpc is supplied.
subnetSelectionoptionalSubnetSelectionsubnet_selectionoptionalSubnetSelectionsubnetSelectionoptionalSubnetSelectionSubnetSelectionoptionalSubnetSelectionSubnetSelectionoptionalSubnetSelection#Default: private subnets if available else public subnets
notes
To access AWS services, your fleet needs to be in one of the following types of subnets:
- Subnets with access to the internet (of type PRIVATE_WITH_EGRESS).
- Private subnets unconnected to the internet, but with VPC endpoints for the necessary services.
If you don't specify a subnet selection, the default behavior is to use PRIVATE_WITH_EGRESS subnets first if they exist, then PRIVATE_WITHOUT_EGRESS, and finally PUBLIC subnets. If your VPC doesn't have PRIVATE_WITH_EGRESS subnets but you need AWS service access, add VPC Endpoints to your private subnets.