Interface CapacityProviderProps

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
CapacityProviderProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.125.0 (build fdbe357)", date="2026-01-15T15:35:00.366Z") @Stability(Stable) public interface CapacityProviderProps extends software.amazon.jsii.JsiiSerializable
Properties for creating a Lambda capacity provider.

Example:

 import software.amazon.awscdk.services.ec2.*;
 Vpc vpc = new Vpc(this, "MyVpc");
 SecurityGroup securityGroup = SecurityGroup.Builder.create(this, "SecurityGroup").vpc(vpc).build();
 CapacityProvider capacityProvider = CapacityProvider.Builder.create(this, "MyCapacityProvider")
         .subnets(vpc.getPrivateSubnets())
         .securityGroups(List.of(securityGroup))
         .scalingOptions(ScalingOptions.manual(List.of(TargetTrackingScalingPolicy.cpuUtilization(70))))
         .build();
 
  • Method Details

    • getSecurityGroups

      @Stability(Stable) @NotNull List<ISecurityGroup> getSecurityGroups()
      A list of security group IDs to associate with EC2 instances launched by the capacity provider.

      Up to 5 security groups can be specified.

    • getSubnets

      @Stability(Stable) @NotNull List<ISubnet> getSubnets()
      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.

    • getArchitectures

      @Stability(Stable) @Nullable default List<Architecture> getArchitectures()
      The instruction set architecture required for compute instances.

      Only one architecture can be specified per capacity provider.

      Default: - No architecture constraints specified

    • getCapacityProviderName

      @Stability(Stable) @Nullable default String getCapacityProviderName()
      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.

    • getInstanceTypeFilter

      @Stability(Stable) @Nullable default InstanceTypeFilter getInstanceTypeFilter()
      Configuration for filtering instance types that the capacity provider can use.

      Default: - No instance type filtering applied

    • getKmsKey

      @Stability(Stable) @Nullable default IKey getKmsKey()
      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

    • getMaxVCpuCount

      @Stability(Stable) @Nullable default Number getMaxVCpuCount()
      The maximum number of vCPUs that the capacity provider can scale up to.

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

    • getOperatorRole

      @Stability(Stable) @Nullable default IRole getOperatorRole()
      The IAM role that the Lambda service assumes to manage the capacity provider.

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

    • getScalingOptions

      @Stability(Stable) @Nullable default ScalingOptions getScalingOptions()
      The options for scaling a capacity provider, including scaling policies.

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

    • builder

      @Stability(Stable) static CapacityProviderProps.Builder builder()
      Returns:
      a CapacityProviderProps.Builder of CapacityProviderProps