Skip to content
v2.275.0

CfnTaskSetProps Struct ​

Properties for defining a CfnTaskSet.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ecs as ecs } from 'aws-cdk-lib';
const cfnTaskSetProps: ecs.CfnTaskSetProps = {
  cluster: 'cluster',
  service: 'service',
  taskDefinition: 'taskDefinition',

  // the properties below are optional
  capacityProviderStrategy: [{
    base: 123,
    capacityProvider: 'capacityProvider',
    weight: 123,
  }],
  externalId: 'externalId',
  launchType: 'launchType',
  loadBalancers: [{
    containerName: 'containerName',
    containerPort: 123,
    targetGroupArn: 'targetGroupArn',
  }],
  networkConfiguration: {
    awsVpcConfiguration: {
      subnets: ['subnets'],

      // the properties below are optional
      assignPublicIp: 'assignPublicIp',
      securityGroups: ['securityGroups'],
    },
  },
  platformVersion: 'platformVersion',
  scale: {
    unit: 'unit',
    value: 123,
  },
  serviceRegistries: [{
    containerName: 'containerName',
    containerPort: 123,
    port: 123,
    registryArn: 'registryArn',
  }],
  tags: [{
    key: 'key',
    value: 'value',
  }],
};

Properties ​

capacityProviderStrategyoptionalIResolvable | IResolvable | CfnTaskSet.CapacityProviderStrategyItemProperty[]capacity_provider_strategyoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, CapacityProviderStrategyItemProperty]]]capacityProviderStrategyoptionalIResolvableCapacityProviderStrategyoptionalIResolvableCapacityProviderStrategyoptionalinterface{}#
The capacity provider strategy that are associated with the task set.
clusterstringclusterstrclusterStringClusterstringCluster*stringrequired#
The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service to create the task set in.
externalIdoptionalstringexternal_idoptionalstrexternalIdoptionalStringExternalIdoptionalstringExternalIdoptional*string#
An optional non-unique tag that identifies this task set in external systems.

If the task set is associated with a service discovery registry, the tasks in this task set will have the ECS_TASK_SET_EXTERNAL_ID AWS Cloud Map attribute set to the provided value.

launchTypeoptionalstringlaunch_typeoptionalstrlaunchTypeoptionalStringLaunchTypeoptionalstringLaunchTypeoptional*string#
The launch type that new tasks in the task set uses.
notes

For more information, see Amazon ECS launch types in the Amazon Elastic Container Service Developer Guide .

If a launchType is specified, the capacityProviderStrategy parameter must be omitted.

loadBalancersoptionalIResolvable | IResolvable | CfnTaskSet.LoadBalancerProperty[]load_balancersoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, LoadBalancerProperty]]]loadBalancersoptionalIResolvableLoadBalancersoptionalIResolvableLoadBalancersoptionalinterface{}#
A load balancer object representing the load balancer to use with the task set.

The supported load balancer types are either an Application Load Balancer or a Network Load Balancer.

networkConfigurationoptionalIResolvable | CfnTaskSet.NetworkConfigurationPropertynetwork_configurationoptionaltyping.Union[IResolvable, NetworkConfigurationProperty]networkConfigurationoptionalIResolvableNetworkConfigurationoptionalIResolvableNetworkConfigurationoptionalinterface{}#
The network configuration for the task set.
platformVersionoptionalstringplatform_versionoptionalstrplatformVersionoptionalStringPlatformVersionoptionalstringPlatformVersionoptional*string#
The platform version that the tasks in the task set uses.

A platform version is specified only for tasks using the Fargate launch type. If one isn't specified, the LATEST platform version is used.

scaleoptionalIResolvable | CfnTaskSet.ScalePropertyscaleoptionaltyping.Union[IResolvable, ScaleProperty]scaleoptionalIResolvableScaleoptionalIResolvableScaleoptionalinterface{}#
A floating-point percentage of your desired number of tasks to place and keep running in the task set.
servicestringservicestrserviceStringServicestringService*stringrequired#
The short name or full Amazon Resource Name (ARN) of the service to create the task set in.
serviceRegistriesoptionalIResolvable | IResolvable | CfnTaskSet.ServiceRegistryProperty[]service_registriesoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, ServiceRegistryProperty]]]serviceRegistriesoptionalIResolvableServiceRegistriesoptionalIResolvableServiceRegistriesoptionalinterface{}#
The details of the service discovery registries to assign to this task set.

For more information, see Service discovery .

tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag#
The metadata that you apply to the task set to help you categorize and organize them.
notes

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: + - = . _ : /
taskDefinitionstringtask_definitionstrtaskDefinitionStringTaskDefinitionstringTaskDefinition*stringrequired#
The task definition for the tasks in the task set to use.

If a revision isn't specified, the latest ACTIVE revision is used.