Class CfnCapacityProvider

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, IEnvironmentAware, ICapacityProviderRef, ITaggableV2, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)", date="2025-12-01T16:02:23.532Z") @Stability(Stable) public class CfnCapacityProvider extends CfnResource implements IInspectable, ICapacityProviderRef, ITaggableV2
Resource Type definition for AWS::Lambda::CapacityProvider.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.lambda.*;
 CfnCapacityProvider cfnCapacityProvider = CfnCapacityProvider.Builder.create(this, "MyCfnCapacityProvider")
         .permissionsConfig(CapacityProviderPermissionsConfigProperty.builder()
                 .capacityProviderOperatorRoleArn("capacityProviderOperatorRoleArn")
                 .build())
         .vpcConfig(CapacityProviderVpcConfigProperty.builder()
                 .securityGroupIds(List.of("securityGroupIds"))
                 .subnetIds(List.of("subnetIds"))
                 .build())
         // the properties below are optional
         .capacityProviderName("capacityProviderName")
         .capacityProviderScalingConfig(CapacityProviderScalingConfigProperty.builder()
                 .maxVCpuCount(123)
                 .scalingMode("scalingMode")
                 .scalingPolicies(List.of(TargetTrackingScalingPolicyProperty.builder()
                         .predefinedMetricType("predefinedMetricType")
                         .targetValue(123)
                         .build()))
                 .build())
         .instanceRequirements(InstanceRequirementsProperty.builder()
                 .allowedInstanceTypes(List.of("allowedInstanceTypes"))
                 .architectures(List.of("architectures"))
                 .excludedInstanceTypes(List.of("excludedInstanceTypes"))
                 .build())
         .kmsKeyArn("kmsKeyArn")
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnCapacityProvider

      protected CfnCapacityProvider(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnCapacityProvider

      protected CfnCapacityProvider(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnCapacityProvider

      @Stability(Stable) public CfnCapacityProvider(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnCapacityProviderProps props)
      Create a new AWS::Lambda::CapacityProvider.

      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties. This parameter is required.
  • Method Details

    • arnForCapacityProvider

      @Stability(Stable) @NotNull public static String arnForCapacityProvider(@NotNull ICapacityProviderRef resource)
      Parameters:
      resource - This parameter is required.
    • isCfnCapacityProvider

      @Stability(Stable) @NotNull public static Boolean isCfnCapacityProvider(@NotNull Object x)
      Checks whether the given object is a CfnCapacityProvider.

      Parameters:
      x - This parameter is required.
    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      The Amazon Resource Name (ARN) of the capacity provider.

      This is a read-only property that is automatically generated when the capacity provider is created.

    • getAttrState

      @Stability(Stable) @NotNull public String getAttrState()
      The current state of the capacity provider.

      Indicates whether the provider is being created, is active and ready for use, has failed, or is being deleted.

    • getCapacityProviderRef

      @Stability(Stable) @NotNull public CapacityProviderReference getCapacityProviderRef()
      A reference to a CapacityProvider resource.
      Specified by:
      getCapacityProviderRef in interface ICapacityProviderRef
    • getCdkTagManager

      @Stability(Stable) @NotNull public TagManager getCdkTagManager()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getCdkTagManager in interface ITaggableV2
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getPermissionsConfig

      @Stability(Stable) @NotNull public Object getPermissionsConfig()
      IAM permissions configuration for the capacity provider.

      Returns union: either IResolvable or CfnCapacityProvider.CapacityProviderPermissionsConfigProperty

    • setPermissionsConfig

      @Stability(Stable) public void setPermissionsConfig(@NotNull IResolvable value)
      IAM permissions configuration for the capacity provider.
    • setPermissionsConfig

      @Stability(Stable) public void setPermissionsConfig(@NotNull CfnCapacityProvider.CapacityProviderPermissionsConfigProperty value)
      IAM permissions configuration for the capacity provider.
    • getVpcConfig

      @Stability(Stable) @NotNull public Object getVpcConfig()
      VPC configuration for the capacity provider.

      Returns union: either IResolvable or CfnCapacityProvider.CapacityProviderVpcConfigProperty

    • setVpcConfig

      @Stability(Stable) public void setVpcConfig(@NotNull IResolvable value)
      VPC configuration for the capacity provider.
    • setVpcConfig

      @Stability(Stable) public void setVpcConfig(@NotNull CfnCapacityProvider.CapacityProviderVpcConfigProperty value)
      VPC configuration for the capacity provider.
    • getCapacityProviderName

      @Stability(Stable) @Nullable public String getCapacityProviderName()
      The name of the capacity provider.
    • setCapacityProviderName

      @Stability(Stable) public void setCapacityProviderName(@Nullable String value)
      The name of the capacity provider.
    • getCapacityProviderScalingConfig

      @Stability(Stable) @Nullable public Object getCapacityProviderScalingConfig()
      The scaling configuration for the capacity provider.

      Returns union: either IResolvable or CfnCapacityProvider.CapacityProviderScalingConfigProperty

    • setCapacityProviderScalingConfig

      @Stability(Stable) public void setCapacityProviderScalingConfig(@Nullable IResolvable value)
      The scaling configuration for the capacity provider.
    • setCapacityProviderScalingConfig

      @Stability(Stable) public void setCapacityProviderScalingConfig(@Nullable CfnCapacityProvider.CapacityProviderScalingConfigProperty value)
      The scaling configuration for the capacity provider.
    • getInstanceRequirements

      @Stability(Stable) @Nullable public Object getInstanceRequirements()
      Specifications for the types of EC2 instances that the capacity provider can use.

      Returns union: either IResolvable or CfnCapacityProvider.InstanceRequirementsProperty

    • setInstanceRequirements

      @Stability(Stable) public void setInstanceRequirements(@Nullable IResolvable value)
      Specifications for the types of EC2 instances that the capacity provider can use.
    • setInstanceRequirements

      @Stability(Stable) public void setInstanceRequirements(@Nullable CfnCapacityProvider.InstanceRequirementsProperty value)
      Specifications for the types of EC2 instances that the capacity provider can use.
    • getKmsKeyArn

      @Stability(Stable) @Nullable public String getKmsKeyArn()
      The ARN of the AWS Key Management Service (KMS) key used by the capacity provider.
    • setKmsKeyArn

      @Stability(Stable) public void setKmsKeyArn(@Nullable String value)
      The ARN of the AWS Key Management Service (KMS) key used by the capacity provider.
    • getTags

      @Stability(Stable) @Nullable public List<CfnTag> getTags()
      A list of tags to apply to the capacity provider.
    • setTags

      @Stability(Stable) public void setTags(@Nullable List<CfnTag> value)
      A list of tags to apply to the capacity provider.