aws-cdk-lib.aws_ecs.PropagatedTagSource

enum PropagatedTagSource

LanguageType name
.NETAmazon.CDK.AWS.ECS.PropagatedTagSource
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsecs#PropagatedTagSource
Javasoftware.amazon.awscdk.services.ecs.PropagatedTagSource
Pythonaws_cdk.aws_ecs.PropagatedTagSource
TypeScript (source)aws-cdk-lib » aws_ecs » PropagatedTagSource

Propagate tags from either service or task definition.

Example

const vpc = ec2.Vpc.fromLookup(this, 'Vpc', {
  isDefault: true,
});

const cluster = new ecs.Cluster(this, 'FargateCluster', { vpc });

const taskDefinition = new ecs.TaskDefinition(this, 'TD', {
  memoryMiB: '512',
  cpu: '256',
  compatibility: ecs.Compatibility.FARGATE,
});

const containerDefinition = taskDefinition.addContainer('TheContainer', {
  image: ecs.ContainerImage.fromRegistry('foo/bar'),
  memoryLimitMiB: 256,
});

const runTask = new tasks.EcsRunTask(this, 'RunFargate', {
  integrationPattern: sfn.IntegrationPattern.RUN_JOB,
  cluster,
  taskDefinition,
  assignPublicIp: true,
  containerOverrides: [{
    containerDefinition,
    environment: [{ name: 'SOME_KEY', value: sfn.JsonPath.stringAt('$.SomeKey') }],
  }],
  launchTarget: new tasks.EcsFargateLaunchTarget(),
  propagatedTagSource: ecs.PropagatedTagSource.TASK_DEFINITION,
});

Members

NameDescription
SERVICEPropagate tags from service.
TASK_DEFINITIONPropagate tags from task definition.
NONEDo not propagate.

SERVICE

Propagate tags from service.


TASK_DEFINITION

Propagate tags from task definition.


NONE

Do not propagate.