From 683d5958b91747cedd746b96845a2169411d847a Mon Sep 17 00:00:00 2001 From: Michael Sambol Date: Mon, 12 Feb 2024 08:05:43 -0800 Subject: [PATCH 1/4] fix(stepfunctions-tasks): missing permissions for running tasks on ecs (#27891) While working on [#27803](https://github.com/aws/aws-cdk/pull/27803), I noticed the integration tests for `aws-stepfunctions-tasks/ecs` were not fully working (they deployed but the state machines did not run successfully). This PR addresses two issues: 1. Missing permissions for `ecs:RunTask` on the task definition version. sfn-role 2. The sample container was from a Lambda image. This resulted in the following error: `entrypoint requires the handler name to be the first argument`. I changed the image to `docker/library/python:3.12`. These changes result in the successful execution of all four state machines in `aws-stepfunctions-tasks/ecs`. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../test/ecs/eventhandler-image/Dockerfile | 8 +- .../test/ecs/eventhandler-image/index.py | 1 - ...efaultTestDeployAssert2569343D.assets.json | 19 + ...aultTestDeployAssert2569343D.template.json | 36 + .../Dockerfile | 5 - .../Dockerfile | 3 + .../index.py | 1 - .../aws-sfn-tasks-ecs-run-task.assets.json} | 14 +- ... aws-sfn-tasks-ecs-run-task.template.json} | 544 +++++--- .../integ.ec2-run-task.js.snapshot/cdk.out | 2 +- .../integ.ec2-run-task.js.snapshot/integ.json | 14 +- .../manifest.json | 174 ++- .../integ.ec2-run-task.js.snapshot/tree.json | 1196 ++++++++++------- .../test/ecs/integ.ec2-run-task.ts | 9 +- ...efaultTestDeployAssert9E1A388C.assets.json | 19 + ...aultTestDeployAssert9E1A388C.template.json | 36 + .../Dockerfile | 5 - .../Dockerfile | 3 + .../index.py | 1 - ...son => aws-sfn-tasks-ecs-task.assets.json} | 14 +- ...n => aws-sfn-tasks-ecs-task.template.json} | 210 +-- .../ecs/integ.ec2-task.js.snapshot/cdk.out | 2 +- .../ecs/integ.ec2-task.js.snapshot/integ.json | 14 +- .../integ.ec2-task.js.snapshot/manifest.json | 172 ++- .../ecs/integ.ec2-task.js.snapshot/tree.json | 856 ++++++------ .../test/ecs/integ.ec2-task.ts | 19 +- ...efaultTestDeployAssert9D97FD2B.assets.json | 19 + ...aultTestDeployAssert9D97FD2B.template.json | 36 + .../Dockerfile | 5 - .../Dockerfile | 3 + .../index.py | 1 - ...fn-tasks-ecs-fargate-run-task.assets.json} | 14 +- ...-tasks-ecs-fargate-run-task.template.json} | 510 ++++--- .../cdk.out | 2 +- .../integ.json | 14 +- .../manifest.json | 147 +- .../tree.json | 1000 ++++++++------ .../test/ecs/integ.fargate-run-task.ts | 11 +- ...efaultTestDeployAssert83C8E074.assets.json | 19 + ...aultTestDeployAssert83C8E074.template.json | 36 + .../Dockerfile | 5 - .../Dockerfile | 3 + .../index.py | 1 - ...ws-sfn-tasks-ecs-fargate-task.assets.json} | 14 +- ...-sfn-tasks-ecs-fargate-task.template.json} | 152 +-- .../integ.fargate-task.js.snapshot/cdk.out | 2 +- .../integ.fargate-task.js.snapshot/integ.json | 14 +- .../manifest.json | 137 +- .../integ.fargate-task.js.snapshot/tree.json | 596 ++++---- .../test/ecs/integ.fargate-task.ts | 17 +- .../lib/ecs/run-task.ts | 6 +- .../test/ecs/eventhandler-image/Dockerfile | 8 +- .../test/ecs/run-tasks.test.ts | 44 +- 53 files changed, 3669 insertions(+), 2524 deletions(-) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/SfnTasksEcsEc2RunTaskTestDefaultTestDeployAssert2569343D.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/SfnTasksEcsEc2RunTaskTestDefaultTestDeployAssert2569343D.template.json delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2/Dockerfile create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534/Dockerfile rename packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/{integ.ec2-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2 => integ.ec2-run-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534}/index.py (82%) rename packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/{integ.fargate-task.js.snapshot/aws-ecs-integ2.assets.json => integ.ec2-run-task.js.snapshot/aws-sfn-tasks-ecs-run-task.assets.json} (60%) rename packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/{aws-sfn-tasks-ecs-ec2-integ.template.json => aws-sfn-tasks-ecs-run-task.template.json} (80%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/SfnTasksEcsEc2TaskTestDefaultTestDeployAssert9E1A388C.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/SfnTasksEcsEc2TaskTestDefaultTestDeployAssert9E1A388C.template.json delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2/Dockerfile create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534/Dockerfile rename packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/{integ.ec2-run-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2 => integ.ec2-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534}/index.py (82%) rename packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/{aws-ecs-integ2.assets.json => aws-sfn-tasks-ecs-task.assets.json} (60%) rename packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/{aws-ecs-integ2.template.json => aws-sfn-tasks-ecs-task.template.json} (91%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/SfnTasksEcsFargateRunTaskTestDefaultTestDeployAssert9D97FD2B.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/SfnTasksEcsFargateRunTaskTestDefaultTestDeployAssert9D97FD2B.template.json delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2/Dockerfile create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534/Dockerfile rename packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/{asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2 => asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534}/index.py (82%) rename 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 => aws-sfn-tasks-ecs-fargate-run-task.assets.json} (60%) rename 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 => aws-sfn-tasks-ecs-fargate-run-task.template.json} (70%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/SfnTasksEcsFargateTaskTestDefaultTestDeployAssert83C8E074.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/SfnTasksEcsFargateTaskTestDefaultTestDeployAssert83C8E074.template.json delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2/Dockerfile create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534/Dockerfile rename packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/{asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2 => asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534}/index.py (82%) rename packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/{integ.ec2-run-task.js.snapshot/aws-sfn-tasks-ecs-ec2-integ.assets.json => integ.fargate-task.js.snapshot/aws-sfn-tasks-ecs-fargate-task.assets.json} (60%) rename packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/{aws-ecs-integ2.template.json => aws-sfn-tasks-ecs-fargate-task.template.json} (91%) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/eventhandler-image/Dockerfile b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/eventhandler-image/Dockerfile index 235b30e9661ed..23cf9b3e22f5d 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/eventhandler-image/Dockerfile +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/eventhandler-image/Dockerfile @@ -1,5 +1,3 @@ -FROM public.ecr.aws/lambda/python:3.6 -EXPOSE 8000 -WORKDIR /src -ADD . /src -CMD python3 index.py +FROM public.ecr.aws/docker/library/python:3.12 +ADD index.py . +CMD [ "python3", "./index.py" ] diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/eventhandler-image/index.py b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/eventhandler-image/index.py index c4cab119afc2d..730f1be5ad06e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/eventhandler-image/index.py +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/eventhandler-image/index.py @@ -1,4 +1,3 @@ -#!/usr/bin/python import os import pprint diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/SfnTasksEcsEc2RunTaskTestDefaultTestDeployAssert2569343D.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/SfnTasksEcsEc2RunTaskTestDefaultTestDeployAssert2569343D.assets.json new file mode 100644 index 0000000000000..d6f156a9e088c --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/SfnTasksEcsEc2RunTaskTestDefaultTestDeployAssert2569343D.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "SfnTasksEcsEc2RunTaskTestDefaultTestDeployAssert2569343D.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/SfnTasksEcsEc2RunTaskTestDefaultTestDeployAssert2569343D.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/SfnTasksEcsEc2RunTaskTestDefaultTestDeployAssert2569343D.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/SfnTasksEcsEc2RunTaskTestDefaultTestDeployAssert2569343D.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2/Dockerfile b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2/Dockerfile deleted file mode 100644 index 235b30e9661ed..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM public.ecr.aws/lambda/python:3.6 -EXPOSE 8000 -WORKDIR /src -ADD . /src -CMD python3 index.py diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534/Dockerfile b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534/Dockerfile new file mode 100644 index 0000000000000..23cf9b3e22f5d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534/Dockerfile @@ -0,0 +1,3 @@ +FROM public.ecr.aws/docker/library/python:3.12 +ADD index.py . +CMD [ "python3", "./index.py" ] diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2/index.py b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534/index.py similarity index 82% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2/index.py rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534/index.py index c4cab119afc2d..730f1be5ad06e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2/index.py +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534/index.py @@ -1,4 +1,3 @@ -#!/usr/bin/python import os import pprint diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/aws-ecs-integ2.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/aws-sfn-tasks-ecs-run-task.assets.json similarity index 60% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/aws-ecs-integ2.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/aws-sfn-tasks-ecs-run-task.assets.json index e060c9972f295..9e4c6412a37b2 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/aws-ecs-integ2.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/aws-sfn-tasks-ecs-run-task.assets.json @@ -1,29 +1,29 @@ { - "version": "30.0.0", + "version": "36.0.0", "files": { - "49b9ca0d3fa9d22154be9a9852e1b152c1d5c634726748270dfa1952b69f1ed6": { + "95e3c66ed03d4b413dbfdca27bdc41c19f0035e7aab4e92a1fa335f02cd8b768": { "source": { - "path": "aws-ecs-integ2.template.json", + "path": "aws-sfn-tasks-ecs-run-task.template.json", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "49b9ca0d3fa9d22154be9a9852e1b152c1d5c634726748270dfa1952b69f1ed6.json", + "objectKey": "95e3c66ed03d4b413dbfdca27bdc41c19f0035e7aab4e92a1fa335f02cd8b768.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } } }, "dockerImages": { - "7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2": { + "d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534": { "source": { - "directory": "asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2" + "directory": "asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534" }, "destinations": { "current_account-current_region": { "repositoryName": "cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}", - "imageTag": "7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2", + "imageTag": "d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-image-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/aws-sfn-tasks-ecs-ec2-integ.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/aws-sfn-tasks-ecs-run-task.template.json similarity index 80% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/aws-sfn-tasks-ecs-ec2-integ.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/aws-sfn-tasks-ecs-run-task.template.json index 63fb3851bf89d..69fd4e4190aeb 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/aws-sfn-tasks-ecs-ec2-integ.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/aws-sfn-tasks-ecs-run-task.template.json @@ -13,7 +13,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc" + "Value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc" } ] } @@ -21,9 +21,6 @@ "Ec2ClusterVpcPublicSubnet1SubnetD46FD92B": { "Type": "AWS::EC2::Subnet", "Properties": { - "VpcId": { - "Ref": "Ec2ClusterVpc568127F1" - }, "AvailabilityZone": { "Fn::Select": [ 0, @@ -45,23 +42,26 @@ }, { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet1" + "Value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet1" } - ] + ], + "VpcId": { + "Ref": "Ec2ClusterVpc568127F1" + } } }, "Ec2ClusterVpcPublicSubnet1RouteTableE30610F5": { "Type": "AWS::EC2::RouteTable", "Properties": { - "VpcId": { - "Ref": "Ec2ClusterVpc568127F1" - }, "Tags": [ { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet1" + "Value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet1" } - ] + ], + "VpcId": { + "Ref": "Ec2ClusterVpc568127F1" + } } }, "Ec2ClusterVpcPublicSubnet1RouteTableAssociation9C78F646": { @@ -78,12 +78,12 @@ "Ec2ClusterVpcPublicSubnet1DefaultRouteC7FBE273": { "Type": "AWS::EC2::Route", "Properties": { - "RouteTableId": { - "Ref": "Ec2ClusterVpcPublicSubnet1RouteTableE30610F5" - }, "DestinationCidrBlock": "0.0.0.0/0", "GatewayId": { "Ref": "Ec2ClusterVpcIGW605638EB" + }, + "RouteTableId": { + "Ref": "Ec2ClusterVpcPublicSubnet1RouteTableE30610F5" } }, "DependsOn": [ @@ -97,7 +97,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet1" + "Value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet1" } ] } @@ -105,19 +105,19 @@ "Ec2ClusterVpcPublicSubnet1NATGateway79A8A839": { "Type": "AWS::EC2::NatGateway", "Properties": { - "SubnetId": { - "Ref": "Ec2ClusterVpcPublicSubnet1SubnetD46FD92B" - }, "AllocationId": { "Fn::GetAtt": [ "Ec2ClusterVpcPublicSubnet1EIPD4B5D142", "AllocationId" ] }, + "SubnetId": { + "Ref": "Ec2ClusterVpcPublicSubnet1SubnetD46FD92B" + }, "Tags": [ { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet1" + "Value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet1" } ] }, @@ -129,9 +129,6 @@ "Ec2ClusterVpcPublicSubnet2Subnet207D9E5E": { "Type": "AWS::EC2::Subnet", "Properties": { - "VpcId": { - "Ref": "Ec2ClusterVpc568127F1" - }, "AvailabilityZone": { "Fn::Select": [ 1, @@ -153,23 +150,26 @@ }, { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet2" + "Value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet2" } - ] + ], + "VpcId": { + "Ref": "Ec2ClusterVpc568127F1" + } } }, "Ec2ClusterVpcPublicSubnet2RouteTable44A09188": { "Type": "AWS::EC2::RouteTable", "Properties": { - "VpcId": { - "Ref": "Ec2ClusterVpc568127F1" - }, "Tags": [ { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet2" + "Value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet2" } - ] + ], + "VpcId": { + "Ref": "Ec2ClusterVpc568127F1" + } } }, "Ec2ClusterVpcPublicSubnet2RouteTableAssociation7615C6B2": { @@ -186,12 +186,12 @@ "Ec2ClusterVpcPublicSubnet2DefaultRouteEBA52256": { "Type": "AWS::EC2::Route", "Properties": { - "RouteTableId": { - "Ref": "Ec2ClusterVpcPublicSubnet2RouteTable44A09188" - }, "DestinationCidrBlock": "0.0.0.0/0", "GatewayId": { "Ref": "Ec2ClusterVpcIGW605638EB" + }, + "RouteTableId": { + "Ref": "Ec2ClusterVpcPublicSubnet2RouteTable44A09188" } }, "DependsOn": [ @@ -205,7 +205,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet2" + "Value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet2" } ] } @@ -213,19 +213,19 @@ "Ec2ClusterVpcPublicSubnet2NATGateway302F96C0": { "Type": "AWS::EC2::NatGateway", "Properties": { - "SubnetId": { - "Ref": "Ec2ClusterVpcPublicSubnet2Subnet207D9E5E" - }, "AllocationId": { "Fn::GetAtt": [ "Ec2ClusterVpcPublicSubnet2EIP921925E6", "AllocationId" ] }, + "SubnetId": { + "Ref": "Ec2ClusterVpcPublicSubnet2Subnet207D9E5E" + }, "Tags": [ { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet2" + "Value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet2" } ] }, @@ -237,9 +237,6 @@ "Ec2ClusterVpcPrivateSubnet1Subnet0AE9B91E": { "Type": "AWS::EC2::Subnet", "Properties": { - "VpcId": { - "Ref": "Ec2ClusterVpc568127F1" - }, "AvailabilityZone": { "Fn::Select": [ 0, @@ -261,23 +258,26 @@ }, { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PrivateSubnet1" + "Value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PrivateSubnet1" } - ] + ], + "VpcId": { + "Ref": "Ec2ClusterVpc568127F1" + } } }, "Ec2ClusterVpcPrivateSubnet1RouteTable50D391D1": { "Type": "AWS::EC2::RouteTable", "Properties": { - "VpcId": { - "Ref": "Ec2ClusterVpc568127F1" - }, "Tags": [ { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PrivateSubnet1" + "Value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PrivateSubnet1" } - ] + ], + "VpcId": { + "Ref": "Ec2ClusterVpc568127F1" + } } }, "Ec2ClusterVpcPrivateSubnet1RouteTableAssociation1043DBDA": { @@ -294,21 +294,18 @@ "Ec2ClusterVpcPrivateSubnet1DefaultRouteD31A76F0": { "Type": "AWS::EC2::Route", "Properties": { - "RouteTableId": { - "Ref": "Ec2ClusterVpcPrivateSubnet1RouteTable50D391D1" - }, "DestinationCidrBlock": "0.0.0.0/0", "NatGatewayId": { "Ref": "Ec2ClusterVpcPublicSubnet1NATGateway79A8A839" + }, + "RouteTableId": { + "Ref": "Ec2ClusterVpcPrivateSubnet1RouteTable50D391D1" } } }, "Ec2ClusterVpcPrivateSubnet2Subnet16B68C19": { "Type": "AWS::EC2::Subnet", "Properties": { - "VpcId": { - "Ref": "Ec2ClusterVpc568127F1" - }, "AvailabilityZone": { "Fn::Select": [ 1, @@ -330,23 +327,26 @@ }, { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PrivateSubnet2" + "Value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PrivateSubnet2" } - ] + ], + "VpcId": { + "Ref": "Ec2ClusterVpc568127F1" + } } }, "Ec2ClusterVpcPrivateSubnet2RouteTable22B9DAE6": { "Type": "AWS::EC2::RouteTable", "Properties": { - "VpcId": { - "Ref": "Ec2ClusterVpc568127F1" - }, "Tags": [ { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PrivateSubnet2" + "Value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PrivateSubnet2" } - ] + ], + "VpcId": { + "Ref": "Ec2ClusterVpc568127F1" + } } }, "Ec2ClusterVpcPrivateSubnet2RouteTableAssociation3AFD70F4": { @@ -363,12 +363,12 @@ "Ec2ClusterVpcPrivateSubnet2DefaultRoute22B3073E": { "Type": "AWS::EC2::Route", "Properties": { - "RouteTableId": { - "Ref": "Ec2ClusterVpcPrivateSubnet2RouteTable22B9DAE6" - }, "DestinationCidrBlock": "0.0.0.0/0", "NatGatewayId": { "Ref": "Ec2ClusterVpcPublicSubnet2NATGateway302F96C0" + }, + "RouteTableId": { + "Ref": "Ec2ClusterVpcPrivateSubnet2RouteTable22B9DAE6" } } }, @@ -378,7 +378,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc" + "Value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc" } ] } @@ -386,18 +386,18 @@ "Ec2ClusterVpcVPCGW24F3B413": { "Type": "AWS::EC2::VPCGatewayAttachment", "Properties": { - "VpcId": { - "Ref": "Ec2ClusterVpc568127F1" - }, "InternetGatewayId": { "Ref": "Ec2ClusterVpcIGW605638EB" + }, + "VpcId": { + "Ref": "Ec2ClusterVpc568127F1" } } }, "Ec2ClusterDefaultAutoScalingGroupInstanceSecurityGroup149B0A9E": { "Type": "AWS::EC2::SecurityGroup", "Properties": { - "GroupDescription": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/InstanceSecurityGroup", + "GroupDescription": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/InstanceSecurityGroup", "SecurityGroupEgress": [ { "CidrIp": "0.0.0.0/0", @@ -408,7 +408,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup" + "Value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup" } ], "VpcId": { @@ -434,7 +434,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup" + "Value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup" } ] } @@ -540,7 +540,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/LaunchTemplate" + "Value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/LaunchTemplate" } ] }, @@ -549,7 +549,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/LaunchTemplate" + "Value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/LaunchTemplate" } ] } @@ -575,7 +575,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/LaunchTemplate" + "Value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/LaunchTemplate" } ] } @@ -589,8 +589,6 @@ "Ec2ClusterDefaultAutoScalingGroupASGC5A6D4C0": { "Type": "AWS::AutoScaling::AutoScalingGroup", "Properties": { - "MaxSize": "1", - "MinSize": "1", "LaunchTemplate": { "LaunchTemplateId": { "Ref": "Ec2ClusterDefaultAutoScalingGroupLaunchTemplate346F58BE" @@ -602,11 +600,13 @@ ] } }, + "MaxSize": "1", + "MinSize": "1", "Tags": [ { "Key": "Name", "PropagateAtLaunch": true, - "Value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup" + "Value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup" } ], "VPCZoneIdentifier": [ @@ -659,7 +659,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup" + "Value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup" } ] } @@ -757,12 +757,6 @@ "Code": { "ZipFile": "import boto3, json, os, time\n\necs = boto3.client('ecs')\nautoscaling = boto3.client('autoscaling')\n\n\ndef lambda_handler(event, context):\n print(json.dumps(dict(event, ResponseURL='...')))\n cluster = os.environ['CLUSTER']\n snsTopicArn = event['Records'][0]['Sns']['TopicArn']\n lifecycle_event = json.loads(event['Records'][0]['Sns']['Message'])\n instance_id = lifecycle_event.get('EC2InstanceId')\n if not instance_id:\n print('Got event without EC2InstanceId: %s', json.dumps(dict(event, ResponseURL='...')))\n return\n\n instance_arn = container_instance_arn(cluster, instance_id)\n print('Instance %s has container instance ARN %s' % (lifecycle_event['EC2InstanceId'], instance_arn))\n\n if not instance_arn:\n return\n\n task_arns = container_instance_task_arns(cluster, instance_arn)\n\n if task_arns:\n print('Instance ARN %s has task ARNs %s' % (instance_arn, ', '.join(task_arns)))\n\n while has_tasks(cluster, instance_arn, task_arns):\n time.sleep(10)\n\n try:\n print('Terminating instance %s' % instance_id)\n autoscaling.complete_lifecycle_action(\n LifecycleActionResult='CONTINUE',\n **pick(lifecycle_event, 'LifecycleHookName', 'LifecycleActionToken', 'AutoScalingGroupName'))\n except Exception as e:\n # Lifecycle action may have already completed.\n print(str(e))\n\n\ndef container_instance_arn(cluster, instance_id):\n \"\"\"Turn an instance ID into a container instance ARN.\"\"\"\n arns = ecs.list_container_instances(cluster=cluster, filter='ec2InstanceId==' + instance_id)['containerInstanceArns']\n if not arns:\n return None\n return arns[0]\n\ndef container_instance_task_arns(cluster, instance_arn):\n \"\"\"Fetch tasks for a container instance ARN.\"\"\"\n arns = ecs.list_tasks(cluster=cluster, containerInstance=instance_arn)['taskArns']\n return arns\n\ndef has_tasks(cluster, instance_arn, task_arns):\n \"\"\"Return True if the instance is running tasks for the given cluster.\"\"\"\n instances = ecs.describe_container_instances(cluster=cluster, containerInstances=[instance_arn])['containerInstances']\n if not instances:\n return False\n instance = instances[0]\n\n if instance['status'] == 'ACTIVE':\n # Start draining, then try again later\n set_container_instance_to_draining(cluster, instance_arn)\n return True\n\n task_count = None\n\n if task_arns:\n # Fetch details for tasks running on the container instance\n tasks = ecs.describe_tasks(cluster=cluster, tasks=task_arns)['tasks']\n if tasks:\n # Consider any non-stopped tasks as running\n task_count = sum(task['lastStatus'] != 'STOPPED' for task in tasks) + instance['pendingTasksCount']\n\n if not task_count:\n # Fallback to instance task counts if detailed task information is unavailable\n task_count = instance['runningTasksCount'] + instance['pendingTasksCount']\n\n print('Instance %s has %s tasks' % (instance_arn, task_count))\n\n return task_count > 0\n\ndef set_container_instance_to_draining(cluster, instance_arn):\n ecs.update_container_instances_state(\n cluster=cluster,\n containerInstances=[instance_arn], status='DRAINING')\n\n\ndef pick(dct, *keys):\n \"\"\"Pick a subset of a dict.\"\"\"\n return {k: v for k, v in dct.items() if k in keys}\n" }, - "Role": { - "Fn::GetAtt": [ - "Ec2ClusterDefaultAutoScalingGroupDrainECSHookFunctionServiceRole23116FA3", - "Arn" - ] - }, "Environment": { "Variables": { "CLUSTER": { @@ -771,11 +765,17 @@ } }, "Handler": "index.lambda_handler", + "Role": { + "Fn::GetAtt": [ + "Ec2ClusterDefaultAutoScalingGroupDrainECSHookFunctionServiceRole23116FA3", + "Arn" + ] + }, "Runtime": "python3.9", "Tags": [ { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup" + "Value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup" } ], "Timeout": 310 @@ -785,7 +785,7 @@ "Ec2ClusterDefaultAutoScalingGroupDrainECSHookFunctionServiceRole23116FA3" ] }, - "Ec2ClusterDefaultAutoScalingGroupDrainECSHookFunctionAllowInvokeawssfntasksecsec2integEc2ClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopicEE9E39A29ACCEEA3": { + "Ec2ClusterDefaultAutoScalingGroupDrainECSHookFunctionAllowInvokeawssfntasksecsruntaskEc2ClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopicF7B5DFDEB44D2982": { "Type": "AWS::Lambda::Permission", "Properties": { "Action": "lambda:InvokeFunction", @@ -804,15 +804,15 @@ "Ec2ClusterDefaultAutoScalingGroupDrainECSHookFunctionTopic4795E0F6": { "Type": "AWS::SNS::Subscription", "Properties": { - "Protocol": "lambda", - "TopicArn": { - "Ref": "Ec2ClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopicF7263B30" - }, "Endpoint": { "Fn::GetAtt": [ "Ec2ClusterDefaultAutoScalingGroupDrainECSHookFunctionE0DEFB31", "Arn" ] + }, + "Protocol": "lambda", + "TopicArn": { + "Ref": "Ec2ClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopicF7263B30" } } }, @@ -822,7 +822,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup" + "Value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup" } ] } @@ -845,7 +845,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup" + "Value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup" } ] } @@ -879,9 +879,9 @@ "AutoScalingGroupName": { "Ref": "Ec2ClusterDefaultAutoScalingGroupASGC5A6D4C0" }, - "LifecycleTransition": "autoscaling:EC2_INSTANCE_TERMINATING", "DefaultResult": "CONTINUE", "HeartbeatTimeout": 300, + "LifecycleTransition": "autoscaling:EC2_INSTANCE_TERMINATING", "NotificationTargetARN": { "Ref": "Ec2ClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopicF7263B30" }, @@ -921,13 +921,13 @@ { "Essential": true, "Image": { - "Fn::Sub": "${AWS::AccountId}.dkr.ecr.${AWS::Region}.${AWS::URLSuffix}/cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}:7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2" + "Fn::Sub": "${AWS::AccountId}.dkr.ecr.${AWS::Region}.${AWS::URLSuffix}/cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}:d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534" }, "LogConfiguration": { "LogDriver": "awslogs", "Options": { "awslogs-group": { - "Ref": "TaskDefTheContainerLogGroupD94C8EF5" + "Ref": "TaskDefContainerLogGroupB60E6F44" }, "awslogs-stream-prefix": "EventDemo", "awslogs-region": { @@ -936,7 +936,7 @@ } }, "Memory": 256, - "Name": "TheContainer" + "Name": "Container" } ], "ExecutionRoleArn": { @@ -945,7 +945,7 @@ "Arn" ] }, - "Family": "awssfntasksecsec2integTaskDefFAFE2BE7", + "Family": "awssfntasksecsruntaskTaskDef75140181", "NetworkMode": "bridge", "RequiresCompatibilities": [ "EC2" @@ -958,7 +958,7 @@ } } }, - "TaskDefTheContainerLogGroupD94C8EF5": { + "TaskDefContainerLogGroupB60E6F44": { "Type": "AWS::Logs::LogGroup", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Retain" @@ -1029,7 +1029,7 @@ "Effect": "Allow", "Resource": { "Fn::GetAtt": [ - "TaskDefTheContainerLogGroupD94C8EF5", + "TaskDefContainerLogGroupB60E6F44", "Arn" ] } @@ -1070,117 +1070,231 @@ { "Action": "ecs:RunTask", "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - ":", - { - "Ref": "TaskDef54694570" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 2, - { - "Fn::Split": [ - ":", - { - "Ref": "TaskDef54694570" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Ref": "TaskDef54694570" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Ref": "TaskDef54694570" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "/", - { - "Fn::Select": [ - 5, - { - "Fn::Split": [ - ":", - { - "Ref": "TaskDef54694570" - } - ] - } - ] - } - ] - } - ] - }, - "/", - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "/", - { - "Fn::Select": [ - 5, - { - "Fn::Split": [ - ":", - { - "Ref": "TaskDef54694570" - } - ] - } - ] - } - ] - } - ] - } + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + } + ] + } + ] + }, + "/", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + } + ] + } + ] + }, + ":*" + ] ] - ] - } + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + } + ] + } + ] + }, + "/", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + } + ] + } + ] + } + ] + ] + } + ] }, { "Action": [ @@ -1250,12 +1364,6 @@ "StateMachine2E01A3A5": { "Type": "AWS::StepFunctions::StateMachine", "Properties": { - "RoleArn": { - "Fn::GetAtt": [ - "StateMachineRoleB840431D", - "Arn" - ] - }, "DefinitionString": { "Fn::Join": [ "", @@ -1271,9 +1379,15 @@ "Arn" ] }, - "\",\"TaskDefinition\":\"awssfntasksecsec2integTaskDefFAFE2BE7\",\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"TheContainer\",\"Environment\":[{\"Name\":\"SOME_KEY\",\"Value.$\":\"$.SomeKey\"}]}]},\"LaunchType\":\"EC2\"}}}}" + "\",\"TaskDefinition\":\"awssfntasksecsruntaskTaskDef75140181\",\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"Container\",\"Environment\":[{\"Name\":\"SOME_KEY\",\"Value.$\":\"$.SomeKey\"}]}]},\"LaunchType\":\"EC2\"}}}}" ] ] + }, + "RoleArn": { + "Fn::GetAtt": [ + "StateMachineRoleB840431D", + "Arn" + ] } }, "DependsOn": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/cdk.out index f0b901e7c06e5..1f0068d32659a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"32.0.0"} \ No newline at end of file +{"version":"36.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/integ.json index 848b3910874f2..db253efdd3d04 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/integ.json @@ -1,14 +1,12 @@ { - "version": "32.0.0", + "version": "36.0.0", "testCases": { - "integ.ec2-run-task": { + "SfnTasksEcsEc2RunTaskTest/DefaultTest": { "stacks": [ - "aws-sfn-tasks-ecs-ec2-integ" + "aws-sfn-tasks-ecs-run-task" ], - "diffAssets": false, - "stackUpdateWorkflow": true + "assertionStack": "SfnTasksEcsEc2RunTaskTest/DefaultTest/DeployAssert", + "assertionStackName": "SfnTasksEcsEc2RunTaskTestDefaultTestDeployAssert2569343D" } - }, - "synthContext": {}, - "enableLookups": false + } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/manifest.json index d21830841bd41..380a0942b6701 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/manifest.json @@ -1,27 +1,28 @@ { - "version": "32.0.0", + "version": "36.0.0", "artifacts": { - "aws-sfn-tasks-ecs-ec2-integ.assets": { + "aws-sfn-tasks-ecs-run-task.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "aws-sfn-tasks-ecs-ec2-integ.assets.json", + "file": "aws-sfn-tasks-ecs-run-task.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "aws-sfn-tasks-ecs-ec2-integ": { + "aws-sfn-tasks-ecs-run-task": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "aws-sfn-tasks-ecs-ec2-integ.template.json", + "templateFile": "aws-sfn-tasks-ecs-run-task.template.json", + "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/094d02f805367413b48e15531f0003d2531c3c5e3bf3f1f0d6da61227cecae4a.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/95e3c66ed03d4b413dbfdca27bdc41c19f0035e7aab4e92a1fa335f02cd8b768.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "aws-sfn-tasks-ecs-ec2-integ.assets" + "aws-sfn-tasks-ecs-run-task.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", @@ -30,326 +31,365 @@ } }, "dependencies": [ - "aws-sfn-tasks-ecs-ec2-integ.assets" + "aws-sfn-tasks-ecs-run-task.assets" ], "metadata": { - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Resource": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/Resource": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterEE43E89D" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/Resource": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/Resource": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterVpc568127F1" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet1/Subnet": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet1/Subnet": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterVpcPublicSubnet1SubnetD46FD92B" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet1/RouteTable": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet1/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterVpcPublicSubnet1RouteTableE30610F5" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet1/RouteTableAssociation": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet1/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterVpcPublicSubnet1RouteTableAssociation9C78F646" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet1/DefaultRoute": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet1/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterVpcPublicSubnet1DefaultRouteC7FBE273" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet1/EIP": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet1/EIP": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterVpcPublicSubnet1EIPD4B5D142" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet1/NATGateway": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet1/NATGateway": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterVpcPublicSubnet1NATGateway79A8A839" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet2/Subnet": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet2/Subnet": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterVpcPublicSubnet2Subnet207D9E5E" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet2/RouteTable": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet2/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterVpcPublicSubnet2RouteTable44A09188" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet2/RouteTableAssociation": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet2/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterVpcPublicSubnet2RouteTableAssociation7615C6B2" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet2/DefaultRoute": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet2/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterVpcPublicSubnet2DefaultRouteEBA52256" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet2/EIP": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet2/EIP": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterVpcPublicSubnet2EIP921925E6" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet2/NATGateway": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet2/NATGateway": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterVpcPublicSubnet2NATGateway302F96C0" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PrivateSubnet1/Subnet": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PrivateSubnet1/Subnet": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterVpcPrivateSubnet1Subnet0AE9B91E" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PrivateSubnet1/RouteTable": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PrivateSubnet1/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterVpcPrivateSubnet1RouteTable50D391D1" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PrivateSubnet1/RouteTableAssociation": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PrivateSubnet1/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterVpcPrivateSubnet1RouteTableAssociation1043DBDA" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PrivateSubnet1/DefaultRoute": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PrivateSubnet1/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterVpcPrivateSubnet1DefaultRouteD31A76F0" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PrivateSubnet2/Subnet": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PrivateSubnet2/Subnet": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterVpcPrivateSubnet2Subnet16B68C19" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PrivateSubnet2/RouteTable": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PrivateSubnet2/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterVpcPrivateSubnet2RouteTable22B9DAE6" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PrivateSubnet2/RouteTableAssociation": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PrivateSubnet2/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterVpcPrivateSubnet2RouteTableAssociation3AFD70F4" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PrivateSubnet2/DefaultRoute": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PrivateSubnet2/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterVpcPrivateSubnet2DefaultRoute22B3073E" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/IGW": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/IGW": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterVpcIGW605638EB" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/VPCGW": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/VPCGW": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterVpcVPCGW24F3B413" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/InstanceSecurityGroup/Resource": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/InstanceSecurityGroup/Resource": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterDefaultAutoScalingGroupInstanceSecurityGroup149B0A9E" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/InstanceRole/Resource": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/InstanceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterDefaultAutoScalingGroupInstanceRole73D80898" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/InstanceRole/DefaultPolicy/Resource": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/InstanceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterDefaultAutoScalingGroupInstanceRoleDefaultPolicy6D2DC2FD" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/InstanceProfile": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/InstanceProfile": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterDefaultAutoScalingGroupInstanceProfileDB232471" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/LaunchTemplate/Resource": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/LaunchTemplate/Resource": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterDefaultAutoScalingGroupLaunchTemplate346F58BE" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/ASG": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/ASG": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterDefaultAutoScalingGroupASGC5A6D4C0" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function/ServiceRole/Resource": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterDefaultAutoScalingGroupDrainECSHookFunctionServiceRole23116FA3" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function/ServiceRole/DefaultPolicy/Resource": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function/ServiceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterDefaultAutoScalingGroupDrainECSHookFunctionServiceRoleDefaultPolicy638C9E33" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function/Resource": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function/Resource": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterDefaultAutoScalingGroupDrainECSHookFunctionE0DEFB31" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function/AllowInvoke:awssfntasksecsec2integEc2ClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopicEE9E39A2": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function/AllowInvoke:awssfntasksecsruntaskEc2ClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopicF7B5DFDE": [ { "type": "aws:cdk:logicalId", - "data": "Ec2ClusterDefaultAutoScalingGroupDrainECSHookFunctionAllowInvokeawssfntasksecsec2integEc2ClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopicEE9E39A29ACCEEA3" + "data": "Ec2ClusterDefaultAutoScalingGroupDrainECSHookFunctionAllowInvokeawssfntasksecsruntaskEc2ClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopicF7B5DFDEB44D2982" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function/Topic/Resource": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function/Topic/Resource": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterDefaultAutoScalingGroupDrainECSHookFunctionTopic4795E0F6" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Topic/Resource": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Topic/Resource": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopicF7263B30" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Role/Resource": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Role/Resource": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterDefaultAutoScalingGroupLifecycleHookDrainHookRole71045ED7" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Role/DefaultPolicy/Resource": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Role/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterDefaultAutoScalingGroupLifecycleHookDrainHookRoleDefaultPolicyE499974B" } ], - "/aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Resource": [ + "/aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Resource": [ { "type": "aws:cdk:logicalId", "data": "Ec2ClusterDefaultAutoScalingGroupLifecycleHookDrainHook5CB1467E" } ], - "/aws-sfn-tasks-ecs-ec2-integ/SsmParameterValue:--aws--service--ecs--optimized-ami--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ + "/aws-sfn-tasks-ecs-run-task/SsmParameterValue:--aws--service--ecs--optimized-ami--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ { "type": "aws:cdk:logicalId", "data": "SsmParameterValueawsserviceecsoptimizedamiamazonlinux2recommendedimageidC96584B6F00A464EAD1953AFF4B05118Parameter" } ], - "/aws-sfn-tasks-ecs-ec2-integ/TaskDef/TaskRole/Resource": [ + "/aws-sfn-tasks-ecs-run-task/TaskDef/TaskRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "TaskDefTaskRole1EDB4A67" } ], - "/aws-sfn-tasks-ecs-ec2-integ/TaskDef/Resource": [ + "/aws-sfn-tasks-ecs-run-task/TaskDef/Resource": [ { "type": "aws:cdk:logicalId", "data": "TaskDef54694570" } ], - "/aws-sfn-tasks-ecs-ec2-integ/TaskDef/TheContainer/LogGroup/Resource": [ + "/aws-sfn-tasks-ecs-run-task/TaskDef/Container/LogGroup/Resource": [ { "type": "aws:cdk:logicalId", - "data": "TaskDefTheContainerLogGroupD94C8EF5" + "data": "TaskDefContainerLogGroupB60E6F44" } ], - "/aws-sfn-tasks-ecs-ec2-integ/TaskDef/ExecutionRole/Resource": [ + "/aws-sfn-tasks-ecs-run-task/TaskDef/ExecutionRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "TaskDefExecutionRoleB4775C97" } ], - "/aws-sfn-tasks-ecs-ec2-integ/TaskDef/ExecutionRole/DefaultPolicy/Resource": [ + "/aws-sfn-tasks-ecs-run-task/TaskDef/ExecutionRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "TaskDefExecutionRoleDefaultPolicy0DBB737A" } ], - "/aws-sfn-tasks-ecs-ec2-integ/StateMachine/Role/Resource": [ + "/aws-sfn-tasks-ecs-run-task/StateMachine/Role/Resource": [ { "type": "aws:cdk:logicalId", "data": "StateMachineRoleB840431D" } ], - "/aws-sfn-tasks-ecs-ec2-integ/StateMachine/Role/DefaultPolicy/Resource": [ + "/aws-sfn-tasks-ecs-run-task/StateMachine/Role/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "StateMachineRoleDefaultPolicyDF1E6607" } ], - "/aws-sfn-tasks-ecs-ec2-integ/StateMachine/Resource": [ + "/aws-sfn-tasks-ecs-run-task/StateMachine/Resource": [ { "type": "aws:cdk:logicalId", "data": "StateMachine2E01A3A5" } ], - "/aws-sfn-tasks-ecs-ec2-integ/stateMachineArn": [ + "/aws-sfn-tasks-ecs-run-task/stateMachineArn": [ { "type": "aws:cdk:logicalId", "data": "stateMachineArn" } ], - "/aws-sfn-tasks-ecs-ec2-integ/BootstrapVersion": [ + "/aws-sfn-tasks-ecs-run-task/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/aws-sfn-tasks-ecs-ec2-integ/CheckBootstrapVersion": [ + "/aws-sfn-tasks-ecs-run-task/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } + ] + }, + "displayName": "aws-sfn-tasks-ecs-run-task" + }, + "SfnTasksEcsEc2RunTaskTestDefaultTestDeployAssert2569343D.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "SfnTasksEcsEc2RunTaskTestDefaultTestDeployAssert2569343D.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "SfnTasksEcsEc2RunTaskTestDefaultTestDeployAssert2569343D": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "SfnTasksEcsEc2RunTaskTestDefaultTestDeployAssert2569343D.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "SfnTasksEcsEc2RunTaskTestDefaultTestDeployAssert2569343D.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "SfnTasksEcsEc2RunTaskTestDefaultTestDeployAssert2569343D.assets" + ], + "metadata": { + "/SfnTasksEcsEc2RunTaskTest/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } ], - "Ec2ClusterDefaultAutoScalingGroupLaunchTemplateProfileA74899D4": [ + "/SfnTasksEcsEc2RunTaskTest/DefaultTest/DeployAssert/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", - "data": "Ec2ClusterDefaultAutoScalingGroupLaunchTemplateProfileA74899D4", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] + "data": "CheckBootstrapVersion" } ] }, - "displayName": "aws-sfn-tasks-ecs-ec2-integ" + "displayName": "SfnTasksEcsEc2RunTaskTest/DefaultTest/DeployAssert" }, "Tree": { "type": "cdk:tree", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/tree.json index dd9d7c7d9e430..9ecf86d3d0921 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/tree.json @@ -4,33 +4,33 @@ "id": "App", "path": "", "children": { - "aws-sfn-tasks-ecs-ec2-integ": { - "id": "aws-sfn-tasks-ecs-ec2-integ", - "path": "aws-sfn-tasks-ecs-ec2-integ", + "aws-sfn-tasks-ecs-run-task": { + "id": "aws-sfn-tasks-ecs-run-task", + "path": "aws-sfn-tasks-ecs-run-task", "children": { "Ec2Cluster": { "id": "Ec2Cluster", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster", "children": { "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Resource", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::ECS::Cluster", "aws:cdk:cloudformation:props": {} }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ecs.CfnCluster", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Vpc": { "id": "Vpc", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc", "children": { "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/Resource", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::VPC", "aws:cdk:cloudformation:props": { @@ -41,29 +41,26 @@ "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc" + "value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc" } ] } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnVPC", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "PublicSubnet1": { "id": "PublicSubnet1", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet1", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet1", "children": { "Subnet": { "id": "Subnet", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet1/Subnet", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet1/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "Ec2ClusterVpc568127F1" - }, "availabilityZone": { "Fn::Select": [ 0, @@ -85,49 +82,52 @@ }, { "key": "Name", - "value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet1" + "value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet1" } - ] + ], + "vpcId": { + "Ref": "Ec2ClusterVpc568127F1" + } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Acl": { "id": "Acl", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet1/Acl", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet1/Acl", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTable": { "id": "RouteTable", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet1/RouteTable", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet1/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "Ec2ClusterVpc568127F1" - }, "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet1" + "value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet1" } - ] + ], + "vpcId": { + "Ref": "Ec2ClusterVpc568127F1" + } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet1/RouteTableAssociation", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet1/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -140,33 +140,33 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultRoute": { "id": "DefaultRoute", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet1/DefaultRoute", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet1/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "Ec2ClusterVpcPublicSubnet1RouteTableE30610F5" - }, "destinationCidrBlock": "0.0.0.0/0", "gatewayId": { "Ref": "Ec2ClusterVpcIGW605638EB" + }, + "routeTableId": { + "Ref": "Ec2ClusterVpcPublicSubnet1RouteTableE30610F5" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "EIP": { "id": "EIP", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet1/EIP", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet1/EIP", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::EIP", "aws:cdk:cloudformation:props": { @@ -174,63 +174,60 @@ "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet1" + "value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet1" } ] } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "NATGateway": { "id": "NATGateway", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet1/NATGateway", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet1/NATGateway", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", "aws:cdk:cloudformation:props": { - "subnetId": { - "Ref": "Ec2ClusterVpcPublicSubnet1SubnetD46FD92B" - }, "allocationId": { "Fn::GetAtt": [ "Ec2ClusterVpcPublicSubnet1EIPD4B5D142", "AllocationId" ] }, + "subnetId": { + "Ref": "Ec2ClusterVpcPublicSubnet1SubnetD46FD92B" + }, "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet1" + "value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet1" } ] } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "PublicSubnet2": { "id": "PublicSubnet2", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet2", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet2", "children": { "Subnet": { "id": "Subnet", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet2/Subnet", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet2/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "Ec2ClusterVpc568127F1" - }, "availabilityZone": { "Fn::Select": [ 1, @@ -252,49 +249,52 @@ }, { "key": "Name", - "value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet2" + "value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet2" } - ] + ], + "vpcId": { + "Ref": "Ec2ClusterVpc568127F1" + } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Acl": { "id": "Acl", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet2/Acl", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet2/Acl", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTable": { "id": "RouteTable", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet2/RouteTable", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet2/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "Ec2ClusterVpc568127F1" - }, "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet2" + "value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet2" } - ] + ], + "vpcId": { + "Ref": "Ec2ClusterVpc568127F1" + } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet2/RouteTableAssociation", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet2/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -307,33 +307,33 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultRoute": { "id": "DefaultRoute", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet2/DefaultRoute", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet2/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "Ec2ClusterVpcPublicSubnet2RouteTable44A09188" - }, "destinationCidrBlock": "0.0.0.0/0", "gatewayId": { "Ref": "Ec2ClusterVpcIGW605638EB" + }, + "routeTableId": { + "Ref": "Ec2ClusterVpcPublicSubnet2RouteTable44A09188" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "EIP": { "id": "EIP", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet2/EIP", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet2/EIP", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::EIP", "aws:cdk:cloudformation:props": { @@ -341,63 +341,60 @@ "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet2" + "value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet2" } ] } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "NATGateway": { "id": "NATGateway", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet2/NATGateway", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet2/NATGateway", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", "aws:cdk:cloudformation:props": { - "subnetId": { - "Ref": "Ec2ClusterVpcPublicSubnet2Subnet207D9E5E" - }, "allocationId": { "Fn::GetAtt": [ "Ec2ClusterVpcPublicSubnet2EIP921925E6", "AllocationId" ] }, + "subnetId": { + "Ref": "Ec2ClusterVpcPublicSubnet2Subnet207D9E5E" + }, "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PublicSubnet2" + "value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PublicSubnet2" } ] } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "PrivateSubnet1": { "id": "PrivateSubnet1", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PrivateSubnet1", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PrivateSubnet1", "children": { "Subnet": { "id": "Subnet", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PrivateSubnet1/Subnet", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PrivateSubnet1/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "Ec2ClusterVpc568127F1" - }, "availabilityZone": { "Fn::Select": [ 0, @@ -419,49 +416,52 @@ }, { "key": "Name", - "value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PrivateSubnet1" + "value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PrivateSubnet1" } - ] + ], + "vpcId": { + "Ref": "Ec2ClusterVpc568127F1" + } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Acl": { "id": "Acl", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PrivateSubnet1/Acl", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PrivateSubnet1/Acl", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTable": { "id": "RouteTable", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PrivateSubnet1/RouteTable", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PrivateSubnet1/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "Ec2ClusterVpc568127F1" - }, "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PrivateSubnet1" + "value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PrivateSubnet1" } - ] + ], + "vpcId": { + "Ref": "Ec2ClusterVpc568127F1" + } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PrivateSubnet1/RouteTableAssociation", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PrivateSubnet1/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -474,49 +474,46 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultRoute": { "id": "DefaultRoute", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PrivateSubnet1/DefaultRoute", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PrivateSubnet1/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "Ec2ClusterVpcPrivateSubnet1RouteTable50D391D1" - }, "destinationCidrBlock": "0.0.0.0/0", "natGatewayId": { "Ref": "Ec2ClusterVpcPublicSubnet1NATGateway79A8A839" + }, + "routeTableId": { + "Ref": "Ec2ClusterVpcPrivateSubnet1RouteTable50D391D1" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "PrivateSubnet2": { "id": "PrivateSubnet2", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PrivateSubnet2", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PrivateSubnet2", "children": { "Subnet": { "id": "Subnet", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PrivateSubnet2/Subnet", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PrivateSubnet2/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "Ec2ClusterVpc568127F1" - }, "availabilityZone": { "Fn::Select": [ 1, @@ -538,49 +535,52 @@ }, { "key": "Name", - "value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PrivateSubnet2" + "value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PrivateSubnet2" } - ] + ], + "vpcId": { + "Ref": "Ec2ClusterVpc568127F1" + } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Acl": { "id": "Acl", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PrivateSubnet2/Acl", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PrivateSubnet2/Acl", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTable": { "id": "RouteTable", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PrivateSubnet2/RouteTable", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PrivateSubnet2/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "Ec2ClusterVpc568127F1" - }, "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PrivateSubnet2" + "value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PrivateSubnet2" } - ] + ], + "vpcId": { + "Ref": "Ec2ClusterVpc568127F1" + } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PrivateSubnet2/RouteTableAssociation", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PrivateSubnet2/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -593,95 +593,95 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultRoute": { "id": "DefaultRoute", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/PrivateSubnet2/DefaultRoute", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/PrivateSubnet2/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "Ec2ClusterVpcPrivateSubnet2RouteTable22B9DAE6" - }, "destinationCidrBlock": "0.0.0.0/0", "natGatewayId": { "Ref": "Ec2ClusterVpcPublicSubnet2NATGateway302F96C0" + }, + "routeTableId": { + "Ref": "Ec2ClusterVpcPrivateSubnet2RouteTable22B9DAE6" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "IGW": { "id": "IGW", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/IGW", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/IGW", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", "aws:cdk:cloudformation:props": { "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc" + "value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc" } ] } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnInternetGateway", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "VPCGW": { "id": "VPCGW", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/Vpc/VPCGW", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/Vpc/VPCGW", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "Ec2ClusterVpc568127F1" - }, "internetGatewayId": { "Ref": "Ec2ClusterVpcIGW605638EB" + }, + "vpcId": { + "Ref": "Ec2ClusterVpc568127F1" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnVPCGatewayAttachment", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.Vpc", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultAutoScalingGroup": { "id": "DefaultAutoScalingGroup", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup", "children": { "InstanceSecurityGroup": { "id": "InstanceSecurityGroup", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/InstanceSecurityGroup", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/InstanceSecurityGroup", "children": { "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/InstanceSecurityGroup/Resource", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/InstanceSecurityGroup/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", "aws:cdk:cloudformation:props": { - "groupDescription": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/InstanceSecurityGroup", + "groupDescription": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/InstanceSecurityGroup", "securityGroupEgress": [ { "cidrIp": "0.0.0.0/0", @@ -692,7 +692,7 @@ "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup" + "value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup" } ], "vpcId": { @@ -701,31 +701,31 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSecurityGroup", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.SecurityGroup", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "InstanceRole": { "id": "InstanceRole", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/InstanceRole", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/InstanceRole", "children": { "ImportInstanceRole": { "id": "ImportInstanceRole", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/InstanceRole/ImportInstanceRole", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/InstanceRole/ImportInstanceRole", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/InstanceRole/Resource", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/InstanceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -744,23 +744,23 @@ "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup" + "value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup" } ] } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/InstanceRole/DefaultPolicy", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/InstanceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/InstanceRole/DefaultPolicy/Resource", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/InstanceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -820,25 +820,25 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "InstanceProfile": { "id": "InstanceProfile", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/InstanceProfile", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/InstanceProfile", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::InstanceProfile", "aws:cdk:cloudformation:props": { @@ -850,17 +850,25 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnInstanceProfile", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "ImportedInstanceProfile": { + "id": "ImportedInstanceProfile", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/ImportedInstanceProfile", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "LaunchTemplate": { "id": "LaunchTemplate", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/LaunchTemplate", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/LaunchTemplate", "children": { "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/LaunchTemplate/Resource", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/LaunchTemplate/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::LaunchTemplate", "aws:cdk:cloudformation:props": { @@ -894,7 +902,7 @@ "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/LaunchTemplate" + "value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/LaunchTemplate" } ] }, @@ -903,7 +911,7 @@ "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/LaunchTemplate" + "value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/LaunchTemplate" } ] } @@ -929,7 +937,7 @@ "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/LaunchTemplate" + "value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/LaunchTemplate" } ] } @@ -937,24 +945,22 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnLaunchTemplate", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.LaunchTemplate", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "ASG": { "id": "ASG", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/ASG", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/ASG", "attributes": { "aws:cdk:cloudformation:type": "AWS::AutoScaling::AutoScalingGroup", "aws:cdk:cloudformation:props": { - "maxSize": "1", - "minSize": "1", "launchTemplate": { "launchTemplateId": { "Ref": "Ec2ClusterDefaultAutoScalingGroupLaunchTemplate346F58BE" @@ -966,10 +972,12 @@ ] } }, + "maxSize": "1", + "minSize": "1", "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup", + "value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup", "propagateAtLaunch": true } ], @@ -984,33 +992,33 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_autoscaling.CfnAutoScalingGroup", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DrainECSHook": { "id": "DrainECSHook", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook", "children": { "Function": { "id": "Function", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function/ServiceRole", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function/ServiceRole/ImportServiceRole", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function/ServiceRole/ImportServiceRole", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function/ServiceRole/Resource", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1043,23 +1051,23 @@ "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup" + "value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup" } ] } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function/ServiceRole/DefaultPolicy", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function/ServiceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function/ServiceRole/DefaultPolicy/Resource", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function/ServiceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -1148,37 +1156,31 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function/Resource", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { "code": { "zipFile": "import boto3, json, os, time\n\necs = boto3.client('ecs')\nautoscaling = boto3.client('autoscaling')\n\n\ndef lambda_handler(event, context):\n print(json.dumps(dict(event, ResponseURL='...')))\n cluster = os.environ['CLUSTER']\n snsTopicArn = event['Records'][0]['Sns']['TopicArn']\n lifecycle_event = json.loads(event['Records'][0]['Sns']['Message'])\n instance_id = lifecycle_event.get('EC2InstanceId')\n if not instance_id:\n print('Got event without EC2InstanceId: %s', json.dumps(dict(event, ResponseURL='...')))\n return\n\n instance_arn = container_instance_arn(cluster, instance_id)\n print('Instance %s has container instance ARN %s' % (lifecycle_event['EC2InstanceId'], instance_arn))\n\n if not instance_arn:\n return\n\n task_arns = container_instance_task_arns(cluster, instance_arn)\n\n if task_arns:\n print('Instance ARN %s has task ARNs %s' % (instance_arn, ', '.join(task_arns)))\n\n while has_tasks(cluster, instance_arn, task_arns):\n time.sleep(10)\n\n try:\n print('Terminating instance %s' % instance_id)\n autoscaling.complete_lifecycle_action(\n LifecycleActionResult='CONTINUE',\n **pick(lifecycle_event, 'LifecycleHookName', 'LifecycleActionToken', 'AutoScalingGroupName'))\n except Exception as e:\n # Lifecycle action may have already completed.\n print(str(e))\n\n\ndef container_instance_arn(cluster, instance_id):\n \"\"\"Turn an instance ID into a container instance ARN.\"\"\"\n arns = ecs.list_container_instances(cluster=cluster, filter='ec2InstanceId==' + instance_id)['containerInstanceArns']\n if not arns:\n return None\n return arns[0]\n\ndef container_instance_task_arns(cluster, instance_arn):\n \"\"\"Fetch tasks for a container instance ARN.\"\"\"\n arns = ecs.list_tasks(cluster=cluster, containerInstance=instance_arn)['taskArns']\n return arns\n\ndef has_tasks(cluster, instance_arn, task_arns):\n \"\"\"Return True if the instance is running tasks for the given cluster.\"\"\"\n instances = ecs.describe_container_instances(cluster=cluster, containerInstances=[instance_arn])['containerInstances']\n if not instances:\n return False\n instance = instances[0]\n\n if instance['status'] == 'ACTIVE':\n # Start draining, then try again later\n set_container_instance_to_draining(cluster, instance_arn)\n return True\n\n task_count = None\n\n if task_arns:\n # Fetch details for tasks running on the container instance\n tasks = ecs.describe_tasks(cluster=cluster, tasks=task_arns)['tasks']\n if tasks:\n # Consider any non-stopped tasks as running\n task_count = sum(task['lastStatus'] != 'STOPPED' for task in tasks) + instance['pendingTasksCount']\n\n if not task_count:\n # Fallback to instance task counts if detailed task information is unavailable\n task_count = instance['runningTasksCount'] + instance['pendingTasksCount']\n\n print('Instance %s has %s tasks' % (instance_arn, task_count))\n\n return task_count > 0\n\ndef set_container_instance_to_draining(cluster, instance_arn):\n ecs.update_container_instances_state(\n cluster=cluster,\n containerInstances=[instance_arn], status='DRAINING')\n\n\ndef pick(dct, *keys):\n \"\"\"Pick a subset of a dict.\"\"\"\n return {k: v for k, v in dct.items() if k in keys}\n" }, - "role": { - "Fn::GetAtt": [ - "Ec2ClusterDefaultAutoScalingGroupDrainECSHookFunctionServiceRole23116FA3", - "Arn" - ] - }, "environment": { "variables": { "CLUSTER": { @@ -1187,24 +1189,30 @@ } }, "handler": "index.lambda_handler", + "role": { + "Fn::GetAtt": [ + "Ec2ClusterDefaultAutoScalingGroupDrainECSHookFunctionServiceRole23116FA3", + "Arn" + ] + }, "runtime": "python3.9", "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup" + "value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup" } ], "timeout": 310 } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, - "AllowInvoke:awssfntasksecsec2integEc2ClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopicEE9E39A2": { - "id": "AllowInvoke:awssfntasksecsec2integEc2ClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopicEE9E39A2", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function/AllowInvoke:awssfntasksecsec2integEc2ClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopicEE9E39A2", + "AllowInvoke:awssfntasksecsruntaskEc2ClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopicF7B5DFDE": { + "id": "AllowInvoke:awssfntasksecsruntaskEc2ClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopicF7B5DFDE", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function/AllowInvoke:awssfntasksecsruntaskEc2ClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopicF7B5DFDE", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", "aws:cdk:cloudformation:props": { @@ -1222,103 +1230,103 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Topic": { "id": "Topic", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function/Topic", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function/Topic", "children": { "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function/Topic/Resource", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/DrainECSHook/Function/Topic/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::SNS::Subscription", "aws:cdk:cloudformation:props": { - "protocol": "lambda", - "topicArn": { - "Ref": "Ec2ClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopicF7263B30" - }, "endpoint": { "Fn::GetAtt": [ "Ec2ClusterDefaultAutoScalingGroupDrainECSHookFunctionE0DEFB31", "Arn" ] + }, + "protocol": "lambda", + "topicArn": { + "Ref": "Ec2ClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopicF7263B30" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_sns.CfnSubscription", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_sns.Subscription", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.Function", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.3.0" } }, "LifecycleHookDrainHook": { "id": "LifecycleHookDrainHook", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/LifecycleHookDrainHook", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/LifecycleHookDrainHook", "children": { "Topic": { "id": "Topic", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Topic", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Topic", "children": { "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Topic/Resource", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Topic/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::SNS::Topic", "aws:cdk:cloudformation:props": { "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup" + "value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup" } ] } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_sns.CfnTopic", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_sns.Topic", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Role": { "id": "Role", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Role", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Role", "children": { "ImportRole": { "id": "ImportRole", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Role/ImportRole", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Role/ImportRole", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Role/Resource", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Role/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1337,23 +1345,23 @@ "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup" + "value": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup" } ] } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Role/DefaultPolicy", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Role/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Role/DefaultPolicy/Resource", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Role/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -1378,34 +1386,34 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-ec2-integ/Ec2Cluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Resource", + "path": "aws-sfn-tasks-ecs-run-task/Ec2Cluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::AutoScaling::LifecycleHook", "aws:cdk:cloudformation:props": { "autoScalingGroupName": { "Ref": "Ec2ClusterDefaultAutoScalingGroupASGC5A6D4C0" }, - "lifecycleTransition": "autoscaling:EC2_INSTANCE_TERMINATING", "defaultResult": "CONTINUE", "heartbeatTimeout": 300, + "lifecycleTransition": "autoscaling:EC2_INSTANCE_TERMINATING", "notificationTargetArn": { "Ref": "Ec2ClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopicF7263B30" }, @@ -1418,63 +1426,63 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_autoscaling.CfnLifecycleHook", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_autoscaling.LifecycleHook", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_autoscaling.AutoScalingGroup", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ecs.Cluster", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "SsmParameterValue:--aws--service--ecs--optimized-ami--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": { "id": "SsmParameterValue:--aws--service--ecs--optimized-ami--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", - "path": "aws-sfn-tasks-ecs-ec2-integ/SsmParameterValue:--aws--service--ecs--optimized-ami--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", + "path": "aws-sfn-tasks-ecs-run-task/SsmParameterValue:--aws--service--ecs--optimized-ami--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", "constructInfo": { - "fqn": "aws-cdk-lib.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "SsmParameterValue:--aws--service--ecs--optimized-ami--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118": { "id": "SsmParameterValue:--aws--service--ecs--optimized-ami--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", - "path": "aws-sfn-tasks-ecs-ec2-integ/SsmParameterValue:--aws--service--ecs--optimized-ami--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", + "path": "aws-sfn-tasks-ecs-run-task/SsmParameterValue:--aws--service--ecs--optimized-ami--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "TaskDef": { "id": "TaskDef", - "path": "aws-sfn-tasks-ecs-ec2-integ/TaskDef", + "path": "aws-sfn-tasks-ecs-run-task/TaskDef", "children": { "TaskRole": { "id": "TaskRole", - "path": "aws-sfn-tasks-ecs-ec2-integ/TaskDef/TaskRole", + "path": "aws-sfn-tasks-ecs-run-task/TaskDef/TaskRole", "children": { "ImportTaskRole": { "id": "ImportTaskRole", - "path": "aws-sfn-tasks-ecs-ec2-integ/TaskDef/TaskRole/ImportTaskRole", + "path": "aws-sfn-tasks-ecs-run-task/TaskDef/TaskRole/ImportTaskRole", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-ec2-integ/TaskDef/TaskRole/Resource", + "path": "aws-sfn-tasks-ecs-run-task/TaskDef/TaskRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1493,19 +1501,19 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-ec2-integ/TaskDef/Resource", + "path": "aws-sfn-tasks-ecs-run-task/TaskDef/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::ECS::TaskDefinition", "aws:cdk:cloudformation:props": { @@ -1513,15 +1521,15 @@ { "essential": true, "image": { - "Fn::Sub": "${AWS::AccountId}.dkr.ecr.${AWS::Region}.${AWS::URLSuffix}/cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}:7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2" + "Fn::Sub": "${AWS::AccountId}.dkr.ecr.${AWS::Region}.${AWS::URLSuffix}/cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}:d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534" }, "memory": 256, - "name": "TheContainer", + "name": "Container", "logConfiguration": { "logDriver": "awslogs", "options": { "awslogs-group": { - "Ref": "TaskDefTheContainerLogGroupD94C8EF5" + "Ref": "TaskDefContainerLogGroupB60E6F44" }, "awslogs-stream-prefix": "EventDemo", "awslogs-region": { @@ -1537,7 +1545,7 @@ "Arn" ] }, - "family": "awssfntasksecsec2integTaskDefFAFE2BE7", + "family": "awssfntasksecsruntaskTaskDef75140181", "networkMode": "bridge", "requiresCompatibilities": [ "EC2" @@ -1551,83 +1559,83 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ecs.CfnTaskDefinition", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, - "TheContainer": { - "id": "TheContainer", - "path": "aws-sfn-tasks-ecs-ec2-integ/TaskDef/TheContainer", + "Container": { + "id": "Container", + "path": "aws-sfn-tasks-ecs-run-task/TaskDef/Container", "children": { "AssetImage": { "id": "AssetImage", - "path": "aws-sfn-tasks-ecs-ec2-integ/TaskDef/TheContainer/AssetImage", + "path": "aws-sfn-tasks-ecs-run-task/TaskDef/Container/AssetImage", "children": { "Staging": { "id": "Staging", - "path": "aws-sfn-tasks-ecs-ec2-integ/TaskDef/TheContainer/AssetImage/Staging", + "path": "aws-sfn-tasks-ecs-run-task/TaskDef/Container/AssetImage/Staging", "constructInfo": { - "fqn": "aws-cdk-lib.AssetStaging", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Repository": { "id": "Repository", - "path": "aws-sfn-tasks-ecs-ec2-integ/TaskDef/TheContainer/AssetImage/Repository", + "path": "aws-sfn-tasks-ecs-run-task/TaskDef/Container/AssetImage/Repository", "constructInfo": { - "fqn": "aws-cdk-lib.aws_ecr.RepositoryBase", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ecr_assets.DockerImageAsset", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "LogGroup": { "id": "LogGroup", - "path": "aws-sfn-tasks-ecs-ec2-integ/TaskDef/TheContainer/LogGroup", + "path": "aws-sfn-tasks-ecs-run-task/TaskDef/Container/LogGroup", "children": { "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-ec2-integ/TaskDef/TheContainer/LogGroup/Resource", + "path": "aws-sfn-tasks-ecs-run-task/TaskDef/Container/LogGroup/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", "aws:cdk:cloudformation:props": {} }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_logs.LogGroup", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ecs.ContainerDefinition", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "ExecutionRole": { "id": "ExecutionRole", - "path": "aws-sfn-tasks-ecs-ec2-integ/TaskDef/ExecutionRole", + "path": "aws-sfn-tasks-ecs-run-task/TaskDef/ExecutionRole", "children": { "ImportExecutionRole": { "id": "ImportExecutionRole", - "path": "aws-sfn-tasks-ecs-ec2-integ/TaskDef/ExecutionRole/ImportExecutionRole", + "path": "aws-sfn-tasks-ecs-run-task/TaskDef/ExecutionRole/ImportExecutionRole", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-ec2-integ/TaskDef/ExecutionRole/Resource", + "path": "aws-sfn-tasks-ecs-run-task/TaskDef/ExecutionRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1646,17 +1654,17 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-sfn-tasks-ecs-ec2-integ/TaskDef/ExecutionRole/DefaultPolicy", + "path": "aws-sfn-tasks-ecs-run-task/TaskDef/ExecutionRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-ec2-integ/TaskDef/ExecutionRole/DefaultPolicy/Resource", + "path": "aws-sfn-tasks-ecs-run-task/TaskDef/ExecutionRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -1706,7 +1714,7 @@ "Effect": "Allow", "Resource": { "Fn::GetAtt": [ - "TaskDefTheContainerLogGroupD94C8EF5", + "TaskDefContainerLogGroupB60E6F44", "Arn" ] } @@ -1723,63 +1731,63 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ecs.Ec2TaskDefinition", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Start": { "id": "Start", - "path": "aws-sfn-tasks-ecs-ec2-integ/Start", + "path": "aws-sfn-tasks-ecs-run-task/Start", "constructInfo": { - "fqn": "aws-cdk-lib.aws_stepfunctions.Pass", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Run": { "id": "Run", - "path": "aws-sfn-tasks-ecs-ec2-integ/Run", + "path": "aws-sfn-tasks-ecs-run-task/Run", "constructInfo": { - "fqn": "aws-cdk-lib.aws_stepfunctions_tasks.EcsRunTask", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "StateMachine": { "id": "StateMachine", - "path": "aws-sfn-tasks-ecs-ec2-integ/StateMachine", + "path": "aws-sfn-tasks-ecs-run-task/StateMachine", "children": { "Role": { "id": "Role", - "path": "aws-sfn-tasks-ecs-ec2-integ/StateMachine/Role", + "path": "aws-sfn-tasks-ecs-run-task/StateMachine/Role", "children": { "ImportRole": { "id": "ImportRole", - "path": "aws-sfn-tasks-ecs-ec2-integ/StateMachine/Role/ImportRole", + "path": "aws-sfn-tasks-ecs-run-task/StateMachine/Role/ImportRole", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-ec2-integ/StateMachine/Role/Resource", + "path": "aws-sfn-tasks-ecs-run-task/StateMachine/Role/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1798,17 +1806,17 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-sfn-tasks-ecs-ec2-integ/StateMachine/Role/DefaultPolicy", + "path": "aws-sfn-tasks-ecs-run-task/StateMachine/Role/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-ec2-integ/StateMachine/Role/DefaultPolicy/Resource", + "path": "aws-sfn-tasks-ecs-run-task/StateMachine/Role/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -1817,117 +1825,231 @@ { "Action": "ecs:RunTask", "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - ":", - { - "Ref": "TaskDef54694570" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 2, - { - "Fn::Split": [ - ":", - { - "Ref": "TaskDef54694570" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Ref": "TaskDef54694570" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Ref": "TaskDef54694570" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "/", - { - "Fn::Select": [ - 5, - { - "Fn::Split": [ - ":", - { - "Ref": "TaskDef54694570" - } - ] - } - ] - } - ] - } - ] - }, - "/", - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "/", - { - "Fn::Select": [ - 5, - { - "Fn::Split": [ - ":", - { - "Ref": "TaskDef54694570" - } - ] - } - ] - } - ] - } - ] - } + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + } + ] + } + ] + }, + "/", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + } + ] + } + ] + }, + ":*" + ] ] - ] - } + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + } + ] + } + ] + }, + "/", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + } + ] + } + ] + } + ] + ] + } + ] }, { "Action": [ @@ -1995,34 +2117,28 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-ec2-integ/StateMachine/Resource", + "path": "aws-sfn-tasks-ecs-run-task/StateMachine/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::StepFunctions::StateMachine", "aws:cdk:cloudformation:props": { - "roleArn": { - "Fn::GetAtt": [ - "StateMachineRoleB840431D", - "Arn" - ] - }, "definitionString": { "Fn::Join": [ "", @@ -2038,50 +2154,110 @@ "Arn" ] }, - "\",\"TaskDefinition\":\"awssfntasksecsec2integTaskDefFAFE2BE7\",\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"TheContainer\",\"Environment\":[{\"Name\":\"SOME_KEY\",\"Value.$\":\"$.SomeKey\"}]}]},\"LaunchType\":\"EC2\"}}}}" + "\",\"TaskDefinition\":\"awssfntasksecsruntaskTaskDef75140181\",\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"Container\",\"Environment\":[{\"Name\":\"SOME_KEY\",\"Value.$\":\"$.SomeKey\"}]}]},\"LaunchType\":\"EC2\"}}}}" ] ] + }, + "roleArn": { + "Fn::GetAtt": [ + "StateMachineRoleB840431D", + "Arn" + ] } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_stepfunctions.CfnStateMachine", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_stepfunctions.StateMachine", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "stateMachineArn": { "id": "stateMachineArn", - "path": "aws-sfn-tasks-ecs-ec2-integ/stateMachineArn", + "path": "aws-sfn-tasks-ecs-run-task/stateMachineArn", "constructInfo": { - "fqn": "aws-cdk-lib.CfnOutput", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "BootstrapVersion": { "id": "BootstrapVersion", - "path": "aws-sfn-tasks-ecs-ec2-integ/BootstrapVersion", + "path": "aws-sfn-tasks-ecs-run-task/BootstrapVersion", "constructInfo": { - "fqn": "aws-cdk-lib.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "aws-sfn-tasks-ecs-ec2-integ/CheckBootstrapVersion", + "path": "aws-sfn-tasks-ecs-run-task/CheckBootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "SfnTasksEcsEc2RunTaskTest": { + "id": "SfnTasksEcsEc2RunTaskTest", + "path": "SfnTasksEcsEc2RunTaskTest", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "SfnTasksEcsEc2RunTaskTest/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "SfnTasksEcsEc2RunTaskTest/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "SfnTasksEcsEc2RunTaskTest/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "SfnTasksEcsEc2RunTaskTest/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "SfnTasksEcsEc2RunTaskTest/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, "constructInfo": { - "fqn": "aws-cdk-lib.CfnRule", + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.Stack", + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", "version": "0.0.0" } }, @@ -2090,13 +2266,13 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.App", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.ts index 21cc9f38f9160..5c2fd6afd0ebd 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.ts @@ -5,6 +5,7 @@ import * as sfn from 'aws-cdk-lib/aws-stepfunctions'; import * as cdk from 'aws-cdk-lib'; import * as tasks from 'aws-cdk-lib/aws-stepfunctions-tasks'; import { EC2_RESTRICT_DEFAULT_SECURITY_GROUP } from 'aws-cdk-lib/cx-api'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; /* * * Creates a state machine with a task state to run a job with ECS on EC2 @@ -17,7 +18,7 @@ import { EC2_RESTRICT_DEFAULT_SECURITY_GROUP } from 'aws-cdk-lib/cx-api'; * -- aws stepfunctions describe-execution --execution-arn returns a status of `Succeeded` */ const app = new cdk.App(); -const stack = new cdk.Stack(app, 'aws-sfn-tasks-ecs-ec2-integ'); +const stack = new cdk.Stack(app, 'aws-sfn-tasks-ecs-run-task'); stack.node.setContext(EC2_RESTRICT_DEFAULT_SECURITY_GROUP, false); const cluster = new ecs.Cluster(stack, 'Ec2Cluster'); @@ -28,7 +29,7 @@ cluster.addCapacity('DefaultAutoScalingGroup', { // Build task definition const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); -const containerDefinition = taskDefinition.addContainer('TheContainer', { +const containerDefinition = taskDefinition.addContainer('Container', { image: ecs.ContainerImage.fromAsset(path.resolve(__dirname, 'eventhandler-image')), memoryLimitMiB: 256, logging: new ecs.AwsLogDriver({ streamPrefix: 'EventDemo' }), @@ -65,4 +66,8 @@ new cdk.CfnOutput(stack, 'stateMachineArn', { value: sm.stateMachineArn, }); +new IntegTest(app, 'SfnTasksEcsEc2RunTaskTest', { + testCases: [stack], +}); + app.synth(); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/SfnTasksEcsEc2TaskTestDefaultTestDeployAssert9E1A388C.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/SfnTasksEcsEc2TaskTestDefaultTestDeployAssert9E1A388C.assets.json new file mode 100644 index 0000000000000..be6172954b1a6 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/SfnTasksEcsEc2TaskTestDefaultTestDeployAssert9E1A388C.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "SfnTasksEcsEc2TaskTestDefaultTestDeployAssert9E1A388C.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/SfnTasksEcsEc2TaskTestDefaultTestDeployAssert9E1A388C.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/SfnTasksEcsEc2TaskTestDefaultTestDeployAssert9E1A388C.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/SfnTasksEcsEc2TaskTestDefaultTestDeployAssert9E1A388C.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2/Dockerfile b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2/Dockerfile deleted file mode 100644 index 235b30e9661ed..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM public.ecr.aws/lambda/python:3.6 -EXPOSE 8000 -WORKDIR /src -ADD . /src -CMD python3 index.py diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534/Dockerfile b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534/Dockerfile new file mode 100644 index 0000000000000..23cf9b3e22f5d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534/Dockerfile @@ -0,0 +1,3 @@ +FROM public.ecr.aws/docker/library/python:3.12 +ADD index.py . +CMD [ "python3", "./index.py" ] diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2/index.py b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534/index.py similarity index 82% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2/index.py rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534/index.py index c4cab119afc2d..730f1be5ad06e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2/index.py +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534/index.py @@ -1,4 +1,3 @@ -#!/usr/bin/python import os import pprint diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/aws-ecs-integ2.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/aws-sfn-tasks-ecs-task.assets.json similarity index 60% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/aws-ecs-integ2.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/aws-sfn-tasks-ecs-task.assets.json index 832794ac26a69..7b20bcee09ac9 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/aws-ecs-integ2.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/aws-sfn-tasks-ecs-task.assets.json @@ -1,29 +1,29 @@ { - "version": "32.0.0", + "version": "36.0.0", "files": { - "c3be3861b160a5c4b786a665bc563d4af7f3789d729e9568e720d7e14d398b6c": { + "3def9ee7b59a962a2c1b87f53788e50585c78f8b28084882a58d0b6796594f37": { "source": { - "path": "aws-ecs-integ2.template.json", + "path": "aws-sfn-tasks-ecs-task.template.json", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "c3be3861b160a5c4b786a665bc563d4af7f3789d729e9568e720d7e14d398b6c.json", + "objectKey": "3def9ee7b59a962a2c1b87f53788e50585c78f8b28084882a58d0b6796594f37.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } } }, "dockerImages": { - "7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2": { + "d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534": { "source": { - "directory": "asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2" + "directory": "asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534" }, "destinations": { "current_account-current_region": { "repositoryName": "cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}", - "imageTag": "7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2", + "imageTag": "d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-image-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/aws-ecs-integ2.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/aws-sfn-tasks-ecs-task.template.json similarity index 91% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/aws-ecs-integ2.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/aws-sfn-tasks-ecs-task.template.json index f5dd2baccaa15..5f3399c06dfee 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/aws-ecs-integ2.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/aws-sfn-tasks-ecs-task.template.json @@ -13,7 +13,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/Vpc" + "Value": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc" } ] } @@ -21,9 +21,6 @@ "FargateClusterVpcPublicSubnet1SubnetB9C24BC7": { "Type": "AWS::EC2::Subnet", "Properties": { - "VpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "AvailabilityZone": { "Fn::Select": [ 0, @@ -45,23 +42,26 @@ }, { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1" + "Value": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet1" } - ] + ], + "VpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "FargateClusterVpcPublicSubnet1RouteTable1D7FA747": { "Type": "AWS::EC2::RouteTable", "Properties": { - "VpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1" + "Value": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet1" } - ] + ], + "VpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "FargateClusterVpcPublicSubnet1RouteTableAssociation80F1442F": { @@ -78,12 +78,12 @@ "FargateClusterVpcPublicSubnet1DefaultRoute80086690": { "Type": "AWS::EC2::Route", "Properties": { - "RouteTableId": { - "Ref": "FargateClusterVpcPublicSubnet1RouteTable1D7FA747" - }, "DestinationCidrBlock": "0.0.0.0/0", "GatewayId": { "Ref": "FargateClusterVpcIGW827638CB" + }, + "RouteTableId": { + "Ref": "FargateClusterVpcPublicSubnet1RouteTable1D7FA747" } }, "DependsOn": [ @@ -97,7 +97,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1" + "Value": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet1" } ] } @@ -105,19 +105,19 @@ "FargateClusterVpcPublicSubnet1NATGateway5202D86A": { "Type": "AWS::EC2::NatGateway", "Properties": { - "SubnetId": { - "Ref": "FargateClusterVpcPublicSubnet1SubnetB9C24BC7" - }, "AllocationId": { "Fn::GetAtt": [ "FargateClusterVpcPublicSubnet1EIPF91909D0", "AllocationId" ] }, + "SubnetId": { + "Ref": "FargateClusterVpcPublicSubnet1SubnetB9C24BC7" + }, "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1" + "Value": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet1" } ] }, @@ -129,9 +129,6 @@ "FargateClusterVpcPublicSubnet2Subnet24C0F9D8": { "Type": "AWS::EC2::Subnet", "Properties": { - "VpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "AvailabilityZone": { "Fn::Select": [ 1, @@ -153,23 +150,26 @@ }, { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2" + "Value": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet2" } - ] + ], + "VpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "FargateClusterVpcPublicSubnet2RouteTable1493C5D6": { "Type": "AWS::EC2::RouteTable", "Properties": { - "VpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2" + "Value": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet2" } - ] + ], + "VpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "FargateClusterVpcPublicSubnet2RouteTableAssociation3EFA74DC": { @@ -186,12 +186,12 @@ "FargateClusterVpcPublicSubnet2DefaultRoute8E847CD2": { "Type": "AWS::EC2::Route", "Properties": { - "RouteTableId": { - "Ref": "FargateClusterVpcPublicSubnet2RouteTable1493C5D6" - }, "DestinationCidrBlock": "0.0.0.0/0", "GatewayId": { "Ref": "FargateClusterVpcIGW827638CB" + }, + "RouteTableId": { + "Ref": "FargateClusterVpcPublicSubnet2RouteTable1493C5D6" } }, "DependsOn": [ @@ -205,7 +205,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2" + "Value": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet2" } ] } @@ -213,19 +213,19 @@ "FargateClusterVpcPublicSubnet2NATGatewayFFEC8ED2": { "Type": "AWS::EC2::NatGateway", "Properties": { - "SubnetId": { - "Ref": "FargateClusterVpcPublicSubnet2Subnet24C0F9D8" - }, "AllocationId": { "Fn::GetAtt": [ "FargateClusterVpcPublicSubnet2EIPBBB24774", "AllocationId" ] }, + "SubnetId": { + "Ref": "FargateClusterVpcPublicSubnet2Subnet24C0F9D8" + }, "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2" + "Value": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet2" } ] }, @@ -237,9 +237,6 @@ "FargateClusterVpcPrivateSubnet1Subnet9127625F": { "Type": "AWS::EC2::Subnet", "Properties": { - "VpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "AvailabilityZone": { "Fn::Select": [ 0, @@ -261,23 +258,26 @@ }, { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet1" + "Value": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PrivateSubnet1" } - ] + ], + "VpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "FargateClusterVpcPrivateSubnet1RouteTable21B3CEAE": { "Type": "AWS::EC2::RouteTable", "Properties": { - "VpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet1" + "Value": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PrivateSubnet1" } - ] + ], + "VpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "FargateClusterVpcPrivateSubnet1RouteTableAssociation78F6E213": { @@ -294,21 +294,18 @@ "FargateClusterVpcPrivateSubnet1DefaultRoute0438DCBA": { "Type": "AWS::EC2::Route", "Properties": { - "RouteTableId": { - "Ref": "FargateClusterVpcPrivateSubnet1RouteTable21B3CEAE" - }, "DestinationCidrBlock": "0.0.0.0/0", "NatGatewayId": { "Ref": "FargateClusterVpcPublicSubnet1NATGateway5202D86A" + }, + "RouteTableId": { + "Ref": "FargateClusterVpcPrivateSubnet1RouteTable21B3CEAE" } } }, "FargateClusterVpcPrivateSubnet2Subnet307CEE57": { "Type": "AWS::EC2::Subnet", "Properties": { - "VpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "AvailabilityZone": { "Fn::Select": [ 1, @@ -330,23 +327,26 @@ }, { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet2" + "Value": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PrivateSubnet2" } - ] + ], + "VpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "FargateClusterVpcPrivateSubnet2RouteTable7B7F9678": { "Type": "AWS::EC2::RouteTable", "Properties": { - "VpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet2" + "Value": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PrivateSubnet2" } - ] + ], + "VpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "FargateClusterVpcPrivateSubnet2RouteTableAssociation3A46964C": { @@ -363,12 +363,12 @@ "FargateClusterVpcPrivateSubnet2DefaultRoute35FDD29D": { "Type": "AWS::EC2::Route", "Properties": { - "RouteTableId": { - "Ref": "FargateClusterVpcPrivateSubnet2RouteTable7B7F9678" - }, "DestinationCidrBlock": "0.0.0.0/0", "NatGatewayId": { "Ref": "FargateClusterVpcPublicSubnet2NATGatewayFFEC8ED2" + }, + "RouteTableId": { + "Ref": "FargateClusterVpcPrivateSubnet2RouteTable7B7F9678" } } }, @@ -378,7 +378,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/Vpc" + "Value": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc" } ] } @@ -386,18 +386,18 @@ "FargateClusterVpcVPCGW38717255": { "Type": "AWS::EC2::VPCGatewayAttachment", "Properties": { - "VpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "InternetGatewayId": { "Ref": "FargateClusterVpcIGW827638CB" + }, + "VpcId": { + "Ref": "FargateClusterVpc377E8024" } } }, "FargateClusterDefaultAutoScalingGroupInstanceSecurityGroup42AF8A40": { "Type": "AWS::EC2::SecurityGroup", "Properties": { - "GroupDescription": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/InstanceSecurityGroup", + "GroupDescription": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/InstanceSecurityGroup", "SecurityGroupEgress": [ { "CidrIp": "0.0.0.0/0", @@ -408,7 +408,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup" + "Value": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup" } ], "VpcId": { @@ -434,7 +434,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup" + "Value": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup" } ] } @@ -540,7 +540,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/LaunchTemplate" + "Value": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/LaunchTemplate" } ] }, @@ -549,7 +549,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/LaunchTemplate" + "Value": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/LaunchTemplate" } ] } @@ -575,7 +575,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/LaunchTemplate" + "Value": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/LaunchTemplate" } ] } @@ -589,8 +589,6 @@ "FargateClusterDefaultAutoScalingGroupASG36A4948F": { "Type": "AWS::AutoScaling::AutoScalingGroup", "Properties": { - "MaxSize": "1", - "MinSize": "1", "LaunchTemplate": { "LaunchTemplateId": { "Ref": "FargateClusterDefaultAutoScalingGroupLaunchTemplate7BE88B5A" @@ -602,11 +600,13 @@ ] } }, + "MaxSize": "1", + "MinSize": "1", "Tags": [ { "Key": "Name", "PropagateAtLaunch": true, - "Value": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup" + "Value": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup" } ], "VPCZoneIdentifier": [ @@ -659,7 +659,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup" + "Value": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup" } ] } @@ -757,12 +757,6 @@ "Code": { "ZipFile": "import boto3, json, os, time\n\necs = boto3.client('ecs')\nautoscaling = boto3.client('autoscaling')\n\n\ndef lambda_handler(event, context):\n print(json.dumps(dict(event, ResponseURL='...')))\n cluster = os.environ['CLUSTER']\n snsTopicArn = event['Records'][0]['Sns']['TopicArn']\n lifecycle_event = json.loads(event['Records'][0]['Sns']['Message'])\n instance_id = lifecycle_event.get('EC2InstanceId')\n if not instance_id:\n print('Got event without EC2InstanceId: %s', json.dumps(dict(event, ResponseURL='...')))\n return\n\n instance_arn = container_instance_arn(cluster, instance_id)\n print('Instance %s has container instance ARN %s' % (lifecycle_event['EC2InstanceId'], instance_arn))\n\n if not instance_arn:\n return\n\n task_arns = container_instance_task_arns(cluster, instance_arn)\n\n if task_arns:\n print('Instance ARN %s has task ARNs %s' % (instance_arn, ', '.join(task_arns)))\n\n while has_tasks(cluster, instance_arn, task_arns):\n time.sleep(10)\n\n try:\n print('Terminating instance %s' % instance_id)\n autoscaling.complete_lifecycle_action(\n LifecycleActionResult='CONTINUE',\n **pick(lifecycle_event, 'LifecycleHookName', 'LifecycleActionToken', 'AutoScalingGroupName'))\n except Exception as e:\n # Lifecycle action may have already completed.\n print(str(e))\n\n\ndef container_instance_arn(cluster, instance_id):\n \"\"\"Turn an instance ID into a container instance ARN.\"\"\"\n arns = ecs.list_container_instances(cluster=cluster, filter='ec2InstanceId==' + instance_id)['containerInstanceArns']\n if not arns:\n return None\n return arns[0]\n\ndef container_instance_task_arns(cluster, instance_arn):\n \"\"\"Fetch tasks for a container instance ARN.\"\"\"\n arns = ecs.list_tasks(cluster=cluster, containerInstance=instance_arn)['taskArns']\n return arns\n\ndef has_tasks(cluster, instance_arn, task_arns):\n \"\"\"Return True if the instance is running tasks for the given cluster.\"\"\"\n instances = ecs.describe_container_instances(cluster=cluster, containerInstances=[instance_arn])['containerInstances']\n if not instances:\n return False\n instance = instances[0]\n\n if instance['status'] == 'ACTIVE':\n # Start draining, then try again later\n set_container_instance_to_draining(cluster, instance_arn)\n return True\n\n task_count = None\n\n if task_arns:\n # Fetch details for tasks running on the container instance\n tasks = ecs.describe_tasks(cluster=cluster, tasks=task_arns)['tasks']\n if tasks:\n # Consider any non-stopped tasks as running\n task_count = sum(task['lastStatus'] != 'STOPPED' for task in tasks) + instance['pendingTasksCount']\n\n if not task_count:\n # Fallback to instance task counts if detailed task information is unavailable\n task_count = instance['runningTasksCount'] + instance['pendingTasksCount']\n\n print('Instance %s has %s tasks' % (instance_arn, task_count))\n\n return task_count > 0\n\ndef set_container_instance_to_draining(cluster, instance_arn):\n ecs.update_container_instances_state(\n cluster=cluster,\n containerInstances=[instance_arn], status='DRAINING')\n\n\ndef pick(dct, *keys):\n \"\"\"Pick a subset of a dict.\"\"\"\n return {k: v for k, v in dct.items() if k in keys}\n" }, - "Role": { - "Fn::GetAtt": [ - "FargateClusterDefaultAutoScalingGroupDrainECSHookFunctionServiceRole7FEDCD32", - "Arn" - ] - }, "Environment": { "Variables": { "CLUSTER": { @@ -771,11 +765,17 @@ } }, "Handler": "index.lambda_handler", + "Role": { + "Fn::GetAtt": [ + "FargateClusterDefaultAutoScalingGroupDrainECSHookFunctionServiceRole7FEDCD32", + "Arn" + ] + }, "Runtime": "python3.9", "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup" + "Value": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup" } ], "Timeout": 310 @@ -785,7 +785,7 @@ "FargateClusterDefaultAutoScalingGroupDrainECSHookFunctionServiceRole7FEDCD32" ] }, - "FargateClusterDefaultAutoScalingGroupDrainECSHookFunctionAllowInvokeawsecsinteg2FargateClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopic9C6EC468C75B1F21": { + "FargateClusterDefaultAutoScalingGroupDrainECSHookFunctionAllowInvokeawssfntasksecstaskFargateClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopic9B632D133CB839DE": { "Type": "AWS::Lambda::Permission", "Properties": { "Action": "lambda:InvokeFunction", @@ -804,15 +804,15 @@ "FargateClusterDefaultAutoScalingGroupDrainECSHookFunctionTopic37856E82": { "Type": "AWS::SNS::Subscription", "Properties": { - "Protocol": "lambda", - "TopicArn": { - "Ref": "FargateClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopic49146C10" - }, "Endpoint": { "Fn::GetAtt": [ "FargateClusterDefaultAutoScalingGroupDrainECSHookFunctionE3D5BEE8", "Arn" ] + }, + "Protocol": "lambda", + "TopicArn": { + "Ref": "FargateClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopic49146C10" } } }, @@ -822,7 +822,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup" + "Value": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup" } ] } @@ -845,7 +845,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup" + "Value": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup" } ] } @@ -879,9 +879,9 @@ "AutoScalingGroupName": { "Ref": "FargateClusterDefaultAutoScalingGroupASG36A4948F" }, - "LifecycleTransition": "autoscaling:EC2_INSTANCE_TERMINATING", "DefaultResult": "CONTINUE", "HeartbeatTimeout": 300, + "LifecycleTransition": "autoscaling:EC2_INSTANCE_TERMINATING", "NotificationTargetARN": { "Ref": "FargateClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopic49146C10" }, @@ -921,13 +921,13 @@ { "Essential": true, "Image": { - "Fn::Sub": "${AWS::AccountId}.dkr.ecr.${AWS::Region}.${AWS::URLSuffix}/cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}:7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2" + "Fn::Sub": "${AWS::AccountId}.dkr.ecr.${AWS::Region}.${AWS::URLSuffix}/cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}:d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534" }, "LogConfiguration": { "LogDriver": "awslogs", "Options": { "awslogs-group": { - "Ref": "TaskDefTheContainerLogGroupD94C8EF5" + "Ref": "TaskDefContainerLogGroupB60E6F44" }, "awslogs-stream-prefix": "EventDemo", "awslogs-region": { @@ -936,7 +936,7 @@ } }, "Memory": 256, - "Name": "TheContainer" + "Name": "Container" } ], "ExecutionRoleArn": { @@ -945,7 +945,7 @@ "Arn" ] }, - "Family": "awsecsinteg2TaskDef1F38909D", + "Family": "awssfntasksecstaskTaskDefE541322D", "NetworkMode": "bridge", "RequiresCompatibilities": [ "EC2" @@ -958,7 +958,7 @@ } } }, - "TaskDefTheContainerLogGroupD94C8EF5": { + "TaskDefContainerLogGroupB60E6F44": { "Type": "AWS::Logs::LogGroup", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Retain" @@ -1029,7 +1029,7 @@ "Effect": "Allow", "Resource": { "Fn::GetAtt": [ - "TaskDefTheContainerLogGroupD94C8EF5", + "TaskDefContainerLogGroupB60E6F44", "Arn" ] } @@ -1142,12 +1142,6 @@ "StateMachine2E01A3A5": { "Type": "AWS::StepFunctions::StateMachine", "Properties": { - "RoleArn": { - "Fn::GetAtt": [ - "StateMachineRoleB840431D", - "Arn" - ] - }, "DefinitionString": { "Fn::Join": [ "", @@ -1163,13 +1157,19 @@ { "Ref": "TaskDef54694570" }, - "\",\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"TheContainer\",\"Environment\":[{\"Name\":\"SOME_KEY\",\"Value.$\":\"$.SomeKey\"}]}]},\"LaunchType\":\"EC2\"},\"Type\":\"Task\",\"Resource\":\"arn:", + "\",\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"Container\",\"Environment\":[{\"Name\":\"SOME_KEY\",\"Value.$\":\"$.SomeKey\"}]}]},\"LaunchType\":\"EC2\"},\"Type\":\"Task\",\"Resource\":\"arn:", { "Ref": "AWS::Partition" }, ":states:::ecs:runTask.sync\"}}}" ] ] + }, + "RoleArn": { + "Fn::GetAtt": [ + "StateMachineRoleB840431D", + "Arn" + ] } }, "DependsOn": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/cdk.out index f0b901e7c06e5..1f0068d32659a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"32.0.0"} \ No newline at end of file +{"version":"36.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/integ.json index 51d28abadfeea..a5c6cf6de5fc7 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/integ.json @@ -1,14 +1,12 @@ { - "version": "32.0.0", + "version": "36.0.0", "testCases": { - "integ.ec2-task": { + "SfnTasksEcsEc2TaskTest/DefaultTest": { "stacks": [ - "aws-ecs-integ2" + "aws-sfn-tasks-ecs-task" ], - "diffAssets": false, - "stackUpdateWorkflow": true + "assertionStack": "SfnTasksEcsEc2TaskTest/DefaultTest/DeployAssert", + "assertionStackName": "SfnTasksEcsEc2TaskTestDefaultTestDeployAssert9E1A388C" } - }, - "synthContext": {}, - "enableLookups": false + } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/manifest.json index 23cdcdb67e8b2..04674b3f108a4 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/manifest.json @@ -1,27 +1,28 @@ { - "version": "32.0.0", + "version": "36.0.0", "artifacts": { - "aws-ecs-integ2.assets": { + "aws-sfn-tasks-ecs-task.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "aws-ecs-integ2.assets.json", + "file": "aws-sfn-tasks-ecs-task.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "aws-ecs-integ2": { + "aws-sfn-tasks-ecs-task": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "aws-ecs-integ2.template.json", + "templateFile": "aws-sfn-tasks-ecs-task.template.json", + "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/c3be3861b160a5c4b786a665bc563d4af7f3789d729e9568e720d7e14d398b6c.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/3def9ee7b59a962a2c1b87f53788e50585c78f8b28084882a58d0b6796594f37.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "aws-ecs-integ2.assets" + "aws-sfn-tasks-ecs-task.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", @@ -30,320 +31,359 @@ } }, "dependencies": [ - "aws-ecs-integ2.assets" + "aws-sfn-tasks-ecs-task.assets" ], "metadata": { - "/aws-ecs-integ2/FargateCluster/Resource": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/Resource": [ { "type": "aws:cdk:logicalId", "data": "FargateCluster7CCD5F93" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/Resource": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/Vpc/Resource": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpc377E8024" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1/Subnet": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet1/Subnet": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet1SubnetB9C24BC7" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1/RouteTable": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet1/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet1RouteTable1D7FA747" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1/RouteTableAssociation": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet1/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet1RouteTableAssociation80F1442F" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1/DefaultRoute": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet1/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet1DefaultRoute80086690" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1/EIP": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet1/EIP": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet1EIPF91909D0" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1/NATGateway": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet1/NATGateway": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet1NATGateway5202D86A" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2/Subnet": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet2/Subnet": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet2Subnet24C0F9D8" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2/RouteTable": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet2/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet2RouteTable1493C5D6" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2/RouteTableAssociation": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet2/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet2RouteTableAssociation3EFA74DC" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2/DefaultRoute": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet2/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet2DefaultRoute8E847CD2" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2/EIP": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet2/EIP": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet2EIPBBB24774" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2/NATGateway": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet2/NATGateway": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet2NATGatewayFFEC8ED2" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet1/Subnet": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PrivateSubnet1/Subnet": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPrivateSubnet1Subnet9127625F" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet1/RouteTable": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PrivateSubnet1/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPrivateSubnet1RouteTable21B3CEAE" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet1/RouteTableAssociation": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PrivateSubnet1/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPrivateSubnet1RouteTableAssociation78F6E213" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet1/DefaultRoute": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PrivateSubnet1/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPrivateSubnet1DefaultRoute0438DCBA" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet2/Subnet": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PrivateSubnet2/Subnet": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPrivateSubnet2Subnet307CEE57" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet2/RouteTable": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PrivateSubnet2/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPrivateSubnet2RouteTable7B7F9678" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet2/RouteTableAssociation": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PrivateSubnet2/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPrivateSubnet2RouteTableAssociation3A46964C" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet2/DefaultRoute": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PrivateSubnet2/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPrivateSubnet2DefaultRoute35FDD29D" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/IGW": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/Vpc/IGW": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcIGW827638CB" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/VPCGW": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/Vpc/VPCGW": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcVPCGW38717255" } ], - "/aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/InstanceSecurityGroup/Resource": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/InstanceSecurityGroup/Resource": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterDefaultAutoScalingGroupInstanceSecurityGroup42AF8A40" } ], - "/aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/InstanceRole/Resource": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/InstanceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterDefaultAutoScalingGroupInstanceRole0C1F7FF7" } ], - "/aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/InstanceRole/DefaultPolicy/Resource": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/InstanceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterDefaultAutoScalingGroupInstanceRoleDefaultPolicy3BD78F3E" } ], - "/aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/InstanceProfile": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/InstanceProfile": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterDefaultAutoScalingGroupInstanceProfile2C0FEF3B" } ], - "/aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/LaunchTemplate/Resource": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/LaunchTemplate/Resource": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterDefaultAutoScalingGroupLaunchTemplate7BE88B5A" } ], - "/aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/ASG": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/ASG": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterDefaultAutoScalingGroupASG36A4948F" } ], - "/aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function/ServiceRole/Resource": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterDefaultAutoScalingGroupDrainECSHookFunctionServiceRole7FEDCD32" } ], - "/aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function/ServiceRole/DefaultPolicy/Resource": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function/ServiceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterDefaultAutoScalingGroupDrainECSHookFunctionServiceRoleDefaultPolicyB91C5343" } ], - "/aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function/Resource": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function/Resource": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterDefaultAutoScalingGroupDrainECSHookFunctionE3D5BEE8" } ], - "/aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function/AllowInvoke:awsecsinteg2FargateClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopic9C6EC468": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function/AllowInvoke:awssfntasksecstaskFargateClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopic9B632D13": [ { "type": "aws:cdk:logicalId", - "data": "FargateClusterDefaultAutoScalingGroupDrainECSHookFunctionAllowInvokeawsecsinteg2FargateClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopic9C6EC468C75B1F21" + "data": "FargateClusterDefaultAutoScalingGroupDrainECSHookFunctionAllowInvokeawssfntasksecstaskFargateClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopic9B632D133CB839DE" } ], - "/aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function/Topic/Resource": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function/Topic/Resource": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterDefaultAutoScalingGroupDrainECSHookFunctionTopic37856E82" } ], - "/aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Topic/Resource": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Topic/Resource": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopic49146C10" } ], - "/aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Role/Resource": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Role/Resource": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterDefaultAutoScalingGroupLifecycleHookDrainHookRole410D556D" } ], - "/aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Role/DefaultPolicy/Resource": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Role/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterDefaultAutoScalingGroupLifecycleHookDrainHookRoleDefaultPolicy4958D19D" } ], - "/aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Resource": [ + "/aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Resource": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterDefaultAutoScalingGroupLifecycleHookDrainHook2AE13680" } ], - "/aws-ecs-integ2/SsmParameterValue:--aws--service--ecs--optimized-ami--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ + "/aws-sfn-tasks-ecs-task/SsmParameterValue:--aws--service--ecs--optimized-ami--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ { "type": "aws:cdk:logicalId", "data": "SsmParameterValueawsserviceecsoptimizedamiamazonlinux2recommendedimageidC96584B6F00A464EAD1953AFF4B05118Parameter" } ], - "/aws-ecs-integ2/TaskDef/TaskRole/Resource": [ + "/aws-sfn-tasks-ecs-task/TaskDef/TaskRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "TaskDefTaskRole1EDB4A67" } ], - "/aws-ecs-integ2/TaskDef/Resource": [ + "/aws-sfn-tasks-ecs-task/TaskDef/Resource": [ { "type": "aws:cdk:logicalId", "data": "TaskDef54694570" } ], - "/aws-ecs-integ2/TaskDef/TheContainer/LogGroup/Resource": [ + "/aws-sfn-tasks-ecs-task/TaskDef/Container/LogGroup/Resource": [ { "type": "aws:cdk:logicalId", - "data": "TaskDefTheContainerLogGroupD94C8EF5" + "data": "TaskDefContainerLogGroupB60E6F44" } ], - "/aws-ecs-integ2/TaskDef/ExecutionRole/Resource": [ + "/aws-sfn-tasks-ecs-task/TaskDef/ExecutionRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "TaskDefExecutionRoleB4775C97" } ], - "/aws-ecs-integ2/TaskDef/ExecutionRole/DefaultPolicy/Resource": [ + "/aws-sfn-tasks-ecs-task/TaskDef/ExecutionRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "TaskDefExecutionRoleDefaultPolicy0DBB737A" } ], - "/aws-ecs-integ2/StateMachine/Role/Resource": [ + "/aws-sfn-tasks-ecs-task/StateMachine/Role/Resource": [ { "type": "aws:cdk:logicalId", "data": "StateMachineRoleB840431D" } ], - "/aws-ecs-integ2/StateMachine/Role/DefaultPolicy/Resource": [ + "/aws-sfn-tasks-ecs-task/StateMachine/Role/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "StateMachineRoleDefaultPolicyDF1E6607" } ], - "/aws-ecs-integ2/StateMachine/Resource": [ + "/aws-sfn-tasks-ecs-task/StateMachine/Resource": [ { "type": "aws:cdk:logicalId", "data": "StateMachine2E01A3A5" } ], - "/aws-ecs-integ2/BootstrapVersion": [ + "/aws-sfn-tasks-ecs-task/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/aws-ecs-integ2/CheckBootstrapVersion": [ + "/aws-sfn-tasks-ecs-task/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } + ] + }, + "displayName": "aws-sfn-tasks-ecs-task" + }, + "SfnTasksEcsEc2TaskTestDefaultTestDeployAssert9E1A388C.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "SfnTasksEcsEc2TaskTestDefaultTestDeployAssert9E1A388C.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "SfnTasksEcsEc2TaskTestDefaultTestDeployAssert9E1A388C": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "SfnTasksEcsEc2TaskTestDefaultTestDeployAssert9E1A388C.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "SfnTasksEcsEc2TaskTestDefaultTestDeployAssert9E1A388C.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "SfnTasksEcsEc2TaskTestDefaultTestDeployAssert9E1A388C.assets" + ], + "metadata": { + "/SfnTasksEcsEc2TaskTest/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } ], - "FargateClusterDefaultAutoScalingGroupLaunchTemplateProfile7159126B": [ + "/SfnTasksEcsEc2TaskTest/DefaultTest/DeployAssert/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", - "data": "FargateClusterDefaultAutoScalingGroupLaunchTemplateProfile7159126B", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] + "data": "CheckBootstrapVersion" } ] }, - "displayName": "aws-ecs-integ2" + "displayName": "SfnTasksEcsEc2TaskTest/DefaultTest/DeployAssert" }, "Tree": { "type": "cdk:tree", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/tree.json index 10a6719d7200e..e7fd27ef01173 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.js.snapshot/tree.json @@ -4,33 +4,33 @@ "id": "App", "path": "", "children": { - "aws-ecs-integ2": { - "id": "aws-ecs-integ2", - "path": "aws-ecs-integ2", + "aws-sfn-tasks-ecs-task": { + "id": "aws-sfn-tasks-ecs-task", + "path": "aws-sfn-tasks-ecs-task", "children": { "FargateCluster": { "id": "FargateCluster", - "path": "aws-ecs-integ2/FargateCluster", + "path": "aws-sfn-tasks-ecs-task/FargateCluster", "children": { "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/FargateCluster/Resource", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::ECS::Cluster", "aws:cdk:cloudformation:props": {} }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ecs.CfnCluster", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Vpc": { "id": "Vpc", - "path": "aws-ecs-integ2/FargateCluster/Vpc", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc", "children": { "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/FargateCluster/Vpc/Resource", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::VPC", "aws:cdk:cloudformation:props": { @@ -41,29 +41,26 @@ "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/Vpc" + "value": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc" } ] } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnVPC", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "PublicSubnet1": { "id": "PublicSubnet1", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet1", "children": { "Subnet": { "id": "Subnet", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1/Subnet", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet1/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "availabilityZone": { "Fn::Select": [ 0, @@ -85,49 +82,52 @@ }, { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1" + "value": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet1" } - ] + ], + "vpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Acl": { "id": "Acl", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1/Acl", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet1/Acl", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTable": { "id": "RouteTable", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1/RouteTable", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet1/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1" + "value": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet1" } - ] + ], + "vpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1/RouteTableAssociation", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet1/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -140,33 +140,33 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultRoute": { "id": "DefaultRoute", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1/DefaultRoute", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet1/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "FargateClusterVpcPublicSubnet1RouteTable1D7FA747" - }, "destinationCidrBlock": "0.0.0.0/0", "gatewayId": { "Ref": "FargateClusterVpcIGW827638CB" + }, + "routeTableId": { + "Ref": "FargateClusterVpcPublicSubnet1RouteTable1D7FA747" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "EIP": { "id": "EIP", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1/EIP", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet1/EIP", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::EIP", "aws:cdk:cloudformation:props": { @@ -174,63 +174,60 @@ "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1" + "value": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet1" } ] } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "NATGateway": { "id": "NATGateway", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1/NATGateway", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet1/NATGateway", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", "aws:cdk:cloudformation:props": { - "subnetId": { - "Ref": "FargateClusterVpcPublicSubnet1SubnetB9C24BC7" - }, "allocationId": { "Fn::GetAtt": [ "FargateClusterVpcPublicSubnet1EIPF91909D0", "AllocationId" ] }, + "subnetId": { + "Ref": "FargateClusterVpcPublicSubnet1SubnetB9C24BC7" + }, "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1" + "value": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet1" } ] } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "PublicSubnet2": { "id": "PublicSubnet2", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet2", "children": { "Subnet": { "id": "Subnet", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2/Subnet", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet2/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "availabilityZone": { "Fn::Select": [ 1, @@ -252,49 +249,52 @@ }, { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2" + "value": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet2" } - ] + ], + "vpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Acl": { "id": "Acl", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2/Acl", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet2/Acl", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTable": { "id": "RouteTable", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2/RouteTable", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet2/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2" + "value": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet2" } - ] + ], + "vpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2/RouteTableAssociation", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet2/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -307,33 +307,33 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultRoute": { "id": "DefaultRoute", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2/DefaultRoute", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet2/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "FargateClusterVpcPublicSubnet2RouteTable1493C5D6" - }, "destinationCidrBlock": "0.0.0.0/0", "gatewayId": { "Ref": "FargateClusterVpcIGW827638CB" + }, + "routeTableId": { + "Ref": "FargateClusterVpcPublicSubnet2RouteTable1493C5D6" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "EIP": { "id": "EIP", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2/EIP", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet2/EIP", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::EIP", "aws:cdk:cloudformation:props": { @@ -341,63 +341,60 @@ "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2" + "value": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet2" } ] } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "NATGateway": { "id": "NATGateway", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2/NATGateway", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet2/NATGateway", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", "aws:cdk:cloudformation:props": { - "subnetId": { - "Ref": "FargateClusterVpcPublicSubnet2Subnet24C0F9D8" - }, "allocationId": { "Fn::GetAtt": [ "FargateClusterVpcPublicSubnet2EIPBBB24774", "AllocationId" ] }, + "subnetId": { + "Ref": "FargateClusterVpcPublicSubnet2Subnet24C0F9D8" + }, "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2" + "value": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PublicSubnet2" } ] } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "PrivateSubnet1": { "id": "PrivateSubnet1", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet1", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PrivateSubnet1", "children": { "Subnet": { "id": "Subnet", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet1/Subnet", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PrivateSubnet1/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "availabilityZone": { "Fn::Select": [ 0, @@ -419,49 +416,52 @@ }, { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet1" + "value": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PrivateSubnet1" } - ] + ], + "vpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Acl": { "id": "Acl", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet1/Acl", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PrivateSubnet1/Acl", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTable": { "id": "RouteTable", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet1/RouteTable", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PrivateSubnet1/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet1" + "value": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PrivateSubnet1" } - ] + ], + "vpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet1/RouteTableAssociation", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PrivateSubnet1/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -474,49 +474,46 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultRoute": { "id": "DefaultRoute", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet1/DefaultRoute", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PrivateSubnet1/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "FargateClusterVpcPrivateSubnet1RouteTable21B3CEAE" - }, "destinationCidrBlock": "0.0.0.0/0", "natGatewayId": { "Ref": "FargateClusterVpcPublicSubnet1NATGateway5202D86A" + }, + "routeTableId": { + "Ref": "FargateClusterVpcPrivateSubnet1RouteTable21B3CEAE" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "PrivateSubnet2": { "id": "PrivateSubnet2", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet2", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PrivateSubnet2", "children": { "Subnet": { "id": "Subnet", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet2/Subnet", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PrivateSubnet2/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "availabilityZone": { "Fn::Select": [ 1, @@ -538,49 +535,52 @@ }, { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet2" + "value": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PrivateSubnet2" } - ] + ], + "vpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Acl": { "id": "Acl", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet2/Acl", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PrivateSubnet2/Acl", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTable": { "id": "RouteTable", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet2/RouteTable", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PrivateSubnet2/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet2" + "value": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PrivateSubnet2" } - ] + ], + "vpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet2/RouteTableAssociation", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PrivateSubnet2/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -593,95 +593,95 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultRoute": { "id": "DefaultRoute", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet2/DefaultRoute", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/PrivateSubnet2/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "FargateClusterVpcPrivateSubnet2RouteTable7B7F9678" - }, "destinationCidrBlock": "0.0.0.0/0", "natGatewayId": { "Ref": "FargateClusterVpcPublicSubnet2NATGatewayFFEC8ED2" + }, + "routeTableId": { + "Ref": "FargateClusterVpcPrivateSubnet2RouteTable7B7F9678" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "IGW": { "id": "IGW", - "path": "aws-ecs-integ2/FargateCluster/Vpc/IGW", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/IGW", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", "aws:cdk:cloudformation:props": { "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/Vpc" + "value": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc" } ] } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnInternetGateway", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "VPCGW": { "id": "VPCGW", - "path": "aws-ecs-integ2/FargateCluster/Vpc/VPCGW", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/Vpc/VPCGW", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "internetGatewayId": { "Ref": "FargateClusterVpcIGW827638CB" + }, + "vpcId": { + "Ref": "FargateClusterVpc377E8024" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnVPCGatewayAttachment", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.Vpc", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultAutoScalingGroup": { "id": "DefaultAutoScalingGroup", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup", "children": { "InstanceSecurityGroup": { "id": "InstanceSecurityGroup", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/InstanceSecurityGroup", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/InstanceSecurityGroup", "children": { "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/InstanceSecurityGroup/Resource", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/InstanceSecurityGroup/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", "aws:cdk:cloudformation:props": { - "groupDescription": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/InstanceSecurityGroup", + "groupDescription": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/InstanceSecurityGroup", "securityGroupEgress": [ { "cidrIp": "0.0.0.0/0", @@ -692,7 +692,7 @@ "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup" + "value": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup" } ], "vpcId": { @@ -701,31 +701,31 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSecurityGroup", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.SecurityGroup", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "InstanceRole": { "id": "InstanceRole", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/InstanceRole", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/InstanceRole", "children": { "ImportInstanceRole": { "id": "ImportInstanceRole", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/InstanceRole/ImportInstanceRole", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/InstanceRole/ImportInstanceRole", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/InstanceRole/Resource", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/InstanceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -744,23 +744,23 @@ "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup" + "value": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup" } ] } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/InstanceRole/DefaultPolicy", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/InstanceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/InstanceRole/DefaultPolicy/Resource", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/InstanceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -820,25 +820,25 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "InstanceProfile": { "id": "InstanceProfile", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/InstanceProfile", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/InstanceProfile", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::InstanceProfile", "aws:cdk:cloudformation:props": { @@ -850,17 +850,25 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnInstanceProfile", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "ImportedInstanceProfile": { + "id": "ImportedInstanceProfile", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/ImportedInstanceProfile", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "LaunchTemplate": { "id": "LaunchTemplate", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/LaunchTemplate", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/LaunchTemplate", "children": { "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/LaunchTemplate/Resource", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/LaunchTemplate/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::LaunchTemplate", "aws:cdk:cloudformation:props": { @@ -894,7 +902,7 @@ "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/LaunchTemplate" + "value": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/LaunchTemplate" } ] }, @@ -903,7 +911,7 @@ "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/LaunchTemplate" + "value": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/LaunchTemplate" } ] } @@ -929,7 +937,7 @@ "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/LaunchTemplate" + "value": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/LaunchTemplate" } ] } @@ -937,24 +945,22 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnLaunchTemplate", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.LaunchTemplate", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "ASG": { "id": "ASG", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/ASG", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/ASG", "attributes": { "aws:cdk:cloudformation:type": "AWS::AutoScaling::AutoScalingGroup", "aws:cdk:cloudformation:props": { - "maxSize": "1", - "minSize": "1", "launchTemplate": { "launchTemplateId": { "Ref": "FargateClusterDefaultAutoScalingGroupLaunchTemplate7BE88B5A" @@ -966,10 +972,12 @@ ] } }, + "maxSize": "1", + "minSize": "1", "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup", + "value": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup", "propagateAtLaunch": true } ], @@ -984,33 +992,33 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_autoscaling.CfnAutoScalingGroup", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DrainECSHook": { "id": "DrainECSHook", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/DrainECSHook", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/DrainECSHook", "children": { "Function": { "id": "Function", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function/ServiceRole", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function/ServiceRole/ImportServiceRole", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function/ServiceRole/ImportServiceRole", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function/ServiceRole/Resource", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1043,23 +1051,23 @@ "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup" + "value": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup" } ] } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function/ServiceRole/DefaultPolicy", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function/ServiceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function/ServiceRole/DefaultPolicy/Resource", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function/ServiceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -1148,37 +1156,31 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function/Resource", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { "code": { "zipFile": "import boto3, json, os, time\n\necs = boto3.client('ecs')\nautoscaling = boto3.client('autoscaling')\n\n\ndef lambda_handler(event, context):\n print(json.dumps(dict(event, ResponseURL='...')))\n cluster = os.environ['CLUSTER']\n snsTopicArn = event['Records'][0]['Sns']['TopicArn']\n lifecycle_event = json.loads(event['Records'][0]['Sns']['Message'])\n instance_id = lifecycle_event.get('EC2InstanceId')\n if not instance_id:\n print('Got event without EC2InstanceId: %s', json.dumps(dict(event, ResponseURL='...')))\n return\n\n instance_arn = container_instance_arn(cluster, instance_id)\n print('Instance %s has container instance ARN %s' % (lifecycle_event['EC2InstanceId'], instance_arn))\n\n if not instance_arn:\n return\n\n task_arns = container_instance_task_arns(cluster, instance_arn)\n\n if task_arns:\n print('Instance ARN %s has task ARNs %s' % (instance_arn, ', '.join(task_arns)))\n\n while has_tasks(cluster, instance_arn, task_arns):\n time.sleep(10)\n\n try:\n print('Terminating instance %s' % instance_id)\n autoscaling.complete_lifecycle_action(\n LifecycleActionResult='CONTINUE',\n **pick(lifecycle_event, 'LifecycleHookName', 'LifecycleActionToken', 'AutoScalingGroupName'))\n except Exception as e:\n # Lifecycle action may have already completed.\n print(str(e))\n\n\ndef container_instance_arn(cluster, instance_id):\n \"\"\"Turn an instance ID into a container instance ARN.\"\"\"\n arns = ecs.list_container_instances(cluster=cluster, filter='ec2InstanceId==' + instance_id)['containerInstanceArns']\n if not arns:\n return None\n return arns[0]\n\ndef container_instance_task_arns(cluster, instance_arn):\n \"\"\"Fetch tasks for a container instance ARN.\"\"\"\n arns = ecs.list_tasks(cluster=cluster, containerInstance=instance_arn)['taskArns']\n return arns\n\ndef has_tasks(cluster, instance_arn, task_arns):\n \"\"\"Return True if the instance is running tasks for the given cluster.\"\"\"\n instances = ecs.describe_container_instances(cluster=cluster, containerInstances=[instance_arn])['containerInstances']\n if not instances:\n return False\n instance = instances[0]\n\n if instance['status'] == 'ACTIVE':\n # Start draining, then try again later\n set_container_instance_to_draining(cluster, instance_arn)\n return True\n\n task_count = None\n\n if task_arns:\n # Fetch details for tasks running on the container instance\n tasks = ecs.describe_tasks(cluster=cluster, tasks=task_arns)['tasks']\n if tasks:\n # Consider any non-stopped tasks as running\n task_count = sum(task['lastStatus'] != 'STOPPED' for task in tasks) + instance['pendingTasksCount']\n\n if not task_count:\n # Fallback to instance task counts if detailed task information is unavailable\n task_count = instance['runningTasksCount'] + instance['pendingTasksCount']\n\n print('Instance %s has %s tasks' % (instance_arn, task_count))\n\n return task_count > 0\n\ndef set_container_instance_to_draining(cluster, instance_arn):\n ecs.update_container_instances_state(\n cluster=cluster,\n containerInstances=[instance_arn], status='DRAINING')\n\n\ndef pick(dct, *keys):\n \"\"\"Pick a subset of a dict.\"\"\"\n return {k: v for k, v in dct.items() if k in keys}\n" }, - "role": { - "Fn::GetAtt": [ - "FargateClusterDefaultAutoScalingGroupDrainECSHookFunctionServiceRole7FEDCD32", - "Arn" - ] - }, "environment": { "variables": { "CLUSTER": { @@ -1187,24 +1189,30 @@ } }, "handler": "index.lambda_handler", + "role": { + "Fn::GetAtt": [ + "FargateClusterDefaultAutoScalingGroupDrainECSHookFunctionServiceRole7FEDCD32", + "Arn" + ] + }, "runtime": "python3.9", "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup" + "value": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup" } ], "timeout": 310 } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, - "AllowInvoke:awsecsinteg2FargateClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopic9C6EC468": { - "id": "AllowInvoke:awsecsinteg2FargateClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopic9C6EC468", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function/AllowInvoke:awsecsinteg2FargateClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopic9C6EC468", + "AllowInvoke:awssfntasksecstaskFargateClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopic9B632D13": { + "id": "AllowInvoke:awssfntasksecstaskFargateClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopic9B632D13", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function/AllowInvoke:awssfntasksecstaskFargateClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopic9B632D13", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", "aws:cdk:cloudformation:props": { @@ -1222,103 +1230,103 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Topic": { "id": "Topic", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function/Topic", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function/Topic", "children": { "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function/Topic/Resource", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/DrainECSHook/Function/Topic/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::SNS::Subscription", "aws:cdk:cloudformation:props": { - "protocol": "lambda", - "topicArn": { - "Ref": "FargateClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopic49146C10" - }, "endpoint": { "Fn::GetAtt": [ "FargateClusterDefaultAutoScalingGroupDrainECSHookFunctionE3D5BEE8", "Arn" ] + }, + "protocol": "lambda", + "topicArn": { + "Ref": "FargateClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopic49146C10" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_sns.CfnSubscription", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_sns.Subscription", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.Function", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.3.0" } }, "LifecycleHookDrainHook": { "id": "LifecycleHookDrainHook", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/LifecycleHookDrainHook", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/LifecycleHookDrainHook", "children": { "Topic": { "id": "Topic", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Topic", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Topic", "children": { "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Topic/Resource", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Topic/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::SNS::Topic", "aws:cdk:cloudformation:props": { "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup" + "value": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup" } ] } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_sns.CfnTopic", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_sns.Topic", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Role": { "id": "Role", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Role", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Role", "children": { "ImportRole": { "id": "ImportRole", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Role/ImportRole", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Role/ImportRole", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Role/Resource", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Role/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1337,23 +1345,23 @@ "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup" + "value": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup" } ] } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Role/DefaultPolicy", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Role/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Role/DefaultPolicy/Resource", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Role/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -1378,34 +1386,34 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/FargateCluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Resource", + "path": "aws-sfn-tasks-ecs-task/FargateCluster/DefaultAutoScalingGroup/LifecycleHookDrainHook/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::AutoScaling::LifecycleHook", "aws:cdk:cloudformation:props": { "autoScalingGroupName": { "Ref": "FargateClusterDefaultAutoScalingGroupASG36A4948F" }, - "lifecycleTransition": "autoscaling:EC2_INSTANCE_TERMINATING", "defaultResult": "CONTINUE", "heartbeatTimeout": 300, + "lifecycleTransition": "autoscaling:EC2_INSTANCE_TERMINATING", "notificationTargetArn": { "Ref": "FargateClusterDefaultAutoScalingGroupLifecycleHookDrainHookTopic49146C10" }, @@ -1418,63 +1426,63 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_autoscaling.CfnLifecycleHook", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_autoscaling.LifecycleHook", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_autoscaling.AutoScalingGroup", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ecs.Cluster", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "SsmParameterValue:--aws--service--ecs--optimized-ami--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": { "id": "SsmParameterValue:--aws--service--ecs--optimized-ami--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", - "path": "aws-ecs-integ2/SsmParameterValue:--aws--service--ecs--optimized-ami--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", + "path": "aws-sfn-tasks-ecs-task/SsmParameterValue:--aws--service--ecs--optimized-ami--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", "constructInfo": { - "fqn": "aws-cdk-lib.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "SsmParameterValue:--aws--service--ecs--optimized-ami--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118": { "id": "SsmParameterValue:--aws--service--ecs--optimized-ami--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", - "path": "aws-ecs-integ2/SsmParameterValue:--aws--service--ecs--optimized-ami--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", + "path": "aws-sfn-tasks-ecs-task/SsmParameterValue:--aws--service--ecs--optimized-ami--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "TaskDef": { "id": "TaskDef", - "path": "aws-ecs-integ2/TaskDef", + "path": "aws-sfn-tasks-ecs-task/TaskDef", "children": { "TaskRole": { "id": "TaskRole", - "path": "aws-ecs-integ2/TaskDef/TaskRole", + "path": "aws-sfn-tasks-ecs-task/TaskDef/TaskRole", "children": { "ImportTaskRole": { "id": "ImportTaskRole", - "path": "aws-ecs-integ2/TaskDef/TaskRole/ImportTaskRole", + "path": "aws-sfn-tasks-ecs-task/TaskDef/TaskRole/ImportTaskRole", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/TaskDef/TaskRole/Resource", + "path": "aws-sfn-tasks-ecs-task/TaskDef/TaskRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1493,19 +1501,19 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/TaskDef/Resource", + "path": "aws-sfn-tasks-ecs-task/TaskDef/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::ECS::TaskDefinition", "aws:cdk:cloudformation:props": { @@ -1513,15 +1521,15 @@ { "essential": true, "image": { - "Fn::Sub": "${AWS::AccountId}.dkr.ecr.${AWS::Region}.${AWS::URLSuffix}/cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}:7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2" + "Fn::Sub": "${AWS::AccountId}.dkr.ecr.${AWS::Region}.${AWS::URLSuffix}/cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}:d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534" }, "memory": 256, - "name": "TheContainer", + "name": "Container", "logConfiguration": { "logDriver": "awslogs", "options": { "awslogs-group": { - "Ref": "TaskDefTheContainerLogGroupD94C8EF5" + "Ref": "TaskDefContainerLogGroupB60E6F44" }, "awslogs-stream-prefix": "EventDemo", "awslogs-region": { @@ -1537,7 +1545,7 @@ "Arn" ] }, - "family": "awsecsinteg2TaskDef1F38909D", + "family": "awssfntasksecstaskTaskDefE541322D", "networkMode": "bridge", "requiresCompatibilities": [ "EC2" @@ -1551,83 +1559,83 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ecs.CfnTaskDefinition", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, - "TheContainer": { - "id": "TheContainer", - "path": "aws-ecs-integ2/TaskDef/TheContainer", + "Container": { + "id": "Container", + "path": "aws-sfn-tasks-ecs-task/TaskDef/Container", "children": { "AssetImage": { "id": "AssetImage", - "path": "aws-ecs-integ2/TaskDef/TheContainer/AssetImage", + "path": "aws-sfn-tasks-ecs-task/TaskDef/Container/AssetImage", "children": { "Staging": { "id": "Staging", - "path": "aws-ecs-integ2/TaskDef/TheContainer/AssetImage/Staging", + "path": "aws-sfn-tasks-ecs-task/TaskDef/Container/AssetImage/Staging", "constructInfo": { - "fqn": "aws-cdk-lib.AssetStaging", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Repository": { "id": "Repository", - "path": "aws-ecs-integ2/TaskDef/TheContainer/AssetImage/Repository", + "path": "aws-sfn-tasks-ecs-task/TaskDef/Container/AssetImage/Repository", "constructInfo": { - "fqn": "aws-cdk-lib.aws_ecr.RepositoryBase", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ecr_assets.DockerImageAsset", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "LogGroup": { "id": "LogGroup", - "path": "aws-ecs-integ2/TaskDef/TheContainer/LogGroup", + "path": "aws-sfn-tasks-ecs-task/TaskDef/Container/LogGroup", "children": { "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/TaskDef/TheContainer/LogGroup/Resource", + "path": "aws-sfn-tasks-ecs-task/TaskDef/Container/LogGroup/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", "aws:cdk:cloudformation:props": {} }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_logs.LogGroup", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ecs.ContainerDefinition", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "ExecutionRole": { "id": "ExecutionRole", - "path": "aws-ecs-integ2/TaskDef/ExecutionRole", + "path": "aws-sfn-tasks-ecs-task/TaskDef/ExecutionRole", "children": { "ImportExecutionRole": { "id": "ImportExecutionRole", - "path": "aws-ecs-integ2/TaskDef/ExecutionRole/ImportExecutionRole", + "path": "aws-sfn-tasks-ecs-task/TaskDef/ExecutionRole/ImportExecutionRole", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/TaskDef/ExecutionRole/Resource", + "path": "aws-sfn-tasks-ecs-task/TaskDef/ExecutionRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1646,17 +1654,17 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-ecs-integ2/TaskDef/ExecutionRole/DefaultPolicy", + "path": "aws-sfn-tasks-ecs-task/TaskDef/ExecutionRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/TaskDef/ExecutionRole/DefaultPolicy/Resource", + "path": "aws-sfn-tasks-ecs-task/TaskDef/ExecutionRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -1706,7 +1714,7 @@ "Effect": "Allow", "Resource": { "Fn::GetAtt": [ - "TaskDefTheContainerLogGroupD94C8EF5", + "TaskDefContainerLogGroupB60E6F44", "Arn" ] } @@ -1723,63 +1731,63 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ecs.Ec2TaskDefinition", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Start": { "id": "Start", - "path": "aws-ecs-integ2/Start", + "path": "aws-sfn-tasks-ecs-task/Start", "constructInfo": { - "fqn": "aws-cdk-lib.aws_stepfunctions.Pass", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Run": { "id": "Run", - "path": "aws-ecs-integ2/Run", + "path": "aws-sfn-tasks-ecs-task/Run", "constructInfo": { - "fqn": "aws-cdk-lib.aws_stepfunctions.Task", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "StateMachine": { "id": "StateMachine", - "path": "aws-ecs-integ2/StateMachine", + "path": "aws-sfn-tasks-ecs-task/StateMachine", "children": { "Role": { "id": "Role", - "path": "aws-ecs-integ2/StateMachine/Role", + "path": "aws-sfn-tasks-ecs-task/StateMachine/Role", "children": { "ImportRole": { "id": "ImportRole", - "path": "aws-ecs-integ2/StateMachine/Role/ImportRole", + "path": "aws-sfn-tasks-ecs-task/StateMachine/Role/ImportRole", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/StateMachine/Role/Resource", + "path": "aws-sfn-tasks-ecs-task/StateMachine/Role/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1798,17 +1806,17 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-ecs-integ2/StateMachine/Role/DefaultPolicy", + "path": "aws-sfn-tasks-ecs-task/StateMachine/Role/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/StateMachine/Role/DefaultPolicy/Resource", + "path": "aws-sfn-tasks-ecs-task/StateMachine/Role/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -1887,34 +1895,28 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/StateMachine/Resource", + "path": "aws-sfn-tasks-ecs-task/StateMachine/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::StepFunctions::StateMachine", "aws:cdk:cloudformation:props": { - "roleArn": { - "Fn::GetAtt": [ - "StateMachineRoleB840431D", - "Arn" - ] - }, "definitionString": { "Fn::Join": [ "", @@ -1930,46 +1932,106 @@ { "Ref": "TaskDef54694570" }, - "\",\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"TheContainer\",\"Environment\":[{\"Name\":\"SOME_KEY\",\"Value.$\":\"$.SomeKey\"}]}]},\"LaunchType\":\"EC2\"},\"Type\":\"Task\",\"Resource\":\"arn:", + "\",\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"Container\",\"Environment\":[{\"Name\":\"SOME_KEY\",\"Value.$\":\"$.SomeKey\"}]}]},\"LaunchType\":\"EC2\"},\"Type\":\"Task\",\"Resource\":\"arn:", { "Ref": "AWS::Partition" }, ":states:::ecs:runTask.sync\"}}}" ] ] + }, + "roleArn": { + "Fn::GetAtt": [ + "StateMachineRoleB840431D", + "Arn" + ] } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_stepfunctions.CfnStateMachine", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_stepfunctions.StateMachine", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "BootstrapVersion": { "id": "BootstrapVersion", - "path": "aws-ecs-integ2/BootstrapVersion", + "path": "aws-sfn-tasks-ecs-task/BootstrapVersion", "constructInfo": { - "fqn": "aws-cdk-lib.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "aws-ecs-integ2/CheckBootstrapVersion", + "path": "aws-sfn-tasks-ecs-task/CheckBootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "SfnTasksEcsEc2TaskTest": { + "id": "SfnTasksEcsEc2TaskTest", + "path": "SfnTasksEcsEc2TaskTest", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "SfnTasksEcsEc2TaskTest/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "SfnTasksEcsEc2TaskTest/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "SfnTasksEcsEc2TaskTest/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "SfnTasksEcsEc2TaskTest/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "SfnTasksEcsEc2TaskTest/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, "constructInfo": { - "fqn": "aws-cdk-lib.CfnRule", + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.Stack", + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", "version": "0.0.0" } }, @@ -1978,13 +2040,13 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.App", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.ts index fd808d15b3d75..9ed50631515d6 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.ts @@ -5,9 +5,20 @@ import * as sfn from 'aws-cdk-lib/aws-stepfunctions'; import * as cdk from 'aws-cdk-lib'; import * as tasks from 'aws-cdk-lib/aws-stepfunctions-tasks'; import { EC2_RESTRICT_DEFAULT_SECURITY_GROUP } from 'aws-cdk-lib/cx-api'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; +/* + * * Creates a state machine with a task state to run a job with ECS on EC2 + * + * Stack verification steps: + * The generated State Machine can be executed from the CLI (or Step Functions console) + * and runs with an execution status of `Succeeded`. + * + * -- aws stepfunctions start-execution --state-machine-arn provides execution arn + * -- aws stepfunctions describe-execution --execution-arn returns a status of `Succeeded` + */ const app = new cdk.App(); -const stack = new cdk.Stack(app, 'aws-ecs-integ2'); +const stack = new cdk.Stack(app, 'aws-sfn-tasks-ecs-task'); stack.node.setContext(EC2_RESTRICT_DEFAULT_SECURITY_GROUP, false); const cluster = new ecs.Cluster(stack, 'FargateCluster'); @@ -18,7 +29,7 @@ cluster.addCapacity('DefaultAutoScalingGroup', { // Build task definition const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); -const containerDefinition = taskDefinition.addContainer('TheContainer', { +const containerDefinition = taskDefinition.addContainer('Container', { image: ecs.ContainerImage.fromAsset(path.resolve(__dirname, 'eventhandler-image')), memoryLimitMiB: 256, logging: new ecs.AwsLogDriver({ streamPrefix: 'EventDemo' }), @@ -52,4 +63,8 @@ new sfn.StateMachine(stack, 'StateMachine', { definition, }); +new IntegTest(app, 'SfnTasksEcsEc2TaskTest', { + testCases: [stack], +}); + app.synth(); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/SfnTasksEcsFargateRunTaskTestDefaultTestDeployAssert9D97FD2B.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/SfnTasksEcsFargateRunTaskTestDefaultTestDeployAssert9D97FD2B.assets.json new file mode 100644 index 0000000000000..d917df2e02b1d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/SfnTasksEcsFargateRunTaskTestDefaultTestDeployAssert9D97FD2B.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "SfnTasksEcsFargateRunTaskTestDefaultTestDeployAssert9D97FD2B.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/SfnTasksEcsFargateRunTaskTestDefaultTestDeployAssert9D97FD2B.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/SfnTasksEcsFargateRunTaskTestDefaultTestDeployAssert9D97FD2B.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/SfnTasksEcsFargateRunTaskTestDefaultTestDeployAssert9D97FD2B.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2/Dockerfile b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2/Dockerfile deleted file mode 100644 index 235b30e9661ed..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM public.ecr.aws/lambda/python:3.6 -EXPOSE 8000 -WORKDIR /src -ADD . /src -CMD python3 index.py diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534/Dockerfile b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534/Dockerfile new file mode 100644 index 0000000000000..23cf9b3e22f5d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534/Dockerfile @@ -0,0 +1,3 @@ +FROM public.ecr.aws/docker/library/python:3.12 +ADD index.py . +CMD [ "python3", "./index.py" ] diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2/index.py b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534/index.py similarity index 82% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2/index.py rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534/index.py index c4cab119afc2d..730f1be5ad06e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2/index.py +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534/index.py @@ -1,4 +1,3 @@ -#!/usr/bin/python import os import pprint diff --git a/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 b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/aws-sfn-tasks-ecs-fargate-run-task.assets.json similarity index 60% rename from 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 rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/aws-sfn-tasks-ecs-fargate-run-task.assets.json index 727e6ea153ff5..cb324b8ac0ca7 100644 --- a/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 +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/aws-sfn-tasks-ecs-fargate-run-task.assets.json @@ -1,29 +1,29 @@ { - "version": "31.0.0", + "version": "36.0.0", "files": { - "e0fc842b7fabc881a98d67eb7dec48a397328444df14c6f4b2cd2c341ac07639": { + "0ca0554ec9ca9ad5a8c05f7cd0009a3e53dd3645de04e448b2afe776f7d1c945": { "source": { - "path": "aws-sfn-tasks-ecs-fargate-integ.template.json", + "path": "aws-sfn-tasks-ecs-fargate-run-task.template.json", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "e0fc842b7fabc881a98d67eb7dec48a397328444df14c6f4b2cd2c341ac07639.json", + "objectKey": "0ca0554ec9ca9ad5a8c05f7cd0009a3e53dd3645de04e448b2afe776f7d1c945.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } } }, "dockerImages": { - "7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2": { + "d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534": { "source": { - "directory": "asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2" + "directory": "asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534" }, "destinations": { "current_account-current_region": { "repositoryName": "cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}", - "imageTag": "7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2", + "imageTag": "d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-image-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/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 b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/aws-sfn-tasks-ecs-fargate-run-task.template.json similarity index 70% rename from 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 rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/aws-sfn-tasks-ecs-fargate-run-task.template.json index 9bb78abfc790e..44394dfa9a8ef 100644 --- a/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 +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/aws-sfn-tasks-ecs-fargate-run-task.template.json @@ -13,7 +13,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc" + "Value": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc" } ] } @@ -21,9 +21,6 @@ "FargateClusterVpcPublicSubnet1SubnetB9C24BC7": { "Type": "AWS::EC2::Subnet", "Properties": { - "VpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "AvailabilityZone": { "Fn::Select": [ 0, @@ -45,23 +42,26 @@ }, { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet1" + "Value": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet1" } - ] + ], + "VpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "FargateClusterVpcPublicSubnet1RouteTable1D7FA747": { "Type": "AWS::EC2::RouteTable", "Properties": { - "VpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "Tags": [ { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet1" + "Value": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet1" } - ] + ], + "VpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "FargateClusterVpcPublicSubnet1RouteTableAssociation80F1442F": { @@ -78,12 +78,12 @@ "FargateClusterVpcPublicSubnet1DefaultRoute80086690": { "Type": "AWS::EC2::Route", "Properties": { - "RouteTableId": { - "Ref": "FargateClusterVpcPublicSubnet1RouteTable1D7FA747" - }, "DestinationCidrBlock": "0.0.0.0/0", "GatewayId": { "Ref": "FargateClusterVpcIGW827638CB" + }, + "RouteTableId": { + "Ref": "FargateClusterVpcPublicSubnet1RouteTable1D7FA747" } }, "DependsOn": [ @@ -97,7 +97,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet1" + "Value": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet1" } ] } @@ -105,19 +105,19 @@ "FargateClusterVpcPublicSubnet1NATGateway5202D86A": { "Type": "AWS::EC2::NatGateway", "Properties": { - "SubnetId": { - "Ref": "FargateClusterVpcPublicSubnet1SubnetB9C24BC7" - }, "AllocationId": { "Fn::GetAtt": [ "FargateClusterVpcPublicSubnet1EIPF91909D0", "AllocationId" ] }, + "SubnetId": { + "Ref": "FargateClusterVpcPublicSubnet1SubnetB9C24BC7" + }, "Tags": [ { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet1" + "Value": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet1" } ] }, @@ -129,9 +129,6 @@ "FargateClusterVpcPublicSubnet2Subnet24C0F9D8": { "Type": "AWS::EC2::Subnet", "Properties": { - "VpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "AvailabilityZone": { "Fn::Select": [ 1, @@ -153,23 +150,26 @@ }, { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet2" + "Value": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet2" } - ] + ], + "VpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "FargateClusterVpcPublicSubnet2RouteTable1493C5D6": { "Type": "AWS::EC2::RouteTable", "Properties": { - "VpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "Tags": [ { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet2" + "Value": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet2" } - ] + ], + "VpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "FargateClusterVpcPublicSubnet2RouteTableAssociation3EFA74DC": { @@ -186,12 +186,12 @@ "FargateClusterVpcPublicSubnet2DefaultRoute8E847CD2": { "Type": "AWS::EC2::Route", "Properties": { - "RouteTableId": { - "Ref": "FargateClusterVpcPublicSubnet2RouteTable1493C5D6" - }, "DestinationCidrBlock": "0.0.0.0/0", "GatewayId": { "Ref": "FargateClusterVpcIGW827638CB" + }, + "RouteTableId": { + "Ref": "FargateClusterVpcPublicSubnet2RouteTable1493C5D6" } }, "DependsOn": [ @@ -205,7 +205,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet2" + "Value": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet2" } ] } @@ -213,19 +213,19 @@ "FargateClusterVpcPublicSubnet2NATGatewayFFEC8ED2": { "Type": "AWS::EC2::NatGateway", "Properties": { - "SubnetId": { - "Ref": "FargateClusterVpcPublicSubnet2Subnet24C0F9D8" - }, "AllocationId": { "Fn::GetAtt": [ "FargateClusterVpcPublicSubnet2EIPBBB24774", "AllocationId" ] }, + "SubnetId": { + "Ref": "FargateClusterVpcPublicSubnet2Subnet24C0F9D8" + }, "Tags": [ { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet2" + "Value": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet2" } ] }, @@ -237,9 +237,6 @@ "FargateClusterVpcPrivateSubnet1Subnet9127625F": { "Type": "AWS::EC2::Subnet", "Properties": { - "VpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "AvailabilityZone": { "Fn::Select": [ 0, @@ -261,23 +258,26 @@ }, { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PrivateSubnet1" + "Value": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PrivateSubnet1" } - ] + ], + "VpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "FargateClusterVpcPrivateSubnet1RouteTable21B3CEAE": { "Type": "AWS::EC2::RouteTable", "Properties": { - "VpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "Tags": [ { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PrivateSubnet1" + "Value": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PrivateSubnet1" } - ] + ], + "VpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "FargateClusterVpcPrivateSubnet1RouteTableAssociation78F6E213": { @@ -294,21 +294,18 @@ "FargateClusterVpcPrivateSubnet1DefaultRoute0438DCBA": { "Type": "AWS::EC2::Route", "Properties": { - "RouteTableId": { - "Ref": "FargateClusterVpcPrivateSubnet1RouteTable21B3CEAE" - }, "DestinationCidrBlock": "0.0.0.0/0", "NatGatewayId": { "Ref": "FargateClusterVpcPublicSubnet1NATGateway5202D86A" + }, + "RouteTableId": { + "Ref": "FargateClusterVpcPrivateSubnet1RouteTable21B3CEAE" } } }, "FargateClusterVpcPrivateSubnet2Subnet307CEE57": { "Type": "AWS::EC2::Subnet", "Properties": { - "VpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "AvailabilityZone": { "Fn::Select": [ 1, @@ -330,23 +327,26 @@ }, { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PrivateSubnet2" + "Value": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PrivateSubnet2" } - ] + ], + "VpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "FargateClusterVpcPrivateSubnet2RouteTable7B7F9678": { "Type": "AWS::EC2::RouteTable", "Properties": { - "VpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "Tags": [ { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PrivateSubnet2" + "Value": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PrivateSubnet2" } - ] + ], + "VpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "FargateClusterVpcPrivateSubnet2RouteTableAssociation3A46964C": { @@ -363,12 +363,12 @@ "FargateClusterVpcPrivateSubnet2DefaultRoute35FDD29D": { "Type": "AWS::EC2::Route", "Properties": { - "RouteTableId": { - "Ref": "FargateClusterVpcPrivateSubnet2RouteTable7B7F9678" - }, "DestinationCidrBlock": "0.0.0.0/0", "NatGatewayId": { "Ref": "FargateClusterVpcPublicSubnet2NATGatewayFFEC8ED2" + }, + "RouteTableId": { + "Ref": "FargateClusterVpcPrivateSubnet2RouteTable7B7F9678" } } }, @@ -378,7 +378,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc" + "Value": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc" } ] } @@ -386,11 +386,11 @@ "FargateClusterVpcVPCGW38717255": { "Type": "AWS::EC2::VPCGatewayAttachment", "Properties": { - "VpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "InternetGatewayId": { "Ref": "FargateClusterVpcIGW827638CB" + }, + "VpcId": { + "Ref": "FargateClusterVpc377E8024" } } }, @@ -418,7 +418,7 @@ { "Essential": true, "Image": { - "Fn::Sub": "${AWS::AccountId}.dkr.ecr.${AWS::Region}.${AWS::URLSuffix}/cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}:7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2" + "Fn::Sub": "${AWS::AccountId}.dkr.ecr.${AWS::Region}.${AWS::URLSuffix}/cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}:d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534" }, "LogConfiguration": { "LogDriver": "awslogs", @@ -443,7 +443,7 @@ "Arn" ] }, - "Family": "awssfntasksecsfargateintegTaskDefD0F4AD10", + "Family": "awssfntasksecsfargateruntaskTaskDef0E89D5AE", "Memory": "512", "NetworkMode": "awsvpc", "RequiresCompatibilities": [ @@ -547,7 +547,7 @@ "FargateTaskSecurityGroup0BBB27CB": { "Type": "AWS::EC2::SecurityGroup", "Properties": { - "GroupDescription": "aws-sfn-tasks-ecs-fargate-integ/FargateTask/SecurityGroup", + "GroupDescription": "aws-sfn-tasks-ecs-fargate-run-task/FargateTask/SecurityGroup", "SecurityGroupEgress": [ { "CidrIp": "0.0.0.0/0", @@ -560,10 +560,10 @@ } } }, - "FargeateTaskSetRevisionNumberSecurityGroup916C9B0B": { + "FargateTaskSetRevisionNumberSecurityGroupDF805F2C": { "Type": "AWS::EC2::SecurityGroup", "Properties": { - "GroupDescription": "aws-sfn-tasks-ecs-fargate-integ/FargeateTaskSetRevisionNumber/SecurityGroup", + "GroupDescription": "aws-sfn-tasks-ecs-fargate-run-task/FargateTaskSetRevisionNumber/SecurityGroup", "SecurityGroupEgress": [ { "CidrIp": "0.0.0.0/0", @@ -576,10 +576,10 @@ } } }, - "FargeateTaskWithPropagatedTagSecurityGroup94A6AE70": { + "FargateTaskWithPropagatedTagSecurityGroupE2B5DD29": { "Type": "AWS::EC2::SecurityGroup", "Properties": { - "GroupDescription": "aws-sfn-tasks-ecs-fargate-integ/FargeateTaskWithPropagatedTag/SecurityGroup", + "GroupDescription": "aws-sfn-tasks-ecs-fargate-run-task/FargateTaskWithPropagatedTag/SecurityGroup", "SecurityGroupEgress": [ { "CidrIp": "0.0.0.0/0", @@ -617,117 +617,231 @@ { "Action": "ecs:RunTask", "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - ":", - { - "Ref": "TaskDef54694570" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 2, - { - "Fn::Split": [ - ":", - { - "Ref": "TaskDef54694570" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Ref": "TaskDef54694570" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Ref": "TaskDef54694570" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "/", - { - "Fn::Select": [ - 5, - { - "Fn::Split": [ - ":", - { - "Ref": "TaskDef54694570" - } - ] - } - ] - } - ] - } - ] - }, - "/", - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "/", - { - "Fn::Select": [ - 5, - { - "Fn::Split": [ - ":", - { - "Ref": "TaskDef54694570" - } - ] - } - ] - } - ] - } - ] - } + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + } + ] + } + ] + }, + "/", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + } + ] + } + ] + }, + ":*" + ] ] - ] - } + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + } + ] + } + ] + }, + "/", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + } + ] + } + ] + } + ] + ] + } + ] }, { "Action": [ @@ -797,17 +911,11 @@ "StateMachine2E01A3A5": { "Type": "AWS::StepFunctions::StateMachine", "Properties": { - "RoleArn": { - "Fn::GetAtt": [ - "StateMachineRoleB840431D", - "Arn" - ] - }, "DefinitionString": { "Fn::Join": [ "", [ - "{\"StartAt\":\"Start\",\"States\":{\"Start\":{\"Type\":\"Pass\",\"Result\":{\"SomeKey\":\"SomeValue\",\"Timeout\":900},\"Next\":\"FargateTask\"},\"FargateTask\":{\"Next\":\"FargeateTaskSetRevisionNumber\",\"Type\":\"Task\",\"TimeoutSecondsPath\":\"$.Timeout\",\"Resource\":\"arn:", + "{\"StartAt\":\"Start\",\"States\":{\"Start\":{\"Type\":\"Pass\",\"Result\":{\"SomeKey\":\"SomeValue\",\"Timeout\":900},\"Next\":\"FargateTask\"},\"FargateTask\":{\"Next\":\"FargateTaskSetRevisionNumber\",\"Type\":\"Task\",\"TimeoutSecondsPath\":\"$.Timeout\",\"Resource\":\"arn:", { "Ref": "AWS::Partition" }, @@ -818,7 +926,7 @@ "Arn" ] }, - "\",\"TaskDefinition\":\"awssfntasksecsfargateintegTaskDefD0F4AD10\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"AssignPublicIp\":\"ENABLED\",\"Subnets\":[\"", + "\",\"TaskDefinition\":\"awssfntasksecsfargateruntaskTaskDef0E89D5AE\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"AssignPublicIp\":\"ENABLED\",\"Subnets\":[\"", { "Ref": "FargateClusterVpcPublicSubnet1SubnetB9C24BC7" }, @@ -833,7 +941,7 @@ "GroupId" ] }, - "\"]}},\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"TheContainer\",\"Environment\":[{\"Name\":\"SOME_KEY\",\"Value.$\":\"$.SomeKey\"}]}]},\"LaunchType\":\"FARGATE\",\"PlatformVersion\":\"1.4.0\"}},\"FargeateTaskSetRevisionNumber\":{\"Next\":\"FargeateTaskWithPropagatedTag\",\"Type\":\"Task\",\"Resource\":\"arn:", + "\"]}},\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"TheContainer\",\"Environment\":[{\"Name\":\"SOME_KEY\",\"Value.$\":\"$.SomeKey\"}]}]},\"LaunchType\":\"FARGATE\",\"PlatformVersion\":\"1.4.0\"}},\"FargateTaskSetRevisionNumber\":{\"Next\":\"FargateTaskWithPropagatedTag\",\"Type\":\"Task\",\"Resource\":\"arn:", { "Ref": "AWS::Partition" }, @@ -844,7 +952,7 @@ "Arn" ] }, - "\",\"TaskDefinition\":\"awssfntasksecsfargateintegTaskDefD0F4AD10:1\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"Subnets\":[\"", + "\",\"TaskDefinition\":\"awssfntasksecsfargateruntaskTaskDef0E89D5AE:1\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"Subnets\":[\"", { "Ref": "FargateClusterVpcPrivateSubnet1Subnet9127625F" }, @@ -855,11 +963,11 @@ "\"],\"SecurityGroups\":[\"", { "Fn::GetAtt": [ - "FargeateTaskSetRevisionNumberSecurityGroup916C9B0B", + "FargateTaskSetRevisionNumberSecurityGroupDF805F2C", "GroupId" ] }, - "\"]}},\"LaunchType\":\"FARGATE\",\"PlatformVersion\":\"1.4.0\"}},\"FargeateTaskWithPropagatedTag\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + "\"]}},\"LaunchType\":\"FARGATE\",\"PlatformVersion\":\"1.4.0\"}},\"FargateTaskWithPropagatedTag\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", { "Ref": "AWS::Partition" }, @@ -870,7 +978,7 @@ "Arn" ] }, - "\",\"TaskDefinition\":\"awssfntasksecsfargateintegTaskDefD0F4AD10\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"Subnets\":[\"", + "\",\"TaskDefinition\":\"awssfntasksecsfargateruntaskTaskDef0E89D5AE\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"Subnets\":[\"", { "Ref": "FargateClusterVpcPrivateSubnet1Subnet9127625F" }, @@ -881,13 +989,19 @@ "\"],\"SecurityGroups\":[\"", { "Fn::GetAtt": [ - "FargeateTaskWithPropagatedTagSecurityGroup94A6AE70", + "FargateTaskWithPropagatedTagSecurityGroupE2B5DD29", "GroupId" ] }, "\"]}},\"PropagateTags\":\"TASK_DEFINITION\",\"LaunchType\":\"FARGATE\",\"PlatformVersion\":\"1.4.0\"}}}}" ] ] + }, + "RoleArn": { + "Fn::GetAtt": [ + "StateMachineRoleB840431D", + "Arn" + ] } }, "DependsOn": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/cdk.out index 7925065efbcc4..1f0068d32659a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"31.0.0"} \ No newline at end of file +{"version":"36.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/integ.json index ab3675c9bf242..ba724e856a348 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/integ.json @@ -1,14 +1,12 @@ { - "version": "31.0.0", + "version": "36.0.0", "testCases": { - "integ.fargate-run-task": { + "SfnTasksEcsFargateRunTaskTest/DefaultTest": { "stacks": [ - "aws-sfn-tasks-ecs-fargate-integ" + "aws-sfn-tasks-ecs-fargate-run-task" ], - "diffAssets": false, - "stackUpdateWorkflow": true + "assertionStack": "SfnTasksEcsFargateRunTaskTest/DefaultTest/DeployAssert", + "assertionStackName": "SfnTasksEcsFargateRunTaskTestDefaultTestDeployAssert9D97FD2B" } - }, - "synthContext": {}, - "enableLookups": false + } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/manifest.json index f1ee1b6e97426..1c19eb3e4901a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/manifest.json @@ -1,27 +1,28 @@ { - "version": "31.0.0", + "version": "36.0.0", "artifacts": { - "aws-sfn-tasks-ecs-fargate-integ.assets": { + "aws-sfn-tasks-ecs-fargate-run-task.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "aws-sfn-tasks-ecs-fargate-integ.assets.json", + "file": "aws-sfn-tasks-ecs-fargate-run-task.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "aws-sfn-tasks-ecs-fargate-integ": { + "aws-sfn-tasks-ecs-fargate-run-task": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "aws-sfn-tasks-ecs-fargate-integ.template.json", + "templateFile": "aws-sfn-tasks-ecs-fargate-run-task.template.json", + "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/e0fc842b7fabc881a98d67eb7dec48a397328444df14c6f4b2cd2c341ac07639.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/0ca0554ec9ca9ad5a8c05f7cd0009a3e53dd3645de04e448b2afe776f7d1c945.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "aws-sfn-tasks-ecs-fargate-integ.assets" + "aws-sfn-tasks-ecs-fargate-run-task.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", @@ -30,239 +31,287 @@ } }, "dependencies": [ - "aws-sfn-tasks-ecs-fargate-integ.assets" + "aws-sfn-tasks-ecs-fargate-run-task.assets" ], "metadata": { - "/aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Resource": [ + "/aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Resource": [ { "type": "aws:cdk:logicalId", "data": "FargateCluster7CCD5F93" } ], - "/aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/Resource": [ + "/aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/Resource": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpc377E8024" } ], - "/aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet1/Subnet": [ + "/aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet1/Subnet": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet1SubnetB9C24BC7" } ], - "/aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet1/RouteTable": [ + "/aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet1/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet1RouteTable1D7FA747" } ], - "/aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet1/RouteTableAssociation": [ + "/aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet1/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet1RouteTableAssociation80F1442F" } ], - "/aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet1/DefaultRoute": [ + "/aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet1/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet1DefaultRoute80086690" } ], - "/aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet1/EIP": [ + "/aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet1/EIP": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet1EIPF91909D0" } ], - "/aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet1/NATGateway": [ + "/aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet1/NATGateway": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet1NATGateway5202D86A" } ], - "/aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet2/Subnet": [ + "/aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet2/Subnet": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet2Subnet24C0F9D8" } ], - "/aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet2/RouteTable": [ + "/aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet2/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet2RouteTable1493C5D6" } ], - "/aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet2/RouteTableAssociation": [ + "/aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet2/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet2RouteTableAssociation3EFA74DC" } ], - "/aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet2/DefaultRoute": [ + "/aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet2/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet2DefaultRoute8E847CD2" } ], - "/aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet2/EIP": [ + "/aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet2/EIP": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet2EIPBBB24774" } ], - "/aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet2/NATGateway": [ + "/aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet2/NATGateway": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet2NATGatewayFFEC8ED2" } ], - "/aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PrivateSubnet1/Subnet": [ + "/aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PrivateSubnet1/Subnet": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPrivateSubnet1Subnet9127625F" } ], - "/aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PrivateSubnet1/RouteTable": [ + "/aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PrivateSubnet1/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPrivateSubnet1RouteTable21B3CEAE" } ], - "/aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PrivateSubnet1/RouteTableAssociation": [ + "/aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PrivateSubnet1/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPrivateSubnet1RouteTableAssociation78F6E213" } ], - "/aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PrivateSubnet1/DefaultRoute": [ + "/aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PrivateSubnet1/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPrivateSubnet1DefaultRoute0438DCBA" } ], - "/aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PrivateSubnet2/Subnet": [ + "/aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PrivateSubnet2/Subnet": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPrivateSubnet2Subnet307CEE57" } ], - "/aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PrivateSubnet2/RouteTable": [ + "/aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PrivateSubnet2/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPrivateSubnet2RouteTable7B7F9678" } ], - "/aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PrivateSubnet2/RouteTableAssociation": [ + "/aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PrivateSubnet2/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPrivateSubnet2RouteTableAssociation3A46964C" } ], - "/aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PrivateSubnet2/DefaultRoute": [ + "/aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PrivateSubnet2/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPrivateSubnet2DefaultRoute35FDD29D" } ], - "/aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/IGW": [ + "/aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/IGW": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcIGW827638CB" } ], - "/aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/VPCGW": [ + "/aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/VPCGW": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcVPCGW38717255" } ], - "/aws-sfn-tasks-ecs-fargate-integ/TaskDef/TaskRole/Resource": [ + "/aws-sfn-tasks-ecs-fargate-run-task/TaskDef/TaskRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "TaskDefTaskRole1EDB4A67" } ], - "/aws-sfn-tasks-ecs-fargate-integ/TaskDef/Resource": [ + "/aws-sfn-tasks-ecs-fargate-run-task/TaskDef/Resource": [ { "type": "aws:cdk:logicalId", "data": "TaskDef54694570" } ], - "/aws-sfn-tasks-ecs-fargate-integ/TaskDef/TheContainer/LogGroup/Resource": [ + "/aws-sfn-tasks-ecs-fargate-run-task/TaskDef/TheContainer/LogGroup/Resource": [ { "type": "aws:cdk:logicalId", "data": "TaskDefTheContainerLogGroupD94C8EF5" } ], - "/aws-sfn-tasks-ecs-fargate-integ/TaskDef/ExecutionRole/Resource": [ + "/aws-sfn-tasks-ecs-fargate-run-task/TaskDef/ExecutionRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "TaskDefExecutionRoleB4775C97" } ], - "/aws-sfn-tasks-ecs-fargate-integ/TaskDef/ExecutionRole/DefaultPolicy/Resource": [ + "/aws-sfn-tasks-ecs-fargate-run-task/TaskDef/ExecutionRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "TaskDefExecutionRoleDefaultPolicy0DBB737A" } ], - "/aws-sfn-tasks-ecs-fargate-integ/FargateTask/SecurityGroup/Resource": [ + "/aws-sfn-tasks-ecs-fargate-run-task/FargateTask/SecurityGroup/Resource": [ { "type": "aws:cdk:logicalId", "data": "FargateTaskSecurityGroup0BBB27CB" } ], - "/aws-sfn-tasks-ecs-fargate-integ/FargeateTaskSetRevisionNumber/SecurityGroup/Resource": [ + "/aws-sfn-tasks-ecs-fargate-run-task/FargateTaskSetRevisionNumber/SecurityGroup/Resource": [ { "type": "aws:cdk:logicalId", - "data": "FargeateTaskSetRevisionNumberSecurityGroup916C9B0B" + "data": "FargateTaskSetRevisionNumberSecurityGroupDF805F2C" } ], - "/aws-sfn-tasks-ecs-fargate-integ/FargeateTaskWithPropagatedTag/SecurityGroup/Resource": [ + "/aws-sfn-tasks-ecs-fargate-run-task/FargateTaskWithPropagatedTag/SecurityGroup/Resource": [ { "type": "aws:cdk:logicalId", - "data": "FargeateTaskWithPropagatedTagSecurityGroup94A6AE70" + "data": "FargateTaskWithPropagatedTagSecurityGroupE2B5DD29" } ], - "/aws-sfn-tasks-ecs-fargate-integ/StateMachine/Role/Resource": [ + "/aws-sfn-tasks-ecs-fargate-run-task/StateMachine/Role/Resource": [ { "type": "aws:cdk:logicalId", "data": "StateMachineRoleB840431D" } ], - "/aws-sfn-tasks-ecs-fargate-integ/StateMachine/Role/DefaultPolicy/Resource": [ + "/aws-sfn-tasks-ecs-fargate-run-task/StateMachine/Role/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "StateMachineRoleDefaultPolicyDF1E6607" } ], - "/aws-sfn-tasks-ecs-fargate-integ/StateMachine/Resource": [ + "/aws-sfn-tasks-ecs-fargate-run-task/StateMachine/Resource": [ { "type": "aws:cdk:logicalId", "data": "StateMachine2E01A3A5" } ], - "/aws-sfn-tasks-ecs-fargate-integ/stateMachineArn": [ + "/aws-sfn-tasks-ecs-fargate-run-task/stateMachineArn": [ { "type": "aws:cdk:logicalId", "data": "stateMachineArn" } ], - "/aws-sfn-tasks-ecs-fargate-integ/BootstrapVersion": [ + "/aws-sfn-tasks-ecs-fargate-run-task/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/aws-sfn-tasks-ecs-fargate-integ/CheckBootstrapVersion": [ + "/aws-sfn-tasks-ecs-fargate-run-task/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } ] }, - "displayName": "aws-sfn-tasks-ecs-fargate-integ" + "displayName": "aws-sfn-tasks-ecs-fargate-run-task" + }, + "SfnTasksEcsFargateRunTaskTestDefaultTestDeployAssert9D97FD2B.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "SfnTasksEcsFargateRunTaskTestDefaultTestDeployAssert9D97FD2B.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "SfnTasksEcsFargateRunTaskTestDefaultTestDeployAssert9D97FD2B": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "SfnTasksEcsFargateRunTaskTestDefaultTestDeployAssert9D97FD2B.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "SfnTasksEcsFargateRunTaskTestDefaultTestDeployAssert9D97FD2B.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "SfnTasksEcsFargateRunTaskTestDefaultTestDeployAssert9D97FD2B.assets" + ], + "metadata": { + "/SfnTasksEcsFargateRunTaskTest/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/SfnTasksEcsFargateRunTaskTest/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "SfnTasksEcsFargateRunTaskTest/DefaultTest/DeployAssert" }, "Tree": { "type": "cdk:tree", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/tree.json index f175e72b29520..9bb649587067d 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/tree.json @@ -4,33 +4,33 @@ "id": "App", "path": "", "children": { - "aws-sfn-tasks-ecs-fargate-integ": { - "id": "aws-sfn-tasks-ecs-fargate-integ", - "path": "aws-sfn-tasks-ecs-fargate-integ", + "aws-sfn-tasks-ecs-fargate-run-task": { + "id": "aws-sfn-tasks-ecs-fargate-run-task", + "path": "aws-sfn-tasks-ecs-fargate-run-task", "children": { "FargateCluster": { "id": "FargateCluster", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster", "children": { "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Resource", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::ECS::Cluster", "aws:cdk:cloudformation:props": {} }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ecs.CfnCluster", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Vpc": { "id": "Vpc", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc", "children": { "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/Resource", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::VPC", "aws:cdk:cloudformation:props": { @@ -41,29 +41,26 @@ "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc" + "value": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc" } ] } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnVPC", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "PublicSubnet1": { "id": "PublicSubnet1", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet1", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet1", "children": { "Subnet": { "id": "Subnet", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet1/Subnet", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet1/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "availabilityZone": { "Fn::Select": [ 0, @@ -85,49 +82,52 @@ }, { "key": "Name", - "value": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet1" + "value": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet1" } - ] + ], + "vpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Acl": { "id": "Acl", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet1/Acl", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet1/Acl", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTable": { "id": "RouteTable", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet1/RouteTable", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet1/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet1" + "value": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet1" } - ] + ], + "vpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet1/RouteTableAssociation", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet1/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -140,33 +140,33 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultRoute": { "id": "DefaultRoute", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet1/DefaultRoute", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet1/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "FargateClusterVpcPublicSubnet1RouteTable1D7FA747" - }, "destinationCidrBlock": "0.0.0.0/0", "gatewayId": { "Ref": "FargateClusterVpcIGW827638CB" + }, + "routeTableId": { + "Ref": "FargateClusterVpcPublicSubnet1RouteTable1D7FA747" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "EIP": { "id": "EIP", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet1/EIP", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet1/EIP", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::EIP", "aws:cdk:cloudformation:props": { @@ -174,63 +174,60 @@ "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet1" + "value": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet1" } ] } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "NATGateway": { "id": "NATGateway", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet1/NATGateway", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet1/NATGateway", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", "aws:cdk:cloudformation:props": { - "subnetId": { - "Ref": "FargateClusterVpcPublicSubnet1SubnetB9C24BC7" - }, "allocationId": { "Fn::GetAtt": [ "FargateClusterVpcPublicSubnet1EIPF91909D0", "AllocationId" ] }, + "subnetId": { + "Ref": "FargateClusterVpcPublicSubnet1SubnetB9C24BC7" + }, "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet1" + "value": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet1" } ] } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "PublicSubnet2": { "id": "PublicSubnet2", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet2", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet2", "children": { "Subnet": { "id": "Subnet", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet2/Subnet", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet2/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "availabilityZone": { "Fn::Select": [ 1, @@ -252,49 +249,52 @@ }, { "key": "Name", - "value": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet2" + "value": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet2" } - ] + ], + "vpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Acl": { "id": "Acl", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet2/Acl", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet2/Acl", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTable": { "id": "RouteTable", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet2/RouteTable", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet2/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet2" + "value": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet2" } - ] + ], + "vpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet2/RouteTableAssociation", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet2/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -307,33 +307,33 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultRoute": { "id": "DefaultRoute", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet2/DefaultRoute", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet2/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "FargateClusterVpcPublicSubnet2RouteTable1493C5D6" - }, "destinationCidrBlock": "0.0.0.0/0", "gatewayId": { "Ref": "FargateClusterVpcIGW827638CB" + }, + "routeTableId": { + "Ref": "FargateClusterVpcPublicSubnet2RouteTable1493C5D6" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "EIP": { "id": "EIP", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet2/EIP", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet2/EIP", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::EIP", "aws:cdk:cloudformation:props": { @@ -341,63 +341,60 @@ "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet2" + "value": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet2" } ] } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "NATGateway": { "id": "NATGateway", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet2/NATGateway", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet2/NATGateway", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", "aws:cdk:cloudformation:props": { - "subnetId": { - "Ref": "FargateClusterVpcPublicSubnet2Subnet24C0F9D8" - }, "allocationId": { "Fn::GetAtt": [ "FargateClusterVpcPublicSubnet2EIPBBB24774", "AllocationId" ] }, + "subnetId": { + "Ref": "FargateClusterVpcPublicSubnet2Subnet24C0F9D8" + }, "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PublicSubnet2" + "value": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PublicSubnet2" } ] } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "PrivateSubnet1": { "id": "PrivateSubnet1", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PrivateSubnet1", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PrivateSubnet1", "children": { "Subnet": { "id": "Subnet", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PrivateSubnet1/Subnet", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PrivateSubnet1/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "availabilityZone": { "Fn::Select": [ 0, @@ -419,49 +416,52 @@ }, { "key": "Name", - "value": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PrivateSubnet1" + "value": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PrivateSubnet1" } - ] + ], + "vpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Acl": { "id": "Acl", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PrivateSubnet1/Acl", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PrivateSubnet1/Acl", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTable": { "id": "RouteTable", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PrivateSubnet1/RouteTable", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PrivateSubnet1/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PrivateSubnet1" + "value": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PrivateSubnet1" } - ] + ], + "vpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PrivateSubnet1/RouteTableAssociation", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PrivateSubnet1/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -474,49 +474,46 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultRoute": { "id": "DefaultRoute", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PrivateSubnet1/DefaultRoute", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PrivateSubnet1/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "FargateClusterVpcPrivateSubnet1RouteTable21B3CEAE" - }, "destinationCidrBlock": "0.0.0.0/0", "natGatewayId": { "Ref": "FargateClusterVpcPublicSubnet1NATGateway5202D86A" + }, + "routeTableId": { + "Ref": "FargateClusterVpcPrivateSubnet1RouteTable21B3CEAE" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "PrivateSubnet2": { "id": "PrivateSubnet2", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PrivateSubnet2", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PrivateSubnet2", "children": { "Subnet": { "id": "Subnet", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PrivateSubnet2/Subnet", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PrivateSubnet2/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "availabilityZone": { "Fn::Select": [ 1, @@ -538,49 +535,52 @@ }, { "key": "Name", - "value": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PrivateSubnet2" + "value": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PrivateSubnet2" } - ] + ], + "vpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Acl": { "id": "Acl", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PrivateSubnet2/Acl", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PrivateSubnet2/Acl", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTable": { "id": "RouteTable", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PrivateSubnet2/RouteTable", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PrivateSubnet2/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PrivateSubnet2" + "value": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PrivateSubnet2" } - ] + ], + "vpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PrivateSubnet2/RouteTableAssociation", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PrivateSubnet2/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -593,105 +593,105 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultRoute": { "id": "DefaultRoute", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/PrivateSubnet2/DefaultRoute", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/PrivateSubnet2/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "FargateClusterVpcPrivateSubnet2RouteTable7B7F9678" - }, "destinationCidrBlock": "0.0.0.0/0", "natGatewayId": { "Ref": "FargateClusterVpcPublicSubnet2NATGatewayFFEC8ED2" + }, + "routeTableId": { + "Ref": "FargateClusterVpcPrivateSubnet2RouteTable7B7F9678" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "IGW": { "id": "IGW", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/IGW", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/IGW", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", "aws:cdk:cloudformation:props": { "tags": [ { "key": "Name", - "value": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc" + "value": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc" } ] } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnInternetGateway", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "VPCGW": { "id": "VPCGW", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateCluster/Vpc/VPCGW", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateCluster/Vpc/VPCGW", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "internetGatewayId": { "Ref": "FargateClusterVpcIGW827638CB" + }, + "vpcId": { + "Ref": "FargateClusterVpc377E8024" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnVPCGatewayAttachment", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.Vpc", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ecs.Cluster", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "TaskDef": { "id": "TaskDef", - "path": "aws-sfn-tasks-ecs-fargate-integ/TaskDef", + "path": "aws-sfn-tasks-ecs-fargate-run-task/TaskDef", "children": { "TaskRole": { "id": "TaskRole", - "path": "aws-sfn-tasks-ecs-fargate-integ/TaskDef/TaskRole", + "path": "aws-sfn-tasks-ecs-fargate-run-task/TaskDef/TaskRole", "children": { "ImportTaskRole": { "id": "ImportTaskRole", - "path": "aws-sfn-tasks-ecs-fargate-integ/TaskDef/TaskRole/ImportTaskRole", + "path": "aws-sfn-tasks-ecs-fargate-run-task/TaskDef/TaskRole/ImportTaskRole", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-fargate-integ/TaskDef/TaskRole/Resource", + "path": "aws-sfn-tasks-ecs-fargate-run-task/TaskDef/TaskRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -710,19 +710,19 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-fargate-integ/TaskDef/Resource", + "path": "aws-sfn-tasks-ecs-fargate-run-task/TaskDef/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::ECS::TaskDefinition", "aws:cdk:cloudformation:props": { @@ -730,7 +730,7 @@ { "essential": true, "image": { - "Fn::Sub": "${AWS::AccountId}.dkr.ecr.${AWS::Region}.${AWS::URLSuffix}/cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}:7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2" + "Fn::Sub": "${AWS::AccountId}.dkr.ecr.${AWS::Region}.${AWS::URLSuffix}/cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}:d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534" }, "memory": 256, "name": "TheContainer", @@ -755,7 +755,7 @@ "Arn" ] }, - "family": "awssfntasksecsfargateintegTaskDefD0F4AD10", + "family": "awssfntasksecsfargateruntaskTaskDef0E89D5AE", "memory": "512", "networkMode": "awsvpc", "requiresCompatibilities": [ @@ -770,83 +770,83 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ecs.CfnTaskDefinition", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "TheContainer": { "id": "TheContainer", - "path": "aws-sfn-tasks-ecs-fargate-integ/TaskDef/TheContainer", + "path": "aws-sfn-tasks-ecs-fargate-run-task/TaskDef/TheContainer", "children": { "AssetImage": { "id": "AssetImage", - "path": "aws-sfn-tasks-ecs-fargate-integ/TaskDef/TheContainer/AssetImage", + "path": "aws-sfn-tasks-ecs-fargate-run-task/TaskDef/TheContainer/AssetImage", "children": { "Staging": { "id": "Staging", - "path": "aws-sfn-tasks-ecs-fargate-integ/TaskDef/TheContainer/AssetImage/Staging", + "path": "aws-sfn-tasks-ecs-fargate-run-task/TaskDef/TheContainer/AssetImage/Staging", "constructInfo": { - "fqn": "aws-cdk-lib.AssetStaging", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Repository": { "id": "Repository", - "path": "aws-sfn-tasks-ecs-fargate-integ/TaskDef/TheContainer/AssetImage/Repository", + "path": "aws-sfn-tasks-ecs-fargate-run-task/TaskDef/TheContainer/AssetImage/Repository", "constructInfo": { - "fqn": "aws-cdk-lib.aws_ecr.RepositoryBase", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ecr_assets.DockerImageAsset", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "LogGroup": { "id": "LogGroup", - "path": "aws-sfn-tasks-ecs-fargate-integ/TaskDef/TheContainer/LogGroup", + "path": "aws-sfn-tasks-ecs-fargate-run-task/TaskDef/TheContainer/LogGroup", "children": { "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-fargate-integ/TaskDef/TheContainer/LogGroup/Resource", + "path": "aws-sfn-tasks-ecs-fargate-run-task/TaskDef/TheContainer/LogGroup/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", "aws:cdk:cloudformation:props": {} }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_logs.LogGroup", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ecs.ContainerDefinition", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "ExecutionRole": { "id": "ExecutionRole", - "path": "aws-sfn-tasks-ecs-fargate-integ/TaskDef/ExecutionRole", + "path": "aws-sfn-tasks-ecs-fargate-run-task/TaskDef/ExecutionRole", "children": { "ImportExecutionRole": { "id": "ImportExecutionRole", - "path": "aws-sfn-tasks-ecs-fargate-integ/TaskDef/ExecutionRole/ImportExecutionRole", + "path": "aws-sfn-tasks-ecs-fargate-run-task/TaskDef/ExecutionRole/ImportExecutionRole", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-fargate-integ/TaskDef/ExecutionRole/Resource", + "path": "aws-sfn-tasks-ecs-fargate-run-task/TaskDef/ExecutionRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -865,17 +865,17 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-sfn-tasks-ecs-fargate-integ/TaskDef/ExecutionRole/DefaultPolicy", + "path": "aws-sfn-tasks-ecs-fargate-run-task/TaskDef/ExecutionRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-fargate-integ/TaskDef/ExecutionRole/DefaultPolicy/Resource", + "path": "aws-sfn-tasks-ecs-fargate-run-task/TaskDef/ExecutionRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -942,51 +942,51 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ecs.FargateTaskDefinition", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Start": { "id": "Start", - "path": "aws-sfn-tasks-ecs-fargate-integ/Start", + "path": "aws-sfn-tasks-ecs-fargate-run-task/Start", "constructInfo": { - "fqn": "aws-cdk-lib.aws_stepfunctions.Pass", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "FargateTask": { "id": "FargateTask", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateTask", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateTask", "children": { "SecurityGroup": { "id": "SecurityGroup", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateTask/SecurityGroup", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateTask/SecurityGroup", "children": { "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargateTask/SecurityGroup/Resource", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateTask/SecurityGroup/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", "aws:cdk:cloudformation:props": { - "groupDescription": "aws-sfn-tasks-ecs-fargate-integ/FargateTask/SecurityGroup", + "groupDescription": "aws-sfn-tasks-ecs-fargate-run-task/FargateTask/SecurityGroup", "securityGroupEgress": [ { "cidrIp": "0.0.0.0/0", @@ -1000,37 +1000,37 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSecurityGroup", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.SecurityGroup", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_stepfunctions_tasks.EcsRunTask", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, - "FargeateTaskSetRevisionNumber": { - "id": "FargeateTaskSetRevisionNumber", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargeateTaskSetRevisionNumber", + "FargateTaskSetRevisionNumber": { + "id": "FargateTaskSetRevisionNumber", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateTaskSetRevisionNumber", "children": { "SecurityGroup": { "id": "SecurityGroup", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargeateTaskSetRevisionNumber/SecurityGroup", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateTaskSetRevisionNumber/SecurityGroup", "children": { "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargeateTaskSetRevisionNumber/SecurityGroup/Resource", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateTaskSetRevisionNumber/SecurityGroup/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", "aws:cdk:cloudformation:props": { - "groupDescription": "aws-sfn-tasks-ecs-fargate-integ/FargeateTaskSetRevisionNumber/SecurityGroup", + "groupDescription": "aws-sfn-tasks-ecs-fargate-run-task/FargateTaskSetRevisionNumber/SecurityGroup", "securityGroupEgress": [ { "cidrIp": "0.0.0.0/0", @@ -1044,37 +1044,37 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSecurityGroup", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.SecurityGroup", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_stepfunctions_tasks.EcsRunTask", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, - "FargeateTaskWithPropagatedTag": { - "id": "FargeateTaskWithPropagatedTag", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargeateTaskWithPropagatedTag", + "FargateTaskWithPropagatedTag": { + "id": "FargateTaskWithPropagatedTag", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateTaskWithPropagatedTag", "children": { "SecurityGroup": { "id": "SecurityGroup", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargeateTaskWithPropagatedTag/SecurityGroup", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateTaskWithPropagatedTag/SecurityGroup", "children": { "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-fargate-integ/FargeateTaskWithPropagatedTag/SecurityGroup/Resource", + "path": "aws-sfn-tasks-ecs-fargate-run-task/FargateTaskWithPropagatedTag/SecurityGroup/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", "aws:cdk:cloudformation:props": { - "groupDescription": "aws-sfn-tasks-ecs-fargate-integ/FargeateTaskWithPropagatedTag/SecurityGroup", + "groupDescription": "aws-sfn-tasks-ecs-fargate-run-task/FargateTaskWithPropagatedTag/SecurityGroup", "securityGroupEgress": [ { "cidrIp": "0.0.0.0/0", @@ -1088,41 +1088,41 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSecurityGroup", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.SecurityGroup", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_stepfunctions_tasks.EcsRunTask", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "StateMachine": { "id": "StateMachine", - "path": "aws-sfn-tasks-ecs-fargate-integ/StateMachine", + "path": "aws-sfn-tasks-ecs-fargate-run-task/StateMachine", "children": { "Role": { "id": "Role", - "path": "aws-sfn-tasks-ecs-fargate-integ/StateMachine/Role", + "path": "aws-sfn-tasks-ecs-fargate-run-task/StateMachine/Role", "children": { "ImportRole": { "id": "ImportRole", - "path": "aws-sfn-tasks-ecs-fargate-integ/StateMachine/Role/ImportRole", + "path": "aws-sfn-tasks-ecs-fargate-run-task/StateMachine/Role/ImportRole", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-fargate-integ/StateMachine/Role/Resource", + "path": "aws-sfn-tasks-ecs-fargate-run-task/StateMachine/Role/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1141,17 +1141,17 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-sfn-tasks-ecs-fargate-integ/StateMachine/Role/DefaultPolicy", + "path": "aws-sfn-tasks-ecs-fargate-run-task/StateMachine/Role/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-fargate-integ/StateMachine/Role/DefaultPolicy/Resource", + "path": "aws-sfn-tasks-ecs-fargate-run-task/StateMachine/Role/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -1160,117 +1160,231 @@ { "Action": "ecs:RunTask", "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - ":", - { - "Ref": "TaskDef54694570" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 2, - { - "Fn::Split": [ - ":", - { - "Ref": "TaskDef54694570" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Ref": "TaskDef54694570" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Ref": "TaskDef54694570" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "/", - { - "Fn::Select": [ - 5, - { - "Fn::Split": [ - ":", - { - "Ref": "TaskDef54694570" - } - ] - } - ] - } - ] - } - ] - }, - "/", - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "/", - { - "Fn::Select": [ - 5, - { - "Fn::Split": [ - ":", - { - "Ref": "TaskDef54694570" - } - ] - } - ] - } - ] - } - ] - } + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + } + ] + } + ] + }, + "/", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + } + ] + } + ] + }, + ":*" + ] ] - ] - } + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + } + ] + } + ] + }, + "/", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "TaskDef54694570" + } + ] + } + ] + } + ] + } + ] + } + ] + ] + } + ] }, { "Action": [ @@ -1338,39 +1452,33 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-sfn-tasks-ecs-fargate-integ/StateMachine/Resource", + "path": "aws-sfn-tasks-ecs-fargate-run-task/StateMachine/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::StepFunctions::StateMachine", "aws:cdk:cloudformation:props": { - "roleArn": { - "Fn::GetAtt": [ - "StateMachineRoleB840431D", - "Arn" - ] - }, "definitionString": { "Fn::Join": [ "", [ - "{\"StartAt\":\"Start\",\"States\":{\"Start\":{\"Type\":\"Pass\",\"Result\":{\"SomeKey\":\"SomeValue\",\"Timeout\":900},\"Next\":\"FargateTask\"},\"FargateTask\":{\"Next\":\"FargeateTaskSetRevisionNumber\",\"Type\":\"Task\",\"TimeoutSecondsPath\":\"$.Timeout\",\"Resource\":\"arn:", + "{\"StartAt\":\"Start\",\"States\":{\"Start\":{\"Type\":\"Pass\",\"Result\":{\"SomeKey\":\"SomeValue\",\"Timeout\":900},\"Next\":\"FargateTask\"},\"FargateTask\":{\"Next\":\"FargateTaskSetRevisionNumber\",\"Type\":\"Task\",\"TimeoutSecondsPath\":\"$.Timeout\",\"Resource\":\"arn:", { "Ref": "AWS::Partition" }, @@ -1381,7 +1489,7 @@ "Arn" ] }, - "\",\"TaskDefinition\":\"awssfntasksecsfargateintegTaskDefD0F4AD10\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"AssignPublicIp\":\"ENABLED\",\"Subnets\":[\"", + "\",\"TaskDefinition\":\"awssfntasksecsfargateruntaskTaskDef0E89D5AE\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"AssignPublicIp\":\"ENABLED\",\"Subnets\":[\"", { "Ref": "FargateClusterVpcPublicSubnet1SubnetB9C24BC7" }, @@ -1396,7 +1504,7 @@ "GroupId" ] }, - "\"]}},\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"TheContainer\",\"Environment\":[{\"Name\":\"SOME_KEY\",\"Value.$\":\"$.SomeKey\"}]}]},\"LaunchType\":\"FARGATE\",\"PlatformVersion\":\"1.4.0\"}},\"FargeateTaskSetRevisionNumber\":{\"Next\":\"FargeateTaskWithPropagatedTag\",\"Type\":\"Task\",\"Resource\":\"arn:", + "\"]}},\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"TheContainer\",\"Environment\":[{\"Name\":\"SOME_KEY\",\"Value.$\":\"$.SomeKey\"}]}]},\"LaunchType\":\"FARGATE\",\"PlatformVersion\":\"1.4.0\"}},\"FargateTaskSetRevisionNumber\":{\"Next\":\"FargateTaskWithPropagatedTag\",\"Type\":\"Task\",\"Resource\":\"arn:", { "Ref": "AWS::Partition" }, @@ -1407,7 +1515,7 @@ "Arn" ] }, - "\",\"TaskDefinition\":\"awssfntasksecsfargateintegTaskDefD0F4AD10:1\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"Subnets\":[\"", + "\",\"TaskDefinition\":\"awssfntasksecsfargateruntaskTaskDef0E89D5AE:1\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"Subnets\":[\"", { "Ref": "FargateClusterVpcPrivateSubnet1Subnet9127625F" }, @@ -1418,11 +1526,11 @@ "\"],\"SecurityGroups\":[\"", { "Fn::GetAtt": [ - "FargeateTaskSetRevisionNumberSecurityGroup916C9B0B", + "FargateTaskSetRevisionNumberSecurityGroupDF805F2C", "GroupId" ] }, - "\"]}},\"LaunchType\":\"FARGATE\",\"PlatformVersion\":\"1.4.0\"}},\"FargeateTaskWithPropagatedTag\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + "\"]}},\"LaunchType\":\"FARGATE\",\"PlatformVersion\":\"1.4.0\"}},\"FargateTaskWithPropagatedTag\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", { "Ref": "AWS::Partition" }, @@ -1433,7 +1541,7 @@ "Arn" ] }, - "\",\"TaskDefinition\":\"awssfntasksecsfargateintegTaskDefD0F4AD10\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"Subnets\":[\"", + "\",\"TaskDefinition\":\"awssfntasksecsfargateruntaskTaskDef0E89D5AE\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"Subnets\":[\"", { "Ref": "FargateClusterVpcPrivateSubnet1Subnet9127625F" }, @@ -1444,54 +1552,114 @@ "\"],\"SecurityGroups\":[\"", { "Fn::GetAtt": [ - "FargeateTaskWithPropagatedTagSecurityGroup94A6AE70", + "FargateTaskWithPropagatedTagSecurityGroupE2B5DD29", "GroupId" ] }, "\"]}},\"PropagateTags\":\"TASK_DEFINITION\",\"LaunchType\":\"FARGATE\",\"PlatformVersion\":\"1.4.0\"}}}}" ] ] + }, + "roleArn": { + "Fn::GetAtt": [ + "StateMachineRoleB840431D", + "Arn" + ] } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_stepfunctions.CfnStateMachine", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_stepfunctions.StateMachine", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "stateMachineArn": { "id": "stateMachineArn", - "path": "aws-sfn-tasks-ecs-fargate-integ/stateMachineArn", + "path": "aws-sfn-tasks-ecs-fargate-run-task/stateMachineArn", "constructInfo": { - "fqn": "aws-cdk-lib.CfnOutput", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "BootstrapVersion": { "id": "BootstrapVersion", - "path": "aws-sfn-tasks-ecs-fargate-integ/BootstrapVersion", + "path": "aws-sfn-tasks-ecs-fargate-run-task/BootstrapVersion", "constructInfo": { - "fqn": "aws-cdk-lib.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "aws-sfn-tasks-ecs-fargate-integ/CheckBootstrapVersion", + "path": "aws-sfn-tasks-ecs-fargate-run-task/CheckBootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "SfnTasksEcsFargateRunTaskTest": { + "id": "SfnTasksEcsFargateRunTaskTest", + "path": "SfnTasksEcsFargateRunTaskTest", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "SfnTasksEcsFargateRunTaskTest/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "SfnTasksEcsFargateRunTaskTest/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "SfnTasksEcsFargateRunTaskTest/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "SfnTasksEcsFargateRunTaskTest/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "SfnTasksEcsFargateRunTaskTest/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, "constructInfo": { - "fqn": "aws-cdk-lib.CfnRule", + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.Stack", + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", "version": "0.0.0" } }, @@ -1500,13 +1668,13 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.270" + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.App", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.ts index ad756ae070c73..3dad45d7604a3 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.ts @@ -4,6 +4,7 @@ import * as sfn from 'aws-cdk-lib/aws-stepfunctions'; import * as cdk from 'aws-cdk-lib'; import * as tasks from 'aws-cdk-lib/aws-stepfunctions-tasks'; import { EC2_RESTRICT_DEFAULT_SECURITY_GROUP } from 'aws-cdk-lib/cx-api'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; /* * Creates a state machine with a task state to run a job with ECS on Fargate @@ -16,7 +17,7 @@ import { EC2_RESTRICT_DEFAULT_SECURITY_GROUP } from 'aws-cdk-lib/cx-api'; * -- aws stepfunctions describe-execution --execution-arn returns a status of `Succeeded` */ const app = new cdk.App(); -const stack = new cdk.Stack(app, 'aws-sfn-tasks-ecs-fargate-integ'); +const stack = new cdk.Stack(app, 'aws-sfn-tasks-ecs-fargate-run-task'); stack.node.setContext(EC2_RESTRICT_DEFAULT_SECURITY_GROUP, false); const cluster = new ecs.Cluster(stack, 'FargateCluster'); @@ -58,7 +59,7 @@ const definition = new sfn.Pass(stack, 'Start', { taskTimeout: sfn.Timeout.at('$.Timeout'), }), ).next( - new tasks.EcsRunTask(stack, 'FargeateTaskSetRevisionNumber', { + new tasks.EcsRunTask(stack, 'FargateTaskSetRevisionNumber', { cluster, taskDefinition, revisionNumber: 1, @@ -67,7 +68,7 @@ const definition = new sfn.Pass(stack, 'Start', { }), }), ).next( - new tasks.EcsRunTask(stack, 'FargeateTaskWithPropagatedTag', { + new tasks.EcsRunTask(stack, 'FargateTaskWithPropagatedTag', { cluster, taskDefinition, launchTarget: new tasks.EcsFargateLaunchTarget({ @@ -85,4 +86,8 @@ new cdk.CfnOutput(stack, 'stateMachineArn', { value: sm.stateMachineArn, }); +new IntegTest(app, 'SfnTasksEcsFargateRunTaskTest', { + testCases: [stack], +}); + app.synth(); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/SfnTasksEcsFargateTaskTestDefaultTestDeployAssert83C8E074.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/SfnTasksEcsFargateTaskTestDefaultTestDeployAssert83C8E074.assets.json new file mode 100644 index 0000000000000..af300895c5ae7 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/SfnTasksEcsFargateTaskTestDefaultTestDeployAssert83C8E074.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "SfnTasksEcsFargateTaskTestDefaultTestDeployAssert83C8E074.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/SfnTasksEcsFargateTaskTestDefaultTestDeployAssert83C8E074.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/SfnTasksEcsFargateTaskTestDefaultTestDeployAssert83C8E074.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/SfnTasksEcsFargateTaskTestDefaultTestDeployAssert83C8E074.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2/Dockerfile b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2/Dockerfile deleted file mode 100644 index 235b30e9661ed..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM public.ecr.aws/lambda/python:3.6 -EXPOSE 8000 -WORKDIR /src -ADD . /src -CMD python3 index.py diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534/Dockerfile b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534/Dockerfile new file mode 100644 index 0000000000000..23cf9b3e22f5d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534/Dockerfile @@ -0,0 +1,3 @@ +FROM public.ecr.aws/docker/library/python:3.12 +ADD index.py . +CMD [ "python3", "./index.py" ] diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2/index.py b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534/index.py similarity index 82% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2/index.py rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534/index.py index c4cab119afc2d..730f1be5ad06e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2/index.py +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534/index.py @@ -1,4 +1,3 @@ -#!/usr/bin/python import os import pprint diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/aws-sfn-tasks-ecs-ec2-integ.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/aws-sfn-tasks-ecs-fargate-task.assets.json similarity index 60% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/aws-sfn-tasks-ecs-ec2-integ.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/aws-sfn-tasks-ecs-fargate-task.assets.json index 715b1481a702b..88af590cfe869 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.js.snapshot/aws-sfn-tasks-ecs-ec2-integ.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/aws-sfn-tasks-ecs-fargate-task.assets.json @@ -1,29 +1,29 @@ { - "version": "32.0.0", + "version": "36.0.0", "files": { - "094d02f805367413b48e15531f0003d2531c3c5e3bf3f1f0d6da61227cecae4a": { + "be703494f5dbef249f3751ce57d5a765ea3478088d3f6de0f264f5465d6a69ae": { "source": { - "path": "aws-sfn-tasks-ecs-ec2-integ.template.json", + "path": "aws-sfn-tasks-ecs-fargate-task.template.json", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "094d02f805367413b48e15531f0003d2531c3c5e3bf3f1f0d6da61227cecae4a.json", + "objectKey": "be703494f5dbef249f3751ce57d5a765ea3478088d3f6de0f264f5465d6a69ae.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } } }, "dockerImages": { - "7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2": { + "d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534": { "source": { - "directory": "asset.7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2" + "directory": "asset.d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534" }, "destinations": { "current_account-current_region": { "repositoryName": "cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}", - "imageTag": "7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2", + "imageTag": "d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-image-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/aws-ecs-integ2.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/aws-sfn-tasks-ecs-fargate-task.template.json similarity index 91% rename from packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/aws-ecs-integ2.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/aws-sfn-tasks-ecs-fargate-task.template.json index 9838fec8fbd13..19211ab7a8f03 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/aws-ecs-integ2.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/aws-sfn-tasks-ecs-fargate-task.template.json @@ -13,7 +13,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/Vpc" + "Value": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc" } ] } @@ -21,9 +21,6 @@ "FargateClusterVpcPublicSubnet1SubnetB9C24BC7": { "Type": "AWS::EC2::Subnet", "Properties": { - "VpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "AvailabilityZone": { "Fn::Select": [ 0, @@ -45,23 +42,26 @@ }, { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1" + "Value": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet1" } - ] + ], + "VpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "FargateClusterVpcPublicSubnet1RouteTable1D7FA747": { "Type": "AWS::EC2::RouteTable", "Properties": { - "VpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1" + "Value": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet1" } - ] + ], + "VpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "FargateClusterVpcPublicSubnet1RouteTableAssociation80F1442F": { @@ -78,12 +78,12 @@ "FargateClusterVpcPublicSubnet1DefaultRoute80086690": { "Type": "AWS::EC2::Route", "Properties": { - "RouteTableId": { - "Ref": "FargateClusterVpcPublicSubnet1RouteTable1D7FA747" - }, "DestinationCidrBlock": "0.0.0.0/0", "GatewayId": { "Ref": "FargateClusterVpcIGW827638CB" + }, + "RouteTableId": { + "Ref": "FargateClusterVpcPublicSubnet1RouteTable1D7FA747" } }, "DependsOn": [ @@ -97,7 +97,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1" + "Value": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet1" } ] } @@ -105,19 +105,19 @@ "FargateClusterVpcPublicSubnet1NATGateway5202D86A": { "Type": "AWS::EC2::NatGateway", "Properties": { - "SubnetId": { - "Ref": "FargateClusterVpcPublicSubnet1SubnetB9C24BC7" - }, "AllocationId": { "Fn::GetAtt": [ "FargateClusterVpcPublicSubnet1EIPF91909D0", "AllocationId" ] }, + "SubnetId": { + "Ref": "FargateClusterVpcPublicSubnet1SubnetB9C24BC7" + }, "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1" + "Value": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet1" } ] }, @@ -129,9 +129,6 @@ "FargateClusterVpcPublicSubnet2Subnet24C0F9D8": { "Type": "AWS::EC2::Subnet", "Properties": { - "VpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "AvailabilityZone": { "Fn::Select": [ 1, @@ -153,23 +150,26 @@ }, { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2" + "Value": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet2" } - ] + ], + "VpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "FargateClusterVpcPublicSubnet2RouteTable1493C5D6": { "Type": "AWS::EC2::RouteTable", "Properties": { - "VpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2" + "Value": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet2" } - ] + ], + "VpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "FargateClusterVpcPublicSubnet2RouteTableAssociation3EFA74DC": { @@ -186,12 +186,12 @@ "FargateClusterVpcPublicSubnet2DefaultRoute8E847CD2": { "Type": "AWS::EC2::Route", "Properties": { - "RouteTableId": { - "Ref": "FargateClusterVpcPublicSubnet2RouteTable1493C5D6" - }, "DestinationCidrBlock": "0.0.0.0/0", "GatewayId": { "Ref": "FargateClusterVpcIGW827638CB" + }, + "RouteTableId": { + "Ref": "FargateClusterVpcPublicSubnet2RouteTable1493C5D6" } }, "DependsOn": [ @@ -205,7 +205,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2" + "Value": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet2" } ] } @@ -213,19 +213,19 @@ "FargateClusterVpcPublicSubnet2NATGatewayFFEC8ED2": { "Type": "AWS::EC2::NatGateway", "Properties": { - "SubnetId": { - "Ref": "FargateClusterVpcPublicSubnet2Subnet24C0F9D8" - }, "AllocationId": { "Fn::GetAtt": [ "FargateClusterVpcPublicSubnet2EIPBBB24774", "AllocationId" ] }, + "SubnetId": { + "Ref": "FargateClusterVpcPublicSubnet2Subnet24C0F9D8" + }, "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2" + "Value": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet2" } ] }, @@ -237,9 +237,6 @@ "FargateClusterVpcPrivateSubnet1Subnet9127625F": { "Type": "AWS::EC2::Subnet", "Properties": { - "VpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "AvailabilityZone": { "Fn::Select": [ 0, @@ -261,23 +258,26 @@ }, { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet1" + "Value": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PrivateSubnet1" } - ] + ], + "VpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "FargateClusterVpcPrivateSubnet1RouteTable21B3CEAE": { "Type": "AWS::EC2::RouteTable", "Properties": { - "VpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet1" + "Value": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PrivateSubnet1" } - ] + ], + "VpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "FargateClusterVpcPrivateSubnet1RouteTableAssociation78F6E213": { @@ -294,21 +294,18 @@ "FargateClusterVpcPrivateSubnet1DefaultRoute0438DCBA": { "Type": "AWS::EC2::Route", "Properties": { - "RouteTableId": { - "Ref": "FargateClusterVpcPrivateSubnet1RouteTable21B3CEAE" - }, "DestinationCidrBlock": "0.0.0.0/0", "NatGatewayId": { "Ref": "FargateClusterVpcPublicSubnet1NATGateway5202D86A" + }, + "RouteTableId": { + "Ref": "FargateClusterVpcPrivateSubnet1RouteTable21B3CEAE" } } }, "FargateClusterVpcPrivateSubnet2Subnet307CEE57": { "Type": "AWS::EC2::Subnet", "Properties": { - "VpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "AvailabilityZone": { "Fn::Select": [ 1, @@ -330,23 +327,26 @@ }, { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet2" + "Value": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PrivateSubnet2" } - ] + ], + "VpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "FargateClusterVpcPrivateSubnet2RouteTable7B7F9678": { "Type": "AWS::EC2::RouteTable", "Properties": { - "VpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet2" + "Value": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PrivateSubnet2" } - ] + ], + "VpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "FargateClusterVpcPrivateSubnet2RouteTableAssociation3A46964C": { @@ -363,12 +363,12 @@ "FargateClusterVpcPrivateSubnet2DefaultRoute35FDD29D": { "Type": "AWS::EC2::Route", "Properties": { - "RouteTableId": { - "Ref": "FargateClusterVpcPrivateSubnet2RouteTable7B7F9678" - }, "DestinationCidrBlock": "0.0.0.0/0", "NatGatewayId": { "Ref": "FargateClusterVpcPublicSubnet2NATGatewayFFEC8ED2" + }, + "RouteTableId": { + "Ref": "FargateClusterVpcPrivateSubnet2RouteTable7B7F9678" } } }, @@ -378,7 +378,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ2/FargateCluster/Vpc" + "Value": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc" } ] } @@ -386,11 +386,11 @@ "FargateClusterVpcVPCGW38717255": { "Type": "AWS::EC2::VPCGatewayAttachment", "Properties": { - "VpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "InternetGatewayId": { "Ref": "FargateClusterVpcIGW827638CB" + }, + "VpcId": { + "Ref": "FargateClusterVpc377E8024" } } }, @@ -418,7 +418,7 @@ { "Essential": true, "Image": { - "Fn::Sub": "${AWS::AccountId}.dkr.ecr.${AWS::Region}.${AWS::URLSuffix}/cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}:7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2" + "Fn::Sub": "${AWS::AccountId}.dkr.ecr.${AWS::Region}.${AWS::URLSuffix}/cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}:d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534" }, "LogConfiguration": { "LogDriver": "awslogs", @@ -443,7 +443,7 @@ "Arn" ] }, - "Family": "awsecsinteg2TaskDef1F38909D", + "Family": "awssfntasksecsfargatetaskTaskDefBB13BD5B", "Memory": "512", "NetworkMode": "awsvpc", "RequiresCompatibilities": [ @@ -547,7 +547,7 @@ "FargateTaskSecurityGroup0BBB27CB": { "Type": "AWS::EC2::SecurityGroup", "Properties": { - "GroupDescription": "aws-ecs-integ2/FargateTask/SecurityGroup", + "GroupDescription": "aws-sfn-tasks-ecs-fargate-task/FargateTask/SecurityGroup", "SecurityGroupEgress": [ { "CidrIp": "0.0.0.0/0", @@ -657,12 +657,6 @@ "StateMachine2E01A3A5": { "Type": "AWS::StepFunctions::StateMachine", "Properties": { - "RoleArn": { - "Fn::GetAtt": [ - "StateMachineRoleB840431D", - "Arn" - ] - }, "DefinitionString": { "Fn::Join": [ "", @@ -700,6 +694,12 @@ ":states:::ecs:runTask.sync\"}}}" ] ] + }, + "RoleArn": { + "Fn::GetAtt": [ + "StateMachineRoleB840431D", + "Arn" + ] } }, "DependsOn": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/cdk.out index ae4b03c54e770..1f0068d32659a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"30.0.0"} \ No newline at end of file +{"version":"36.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/integ.json index aa363769950ad..9d90adc46610a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/integ.json @@ -1,14 +1,12 @@ { - "version": "30.0.0", + "version": "36.0.0", "testCases": { - "integ.fargate-task": { + "SfnTasksEcsFargateTaskTest/DefaultTest": { "stacks": [ - "aws-ecs-integ2" + "aws-sfn-tasks-ecs-fargate-task" ], - "diffAssets": false, - "stackUpdateWorkflow": true + "assertionStack": "SfnTasksEcsFargateTaskTest/DefaultTest/DeployAssert", + "assertionStackName": "SfnTasksEcsFargateTaskTestDefaultTestDeployAssert83C8E074" } - }, - "synthContext": {}, - "enableLookups": false + } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/manifest.json index 19d1cfcb8584d..bbed229bd8f9e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/manifest.json @@ -1,27 +1,28 @@ { - "version": "30.0.0", + "version": "36.0.0", "artifacts": { - "aws-ecs-integ2.assets": { + "aws-sfn-tasks-ecs-fargate-task.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "aws-ecs-integ2.assets.json", + "file": "aws-sfn-tasks-ecs-fargate-task.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "aws-ecs-integ2": { + "aws-sfn-tasks-ecs-fargate-task": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "aws-ecs-integ2.template.json", + "templateFile": "aws-sfn-tasks-ecs-fargate-task.template.json", + "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/49b9ca0d3fa9d22154be9a9852e1b152c1d5c634726748270dfa1952b69f1ed6.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/be703494f5dbef249f3751ce57d5a765ea3478088d3f6de0f264f5465d6a69ae.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "aws-ecs-integ2.assets" + "aws-sfn-tasks-ecs-fargate-task.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", @@ -30,221 +31,269 @@ } }, "dependencies": [ - "aws-ecs-integ2.assets" + "aws-sfn-tasks-ecs-fargate-task.assets" ], "metadata": { - "/aws-ecs-integ2/FargateCluster/Resource": [ + "/aws-sfn-tasks-ecs-fargate-task/FargateCluster/Resource": [ { "type": "aws:cdk:logicalId", "data": "FargateCluster7CCD5F93" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/Resource": [ + "/aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/Resource": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpc377E8024" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1/Subnet": [ + "/aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet1/Subnet": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet1SubnetB9C24BC7" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1/RouteTable": [ + "/aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet1/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet1RouteTable1D7FA747" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1/RouteTableAssociation": [ + "/aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet1/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet1RouteTableAssociation80F1442F" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1/DefaultRoute": [ + "/aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet1/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet1DefaultRoute80086690" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1/EIP": [ + "/aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet1/EIP": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet1EIPF91909D0" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1/NATGateway": [ + "/aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet1/NATGateway": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet1NATGateway5202D86A" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2/Subnet": [ + "/aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet2/Subnet": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet2Subnet24C0F9D8" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2/RouteTable": [ + "/aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet2/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet2RouteTable1493C5D6" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2/RouteTableAssociation": [ + "/aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet2/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet2RouteTableAssociation3EFA74DC" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2/DefaultRoute": [ + "/aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet2/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet2DefaultRoute8E847CD2" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2/EIP": [ + "/aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet2/EIP": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet2EIPBBB24774" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2/NATGateway": [ + "/aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet2/NATGateway": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPublicSubnet2NATGatewayFFEC8ED2" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet1/Subnet": [ + "/aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PrivateSubnet1/Subnet": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPrivateSubnet1Subnet9127625F" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet1/RouteTable": [ + "/aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PrivateSubnet1/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPrivateSubnet1RouteTable21B3CEAE" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet1/RouteTableAssociation": [ + "/aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PrivateSubnet1/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPrivateSubnet1RouteTableAssociation78F6E213" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet1/DefaultRoute": [ + "/aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PrivateSubnet1/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPrivateSubnet1DefaultRoute0438DCBA" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet2/Subnet": [ + "/aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PrivateSubnet2/Subnet": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPrivateSubnet2Subnet307CEE57" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet2/RouteTable": [ + "/aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PrivateSubnet2/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPrivateSubnet2RouteTable7B7F9678" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet2/RouteTableAssociation": [ + "/aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PrivateSubnet2/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPrivateSubnet2RouteTableAssociation3A46964C" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet2/DefaultRoute": [ + "/aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PrivateSubnet2/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcPrivateSubnet2DefaultRoute35FDD29D" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/IGW": [ + "/aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/IGW": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcIGW827638CB" } ], - "/aws-ecs-integ2/FargateCluster/Vpc/VPCGW": [ + "/aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/VPCGW": [ { "type": "aws:cdk:logicalId", "data": "FargateClusterVpcVPCGW38717255" } ], - "/aws-ecs-integ2/TaskDef/TaskRole/Resource": [ + "/aws-sfn-tasks-ecs-fargate-task/TaskDef/TaskRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "TaskDefTaskRole1EDB4A67" } ], - "/aws-ecs-integ2/TaskDef/Resource": [ + "/aws-sfn-tasks-ecs-fargate-task/TaskDef/Resource": [ { "type": "aws:cdk:logicalId", "data": "TaskDef54694570" } ], - "/aws-ecs-integ2/TaskDef/TheContainer/LogGroup/Resource": [ + "/aws-sfn-tasks-ecs-fargate-task/TaskDef/TheContainer/LogGroup/Resource": [ { "type": "aws:cdk:logicalId", "data": "TaskDefTheContainerLogGroupD94C8EF5" } ], - "/aws-ecs-integ2/TaskDef/ExecutionRole/Resource": [ + "/aws-sfn-tasks-ecs-fargate-task/TaskDef/ExecutionRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "TaskDefExecutionRoleB4775C97" } ], - "/aws-ecs-integ2/TaskDef/ExecutionRole/DefaultPolicy/Resource": [ + "/aws-sfn-tasks-ecs-fargate-task/TaskDef/ExecutionRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "TaskDefExecutionRoleDefaultPolicy0DBB737A" } ], - "/aws-ecs-integ2/FargateTask/SecurityGroup/Resource": [ + "/aws-sfn-tasks-ecs-fargate-task/FargateTask/SecurityGroup/Resource": [ { "type": "aws:cdk:logicalId", "data": "FargateTaskSecurityGroup0BBB27CB" } ], - "/aws-ecs-integ2/StateMachine/Role/Resource": [ + "/aws-sfn-tasks-ecs-fargate-task/StateMachine/Role/Resource": [ { "type": "aws:cdk:logicalId", "data": "StateMachineRoleB840431D" } ], - "/aws-ecs-integ2/StateMachine/Role/DefaultPolicy/Resource": [ + "/aws-sfn-tasks-ecs-fargate-task/StateMachine/Role/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "StateMachineRoleDefaultPolicyDF1E6607" } ], - "/aws-ecs-integ2/StateMachine/Resource": [ + "/aws-sfn-tasks-ecs-fargate-task/StateMachine/Resource": [ { "type": "aws:cdk:logicalId", "data": "StateMachine2E01A3A5" } ], - "/aws-ecs-integ2/BootstrapVersion": [ + "/aws-sfn-tasks-ecs-fargate-task/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/aws-ecs-integ2/CheckBootstrapVersion": [ + "/aws-sfn-tasks-ecs-fargate-task/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } ] }, - "displayName": "aws-ecs-integ2" + "displayName": "aws-sfn-tasks-ecs-fargate-task" + }, + "SfnTasksEcsFargateTaskTestDefaultTestDeployAssert83C8E074.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "SfnTasksEcsFargateTaskTestDefaultTestDeployAssert83C8E074.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "SfnTasksEcsFargateTaskTestDefaultTestDeployAssert83C8E074": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "SfnTasksEcsFargateTaskTestDefaultTestDeployAssert83C8E074.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "SfnTasksEcsFargateTaskTestDefaultTestDeployAssert83C8E074.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "SfnTasksEcsFargateTaskTestDefaultTestDeployAssert83C8E074.assets" + ], + "metadata": { + "/SfnTasksEcsFargateTaskTest/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/SfnTasksEcsFargateTaskTest/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "SfnTasksEcsFargateTaskTest/DefaultTest/DeployAssert" }, "Tree": { "type": "cdk:tree", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/tree.json index 78b114670600b..241afb706f5bf 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.js.snapshot/tree.json @@ -4,33 +4,33 @@ "id": "App", "path": "", "children": { - "aws-ecs-integ2": { - "id": "aws-ecs-integ2", - "path": "aws-ecs-integ2", + "aws-sfn-tasks-ecs-fargate-task": { + "id": "aws-sfn-tasks-ecs-fargate-task", + "path": "aws-sfn-tasks-ecs-fargate-task", "children": { "FargateCluster": { "id": "FargateCluster", - "path": "aws-ecs-integ2/FargateCluster", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster", "children": { "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/FargateCluster/Resource", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::ECS::Cluster", "aws:cdk:cloudformation:props": {} }, "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.CfnCluster", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Vpc": { "id": "Vpc", - "path": "aws-ecs-integ2/FargateCluster/Vpc", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc", "children": { "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/FargateCluster/Vpc/Resource", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::VPC", "aws:cdk:cloudformation:props": { @@ -41,29 +41,26 @@ "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/Vpc" + "value": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc" } ] } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnVPC", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "PublicSubnet1": { "id": "PublicSubnet1", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet1", "children": { "Subnet": { "id": "Subnet", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1/Subnet", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet1/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "availabilityZone": { "Fn::Select": [ 0, @@ -85,49 +82,52 @@ }, { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1" + "value": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet1" } - ] + ], + "vpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Acl": { "id": "Acl", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1/Acl", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet1/Acl", "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTable": { "id": "RouteTable", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1/RouteTable", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet1/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1" + "value": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet1" } - ] + ], + "vpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1/RouteTableAssociation", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet1/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -140,33 +140,33 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultRoute": { "id": "DefaultRoute", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1/DefaultRoute", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet1/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "FargateClusterVpcPublicSubnet1RouteTable1D7FA747" - }, "destinationCidrBlock": "0.0.0.0/0", "gatewayId": { "Ref": "FargateClusterVpcIGW827638CB" + }, + "routeTableId": { + "Ref": "FargateClusterVpcPublicSubnet1RouteTable1D7FA747" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "EIP": { "id": "EIP", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1/EIP", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet1/EIP", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::EIP", "aws:cdk:cloudformation:props": { @@ -174,63 +174,60 @@ "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1" + "value": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet1" } ] } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnEIP", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "NATGateway": { "id": "NATGateway", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1/NATGateway", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet1/NATGateway", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", "aws:cdk:cloudformation:props": { - "subnetId": { - "Ref": "FargateClusterVpcPublicSubnet1SubnetB9C24BC7" - }, "allocationId": { "Fn::GetAtt": [ "FargateClusterVpcPublicSubnet1EIPF91909D0", "AllocationId" ] }, + "subnetId": { + "Ref": "FargateClusterVpcPublicSubnet1SubnetB9C24BC7" + }, "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet1" + "value": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet1" } ] } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnNatGateway", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PublicSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "PublicSubnet2": { "id": "PublicSubnet2", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet2", "children": { "Subnet": { "id": "Subnet", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2/Subnet", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet2/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "availabilityZone": { "Fn::Select": [ 1, @@ -252,49 +249,52 @@ }, { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2" + "value": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet2" } - ] + ], + "vpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Acl": { "id": "Acl", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2/Acl", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet2/Acl", "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTable": { "id": "RouteTable", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2/RouteTable", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet2/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2" + "value": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet2" } - ] + ], + "vpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2/RouteTableAssociation", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet2/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -307,33 +307,33 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultRoute": { "id": "DefaultRoute", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2/DefaultRoute", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet2/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "FargateClusterVpcPublicSubnet2RouteTable1493C5D6" - }, "destinationCidrBlock": "0.0.0.0/0", "gatewayId": { "Ref": "FargateClusterVpcIGW827638CB" + }, + "routeTableId": { + "Ref": "FargateClusterVpcPublicSubnet2RouteTable1493C5D6" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "EIP": { "id": "EIP", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2/EIP", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet2/EIP", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::EIP", "aws:cdk:cloudformation:props": { @@ -341,63 +341,60 @@ "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2" + "value": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet2" } ] } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnEIP", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "NATGateway": { "id": "NATGateway", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2/NATGateway", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet2/NATGateway", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", "aws:cdk:cloudformation:props": { - "subnetId": { - "Ref": "FargateClusterVpcPublicSubnet2Subnet24C0F9D8" - }, "allocationId": { "Fn::GetAtt": [ "FargateClusterVpcPublicSubnet2EIPBBB24774", "AllocationId" ] }, + "subnetId": { + "Ref": "FargateClusterVpcPublicSubnet2Subnet24C0F9D8" + }, "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/Vpc/PublicSubnet2" + "value": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PublicSubnet2" } ] } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnNatGateway", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PublicSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "PrivateSubnet1": { "id": "PrivateSubnet1", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet1", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PrivateSubnet1", "children": { "Subnet": { "id": "Subnet", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet1/Subnet", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PrivateSubnet1/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "availabilityZone": { "Fn::Select": [ 0, @@ -419,49 +416,52 @@ }, { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet1" + "value": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PrivateSubnet1" } - ] + ], + "vpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Acl": { "id": "Acl", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet1/Acl", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PrivateSubnet1/Acl", "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTable": { "id": "RouteTable", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet1/RouteTable", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PrivateSubnet1/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet1" + "value": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PrivateSubnet1" } - ] + ], + "vpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet1/RouteTableAssociation", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PrivateSubnet1/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -474,49 +474,46 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultRoute": { "id": "DefaultRoute", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet1/DefaultRoute", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PrivateSubnet1/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "FargateClusterVpcPrivateSubnet1RouteTable21B3CEAE" - }, "destinationCidrBlock": "0.0.0.0/0", "natGatewayId": { "Ref": "FargateClusterVpcPublicSubnet1NATGateway5202D86A" + }, + "routeTableId": { + "Ref": "FargateClusterVpcPrivateSubnet1RouteTable21B3CEAE" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "PrivateSubnet2": { "id": "PrivateSubnet2", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet2", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PrivateSubnet2", "children": { "Subnet": { "id": "Subnet", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet2/Subnet", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PrivateSubnet2/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "availabilityZone": { "Fn::Select": [ 1, @@ -538,49 +535,52 @@ }, { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet2" + "value": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PrivateSubnet2" } - ] + ], + "vpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Acl": { "id": "Acl", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet2/Acl", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PrivateSubnet2/Acl", "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTable": { "id": "RouteTable", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet2/RouteTable", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PrivateSubnet2/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet2" + "value": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PrivateSubnet2" } - ] + ], + "vpcId": { + "Ref": "FargateClusterVpc377E8024" + } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet2/RouteTableAssociation", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PrivateSubnet2/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -593,105 +593,105 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultRoute": { "id": "DefaultRoute", - "path": "aws-ecs-integ2/FargateCluster/Vpc/PrivateSubnet2/DefaultRoute", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/PrivateSubnet2/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "FargateClusterVpcPrivateSubnet2RouteTable7B7F9678" - }, "destinationCidrBlock": "0.0.0.0/0", "natGatewayId": { "Ref": "FargateClusterVpcPublicSubnet2NATGatewayFFEC8ED2" + }, + "routeTableId": { + "Ref": "FargateClusterVpcPrivateSubnet2RouteTable7B7F9678" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "IGW": { "id": "IGW", - "path": "aws-ecs-integ2/FargateCluster/Vpc/IGW", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/IGW", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", "aws:cdk:cloudformation:props": { "tags": [ { "key": "Name", - "value": "aws-ecs-integ2/FargateCluster/Vpc" + "value": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc" } ] } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnInternetGateway", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "VPCGW": { "id": "VPCGW", - "path": "aws-ecs-integ2/FargateCluster/Vpc/VPCGW", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateCluster/Vpc/VPCGW", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "FargateClusterVpc377E8024" - }, "internetGatewayId": { "Ref": "FargateClusterVpcIGW827638CB" + }, + "vpcId": { + "Ref": "FargateClusterVpc377E8024" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnVPCGatewayAttachment", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.Vpc", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.Cluster", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "TaskDef": { "id": "TaskDef", - "path": "aws-ecs-integ2/TaskDef", + "path": "aws-sfn-tasks-ecs-fargate-task/TaskDef", "children": { "TaskRole": { "id": "TaskRole", - "path": "aws-ecs-integ2/TaskDef/TaskRole", + "path": "aws-sfn-tasks-ecs-fargate-task/TaskDef/TaskRole", "children": { "ImportTaskRole": { "id": "ImportTaskRole", - "path": "aws-ecs-integ2/TaskDef/TaskRole/ImportTaskRole", + "path": "aws-sfn-tasks-ecs-fargate-task/TaskDef/TaskRole/ImportTaskRole", "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/TaskDef/TaskRole/Resource", + "path": "aws-sfn-tasks-ecs-fargate-task/TaskDef/TaskRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -710,19 +710,19 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/TaskDef/Resource", + "path": "aws-sfn-tasks-ecs-fargate-task/TaskDef/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::ECS::TaskDefinition", "aws:cdk:cloudformation:props": { @@ -730,7 +730,7 @@ { "essential": true, "image": { - "Fn::Sub": "${AWS::AccountId}.dkr.ecr.${AWS::Region}.${AWS::URLSuffix}/cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}:7a4895bc694ae074467753dddb9a798e58f2f5eda62bcce5833d7d356b8a1da2" + "Fn::Sub": "${AWS::AccountId}.dkr.ecr.${AWS::Region}.${AWS::URLSuffix}/cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}:d87af9b5acc567118fa529d3d3b763098200a6446a5ca64aea987729efd52534" }, "memory": 256, "name": "TheContainer", @@ -755,7 +755,7 @@ "Arn" ] }, - "family": "awsecsinteg2TaskDef1F38909D", + "family": "awssfntasksecsfargatetaskTaskDefBB13BD5B", "memory": "512", "networkMode": "awsvpc", "requiresCompatibilities": [ @@ -770,83 +770,83 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.CfnTaskDefinition", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "TheContainer": { "id": "TheContainer", - "path": "aws-ecs-integ2/TaskDef/TheContainer", + "path": "aws-sfn-tasks-ecs-fargate-task/TaskDef/TheContainer", "children": { "AssetImage": { "id": "AssetImage", - "path": "aws-ecs-integ2/TaskDef/TheContainer/AssetImage", + "path": "aws-sfn-tasks-ecs-fargate-task/TaskDef/TheContainer/AssetImage", "children": { "Staging": { "id": "Staging", - "path": "aws-ecs-integ2/TaskDef/TheContainer/AssetImage/Staging", + "path": "aws-sfn-tasks-ecs-fargate-task/TaskDef/TheContainer/AssetImage/Staging", "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Repository": { "id": "Repository", - "path": "aws-ecs-integ2/TaskDef/TheContainer/AssetImage/Repository", + "path": "aws-sfn-tasks-ecs-fargate-task/TaskDef/TheContainer/AssetImage/Repository", "constructInfo": { - "fqn": "@aws-cdk/aws-ecr.RepositoryBase", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ecr-assets.DockerImageAsset", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "LogGroup": { "id": "LogGroup", - "path": "aws-ecs-integ2/TaskDef/TheContainer/LogGroup", + "path": "aws-sfn-tasks-ecs-fargate-task/TaskDef/TheContainer/LogGroup", "children": { "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/TaskDef/TheContainer/LogGroup/Resource", + "path": "aws-sfn-tasks-ecs-fargate-task/TaskDef/TheContainer/LogGroup/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", "aws:cdk:cloudformation:props": {} }, "constructInfo": { - "fqn": "@aws-cdk/aws-logs.CfnLogGroup", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-logs.LogGroup", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.ContainerDefinition", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "ExecutionRole": { "id": "ExecutionRole", - "path": "aws-ecs-integ2/TaskDef/ExecutionRole", + "path": "aws-sfn-tasks-ecs-fargate-task/TaskDef/ExecutionRole", "children": { "ImportExecutionRole": { "id": "ImportExecutionRole", - "path": "aws-ecs-integ2/TaskDef/ExecutionRole/ImportExecutionRole", + "path": "aws-sfn-tasks-ecs-fargate-task/TaskDef/ExecutionRole/ImportExecutionRole", "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/TaskDef/ExecutionRole/Resource", + "path": "aws-sfn-tasks-ecs-fargate-task/TaskDef/ExecutionRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -865,17 +865,17 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-ecs-integ2/TaskDef/ExecutionRole/DefaultPolicy", + "path": "aws-sfn-tasks-ecs-fargate-task/TaskDef/ExecutionRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/TaskDef/ExecutionRole/DefaultPolicy/Resource", + "path": "aws-sfn-tasks-ecs-fargate-task/TaskDef/ExecutionRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -942,51 +942,51 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ecs.FargateTaskDefinition", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Start": { "id": "Start", - "path": "aws-ecs-integ2/Start", + "path": "aws-sfn-tasks-ecs-fargate-task/Start", "constructInfo": { - "fqn": "@aws-cdk/aws-stepfunctions.Pass", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "FargateTask": { "id": "FargateTask", - "path": "aws-ecs-integ2/FargateTask", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateTask", "children": { "SecurityGroup": { "id": "SecurityGroup", - "path": "aws-ecs-integ2/FargateTask/SecurityGroup", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateTask/SecurityGroup", "children": { "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/FargateTask/SecurityGroup/Resource", + "path": "aws-sfn-tasks-ecs-fargate-task/FargateTask/SecurityGroup/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", "aws:cdk:cloudformation:props": { - "groupDescription": "aws-ecs-integ2/FargateTask/SecurityGroup", + "groupDescription": "aws-sfn-tasks-ecs-fargate-task/FargateTask/SecurityGroup", "securityGroupEgress": [ { "cidrIp": "0.0.0.0/0", @@ -1000,41 +1000,41 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroup", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.SecurityGroup", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-stepfunctions.Task", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "StateMachine": { "id": "StateMachine", - "path": "aws-ecs-integ2/StateMachine", + "path": "aws-sfn-tasks-ecs-fargate-task/StateMachine", "children": { "Role": { "id": "Role", - "path": "aws-ecs-integ2/StateMachine/Role", + "path": "aws-sfn-tasks-ecs-fargate-task/StateMachine/Role", "children": { "ImportRole": { "id": "ImportRole", - "path": "aws-ecs-integ2/StateMachine/Role/ImportRole", + "path": "aws-sfn-tasks-ecs-fargate-task/StateMachine/Role/ImportRole", "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/StateMachine/Role/Resource", + "path": "aws-sfn-tasks-ecs-fargate-task/StateMachine/Role/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1053,17 +1053,17 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-ecs-integ2/StateMachine/Role/DefaultPolicy", + "path": "aws-sfn-tasks-ecs-fargate-task/StateMachine/Role/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/StateMachine/Role/DefaultPolicy/Resource", + "path": "aws-sfn-tasks-ecs-fargate-task/StateMachine/Role/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -1142,34 +1142,28 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "aws-ecs-integ2/StateMachine/Resource", + "path": "aws-sfn-tasks-ecs-fargate-task/StateMachine/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::StepFunctions::StateMachine", "aws:cdk:cloudformation:props": { - "roleArn": { - "Fn::GetAtt": [ - "StateMachineRoleB840431D", - "Arn" - ] - }, "definitionString": { "Fn::Join": [ "", @@ -1207,39 +1201,99 @@ ":states:::ecs:runTask.sync\"}}}" ] ] + }, + "roleArn": { + "Fn::GetAtt": [ + "StateMachineRoleB840431D", + "Arn" + ] } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-stepfunctions.CfnStateMachine", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-stepfunctions.StateMachine", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "BootstrapVersion": { "id": "BootstrapVersion", - "path": "aws-ecs-integ2/BootstrapVersion", + "path": "aws-sfn-tasks-ecs-fargate-task/BootstrapVersion", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "aws-ecs-integ2/CheckBootstrapVersion", + "path": "aws-sfn-tasks-ecs-fargate-task/CheckBootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "SfnTasksEcsFargateTaskTest": { + "id": "SfnTasksEcsFargateTaskTest", + "path": "SfnTasksEcsFargateTaskTest", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "SfnTasksEcsFargateTaskTest/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "SfnTasksEcsFargateTaskTest/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "SfnTasksEcsFargateTaskTest/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "SfnTasksEcsFargateTaskTest/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "SfnTasksEcsFargateTaskTest/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, "constructInfo": { - "fqn": "@aws-cdk/core.CfnRule", + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Stack", + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", "version": "0.0.0" } }, @@ -1248,13 +1302,13 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.237" + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.App", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.ts index 8b6198479a2ce..b239dd39909cb 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.fargate-task.ts @@ -4,9 +4,20 @@ import * as sfn from 'aws-cdk-lib/aws-stepfunctions'; import * as cdk from 'aws-cdk-lib'; import * as tasks from 'aws-cdk-lib/aws-stepfunctions-tasks'; import { EC2_RESTRICT_DEFAULT_SECURITY_GROUP } from 'aws-cdk-lib/cx-api'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; +/* + * * Creates a state machine with a task state to run a job with ECS on EC2 + * + * Stack verification steps: + * The generated State Machine can be executed from the CLI (or Step Functions console) + * and runs with an execution status of `Succeeded`. + * + * -- aws stepfunctions start-execution --state-machine-arn provides execution arn + * -- aws stepfunctions describe-execution --execution-arn returns a status of `Succeeded` + */ const app = new cdk.App(); -const stack = new cdk.Stack(app, 'aws-ecs-integ2'); +const stack = new cdk.Stack(app, 'aws-sfn-tasks-ecs-fargate-task'); stack.node.setContext(EC2_RESTRICT_DEFAULT_SECURITY_GROUP, false); const cluster = new ecs.Cluster(stack, 'FargateCluster'); @@ -51,4 +62,8 @@ new sfn.StateMachine(stack, 'StateMachine', { definition, }); +new IntegTest(app, 'SfnTasksEcsFargateTaskTest', { + testCases: [stack], +}); + app.synth(); diff --git a/packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/ecs/run-task.ts b/packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/ecs/run-task.ts index 62a7ad06be2ba..303468707ea54 100644 --- a/packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/ecs/run-task.ts +++ b/packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/ecs/run-task.ts @@ -337,10 +337,14 @@ export class EcsRunTask extends sfn.TaskStateBase implements ec2.IConnectable { const stack = cdk.Stack.of(this); // https://docs.aws.amazon.com/step-functions/latest/dg/ecs-iam.html + const taskDefinitionFamilyArn = this.getTaskDefinitionFamilyArn(); const policyStatements = [ new iam.PolicyStatement({ actions: ['ecs:RunTask'], - resources: [this.getTaskDefinitionFamilyArn()], + resources: [ + taskDefinitionFamilyArn, + `${taskDefinitionFamilyArn}:*`, + ], }), new iam.PolicyStatement({ actions: ['ecs:StopTask', 'ecs:DescribeTasks'], diff --git a/packages/aws-cdk-lib/aws-stepfunctions-tasks/test/ecs/eventhandler-image/Dockerfile b/packages/aws-cdk-lib/aws-stepfunctions-tasks/test/ecs/eventhandler-image/Dockerfile index 235b30e9661ed..23cf9b3e22f5d 100644 --- a/packages/aws-cdk-lib/aws-stepfunctions-tasks/test/ecs/eventhandler-image/Dockerfile +++ b/packages/aws-cdk-lib/aws-stepfunctions-tasks/test/ecs/eventhandler-image/Dockerfile @@ -1,5 +1,3 @@ -FROM public.ecr.aws/lambda/python:3.6 -EXPOSE 8000 -WORKDIR /src -ADD . /src -CMD python3 index.py +FROM public.ecr.aws/docker/library/python:3.12 +ADD index.py . +CMD [ "python3", "./index.py" ] diff --git a/packages/aws-cdk-lib/aws-stepfunctions-tasks/test/ecs/run-tasks.test.ts b/packages/aws-cdk-lib/aws-stepfunctions-tasks/test/ecs/run-tasks.test.ts index b9598f4a4aacb..928e7486eb02f 100644 --- a/packages/aws-cdk-lib/aws-stepfunctions-tasks/test/ecs/run-tasks.test.ts +++ b/packages/aws-cdk-lib/aws-stepfunctions-tasks/test/ecs/run-tasks.test.ts @@ -289,7 +289,7 @@ test('Running a Fargate Task', () => { { Action: 'ecs:RunTask', Effect: 'Allow', - Resource: { + Resource: [{ 'Fn::Join': [ '', [ @@ -308,6 +308,26 @@ test('Running a Fargate Task', () => { ], ], }, + { + 'Fn::Join': [ + '', + [ + 'arn:', + { 'Fn::Select': [1, { 'Fn::Split': [':', { 'Ref': 'TD49C78F36' }] }] }, + ':', + { 'Fn::Select': [2, { 'Fn::Split': [':', { 'Ref': 'TD49C78F36' }] }] }, + ':', + { 'Fn::Select': [3, { 'Fn::Split': [':', { 'Ref': 'TD49C78F36' }] }] }, + ':', + { 'Fn::Select': [4, { 'Fn::Split': [':', { 'Ref': 'TD49C78F36' }] }] }, + ':', + { 'Fn::Select': [0, { 'Fn::Split': ['/', { 'Fn::Select': [5, { 'Fn::Split': [':', { 'Ref': 'TD49C78F36' }] }] }] }] }, + '/', + { 'Fn::Select': [1, { 'Fn::Split': ['/', { 'Fn::Select': [5, { 'Fn::Split': [':', { 'Ref': 'TD49C78F36' }] }] }] }] }, + ':*', + ], + ], + }], }, { Action: ['ecs:StopTask', 'ecs:DescribeTasks'], @@ -411,7 +431,7 @@ test('Running an EC2 Task with bridge network', () => { { Action: 'ecs:RunTask', Effect: 'Allow', - Resource: { + Resource: [{ 'Fn::Join': [ '', [ @@ -430,6 +450,26 @@ test('Running an EC2 Task with bridge network', () => { ], ], }, + { + 'Fn::Join': [ + '', + [ + 'arn:', + { 'Fn::Select': [1, { 'Fn::Split': [':', { 'Ref': 'TD49C78F36' }] }] }, + ':', + { 'Fn::Select': [2, { 'Fn::Split': [':', { 'Ref': 'TD49C78F36' }] }] }, + ':', + { 'Fn::Select': [3, { 'Fn::Split': [':', { 'Ref': 'TD49C78F36' }] }] }, + ':', + { 'Fn::Select': [4, { 'Fn::Split': [':', { 'Ref': 'TD49C78F36' }] }] }, + ':', + { 'Fn::Select': [0, { 'Fn::Split': ['/', { 'Fn::Select': [5, { 'Fn::Split': [':', { 'Ref': 'TD49C78F36' }] }] }] }] }, + '/', + { 'Fn::Select': [1, { 'Fn::Split': ['/', { 'Fn::Select': [5, { 'Fn::Split': [':', { 'Ref': 'TD49C78F36' }] }] }] }] }, + ':*', + ], + ], + }], }, { Action: ['ecs:StopTask', 'ecs:DescribeTasks'], From 2503f6855b6b0dad73c6fafc51f81f66354e2822 Mon Sep 17 00:00:00 2001 From: KIDANI Akito Date: Tue, 13 Feb 2024 04:41:30 +0900 Subject: [PATCH 2/4] fix(lambda): @deprecated tag to deprecated runtimes (#29081) ### Issue # (if applicable) Closes #. ### Reason for this change Updated according to [this document](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy). ### Description of changes ### Description of how you validated changes ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/aws-cdk-lib/aws-lambda/lib/runtime.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/aws-cdk-lib/aws-lambda/lib/runtime.ts b/packages/aws-cdk-lib/aws-lambda/lib/runtime.ts index 69dd0283bc1f8..1c05e74ec7957 100644 --- a/packages/aws-cdk-lib/aws-lambda/lib/runtime.ts +++ b/packages/aws-cdk-lib/aws-lambda/lib/runtime.ts @@ -135,6 +135,7 @@ export class Runtime { /** * The Python 3.7 runtime (python3.7) + * @deprecated Legacy runtime no longer supported by AWS Lambda. Migrate to the latest Python runtime. */ public static readonly PYTHON_3_7 = new Runtime('python3.7', RuntimeFamily.PYTHON, { supportsInlineCode: true, @@ -183,6 +184,7 @@ export class Runtime { /** * The Java 8 runtime (java8) + * @deprecated Legacy runtime no longer supported by AWS Lambda. Migrate to the latest Java runtime. */ public static readonly JAVA_8 = new Runtime('java8', RuntimeFamily.JAVA, { supportsCodeGuruProfiling: true, @@ -262,6 +264,7 @@ export class Runtime { /** * The Ruby 2.7 runtime (ruby2.7) + * @deprecated Legacy runtime no longer supported by AWS Lambda. Migrate to the latest Ruby runtime. */ public static readonly RUBY_2_7 = new Runtime('ruby2.7', RuntimeFamily.RUBY); From e890e89e9fbe46c9f93ef2a16c26bd9a06694ca6 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Mon, 12 Feb 2024 18:07:29 -0500 Subject: [PATCH 3/4] feat(codedeploy): ignoreAlarmConfiguration parameter to Deployment Groups (#26957) The alarms on a CodeDeploy group are configurable to be enabled or disabled through the SDK or UI. Bringing in that functionality to the CDK to have parity. The parameter name mirrors the "Ignore alarm configuration" checkbox in the alarm configuration section of the UI. Motivation: Developers are able to disable _rollback_ on alarm, but this leaves deployments in a stopped state should any alarms be active. Including this configuration will align with the expectation that alarms will not block a deployment in lower environments via a flag rather than logic to include/exclude alarms on the deployment group based on environment. I'm sure there are other use cases for disabling the alarm configuration on a deployment group. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- ...efaultTestDeployAssert60AABFA0.assets.json | 2 +- .../aws-cdk-codedeploy-ecs-dg.assets.json | 6 +- .../aws-cdk-codedeploy-ecs-dg.template.json | 158 ++--- .../cdk.out | 2 +- .../integ.json | 2 +- .../manifest.json | 4 +- .../tree.json | 538 +++++++++--------- .../test/ecs/integ.deployment-group.ts | 1 + packages/aws-cdk-lib/aws-codedeploy/README.md | 3 + .../lib/ecs/deployment-group.ts | 14 +- .../lib/lambda/deployment-group.ts | 14 +- .../aws-codedeploy/lib/private/utils.ts | 46 +- .../lib/server/deployment-group.ts | 14 +- .../test/ecs/deployment-group.test.ts | 60 ++ .../test/lambda/deployment-group.test.ts | 52 ++ .../test/server/deployment-group.test.ts | 49 ++ 16 files changed, 597 insertions(+), 368 deletions(-) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/EcsDeploymentGroupTestDefaultTestDeployAssert60AABFA0.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/EcsDeploymentGroupTestDefaultTestDeployAssert60AABFA0.assets.json index 450725bf2e337..a12cfbdbba5ba 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/EcsDeploymentGroupTestDefaultTestDeployAssert60AABFA0.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/EcsDeploymentGroupTestDefaultTestDeployAssert60AABFA0.assets.json @@ -1,5 +1,5 @@ { - "version": "32.0.0", + "version": "34.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/aws-cdk-codedeploy-ecs-dg.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/aws-cdk-codedeploy-ecs-dg.assets.json index a0b1b02ba7950..3cf5ed0926e98 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/aws-cdk-codedeploy-ecs-dg.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/aws-cdk-codedeploy-ecs-dg.assets.json @@ -1,7 +1,7 @@ { - "version": "32.0.0", + "version": "34.0.0", "files": { - "54ea34edd18b9383781f88fd1ab5487b7d2a4ca076f0a365fa77e3b3a4b109d9": { + "710f6bc445077db08ceffaf64861f978b37344d19f910739818890c51a58f0d9": { "source": { "path": "aws-cdk-codedeploy-ecs-dg.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "54ea34edd18b9383781f88fd1ab5487b7d2a4ca076f0a365fa77e3b3a4b109d9.json", + "objectKey": "710f6bc445077db08ceffaf64861f978b37344d19f910739818890c51a58f0d9.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/aws-cdk-codedeploy-ecs-dg.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/aws-cdk-codedeploy-ecs-dg.template.json index 64f48e53ec831..59fc30d6fffd1 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/aws-cdk-codedeploy-ecs-dg.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/aws-cdk-codedeploy-ecs-dg.template.json @@ -18,9 +18,6 @@ "VPCPublicSubnet1SubnetB4246D30": { "Type": "AWS::EC2::Subnet", "Properties": { - "VpcId": { - "Ref": "VPCB9E5F0B4" - }, "AvailabilityZone": { "Fn::Select": [ 0, @@ -44,21 +41,24 @@ "Key": "Name", "Value": "aws-cdk-codedeploy-ecs-dg/VPC/PublicSubnet1" } - ] + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } } }, "VPCPublicSubnet1RouteTableFEE4B781": { "Type": "AWS::EC2::RouteTable", "Properties": { - "VpcId": { - "Ref": "VPCB9E5F0B4" - }, "Tags": [ { "Key": "Name", "Value": "aws-cdk-codedeploy-ecs-dg/VPC/PublicSubnet1" } - ] + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } } }, "VPCPublicSubnet1RouteTableAssociation0B0896DC": { @@ -75,12 +75,12 @@ "VPCPublicSubnet1DefaultRoute91CEF279": { "Type": "AWS::EC2::Route", "Properties": { - "RouteTableId": { - "Ref": "VPCPublicSubnet1RouteTableFEE4B781" - }, "DestinationCidrBlock": "0.0.0.0/0", "GatewayId": { "Ref": "VPCIGWB7E252D3" + }, + "RouteTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" } }, "DependsOn": [ @@ -102,15 +102,15 @@ "VPCPublicSubnet1NATGatewayE0556630": { "Type": "AWS::EC2::NatGateway", "Properties": { - "SubnetId": { - "Ref": "VPCPublicSubnet1SubnetB4246D30" - }, "AllocationId": { "Fn::GetAtt": [ "VPCPublicSubnet1EIP6AD938E8", "AllocationId" ] }, + "SubnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, "Tags": [ { "Key": "Name", @@ -126,9 +126,6 @@ "VPCPublicSubnet2Subnet74179F39": { "Type": "AWS::EC2::Subnet", "Properties": { - "VpcId": { - "Ref": "VPCB9E5F0B4" - }, "AvailabilityZone": { "Fn::Select": [ 1, @@ -152,21 +149,24 @@ "Key": "Name", "Value": "aws-cdk-codedeploy-ecs-dg/VPC/PublicSubnet2" } - ] + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } } }, "VPCPublicSubnet2RouteTable6F1A15F1": { "Type": "AWS::EC2::RouteTable", "Properties": { - "VpcId": { - "Ref": "VPCB9E5F0B4" - }, "Tags": [ { "Key": "Name", "Value": "aws-cdk-codedeploy-ecs-dg/VPC/PublicSubnet2" } - ] + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } } }, "VPCPublicSubnet2RouteTableAssociation5A808732": { @@ -183,12 +183,12 @@ "VPCPublicSubnet2DefaultRouteB7481BBA": { "Type": "AWS::EC2::Route", "Properties": { - "RouteTableId": { - "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" - }, "DestinationCidrBlock": "0.0.0.0/0", "GatewayId": { "Ref": "VPCIGWB7E252D3" + }, + "RouteTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" } }, "DependsOn": [ @@ -210,15 +210,15 @@ "VPCPublicSubnet2NATGateway3C070193": { "Type": "AWS::EC2::NatGateway", "Properties": { - "SubnetId": { - "Ref": "VPCPublicSubnet2Subnet74179F39" - }, "AllocationId": { "Fn::GetAtt": [ "VPCPublicSubnet2EIP4947BC00", "AllocationId" ] }, + "SubnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + }, "Tags": [ { "Key": "Name", @@ -234,9 +234,6 @@ "VPCPrivateSubnet1Subnet8BCA10E0": { "Type": "AWS::EC2::Subnet", "Properties": { - "VpcId": { - "Ref": "VPCB9E5F0B4" - }, "AvailabilityZone": { "Fn::Select": [ 0, @@ -260,21 +257,24 @@ "Key": "Name", "Value": "aws-cdk-codedeploy-ecs-dg/VPC/PrivateSubnet1" } - ] + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } } }, "VPCPrivateSubnet1RouteTableBE8A6027": { "Type": "AWS::EC2::RouteTable", "Properties": { - "VpcId": { - "Ref": "VPCB9E5F0B4" - }, "Tags": [ { "Key": "Name", "Value": "aws-cdk-codedeploy-ecs-dg/VPC/PrivateSubnet1" } - ] + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } } }, "VPCPrivateSubnet1RouteTableAssociation347902D1": { @@ -291,21 +291,18 @@ "VPCPrivateSubnet1DefaultRouteAE1D6490": { "Type": "AWS::EC2::Route", "Properties": { - "RouteTableId": { - "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" - }, "DestinationCidrBlock": "0.0.0.0/0", "NatGatewayId": { "Ref": "VPCPublicSubnet1NATGatewayE0556630" + }, + "RouteTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" } } }, "VPCPrivateSubnet2SubnetCFCDAA7A": { "Type": "AWS::EC2::Subnet", "Properties": { - "VpcId": { - "Ref": "VPCB9E5F0B4" - }, "AvailabilityZone": { "Fn::Select": [ 1, @@ -329,21 +326,24 @@ "Key": "Name", "Value": "aws-cdk-codedeploy-ecs-dg/VPC/PrivateSubnet2" } - ] + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } } }, "VPCPrivateSubnet2RouteTable0A19E10E": { "Type": "AWS::EC2::RouteTable", "Properties": { - "VpcId": { - "Ref": "VPCB9E5F0B4" - }, "Tags": [ { "Key": "Name", "Value": "aws-cdk-codedeploy-ecs-dg/VPC/PrivateSubnet2" } - ] + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } } }, "VPCPrivateSubnet2RouteTableAssociation0C73D413": { @@ -360,12 +360,12 @@ "VPCPrivateSubnet2DefaultRouteF4F5CFD2": { "Type": "AWS::EC2::Route", "Properties": { - "RouteTableId": { - "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" - }, "DestinationCidrBlock": "0.0.0.0/0", "NatGatewayId": { "Ref": "VPCPublicSubnet2NATGateway3C070193" + }, + "RouteTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" } } }, @@ -383,11 +383,11 @@ "VPCVPCGW99B986DC": { "Type": "AWS::EC2::VPCGatewayAttachment", "Properties": { - "VpcId": { - "Ref": "VPCB9E5F0B4" - }, "InternetGatewayId": { "Ref": "VPCIGWB7E252D3" + }, + "VpcId": { + "Ref": "VPCB9E5F0B4" } } }, @@ -528,7 +528,6 @@ "FargateServiceSecurityGroupfromawscdkcodedeployecsdgServiceLBSecurityGroupEC967688803C3B1119": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { - "IpProtocol": "tcp", "Description": "Load balancer to target", "FromPort": 80, "GroupId": { @@ -537,6 +536,7 @@ "GroupId" ] }, + "IpProtocol": "tcp", "SourceSecurityGroupId": { "Fn::GetAtt": [ "ServiceLBSecurityGroup2EA7EDA1", @@ -659,13 +659,6 @@ "ServiceLBSecurityGrouptoawscdkcodedeployecsdgFargateServiceSecurityGroup64C2B62E8071D2502F": { "Type": "AWS::EC2::SecurityGroupEgress", "Properties": { - "GroupId": { - "Fn::GetAtt": [ - "ServiceLBSecurityGroup2EA7EDA1", - "GroupId" - ] - }, - "IpProtocol": "tcp", "Description": "Load balancer to target", "DestinationSecurityGroupId": { "Fn::GetAtt": [ @@ -674,6 +667,13 @@ ] }, "FromPort": 80, + "GroupId": { + "Fn::GetAtt": [ + "ServiceLBSecurityGroup2EA7EDA1", + "GroupId" + ] + }, + "IpProtocol": "tcp", "ToPort": 80 } }, @@ -781,9 +781,8 @@ "BlueUnhealthyHosts48919A97": { "Type": "AWS::CloudWatch::Alarm", "Properties": { - "ComparisonOperator": "GreaterThanOrEqualToThreshold", - "EvaluationPeriods": 2, "AlarmName": "aws-cdk-codedeploy-ecs-dg-Unhealthy-Hosts-Blue", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", "Dimensions": [ { "Name": "LoadBalancer", @@ -846,6 +845,7 @@ } } ], + "EvaluationPeriods": 2, "MetricName": "UnHealthyHostCount", "Namespace": "AWS/ApplicationELB", "Period": 300, @@ -856,9 +856,8 @@ "Blue5xx7E9798A6": { "Type": "AWS::CloudWatch::Alarm", "Properties": { - "ComparisonOperator": "GreaterThanOrEqualToThreshold", - "EvaluationPeriods": 1, "AlarmName": "aws-cdk-codedeploy-ecs-dg-Http-500-Blue", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", "Dimensions": [ { "Name": "LoadBalancer", @@ -921,6 +920,7 @@ } } ], + "EvaluationPeriods": 1, "MetricName": "HTTPCode_Target_5XX_Count", "Namespace": "AWS/ApplicationELB", "Period": 60, @@ -931,9 +931,8 @@ "GreenUnhealthyHosts8D9D09C1": { "Type": "AWS::CloudWatch::Alarm", "Properties": { - "ComparisonOperator": "GreaterThanOrEqualToThreshold", - "EvaluationPeriods": 2, "AlarmName": "aws-cdk-codedeploy-ecs-dg-Unhealthy-Hosts-Green", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", "Dimensions": [ { "Name": "LoadBalancer", @@ -996,6 +995,7 @@ } } ], + "EvaluationPeriods": 2, "MetricName": "UnHealthyHostCount", "Namespace": "AWS/ApplicationELB", "Period": 300, @@ -1006,9 +1006,8 @@ "Green5xx1A511A06": { "Type": "AWS::CloudWatch::Alarm", "Properties": { - "ComparisonOperator": "GreaterThanOrEqualToThreshold", - "EvaluationPeriods": 1, "AlarmName": "aws-cdk-codedeploy-ecs-dg-Http-500-Green", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", "Dimensions": [ { "Name": "LoadBalancer", @@ -1071,6 +1070,7 @@ } } ], + "EvaluationPeriods": 1, "MetricName": "HTTPCode_Target_5XX_Count", "Namespace": "AWS/ApplicationELB", "Period": 60, @@ -1137,15 +1137,6 @@ "BlueGreenDG373AB9B0": { "Type": "AWS::CodeDeploy::DeploymentGroup", "Properties": { - "ApplicationName": { - "Ref": "BlueGreenDGApplication3649479D" - }, - "ServiceRoleArn": { - "Fn::GetAtt": [ - "BlueGreenDGServiceRole33E3BCAC", - "Arn" - ] - }, "AlarmConfiguration": { "Alarms": [ { @@ -1169,7 +1160,10 @@ } } ], - "Enabled": true + "Enabled": false + }, + "ApplicationName": { + "Ref": "BlueGreenDGApplication3649479D" }, "AutoRollbackConfiguration": { "Enabled": true, @@ -1246,6 +1240,12 @@ } } ] + }, + "ServiceRoleArn": { + "Fn::GetAtt": [ + "BlueGreenDGServiceRole33E3BCAC", + "Arn" + ] } }, "DependsOn": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/cdk.out index f0b901e7c06e5..2313ab5436501 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"32.0.0"} \ No newline at end of file +{"version":"34.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/integ.json index d10ac3bae19ec..543faf986acd9 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "32.0.0", + "version": "34.0.0", "testCases": { "EcsDeploymentGroupTest/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/manifest.json index 2ac61ce54d5a8..7bdb333ff5afc 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "32.0.0", + "version": "34.0.0", "artifacts": { "aws-cdk-codedeploy-ecs-dg.assets": { "type": "cdk:asset-manifest", @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/54ea34edd18b9383781f88fd1ab5487b7d2a4ca076f0a365fa77e3b3a4b109d9.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/710f6bc445077db08ceffaf64861f978b37344d19f910739818890c51a58f0d9.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/tree.json index b5cdc1e7eed0e..8f35257767a2c 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.js.snapshot/tree.json @@ -31,8 +31,8 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.CfnVPC", + "version": "0.0.0" } }, "PublicSubnet1": { @@ -45,9 +45,6 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "VPCB9E5F0B4" - }, "availabilityZone": { "Fn::Select": [ 0, @@ -71,20 +68,23 @@ "key": "Name", "value": "aws-cdk-codedeploy-ecs-dg/VPC/PublicSubnet1" } - ] + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" } }, "Acl": { "id": "Acl", "path": "aws-cdk-codedeploy-ecs-dg/VPC/PublicSubnet1/Acl", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" } }, "RouteTable": { @@ -93,20 +93,20 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "VPCB9E5F0B4" - }, "tags": [ { "key": "Name", "value": "aws-cdk-codedeploy-ecs-dg/VPC/PublicSubnet1" } - ] + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" } }, "RouteTableAssociation": { @@ -124,8 +124,8 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" } }, "DefaultRoute": { @@ -134,18 +134,18 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "VPCPublicSubnet1RouteTableFEE4B781" - }, "destinationCidrBlock": "0.0.0.0/0", "gatewayId": { "Ref": "VPCIGWB7E252D3" + }, + "routeTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" } }, "EIP": { @@ -164,8 +164,8 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", + "version": "0.0.0" } }, "NATGateway": { @@ -174,15 +174,15 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", "aws:cdk:cloudformation:props": { - "subnetId": { - "Ref": "VPCPublicSubnet1SubnetB4246D30" - }, "allocationId": { "Fn::GetAtt": [ "VPCPublicSubnet1EIP6AD938E8", "AllocationId" ] }, + "subnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, "tags": [ { "key": "Name", @@ -192,14 +192,14 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", + "version": "0.0.0" } }, "PublicSubnet2": { @@ -212,9 +212,6 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "VPCB9E5F0B4" - }, "availabilityZone": { "Fn::Select": [ 1, @@ -238,20 +235,23 @@ "key": "Name", "value": "aws-cdk-codedeploy-ecs-dg/VPC/PublicSubnet2" } - ] + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" } }, "Acl": { "id": "Acl", "path": "aws-cdk-codedeploy-ecs-dg/VPC/PublicSubnet2/Acl", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" } }, "RouteTable": { @@ -260,20 +260,20 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "VPCB9E5F0B4" - }, "tags": [ { "key": "Name", "value": "aws-cdk-codedeploy-ecs-dg/VPC/PublicSubnet2" } - ] + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" } }, "RouteTableAssociation": { @@ -291,8 +291,8 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" } }, "DefaultRoute": { @@ -301,18 +301,18 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" - }, "destinationCidrBlock": "0.0.0.0/0", "gatewayId": { "Ref": "VPCIGWB7E252D3" + }, + "routeTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" } }, "EIP": { @@ -331,8 +331,8 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", + "version": "0.0.0" } }, "NATGateway": { @@ -341,15 +341,15 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", "aws:cdk:cloudformation:props": { - "subnetId": { - "Ref": "VPCPublicSubnet2Subnet74179F39" - }, "allocationId": { "Fn::GetAtt": [ "VPCPublicSubnet2EIP4947BC00", "AllocationId" ] }, + "subnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + }, "tags": [ { "key": "Name", @@ -359,14 +359,14 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", + "version": "0.0.0" } }, "PrivateSubnet1": { @@ -379,9 +379,6 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "VPCB9E5F0B4" - }, "availabilityZone": { "Fn::Select": [ 0, @@ -405,20 +402,23 @@ "key": "Name", "value": "aws-cdk-codedeploy-ecs-dg/VPC/PrivateSubnet1" } - ] + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" } }, "Acl": { "id": "Acl", "path": "aws-cdk-codedeploy-ecs-dg/VPC/PrivateSubnet1/Acl", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" } }, "RouteTable": { @@ -427,20 +427,20 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "VPCB9E5F0B4" - }, "tags": [ { "key": "Name", "value": "aws-cdk-codedeploy-ecs-dg/VPC/PrivateSubnet1" } - ] + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" } }, "RouteTableAssociation": { @@ -458,8 +458,8 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" } }, "DefaultRoute": { @@ -468,24 +468,24 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" - }, "destinationCidrBlock": "0.0.0.0/0", "natGatewayId": { "Ref": "VPCPublicSubnet1NATGatewayE0556630" + }, + "routeTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", + "version": "0.0.0" } }, "PrivateSubnet2": { @@ -498,9 +498,6 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "VPCB9E5F0B4" - }, "availabilityZone": { "Fn::Select": [ 1, @@ -524,20 +521,23 @@ "key": "Name", "value": "aws-cdk-codedeploy-ecs-dg/VPC/PrivateSubnet2" } - ] + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" } }, "Acl": { "id": "Acl", "path": "aws-cdk-codedeploy-ecs-dg/VPC/PrivateSubnet2/Acl", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" } }, "RouteTable": { @@ -546,20 +546,20 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "VPCB9E5F0B4" - }, "tags": [ { "key": "Name", "value": "aws-cdk-codedeploy-ecs-dg/VPC/PrivateSubnet2" } - ] + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" } }, "RouteTableAssociation": { @@ -577,8 +577,8 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" } }, "DefaultRoute": { @@ -587,24 +587,24 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" - }, "destinationCidrBlock": "0.0.0.0/0", "natGatewayId": { "Ref": "VPCPublicSubnet2NATGateway3C070193" + }, + "routeTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", + "version": "0.0.0" } }, "IGW": { @@ -622,8 +622,8 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.CfnInternetGateway", + "version": "0.0.0" } }, "VPCGW": { @@ -632,23 +632,23 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "VPCB9E5F0B4" - }, "internetGatewayId": { "Ref": "VPCIGWB7E252D3" + }, + "vpcId": { + "Ref": "VPCB9E5F0B4" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.CfnVPCGatewayAttachment", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.Vpc", + "version": "0.0.0" } }, "EcsCluster": { @@ -663,14 +663,14 @@ "aws:cdk:cloudformation:props": {} }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ecs.CfnCluster", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ecs.Cluster", + "version": "0.0.0" } }, "TaskDef": { @@ -685,8 +685,8 @@ "id": "ImportTaskRole", "path": "aws-cdk-codedeploy-ecs-dg/TaskDef/TaskRole/ImportTaskRole", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" } }, "Resource": { @@ -710,14 +710,14 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "0.0.0" } }, "Resource": { @@ -755,22 +755,22 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ecs.CfnTaskDefinition", + "version": "0.0.0" } }, "Container": { "id": "Container", "path": "aws-cdk-codedeploy-ecs-dg/TaskDef/Container", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ecs.ContainerDefinition", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ecs.FargateTaskDefinition", + "version": "0.0.0" } }, "FargateService": { @@ -830,8 +830,8 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ecs.CfnService", + "version": "0.0.0" } }, "SecurityGroup": { @@ -858,8 +858,8 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.CfnSecurityGroup", + "version": "0.0.0" } }, "from awscdkcodedeployecsdgServiceLBSecurityGroupEC967688:80": { @@ -868,7 +868,6 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", "aws:cdk:cloudformation:props": { - "ipProtocol": "tcp", "description": "Load balancer to target", "fromPort": 80, "groupId": { @@ -877,6 +876,7 @@ "GroupId" ] }, + "ipProtocol": "tcp", "sourceSecurityGroupId": { "Fn::GetAtt": [ "ServiceLBSecurityGroup2EA7EDA1", @@ -887,20 +887,20 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.CfnSecurityGroupIngress", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.SecurityGroup", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ecs.FargateService", + "version": "0.0.0" } }, "TaskDef2": { @@ -915,8 +915,8 @@ "id": "ImportTaskRole", "path": "aws-cdk-codedeploy-ecs-dg/TaskDef2/TaskRole/ImportTaskRole", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" } }, "Resource": { @@ -940,14 +940,14 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "0.0.0" } }, "Resource": { @@ -985,22 +985,22 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ecs.CfnTaskDefinition", + "version": "0.0.0" } }, "Container": { "id": "Container", "path": "aws-cdk-codedeploy-ecs-dg/TaskDef2/Container", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ecs.ContainerDefinition", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ecs.FargateTaskDefinition", + "version": "0.0.0" } }, "ServiceLB": { @@ -1040,8 +1040,8 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_elasticloadbalancingv2.CfnLoadBalancer", + "version": "0.0.0" } }, "SecurityGroup": { @@ -1077,8 +1077,8 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.CfnSecurityGroup", + "version": "0.0.0" } }, "to awscdkcodedeployecsdgFargateServiceSecurityGroup64C2B62E:80": { @@ -1087,13 +1087,6 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupEgress", "aws:cdk:cloudformation:props": { - "groupId": { - "Fn::GetAtt": [ - "ServiceLBSecurityGroup2EA7EDA1", - "GroupId" - ] - }, - "ipProtocol": "tcp", "description": "Load balancer to target", "destinationSecurityGroupId": { "Fn::GetAtt": [ @@ -1102,18 +1095,25 @@ ] }, "fromPort": 80, + "groupId": { + "Fn::GetAtt": [ + "ServiceLBSecurityGroup2EA7EDA1", + "GroupId" + ] + }, + "ipProtocol": "tcp", "toPort": 80 } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.CfnSecurityGroupEgress", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_ec2.SecurityGroup", + "version": "0.0.0" } }, "ProdListener": { @@ -1142,8 +1142,8 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_elasticloadbalancingv2.CfnListener", + "version": "0.0.0" } }, "BlueTGGroup": { @@ -1182,20 +1182,20 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_elasticloadbalancingv2.CfnTargetGroup", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationTargetGroup", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationListener", + "version": "0.0.0" } }, "TestListener": { @@ -1224,20 +1224,20 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_elasticloadbalancingv2.CfnListener", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationListener", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationLoadBalancer", + "version": "0.0.0" } }, "GreenTG": { @@ -1276,14 +1276,14 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_elasticloadbalancingv2.CfnTargetGroup", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationTargetGroup", + "version": "0.0.0" } }, "BlueUnhealthyHosts": { @@ -1296,9 +1296,8 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", "aws:cdk:cloudformation:props": { - "comparisonOperator": "GreaterThanOrEqualToThreshold", - "evaluationPeriods": 2, "alarmName": "aws-cdk-codedeploy-ecs-dg-Unhealthy-Hosts-Blue", + "comparisonOperator": "GreaterThanOrEqualToThreshold", "dimensions": [ { "name": "LoadBalancer", @@ -1361,6 +1360,7 @@ } } ], + "evaluationPeriods": 2, "metricName": "UnHealthyHostCount", "namespace": "AWS/ApplicationELB", "period": 300, @@ -1369,14 +1369,14 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "0.0.0" } }, "Blue5xx": { @@ -1389,9 +1389,8 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", "aws:cdk:cloudformation:props": { - "comparisonOperator": "GreaterThanOrEqualToThreshold", - "evaluationPeriods": 1, "alarmName": "aws-cdk-codedeploy-ecs-dg-Http-500-Blue", + "comparisonOperator": "GreaterThanOrEqualToThreshold", "dimensions": [ { "name": "LoadBalancer", @@ -1454,6 +1453,7 @@ } } ], + "evaluationPeriods": 1, "metricName": "HTTPCode_Target_5XX_Count", "namespace": "AWS/ApplicationELB", "period": 60, @@ -1462,14 +1462,14 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "0.0.0" } }, "GreenUnhealthyHosts": { @@ -1482,9 +1482,8 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", "aws:cdk:cloudformation:props": { - "comparisonOperator": "GreaterThanOrEqualToThreshold", - "evaluationPeriods": 2, "alarmName": "aws-cdk-codedeploy-ecs-dg-Unhealthy-Hosts-Green", + "comparisonOperator": "GreaterThanOrEqualToThreshold", "dimensions": [ { "name": "LoadBalancer", @@ -1547,6 +1546,7 @@ } } ], + "evaluationPeriods": 2, "metricName": "UnHealthyHostCount", "namespace": "AWS/ApplicationELB", "period": 300, @@ -1555,14 +1555,14 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "0.0.0" } }, "Green5xx": { @@ -1575,9 +1575,8 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", "aws:cdk:cloudformation:props": { - "comparisonOperator": "GreaterThanOrEqualToThreshold", - "evaluationPeriods": 1, "alarmName": "aws-cdk-codedeploy-ecs-dg-Http-500-Green", + "comparisonOperator": "GreaterThanOrEqualToThreshold", "dimensions": [ { "name": "LoadBalancer", @@ -1640,6 +1639,7 @@ } } ], + "evaluationPeriods": 1, "metricName": "HTTPCode_Target_5XX_Count", "namespace": "AWS/ApplicationELB", "period": 60, @@ -1648,14 +1648,14 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "0.0.0" } }, "CanaryConfig": { @@ -1679,14 +1679,14 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_codedeploy.CfnDeploymentConfig", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_codedeploy.EcsDeploymentConfig", + "version": "0.0.0" } }, "BlueGreenDG": { @@ -1701,8 +1701,8 @@ "id": "ImportServiceRole", "path": "aws-cdk-codedeploy-ecs-dg/BlueGreenDG/ServiceRole/ImportServiceRole", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" } }, "Resource": { @@ -1740,14 +1740,14 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "0.0.0" } }, "Application": { @@ -1764,14 +1764,14 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_codedeploy.CfnApplication", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_codedeploy.EcsApplication", + "version": "0.0.0" } }, "Resource": { @@ -1780,15 +1780,6 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::CodeDeploy::DeploymentGroup", "aws:cdk:cloudformation:props": { - "applicationName": { - "Ref": "BlueGreenDGApplication3649479D" - }, - "serviceRoleArn": { - "Fn::GetAtt": [ - "BlueGreenDGServiceRole33E3BCAC", - "Arn" - ] - }, "alarmConfiguration": { "alarms": [ { @@ -1812,7 +1803,10 @@ } } ], - "enabled": true + "enabled": false + }, + "applicationName": { + "Ref": "BlueGreenDGApplication3649479D" }, "autoRollbackConfiguration": { "enabled": true, @@ -1889,88 +1883,94 @@ } } ] + }, + "serviceRoleArn": { + "Fn::GetAtt": [ + "BlueGreenDGServiceRole33E3BCAC", + "Arn" + ] } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_codedeploy.CfnDeploymentGroup", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.aws_codedeploy.EcsDeploymentGroup", + "version": "0.0.0" } }, "NewTaskDefinition": { "id": "NewTaskDefinition", "path": "aws-cdk-codedeploy-ecs-dg/NewTaskDefinition", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.CfnOutput", + "version": "0.0.0" } }, "Subnet1Id": { "id": "Subnet1Id", "path": "aws-cdk-codedeploy-ecs-dg/Subnet1Id", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.CfnOutput", + "version": "0.0.0" } }, "Subnet2Id": { "id": "Subnet2Id", "path": "aws-cdk-codedeploy-ecs-dg/Subnet2Id", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.CfnOutput", + "version": "0.0.0" } }, "SecurityGroupId": { "id": "SecurityGroupId", "path": "aws-cdk-codedeploy-ecs-dg/SecurityGroupId", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.CfnOutput", + "version": "0.0.0" } }, "CodeDeployApplicationName": { "id": "CodeDeployApplicationName", "path": "aws-cdk-codedeploy-ecs-dg/CodeDeployApplicationName", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.CfnOutput", + "version": "0.0.0" } }, "CodeDeployDeploymentGroupName": { "id": "CodeDeployDeploymentGroupName", "path": "aws-cdk-codedeploy-ecs-dg/CodeDeployDeploymentGroupName", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.CfnOutput", + "version": "0.0.0" } }, "BootstrapVersion": { "id": "BootstrapVersion", "path": "aws-cdk-codedeploy-ecs-dg/BootstrapVersion", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" } }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", "path": "aws-cdk-codedeploy-ecs-dg/CheckBootstrapVersion", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" } }, "EcsDeploymentGroupTest": { @@ -1986,7 +1986,7 @@ "path": "EcsDeploymentGroupTest/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.70" } }, "DeployAssert": { @@ -1997,22 +1997,22 @@ "id": "BootstrapVersion", "path": "EcsDeploymentGroupTest/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" } }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", "path": "EcsDeploymentGroupTest/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" } } }, @@ -2032,13 +2032,13 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.70" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.55" + "fqn": "aws-cdk-lib.App", + "version": "0.0.0" } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.ts index 2d93b158cd709..bef7582148d71 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/ecs/integ.deployment-group.ts @@ -222,6 +222,7 @@ const dg = new codedeploy.EcsDeploymentGroup(stack, 'BlueGreenDG', { autoRollback: { stoppedDeployment: true, }, + ignoreAlarmConfiguration: true, }); // Outputs to use for manual testing diff --git a/packages/aws-cdk-lib/aws-codedeploy/README.md b/packages/aws-cdk-lib/aws-codedeploy/README.md index 2d1f959923cff..752efc73ad526 100644 --- a/packages/aws-cdk-lib/aws-codedeploy/README.md +++ b/packages/aws-cdk-lib/aws-codedeploy/README.md @@ -90,6 +90,9 @@ const deploymentGroup = new codedeploy.ServerDeploymentGroup(this, 'CodeDeployDe // whether to ignore failure to fetch the status of alarms from CloudWatch // default: false ignorePollAlarmsFailure: false, + // whether to skip the step of checking CloudWatch alarms during the deployment process + // default: false + ignoreAlarmConfiguration: false, // auto-rollback configuration autoRollback: { failedDeployment: true, // default: true diff --git a/packages/aws-cdk-lib/aws-codedeploy/lib/ecs/deployment-group.ts b/packages/aws-cdk-lib/aws-codedeploy/lib/ecs/deployment-group.ts index 3b1f29cd525b3..9ff4b247952f4 100644 --- a/packages/aws-cdk-lib/aws-codedeploy/lib/ecs/deployment-group.ts +++ b/packages/aws-cdk-lib/aws-codedeploy/lib/ecs/deployment-group.ts @@ -178,6 +178,13 @@ export interface EcsDeploymentGroupProps { * @default - default AutoRollbackConfig. */ readonly autoRollback?: AutoRollbackConfig; + + /** + * Whether to skip the step of checking CloudWatch alarms during the deployment process + * + * @default - false + */ + readonly ignoreAlarmConfiguration?: boolean; } /** @@ -261,7 +268,12 @@ export class EcsDeploymentGroup extends DeploymentGroupBase implements IEcsDeplo }), loadBalancerInfo: cdk.Lazy.any({ produce: () => this.renderLoadBalancerInfo(props.blueGreenDeploymentConfig) }), alarmConfiguration: cdk.Lazy.any({ - produce: () => renderAlarmConfiguration(this.alarms, props.ignorePollAlarmsFailure, removeAlarmsFromDeploymentGroup), + produce: () => renderAlarmConfiguration({ + alarms: this.alarms, + ignorePollAlarmFailure: props.ignorePollAlarmsFailure, + removeAlarms: removeAlarmsFromDeploymentGroup, + ignoreAlarmConfiguration: props.ignoreAlarmConfiguration, + }), }), autoRollbackConfiguration: cdk.Lazy.any({ produce: () => renderAutoRollbackConfiguration(this.alarms, props.autoRollback) }), }); diff --git a/packages/aws-cdk-lib/aws-codedeploy/lib/lambda/deployment-group.ts b/packages/aws-cdk-lib/aws-codedeploy/lib/lambda/deployment-group.ts index 6818f643f7ad3..86f6134e62151 100644 --- a/packages/aws-cdk-lib/aws-codedeploy/lib/lambda/deployment-group.ts +++ b/packages/aws-cdk-lib/aws-codedeploy/lib/lambda/deployment-group.ts @@ -117,6 +117,13 @@ export interface LambdaDeploymentGroupProps { * @default - default AutoRollbackConfig. */ readonly autoRollback?: AutoRollbackConfig; + + /** + * Whether to skip the step of checking CloudWatch alarms during the deployment process + * + * @default - false + */ + readonly ignoreAlarmConfiguration?: boolean; } /** @@ -177,7 +184,12 @@ export class LambdaDeploymentGroup extends DeploymentGroupBase implements ILambd deploymentOption: 'WITH_TRAFFIC_CONTROL', }, alarmConfiguration: cdk.Lazy.any({ - produce: () => renderAlarmConfiguration(this.alarms, props.ignorePollAlarmsFailure, removeAlarmsFromDeploymentGroup), + produce: () => renderAlarmConfiguration({ + alarms: this.alarms, + ignorePollAlarmFailure: props.ignorePollAlarmsFailure, + removeAlarms: removeAlarmsFromDeploymentGroup, + ignoreAlarmConfiguration: props.ignoreAlarmConfiguration, + }), }), autoRollbackConfiguration: cdk.Lazy.any({ produce: () => renderAutoRollbackConfiguration(this.alarms, props.autoRollback) }), }); diff --git a/packages/aws-cdk-lib/aws-codedeploy/lib/private/utils.ts b/packages/aws-cdk-lib/aws-codedeploy/lib/private/utils.ts index f1c3f0fb844b0..0b9ae20ae3df1 100644 --- a/packages/aws-cdk-lib/aws-codedeploy/lib/private/utils.ts +++ b/packages/aws-cdk-lib/aws-codedeploy/lib/private/utils.ts @@ -31,22 +31,50 @@ export function arnForDeploymentConfig(name: string, resource?: IResource): stri }); } -export function renderAlarmConfiguration(alarms: cloudwatch.IAlarm[], ignorePollAlarmFailure: boolean | undefined, removeAlarms = true): -CfnDeploymentGroup.AlarmConfigurationProperty | undefined { +export interface renderAlarmConfigProps { + /** + * Array of Cloudwatch alarms + */ + readonly alarms: cloudwatch.IAlarm[]; + + /** + * Whether to ignore failure to fetch the status of alarms from CloudWatch + */ + readonly ignorePollAlarmFailure?: boolean; + + /** + * When no alarms are provided on an update, removes previously existing alarms from the construct. + * @see {@link https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk/cx-api/FEATURE_FLAGS.md#aws-cdkaws-codedeployremovealarmsfromdeploymentgroup} + * + * @default true + */ + readonly removeAlarms?: boolean; + + /** + * Whether to skip the step of checking CloudWatch alarms during the deployment process + * + * @default false + */ + ignoreAlarmConfiguration?: boolean; +} + +export function renderAlarmConfiguration(props: renderAlarmConfigProps): CfnDeploymentGroup.AlarmConfigurationProperty | undefined { + const ignoreAlarmConfiguration = props.ignoreAlarmConfiguration ?? false; + const removeAlarms = props.removeAlarms ?? true; if (removeAlarms) { return { - alarms: alarms.length > 0 ? alarms.map(a => ({ name: a.alarmName })) : undefined, - enabled: alarms.length > 0, - ignorePollAlarmFailure, + alarms: props.alarms.length > 0 ? props.alarms.map(a => ({ name: a.alarmName })) : undefined, + enabled: !ignoreAlarmConfiguration && props.alarms.length > 0, + ignorePollAlarmFailure: props.ignorePollAlarmFailure, }; } - return alarms.length === 0 + return props.alarms.length === 0 ? undefined : { - alarms: alarms.map(a => ({ name: a.alarmName })), - enabled: true, - ignorePollAlarmFailure, + alarms: props.alarms.map(a => ({ name: a.alarmName })), + enabled: !ignoreAlarmConfiguration, + ignorePollAlarmFailure: props.ignorePollAlarmFailure, }; } diff --git a/packages/aws-cdk-lib/aws-codedeploy/lib/server/deployment-group.ts b/packages/aws-cdk-lib/aws-codedeploy/lib/server/deployment-group.ts index 958e46468ba92..f2ca41f1f74b8 100644 --- a/packages/aws-cdk-lib/aws-codedeploy/lib/server/deployment-group.ts +++ b/packages/aws-cdk-lib/aws-codedeploy/lib/server/deployment-group.ts @@ -220,6 +220,13 @@ export interface ServerDeploymentGroupProps { * @default - default AutoRollbackConfig. */ readonly autoRollback?: AutoRollbackConfig; + + /** + * Whether to skip the step of checking CloudWatch alarms during the deployment process + * + * @default - false + */ + readonly ignoreAlarmConfiguration?: boolean; } /** @@ -303,7 +310,12 @@ export class ServerDeploymentGroup extends DeploymentGroupBase implements IServe ec2TagSet: this.ec2TagSet(props.ec2InstanceTags), onPremisesTagSet: this.onPremiseTagSet(props.onPremiseInstanceTags), alarmConfiguration: cdk.Lazy.any({ - produce: () => renderAlarmConfiguration(this.alarms, props.ignorePollAlarmsFailure, removeAlarmsFromDeploymentGroup), + produce: () => renderAlarmConfiguration({ + alarms: this.alarms, + ignorePollAlarmFailure: props.ignorePollAlarmsFailure, + removeAlarms: removeAlarmsFromDeploymentGroup, + ignoreAlarmConfiguration: props.ignoreAlarmConfiguration, + }), }), autoRollbackConfiguration: cdk.Lazy.any({ produce: () => renderAutoRollbackConfiguration(this.alarms, props.autoRollback) }), }); diff --git a/packages/aws-cdk-lib/aws-codedeploy/test/ecs/deployment-group.test.ts b/packages/aws-cdk-lib/aws-codedeploy/test/ecs/deployment-group.test.ts index dc8a4539b4c7e..ff244b80f66fc 100644 --- a/packages/aws-cdk-lib/aws-codedeploy/test/ecs/deployment-group.test.ts +++ b/packages/aws-cdk-lib/aws-codedeploy/test/ecs/deployment-group.test.ts @@ -884,4 +884,64 @@ describe('CodeDeploy ECS DeploymentGroup', () => { )); }); }); + + test('can ignore alarm status when alarms are present', () => { + const stack = new cdk.Stack(); + new codedeploy.EcsDeploymentGroup(stack, 'MyDG', { + ignoreAlarmConfiguration: true, + alarms: [ + new cloudwatch.Alarm(stack, 'BlueTGUnHealthyHosts', { + metric: new cloudwatch.Metric({ + namespace: 'AWS/ApplicationELB', + metricName: 'UnHealthyHostCount', + }), + threshold: 1, + evaluationPeriods: 1, + }), + ], + service: mockEcsService(stack), + blueGreenDeploymentConfig: { + blueTargetGroup: mockTargetGroup(stack, 'blue'), + greenTargetGroup: mockTargetGroup(stack, 'green'), + listener: mockListener(stack, 'prod'), + }, + }); + + Template.fromStack(stack).hasResourceProperties('AWS::CodeDeploy::DeploymentGroup', { + AlarmConfiguration: { + Enabled: false, + }, + }); + }); + + test('alarms not enabled when removeAlarms is passed with ignoreAlarmConfiguration', () => { + const stack = new cdk.Stack(); + stack.node.setContext('@aws-cdk/aws-codedeploy:removeAlarmsFromDeploymentGroup', true); + + new codedeploy.EcsDeploymentGroup(stack, 'MyDG', { + ignoreAlarmConfiguration: true, + alarms: [ + new cloudwatch.Alarm(stack, 'BlueTGUnHealthyHosts', { + metric: new cloudwatch.Metric({ + namespace: 'AWS/ApplicationELB', + metricName: 'UnHealthyHostCount', + }), + threshold: 1, + evaluationPeriods: 1, + }), + ], + service: mockEcsService(stack), + blueGreenDeploymentConfig: { + blueTargetGroup: mockTargetGroup(stack, 'blue'), + greenTargetGroup: mockTargetGroup(stack, 'green'), + listener: mockListener(stack, 'prod'), + }, + }); + + Template.fromStack(stack).hasResourceProperties('AWS::CodeDeploy::DeploymentGroup', { + AlarmConfiguration: { + Enabled: false, + }, + }); + }); }); diff --git a/packages/aws-cdk-lib/aws-codedeploy/test/lambda/deployment-group.test.ts b/packages/aws-cdk-lib/aws-codedeploy/test/lambda/deployment-group.test.ts index f3fe863b088e1..c3a7c5110fa00 100644 --- a/packages/aws-cdk-lib/aws-codedeploy/test/lambda/deployment-group.test.ts +++ b/packages/aws-cdk-lib/aws-codedeploy/test/lambda/deployment-group.test.ts @@ -652,6 +652,58 @@ describe('CodeDeploy Lambda DeploymentGroup', () => { )); }); }); + + test('can ignore alarm status when alarms are present', () => { + const stack = new cdk.Stack(); + const application = new codedeploy.LambdaApplication(stack, 'MyApp'); + const alias = mockAlias(stack); + new codedeploy.LambdaDeploymentGroup(stack, 'MyDG', { + application, + alias, + postHook: mockFunction(stack, 'PostHook'), + deploymentConfig: codedeploy.LambdaDeploymentConfig.ALL_AT_ONCE, + ignoreAlarmConfiguration: true, + alarms: [new cloudwatch.Alarm(stack, 'Failures', { + metric: alias.metricErrors(), + comparisonOperator: cloudwatch.ComparisonOperator.GREATER_THAN_THRESHOLD, + threshold: 1, + evaluationPeriods: 1, + })], + }); + + Template.fromStack(stack).hasResourceProperties('AWS::CodeDeploy::DeploymentGroup', { + AlarmConfiguration: { + Enabled: false, + }, + }); + }); + + test('alarms not enabled when removeAlarms is passed with ignoreAlarmConfiguration', () => { + const stack = new cdk.Stack(); + stack.node.setContext('@aws-cdk/aws-codedeploy:removeAlarmsFromDeploymentGroup', true); + + const application = new codedeploy.LambdaApplication(stack, 'MyApp'); + const alias = mockAlias(stack); + new codedeploy.LambdaDeploymentGroup(stack, 'MyDG', { + application, + alias, + postHook: mockFunction(stack, 'PostHook'), + deploymentConfig: codedeploy.LambdaDeploymentConfig.ALL_AT_ONCE, + ignoreAlarmConfiguration: true, + alarms: [new cloudwatch.Alarm(stack, 'Failures', { + metric: alias.metricErrors(), + comparisonOperator: cloudwatch.ComparisonOperator.GREATER_THAN_THRESHOLD, + threshold: 1, + evaluationPeriods: 1, + })], + }); + + Template.fromStack(stack).hasResourceProperties('AWS::CodeDeploy::DeploymentGroup', { + AlarmConfiguration: { + Enabled: false, + }, + }); + }); }); describe('imported with fromLambdaDeploymentGroupAttributes', () => { diff --git a/packages/aws-cdk-lib/aws-codedeploy/test/server/deployment-group.test.ts b/packages/aws-cdk-lib/aws-codedeploy/test/server/deployment-group.test.ts index c01b242ffe7b6..8b5e0d85c3b8d 100644 --- a/packages/aws-cdk-lib/aws-codedeploy/test/server/deployment-group.test.ts +++ b/packages/aws-cdk-lib/aws-codedeploy/test/server/deployment-group.test.ts @@ -630,4 +630,53 @@ describe('CodeDeploy Server Deployment Group', () => { )); }); }); + + test('can ignore alarm status when alarms are present', () => { + const stack = new cdk.Stack(); + + new codedeploy.ServerDeploymentGroup(stack, 'DeploymentGroup', { + alarms: [ + new cloudwatch.Alarm(stack, 'Alarm1', { + metric: new cloudwatch.Metric({ + metricName: 'Errors', + namespace: 'my.namespace', + }), + threshold: 1, + evaluationPeriods: 1, + }), + ], + ignoreAlarmConfiguration: true, + }); + + Template.fromStack(stack).hasResourceProperties('AWS::CodeDeploy::DeploymentGroup', { + AlarmConfiguration: { + Enabled: false, + }, + }); + }); + + test('alarms not enabled when removeAlarms is passed with ignoreAlarmConfiguration', () => { + const stack = new cdk.Stack(); + stack.node.setContext('@aws-cdk/aws-codedeploy:removeAlarmsFromDeploymentGroup', true); + + new codedeploy.ServerDeploymentGroup(stack, 'DeploymentGroup', { + alarms: [ + new cloudwatch.Alarm(stack, 'Alarm1', { + metric: new cloudwatch.Metric({ + metricName: 'Errors', + namespace: 'my.namespace', + }), + threshold: 1, + evaluationPeriods: 1, + }), + ], + ignoreAlarmConfiguration: true, + }); + + Template.fromStack(stack).hasResourceProperties('AWS::CodeDeploy::DeploymentGroup', { + AlarmConfiguration: { + Enabled: false, + }, + }); + }); }); From c3c771c6f6f6790f2298a85a549bded640d2e35b Mon Sep 17 00:00:00 2001 From: Kara Potts Date: Tue, 13 Feb 2024 16:22:53 +0000 Subject: [PATCH 4/4] feat(ses): `grant` methods to `IEmailIdentity` (#29084) ### Issue Closes #29083 ### Reason for this change When granting send email access to a lambda the grant needs to be constructed manually, including constructing the ARN for the identity. e.g. ``` Grant.addToPrincipal({ grantee, actions: ["ses:SendEmail"], resourceArns: [ this.stack.formatArn({ service: 'ses', resource: 'identity', resourceName: 'test@example.com', }), ], scope: this }) ``` This is dissimilar to other constructs, which generally expose a grant method and one or more convenience methods for particularly relevant groups of actions. ### Description of changes Added `grant` and `grantSendEmail` to `IEmailIdentity`, and added a common abstract class, `BaseEmailIdentity` with the relevant grant code. This is to avoid code duplication between the full `EmailIdentity` and the `Import` class. ### Description of how you validated changes Tests added for grants on both new and imported email identities, and a test to validate the `grantSendEmail` method. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../aws-ses/test/fixtures/send-email/index.py | 31 ++ ...efaultTestDeployAssert3F909307.assets.json | 2 +- .../index.py | 31 ++ .../cdk-ses-email-identity-integ.assets.json | 19 +- ...cdk-ses-email-identity-integ.template.json | 143 ++++++-- .../integ.email-identity.js.snapshot/cdk.out | 2 +- .../integ.json | 5 +- .../manifest.json | 36 +- .../tree.json | 317 +++++++++++++++--- .../test/aws-ses/test/integ.email-identity.ts | 13 +- packages/aws-cdk-lib/aws-ses/README.md | 16 + .../aws-cdk-lib/aws-ses/lib/email-identity.ts | 86 ++++- .../aws-ses/test/email-identity.test.ts | 136 ++++++++ 13 files changed, 749 insertions(+), 88 deletions(-) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/fixtures/send-email/index.py create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/asset.ab3156800c2f322f16da8bff913172139189a387dd64a4e622f82a790561fd4d/index.py diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/fixtures/send-email/index.py b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/fixtures/send-email/index.py new file mode 100644 index 0000000000000..d6e4b468282eb --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/fixtures/send-email/index.py @@ -0,0 +1,31 @@ +import json +import boto3 + +client = boto3.client('ses', region_name='us-west-2') + +def lambda_handler(event, context): + response = client.send_email( + Destination={ + 'ToAddresses': ['test@example.com'] + }, + Message={ + 'Body': { + 'Text': { + 'Charset': 'UTF-8', + 'Data': 'This is the message body in text format.', + } + }, + 'Subject': { + 'Charset': 'UTF-8', + 'Data': 'Test email', + }, + }, + Source='sender@cdk.dev' + ) + + print(response) + + return { + 'statusCode': 200, + 'body': json.dumps("Email Sent Successfully. MessageId is: " + response['MessageId']) + } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/EmailIdentityIntegDefaultTestDeployAssert3F909307.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/EmailIdentityIntegDefaultTestDeployAssert3F909307.assets.json index 7044ba1f72377..16de6267b3547 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/EmailIdentityIntegDefaultTestDeployAssert3F909307.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/EmailIdentityIntegDefaultTestDeployAssert3F909307.assets.json @@ -1,5 +1,5 @@ { - "version": "20.0.0", + "version": "36.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/asset.ab3156800c2f322f16da8bff913172139189a387dd64a4e622f82a790561fd4d/index.py b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/asset.ab3156800c2f322f16da8bff913172139189a387dd64a4e622f82a790561fd4d/index.py new file mode 100644 index 0000000000000..d6e4b468282eb --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/asset.ab3156800c2f322f16da8bff913172139189a387dd64a4e622f82a790561fd4d/index.py @@ -0,0 +1,31 @@ +import json +import boto3 + +client = boto3.client('ses', region_name='us-west-2') + +def lambda_handler(event, context): + response = client.send_email( + Destination={ + 'ToAddresses': ['test@example.com'] + }, + Message={ + 'Body': { + 'Text': { + 'Charset': 'UTF-8', + 'Data': 'This is the message body in text format.', + } + }, + 'Subject': { + 'Charset': 'UTF-8', + 'Data': 'Test email', + }, + }, + Source='sender@cdk.dev' + ) + + print(response) + + return { + 'statusCode': 200, + 'body': json.dumps("Email Sent Successfully. MessageId is: " + response['MessageId']) + } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/cdk-ses-email-identity-integ.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/cdk-ses-email-identity-integ.assets.json index 50a1078fb9f8e..97e015957f009 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/cdk-ses-email-identity-integ.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/cdk-ses-email-identity-integ.assets.json @@ -1,7 +1,20 @@ { - "version": "20.0.0", + "version": "36.0.0", "files": { - "3461fb122e984a82b0e44e4b1b516ea2f581c705cce4e8f99d2001a9407cd2fa": { + "ab3156800c2f322f16da8bff913172139189a387dd64a4e622f82a790561fd4d": { + "source": { + "path": "asset.ab3156800c2f322f16da8bff913172139189a387dd64a4e622f82a790561fd4d", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "ab3156800c2f322f16da8bff913172139189a387dd64a4e622f82a790561fd4d.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "8c1c73fb1dcf73cfd07d1697a478ad6e1fbe3673f2d10d7c35dbcaedc31ea460": { "source": { "path": "cdk-ses-email-identity-integ.template.json", "packaging": "file" @@ -9,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "3461fb122e984a82b0e44e4b1b516ea2f581c705cce4e8f99d2001a9407cd2fa.json", + "objectKey": "8c1c73fb1dcf73cfd07d1697a478ad6e1fbe3673f2d10d7c35dbcaedc31ea460.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/cdk-ses-email-identity-integ.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/cdk-ses-email-identity-integ.template.json index 176c7cdb798e2..97aef55c55df7 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/cdk-ses-email-identity-integ.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/cdk-ses-email-identity-integ.template.json @@ -6,19 +6,119 @@ "Name": "cdk.dev." } }, + "FunctionServiceRole675BB04A": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "FunctionServiceRoleDefaultPolicy2F49994A": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ses:SendEmail", + "ses:SendRawEmail" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ses:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":identity/", + { + "Ref": "EmailIdentity7187767D" + } + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "FunctionServiceRoleDefaultPolicy2F49994A", + "Roles": [ + { + "Ref": "FunctionServiceRole675BB04A" + } + ] + } + }, + "Function76856677": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "ab3156800c2f322f16da8bff913172139189a387dd64a4e622f82a790561fd4d.zip" + }, + "FunctionName": "email-sending-lambda", + "Handler": "index.lambda_handler", + "Role": { + "Fn::GetAtt": [ + "FunctionServiceRole675BB04A", + "Arn" + ] + }, + "Runtime": "python3.11" + }, + "DependsOn": [ + "FunctionServiceRoleDefaultPolicy2F49994A", + "FunctionServiceRole675BB04A" + ] + }, "EmailIdentityDkimDnsToken1BA32ACB3": { "Type": "AWS::Route53::RecordSet", "Properties": { + "HostedZoneId": { + "Ref": "HostedZoneDB99F866" + }, "Name": { "Fn::GetAtt": [ "EmailIdentity7187767D", "DkimDNSTokenName1" ] }, - "Type": "CNAME", - "HostedZoneId": { - "Ref": "HostedZoneDB99F866" - }, "ResourceRecords": [ { "Fn::GetAtt": [ @@ -27,22 +127,22 @@ ] } ], - "TTL": "1800" + "TTL": "1800", + "Type": "CNAME" } }, "EmailIdentityDkimDnsToken2BBEBB8EC": { "Type": "AWS::Route53::RecordSet", "Properties": { + "HostedZoneId": { + "Ref": "HostedZoneDB99F866" + }, "Name": { "Fn::GetAtt": [ "EmailIdentity7187767D", "DkimDNSTokenName2" ] }, - "Type": "CNAME", - "HostedZoneId": { - "Ref": "HostedZoneDB99F866" - }, "ResourceRecords": [ { "Fn::GetAtt": [ @@ -51,22 +151,22 @@ ] } ], - "TTL": "1800" + "TTL": "1800", + "Type": "CNAME" } }, "EmailIdentityDkimDnsToken3BB5E8A49": { "Type": "AWS::Route53::RecordSet", "Properties": { + "HostedZoneId": { + "Ref": "HostedZoneDB99F866" + }, "Name": { "Fn::GetAtt": [ "EmailIdentity7187767D", "DkimDNSTokenName3" ] }, - "Type": "CNAME", - "HostedZoneId": { - "Ref": "HostedZoneDB99F866" - }, "ResourceRecords": [ { "Fn::GetAtt": [ @@ -75,7 +175,8 @@ ] } ], - "TTL": "1800" + "TTL": "1800", + "Type": "CNAME" } }, "EmailIdentity7187767D": { @@ -90,11 +191,10 @@ "EmailIdentityMailFromMxRecordCEAAECD0": { "Type": "AWS::Route53::RecordSet", "Properties": { - "Name": "mail.cdk.dev.", - "Type": "MX", "HostedZoneId": { "Ref": "HostedZoneDB99F866" }, + "Name": "mail.cdk.dev.", "ResourceRecords": [ { "Fn::Join": [ @@ -109,21 +209,22 @@ ] } ], - "TTL": "1800" + "TTL": "1800", + "Type": "MX" } }, "EmailIdentityMailFromTxtRecordE6B5E5D0": { "Type": "AWS::Route53::RecordSet", "Properties": { - "Name": "mail.cdk.dev.", - "Type": "TXT", "HostedZoneId": { "Ref": "HostedZoneDB99F866" }, + "Name": "mail.cdk.dev.", "ResourceRecords": [ "\"v=spf1 include:amazonses.com ~all\"" ], - "TTL": "1800" + "TTL": "1800", + "Type": "TXT" } } }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/cdk.out index 588d7b269d34f..1f0068d32659a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"20.0.0"} \ No newline at end of file +{"version":"36.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/integ.json index 9e7358acc260d..fd772ae904c6e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/integ.json @@ -1,11 +1,12 @@ { - "version": "20.0.0", + "version": "36.0.0", "testCases": { "EmailIdentityInteg/DefaultTest": { "stacks": [ "cdk-ses-email-identity-integ" ], - "assertionStack": "EmailIdentityInteg/DefaultTest/DeployAssert" + "assertionStack": "EmailIdentityInteg/DefaultTest/DeployAssert", + "assertionStackName": "EmailIdentityIntegDefaultTestDeployAssert3F909307" } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/manifest.json index a4474de28ad39..6362d8703aa00 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { - "version": "20.0.0", + "version": "36.0.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "cdk-ses-email-identity-integ.assets": { "type": "cdk:asset-manifest", "properties": { @@ -20,10 +14,11 @@ "environment": "aws://unknown-account/unknown-region", "properties": { "templateFile": "cdk-ses-email-identity-integ.template.json", + "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/3461fb122e984a82b0e44e4b1b516ea2f581c705cce4e8f99d2001a9407cd2fa.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/8c1c73fb1dcf73cfd07d1697a478ad6e1fbe3673f2d10d7c35dbcaedc31ea460.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -45,6 +40,24 @@ "data": "HostedZoneDB99F866" } ], + "/cdk-ses-email-identity-integ/Function/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "FunctionServiceRole675BB04A" + } + ], + "/cdk-ses-email-identity-integ/Function/ServiceRole/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "FunctionServiceRoleDefaultPolicy2F49994A" + } + ], + "/cdk-ses-email-identity-integ/Function/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Function76856677" + } + ], "/cdk-ses-email-identity-integ/EmailIdentity/DkimDnsToken1": [ { "type": "aws:cdk:logicalId", @@ -109,6 +122,7 @@ "environment": "aws://unknown-account/unknown-region", "properties": { "templateFile": "EmailIdentityIntegDefaultTestDeployAssert3F909307.template.json", + "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", @@ -142,6 +156,12 @@ ] }, "displayName": "EmailIdentityInteg/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/tree.json index e6753ebfb565e..cfa1021df9c5d 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.js.snapshot/tree.json @@ -4,14 +4,6 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" - } - }, "cdk-ses-email-identity-integ": { "id": "cdk-ses-email-identity-integ", "path": "cdk-ses-email-identity-integ", @@ -30,13 +22,198 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-route53.CfnHostedZone", + "fqn": "aws-cdk-lib.aws_route53.CfnHostedZone", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-route53.PublicHostedZone", + "fqn": "aws-cdk-lib.aws_route53.PublicHostedZone", + "version": "0.0.0" + } + }, + "Function": { + "id": "Function", + "path": "cdk-ses-email-identity-integ/Function", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "cdk-ses-email-identity-integ/Function/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "cdk-ses-email-identity-integ/Function/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "cdk-ses-email-identity-integ/Function/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "cdk-ses-email-identity-integ/Function/ServiceRole/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "cdk-ses-email-identity-integ/Function/ServiceRole/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": [ + "ses:SendEmail", + "ses:SendRawEmail" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ses:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":identity/", + { + "Ref": "EmailIdentity7187767D" + } + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "policyName": "FunctionServiceRoleDefaultPolicy2F49994A", + "roles": [ + { + "Ref": "FunctionServiceRole675BB04A" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "cdk-ses-email-identity-integ/Function/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "cdk-ses-email-identity-integ/Function/Code/Stage", + "constructInfo": { + "fqn": "aws-cdk-lib.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "cdk-ses-email-identity-integ/Function/Code/AssetBucket", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3_assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "cdk-ses-email-identity-integ/Function/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "ab3156800c2f322f16da8bff913172139189a387dd64a4e622f82a790561fd4d.zip" + }, + "functionName": "email-sending-lambda", + "handler": "index.lambda_handler", + "role": { + "Fn::GetAtt": [ + "FunctionServiceRole675BB04A", + "Arn" + ] + }, + "runtime": "python3.11" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.Function", "version": "0.0.0" } }, @@ -50,16 +227,15 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::Route53::RecordSet", "aws:cdk:cloudformation:props": { + "hostedZoneId": { + "Ref": "HostedZoneDB99F866" + }, "name": { "Fn::GetAtt": [ "EmailIdentity7187767D", "DkimDNSTokenName1" ] }, - "type": "CNAME", - "hostedZoneId": { - "Ref": "HostedZoneDB99F866" - }, "resourceRecords": [ { "Fn::GetAtt": [ @@ -68,11 +244,12 @@ ] } ], - "ttl": "1800" + "ttl": "1800", + "type": "CNAME" } }, "constructInfo": { - "fqn": "@aws-cdk/aws-route53.CfnRecordSet", + "fqn": "aws-cdk-lib.aws_route53.CfnRecordSet", "version": "0.0.0" } }, @@ -82,16 +259,15 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::Route53::RecordSet", "aws:cdk:cloudformation:props": { + "hostedZoneId": { + "Ref": "HostedZoneDB99F866" + }, "name": { "Fn::GetAtt": [ "EmailIdentity7187767D", "DkimDNSTokenName2" ] }, - "type": "CNAME", - "hostedZoneId": { - "Ref": "HostedZoneDB99F866" - }, "resourceRecords": [ { "Fn::GetAtt": [ @@ -100,11 +276,12 @@ ] } ], - "ttl": "1800" + "ttl": "1800", + "type": "CNAME" } }, "constructInfo": { - "fqn": "@aws-cdk/aws-route53.CfnRecordSet", + "fqn": "aws-cdk-lib.aws_route53.CfnRecordSet", "version": "0.0.0" } }, @@ -114,16 +291,15 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::Route53::RecordSet", "aws:cdk:cloudformation:props": { + "hostedZoneId": { + "Ref": "HostedZoneDB99F866" + }, "name": { "Fn::GetAtt": [ "EmailIdentity7187767D", "DkimDNSTokenName3" ] }, - "type": "CNAME", - "hostedZoneId": { - "Ref": "HostedZoneDB99F866" - }, "resourceRecords": [ { "Fn::GetAtt": [ @@ -132,11 +308,12 @@ ] } ], - "ttl": "1800" + "ttl": "1800", + "type": "CNAME" } }, "constructInfo": { - "fqn": "@aws-cdk/aws-route53.CfnRecordSet", + "fqn": "aws-cdk-lib.aws_route53.CfnRecordSet", "version": "0.0.0" } }, @@ -153,7 +330,7 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ses.CfnEmailIdentity", + "fqn": "aws-cdk-lib.aws_ses.CfnEmailIdentity", "version": "0.0.0" } }, @@ -167,11 +344,10 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::Route53::RecordSet", "aws:cdk:cloudformation:props": { - "name": "mail.cdk.dev.", - "type": "MX", "hostedZoneId": { "Ref": "HostedZoneDB99F866" }, + "name": "mail.cdk.dev.", "resourceRecords": [ { "Fn::Join": [ @@ -186,17 +362,18 @@ ] } ], - "ttl": "1800" + "ttl": "1800", + "type": "MX" } }, "constructInfo": { - "fqn": "@aws-cdk/aws-route53.CfnRecordSet", + "fqn": "aws-cdk-lib.aws_route53.CfnRecordSet", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-route53.MxRecord", + "fqn": "aws-cdk-lib.aws_route53.MxRecord", "version": "0.0.0" } }, @@ -210,38 +387,54 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::Route53::RecordSet", "aws:cdk:cloudformation:props": { - "name": "mail.cdk.dev.", - "type": "TXT", "hostedZoneId": { "Ref": "HostedZoneDB99F866" }, + "name": "mail.cdk.dev.", "resourceRecords": [ "\"v=spf1 include:amazonses.com ~all\"" ], - "ttl": "1800" + "ttl": "1800", + "type": "TXT" } }, "constructInfo": { - "fqn": "@aws-cdk/aws-route53.CfnRecordSet", + "fqn": "aws-cdk-lib.aws_route53.CfnRecordSet", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-route53.TxtRecord", + "fqn": "aws-cdk-lib.aws_route53.TxtRecord", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ses.EmailIdentity", + "fqn": "aws-cdk-lib.aws_ses.EmailIdentity", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "cdk-ses-email-identity-integ/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "cdk-ses-email-identity-integ/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" } }, "EmailIdentityInteg": { @@ -257,33 +450,59 @@ "path": "EmailIdentityInteg/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.85" + "version": "10.3.0" } }, "DeployAssert": { "id": "DeployAssert", "path": "EmailIdentityInteg/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "EmailIdentityInteg/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "EmailIdentityInteg/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/integ-tests.IntegTest", + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", "version": "0.0.0" } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "aws-cdk-lib.App", + "version": "0.0.0" } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.ts index 5a0bd64bbff69..20888683f53dc 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.email-identity.ts @@ -3,6 +3,8 @@ import { App, Stack, StackProps } from 'aws-cdk-lib'; import * as integ from '@aws-cdk/integ-tests-alpha'; import { Construct } from 'constructs'; import * as ses from 'aws-cdk-lib/aws-ses'; +import { Code, Function, Runtime } from 'aws-cdk-lib/aws-lambda'; +import * as path from 'path'; class TestStack extends Stack { constructor(scope: Construct, id: string, props?: StackProps) { @@ -12,10 +14,19 @@ class TestStack extends Stack { zoneName: 'cdk.dev', }); - new ses.EmailIdentity(this, 'EmailIdentity', { + const lambdaFunction = new Function(this, 'Function', { + functionName: 'email-sending-lambda', + runtime: Runtime.PYTHON_3_11, + code: Code.fromAsset(path.join(__dirname, 'fixtures', 'send-email')), + handler: 'index.lambda_handler', + }); + + const emailIdentity = new ses.EmailIdentity(this, 'EmailIdentity', { identity: ses.Identity.publicHostedZone(hostedZone), mailFromDomain: 'mail.cdk.dev', }); + + emailIdentity.grantSendEmail(lambdaFunction); } } diff --git a/packages/aws-cdk-lib/aws-ses/README.md b/packages/aws-cdk-lib/aws-ses/README.md index 5120aedd90bc8..eb59f3cc6bc9c 100644 --- a/packages/aws-cdk-lib/aws-ses/README.md +++ b/packages/aws-cdk-lib/aws-ses/README.md @@ -210,6 +210,22 @@ for (const record of identity.dkimRecords) { } ``` +#### Grants + +To grant a specific action to a principal use the `grant` method. +For sending emails, `grantSendEmail` can be used instead: + +```ts +import * as iam from 'aws-cdk-lib/aws-iam'; +declare const user: iam.User; + +const identity = new ses.EmailIdentity(this, 'Identity', { + identity: ses.Identity.domain('cdk.dev'), +}); + +identity.grantSendEmail(user); +``` + ### Virtual Deliverability Manager (VDM) Virtual Deliverability Manager is an Amazon SES feature that helps you enhance email deliverability, diff --git a/packages/aws-cdk-lib/aws-ses/lib/email-identity.ts b/packages/aws-cdk-lib/aws-ses/lib/email-identity.ts index f7282af644ef9..49ec4298d17c1 100644 --- a/packages/aws-cdk-lib/aws-ses/lib/email-identity.ts +++ b/packages/aws-cdk-lib/aws-ses/lib/email-identity.ts @@ -2,6 +2,7 @@ import { Construct } from 'constructs'; import { IConfigurationSet } from './configuration-set'; import { undefinedIfNoKeys } from './private/utils'; import { CfnEmailIdentity } from './ses.generated'; +import { Grant, IGrantable } from '../../aws-iam'; import { IPublicHostedZone } from '../../aws-route53'; import * as route53 from '../../aws-route53'; import { IResource, Lazy, Resource, SecretValue, Stack } from '../../core'; @@ -16,6 +17,30 @@ export interface IEmailIdentity extends IResource { * @attribute */ readonly emailIdentityName: string; + + /** + * The ARN of the email identity + * + * @attribute + */ + readonly emailIdentityArn: string; + + /** + * Adds an IAM policy statement associated with this email identity to an IAM principal's policy. + * + * @param grantee the principal (no-op if undefined) + * @param actions the set of actions to allow + */ + grant(grantee: IGrantable, ...actions: string[]): Grant; + + /** + * Permits an IAM principal the send email action. + * + * Actions: SendEmail. + * + * @param grantee the principal to grant access to + */ + grantSendEmail(grantee: IGrantable): Grant; } /** @@ -310,22 +335,73 @@ export enum EasyDkimSigningKeyLength { RSA_2048_BIT = 'RSA_2048_BIT', } +abstract class EmailIdentityBase extends Resource implements IEmailIdentity { + /** + * The name of the email identity + * + * @attribute + */ + public abstract readonly emailIdentityName: string; + + /** + * The ARN of the email identity + * + * @attribute + */ + public abstract readonly emailIdentityArn: string; + + /** + * Adds an IAM policy statement associated with this email identity to an IAM principal's policy. + * + * @param grantee the principal (no-op if undefined) + * @param actions the set of actions to allow + */ + public grant(grantee: IGrantable, ...actions: string[]): Grant { + const resourceArns = [this.emailIdentityArn]; + return Grant.addToPrincipal({ + grantee, + actions, + resourceArns, + scope: this, + }); + } + + /** + * Permits an IAM principal the send email action. + * + * Actions: SendEmail, SendRawEmail. + * + * @param grantee the principal to grant access to + */ + public grantSendEmail(grantee: IGrantable): Grant { + return this.grant(grantee, 'ses:SendEmail', 'ses:SendRawEmail'); + } +} + /** * An email identity */ -export class EmailIdentity extends Resource implements IEmailIdentity { +export class EmailIdentity extends EmailIdentityBase { /** * Use an existing email identity */ public static fromEmailIdentityName(scope: Construct, id: string, emailIdentityName: string): IEmailIdentity { - class Import extends Resource implements IEmailIdentity { + class Import extends EmailIdentityBase { public readonly emailIdentityName = emailIdentityName; + + public readonly emailIdentityArn = this.stack.formatArn({ + service: 'ses', + resource: 'identity', + resourceName: this.emailIdentityName, + }); } return new Import(scope, id); } public readonly emailIdentityName: string; + public readonly emailIdentityArn: string; + /** * The host name for the first token that you have to add to the * DNS configurationfor your domain @@ -421,6 +497,12 @@ export class EmailIdentity extends Resource implements IEmailIdentity { this.emailIdentityName = identity.ref; + this.emailIdentityArn = this.stack.formatArn({ + service: 'ses', + resource: 'identity', + resourceName: this.emailIdentityName, + }); + this.dkimDnsTokenName1 = identity.attrDkimDnsTokenName1; this.dkimDnsTokenName2 = identity.attrDkimDnsTokenName2; this.dkimDnsTokenName3 = identity.attrDkimDnsTokenName3; diff --git a/packages/aws-cdk-lib/aws-ses/test/email-identity.test.ts b/packages/aws-cdk-lib/aws-ses/test/email-identity.test.ts index adf121a4586b5..29cff96a57410 100644 --- a/packages/aws-cdk-lib/aws-ses/test/email-identity.test.ts +++ b/packages/aws-cdk-lib/aws-ses/test/email-identity.test.ts @@ -1,4 +1,5 @@ import { Template } from '../../assertions'; +import { User } from '../../aws-iam'; import * as route53 from '../../aws-route53'; import { SecretValue, Stack } from '../../core'; import { ConfigurationSet, DkimIdentity, EmailIdentity, Identity, MailFromBehaviorOnMxFailure } from '../lib'; @@ -191,3 +192,138 @@ test('with mail from and hosted zone', () => { }); }); +describe('grants', () => { + test('grant on a domain identity', () => { + // GIVEN + stack = new Stack(undefined, 'Stack', { env: { region: 'us-west-2', account: '123456789012' } }); + const user = new User(stack, 'User'); + const emailIdentity = new EmailIdentity(stack, 'Identity', { + identity: Identity.domain('cdk.dev'), + }); + + // WHEN + emailIdentity.grant(user, 'ses:action1', 'ses:action2'); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { + PolicyDocument: { + Statement: [ + { + Action: ['ses:action1', 'ses:action2'], + Effect: 'Allow', + Resource: { + 'Fn::Join': [ + '', + [ + 'arn:', + { Ref: 'AWS::Partition' }, + ':ses:us-west-2:123456789012:identity/', + { Ref: 'Identity2D60E2CC' }, + ], + ], + }, + }, + ], + Version: '2012-10-17', + }, + PolicyName: 'UserDefaultPolicy1F97781E', + Users: [ + { + Ref: 'User00B015A1', + }, + ], + }); + }); + + test('grant on an email identity from name', () => { + // GIVEN + stack = new Stack(undefined, 'Stack', { env: { region: 'us-west-2', account: '123456789012' } }); + const user = new User(stack, 'User'); + const emailIdentity = EmailIdentity.fromEmailIdentityName( + stack, + 'Identity', + 'cdk.dev', + ); + + // WHEN + emailIdentity.grant(user, 'ses:action1', 'ses:action2'); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { + PolicyDocument: { + Statement: [ + { + Action: [ + 'ses:action1', + 'ses:action2', + ], + Effect: 'Allow', + Resource: { + 'Fn::Join': [ + '', + [ + 'arn:', + { Ref: 'AWS::Partition' }, + ':ses:us-west-2:123456789012:identity/cdk.dev', + ], + ], + }, + }, + ], + Version: '2012-10-17', + }, + PolicyName: 'UserDefaultPolicy1F97781E', + Users: [ + { + Ref: 'User00B015A1', + }, + ], + }); + }); + + test('grantSendEmail', () => { + // GIVEN + stack = new Stack(undefined, 'Stack', { env: { region: 'us-west-2', account: '123456789012' } }); + const user = new User(stack, 'User'); + const emailIdentity = EmailIdentity.fromEmailIdentityName( + stack, + 'Identity', + 'cdk.dev', + ); + + // WHEN + emailIdentity.grantSendEmail(user); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { + PolicyDocument: { + Statement: [ + { + Action: [ + 'ses:SendEmail', + 'ses:SendRawEmail', + ], + Effect: 'Allow', + Resource: { + 'Fn::Join': [ + '', + [ + 'arn:', + { Ref: 'AWS::Partition' }, + ':ses:us-west-2:123456789012:identity/cdk.dev', + ], + ], + }, + }, + ], + Version: '2012-10-17', + }, + PolicyName: 'UserDefaultPolicy1F97781E', + Users: [ + { + Ref: 'User00B015A1', + }, + ], + }); + }); +});