Class CfnTaskSet

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

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-12T19:34:01.288Z") @Stability(Stable) public class CfnTaskSet extends CfnResource implements IInspectable, ITaggableV2
Create a task set in the specified cluster and service.

This is used when a service uses the EXTERNAL deployment controller type. For more information, see Amazon ECS deployment types in the Amazon Elastic Container Service Developer Guide .

On March 21, 2024, a change was made to resolve the task definition revision before authorization. When a task definition revision is not specified, authorization will occur using the latest revision of a task definition.

For information about the maximum number of task sets and otther quotas, see Amazon ECS service quotas in the Amazon Elastic Container Service Developer Guide .

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.*;
 CfnTaskSet cfnTaskSet = CfnTaskSet.Builder.create(this, "MyCfnTaskSet")
         .cluster("cluster")
         .service("service")
         .taskDefinition("taskDefinition")
         // the properties below are optional
         .externalId("externalId")
         .launchType("launchType")
         .loadBalancers(List.of(LoadBalancerProperty.builder()
                 .containerName("containerName")
                 .containerPort(123)
                 .targetGroupArn("targetGroupArn")
                 .build()))
         .networkConfiguration(NetworkConfigurationProperty.builder()
                 .awsVpcConfiguration(AwsVpcConfigurationProperty.builder()
                         .subnets(List.of("subnets"))
                         // the properties below are optional
                         .assignPublicIp("assignPublicIp")
                         .securityGroups(List.of("securityGroups"))
                         .build())
                 .build())
         .platformVersion("platformVersion")
         .scale(ScaleProperty.builder()
                 .unit("unit")
                 .value(123)
                 .build())
         .serviceRegistries(List.of(ServiceRegistryProperty.builder()
                 .containerName("containerName")
                 .containerPort(123)
                 .port(123)
                 .registryArn("registryArn")
                 .build()))
         .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

    • CfnTaskSet

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

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

      @Stability(Stable) public CfnTaskSet(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnTaskSetProps props)
      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

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

      @Stability(Stable) @NotNull public String getAttrId()
      The ID of the task set.
    • 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
    • getCluster

      @Stability(Stable) @NotNull public String getCluster()
      The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service to create the task set in.
    • setCluster

      @Stability(Stable) public void setCluster(@NotNull String value)
      The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service to create the task set in.
    • getService

      @Stability(Stable) @NotNull public String getService()
      The short name or full Amazon Resource Name (ARN) of the service to create the task set in.
    • setService

      @Stability(Stable) public void setService(@NotNull String value)
      The short name or full Amazon Resource Name (ARN) of the service to create the task set in.
    • getTaskDefinition

      @Stability(Stable) @NotNull public String getTaskDefinition()
      The task definition for the tasks in the task set to use.
    • setTaskDefinition

      @Stability(Stable) public void setTaskDefinition(@NotNull String value)
      The task definition for the tasks in the task set to use.
    • getExternalId

      @Stability(Stable) @Nullable public String getExternalId()
      An optional non-unique tag that identifies this task set in external systems.
    • setExternalId

      @Stability(Stable) public void setExternalId(@Nullable String value)
      An optional non-unique tag that identifies this task set in external systems.
    • getLaunchType

      @Stability(Stable) @Nullable public String getLaunchType()
      The launch type that new tasks in the task set uses.
    • setLaunchType

      @Stability(Stable) public void setLaunchType(@Nullable String value)
      The launch type that new tasks in the task set uses.
    • getLoadBalancers

      @Stability(Stable) @Nullable public Object getLoadBalancers()
      A load balancer object representing the load balancer to use with the task set.
    • setLoadBalancers

      @Stability(Stable) public void setLoadBalancers(@Nullable IResolvable value)
      A load balancer object representing the load balancer to use with the task set.
    • setLoadBalancers

      @Stability(Stable) public void setLoadBalancers(@Nullable List<Object> value)
      A load balancer object representing the load balancer to use with the task set.
    • getNetworkConfiguration

      @Stability(Stable) @Nullable public Object getNetworkConfiguration()
      The network configuration for the task set.
    • setNetworkConfiguration

      @Stability(Stable) public void setNetworkConfiguration(@Nullable IResolvable value)
      The network configuration for the task set.
    • setNetworkConfiguration

      @Stability(Stable) public void setNetworkConfiguration(@Nullable CfnTaskSet.NetworkConfigurationProperty value)
      The network configuration for the task set.
    • getPlatformVersion

      @Stability(Stable) @Nullable public String getPlatformVersion()
      The platform version that the tasks in the task set uses.
    • setPlatformVersion

      @Stability(Stable) public void setPlatformVersion(@Nullable String value)
      The platform version that the tasks in the task set uses.
    • getScale

      @Stability(Stable) @Nullable public Object getScale()
      A floating-point percentage of your desired number of tasks to place and keep running in the task set.
    • setScale

      @Stability(Stable) public void setScale(@Nullable IResolvable value)
      A floating-point percentage of your desired number of tasks to place and keep running in the task set.
    • setScale

      @Stability(Stable) public void setScale(@Nullable CfnTaskSet.ScaleProperty value)
      A floating-point percentage of your desired number of tasks to place and keep running in the task set.
    • getServiceRegistries

      @Stability(Stable) @Nullable public Object getServiceRegistries()
      The details of the service discovery registries to assign to this task set.
    • setServiceRegistries

      @Stability(Stable) public void setServiceRegistries(@Nullable IResolvable value)
      The details of the service discovery registries to assign to this task set.
    • setServiceRegistries

      @Stability(Stable) public void setServiceRegistries(@Nullable List<Object> value)
      The details of the service discovery registries to assign to this task set.
    • getTags

      @Stability(Stable) @Nullable public List<CfnTag> getTags()
      The metadata that you apply to the task set to help you categorize and organize them.
    • setTags

      @Stability(Stable) public void setTags(@Nullable List<CfnTag> value)
      The metadata that you apply to the task set to help you categorize and organize them.