Skip to content

Commit 6da4eba

Browse files
authored
feat(ecs-patterns): Tagging support for scheduled tasks (#25222)
This was enabled by PR #23838 which adds support for the `propagateTags` and `tags` attributes to the ecs-patterns module. With the changes in this PR, tags can now be applied to tasks that are launched as scheduled tasks with the proper tags passed through to the event target. This PR contributes to (but does not completely close) #25106 . ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 79881c5 commit 6da4eba

21 files changed

+602
-181
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.scheduled-ecs-task.js.snapshot/aws-ecs-integ-ecs.assets.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
"version": "21.0.0",
2+
"version": "31.0.0",
33
"files": {
4-
"ca15a60f3a20460e6534c82e90142c42bda680cee1d53044cff4136cb5b7feb5": {
4+
"45ee1817116bffce287e51bd4477bcad440916657502fad9157093fa3d54f67d": {
55
"source": {
66
"path": "aws-ecs-integ-ecs.template.json",
77
"packaging": "file"
88
},
99
"destinations": {
1010
"current_account-current_region": {
1111
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
12-
"objectKey": "ca15a60f3a20460e6534c82e90142c42bda680cee1d53044cff4136cb5b7feb5.json",
12+
"objectKey": "45ee1817116bffce287e51bd4477bcad440916657502fad9157093fa3d54f67d.json",
1313
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
1414
}
1515
}

packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.scheduled-ecs-task.js.snapshot/aws-ecs-integ-ecs.template.json

+7
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,13 @@
682682
]
683683
},
684684
"EcsParameters": {
685+
"PropagateTags": "TASK_DEFINITION",
686+
"TagList": [
687+
{
688+
"Key": "my-tag",
689+
"Value": "my-tag-value"
690+
}
691+
],
685692
"TaskCount": 2,
686693
"TaskDefinitionArn": {
687694
"Ref": "ScheduledEc2TaskScheduledTaskDef56328BA4"
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"20.0.0"}
1+
{"version":"31.0.0"}

packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.scheduled-ecs-task.js.snapshot/integ.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "21.0.0",
2+
"version": "31.0.0",
33
"testCases": {
44
"scheduledEc2TaskTest/DefaultTest": {
55
"stacks": [

packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.scheduled-ecs-task.js.snapshot/manifest.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
{
2-
"version": "21.0.0",
2+
"version": "31.0.0",
33
"artifacts": {
4-
"Tree": {
5-
"type": "cdk:tree",
6-
"properties": {
7-
"file": "tree.json"
8-
}
9-
},
104
"aws-ecs-integ-ecs.assets": {
115
"type": "cdk:asset-manifest",
126
"properties": {
@@ -23,7 +17,7 @@
2317
"validateOnSynth": false,
2418
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
2519
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
26-
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/ca15a60f3a20460e6534c82e90142c42bda680cee1d53044cff4136cb5b7feb5.json",
20+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/45ee1817116bffce287e51bd4477bcad440916657502fad9157093fa3d54f67d.json",
2721
"requiresBootstrapStackVersion": 6,
2822
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
2923
"additionalDependencies": [
@@ -328,6 +322,12 @@
328322
]
329323
},
330324
"displayName": "scheduledEc2TaskTest/DefaultTest/DeployAssert"
325+
},
326+
"Tree": {
327+
"type": "cdk:tree",
328+
"properties": {
329+
"file": "tree.json"
330+
}
331331
}
332332
}
333333
}

packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.scheduled-ecs-task.js.snapshot/scheduledEc2TaskTestDefaultTestDeployAssertF02313CA.assets.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "21.0.0",
2+
"version": "31.0.0",
33
"files": {
44
"21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": {
55
"source": {

0 commit comments

Comments
 (0)