CfnTaskSetProps Struct
Properties for defining a CfnTaskSet.
| Source | |
|---|---|
| Type last changed |
Example
// 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',
}],
};
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ecs as ecs
cfn_task_set_props = ecs.CfnTaskSetProps(
cluster="cluster",
service="service",
task_definition="taskDefinition",
# the properties below are optional
capacity_provider_strategy=[ecs.CfnTaskSet.CapacityProviderStrategyItemProperty(
base=123,
capacity_provider="capacityProvider",
weight=123
)],
external_id="externalId",
launch_type="launchType",
load_balancers=[ecs.CfnTaskSet.LoadBalancerProperty(
container_name="containerName",
container_port=123,
target_group_arn="targetGroupArn"
)],
network_configuration=ecs.CfnTaskSet.NetworkConfigurationProperty(
aws_vpc_configuration=ecs.CfnTaskSet.AwsVpcConfigurationProperty(
subnets=["subnets"],
# the properties below are optional
assign_public_ip="assignPublicIp",
security_groups=["securityGroups"]
)
),
platform_version="platformVersion",
scale=ecs.CfnTaskSet.ScaleProperty(
unit="unit",
value=123
),
service_registries=[ecs.CfnTaskSet.ServiceRegistryProperty(
container_name="containerName",
container_port=123,
port=123,
registry_arn="registryArn"
)],
tags=[CfnTag(
key="key",
value="value"
)]
)
// 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.*;
CfnTaskSetProps cfnTaskSetProps = CfnTaskSetProps.builder()
.cluster("cluster")
.service("service")
.taskDefinition("taskDefinition")
// the properties below are optional
.capacityProviderStrategy(List.of(CapacityProviderStrategyItemProperty.builder()
.base(123)
.capacityProvider("capacityProvider")
.weight(123)
.build()))
.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();
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ECS;
var cfnTaskSetProps = new CfnTaskSetProps {
Cluster = "cluster",
Service = "service",
TaskDefinition = "taskDefinition",
// the properties below are optional
CapacityProviderStrategy = new [] { new CapacityProviderStrategyItemProperty {
Base = 123,
CapacityProvider = "capacityProvider",
Weight = 123
} },
ExternalId = "externalId",
LaunchType = "launchType",
LoadBalancers = new [] { new LoadBalancerProperty {
ContainerName = "containerName",
ContainerPort = 123,
TargetGroupArn = "targetGroupArn"
} },
NetworkConfiguration = new NetworkConfigurationProperty {
AwsVpcConfiguration = new AwsVpcConfigurationProperty {
Subnets = new [] { "subnets" },
// the properties below are optional
AssignPublicIp = "assignPublicIp",
SecurityGroups = new [] { "securityGroups" }
}
},
PlatformVersion = "platformVersion",
Scale = new ScaleProperty {
Unit = "unit",
Value = 123
},
ServiceRegistries = new [] { new ServiceRegistryProperty {
ContainerName = "containerName",
ContainerPort = 123,
Port = 123,
RegistryArn = "registryArn"
} },
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
};
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
cfnTaskSetProps := &CfnTaskSetProps{
Cluster: jsii.String("cluster"),
Service: jsii.String("service"),
TaskDefinition: jsii.String("taskDefinition"),
// the properties below are optional
CapacityProviderStrategy: []interface{}{
&CapacityProviderStrategyItemProperty{
Base: jsii.Number(123),
CapacityProvider: jsii.String("capacityProvider"),
Weight: jsii.Number(123),
},
},
ExternalId: jsii.String("externalId"),
LaunchType: jsii.String("launchType"),
LoadBalancers: []interface{}{
&LoadBalancerProperty{
ContainerName: jsii.String("containerName"),
ContainerPort: jsii.Number(123),
TargetGroupArn: jsii.String("targetGroupArn"),
},
},
NetworkConfiguration: &NetworkConfigurationProperty{
AwsVpcConfiguration: &AwsVpcConfigurationProperty{
Subnets: []*string{
jsii.String("subnets"),
},
// the properties below are optional
AssignPublicIp: jsii.String("assignPublicIp"),
SecurityGroups: []*string{
jsii.String("securityGroups"),
},
},
},
PlatformVersion: jsii.String("platformVersion"),
Scale: &ScaleProperty{
Unit: jsii.String("unit"),
Value: jsii.Number(123),
},
ServiceRegistries: []interface{}{
&ServiceRegistryProperty{
ContainerName: jsii.String("containerName"),
ContainerPort: jsii.Number(123),
Port: jsii.Number(123),
RegistryArn: jsii.String("registryArn"),
},
},
Tags: []CfnTag{
&CfnTag{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
}
Properties
capacityProviderStrategyoptionalIResolvable | IResolvable | CfnTaskSet.capacity_provider_strategyoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, CapacityProviderStrategyItemProperty]]]capacityProviderStrategyoptionalIResolvableCapacityProviderStrategyoptionalIResolvableCapacityProviderStrategyoptionalinterface{} #externalIdoptionalstringexternal_idoptionalstrexternalIdoptionalStringExternalIdoptionalstringExternalIdoptional*string #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 #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{} #The supported load balancer types are either an Application Load Balancer or a Network Load Balancer.
networkConfigurationoptionalIResolvable | CfnTaskSet.network_configurationoptionaltyping.Union[IResolvable, NetworkConfigurationProperty]networkConfigurationoptionalIResolvableNetworkConfigurationoptionalIResolvableNetworkConfigurationoptionalinterface{} #platformVersionoptionalstringplatform_versionoptionalstrplatformVersionoptionalStringPlatformVersionoptionalstringPlatformVersionoptional*string #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{} #serviceRegistriesoptionalIResolvable | IResolvable | CfnTaskSet.service_registriesoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, ServiceRegistryProperty]]]serviceRegistriesoptionalIResolvableServiceRegistriesoptionalIResolvableServiceRegistriesoptionalinterface{} #For more information, see Service discovery .
tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag #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*string required #If a revision isn't specified, the latest ACTIVE revision is used.