Skip to content

Commit a98a981

Browse files
authored
feat(step-functions-tasks): Support PropagatedTagSource property for EcsRunTask (#24949)
Currently, when launching an ECS task with Step Functions, it is impossible to propagate tag to task. To solve this issue, add property for PropagatedTagSource for EcsRunTask Closes #12999 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 737061d commit a98a981

File tree

11 files changed

+309
-82
lines changed

11 files changed

+309
-82
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js

+8-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/aws-sfn-tasks-ecs-fargate-integ.assets.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
"version": "30.0.0",
2+
"version": "31.0.0",
33
"files": {
4-
"e24a1536363f5a0e085f665d59c23d647a03864eb45d88b8d07e2d0d8e285ee1": {
4+
"e0fc842b7fabc881a98d67eb7dec48a397328444df14c6f4b2cd2c341ac07639": {
55
"source": {
66
"path": "aws-sfn-tasks-ecs-fargate-integ.template.json",
77
"packaging": "file"
88
},
99
"destinations": {
1010
"current_account-current_region": {
1111
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
12-
"objectKey": "e24a1536363f5a0e085f665d59c23d647a03864eb45d88b8d07e2d0d8e285ee1.json",
12+
"objectKey": "e0fc842b7fabc881a98d67eb7dec48a397328444df14c6f4b2cd2c341ac07639.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-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/aws-sfn-tasks-ecs-fargate-integ.template.json

+44-2
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,22 @@
576576
}
577577
}
578578
},
579+
"FargeateTaskWithPropagatedTagSecurityGroup94A6AE70": {
580+
"Type": "AWS::EC2::SecurityGroup",
581+
"Properties": {
582+
"GroupDescription": "aws-sfn-tasks-ecs-fargate-integ/FargeateTaskWithPropagatedTag/SecurityGroup",
583+
"SecurityGroupEgress": [
584+
{
585+
"CidrIp": "0.0.0.0/0",
586+
"Description": "Allow all outbound traffic by default",
587+
"IpProtocol": "-1"
588+
}
589+
],
590+
"VpcId": {
591+
"Ref": "FargateClusterVpc377E8024"
592+
}
593+
}
594+
},
579595
"StateMachineRoleB840431D": {
580596
"Type": "AWS::IAM::Role",
581597
"Properties": {
@@ -817,7 +833,7 @@
817833
"GroupId"
818834
]
819835
},
820-
"\"]}},\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"TheContainer\",\"Environment\":[{\"Name\":\"SOME_KEY\",\"Value.$\":\"$.SomeKey\"}]}]},\"LaunchType\":\"FARGATE\",\"PlatformVersion\":\"1.4.0\"}},\"FargeateTaskSetRevisionNumber\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:",
836+
"\"]}},\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"TheContainer\",\"Environment\":[{\"Name\":\"SOME_KEY\",\"Value.$\":\"$.SomeKey\"}]}]},\"LaunchType\":\"FARGATE\",\"PlatformVersion\":\"1.4.0\"}},\"FargeateTaskSetRevisionNumber\":{\"Next\":\"FargeateTaskWithPropagatedTag\",\"Type\":\"Task\",\"Resource\":\"arn:",
821837
{
822838
"Ref": "AWS::Partition"
823839
},
@@ -843,7 +859,33 @@
843859
"GroupId"
844860
]
845861
},
846-
"\"]}},\"LaunchType\":\"FARGATE\",\"PlatformVersion\":\"1.4.0\"}}}}"
862+
"\"]}},\"LaunchType\":\"FARGATE\",\"PlatformVersion\":\"1.4.0\"}},\"FargeateTaskWithPropagatedTag\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:",
863+
{
864+
"Ref": "AWS::Partition"
865+
},
866+
":states:::ecs:runTask\",\"Parameters\":{\"Cluster\":\"",
867+
{
868+
"Fn::GetAtt": [
869+
"FargateCluster7CCD5F93",
870+
"Arn"
871+
]
872+
},
873+
"\",\"TaskDefinition\":\"awssfntasksecsfargateintegTaskDefD0F4AD10\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"Subnets\":[\"",
874+
{
875+
"Ref": "FargateClusterVpcPrivateSubnet1Subnet9127625F"
876+
},
877+
"\",\"",
878+
{
879+
"Ref": "FargateClusterVpcPrivateSubnet2Subnet307CEE57"
880+
},
881+
"\"],\"SecurityGroups\":[\"",
882+
{
883+
"Fn::GetAtt": [
884+
"FargeateTaskWithPropagatedTagSecurityGroup94A6AE70",
885+
"GroupId"
886+
]
887+
},
888+
"\"]}},\"PropagateTags\":\"TASK_DEFINITION\",\"LaunchType\":\"FARGATE\",\"PlatformVersion\":\"1.4.0\"}}}}"
847889
]
848890
]
849891
}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"30.0.0"}
1+
{"version":"31.0.0"}

packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/integ.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "30.0.0",
2+
"version": "31.0.0",
33
"testCases": {
44
"integ.fargate-run-task": {
55
"stacks": [

packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/manifest.json

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "30.0.0",
2+
"version": "31.0.0",
33
"artifacts": {
44
"aws-sfn-tasks-ecs-fargate-integ.assets": {
55
"type": "cdk:asset-manifest",
@@ -17,7 +17,7 @@
1717
"validateOnSynth": false,
1818
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
1919
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
20-
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/e24a1536363f5a0e085f665d59c23d647a03864eb45d88b8d07e2d0d8e285ee1.json",
20+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/e0fc842b7fabc881a98d67eb7dec48a397328444df14c6f4b2cd2c341ac07639.json",
2121
"requiresBootstrapStackVersion": 6,
2222
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
2323
"additionalDependencies": [
@@ -219,6 +219,12 @@
219219
"data": "FargeateTaskSetRevisionNumberSecurityGroup916C9B0B"
220220
}
221221
],
222+
"/aws-sfn-tasks-ecs-fargate-integ/FargeateTaskWithPropagatedTag/SecurityGroup/Resource": [
223+
{
224+
"type": "aws:cdk:logicalId",
225+
"data": "FargeateTaskWithPropagatedTagSecurityGroup94A6AE70"
226+
}
227+
],
222228
"/aws-sfn-tasks-ecs-fargate-integ/StateMachine/Role/Resource": [
223229
{
224230
"type": "aws:cdk:logicalId",

0 commit comments

Comments
 (0)