Class CfnCapacityProvider

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

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:47.029Z") @Stability(Stable) public class CfnCapacityProvider extends CfnResource implements IInspectable
A CloudFormation AWS::ECS::CapacityProvider.

Creates a new capacity provider. Capacity providers are associated with an Amazon ECS cluster and are used in capacity provider strategies to facilitate cluster auto scaling.

Only capacity providers that use an Auto Scaling group can be created. Amazon ECS tasks on AWS Fargate use the FARGATE and FARGATE_SPOT capacity providers. These providers are available to all accounts in the AWS Regions that AWS Fargate supports.

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.ecs.*;
 CfnCapacityProvider cfnCapacityProvider = CfnCapacityProvider.Builder.create(this, "MyCfnCapacityProvider")
         .autoScalingGroupProvider(AutoScalingGroupProviderProperty.builder()
                 .autoScalingGroupArn("autoScalingGroupArn")
                 // the properties below are optional
                 .managedScaling(ManagedScalingProperty.builder()
                         .instanceWarmupPeriod(123)
                         .maximumScalingStepSize(123)
                         .minimumScalingStepSize(123)
                         .status("status")
                         .targetCapacity(123)
                         .build())
                 .managedTerminationProtection("managedTerminationProtection")
                 .build())
         // the properties below are optional
         .name("name")
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .build();
 
  • 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 Construct scope, @NotNull String id, @NotNull CfnCapacityProviderProps props)
      Create a new AWS::ECS::CapacityProvider.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      props -
      • resource properties.
      This parameter is required.
  • Method Details

    • 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.
    • getCfnProperties

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

      @Stability(Stable) @NotNull public TagManager getTags()
      The metadata that you apply to the capacity provider to help you categorize and organize it.

      Each tag consists of a key and an optional value. You define both.

      The following basic restrictions apply to tags:

      • Maximum number of tags per resource - 50
      • For each resource, each tag key must be unique, and each tag key can have only one value.
      • Maximum key length - 128 Unicode characters in UTF-8
      • Maximum value length - 256 Unicode characters in UTF-8
      • If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.
      • Tag keys and values are case-sensitive.
      • Do not use aws: , AWS: , or any upper or lowercase combination of such as a prefix for either keys or values as it is reserved for AWS use. You cannot edit or delete tag keys or values with this prefix. Tags with this prefix do not count against your tags per resource limit.
    • getAutoScalingGroupProvider

      @Stability(Stable) @NotNull public Object getAutoScalingGroupProvider()
      The Auto Scaling group settings for the capacity provider.
    • setAutoScalingGroupProvider

      @Stability(Stable) public void setAutoScalingGroupProvider(@NotNull CfnCapacityProvider.AutoScalingGroupProviderProperty value)
      The Auto Scaling group settings for the capacity provider.
    • setAutoScalingGroupProvider

      @Stability(Stable) public void setAutoScalingGroupProvider(@NotNull IResolvable value)
      The Auto Scaling group settings for the capacity provider.
    • getName

      @Stability(Stable) @Nullable public String getName()
      The name of the capacity provider.

      If a name is specified, it cannot start with aws , ecs , or fargate . If no name is specified, a default name in the CFNStackName-CFNResourceName-RandomString format is used.

    • setName

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

      If a name is specified, it cannot start with aws , ecs , or fargate . If no name is specified, a default name in the CFNStackName-CFNResourceName-RandomString format is used.