Class FleetProps.Builder
java.lang.Object
software.amazon.awscdk.services.codebuild.FleetProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<FleetProps>
- Enclosing interface:
FleetProps
@Stability(Stable)
public static final class FleetProps.Builder
extends Object
implements software.amazon.jsii.Builder<FleetProps>
A builder for
FleetProps-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbaseCapacity(Number baseCapacity) Sets the value ofFleetProps.getBaseCapacity()build()Builds the configured instance.computeConfiguration(ComputeConfiguration computeConfiguration) Sets the value ofFleetProps.getComputeConfiguration()computeType(FleetComputeType computeType) Sets the value ofFleetProps.getComputeType()environmentType(EnvironmentType environmentType) Sets the value ofFleetProps.getEnvironmentType()Sets the value ofFleetProps.getFleetName()overflowBehavior(FleetOverflowBehavior overflowBehavior) Sets the value ofFleetProps.getOverflowBehavior()Sets the value ofFleetProps.getRole()securityGroups(List<? extends ISecurityGroup> securityGroups) Sets the value ofFleetProps.getSecurityGroups()subnetSelection(SubnetSelection subnetSelection) Sets the value ofFleetProps.getSubnetSelection()Sets the value ofFleetProps.getVpc()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
baseCapacity
Sets the value ofFleetProps.getBaseCapacity()- Parameters:
baseCapacity- The number of machines allocated to the compute fleet. Defines the number of builds that can run in parallel. This parameter is required. Minimum value of 1.- Returns:
this
-
computeType
Sets the value ofFleetProps.getComputeType()- Parameters:
computeType- The instance type of the compute fleet. This parameter is required.- Returns:
this
-
environmentType
Sets the value ofFleetProps.getEnvironmentType()- Parameters:
environmentType- The build environment (operating system/architecture/accelerator) type made available to projects using this fleet. This parameter is required.- Returns:
this
-
computeConfiguration
@Stability(Stable) public FleetProps.Builder computeConfiguration(ComputeConfiguration computeConfiguration) Sets the value ofFleetProps.getComputeConfiguration()- Parameters:
computeConfiguration- The compute configuration of the compute fleet. This is only permitted ifcomputeTypeis set to ATTRIBUTE_BASED or CUSTOM_INSTANCE_TYPE. In such cases, this is required.- Returns:
this
-
fleetName
Sets the value ofFleetProps.getFleetName()- Parameters:
fleetName- The name of the Fleet.- Returns:
this
-
overflowBehavior
@Stability(Stable) public FleetProps.Builder overflowBehavior(FleetOverflowBehavior overflowBehavior) Sets the value ofFleetProps.getOverflowBehavior()- Parameters:
overflowBehavior- The compute fleet overflow behavior. For overflow behaviorQUEUE, 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.- Returns:
this
-
role
Sets the value ofFleetProps.getRole()- Parameters:
role- Service Role assumed by Fleet instances. This Role is not used by Project builds running on Fleet instances; Project builds assume theroleon Project instead.- Returns:
this
-
securityGroups
@Stability(Stable) public FleetProps.Builder securityGroups(List<? extends ISecurityGroup> securityGroups) Sets the value ofFleetProps.getSecurityGroups()- Parameters:
securityGroups- What security groups to associate with the fleet's network interfaces. If none are provided, one will be created automatically. Only used ifvpcis supplied.- Returns:
this
-
subnetSelection
Sets the value ofFleetProps.getSubnetSelection()- Parameters:
subnetSelection- Where to place the network interfaces within the VPC. 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.
- Returns:
this
-
vpc
Sets the value ofFleetProps.getVpc()- Parameters:
vpc- VPC network to place fleet instance network interfaces. Specify this if the fleet needs to access resources in a VPC.- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<FleetProps>- Returns:
- a new instance of
FleetProps - Throws:
NullPointerException- if any required attribute was not provided
-