Class CapacityProvider.Builder

java.lang.Object
software.amazon.awscdk.services.lambda.CapacityProvider.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<CapacityProvider>
Enclosing class:
CapacityProvider

@Stability(Stable) public static final class CapacityProvider.Builder extends Object implements software.amazon.jsii.Builder<CapacityProvider>
A fluent builder for CapacityProvider.
  • Method Details

    • create

      @Stability(Stable) public static CapacityProvider.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope - The parent construct. This parameter is required.
      id - The construct ID. This parameter is required.
      Returns:
      a new instance of CapacityProvider.Builder.
    • securityGroups

      @Stability(Stable) public CapacityProvider.Builder securityGroups(List<? extends ISecurityGroup> securityGroups)
      A list of security group IDs to associate with EC2 instances launched by the capacity provider.

      Up to 5 security groups can be specified.

      Parameters:
      securityGroups - A list of security group IDs to associate with EC2 instances launched by the capacity provider. This parameter is required.
      Returns:
      this
    • subnets

      @Stability(Stable) public CapacityProvider.Builder subnets(List<? extends ISubnet> subnets)
      A list of subnets where the capacity provider can launch EC2 instances.

      At least one subnet must be specified, and up to 16 subnets are supported.

      Parameters:
      subnets - A list of subnets where the capacity provider can launch EC2 instances. This parameter is required.
      Returns:
      this
    • architectures

      @Stability(Stable) public CapacityProvider.Builder architectures(List<? extends Architecture> architectures)
      The instruction set architecture required for compute instances.

      Only one architecture can be specified per capacity provider.

      Default: - No architecture constraints specified

      Parameters:
      architectures - The instruction set architecture required for compute instances. This parameter is required.
      Returns:
      this
    • capacityProviderName

      @Stability(Stable) public CapacityProvider.Builder capacityProviderName(String capacityProviderName)
      The name of the capacity provider.

      The name must be unique within the AWS account and region.

      Default: - AWS CloudFormation generates a unique physical ID and uses that ID for the capacity provider's name.

      Parameters:
      capacityProviderName - The name of the capacity provider. This parameter is required.
      Returns:
      this
    • instanceTypeFilter

      @Stability(Stable) public CapacityProvider.Builder instanceTypeFilter(InstanceTypeFilter instanceTypeFilter)
      Configuration for filtering instance types that the capacity provider can use.

      Default: - No instance type filtering applied

      Parameters:
      instanceTypeFilter - Configuration for filtering instance types that the capacity provider can use. This parameter is required.
      Returns:
      this
    • kmsKey

      @Stability(Stable) public CapacityProvider.Builder kmsKey(IKey kmsKey)
      The AWS Key Management Service (KMS) key used to encrypt data associated with the capacity provider.

      Default: - No KMS key specified, uses an AWS-managed key instead

      Parameters:
      kmsKey - The AWS Key Management Service (KMS) key used to encrypt data associated with the capacity provider. This parameter is required.
      Returns:
      this
    • maxVCpuCount

      @Stability(Stable) public CapacityProvider.Builder maxVCpuCount(Number maxVCpuCount)
      The maximum number of vCPUs that the capacity provider can scale up to.

      Default: - No maximum limit specified, service default is 400

      Parameters:
      maxVCpuCount - The maximum number of vCPUs that the capacity provider can scale up to. This parameter is required.
      Returns:
      this
    • operatorRole

      @Stability(Stable) public CapacityProvider.Builder operatorRole(IRole operatorRole)
      The IAM role that the Lambda service assumes to manage the capacity provider.

      Default: - A role will be generated containing the AWSLambdaManagedEC2ResourceOperator managed policy

      Parameters:
      operatorRole - The IAM role that the Lambda service assumes to manage the capacity provider. This parameter is required.
      Returns:
      this
    • scalingOptions

      @Stability(Stable) public CapacityProvider.Builder scalingOptions(ScalingOptions scalingOptions)
      The options for scaling a capacity provider, including scaling policies.

      Default: - The `Auto` option is applied by default

      Parameters:
      scalingOptions - The options for scaling a capacity provider, including scaling policies. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public CapacityProvider build()
      Specified by:
      build in interface software.amazon.jsii.Builder<CapacityProvider>
      Returns:
      a newly built instance of CapacityProvider.