diff --git a/.github/workflows/lambda-runtime-tests.yml b/.github/workflows/lambda-runtime-tests.yml index b4afacdef12f7..6914e76f08cff 100644 --- a/.github/workflows/lambda-runtime-tests.yml +++ b/.github/workflows/lambda-runtime-tests.yml @@ -8,6 +8,8 @@ jobs: update-lambda-tests: if: github.repository == 'aws/aws-cdk' runs-on: ubuntu-latest + permissions: + contents: write steps: - uses: actions/checkout@v4 with: @@ -44,4 +46,6 @@ jobs: git config --global user.email 'aws-cdk-automation@users.noreply.github.com' git add . git commit -m "chore: update lambda runtime integration tests" - git push origin ${{ github.event.pull_request.head.ref }} \ No newline at end of file + git push origin ${{ github.event.pull_request.head.ref }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/CHANGELOG.v2.alpha.md b/CHANGELOG.v2.alpha.md index e24b1d917785b..5e43526fa0cf1 100644 --- a/CHANGELOG.v2.alpha.md +++ b/CHANGELOG.v2.alpha.md @@ -2,6 +2,19 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [2.175.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.174.1-alpha.0...v2.175.0-alpha.0) (2025-01-09) + + +### Features + +* **s3objectlambda:** open s3 access point arn ([#32661](https://github.com/aws/aws-cdk/issues/32661)) ([0486b9c](https://github.com/aws/aws-cdk/commit/0486b9c5e2b4286499a9d3f87a0db7c95741fb6b)), closes [#31950](https://github.com/aws/aws-cdk/issues/31950) + + +### Bug Fixes + +* **apprunner:** the Service class does not implement IService ([#32771](https://github.com/aws/aws-cdk/issues/32771)) ([3d56efa](https://github.com/aws/aws-cdk/commit/3d56efa20ef92761ed22f12e4f651856b6889be3)), closes [#32745](https://github.com/aws/aws-cdk/issues/32745) +* **integ-runner:** `ENOENT` no such file or directory 'recommended-feature-flags.json' ([#32750](https://github.com/aws/aws-cdk/issues/32750)) ([f809b94](https://github.com/aws/aws-cdk/commit/f809b94d9952b8203221e73e177d2615c21248a8)) + ## [2.174.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.174.0-alpha.0...v2.174.1-alpha.0) (2025-01-07) ## [2.174.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.173.4-alpha.0...v2.174.0-alpha.0) (2025-01-04) diff --git a/CHANGELOG.v2.md b/CHANGELOG.v2.md index 4e92b63270aee..606096c14a563 100644 --- a/CHANGELOG.v2.md +++ b/CHANGELOG.v2.md @@ -2,6 +2,27 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [2.175.0](https://github.com/aws/aws-cdk/compare/v2.174.1...v2.175.0) (2025-01-09) + + +### Features + +* **ecs:** enable fault injection flag ([#32598](https://github.com/aws/aws-cdk/issues/32598)) ([ed366ce](https://github.com/aws/aws-cdk/commit/ed366ce812a94066de04e9862d6cbd1083bf5d9c)) +* **ecs:** warning when creating a service with the default minHealthyPercent ([#31738](https://github.com/aws/aws-cdk/issues/31738)) ([3606deb](https://github.com/aws/aws-cdk/commit/3606deb5b519365d846e6e66406c835889827055)), closes [#31705](https://github.com/aws/aws-cdk/issues/31705) +* update L1 CloudFormation resource definitions ([#32768](https://github.com/aws/aws-cdk/issues/32768)) ([107eed3](https://github.com/aws/aws-cdk/commit/107eed3b50e86246da03d6b59197452e2af0bfaf)) +* **cli:** warn of non-existent stacks in `cdk destroy` ([#32636](https://github.com/aws/aws-cdk/issues/32636)) ([c199378](https://github.com/aws/aws-cdk/commit/c199378667cb63ffe8636dda6b6316dcc6eb47e9)), closes [#32545](https://github.com/aws/aws-cdk/issues/32545) [#27179](https://github.com/aws/aws-cdk/issues/27179) [40aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts#L190](https://github.com/40aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts/issues/L190) [aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts#L286-L291](https://github.com/aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts/issues/L286-L291) +* **eks:** update nodegroup gpu check ([#32715](https://github.com/aws/aws-cdk/issues/32715)) ([693afea](https://github.com/aws/aws-cdk/commit/693afea86310fd444d237b9f70204fbf4bb5a68d)), closes [#31347](https://github.com/aws/aws-cdk/issues/31347) +* update L1 CloudFormation resource definitions ([#32755](https://github.com/aws/aws-cdk/issues/32755)) ([8f97112](https://github.com/aws/aws-cdk/commit/8f97112c89c6b39e299b0cd437336bab11cfdaf8)) +* **kms:** add sign and verify related grant methods ([#32681](https://github.com/aws/aws-cdk/issues/32681)) ([86d2853](https://github.com/aws/aws-cdk/commit/86d2853a9a919669694a2448805a092839a7f4db)), closes [#23185](https://github.com/aws/aws-cdk/issues/23185) + + +### Bug Fixes + +* **cli:** cannot set environment variable `CI=false` ([#32749](https://github.com/aws/aws-cdk/issues/32749)) ([26b361d](https://github.com/aws/aws-cdk/commit/26b361de357a3b83c59dc4931d4797328d220534)) +* **cli:** requiresRefresh function does not respect null ([#32666](https://github.com/aws/aws-cdk/issues/32666)) ([2abc23c](https://github.com/aws/aws-cdk/commit/2abc23c4cfdf27e8623fea3d3fbb71ad7e25dbbe)), closes [#32653](https://github.com/aws/aws-cdk/issues/32653) [/github.com/smithy-lang/smithy-typescript/blob/main/packages/property-provider/src/memoize.ts#L27](https://github.com/aws//github.com/smithy-lang/smithy-typescript/blob/main/packages/property-provider/src/memoize.ts/issues/L27) +* **cloudwatch:** render region and accountId when directly set on metrics ([#32325](https://github.com/aws/aws-cdk/issues/32325)) ([c393481](https://github.com/aws/aws-cdk/commit/c3934817ea15bb3187f67112a1d56c13aa555524)), closes [#28731](https://github.com/aws/aws-cdk/issues/28731) +* **ecs:** outdated linux commands for `canContainersAccessInstanceRole=false` and also deprecate property ([#32763](https://github.com/aws/aws-cdk/issues/32763)) ([bbdd42c](https://github.com/aws/aws-cdk/commit/bbdd42c8f45916d5c6945f3429916f6199d2ec66)), closes [#28518](https://github.com/aws/aws-cdk/issues/28518) + ## [2.174.1](https://github.com/aws/aws-cdk/compare/v2.174.0...v2.174.1) (2025-01-07) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.js.snapshot/appconfigenvironmentDefaultTestDeployAssert75BD28E7.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.js.snapshot/appconfigenvironmentDefaultTestDeployAssert75BD28E7.assets.json index 947e7fb4d76ea..13d8dae10ffa1 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.js.snapshot/appconfigenvironmentDefaultTestDeployAssert75BD28E7.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.js.snapshot/appconfigenvironmentDefaultTestDeployAssert75BD28E7.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "39.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.js.snapshot/aws-appconfig-environment.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.js.snapshot/aws-appconfig-environment.assets.json index 8ffcd1a6d5b6d..cdc65b59c1ce0 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.js.snapshot/aws-appconfig-environment.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.js.snapshot/aws-appconfig-environment.assets.json @@ -1,7 +1,7 @@ { - "version": "36.0.0", + "version": "39.0.0", "files": { - "6ec3a45c455c20f3072a3622b3e548aa72a4c1b8e5a1fac757962194d9f1c82d": { + "8b5317b754f85f2bf23708deb5bed067016cee6070da8f8fdf848daf7d5e028c": { "source": { "path": "aws-appconfig-environment.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "6ec3a45c455c20f3072a3622b3e548aa72a4c1b8e5a1fac757962194d9f1c82d.json", + "objectKey": "8b5317b754f85f2bf23708deb5bed067016cee6070da8f8fdf848daf7d5e028c.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-appconfig/test/integ.environment.js.snapshot/aws-appconfig-environment.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.js.snapshot/aws-appconfig-environment.template.json index ea327d13d23c1..6d109a20eb71e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.js.snapshot/aws-appconfig-environment.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.js.snapshot/aws-appconfig-environment.template.json @@ -126,6 +126,7 @@ "ApplicationId": { "Ref": "MyApplicationForEnv1F597ED9" }, + "DeletionProtectionCheck": "ACCOUNT_DEFAULT", "Description": "This is the environment for integ testing", "Monitors": [ { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.js.snapshot/cdk.out index 1f0068d32659a..91e1a8b9901d5 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"36.0.0"} \ No newline at end of file +{"version":"39.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.js.snapshot/integ.json index c314a395d9c88..49e33ed13ba49 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "39.0.0", "testCases": { "appconfig-environment/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.js.snapshot/manifest.json index e21ade66747e8..7d7faf972f4ea 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "39.0.0", "artifacts": { "aws-appconfig-environment.assets": { "type": "cdk:asset-manifest", @@ -18,7 +18,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}/6ec3a45c455c20f3072a3622b3e548aa72a4c1b8e5a1fac757962194d9f1c82d.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/8b5317b754f85f2bf23708deb5bed067016cee6070da8f8fdf848daf7d5e028c.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -105,15 +105,6 @@ "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } - ], - "MyConfigDeployment36077E0B58611": [ - { - "type": "aws:cdk:logicalId", - "data": "MyConfigDeployment36077E0B58611", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] - } ] }, "displayName": "aws-appconfig-environment" diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.js.snapshot/tree.json index fd96c532cfa58..0e8689629772d 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.js.snapshot/tree.json @@ -22,14 +22,14 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_appconfig.CfnApplication", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.4.2" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-appconfig-alpha.Application", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.4.2" } }, "StartDeploymentCallCountAlarm": { @@ -69,14 +69,14 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.4.2" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.4.2" } }, "MyRole": { @@ -87,8 +87,8 @@ "id": "ImportMyRole", "path": "aws-appconfig-environment/MyRole/ImportMyRole", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.4.2" } }, "Resource": { @@ -127,14 +127,14 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.4.2" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.4.2" } }, "MyCompositeAlarm": { @@ -166,14 +166,14 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_cloudwatch.CfnCompositeAlarm", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.4.2" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_cloudwatch.CompositeAlarm", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.4.2" } }, "MyEnvironment": { @@ -188,8 +188,8 @@ "id": "ImportRole1963C", "path": "aws-appconfig-environment/MyEnvironment/Role1963C/ImportRole1963C", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.4.2" } }, "Resource": { @@ -228,14 +228,14 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.4.2" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.4.2" } }, "Resource": { @@ -247,6 +247,7 @@ "applicationId": { "Ref": "MyApplicationForEnv1F597ED9" }, + "deletionProtectionCheck": "ACCOUNT_DEFAULT", "description": "This is the environment for integ testing", "monitors": [ { @@ -296,14 +297,14 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_appconfig.CfnEnvironment", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.4.2" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-appconfig-alpha.Environment", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.4.2" } }, "MyDeploymentStrategy": { @@ -324,14 +325,14 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_appconfig.CfnDeploymentStrategy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.4.2" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-appconfig-alpha.DeploymentStrategy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.4.2" } }, "MyConfig": { @@ -352,8 +353,8 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_appconfig.CfnConfigurationProfile", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.4.2" } }, "Resource": { @@ -373,8 +374,8 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_appconfig.CfnHostedConfigurationVersion", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.4.2" } }, "Deployment1963C": { @@ -401,36 +402,36 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_appconfig.CfnDeployment", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.4.2" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-appconfig-alpha.HostedConfiguration", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.4.2" } }, "BootstrapVersion": { "id": "BootstrapVersion", "path": "aws-appconfig-environment/BootstrapVersion", "constructInfo": { - "fqn": "aws-cdk-lib.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.4.2" } }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", "path": "aws-appconfig-environment/CheckBootstrapVersion", "constructInfo": { - "fqn": "aws-cdk-lib.CfnRule", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.4.2" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.Stack", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.4.2" } }, "appconfig-environment": { @@ -446,7 +447,7 @@ "path": "appconfig-environment/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.4.2" } }, "DeployAssert": { @@ -457,22 +458,22 @@ "id": "BootstrapVersion", "path": "appconfig-environment/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { - "fqn": "aws-cdk-lib.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.4.2" } }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", "path": "appconfig-environment/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { - "fqn": "aws-cdk-lib.CfnRule", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.4.2" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.Stack", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.4.2" } } }, @@ -492,13 +493,13 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.4.2" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.App", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.4.2" } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.ts index e9c8b1bc81e60..aa11622386de7 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.environment.ts @@ -2,7 +2,7 @@ import { IntegTest } from '@aws-cdk/integ-tests-alpha'; import { App, Duration, PhysicalName, Stack } from 'aws-cdk-lib'; import { Alarm, ComparisonOperator, CompositeAlarm, Metric, TreatMissingData } from 'aws-cdk-lib/aws-cloudwatch'; import { Role, ServicePrincipal, Effect, PolicyStatement, PolicyDocument } from 'aws-cdk-lib/aws-iam'; -import { Application, ConfigurationContent, DeploymentStrategy, Environment, HostedConfiguration, Monitor, RolloutStrategy } from 'aws-cdk-lib/aws-appconfig'; +import { Application, ConfigurationContent, DeletionProtectionCheck, DeploymentStrategy, Environment, HostedConfiguration, Monitor, RolloutStrategy } from 'aws-cdk-lib/aws-appconfig'; const app = new App(); @@ -54,6 +54,7 @@ const compositeAlarm = new CompositeAlarm(stack, 'MyCompositeAlarm', { const env = new Environment(stack, 'MyEnvironment', { application: appForEnv, description: 'This is the environment for integ testing', + deletionProtectionCheck: DeletionProtectionCheck.ACCOUNT_DEFAULT, monitors: [ Monitor.fromCloudWatchAlarm(alarm), Monitor.fromCfnMonitorsProperty({ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.js.snapshot/DashboardAndWidgetWithStartAndEnd.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.js.snapshot/DashboardAndWidgetWithStartAndEnd.assets.json index 048b1a92a7635..0716094f8358f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.js.snapshot/DashboardAndWidgetWithStartAndEnd.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.js.snapshot/DashboardAndWidgetWithStartAndEnd.assets.json @@ -1,7 +1,7 @@ { - "version": "34.0.0", + "version": "38.0.1", "files": { - "874df94f43f12341a3001f4b19d4e1bba754a4fc3a33c6a592ae6c265fc99a44": { + "ffda0354b028815a1953777c34e49bbf4ec8eb0eb04ccd47e60eff77dbcefe33": { "source": { "path": "DashboardAndWidgetWithStartAndEnd.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "874df94f43f12341a3001f4b19d4e1bba754a4fc3a33c6a592ae6c265fc99a44.json", + "objectKey": "ffda0354b028815a1953777c34e49bbf4ec8eb0eb04ccd47e60eff77dbcefe33.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-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.js.snapshot/DashboardAndWidgetWithStartAndEnd.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.js.snapshot/DashboardAndWidgetWithStartAndEnd.template.json index 9ff3f1cedf6cc..8f7e608fdb1e3 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.js.snapshot/DashboardAndWidgetWithStartAndEnd.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.js.snapshot/DashboardAndWidgetWithStartAndEnd.template.json @@ -11,15 +11,15 @@ { "Ref": "AWS::Region" }, - "\",\"metrics\":[[\"CDK/Test\",\"Metric\"]],\"start\":\"-P7D\",\"end\":\"2018-12-17T06:00:00.000Z\"}},{\"type\":\"metric\",\"width\":6,\"height\":6,\"x\":0,\"y\":3,\"properties\":{\"view\":\"timeSeries\",\"region\":\"", + "\",\"metrics\":[[\"CDK/Test\",\"Metric\",{\"accountId\":\"1234\",\"region\":\"us-north-5\"}]],\"start\":\"-P7D\",\"end\":\"2018-12-17T06:00:00.000Z\"}},{\"type\":\"metric\",\"width\":6,\"height\":6,\"x\":0,\"y\":3,\"properties\":{\"view\":\"timeSeries\",\"region\":\"", { "Ref": "AWS::Region" }, - "\",\"metrics\":[[\"CDK/Test\",\"Metric\"]],\"yAxis\":{},\"start\":\"-P7D\",\"end\":\"2018-12-17T06:00:00.000Z\"}},{\"type\":\"metric\",\"width\":6,\"height\":6,\"x\":0,\"y\":9,\"properties\":{\"view\":\"gauge\",\"region\":\"", + "\",\"metrics\":[[\"CDK/Test\",\"Metric\",{\"accountId\":\"1234\",\"region\":\"us-north-5\"}]],\"yAxis\":{},\"start\":\"-P7D\",\"end\":\"2018-12-17T06:00:00.000Z\"}},{\"type\":\"metric\",\"width\":6,\"height\":6,\"x\":0,\"y\":9,\"properties\":{\"view\":\"gauge\",\"region\":\"", { "Ref": "AWS::Region" }, - "\",\"metrics\":[[\"CDK/Test\",\"Metric\"]],\"yAxis\":{\"left\":{\"min\":0,\"max\":100}},\"start\":\"-P7D\",\"end\":\"2018-12-17T06:00:00.000Z\"}}]}" + "\",\"metrics\":[[\"CDK/Test\",\"Metric\",{\"accountId\":\"1234\",\"region\":\"us-north-5\"}]],\"yAxis\":{\"left\":{\"min\":0,\"max\":100}},\"start\":\"-P7D\",\"end\":\"2018-12-17T06:00:00.000Z\"}}]}" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.js.snapshot/cdk.out index 2313ab5436501..c6e612584e352 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"34.0.0"} \ No newline at end of file +{"version":"38.0.1"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.js.snapshot/cdkintegdashboardandwidgetwithstartandendDefaultTestDeployAssert4D8483F4.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.js.snapshot/cdkintegdashboardandwidgetwithstartandendDefaultTestDeployAssert4D8483F4.assets.json index eff956f039962..382c5bbbce8d5 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.js.snapshot/cdkintegdashboardandwidgetwithstartandendDefaultTestDeployAssert4D8483F4.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.js.snapshot/cdkintegdashboardandwidgetwithstartandendDefaultTestDeployAssert4D8483F4.assets.json @@ -1,5 +1,5 @@ { - "version": "34.0.0", + "version": "38.0.1", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.js.snapshot/integ.json index 0ef12514015b1..f68abd5b184d3 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "34.0.0", + "version": "38.0.1", "testCases": { "cdk-integ-dashboard-and-widget-with-start-and-end/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.js.snapshot/manifest.json index da40c03020eed..2a45f59d0938e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "34.0.0", + "version": "38.0.1", "artifacts": { "DashboardAndWidgetWithStartAndEnd.assets": { "type": "cdk:asset-manifest", @@ -14,10 +14,11 @@ "environment": "aws://unknown-account/unknown-region", "properties": { "templateFile": "DashboardAndWidgetWithStartAndEnd.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}/874df94f43f12341a3001f4b19d4e1bba754a4fc3a33c6a592ae6c265fc99a44.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/ffda0354b028815a1953777c34e49bbf4ec8eb0eb04ccd47e60eff77dbcefe33.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -67,6 +68,7 @@ "environment": "aws://unknown-account/unknown-region", "properties": { "templateFile": "cdkintegdashboardandwidgetwithstartandendDefaultTestDeployAssert4D8483F4.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}", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.js.snapshot/tree.json index dec19d3db0811..397fccf676f79 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.js.snapshot/tree.json @@ -26,15 +26,15 @@ { "Ref": "AWS::Region" }, - "\",\"metrics\":[[\"CDK/Test\",\"Metric\"]],\"start\":\"-P7D\",\"end\":\"2018-12-17T06:00:00.000Z\"}},{\"type\":\"metric\",\"width\":6,\"height\":6,\"x\":0,\"y\":3,\"properties\":{\"view\":\"timeSeries\",\"region\":\"", + "\",\"metrics\":[[\"CDK/Test\",\"Metric\",{\"accountId\":\"1234\",\"region\":\"us-north-5\"}]],\"start\":\"-P7D\",\"end\":\"2018-12-17T06:00:00.000Z\"}},{\"type\":\"metric\",\"width\":6,\"height\":6,\"x\":0,\"y\":3,\"properties\":{\"view\":\"timeSeries\",\"region\":\"", { "Ref": "AWS::Region" }, - "\",\"metrics\":[[\"CDK/Test\",\"Metric\"]],\"yAxis\":{},\"start\":\"-P7D\",\"end\":\"2018-12-17T06:00:00.000Z\"}},{\"type\":\"metric\",\"width\":6,\"height\":6,\"x\":0,\"y\":9,\"properties\":{\"view\":\"gauge\",\"region\":\"", + "\",\"metrics\":[[\"CDK/Test\",\"Metric\",{\"accountId\":\"1234\",\"region\":\"us-north-5\"}]],\"yAxis\":{},\"start\":\"-P7D\",\"end\":\"2018-12-17T06:00:00.000Z\"}},{\"type\":\"metric\",\"width\":6,\"height\":6,\"x\":0,\"y\":9,\"properties\":{\"view\":\"gauge\",\"region\":\"", { "Ref": "AWS::Region" }, - "\",\"metrics\":[[\"CDK/Test\",\"Metric\"]],\"yAxis\":{\"left\":{\"min\":0,\"max\":100}},\"start\":\"-P7D\",\"end\":\"2018-12-17T06:00:00.000Z\"}}]}" + "\",\"metrics\":[[\"CDK/Test\",\"Metric\",{\"accountId\":\"1234\",\"region\":\"us-north-5\"}]],\"yAxis\":{\"left\":{\"min\":0,\"max\":100}},\"start\":\"-P7D\",\"end\":\"2018-12-17T06:00:00.000Z\"}}]}" ] ] } @@ -86,7 +86,7 @@ "path": "cdk-integ-dashboard-and-widget-with-start-and-end/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.70" + "version": "10.4.2" } }, "DeployAssert": { @@ -132,7 +132,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.70" + "version": "10.4.2" } } }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.ts index 280845d4e60ab..38e68985deb12 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-and-widget-with-start-and-end.ts @@ -11,6 +11,8 @@ class TestStack extends Stack { const testMetric = new Metric({ namespace: 'CDK/Test', metricName: 'Metric', + account: '1234', + region: 'us-north-5', }); const singleValueWidget = new SingleValueWidget({ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.alb-ecs-service-command-entry-point.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.alb-ecs-service-command-entry-point.ts index 2983ad23728fc..bdbcbf8d8b006 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.alb-ecs-service-command-entry-point.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.alb-ecs-service-command-entry-point.ts @@ -8,6 +8,8 @@ import * as ecsPatterns from 'aws-cdk-lib/aws-ecs-patterns'; const app = new cdk.App({ postCliContext: { '@aws-cdk/aws-ecs:removeDefaultDeploymentAlarm': true, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, }, }); const stack = new cdk.Stack(app, 'aws-ecs-integ-alb-ec2-cmd-entrypoint'); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.application-load-balanced-ecs-service.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.application-load-balanced-ecs-service.ts index b765af9dd41df..cb8e0bf60983c 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.application-load-balanced-ecs-service.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.application-load-balanced-ecs-service.ts @@ -6,7 +6,12 @@ import * as integ from '@aws-cdk/integ-tests-alpha'; import { ApplicationLoadBalancedEc2Service } from 'aws-cdk-lib/aws-ecs-patterns'; import * as elbv2 from 'aws-cdk-lib/aws-elasticloadbalancingv2'; -const app = new App(); +const app = new App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new Stack(app, 'aws-ecs-integ-alb'); const vpc = new Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false }); const cluster = new Cluster(stack, 'Cluster', { vpc }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.healthchecks-multiple-application-load-balanced-ecs-service.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.healthchecks-multiple-application-load-balanced-ecs-service.ts index 09c61744a0ad1..3681f8d4a5ab7 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.healthchecks-multiple-application-load-balanced-ecs-service.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.healthchecks-multiple-application-load-balanced-ecs-service.ts @@ -7,7 +7,12 @@ import { IntegTest } from '@aws-cdk/integ-tests-alpha'; import { ApplicationMultipleTargetGroupsEc2Service } from 'aws-cdk-lib/aws-ecs-patterns'; -const app = new App(); +const app = new App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new Stack(app, 'aws-ecs-integ-multiple-alb-healthchecks'); const vpc = new Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false }); const cluster = new Cluster(stack, 'Cluster', { vpc }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.healthchecks-multiple-network-load-balanced-ecs-service.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.healthchecks-multiple-network-load-balanced-ecs-service.ts index 26172a7ec9bf7..eb7ba7af9649f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.healthchecks-multiple-network-load-balanced-ecs-service.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.healthchecks-multiple-network-load-balanced-ecs-service.ts @@ -5,7 +5,12 @@ import { App, Stack } from 'aws-cdk-lib'; import { IntegTest } from '@aws-cdk/integ-tests-alpha'; import { NetworkMultipleTargetGroupsEc2Service } from 'aws-cdk-lib/aws-ecs-patterns'; -const app = new App(); +const app = new App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new Stack(app, 'aws-ecs-integ-nlb-healthchecks'); const vpc = new Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false }); const cluster = new Cluster(stack, 'Cluster', { vpc }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.multiple-application-load-balanced-ecs-service-idle-timeout.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.multiple-application-load-balanced-ecs-service-idle-timeout.ts index 38e51b7d64a87..f83d722c97b29 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.multiple-application-load-balanced-ecs-service-idle-timeout.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.multiple-application-load-balanced-ecs-service-idle-timeout.ts @@ -12,6 +12,8 @@ const app = new App({ postCliContext: { '@aws-cdk/aws-ecs:removeDefaultDeploymentAlarm': false, '@aws-cdk/aws-ecs:reduceEc2FargateCloudWatchPermissions': false, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, }, }); const stack = new Stack(app, 'aws-ecs-integ-alb-idle-timeout'); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.multiple-application-load-balanced-ecs-service.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.multiple-application-load-balanced-ecs-service.ts index dfbaf2e4e5f42..3788182dc2957 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.multiple-application-load-balanced-ecs-service.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.multiple-application-load-balanced-ecs-service.ts @@ -9,6 +9,8 @@ const app = new App({ postCliContext: { [AUTOSCALING_GENERATE_LAUNCH_TEMPLATE]: false, [REDUCE_EC2_FARGATE_CLOUDWATCH_PERMISSIONS]: false, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, }, }); const stack = new Stack(app, 'aws-ecs-integ-multiple-alb'); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.network-load-balanced-ecs-service.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.network-load-balanced-ecs-service.ts index 8c3bdeff260c7..0b9f2abe9756e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.network-load-balanced-ecs-service.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.network-load-balanced-ecs-service.ts @@ -6,7 +6,12 @@ import * as integ from '@aws-cdk/integ-tests-alpha'; import { NetworkLoadBalancedEc2Service } from 'aws-cdk-lib/aws-ecs-patterns'; import { IpAddressType } from 'aws-cdk-lib/aws-elasticloadbalancingv2'; -const app = new App(); +const app = new App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new Stack(app, 'aws-ecs-integ-nlb'); const vpc = new Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false }); const cluster = new Cluster(stack, 'Cluster', { vpc }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.scheduled-ecs-task.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.scheduled-ecs-task.ts index fa37055b431f3..8460098c3c87c 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.scheduled-ecs-task.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.scheduled-ecs-task.ts @@ -5,7 +5,12 @@ import * as cdk from 'aws-cdk-lib'; import * as integ from '@aws-cdk/integ-tests-alpha'; import { ScheduledEc2Task } from 'aws-cdk-lib/aws-ecs-patterns'; -const app = new cdk.App(); +const app = new cdk.App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); class EventStack extends cdk.Stack { constructor(scope: cdk.App, id: string) { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.tls-network-load-balanced-ecs-service.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.tls-network-load-balanced-ecs-service.ts index 893295167780d..26254a735f8e9 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.tls-network-load-balanced-ecs-service.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.tls-network-load-balanced-ecs-service.ts @@ -11,7 +11,12 @@ import { Certificate } from 'aws-cdk-lib/aws-certificatemanager'; const certArn = process.env.CDK_INTEG_CERT_ARN || process.env.CERT_ARN; if (!certArn) throw new Error('For this test you must provide your own Certificate as an env var "CERT_ARN". See framework-integ/README.md for details.'); -const app = new App(); +const app = new App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new Stack(app, 'tls-network-load-balanced-ecs-service'); const vpc = new Vpc(stack, 'Vpc', { maxAzs: 2 }); const cluster = new Cluster(stack, 'Cluster', { vpc }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.app-mesh-proxy-config.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.app-mesh-proxy-config.ts index ae71fd9d78f76..7bd89d55cccc8 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.app-mesh-proxy-config.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.app-mesh-proxy-config.ts @@ -2,7 +2,12 @@ import * as ec2 from 'aws-cdk-lib/aws-ec2'; import * as cdk from 'aws-cdk-lib'; import * as ecs from 'aws-cdk-lib/aws-ecs'; -const app = new cdk.App(); +const app = new cdk.App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new cdk.Stack(app, 'aws-ecs-integ-appmesh-proxy'); // Create a cluster diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.capacity-provider-managed-draining.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.capacity-provider-managed-draining.ts index 1f7fff205d7ee..6675d688954e0 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.capacity-provider-managed-draining.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.capacity-provider-managed-draining.ts @@ -7,6 +7,8 @@ import * as integ from '@aws-cdk/integ-tests-alpha'; const app = new cdk.App({ postCliContext: { '@aws-cdk/aws-ecs:removeDefaultDeploymentAlarm': true, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, }, }); const stack = new cdk.Stack(app, 'integ-ec2-capacity-provider-managed-draining'); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.capacity-provider.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.capacity-provider.ts index 8bbb65a470a8e..e6f9333b79ec4 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.capacity-provider.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.capacity-provider.ts @@ -3,7 +3,12 @@ import * as ec2 from 'aws-cdk-lib/aws-ec2'; import * as cdk from 'aws-cdk-lib'; import * as ecs from 'aws-cdk-lib/aws-ecs'; -const app = new cdk.App(); +const app = new cdk.App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new cdk.Stack(app, 'integ-ec2-capacity-provider'); const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.clb-host-nw.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.clb-host-nw.ts index 223a9929d6f84..17f7bc2022961 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.clb-host-nw.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.clb-host-nw.ts @@ -3,7 +3,12 @@ import * as elb from 'aws-cdk-lib/aws-elasticloadbalancing'; import * as cdk from 'aws-cdk-lib'; import * as ecs from 'aws-cdk-lib/aws-ecs'; -const app = new cdk.App(); +const app = new cdk.App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new cdk.Stack(app, 'aws-ecs-integ'); const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.cloudmap-container-port.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.cloudmap-container-port.ts index ba0c009dfa425..0882ca3f65181 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.cloudmap-container-port.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.cloudmap-container-port.ts @@ -3,7 +3,12 @@ import * as cloudmap from 'aws-cdk-lib/aws-servicediscovery'; import * as cdk from 'aws-cdk-lib'; import * as ecs from 'aws-cdk-lib/aws-ecs'; -const app = new cdk.App(); +const app = new cdk.App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new cdk.Stack(app, 'aws-ecs-integ'); const vpc = new ec2.Vpc(stack, 'Vpc', { restrictDefaultSecurityGroup: false, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.default-capacity-provider.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.default-capacity-provider.ts index 6cea48957a5fb..bda14d047446b 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.default-capacity-provider.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.default-capacity-provider.ts @@ -4,7 +4,12 @@ import * as cdk from 'aws-cdk-lib'; import * as integ from '@aws-cdk/integ-tests-alpha'; import * as ecs from 'aws-cdk-lib/aws-ecs'; -const app = new cdk.App(); +const app = new cdk.App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new cdk.Stack(app, 'integ-default-capacity-provider'); const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.deployment-alarms.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.deployment-alarms.ts index 6e5dfebfa4f9c..6e5ca339d20a8 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.deployment-alarms.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.deployment-alarms.ts @@ -5,7 +5,12 @@ import * as cdk from 'aws-cdk-lib'; import * as integ from '@aws-cdk/integ-tests-alpha'; import * as ecs from 'aws-cdk-lib/aws-ecs'; -const app = new cdk.App(); +const app = new cdk.App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new cdk.Stack(app, 'integ-deployment-alarms'); const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2 }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.enable-execute-command.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.enable-execute-command.ts index fe6e9a8404470..662b57b40c399 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.enable-execute-command.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.enable-execute-command.ts @@ -9,6 +9,8 @@ import * as ecs from 'aws-cdk-lib/aws-ecs'; const app = new cdk.App({ postCliContext: { '@aws-cdk/aws-ecs:reduceEc2FargateCloudWatchPermissions': true, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, }, }); const stack = new cdk.Stack(app, 'aws-ecs-integ-enable-execute-command'); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.environment-file.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.environment-file.ts index 2a862f4de6c19..627fbb6746dc6 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.environment-file.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.environment-file.ts @@ -7,7 +7,12 @@ import * as cdk from 'aws-cdk-lib'; import * as ecs from 'aws-cdk-lib/aws-ecs'; import { IntegTest } from '@aws-cdk/integ-tests-alpha'; -const app = new cdk.App(); +const app = new cdk.App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new cdk.Stack(app, 'aws-ecs-integ'); // S3 bucket to host envfile without public access diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.exec-command.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.exec-command.ts index 1cbfe8c447394..2afd7db903d4b 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.exec-command.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.exec-command.ts @@ -5,7 +5,12 @@ import * as s3 from 'aws-cdk-lib/aws-s3'; import * as cdk from 'aws-cdk-lib'; import * as ecs from 'aws-cdk-lib/aws-ecs'; -const app = new cdk.App(); +const app = new cdk.App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new cdk.Stack(app, 'aws-ecs-integ-exec-command'); const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.firelens-s3-config.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.firelens-s3-config.ts index d026759ee68e7..54bc029a6ed43 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.firelens-s3-config.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.firelens-s3-config.ts @@ -4,7 +4,12 @@ import * as s3_assets from 'aws-cdk-lib/aws-s3-assets'; import * as cdk from 'aws-cdk-lib'; import * as ecs from 'aws-cdk-lib/aws-ecs'; -const app = new cdk.App(); +const app = new cdk.App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new cdk.Stack(app, 'aws-ecs-integ'); const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false }); const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.graviton.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.graviton.ts index 7c280aff6ae80..79bc54cf617b6 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.graviton.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.graviton.ts @@ -2,7 +2,12 @@ import * as ec2 from 'aws-cdk-lib/aws-ec2'; import * as cdk from 'aws-cdk-lib'; import * as ecs from 'aws-cdk-lib/aws-ecs'; -const app = new cdk.App(); +const app = new cdk.App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new cdk.Stack(app, 'aws-ecs-integ'); const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.lb-awsvpc-nw.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.lb-awsvpc-nw.ts index 8667d63c7c143..20c4c4168afe7 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.lb-awsvpc-nw.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.lb-awsvpc-nw.ts @@ -3,7 +3,12 @@ import * as elbv2 from 'aws-cdk-lib/aws-elasticloadbalancingv2'; import * as cdk from 'aws-cdk-lib'; import * as ecs from 'aws-cdk-lib/aws-ecs'; -const app = new cdk.App(); +const app = new cdk.App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new cdk.Stack(app, 'aws-ecs-integ'); const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.lb-bridge-nw.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.lb-bridge-nw.ts index 93a7a3d465aa1..1baa11f71a67f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.lb-bridge-nw.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.lb-bridge-nw.ts @@ -4,7 +4,12 @@ import * as elbv2 from 'aws-cdk-lib/aws-elasticloadbalancingv2'; import * as cdk from 'aws-cdk-lib'; import * as ecs from 'aws-cdk-lib/aws-ecs'; -const app = new cdk.App(); +const app = new cdk.App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new cdk.Stack(app, 'aws-ecs-integ-ecs'); const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.placement-constraint-default-empty.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.placement-constraint-default-empty.ts index 873f168670aeb..5f6d5ce3731df 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.placement-constraint-default-empty.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.placement-constraint-default-empty.ts @@ -4,7 +4,12 @@ import { Construct } from 'constructs'; import * as ecs from 'aws-cdk-lib/aws-ecs'; import { IntegTest } from '@aws-cdk/integ-tests-alpha'; -const app = new cdk.App(); +const app = new cdk.App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); // WHEN class EcsStack extends cdk.Stack { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.placement-strategies.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.placement-strategies.ts index 92350f2b710e2..ce17e5db4ac13 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.placement-strategies.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.placement-strategies.ts @@ -3,7 +3,12 @@ import * as cdk from 'aws-cdk-lib'; import { Construct } from 'constructs'; import * as ecs from 'aws-cdk-lib/aws-ecs'; -const app = new cdk.App(); +const app = new cdk.App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); class EcsStack extends cdk.Stack { constructor(scope: Construct, id: string, props?: cdk.StackProps) { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.pseudo-terminal.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.pseudo-terminal.ts index dd396281e86fb..9a3cc9c943262 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.pseudo-terminal.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.pseudo-terminal.ts @@ -3,7 +3,12 @@ import * as cdk from 'aws-cdk-lib'; import * as integ from '@aws-cdk/integ-tests-alpha'; import * as ecs from 'aws-cdk-lib/aws-ecs'; -const app = new cdk.App(); +const app = new cdk.App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new cdk.Stack(app, 'aws-ecs-integ-pseudo-terminal'); // Create a cluster diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.sd-awsvpc-nw.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.sd-awsvpc-nw.ts index 4a3923cf384bf..ef3ed277e88d3 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.sd-awsvpc-nw.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.sd-awsvpc-nw.ts @@ -2,7 +2,12 @@ import * as ec2 from 'aws-cdk-lib/aws-ec2'; import * as cdk from 'aws-cdk-lib'; import * as ecs from 'aws-cdk-lib/aws-ecs'; -const app = new cdk.App(); +const app = new cdk.App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new cdk.Stack(app, 'aws-ecs-integ-ecs'); const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.sd-bridge-nw.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.sd-bridge-nw.ts index 0e6d11b6fe8d7..09b26a9e12a6b 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.sd-bridge-nw.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.sd-bridge-nw.ts @@ -2,7 +2,12 @@ import * as ec2 from 'aws-cdk-lib/aws-ec2'; import * as cdk from 'aws-cdk-lib'; import * as ecs from 'aws-cdk-lib/aws-ecs'; -const app = new cdk.App(); +const app = new cdk.App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new cdk.Stack(app, 'aws-ecs-integ-ecs'); const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.spot-drain.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.spot-drain.ts index c5a49abdec8a5..818fffcd59576 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.spot-drain.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.spot-drain.ts @@ -2,7 +2,12 @@ import * as ec2 from 'aws-cdk-lib/aws-ec2'; import * as cdk from 'aws-cdk-lib'; import * as ecs from 'aws-cdk-lib/aws-ecs'; -const app = new cdk.App(); +const app = new cdk.App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new cdk.Stack(app, 'aws-ecs-integ-spot'); const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.swap-parameters.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.swap-parameters.ts index 8ce87e7240f50..680d22d9b3e4d 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.swap-parameters.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.swap-parameters.ts @@ -4,7 +4,12 @@ import * as integ from '@aws-cdk/integ-tests-alpha'; import * as ecs from 'aws-cdk-lib/aws-ecs'; import { LinuxParameters } from 'aws-cdk-lib/aws-ecs'; -const app = new cdk.App(); +const app = new cdk.App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new cdk.Stack(app, 'aws-ecs-integ'); const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.task-definition-placement-constraints.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.task-definition-placement-constraints.ts index 84170fdce75ee..0c55c74456a39 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.task-definition-placement-constraints.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.task-definition-placement-constraints.ts @@ -3,7 +3,12 @@ import * as ecs from 'aws-cdk-lib/aws-ecs'; import * as ec2 from 'aws-cdk-lib/aws-ec2'; import { IntegTest } from '@aws-cdk/integ-tests-alpha'; -const app = new cdk.App(); +const app = new cdk.App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new cdk.Stack(app, 'aws-cdk-ecs-integration-test-stack'); const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2 }); const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-amazonlinux2-neuron-ami.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-amazonlinux2-neuron-ami.ts index d5c6ec7036d74..8199e582c5c3c 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-amazonlinux2-neuron-ami.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-amazonlinux2-neuron-ami.ts @@ -4,7 +4,12 @@ import * as cdk from 'aws-cdk-lib'; import * as ecs from 'aws-cdk-lib/aws-ecs'; import * as integ from '@aws-cdk/integ-tests-alpha'; -const app = new cdk.App(); +const app = new cdk.App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new cdk.Stack(app, 'integ-ecs-neuron-ami'); const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-imported.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-imported.ts index 9bb84fd52424f..ed15bf7804937 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-imported.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-imported.ts @@ -4,7 +4,12 @@ import * as cdk from 'aws-cdk-lib'; import * as ecs from 'aws-cdk-lib/aws-ecs'; import * as integ from '@aws-cdk/integ-tests-alpha'; -const app = new cdk.App(); +const app = new cdk.App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new cdk.Stack(app, 'integ-ecs-imported-cluster'); const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-windows-server-ami.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-windows-server-ami.ts index b55d07c270705..9e5c97cff801c 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-windows-server-ami.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-windows-server-ami.ts @@ -5,7 +5,12 @@ import * as cdk from 'aws-cdk-lib'; import * as ecs from 'aws-cdk-lib/aws-ecs'; import * as integ from '@aws-cdk/integ-tests-alpha'; -const app = new cdk.App(); +const app = new cdk.App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new cdk.Stack(app, 'integ-ecs-windows-server-ami'); const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 1 }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster.amazonlinux2023-ami.js.snapshot/ClusterAL2023DefaultTestDeployAssert19111415.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster.amazonlinux2023-ami.js.snapshot/ClusterAL2023DefaultTestDeployAssert19111415.assets.json new file mode 100644 index 0000000000000..ee34f51b00bf4 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster.amazonlinux2023-ami.js.snapshot/ClusterAL2023DefaultTestDeployAssert19111415.assets.json @@ -0,0 +1,19 @@ +{ + "version": "38.0.1", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "ClusterAL2023DefaultTestDeployAssert19111415.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-ecs/test/integ.cluster.amazonlinux2023-ami.js.snapshot/ClusterAL2023DefaultTestDeployAssert19111415.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster.amazonlinux2023-ami.js.snapshot/ClusterAL2023DefaultTestDeployAssert19111415.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster.amazonlinux2023-ami.js.snapshot/ClusterAL2023DefaultTestDeployAssert19111415.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-ecs/test/integ.cluster.amazonlinux2023-ami.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster.amazonlinux2023-ami.js.snapshot/cdk.out new file mode 100644 index 0000000000000..c6e612584e352 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster.amazonlinux2023-ami.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"38.0.1"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster.amazonlinux2023-ami.js.snapshot/integ-ecs-al2023-ami.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster.amazonlinux2023-ami.js.snapshot/integ-ecs-al2023-ami.assets.json new file mode 100644 index 0000000000000..dc91f134d9af6 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster.amazonlinux2023-ami.js.snapshot/integ-ecs-al2023-ami.assets.json @@ -0,0 +1,19 @@ +{ + "version": "38.0.1", + "files": { + "f875639342074982d90d3f026dd2a665ec32849787c8c2fee81f9a8dd2f1f58d": { + "source": { + "path": "integ-ecs-al2023-ami.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "f875639342074982d90d3f026dd2a665ec32849787c8c2fee81f9a8dd2f1f58d.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-ecs/test/integ.cluster.amazonlinux2023-ami.js.snapshot/integ-ecs-al2023-ami.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster.amazonlinux2023-ami.js.snapshot/integ-ecs-al2023-ami.template.json new file mode 100644 index 0000000000000..13f9ef83aa094 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster.amazonlinux2023-ami.js.snapshot/integ-ecs-al2023-ami.template.json @@ -0,0 +1,827 @@ +{ + "Resources": { + "Vpc8378EB38": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "integ-ecs-al2023-ami/Vpc" + } + ] + } + }, + "VpcPublicSubnet1Subnet5C2D37C4": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.0.0/17", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "integ-ecs-al2023-ami/Vpc/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcPublicSubnet1RouteTable6C95E38E": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "integ-ecs-al2023-ami/Vpc/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcPublicSubnet1RouteTableAssociation97140677": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcPublicSubnet1RouteTable6C95E38E" + }, + "SubnetId": { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + } + } + }, + "VpcPublicSubnet1DefaultRoute3DA9E72A": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "RouteTableId": { + "Ref": "VpcPublicSubnet1RouteTable6C95E38E" + } + }, + "DependsOn": [ + "VpcVPCGWBF912B6E" + ] + }, + "VpcPublicSubnet1EIPD7E02669": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "integ-ecs-al2023-ami/Vpc/PublicSubnet1" + } + ] + } + }, + "VpcPublicSubnet1NATGateway4D7517AA": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "VpcPublicSubnet1EIPD7E02669", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "Tags": [ + { + "Key": "Name", + "Value": "integ-ecs-al2023-ami/Vpc/PublicSubnet1" + } + ] + }, + "DependsOn": [ + "VpcPublicSubnet1DefaultRoute3DA9E72A", + "VpcPublicSubnet1RouteTableAssociation97140677" + ] + }, + "VpcPrivateSubnet1Subnet536B997A": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.128.0/17", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "integ-ecs-al2023-ami/Vpc/PrivateSubnet1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcPrivateSubnet1RouteTableB2C5B500": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "integ-ecs-al2023-ami/Vpc/PrivateSubnet1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcPrivateSubnet1RouteTableAssociation70C59FA6": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcPrivateSubnet1RouteTableB2C5B500" + }, + "SubnetId": { + "Ref": "VpcPrivateSubnet1Subnet536B997A" + } + } + }, + "VpcPrivateSubnet1DefaultRouteBE02A9ED": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "VpcPublicSubnet1NATGateway4D7517AA" + }, + "RouteTableId": { + "Ref": "VpcPrivateSubnet1RouteTableB2C5B500" + } + } + }, + "VpcIGWD7BA715C": { + "Type": "AWS::EC2::InternetGateway", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "integ-ecs-al2023-ami/Vpc" + } + ] + } + }, + "VpcVPCGWBF912B6E": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "InternetGatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "ClusterEB0386A7": { + "Type": "AWS::ECS::Cluster" + }, + "Cluster3DA9CCBA": { + "Type": "AWS::ECS::ClusterCapacityProviderAssociations", + "Properties": { + "CapacityProviders": [ + { + "Ref": "EC2CapacityProvider5A2E35CD" + } + ], + "Cluster": { + "Ref": "ClusterEB0386A7" + }, + "DefaultCapacityProviderStrategy": [] + } + }, + "InstanceRole3CCE2F1D": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AmazonEC2ContainerServiceForEC2Role" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/AmazonSSMManagedInstanceCore" + ] + ] + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "InstanceRoleDefaultPolicy1531605C": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "cloudformation:SignalResource", + "Effect": "Allow", + "Resource": { + "Ref": "AWS::StackId" + } + }, + { + "Action": [ + "ecs:DeregisterContainerInstance", + "ecs:RegisterContainerInstance", + "ecs:Submit*" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ClusterEB0386A7", + "Arn" + ] + } + }, + { + "Action": [ + "ecs:Poll", + "ecs:StartTelemetrySession" + ], + "Condition": { + "ArnEquals": { + "ecs:cluster": { + "Fn::GetAtt": [ + "ClusterEB0386A7", + "Arn" + ] + } + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecr:GetAuthorizationToken", + "ecs:DiscoverPollEndpoint", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "InstanceRoleDefaultPolicy1531605C", + "Roles": [ + { + "Ref": "InstanceRole3CCE2F1D" + } + ] + } + }, + "ASGInstanceSecurityGroup0525485D": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "integ-ecs-al2023-ami/ASG/InstanceSecurityGroup", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "Name", + "Value": "integ-ecs-al2023-ami/ASG" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "ASGInstanceProfile0A2834D7": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "InstanceRole3CCE2F1D" + } + ] + } + }, + "ASGLaunchTemplate0CA92847": { + "Type": "AWS::EC2::LaunchTemplate", + "Properties": { + "LaunchTemplateData": { + "IamInstanceProfile": { + "Arn": { + "Fn::GetAtt": [ + "ASGInstanceProfile0A2834D7", + "Arn" + ] + } + }, + "ImageId": { + "Ref": "SsmParameterValueawsserviceecsoptimizedamiamazonlinux2023recommendedimageidC96584B6F00A464EAD1953AFF4B05118Parameter" + }, + "InstanceType": "t2.micro", + "Monitoring": { + "Enabled": false + }, + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "ASGInstanceSecurityGroup0525485D", + "GroupId" + ] + } + ], + "TagSpecifications": [ + { + "ResourceType": "instance", + "Tags": [ + { + "Key": "Name", + "Value": "integ-ecs-al2023-ami/ASG/LaunchTemplate" + } + ] + }, + { + "ResourceType": "volume", + "Tags": [ + { + "Key": "Name", + "Value": "integ-ecs-al2023-ami/ASG/LaunchTemplate" + } + ] + } + ], + "UserData": { + "Fn::Base64": { + "Fn::Join": [ + "", + [ + "#!/bin/bash\nset -x\nset -e\necho ECS_CLUSTER=", + { + "Ref": "ClusterEB0386A7" + }, + " >> /etc/ecs/ecs.config\nsudo yum install -y iptables-services; sudo iptables --insert DOCKER-USER 1 --in-interface docker+ --destination 169.254.169.254/32 --jump DROP\nsudo iptables-save | sudo tee /etc/sysconfig/iptables && sudo systemctl enable --now iptables\necho ECS_AWSVPC_BLOCK_IMDS=true >> /etc/ecs/ecs.config\nyum install -y aws-cfn-bootstrap\n/opt/aws/bin/cfn-signal -e $? --stack ", + { + "Ref": "AWS::StackId" + }, + " --resource ASG46ED3070 --region ", + { + "Ref": "AWS::Region" + } + ] + ] + } + } + }, + "TagSpecifications": [ + { + "ResourceType": "launch-template", + "Tags": [ + { + "Key": "Name", + "Value": "integ-ecs-al2023-ami/ASG/LaunchTemplate" + } + ] + } + ] + }, + "DependsOn": [ + "InstanceRoleDefaultPolicy1531605C", + "InstanceRole3CCE2F1D" + ] + }, + "ASG46ED3070": { + "Type": "AWS::AutoScaling::AutoScalingGroup", + "Properties": { + "LaunchTemplate": { + "LaunchTemplateId": { + "Ref": "ASGLaunchTemplate0CA92847" + }, + "Version": { + "Fn::GetAtt": [ + "ASGLaunchTemplate0CA92847", + "LatestVersionNumber" + ] + } + }, + "MaxSize": "1", + "MinSize": "1", + "Tags": [ + { + "Key": "Name", + "PropagateAtLaunch": true, + "Value": "integ-ecs-al2023-ami/ASG" + } + ], + "VPCZoneIdentifier": [ + { + "Ref": "VpcPrivateSubnet1Subnet536B997A" + } + ] + }, + "CreationPolicy": { + "ResourceSignal": { + "Count": 1, + "Timeout": "PT10M" + } + }, + "UpdatePolicy": { + "AutoScalingScheduledAction": { + "IgnoreUnmodifiedGroupSizeProperties": true + } + } + }, + "ASGDrainECSHookFunctionServiceRoleC12963BB": { + "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" + ] + ] + } + ], + "Tags": [ + { + "Key": "Name", + "Value": "integ-ecs-al2023-ami/ASG" + } + ] + } + }, + "ASGDrainECSHookFunctionServiceRoleDefaultPolicy16848A27": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ec2:DescribeHosts", + "ec2:DescribeInstanceAttribute", + "ec2:DescribeInstanceStatus", + "ec2:DescribeInstances" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "autoscaling:CompleteLifecycleAction", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":autoscaling:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":autoScalingGroup:*:autoScalingGroupName/", + { + "Ref": "ASG46ED3070" + } + ] + ] + } + }, + { + "Action": [ + "ecs:DescribeContainerInstances", + "ecs:DescribeTasks", + "ecs:ListTasks", + "ecs:UpdateContainerInstancesState" + ], + "Condition": { + "ArnEquals": { + "ecs:cluster": { + "Fn::GetAtt": [ + "ClusterEB0386A7", + "Arn" + ] + } + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecs:ListContainerInstances", + "ecs:SubmitContainerStateChange", + "ecs:SubmitTaskStateChange" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ClusterEB0386A7", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ASGDrainECSHookFunctionServiceRoleDefaultPolicy16848A27", + "Roles": [ + { + "Ref": "ASGDrainECSHookFunctionServiceRoleC12963BB" + } + ] + } + }, + "ASGDrainECSHookFunction5F24CF4D": { + "Type": "AWS::Lambda::Function", + "Properties": { + "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" + }, + "Environment": { + "Variables": { + "CLUSTER": { + "Ref": "ClusterEB0386A7" + } + } + }, + "Handler": "index.lambda_handler", + "Role": { + "Fn::GetAtt": [ + "ASGDrainECSHookFunctionServiceRoleC12963BB", + "Arn" + ] + }, + "Runtime": "python3.9", + "Tags": [ + { + "Key": "Name", + "Value": "integ-ecs-al2023-ami/ASG" + } + ], + "Timeout": 310 + }, + "DependsOn": [ + "ASGDrainECSHookFunctionServiceRoleDefaultPolicy16848A27", + "ASGDrainECSHookFunctionServiceRoleC12963BB" + ] + }, + "ASGDrainECSHookFunctionAllowInvokeintegecsal2023amiASGLifecycleHookDrainHookTopic083F299FF8F99189": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "ASGDrainECSHookFunction5F24CF4D", + "Arn" + ] + }, + "Principal": "sns.amazonaws.com", + "SourceArn": { + "Ref": "ASGLifecycleHookDrainHookTopicA8AD4ACB" + } + } + }, + "ASGDrainECSHookFunctionTopicD6FC59F7": { + "Type": "AWS::SNS::Subscription", + "Properties": { + "Endpoint": { + "Fn::GetAtt": [ + "ASGDrainECSHookFunction5F24CF4D", + "Arn" + ] + }, + "Protocol": "lambda", + "TopicArn": { + "Ref": "ASGLifecycleHookDrainHookTopicA8AD4ACB" + } + } + }, + "ASGLifecycleHookDrainHookTopicA8AD4ACB": { + "Type": "AWS::SNS::Topic", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "integ-ecs-al2023-ami/ASG" + } + ] + } + }, + "ASGLifecycleHookDrainHookRoleD640316C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "autoscaling.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "Name", + "Value": "integ-ecs-al2023-ami/ASG" + } + ] + } + }, + "ASGLifecycleHookDrainHookRoleDefaultPolicy3EEFDE57": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "sns:Publish", + "Effect": "Allow", + "Resource": { + "Ref": "ASGLifecycleHookDrainHookTopicA8AD4ACB" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ASGLifecycleHookDrainHookRoleDefaultPolicy3EEFDE57", + "Roles": [ + { + "Ref": "ASGLifecycleHookDrainHookRoleD640316C" + } + ] + } + }, + "ASGLifecycleHookDrainHookFE4AFEBE": { + "Type": "AWS::AutoScaling::LifecycleHook", + "Properties": { + "AutoScalingGroupName": { + "Ref": "ASG46ED3070" + }, + "DefaultResult": "CONTINUE", + "HeartbeatTimeout": 300, + "LifecycleTransition": "autoscaling:EC2_INSTANCE_TERMINATING", + "NotificationTargetARN": { + "Ref": "ASGLifecycleHookDrainHookTopicA8AD4ACB" + }, + "RoleARN": { + "Fn::GetAtt": [ + "ASGLifecycleHookDrainHookRoleD640316C", + "Arn" + ] + } + }, + "DependsOn": [ + "ASGLifecycleHookDrainHookRoleDefaultPolicy3EEFDE57", + "ASGLifecycleHookDrainHookRoleD640316C" + ] + }, + "EC2CapacityProvider5A2E35CD": { + "Type": "AWS::ECS::CapacityProvider", + "Properties": { + "AutoScalingGroupProvider": { + "AutoScalingGroupArn": { + "Ref": "ASG46ED3070" + }, + "ManagedScaling": { + "Status": "ENABLED", + "TargetCapacity": 100 + }, + "ManagedTerminationProtection": "DISABLED" + } + } + } + }, + "Parameters": { + "SsmParameterValueawsserviceecsoptimizedamiamazonlinux2023recommendedimageidC96584B6F00A464EAD1953AFF4B05118Parameter": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/aws/service/ecs/optimized-ami/amazon-linux-2023/recommended/image_id" + }, + "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-ecs/test/integ.cluster.amazonlinux2023-ami.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster.amazonlinux2023-ami.js.snapshot/integ.json new file mode 100644 index 0000000000000..483e48bdbbc38 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster.amazonlinux2023-ami.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "38.0.1", + "testCases": { + "ClusterAL2023/DefaultTest": { + "stacks": [ + "integ-ecs-al2023-ami" + ], + "assertionStack": "ClusterAL2023/DefaultTest/DeployAssert", + "assertionStackName": "ClusterAL2023DefaultTestDeployAssert19111415" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster.amazonlinux2023-ami.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster.amazonlinux2023-ami.js.snapshot/manifest.json new file mode 100644 index 0000000000000..175636b354cc9 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster.amazonlinux2023-ami.js.snapshot/manifest.json @@ -0,0 +1,299 @@ +{ + "version": "38.0.1", + "artifacts": { + "integ-ecs-al2023-ami.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "integ-ecs-al2023-ami.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "integ-ecs-al2023-ami": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "integ-ecs-al2023-ami.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}/f875639342074982d90d3f026dd2a665ec32849787c8c2fee81f9a8dd2f1f58d.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "integ-ecs-al2023-ami.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": [ + "integ-ecs-al2023-ami.assets" + ], + "metadata": { + "/integ-ecs-al2023-ami/Vpc/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Vpc8378EB38" + } + ], + "/integ-ecs-al2023-ami/Vpc/PublicSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet1Subnet5C2D37C4" + } + ], + "/integ-ecs-al2023-ami/Vpc/PublicSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet1RouteTable6C95E38E" + } + ], + "/integ-ecs-al2023-ami/Vpc/PublicSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet1RouteTableAssociation97140677" + } + ], + "/integ-ecs-al2023-ami/Vpc/PublicSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet1DefaultRoute3DA9E72A" + } + ], + "/integ-ecs-al2023-ami/Vpc/PublicSubnet1/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet1EIPD7E02669" + } + ], + "/integ-ecs-al2023-ami/Vpc/PublicSubnet1/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet1NATGateway4D7517AA" + } + ], + "/integ-ecs-al2023-ami/Vpc/PrivateSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPrivateSubnet1Subnet536B997A" + } + ], + "/integ-ecs-al2023-ami/Vpc/PrivateSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPrivateSubnet1RouteTableB2C5B500" + } + ], + "/integ-ecs-al2023-ami/Vpc/PrivateSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPrivateSubnet1RouteTableAssociation70C59FA6" + } + ], + "/integ-ecs-al2023-ami/Vpc/PrivateSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPrivateSubnet1DefaultRouteBE02A9ED" + } + ], + "/integ-ecs-al2023-ami/Vpc/IGW": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcIGWD7BA715C" + } + ], + "/integ-ecs-al2023-ami/Vpc/VPCGW": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcVPCGWBF912B6E" + } + ], + "/integ-ecs-al2023-ami/Cluster/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterEB0386A7" + } + ], + "/integ-ecs-al2023-ami/Cluster/Cluster": [ + { + "type": "aws:cdk:logicalId", + "data": "Cluster3DA9CCBA" + } + ], + "/integ-ecs-al2023-ami/InstanceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "InstanceRole3CCE2F1D" + } + ], + "/integ-ecs-al2023-ami/InstanceRole/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "InstanceRoleDefaultPolicy1531605C" + } + ], + "/integ-ecs-al2023-ami/ASG/InstanceSecurityGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ASGInstanceSecurityGroup0525485D" + } + ], + "/integ-ecs-al2023-ami/ASG/InstanceProfile": [ + { + "type": "aws:cdk:logicalId", + "data": "ASGInstanceProfile0A2834D7" + } + ], + "/integ-ecs-al2023-ami/ASG/LaunchTemplate/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ASGLaunchTemplate0CA92847" + } + ], + "/integ-ecs-al2023-ami/ASG/ASG": [ + { + "type": "aws:cdk:logicalId", + "data": "ASG46ED3070" + } + ], + "/integ-ecs-al2023-ami/ASG/DrainECSHook/Function/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ASGDrainECSHookFunctionServiceRoleC12963BB" + } + ], + "/integ-ecs-al2023-ami/ASG/DrainECSHook/Function/ServiceRole/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ASGDrainECSHookFunctionServiceRoleDefaultPolicy16848A27" + } + ], + "/integ-ecs-al2023-ami/ASG/DrainECSHook/Function/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ASGDrainECSHookFunction5F24CF4D" + } + ], + "/integ-ecs-al2023-ami/ASG/DrainECSHook/Function/AllowInvoke:integecsal2023amiASGLifecycleHookDrainHookTopic083F299F": [ + { + "type": "aws:cdk:logicalId", + "data": "ASGDrainECSHookFunctionAllowInvokeintegecsal2023amiASGLifecycleHookDrainHookTopic083F299FF8F99189" + } + ], + "/integ-ecs-al2023-ami/ASG/DrainECSHook/Function/Topic/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ASGDrainECSHookFunctionTopicD6FC59F7" + } + ], + "/integ-ecs-al2023-ami/ASG/LifecycleHookDrainHook/Topic/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ASGLifecycleHookDrainHookTopicA8AD4ACB" + } + ], + "/integ-ecs-al2023-ami/ASG/LifecycleHookDrainHook/Role/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ASGLifecycleHookDrainHookRoleD640316C" + } + ], + "/integ-ecs-al2023-ami/ASG/LifecycleHookDrainHook/Role/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ASGLifecycleHookDrainHookRoleDefaultPolicy3EEFDE57" + } + ], + "/integ-ecs-al2023-ami/ASG/LifecycleHookDrainHook/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ASGLifecycleHookDrainHookFE4AFEBE" + } + ], + "/integ-ecs-al2023-ami/SsmParameterValue:--aws--service--ecs--optimized-ami--amazon-linux-2023--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ + { + "type": "aws:cdk:logicalId", + "data": "SsmParameterValueawsserviceecsoptimizedamiamazonlinux2023recommendedimageidC96584B6F00A464EAD1953AFF4B05118Parameter" + } + ], + "/integ-ecs-al2023-ami/EC2CapacityProvider/EC2CapacityProvider": [ + { + "type": "aws:cdk:logicalId", + "data": "EC2CapacityProvider5A2E35CD" + } + ], + "/integ-ecs-al2023-ami/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/integ-ecs-al2023-ami/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "integ-ecs-al2023-ami" + }, + "ClusterAL2023DefaultTestDeployAssert19111415.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "ClusterAL2023DefaultTestDeployAssert19111415.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "ClusterAL2023DefaultTestDeployAssert19111415": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "ClusterAL2023DefaultTestDeployAssert19111415.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": [ + "ClusterAL2023DefaultTestDeployAssert19111415.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": [ + "ClusterAL2023DefaultTestDeployAssert19111415.assets" + ], + "metadata": { + "/ClusterAL2023/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/ClusterAL2023/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "ClusterAL2023/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-ecs/test/integ.cluster.amazonlinux2023-ami.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster.amazonlinux2023-ami.js.snapshot/tree.json new file mode 100644 index 0000000000000..7da3a829f5650 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster.amazonlinux2023-ami.js.snapshot/tree.json @@ -0,0 +1,1357 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "integ-ecs-al2023-ami": { + "id": "integ-ecs-al2023-ami", + "path": "integ-ecs-al2023-ami", + "children": { + "Vpc": { + "id": "Vpc", + "path": "integ-ecs-al2023-ami/Vpc", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-ecs-al2023-ami/Vpc/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPC", + "aws:cdk:cloudformation:props": { + "cidrBlock": "10.0.0.0/16", + "enableDnsHostnames": true, + "enableDnsSupport": true, + "instanceTenancy": "default", + "tags": [ + { + "key": "Name", + "value": "integ-ecs-al2023-ami/Vpc" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPC", + "version": "0.0.0" + } + }, + "PublicSubnet1": { + "id": "PublicSubnet1", + "path": "integ-ecs-al2023-ami/Vpc/PublicSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "integ-ecs-al2023-ami/Vpc/PublicSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.0.0/17", + "mapPublicIpOnLaunch": true, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "integ-ecs-al2023-ami/Vpc/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "integ-ecs-al2023-ami/Vpc/PublicSubnet1/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "integ-ecs-al2023-ami/Vpc/PublicSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "integ-ecs-al2023-ami/Vpc/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "integ-ecs-al2023-ami/Vpc/PublicSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VpcPublicSubnet1RouteTable6C95E38E" + }, + "subnetId": { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "integ-ecs-al2023-ami/Vpc/PublicSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "routeTableId": { + "Ref": "VpcPublicSubnet1RouteTable6C95E38E" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + }, + "EIP": { + "id": "EIP", + "path": "integ-ecs-al2023-ami/Vpc/PublicSubnet1/EIP", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EIP", + "aws:cdk:cloudformation:props": { + "domain": "vpc", + "tags": [ + { + "key": "Name", + "value": "integ-ecs-al2023-ami/Vpc/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", + "version": "0.0.0" + } + }, + "NATGateway": { + "id": "NATGateway", + "path": "integ-ecs-al2023-ami/Vpc/PublicSubnet1/NATGateway", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", + "aws:cdk:cloudformation:props": { + "allocationId": { + "Fn::GetAtt": [ + "VpcPublicSubnet1EIPD7E02669", + "AllocationId" + ] + }, + "subnetId": { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "tags": [ + { + "key": "Name", + "value": "integ-ecs-al2023-ami/Vpc/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", + "version": "0.0.0" + } + }, + "PrivateSubnet1": { + "id": "PrivateSubnet1", + "path": "integ-ecs-al2023-ami/Vpc/PrivateSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "integ-ecs-al2023-ami/Vpc/PrivateSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.128.0/17", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Private" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Private" + }, + { + "key": "Name", + "value": "integ-ecs-al2023-ami/Vpc/PrivateSubnet1" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "integ-ecs-al2023-ami/Vpc/PrivateSubnet1/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "integ-ecs-al2023-ami/Vpc/PrivateSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "integ-ecs-al2023-ami/Vpc/PrivateSubnet1" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "integ-ecs-al2023-ami/Vpc/PrivateSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VpcPrivateSubnet1RouteTableB2C5B500" + }, + "subnetId": { + "Ref": "VpcPrivateSubnet1Subnet536B997A" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "integ-ecs-al2023-ami/Vpc/PrivateSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "natGatewayId": { + "Ref": "VpcPublicSubnet1NATGateway4D7517AA" + }, + "routeTableId": { + "Ref": "VpcPrivateSubnet1RouteTableB2C5B500" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "IGW": { + "id": "IGW", + "path": "integ-ecs-al2023-ami/Vpc/IGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "integ-ecs-al2023-ami/Vpc" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnInternetGateway", + "version": "0.0.0" + } + }, + "VPCGW": { + "id": "VPCGW", + "path": "integ-ecs-al2023-ami/Vpc/VPCGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", + "aws:cdk:cloudformation:props": { + "internetGatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPCGatewayAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.Vpc", + "version": "0.0.0" + } + }, + "Cluster": { + "id": "Cluster", + "path": "integ-ecs-al2023-ami/Cluster", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-ecs-al2023-ami/Cluster/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" + } + }, + "Cluster": { + "id": "Cluster", + "path": "integ-ecs-al2023-ami/Cluster/Cluster", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ECS::ClusterCapacityProviderAssociations", + "aws:cdk:cloudformation:props": { + "capacityProviders": [ + { + "Ref": "EC2CapacityProvider5A2E35CD" + } + ], + "cluster": { + "Ref": "ClusterEB0386A7" + }, + "defaultCapacityProviderStrategy": [] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ecs.CfnClusterCapacityProviderAssociations", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ecs.Cluster", + "version": "0.0.0" + } + }, + "InstanceRole": { + "id": "InstanceRole", + "path": "integ-ecs-al2023-ami/InstanceRole", + "children": { + "ImportInstanceRole": { + "id": "ImportInstanceRole", + "path": "integ-ecs-al2023-ami/InstanceRole/ImportInstanceRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-ecs-al2023-ami/InstanceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AmazonEC2ContainerServiceForEC2Role" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/AmazonSSMManagedInstanceCore" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "integ-ecs-al2023-ami/InstanceRole/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-ecs-al2023-ami/InstanceRole/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "cloudformation:SignalResource", + "Effect": "Allow", + "Resource": { + "Ref": "AWS::StackId" + } + }, + { + "Action": [ + "ecs:DeregisterContainerInstance", + "ecs:RegisterContainerInstance", + "ecs:Submit*" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ClusterEB0386A7", + "Arn" + ] + } + }, + { + "Action": [ + "ecs:Poll", + "ecs:StartTelemetrySession" + ], + "Condition": { + "ArnEquals": { + "ecs:cluster": { + "Fn::GetAtt": [ + "ClusterEB0386A7", + "Arn" + ] + } + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecr:GetAuthorizationToken", + "ecs:DiscoverPollEndpoint", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "policyName": "InstanceRoleDefaultPolicy1531605C", + "roles": [ + { + "Ref": "InstanceRole3CCE2F1D" + } + ] + } + }, + "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" + } + }, + "ASG": { + "id": "ASG", + "path": "integ-ecs-al2023-ami/ASG", + "children": { + "InstanceSecurityGroup": { + "id": "InstanceSecurityGroup", + "path": "integ-ecs-al2023-ami/ASG/InstanceSecurityGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-ecs-al2023-ami/ASG/InstanceSecurityGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", + "aws:cdk:cloudformation:props": { + "groupDescription": "integ-ecs-al2023-ami/ASG/InstanceSecurityGroup", + "securityGroupEgress": [ + { + "cidrIp": "0.0.0.0/0", + "description": "Allow all outbound traffic by default", + "ipProtocol": "-1" + } + ], + "tags": [ + { + "key": "Name", + "value": "integ-ecs-al2023-ami/ASG" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSecurityGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.SecurityGroup", + "version": "0.0.0" + } + }, + "InstanceProfile": { + "id": "InstanceProfile", + "path": "integ-ecs-al2023-ami/ASG/InstanceProfile", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::InstanceProfile", + "aws:cdk:cloudformation:props": { + "roles": [ + { + "Ref": "InstanceRole3CCE2F1D" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnInstanceProfile", + "version": "0.0.0" + } + }, + "ImportedInstanceProfile": { + "id": "ImportedInstanceProfile", + "path": "integ-ecs-al2023-ami/ASG/ImportedInstanceProfile", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "LaunchTemplate": { + "id": "LaunchTemplate", + "path": "integ-ecs-al2023-ami/ASG/LaunchTemplate", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-ecs-al2023-ami/ASG/LaunchTemplate/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::LaunchTemplate", + "aws:cdk:cloudformation:props": { + "launchTemplateData": { + "iamInstanceProfile": { + "arn": { + "Fn::GetAtt": [ + "ASGInstanceProfile0A2834D7", + "Arn" + ] + } + }, + "imageId": { + "Ref": "SsmParameterValueawsserviceecsoptimizedamiamazonlinux2023recommendedimageidC96584B6F00A464EAD1953AFF4B05118Parameter" + }, + "instanceType": "t2.micro", + "monitoring": { + "enabled": false + }, + "securityGroupIds": [ + { + "Fn::GetAtt": [ + "ASGInstanceSecurityGroup0525485D", + "GroupId" + ] + } + ], + "tagSpecifications": [ + { + "resourceType": "instance", + "tags": [ + { + "key": "Name", + "value": "integ-ecs-al2023-ami/ASG/LaunchTemplate" + } + ] + }, + { + "resourceType": "volume", + "tags": [ + { + "key": "Name", + "value": "integ-ecs-al2023-ami/ASG/LaunchTemplate" + } + ] + } + ], + "userData": { + "Fn::Base64": { + "Fn::Join": [ + "", + [ + "#!/bin/bash\nset -x\nset -e\necho ECS_CLUSTER=", + { + "Ref": "ClusterEB0386A7" + }, + " >> /etc/ecs/ecs.config\nsudo yum install -y iptables-services; sudo iptables --insert DOCKER-USER 1 --in-interface docker+ --destination 169.254.169.254/32 --jump DROP\nsudo iptables-save | sudo tee /etc/sysconfig/iptables && sudo systemctl enable --now iptables\necho ECS_AWSVPC_BLOCK_IMDS=true >> /etc/ecs/ecs.config\nyum install -y aws-cfn-bootstrap\n/opt/aws/bin/cfn-signal -e $? --stack ", + { + "Ref": "AWS::StackId" + }, + " --resource ASG46ED3070 --region ", + { + "Ref": "AWS::Region" + } + ] + ] + } + } + }, + "tagSpecifications": [ + { + "resourceType": "launch-template", + "tags": [ + { + "key": "Name", + "value": "integ-ecs-al2023-ami/ASG/LaunchTemplate" + } + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnLaunchTemplate", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.LaunchTemplate", + "version": "0.0.0" + } + }, + "ASG": { + "id": "ASG", + "path": "integ-ecs-al2023-ami/ASG/ASG", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::AutoScaling::AutoScalingGroup", + "aws:cdk:cloudformation:props": { + "launchTemplate": { + "launchTemplateId": { + "Ref": "ASGLaunchTemplate0CA92847" + }, + "version": { + "Fn::GetAtt": [ + "ASGLaunchTemplate0CA92847", + "LatestVersionNumber" + ] + } + }, + "maxSize": "1", + "minSize": "1", + "tags": [ + { + "key": "Name", + "value": "integ-ecs-al2023-ami/ASG", + "propagateAtLaunch": true + } + ], + "vpcZoneIdentifier": [ + { + "Ref": "VpcPrivateSubnet1Subnet536B997A" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_autoscaling.CfnAutoScalingGroup", + "version": "0.0.0" + } + }, + "DrainECSHook": { + "id": "DrainECSHook", + "path": "integ-ecs-al2023-ami/ASG/DrainECSHook", + "children": { + "Function": { + "id": "Function", + "path": "integ-ecs-al2023-ami/ASG/DrainECSHook/Function", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "integ-ecs-al2023-ami/ASG/DrainECSHook/Function/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-ecs-al2023-ami/ASG/DrainECSHook/Function/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-ecs-al2023-ami/ASG/DrainECSHook/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" + ] + ] + } + ], + "tags": [ + { + "key": "Name", + "value": "integ-ecs-al2023-ami/ASG" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "integ-ecs-al2023-ami/ASG/DrainECSHook/Function/ServiceRole/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-ecs-al2023-ami/ASG/DrainECSHook/Function/ServiceRole/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": [ + "ec2:DescribeHosts", + "ec2:DescribeInstanceAttribute", + "ec2:DescribeInstanceStatus", + "ec2:DescribeInstances" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "autoscaling:CompleteLifecycleAction", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":autoscaling:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":autoScalingGroup:*:autoScalingGroupName/", + { + "Ref": "ASG46ED3070" + } + ] + ] + } + }, + { + "Action": [ + "ecs:DescribeContainerInstances", + "ecs:DescribeTasks", + "ecs:ListTasks", + "ecs:UpdateContainerInstancesState" + ], + "Condition": { + "ArnEquals": { + "ecs:cluster": { + "Fn::GetAtt": [ + "ClusterEB0386A7", + "Arn" + ] + } + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecs:ListContainerInstances", + "ecs:SubmitContainerStateChange", + "ecs:SubmitTaskStateChange" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ClusterEB0386A7", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "policyName": "ASGDrainECSHookFunctionServiceRoleDefaultPolicy16848A27", + "roles": [ + { + "Ref": "ASGDrainECSHookFunctionServiceRoleC12963BB" + } + ] + } + }, + "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" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-ecs-al2023-ami/ASG/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" + }, + "environment": { + "variables": { + "CLUSTER": { + "Ref": "ClusterEB0386A7" + } + } + }, + "handler": "index.lambda_handler", + "role": { + "Fn::GetAtt": [ + "ASGDrainECSHookFunctionServiceRoleC12963BB", + "Arn" + ] + }, + "runtime": "python3.9", + "tags": [ + { + "key": "Name", + "value": "integ-ecs-al2023-ami/ASG" + } + ], + "timeout": 310 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", + "version": "0.0.0" + } + }, + "AllowInvoke:integecsal2023amiASGLifecycleHookDrainHookTopic083F299F": { + "id": "AllowInvoke:integecsal2023amiASGLifecycleHookDrainHookTopic083F299F", + "path": "integ-ecs-al2023-ami/ASG/DrainECSHook/Function/AllowInvoke:integecsal2023amiASGLifecycleHookDrainHookTopic083F299F", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", + "aws:cdk:cloudformation:props": { + "action": "lambda:InvokeFunction", + "functionName": { + "Fn::GetAtt": [ + "ASGDrainECSHookFunction5F24CF4D", + "Arn" + ] + }, + "principal": "sns.amazonaws.com", + "sourceArn": { + "Ref": "ASGLifecycleHookDrainHookTopicA8AD4ACB" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", + "version": "0.0.0" + } + }, + "Topic": { + "id": "Topic", + "path": "integ-ecs-al2023-ami/ASG/DrainECSHook/Function/Topic", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-ecs-al2023-ami/ASG/DrainECSHook/Function/Topic/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SNS::Subscription", + "aws:cdk:cloudformation:props": { + "endpoint": { + "Fn::GetAtt": [ + "ASGDrainECSHookFunction5F24CF4D", + "Arn" + ] + }, + "protocol": "lambda", + "topicArn": { + "Ref": "ASGLifecycleHookDrainHookTopicA8AD4ACB" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sns.CfnSubscription", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sns.Subscription", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.Function", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "LifecycleHookDrainHook": { + "id": "LifecycleHookDrainHook", + "path": "integ-ecs-al2023-ami/ASG/LifecycleHookDrainHook", + "children": { + "Topic": { + "id": "Topic", + "path": "integ-ecs-al2023-ami/ASG/LifecycleHookDrainHook/Topic", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-ecs-al2023-ami/ASG/LifecycleHookDrainHook/Topic/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SNS::Topic", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "integ-ecs-al2023-ami/ASG" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sns.CfnTopic", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sns.Topic", + "version": "0.0.0" + } + }, + "Role": { + "id": "Role", + "path": "integ-ecs-al2023-ami/ASG/LifecycleHookDrainHook/Role", + "children": { + "ImportRole": { + "id": "ImportRole", + "path": "integ-ecs-al2023-ami/ASG/LifecycleHookDrainHook/Role/ImportRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-ecs-al2023-ami/ASG/LifecycleHookDrainHook/Role/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "autoscaling.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "tags": [ + { + "key": "Name", + "value": "integ-ecs-al2023-ami/ASG" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "integ-ecs-al2023-ami/ASG/LifecycleHookDrainHook/Role/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-ecs-al2023-ami/ASG/LifecycleHookDrainHook/Role/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "sns:Publish", + "Effect": "Allow", + "Resource": { + "Ref": "ASGLifecycleHookDrainHookTopicA8AD4ACB" + } + } + ], + "Version": "2012-10-17" + }, + "policyName": "ASGLifecycleHookDrainHookRoleDefaultPolicy3EEFDE57", + "roles": [ + { + "Ref": "ASGLifecycleHookDrainHookRoleD640316C" + } + ] + } + }, + "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" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-ecs-al2023-ami/ASG/LifecycleHookDrainHook/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::AutoScaling::LifecycleHook", + "aws:cdk:cloudformation:props": { + "autoScalingGroupName": { + "Ref": "ASG46ED3070" + }, + "defaultResult": "CONTINUE", + "heartbeatTimeout": 300, + "lifecycleTransition": "autoscaling:EC2_INSTANCE_TERMINATING", + "notificationTargetArn": { + "Ref": "ASGLifecycleHookDrainHookTopicA8AD4ACB" + }, + "roleArn": { + "Fn::GetAtt": [ + "ASGLifecycleHookDrainHookRoleD640316C", + "Arn" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_autoscaling.CfnLifecycleHook", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_autoscaling.LifecycleHook", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_autoscaling.AutoScalingGroup", + "version": "0.0.0" + } + }, + "SsmParameterValue:--aws--service--ecs--optimized-ami--amazon-linux-2023--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": { + "id": "SsmParameterValue:--aws--service--ecs--optimized-ami--amazon-linux-2023--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", + "path": "integ-ecs-al2023-ami/SsmParameterValue:--aws--service--ecs--optimized-ami--amazon-linux-2023--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "SsmParameterValue:--aws--service--ecs--optimized-ami--amazon-linux-2023--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118": { + "id": "SsmParameterValue:--aws--service--ecs--optimized-ami--amazon-linux-2023--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", + "path": "integ-ecs-al2023-ami/SsmParameterValue:--aws--service--ecs--optimized-ami--amazon-linux-2023--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "EC2CapacityProvider": { + "id": "EC2CapacityProvider", + "path": "integ-ecs-al2023-ami/EC2CapacityProvider", + "children": { + "EC2CapacityProvider": { + "id": "EC2CapacityProvider", + "path": "integ-ecs-al2023-ami/EC2CapacityProvider/EC2CapacityProvider", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ECS::CapacityProvider", + "aws:cdk:cloudformation:props": { + "autoScalingGroupProvider": { + "autoScalingGroupArn": { + "Ref": "ASG46ED3070" + }, + "managedScaling": { + "status": "ENABLED", + "targetCapacity": 100 + }, + "managedTerminationProtection": "DISABLED" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ecs.CfnCapacityProvider", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ecs.AsgCapacityProvider", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "integ-ecs-al2023-ami/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "integ-ecs-al2023-ami/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + }, + "ClusterAL2023": { + "id": "ClusterAL2023", + "path": "ClusterAL2023", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "ClusterAL2023/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "ClusterAL2023/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "ClusterAL2023/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "ClusterAL2023/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "ClusterAL2023/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "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-ecs/test/integ.cluster.amazonlinux2023-ami.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster.amazonlinux2023-ami.ts new file mode 100644 index 0000000000000..17dda232db22d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster.amazonlinux2023-ami.ts @@ -0,0 +1,64 @@ +import * as autoscaling from 'aws-cdk-lib/aws-autoscaling'; +import * as ec2 from 'aws-cdk-lib/aws-ec2'; +import * as cdk from 'aws-cdk-lib'; +import * as ecs from 'aws-cdk-lib/aws-ecs'; +import * as integ from '@aws-cdk/integ-tests-alpha'; +import * as iam from 'aws-cdk-lib/aws-iam'; + +const app = new cdk.App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': true, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); +const stack = new cdk.Stack(app, 'integ-ecs-al2023-ami'); + +const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 1, restrictDefaultSecurityGroup: false }); +const cluster = new ecs.Cluster(stack, 'Cluster', { + vpc, +}); + +const insRole = new iam.Role(stack, 'InstanceRole', { + assumedBy: new iam.ServicePrincipal('ec2.amazonaws.com'), + managedPolicies: [ + // following policy contains permission needed by the ECS agent: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/instance_IAM_role.html + iam.ManagedPolicy.fromAwsManagedPolicyName('service-role/AmazonEC2ContainerServiceForEC2Role'), // for ECS + // following policy allows ssh-ing into the instance via the AWS Console SSM manager. Good for debugging this integ test + iam.ManagedPolicy.fromAwsManagedPolicyName('AmazonSSMManagedInstanceCore'), // for SSM + ], +}); +insRole.applyRemovalPolicy(cdk.RemovalPolicy.DESTROY); + +const userData = ec2.UserData.forLinux(); +// echo each commands so they appear in /var/log/cloud-init-output.log +userData.addCommands('set -x'); +// error out on any commands failure in the UserData so that cfn-signal will not run at the end, thus, failing the cfn deployment +userData.addCommands('set -e'); + +const autoScalingGroup = new autoscaling.AutoScalingGroup(stack, 'ASG', { + vpc, + role: insRole, + userData, + instanceType: new ec2.InstanceType('t2.micro'), + machineImage: ecs.EcsOptimizedImage.amazonLinux2023(), + minCapacity: 1, + signals: autoscaling.Signals.waitForMinCapacity({ + timeout: cdk.Duration.minutes(10), + }), +}); + +const cp = new ecs.AsgCapacityProvider(stack, 'EC2CapacityProvider', { + autoScalingGroup, + enableManagedTerminationProtection: false, +}); + +cluster.addAsgCapacityProvider(cp); +autoScalingGroup.addUserData('yum install -y aws-cfn-bootstrap'); +// cfn-signal sends a signal to CFN to indicate ASG creation is completed +autoScalingGroup.addUserData(`/opt/aws/bin/cfn-signal -e $? --stack ${stack.stackId}` + +` --resource ${(autoScalingGroup.node.defaultChild as autoscaling.CfnAutoScalingGroup).logicalId}` + + ` --region ${stack.region}`); + +new integ.IntegTest(app, 'ClusterAL2023', { + testCases: [stack], +}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.task-definition-enable-fault-injection.js.snapshot/TaskDefinitionEnableFaultInjectionDefaultTestDeployAssert16EB808C.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.task-definition-enable-fault-injection.js.snapshot/TaskDefinitionEnableFaultInjectionDefaultTestDeployAssert16EB808C.assets.json new file mode 100644 index 0000000000000..a55289a57059d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.task-definition-enable-fault-injection.js.snapshot/TaskDefinitionEnableFaultInjectionDefaultTestDeployAssert16EB808C.assets.json @@ -0,0 +1,19 @@ +{ + "version": "38.0.1", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "TaskDefinitionEnableFaultInjectionDefaultTestDeployAssert16EB808C.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-ecs/test/integ.task-definition-enable-fault-injection.js.snapshot/TaskDefinitionEnableFaultInjectionDefaultTestDeployAssert16EB808C.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.task-definition-enable-fault-injection.js.snapshot/TaskDefinitionEnableFaultInjectionDefaultTestDeployAssert16EB808C.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.task-definition-enable-fault-injection.js.snapshot/TaskDefinitionEnableFaultInjectionDefaultTestDeployAssert16EB808C.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-ecs/test/integ.task-definition-enable-fault-injection.js.snapshot/aws-ecs-task-definition-enable-fault-injection.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.task-definition-enable-fault-injection.js.snapshot/aws-ecs-task-definition-enable-fault-injection.assets.json new file mode 100644 index 0000000000000..9599cb8f22cdf --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.task-definition-enable-fault-injection.js.snapshot/aws-ecs-task-definition-enable-fault-injection.assets.json @@ -0,0 +1,19 @@ +{ + "version": "38.0.1", + "files": { + "1f3359944a7dd8e04b4348673a74c55d7a4cf0f9645dcc981b79e1b9bb77dbd9": { + "source": { + "path": "aws-ecs-task-definition-enable-fault-injection.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "1f3359944a7dd8e04b4348673a74c55d7a4cf0f9645dcc981b79e1b9bb77dbd9.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-ecs/test/integ.task-definition-enable-fault-injection.js.snapshot/aws-ecs-task-definition-enable-fault-injection.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.task-definition-enable-fault-injection.js.snapshot/aws-ecs-task-definition-enable-fault-injection.template.json new file mode 100644 index 0000000000000..6074f7be58a3d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.task-definition-enable-fault-injection.js.snapshot/aws-ecs-task-definition-enable-fault-injection.template.json @@ -0,0 +1,124 @@ +{ + "Resources": { + "Ec2TaskDefinitionTaskRole0B78BC85": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "Ec2TaskDefinitionB25030BE": { + "Type": "AWS::ECS::TaskDefinition", + "Properties": { + "ContainerDefinitions": [ + { + "Essential": true, + "Image": "public.ecr.aws/ecs-sample-image/amazon-ecs-sample:latest", + "Memory": 512, + "Name": "Ec2Container" + } + ], + "EnableFaultInjection": true, + "Family": "awsecstaskdefinitionenablefaultinjectionEc2TaskDefinition28DF45DB", + "NetworkMode": "host", + "RequiresCompatibilities": [ + "EC2" + ], + "TaskRoleArn": { + "Fn::GetAtt": [ + "Ec2TaskDefinitionTaskRole0B78BC85", + "Arn" + ] + } + } + }, + "FargateTaskDefinitionTaskRoleE3C2BCAA": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "FargateTaskDefinition8E3B365E": { + "Type": "AWS::ECS::TaskDefinition", + "Properties": { + "ContainerDefinitions": [ + { + "Essential": true, + "Image": "public.ecr.aws/ecs-sample-image/amazon-ecs-sample:latest", + "Memory": 512, + "Name": "FargateContainer" + } + ], + "Cpu": "256", + "EnableFaultInjection": true, + "Family": "awsecstaskdefinitionenablefaultinjectionFargateTaskDefinition203B68EF", + "Memory": "512", + "NetworkMode": "awsvpc", + "RequiresCompatibilities": [ + "FARGATE" + ], + "TaskRoleArn": { + "Fn::GetAtt": [ + "FargateTaskDefinitionTaskRoleE3C2BCAA", + "Arn" + ] + } + } + } + }, + "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-ecs/test/integ.task-definition-enable-fault-injection.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.task-definition-enable-fault-injection.js.snapshot/cdk.out new file mode 100644 index 0000000000000..c6e612584e352 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.task-definition-enable-fault-injection.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"38.0.1"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.task-definition-enable-fault-injection.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.task-definition-enable-fault-injection.js.snapshot/integ.json new file mode 100644 index 0000000000000..1779997e6b8dc --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.task-definition-enable-fault-injection.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "38.0.1", + "testCases": { + "TaskDefinitionEnableFaultInjection/DefaultTest": { + "stacks": [ + "aws-ecs-task-definition-enable-fault-injection" + ], + "assertionStack": "TaskDefinitionEnableFaultInjection/DefaultTest/DeployAssert", + "assertionStackName": "TaskDefinitionEnableFaultInjectionDefaultTestDeployAssert16EB808C" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.task-definition-enable-fault-injection.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.task-definition-enable-fault-injection.js.snapshot/manifest.json new file mode 100644 index 0000000000000..ffc554651abf2 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.task-definition-enable-fault-injection.js.snapshot/manifest.json @@ -0,0 +1,134 @@ +{ + "version": "38.0.1", + "artifacts": { + "aws-ecs-task-definition-enable-fault-injection.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "aws-ecs-task-definition-enable-fault-injection.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "aws-ecs-task-definition-enable-fault-injection": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "aws-ecs-task-definition-enable-fault-injection.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}/1f3359944a7dd8e04b4348673a74c55d7a4cf0f9645dcc981b79e1b9bb77dbd9.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "aws-ecs-task-definition-enable-fault-injection.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": [ + "aws-ecs-task-definition-enable-fault-injection.assets" + ], + "metadata": { + "/aws-ecs-task-definition-enable-fault-injection/Ec2TaskDefinition/TaskRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Ec2TaskDefinitionTaskRole0B78BC85" + } + ], + "/aws-ecs-task-definition-enable-fault-injection/Ec2TaskDefinition/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Ec2TaskDefinitionB25030BE", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" + ] + } + ], + "/aws-ecs-task-definition-enable-fault-injection/FargateTaskDefinition/TaskRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "FargateTaskDefinitionTaskRoleE3C2BCAA" + } + ], + "/aws-ecs-task-definition-enable-fault-injection/FargateTaskDefinition/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "FargateTaskDefinition8E3B365E" + } + ], + "/aws-ecs-task-definition-enable-fault-injection/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/aws-ecs-task-definition-enable-fault-injection/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "aws-ecs-task-definition-enable-fault-injection" + }, + "TaskDefinitionEnableFaultInjectionDefaultTestDeployAssert16EB808C.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "TaskDefinitionEnableFaultInjectionDefaultTestDeployAssert16EB808C.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "TaskDefinitionEnableFaultInjectionDefaultTestDeployAssert16EB808C": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "TaskDefinitionEnableFaultInjectionDefaultTestDeployAssert16EB808C.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": [ + "TaskDefinitionEnableFaultInjectionDefaultTestDeployAssert16EB808C.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": [ + "TaskDefinitionEnableFaultInjectionDefaultTestDeployAssert16EB808C.assets" + ], + "metadata": { + "/TaskDefinitionEnableFaultInjection/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/TaskDefinitionEnableFaultInjection/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "TaskDefinitionEnableFaultInjection/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-ecs/test/integ.task-definition-enable-fault-injection.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.task-definition-enable-fault-injection.js.snapshot/tree.json new file mode 100644 index 0000000000000..4c4bc5c338169 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.task-definition-enable-fault-injection.js.snapshot/tree.json @@ -0,0 +1,291 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "aws-ecs-task-definition-enable-fault-injection": { + "id": "aws-ecs-task-definition-enable-fault-injection", + "path": "aws-ecs-task-definition-enable-fault-injection", + "children": { + "Ec2TaskDefinition": { + "id": "Ec2TaskDefinition", + "path": "aws-ecs-task-definition-enable-fault-injection/Ec2TaskDefinition", + "children": { + "TaskRole": { + "id": "TaskRole", + "path": "aws-ecs-task-definition-enable-fault-injection/Ec2TaskDefinition/TaskRole", + "children": { + "ImportTaskRole": { + "id": "ImportTaskRole", + "path": "aws-ecs-task-definition-enable-fault-injection/Ec2TaskDefinition/TaskRole/ImportTaskRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-ecs-task-definition-enable-fault-injection/Ec2TaskDefinition/TaskRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-ecs-task-definition-enable-fault-injection/Ec2TaskDefinition/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ECS::TaskDefinition", + "aws:cdk:cloudformation:props": { + "containerDefinitions": [ + { + "essential": true, + "image": "public.ecr.aws/ecs-sample-image/amazon-ecs-sample:latest", + "memory": 512, + "name": "Ec2Container" + } + ], + "enableFaultInjection": true, + "family": "awsecstaskdefinitionenablefaultinjectionEc2TaskDefinition28DF45DB", + "networkMode": "host", + "requiresCompatibilities": [ + "EC2" + ], + "taskRoleArn": { + "Fn::GetAtt": [ + "Ec2TaskDefinitionTaskRole0B78BC85", + "Arn" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ecs.CfnTaskDefinition", + "version": "0.0.0" + } + }, + "Ec2Container": { + "id": "Ec2Container", + "path": "aws-ecs-task-definition-enable-fault-injection/Ec2TaskDefinition/Ec2Container", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ecs.ContainerDefinition", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ecs.Ec2TaskDefinition", + "version": "0.0.0" + } + }, + "FargateTaskDefinition": { + "id": "FargateTaskDefinition", + "path": "aws-ecs-task-definition-enable-fault-injection/FargateTaskDefinition", + "children": { + "TaskRole": { + "id": "TaskRole", + "path": "aws-ecs-task-definition-enable-fault-injection/FargateTaskDefinition/TaskRole", + "children": { + "ImportTaskRole": { + "id": "ImportTaskRole", + "path": "aws-ecs-task-definition-enable-fault-injection/FargateTaskDefinition/TaskRole/ImportTaskRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-ecs-task-definition-enable-fault-injection/FargateTaskDefinition/TaskRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-ecs-task-definition-enable-fault-injection/FargateTaskDefinition/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ECS::TaskDefinition", + "aws:cdk:cloudformation:props": { + "containerDefinitions": [ + { + "essential": true, + "image": "public.ecr.aws/ecs-sample-image/amazon-ecs-sample:latest", + "memory": 512, + "name": "FargateContainer" + } + ], + "cpu": "256", + "enableFaultInjection": true, + "family": "awsecstaskdefinitionenablefaultinjectionFargateTaskDefinition203B68EF", + "memory": "512", + "networkMode": "awsvpc", + "requiresCompatibilities": [ + "FARGATE" + ], + "taskRoleArn": { + "Fn::GetAtt": [ + "FargateTaskDefinitionTaskRoleE3C2BCAA", + "Arn" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ecs.CfnTaskDefinition", + "version": "0.0.0" + } + }, + "FargateContainer": { + "id": "FargateContainer", + "path": "aws-ecs-task-definition-enable-fault-injection/FargateTaskDefinition/FargateContainer", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ecs.ContainerDefinition", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ecs.FargateTaskDefinition", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-ecs-task-definition-enable-fault-injection/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-ecs-task-definition-enable-fault-injection/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + }, + "TaskDefinitionEnableFaultInjection": { + "id": "TaskDefinitionEnableFaultInjection", + "path": "TaskDefinitionEnableFaultInjection", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "TaskDefinitionEnableFaultInjection/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "TaskDefinitionEnableFaultInjection/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "TaskDefinitionEnableFaultInjection/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "TaskDefinitionEnableFaultInjection/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "TaskDefinitionEnableFaultInjection/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "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-ecs/test/integ.task-definition-enable-fault-injection.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.task-definition-enable-fault-injection.ts new file mode 100644 index 0000000000000..2eb3338db7262 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.task-definition-enable-fault-injection.ts @@ -0,0 +1,27 @@ +import * as cdk from 'aws-cdk-lib'; +import * as ecs from 'aws-cdk-lib/aws-ecs'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; + +const app = new cdk.App(); +const stack = new cdk.Stack(app, 'aws-ecs-task-definition-enable-fault-injection'); + +const ec2TaskDefinition = new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDefinition', { + enableFaultInjection: true, + networkMode: ecs.NetworkMode.HOST, +}); +ec2TaskDefinition.addContainer('Ec2Container', { + image: ecs.ContainerImage.fromRegistry('public.ecr.aws/ecs-sample-image/amazon-ecs-sample:latest'), + memoryLimitMiB: 512, +}); + +const fargateTaskDefinition = new ecs.FargateTaskDefinition(stack, 'FargateTaskDefinition', { + enableFaultInjection: true, +}); +fargateTaskDefinition.addContainer('FargateContainer', { + image: ecs.ContainerImage.fromRegistry('public.ecr.aws/ecs-sample-image/amazon-ecs-sample:latest'), + memoryLimitMiB: 512, +}); + +new IntegTest(app, 'TaskDefinitionEnableFaultInjection', { + testCases: [stack], +}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/ecs/integ.event-ec2-task.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/ecs/integ.event-ec2-task.ts index ba7fb097c036c..f9a3572c3bf3e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/ecs/integ.event-ec2-task.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/ecs/integ.event-ec2-task.ts @@ -7,7 +7,12 @@ import * as cdk from 'aws-cdk-lib'; import * as integ from '@aws-cdk/integ-tests-alpha'; import * as targets from 'aws-cdk-lib/aws-events-targets'; -const app = new cdk.App(); +const app = new cdk.App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new cdk.Stack(app, 'aws-ecs-integ-ecs'); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/LambdaNodeJsLatestIntegDefaultTestDeployAssertD40B5C28.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/LambdaNodeJsLatestIntegDefaultTestDeployAssertD40B5C28.assets.json index cdb72a8ca209b..7af6c1aca67ba 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/LambdaNodeJsLatestIntegDefaultTestDeployAssertD40B5C28.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/LambdaNodeJsLatestIntegDefaultTestDeployAssertD40B5C28.assets.json @@ -1,20 +1,20 @@ { - "version": "38.0.1", + "version": "39.0.0", "files": { - "14d52bdadae57c6ec2c7b715c5420ae5c3001a8252558f7219f6207e4f405a97": { + "bfcf4228d6660f50e81f19efdb64c6388dda6796296eb239decdff1dbc2f4981": { "source": { - "path": "asset.14d52bdadae57c6ec2c7b715c5420ae5c3001a8252558f7219f6207e4f405a97.bundle", + "path": "asset.bfcf4228d6660f50e81f19efdb64c6388dda6796296eb239decdff1dbc2f4981.bundle", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "14d52bdadae57c6ec2c7b715c5420ae5c3001a8252558f7219f6207e4f405a97.zip", + "objectKey": "bfcf4228d6660f50e81f19efdb64c6388dda6796296eb239decdff1dbc2f4981.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "a8fae5feb4da6bd9bf0e9597ed8af7943191e43bac68591782214d4eecdaa6c2": { + "406b08db0a8c94d3b8953b7cca80917d4f7d4f48f23fc990126340d7d3b585b4": { "source": { "path": "LambdaNodeJsLatestIntegDefaultTestDeployAssertD40B5C28.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "a8fae5feb4da6bd9bf0e9597ed8af7943191e43bac68591782214d4eecdaa6c2.json", + "objectKey": "406b08db0a8c94d3b8953b7cca80917d4f7d4f48f23fc990126340d7d3b585b4.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-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/LambdaNodeJsLatestIntegDefaultTestDeployAssertD40B5C28.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/LambdaNodeJsLatestIntegDefaultTestDeployAssertD40B5C28.template.json index 2ddf445f88a6e..93b2d9d2d9ee9 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/LambdaNodeJsLatestIntegDefaultTestDeployAssertD40B5C28.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/LambdaNodeJsLatestIntegDefaultTestDeployAssertD40B5C28.template.json @@ -1,6 +1,6 @@ { "Resources": { - "LambdaInvoke6eb068149a1c4cf460ad6e8d302d9779": { + "LambdaInvoke9ea7744a5544a5c6ffed51cd6ff34786": { "Type": "Custom::DeployAssert@SdkCallLambdainvoke", "Properties": { "ServiceToken": { @@ -19,7 +19,7 @@ [ "\"", { - "Fn::ImportValue": "cdk-integ-lambda-nodejs-latest:ExportsOutputReffuncnodejs18x0F8243A883990873F" + "Fn::ImportValue": "cdk-integ-lambda-nodejs-latest:ExportsOutputReffuncnodejs18x8E61B45C0D1332CA" }, "\"" ] @@ -27,17 +27,17 @@ } }, "flattenResponse": "false", - "salt": "1732911897880" + "salt": "1736381079246" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, - "LambdaInvoke6eb068149a1c4cf460ad6e8d302d9779InvokeACFD02A8": { + "LambdaInvoke9ea7744a5544a5c6ffed51cd6ff34786Invoke0196D5F9": { "Type": "AWS::Lambda::Permission", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { - "Fn::ImportValue": "cdk-integ-lambda-nodejs-latest:ExportsOutputReffuncnodejs18x0F8243A883990873F" + "Fn::ImportValue": "cdk-integ-lambda-nodejs-latest:ExportsOutputReffuncnodejs18x8E61B45C0D1332CA" }, "Principal": { "Fn::GetAtt": [ @@ -106,7 +106,7 @@ }, ":function:", { - "Fn::ImportValue": "cdk-integ-lambda-nodejs-latest:ExportsOutputReffuncnodejs18x0F8243A883990873F" + "Fn::ImportValue": "cdk-integ-lambda-nodejs-latest:ExportsOutputReffuncnodejs18x8E61B45C0D1332CA" } ] ] @@ -146,7 +146,7 @@ }, ":function:", { - "Fn::ImportValue": "cdk-integ-lambda-nodejs-latest:ExportsOutputReffuncnodejs20x133AD5CB790AA33D0" + "Fn::ImportValue": "cdk-integ-lambda-nodejs-latest:ExportsOutputReffuncnodejs20x20EDE4EE45E884C9" } ] ] @@ -186,47 +186,7 @@ }, ":function:", { - "Fn::ImportValue": "cdk-integ-lambda-nodejs-latest:ExportsOutputReffuncnodejs18x2566B78741C5F85C9" - } - ] - ] - } - ] - }, - { - "Action": [ - "lambda:Invoke" - ], - "Effect": "Allow", - "Resource": [ - "*" - ] - }, - { - "Action": [ - "lambda:InvokeFunction" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":lambda:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":function:", - { - "Fn::ImportValue": "cdk-integ-lambda-nodejs-latest:ExportsOutputReffuncnodejs22x3C06C9D2E5FED86BD" + "Fn::ImportValue": "cdk-integ-lambda-nodejs-latest:ExportsOutputReffuncnodejs22xAA4F54D576AB7928" } ] ] @@ -255,7 +215,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "14d52bdadae57c6ec2c7b715c5420ae5c3001a8252558f7219f6207e4f405a97.zip" + "S3Key": "bfcf4228d6660f50e81f19efdb64c6388dda6796296eb239decdff1dbc2f4981.zip" }, "Timeout": 120, "Handler": "index.handler", @@ -267,7 +227,7 @@ } } }, - "LambdaInvokec29f0f68556d046db3755c7cbfbe7e19": { + "LambdaInvokedd13d1be8acd5c33cf49dd164c4d4607": { "Type": "Custom::DeployAssert@SdkCallLambdainvoke", "Properties": { "ServiceToken": { @@ -286,7 +246,7 @@ [ "\"", { - "Fn::ImportValue": "cdk-integ-lambda-nodejs-latest:ExportsOutputReffuncnodejs20x133AD5CB790AA33D0" + "Fn::ImportValue": "cdk-integ-lambda-nodejs-latest:ExportsOutputReffuncnodejs20x20EDE4EE45E884C9" }, "\"" ] @@ -294,17 +254,17 @@ } }, "flattenResponse": "false", - "salt": "1732911897883" + "salt": "1736381079248" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, - "LambdaInvokec29f0f68556d046db3755c7cbfbe7e19Invoke2D8CBC7D": { + "LambdaInvokedd13d1be8acd5c33cf49dd164c4d4607Invoke0DDAB5A0": { "Type": "AWS::Lambda::Permission", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { - "Fn::ImportValue": "cdk-integ-lambda-nodejs-latest:ExportsOutputReffuncnodejs20x133AD5CB790AA33D0" + "Fn::ImportValue": "cdk-integ-lambda-nodejs-latest:ExportsOutputReffuncnodejs20x20EDE4EE45E884C9" }, "Principal": { "Fn::GetAtt": [ @@ -314,7 +274,7 @@ } } }, - "LambdaInvokea874c7c1c2bb0bdf9469eb5260003abf": { + "LambdaInvoke7f65e5f1728f1ebc1dc4358d2a6d1dec": { "Type": "Custom::DeployAssert@SdkCallLambdainvoke", "Properties": { "ServiceToken": { @@ -333,7 +293,7 @@ [ "\"", { - "Fn::ImportValue": "cdk-integ-lambda-nodejs-latest:ExportsOutputReffuncnodejs18x2566B78741C5F85C9" + "Fn::ImportValue": "cdk-integ-lambda-nodejs-latest:ExportsOutputReffuncnodejs22xAA4F54D576AB7928" }, "\"" ] @@ -341,64 +301,17 @@ } }, "flattenResponse": "false", - "salt": "1732911897885" + "salt": "1736381079249" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, - "LambdaInvokea874c7c1c2bb0bdf9469eb5260003abfInvoke07459D4C": { + "LambdaInvoke7f65e5f1728f1ebc1dc4358d2a6d1decInvokeE046A313": { "Type": "AWS::Lambda::Permission", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { - "Fn::ImportValue": "cdk-integ-lambda-nodejs-latest:ExportsOutputReffuncnodejs18x2566B78741C5F85C9" - }, - "Principal": { - "Fn::GetAtt": [ - "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", - "Arn" - ] - } - } - }, - "LambdaInvokec6dea6fa9264d7676abde417ce6fbf04": { - "Type": "Custom::DeployAssert@SdkCallLambdainvoke", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", - "Arn" - ] - }, - "service": "Lambda", - "api": "invoke", - "expected": "{\"$ObjectLike\":{\"StatusCode\":200,\"ExecutedVersion\":\"$LATEST\"}}", - "parameters": { - "FunctionName": { - "Fn::Join": [ - "", - [ - "\"", - { - "Fn::ImportValue": "cdk-integ-lambda-nodejs-latest:ExportsOutputReffuncnodejs22x3C06C9D2E5FED86BD" - }, - "\"" - ] - ] - } - }, - "flattenResponse": "false", - "salt": "1732911897888" - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "LambdaInvokec6dea6fa9264d7676abde417ce6fbf04InvokeE894AC2C": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::ImportValue": "cdk-integ-lambda-nodejs-latest:ExportsOutputReffuncnodejs22x3C06C9D2E5FED86BD" + "Fn::ImportValue": "cdk-integ-lambda-nodejs-latest:ExportsOutputReffuncnodejs22xAA4F54D576AB7928" }, "Principal": { "Fn::GetAtt": [ @@ -410,34 +323,26 @@ } }, "Outputs": { - "AssertionResultsLambdaInvoke6eb068149a1c4cf460ad6e8d302d9779": { - "Value": { - "Fn::GetAtt": [ - "LambdaInvoke6eb068149a1c4cf460ad6e8d302d9779", - "assertion" - ] - } - }, - "AssertionResultsLambdaInvokec29f0f68556d046db3755c7cbfbe7e19": { + "AssertionResultsLambdaInvoke9ea7744a5544a5c6ffed51cd6ff34786": { "Value": { "Fn::GetAtt": [ - "LambdaInvokec29f0f68556d046db3755c7cbfbe7e19", + "LambdaInvoke9ea7744a5544a5c6ffed51cd6ff34786", "assertion" ] } }, - "AssertionResultsLambdaInvokea874c7c1c2bb0bdf9469eb5260003abf": { + "AssertionResultsLambdaInvokedd13d1be8acd5c33cf49dd164c4d4607": { "Value": { "Fn::GetAtt": [ - "LambdaInvokea874c7c1c2bb0bdf9469eb5260003abf", + "LambdaInvokedd13d1be8acd5c33cf49dd164c4d4607", "assertion" ] } }, - "AssertionResultsLambdaInvokec6dea6fa9264d7676abde417ce6fbf04": { + "AssertionResultsLambdaInvoke7f65e5f1728f1ebc1dc4358d2a6d1dec": { "Value": { "Fn::GetAtt": [ - "LambdaInvokec6dea6fa9264d7676abde417ce6fbf04", + "LambdaInvoke7f65e5f1728f1ebc1dc4358d2a6d1dec", "assertion" ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/asset.14d52bdadae57c6ec2c7b715c5420ae5c3001a8252558f7219f6207e4f405a97.bundle/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/asset.bfcf4228d6660f50e81f19efdb64c6388dda6796296eb239decdff1dbc2f4981.bundle/index.js similarity index 99% rename from packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/asset.14d52bdadae57c6ec2c7b715c5420ae5c3001a8252558f7219f6207e4f405a97.bundle/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/asset.bfcf4228d6660f50e81f19efdb64c6388dda6796296eb239decdff1dbc2f4981.bundle/index.js index 16f64848011a2..60e59701bc0e1 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/asset.14d52bdadae57c6ec2c7b715c5420ae5c3001a8252558f7219f6207e4f405a97.bundle/index.js +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/asset.bfcf4228d6660f50e81f19efdb64c6388dda6796296eb239decdff1dbc2f4981.bundle/index.js @@ -152,7 +152,6 @@ var init_matcher = __esm({ */ toHumanStrings() { const failures = new Array(); - debugger; recurse(this, []); return failures.map((r) => { const loc = r.path.length === 0 ? "" : ` at /${r.path.join("/")}`; diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/cdk-integ-lambda-nodejs-latest.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/cdk-integ-lambda-nodejs-latest.assets.json index 5f1f270384eb0..c32e03b2e698e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/cdk-integ-lambda-nodejs-latest.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/cdk-integ-lambda-nodejs-latest.assets.json @@ -1,5 +1,5 @@ { - "version": "38.0.1", + "version": "39.0.0", "files": { "c2ab4a8654a5392d58fe69a7991514d5af7a4538d8dce56aa9fa7047dd354e89": { "source": { @@ -14,7 +14,7 @@ } } }, - "aba2e7081fd7768d494b8d7cccdf3ff455105faff5992c2a0266e1dda44c9ee4": { + "477ce67601e6e951d890733213d534b4ba281d2486796a51455a573cd5f0ad62": { "source": { "path": "cdk-integ-lambda-nodejs-latest.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "aba2e7081fd7768d494b8d7cccdf3ff455105faff5992c2a0266e1dda44c9ee4.json", + "objectKey": "477ce67601e6e951d890733213d534b4ba281d2486796a51455a573cd5f0ad62.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-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/cdk-integ-lambda-nodejs-latest.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/cdk-integ-lambda-nodejs-latest.template.json index e658b74f65aa5..74edea0fa0328 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/cdk-integ-lambda-nodejs-latest.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/cdk-integ-lambda-nodejs-latest.template.json @@ -1,6 +1,6 @@ { "Resources": { - "funcnodejs18x0ServiceRole9E76897D": { + "funcnodejs18xServiceRoleAEA986D3": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { @@ -31,7 +31,7 @@ ] } }, - "funcnodejs18x0F8243A88": { + "funcnodejs18x8E61B45C": { "Type": "AWS::Lambda::Function", "Properties": { "Code": { @@ -43,17 +43,17 @@ "Handler": "index.handler", "Role": { "Fn::GetAtt": [ - "funcnodejs18x0ServiceRole9E76897D", + "funcnodejs18xServiceRoleAEA986D3", "Arn" ] }, "Runtime": "nodejs18.x" }, "DependsOn": [ - "funcnodejs18x0ServiceRole9E76897D" + "funcnodejs18xServiceRoleAEA986D3" ] }, - "funcnodejs20x1ServiceRole9F252C30": { + "funcnodejs20xServiceRoleD34C713B": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { @@ -84,7 +84,7 @@ ] } }, - "funcnodejs20x133AD5CB7": { + "funcnodejs20x20EDE4EE": { "Type": "AWS::Lambda::Function", "Properties": { "Code": { @@ -96,17 +96,17 @@ "Handler": "index.handler", "Role": { "Fn::GetAtt": [ - "funcnodejs20x1ServiceRole9F252C30", + "funcnodejs20xServiceRoleD34C713B", "Arn" ] }, "Runtime": "nodejs20.x" }, "DependsOn": [ - "funcnodejs20x1ServiceRole9F252C30" + "funcnodejs20xServiceRoleD34C713B" ] }, - "funcnodejs18x2ServiceRoleF0EC8A13": { + "funcnodejs22xServiceRole4249784B": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { @@ -137,7 +137,7 @@ ] } }, - "funcnodejs18x2566B7874": { + "funcnodejs22xAA4F54D5": { "Type": "AWS::Lambda::Function", "Properties": { "Code": { @@ -149,101 +149,40 @@ "Handler": "index.handler", "Role": { "Fn::GetAtt": [ - "funcnodejs18x2ServiceRoleF0EC8A13", - "Arn" - ] - }, - "Runtime": "nodejs18.x" - }, - "DependsOn": [ - "funcnodejs18x2ServiceRoleF0EC8A13" - ] - }, - "funcnodejs22x3ServiceRole326FAF7D": { - "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" - ] - ] - } - ] - } - }, - "funcnodejs22x3C06C9D2E": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "c2ab4a8654a5392d58fe69a7991514d5af7a4538d8dce56aa9fa7047dd354e89.zip" - }, - "Handler": "index.handler", - "Role": { - "Fn::GetAtt": [ - "funcnodejs22x3ServiceRole326FAF7D", + "funcnodejs22xServiceRole4249784B", "Arn" ] }, "Runtime": "nodejs22.x" }, "DependsOn": [ - "funcnodejs22x3ServiceRole326FAF7D" + "funcnodejs22xServiceRole4249784B" ] } }, "Outputs": { - "ExportsOutputReffuncnodejs18x0F8243A883990873F": { - "Value": { - "Ref": "funcnodejs18x0F8243A88" - }, - "Export": { - "Name": "cdk-integ-lambda-nodejs-latest:ExportsOutputReffuncnodejs18x0F8243A883990873F" - } - }, - "ExportsOutputReffuncnodejs20x133AD5CB790AA33D0": { + "ExportsOutputReffuncnodejs18x8E61B45C0D1332CA": { "Value": { - "Ref": "funcnodejs20x133AD5CB7" + "Ref": "funcnodejs18x8E61B45C" }, "Export": { - "Name": "cdk-integ-lambda-nodejs-latest:ExportsOutputReffuncnodejs20x133AD5CB790AA33D0" + "Name": "cdk-integ-lambda-nodejs-latest:ExportsOutputReffuncnodejs18x8E61B45C0D1332CA" } }, - "ExportsOutputReffuncnodejs18x2566B78741C5F85C9": { + "ExportsOutputReffuncnodejs20x20EDE4EE45E884C9": { "Value": { - "Ref": "funcnodejs18x2566B7874" + "Ref": "funcnodejs20x20EDE4EE" }, "Export": { - "Name": "cdk-integ-lambda-nodejs-latest:ExportsOutputReffuncnodejs18x2566B78741C5F85C9" + "Name": "cdk-integ-lambda-nodejs-latest:ExportsOutputReffuncnodejs20x20EDE4EE45E884C9" } }, - "ExportsOutputReffuncnodejs22x3C06C9D2E5FED86BD": { + "ExportsOutputReffuncnodejs22xAA4F54D576AB7928": { "Value": { - "Ref": "funcnodejs22x3C06C9D2E" + "Ref": "funcnodejs22xAA4F54D5" }, "Export": { - "Name": "cdk-integ-lambda-nodejs-latest:ExportsOutputReffuncnodejs22x3C06C9D2E5FED86BD" + "Name": "cdk-integ-lambda-nodejs-latest:ExportsOutputReffuncnodejs22xAA4F54D576AB7928" } } }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/cdk.out index c6e612584e352..91e1a8b9901d5 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"38.0.1"} \ No newline at end of file +{"version":"39.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/integ.json index 90cfa3696e175..c19418eded0d3 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "38.0.1", + "version": "39.0.0", "testCases": { "LambdaNodeJsLatestInteg/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/manifest.json index cd0c336fdb994..db039f1a9e636 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "38.0.1", + "version": "39.0.0", "artifacts": { "cdk-integ-lambda-nodejs-latest.assets": { "type": "cdk:asset-manifest", @@ -18,7 +18,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}/aba2e7081fd7768d494b8d7cccdf3ff455105faff5992c2a0266e1dda44c9ee4.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/477ce67601e6e951d890733213d534b4ba281d2486796a51455a573cd5f0ad62.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -34,88 +34,142 @@ "cdk-integ-lambda-nodejs-latest.assets" ], "metadata": { - "/cdk-integ-lambda-nodejs-latest/func-nodejs18.x-0/ServiceRole/Resource": [ + "/cdk-integ-lambda-nodejs-latest/func-nodejs18.x/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", - "data": "funcnodejs18x0ServiceRole9E76897D" + "data": "funcnodejs18xServiceRoleAEA986D3" } ], - "/cdk-integ-lambda-nodejs-latest/func-nodejs18.x-0/Resource": [ + "/cdk-integ-lambda-nodejs-latest/func-nodejs18.x/Resource": [ { "type": "aws:cdk:logicalId", - "data": "funcnodejs18x0F8243A88" + "data": "funcnodejs18x8E61B45C" } ], - "/cdk-integ-lambda-nodejs-latest/func-nodejs20.x-1/ServiceRole/Resource": [ + "/cdk-integ-lambda-nodejs-latest/func-nodejs20.x/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", - "data": "funcnodejs20x1ServiceRole9F252C30" + "data": "funcnodejs20xServiceRoleD34C713B" } ], - "/cdk-integ-lambda-nodejs-latest/func-nodejs20.x-1/Resource": [ + "/cdk-integ-lambda-nodejs-latest/func-nodejs20.x/Resource": [ { "type": "aws:cdk:logicalId", - "data": "funcnodejs20x133AD5CB7" + "data": "funcnodejs20x20EDE4EE" } ], - "/cdk-integ-lambda-nodejs-latest/func-nodejs18.x-2/ServiceRole/Resource": [ + "/cdk-integ-lambda-nodejs-latest/func-nodejs22.x/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", - "data": "funcnodejs18x2ServiceRoleF0EC8A13" + "data": "funcnodejs22xServiceRole4249784B" } ], - "/cdk-integ-lambda-nodejs-latest/func-nodejs18.x-2/Resource": [ + "/cdk-integ-lambda-nodejs-latest/func-nodejs22.x/Resource": [ { "type": "aws:cdk:logicalId", - "data": "funcnodejs18x2566B7874" + "data": "funcnodejs22xAA4F54D5" } ], - "/cdk-integ-lambda-nodejs-latest/func-nodejs22.x-3/ServiceRole/Resource": [ + "/cdk-integ-lambda-nodejs-latest/Exports/Output{\"Ref\":\"funcnodejs18x8E61B45C\"}": [ { "type": "aws:cdk:logicalId", - "data": "funcnodejs22x3ServiceRole326FAF7D" + "data": "ExportsOutputReffuncnodejs18x8E61B45C0D1332CA" } ], - "/cdk-integ-lambda-nodejs-latest/func-nodejs22.x-3/Resource": [ + "/cdk-integ-lambda-nodejs-latest/Exports/Output{\"Ref\":\"funcnodejs20x20EDE4EE\"}": [ { "type": "aws:cdk:logicalId", - "data": "funcnodejs22x3C06C9D2E" + "data": "ExportsOutputReffuncnodejs20x20EDE4EE45E884C9" } ], - "/cdk-integ-lambda-nodejs-latest/Exports/Output{\"Ref\":\"funcnodejs18x0F8243A88\"}": [ + "/cdk-integ-lambda-nodejs-latest/Exports/Output{\"Ref\":\"funcnodejs22xAA4F54D5\"}": [ { "type": "aws:cdk:logicalId", - "data": "ExportsOutputReffuncnodejs18x0F8243A883990873F" + "data": "ExportsOutputReffuncnodejs22xAA4F54D576AB7928" } ], - "/cdk-integ-lambda-nodejs-latest/Exports/Output{\"Ref\":\"funcnodejs20x133AD5CB7\"}": [ + "/cdk-integ-lambda-nodejs-latest/BootstrapVersion": [ { "type": "aws:cdk:logicalId", - "data": "ExportsOutputReffuncnodejs20x133AD5CB790AA33D0" + "data": "BootstrapVersion" } ], - "/cdk-integ-lambda-nodejs-latest/Exports/Output{\"Ref\":\"funcnodejs18x2566B7874\"}": [ + "/cdk-integ-lambda-nodejs-latest/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", - "data": "ExportsOutputReffuncnodejs18x2566B78741C5F85C9" + "data": "CheckBootstrapVersion" } ], - "/cdk-integ-lambda-nodejs-latest/Exports/Output{\"Ref\":\"funcnodejs22x3C06C9D2E\"}": [ + "funcnodejs18x0ServiceRole9E76897D": [ { "type": "aws:cdk:logicalId", - "data": "ExportsOutputReffuncnodejs22x3C06C9D2E5FED86BD" + "data": "funcnodejs18x0ServiceRole9E76897D", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] } ], - "/cdk-integ-lambda-nodejs-latest/BootstrapVersion": [ + "funcnodejs18x0F8243A88": [ { "type": "aws:cdk:logicalId", - "data": "BootstrapVersion" + "data": "funcnodejs18x0F8243A88", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] } ], - "/cdk-integ-lambda-nodejs-latest/CheckBootstrapVersion": [ + "funcnodejs20x1ServiceRole9F252C30": [ { "type": "aws:cdk:logicalId", - "data": "CheckBootstrapVersion" + "data": "funcnodejs20x1ServiceRole9F252C30", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "funcnodejs20x133AD5CB7": [ + { + "type": "aws:cdk:logicalId", + "data": "funcnodejs20x133AD5CB7", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "funcnodejs18x2ServiceRoleF0EC8A13": [ + { + "type": "aws:cdk:logicalId", + "data": "funcnodejs18x2ServiceRoleF0EC8A13", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "funcnodejs18x2566B7874": [ + { + "type": "aws:cdk:logicalId", + "data": "funcnodejs18x2566B7874", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "funcnodejs22x3ServiceRole326FAF7D": [ + { + "type": "aws:cdk:logicalId", + "data": "funcnodejs22x3ServiceRole326FAF7D", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "funcnodejs22x3C06C9D2E": [ + { + "type": "aws:cdk:logicalId", + "data": "funcnodejs22x3C06C9D2E", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] } ] }, @@ -138,7 +192,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}/a8fae5feb4da6bd9bf0e9597ed8af7943191e43bac68591782214d4eecdaa6c2.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/406b08db0a8c94d3b8953b7cca80917d4f7d4f48f23fc990126340d7d3b585b4.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -155,22 +209,22 @@ "LambdaNodeJsLatestIntegDefaultTestDeployAssertD40B5C28.assets" ], "metadata": { - "/LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke6eb068149a1c4cf460ad6e8d302d9779/Default/Default": [ + "/LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke9ea7744a5544a5c6ffed51cd6ff34786/Default/Default": [ { "type": "aws:cdk:logicalId", - "data": "LambdaInvoke6eb068149a1c4cf460ad6e8d302d9779" + "data": "LambdaInvoke9ea7744a5544a5c6ffed51cd6ff34786" } ], - "/LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke6eb068149a1c4cf460ad6e8d302d9779/Invoke": [ + "/LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke9ea7744a5544a5c6ffed51cd6ff34786/Invoke": [ { "type": "aws:cdk:logicalId", - "data": "LambdaInvoke6eb068149a1c4cf460ad6e8d302d9779InvokeACFD02A8" + "data": "LambdaInvoke9ea7744a5544a5c6ffed51cd6ff34786Invoke0196D5F9" } ], - "/LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke6eb068149a1c4cf460ad6e8d302d9779/AssertionResults": [ + "/LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke9ea7744a5544a5c6ffed51cd6ff34786/AssertionResults": [ { "type": "aws:cdk:logicalId", - "data": "AssertionResultsLambdaInvoke6eb068149a1c4cf460ad6e8d302d9779" + "data": "AssertionResultsLambdaInvoke9ea7744a5544a5c6ffed51cd6ff34786" } ], "/LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role": [ @@ -191,58 +245,40 @@ "data": "LatestNodeRuntimeMap" } ], - "/LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokec29f0f68556d046db3755c7cbfbe7e19/Default/Default": [ - { - "type": "aws:cdk:logicalId", - "data": "LambdaInvokec29f0f68556d046db3755c7cbfbe7e19" - } - ], - "/LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokec29f0f68556d046db3755c7cbfbe7e19/Invoke": [ - { - "type": "aws:cdk:logicalId", - "data": "LambdaInvokec29f0f68556d046db3755c7cbfbe7e19Invoke2D8CBC7D" - } - ], - "/LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokec29f0f68556d046db3755c7cbfbe7e19/AssertionResults": [ - { - "type": "aws:cdk:logicalId", - "data": "AssertionResultsLambdaInvokec29f0f68556d046db3755c7cbfbe7e19" - } - ], - "/LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokea874c7c1c2bb0bdf9469eb5260003abf/Default/Default": [ + "/LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokedd13d1be8acd5c33cf49dd164c4d4607/Default/Default": [ { "type": "aws:cdk:logicalId", - "data": "LambdaInvokea874c7c1c2bb0bdf9469eb5260003abf" + "data": "LambdaInvokedd13d1be8acd5c33cf49dd164c4d4607" } ], - "/LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokea874c7c1c2bb0bdf9469eb5260003abf/Invoke": [ + "/LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokedd13d1be8acd5c33cf49dd164c4d4607/Invoke": [ { "type": "aws:cdk:logicalId", - "data": "LambdaInvokea874c7c1c2bb0bdf9469eb5260003abfInvoke07459D4C" + "data": "LambdaInvokedd13d1be8acd5c33cf49dd164c4d4607Invoke0DDAB5A0" } ], - "/LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokea874c7c1c2bb0bdf9469eb5260003abf/AssertionResults": [ + "/LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokedd13d1be8acd5c33cf49dd164c4d4607/AssertionResults": [ { "type": "aws:cdk:logicalId", - "data": "AssertionResultsLambdaInvokea874c7c1c2bb0bdf9469eb5260003abf" + "data": "AssertionResultsLambdaInvokedd13d1be8acd5c33cf49dd164c4d4607" } ], - "/LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokec6dea6fa9264d7676abde417ce6fbf04/Default/Default": [ + "/LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke7f65e5f1728f1ebc1dc4358d2a6d1dec/Default/Default": [ { "type": "aws:cdk:logicalId", - "data": "LambdaInvokec6dea6fa9264d7676abde417ce6fbf04" + "data": "LambdaInvoke7f65e5f1728f1ebc1dc4358d2a6d1dec" } ], - "/LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokec6dea6fa9264d7676abde417ce6fbf04/Invoke": [ + "/LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke7f65e5f1728f1ebc1dc4358d2a6d1dec/Invoke": [ { "type": "aws:cdk:logicalId", - "data": "LambdaInvokec6dea6fa9264d7676abde417ce6fbf04InvokeE894AC2C" + "data": "LambdaInvoke7f65e5f1728f1ebc1dc4358d2a6d1decInvokeE046A313" } ], - "/LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokec6dea6fa9264d7676abde417ce6fbf04/AssertionResults": [ + "/LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke7f65e5f1728f1ebc1dc4358d2a6d1dec/AssertionResults": [ { "type": "aws:cdk:logicalId", - "data": "AssertionResultsLambdaInvokec6dea6fa9264d7676abde417ce6fbf04" + "data": "AssertionResultsLambdaInvoke7f65e5f1728f1ebc1dc4358d2a6d1dec" } ], "/LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/BootstrapVersion": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/tree.json index fb57e340328d8..98e5d5f774291 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/tree.json @@ -8,17 +8,17 @@ "id": "cdk-integ-lambda-nodejs-latest", "path": "cdk-integ-lambda-nodejs-latest", "children": { - "func-nodejs18.x-0": { - "id": "func-nodejs18.x-0", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs18.x-0", + "func-nodejs18.x": { + "id": "func-nodejs18.x", + "path": "cdk-integ-lambda-nodejs-latest/func-nodejs18.x", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs18.x-0/ServiceRole", + "path": "cdk-integ-lambda-nodejs-latest/func-nodejs18.x/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs18.x-0/ServiceRole/ImportServiceRole", + "path": "cdk-integ-lambda-nodejs-latest/func-nodejs18.x/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -26,7 +26,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs18.x-0/ServiceRole/Resource", + "path": "cdk-integ-lambda-nodejs-latest/func-nodejs18.x/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -71,11 +71,11 @@ }, "Code": { "id": "Code", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs18.x-0/Code", + "path": "cdk-integ-lambda-nodejs-latest/func-nodejs18.x/Code", "children": { "Stage": { "id": "Stage", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs18.x-0/Code/Stage", + "path": "cdk-integ-lambda-nodejs-latest/func-nodejs18.x/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -83,7 +83,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs18.x-0/Code/AssetBucket", + "path": "cdk-integ-lambda-nodejs-latest/func-nodejs18.x/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -97,7 +97,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs18.x-0/Resource", + "path": "cdk-integ-lambda-nodejs-latest/func-nodejs18.x/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -110,7 +110,7 @@ "handler": "index.handler", "role": { "Fn::GetAtt": [ - "funcnodejs18x0ServiceRole9E76897D", + "funcnodejs18xServiceRoleAEA986D3", "Arn" ] }, @@ -128,17 +128,17 @@ "version": "0.0.0" } }, - "func-nodejs20.x-1": { - "id": "func-nodejs20.x-1", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs20.x-1", + "func-nodejs20.x": { + "id": "func-nodejs20.x", + "path": "cdk-integ-lambda-nodejs-latest/func-nodejs20.x", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs20.x-1/ServiceRole", + "path": "cdk-integ-lambda-nodejs-latest/func-nodejs20.x/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs20.x-1/ServiceRole/ImportServiceRole", + "path": "cdk-integ-lambda-nodejs-latest/func-nodejs20.x/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -146,7 +146,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs20.x-1/ServiceRole/Resource", + "path": "cdk-integ-lambda-nodejs-latest/func-nodejs20.x/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -191,11 +191,11 @@ }, "Code": { "id": "Code", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs20.x-1/Code", + "path": "cdk-integ-lambda-nodejs-latest/func-nodejs20.x/Code", "children": { "Stage": { "id": "Stage", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs20.x-1/Code/Stage", + "path": "cdk-integ-lambda-nodejs-latest/func-nodejs20.x/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -203,7 +203,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs20.x-1/Code/AssetBucket", + "path": "cdk-integ-lambda-nodejs-latest/func-nodejs20.x/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -217,7 +217,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs20.x-1/Resource", + "path": "cdk-integ-lambda-nodejs-latest/func-nodejs20.x/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -230,7 +230,7 @@ "handler": "index.handler", "role": { "Fn::GetAtt": [ - "funcnodejs20x1ServiceRole9F252C30", + "funcnodejs20xServiceRoleD34C713B", "Arn" ] }, @@ -248,17 +248,17 @@ "version": "0.0.0" } }, - "func-nodejs18.x-2": { - "id": "func-nodejs18.x-2", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs18.x-2", + "func-nodejs22.x": { + "id": "func-nodejs22.x", + "path": "cdk-integ-lambda-nodejs-latest/func-nodejs22.x", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs18.x-2/ServiceRole", + "path": "cdk-integ-lambda-nodejs-latest/func-nodejs22.x/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs18.x-2/ServiceRole/ImportServiceRole", + "path": "cdk-integ-lambda-nodejs-latest/func-nodejs22.x/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -266,7 +266,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs18.x-2/ServiceRole/Resource", + "path": "cdk-integ-lambda-nodejs-latest/func-nodejs22.x/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -311,11 +311,11 @@ }, "Code": { "id": "Code", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs18.x-2/Code", + "path": "cdk-integ-lambda-nodejs-latest/func-nodejs22.x/Code", "children": { "Stage": { "id": "Stage", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs18.x-2/Code/Stage", + "path": "cdk-integ-lambda-nodejs-latest/func-nodejs22.x/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -323,7 +323,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs18.x-2/Code/AssetBucket", + "path": "cdk-integ-lambda-nodejs-latest/func-nodejs22.x/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -337,7 +337,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs18.x-2/Resource", + "path": "cdk-integ-lambda-nodejs-latest/func-nodejs22.x/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -350,127 +350,7 @@ "handler": "index.handler", "role": { "Fn::GetAtt": [ - "funcnodejs18x2ServiceRoleF0EC8A13", - "Arn" - ] - }, - "runtime": "nodejs18.x" - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda_nodejs.NodejsFunction", - "version": "0.0.0" - } - }, - "func-nodejs22.x-3": { - "id": "func-nodejs22.x-3", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs22.x-3", - "children": { - "ServiceRole": { - "id": "ServiceRole", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs22.x-3/ServiceRole", - "children": { - "ImportServiceRole": { - "id": "ImportServiceRole", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs22.x-3/ServiceRole/ImportServiceRole", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs22.x-3/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" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" - } - }, - "Code": { - "id": "Code", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs22.x-3/Code", - "children": { - "Stage": { - "id": "Stage", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs22.x-3/Code/Stage", - "constructInfo": { - "fqn": "aws-cdk-lib.AssetStaging", - "version": "0.0.0" - } - }, - "AssetBucket": { - "id": "AssetBucket", - "path": "cdk-integ-lambda-nodejs-latest/func-nodejs22.x-3/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-integ-lambda-nodejs-latest/func-nodejs22.x-3/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": "c2ab4a8654a5392d58fe69a7991514d5af7a4538d8dce56aa9fa7047dd354e89.zip" - }, - "handler": "index.handler", - "role": { - "Fn::GetAtt": [ - "funcnodejs22x3ServiceRole326FAF7D", + "funcnodejs22xServiceRole4249784B", "Arn" ] }, @@ -492,33 +372,25 @@ "id": "Exports", "path": "cdk-integ-lambda-nodejs-latest/Exports", "children": { - "Output{\"Ref\":\"funcnodejs18x0F8243A88\"}": { - "id": "Output{\"Ref\":\"funcnodejs18x0F8243A88\"}", - "path": "cdk-integ-lambda-nodejs-latest/Exports/Output{\"Ref\":\"funcnodejs18x0F8243A88\"}", + "Output{\"Ref\":\"funcnodejs18x8E61B45C\"}": { + "id": "Output{\"Ref\":\"funcnodejs18x8E61B45C\"}", + "path": "cdk-integ-lambda-nodejs-latest/Exports/Output{\"Ref\":\"funcnodejs18x8E61B45C\"}", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" } }, - "Output{\"Ref\":\"funcnodejs20x133AD5CB7\"}": { - "id": "Output{\"Ref\":\"funcnodejs20x133AD5CB7\"}", - "path": "cdk-integ-lambda-nodejs-latest/Exports/Output{\"Ref\":\"funcnodejs20x133AD5CB7\"}", + "Output{\"Ref\":\"funcnodejs20x20EDE4EE\"}": { + "id": "Output{\"Ref\":\"funcnodejs20x20EDE4EE\"}", + "path": "cdk-integ-lambda-nodejs-latest/Exports/Output{\"Ref\":\"funcnodejs20x20EDE4EE\"}", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" } }, - "Output{\"Ref\":\"funcnodejs18x2566B7874\"}": { - "id": "Output{\"Ref\":\"funcnodejs18x2566B7874\"}", - "path": "cdk-integ-lambda-nodejs-latest/Exports/Output{\"Ref\":\"funcnodejs18x2566B7874\"}", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnOutput", - "version": "0.0.0" - } - }, - "Output{\"Ref\":\"funcnodejs22x3C06C9D2E\"}": { - "id": "Output{\"Ref\":\"funcnodejs22x3C06C9D2E\"}", - "path": "cdk-integ-lambda-nodejs-latest/Exports/Output{\"Ref\":\"funcnodejs22x3C06C9D2E\"}", + "Output{\"Ref\":\"funcnodejs22xAA4F54D5\"}": { + "id": "Output{\"Ref\":\"funcnodejs22xAA4F54D5\"}", + "path": "cdk-integ-lambda-nodejs-latest/Exports/Output{\"Ref\":\"funcnodejs22xAA4F54D5\"}", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" @@ -572,17 +444,17 @@ "id": "DeployAssert", "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert", "children": { - "LambdaInvoke6eb068149a1c4cf460ad6e8d302d9779": { - "id": "LambdaInvoke6eb068149a1c4cf460ad6e8d302d9779", - "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke6eb068149a1c4cf460ad6e8d302d9779", + "LambdaInvoke9ea7744a5544a5c6ffed51cd6ff34786": { + "id": "LambdaInvoke9ea7744a5544a5c6ffed51cd6ff34786", + "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke9ea7744a5544a5c6ffed51cd6ff34786", "children": { "SdkProvider": { "id": "SdkProvider", - "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke6eb068149a1c4cf460ad6e8d302d9779/SdkProvider", + "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke9ea7744a5544a5c6ffed51cd6ff34786/SdkProvider", "children": { "AssertionsProvider": { "id": "AssertionsProvider", - "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke6eb068149a1c4cf460ad6e8d302d9779/SdkProvider/AssertionsProvider", + "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke9ea7744a5544a5c6ffed51cd6ff34786/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", "version": "10.4.2" @@ -596,11 +468,11 @@ }, "Default": { "id": "Default", - "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke6eb068149a1c4cf460ad6e8d302d9779/Default", + "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke9ea7744a5544a5c6ffed51cd6ff34786/Default", "children": { "Default": { "id": "Default", - "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke6eb068149a1c4cf460ad6e8d302d9779/Default/Default", + "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke9ea7744a5544a5c6ffed51cd6ff34786/Default/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -614,7 +486,7 @@ }, "Invoke": { "id": "Invoke", - "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke6eb068149a1c4cf460ad6e8d302d9779/Invoke", + "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke9ea7744a5544a5c6ffed51cd6ff34786/Invoke", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -622,7 +494,7 @@ }, "AssertionResults": { "id": "AssertionResults", - "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke6eb068149a1c4cf460ad6e8d302d9779/AssertionResults", + "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke9ea7744a5544a5c6ffed51cd6ff34786/AssertionResults", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" @@ -676,79 +548,17 @@ "version": "0.0.0" } }, - "LambdaInvokec29f0f68556d046db3755c7cbfbe7e19": { - "id": "LambdaInvokec29f0f68556d046db3755c7cbfbe7e19", - "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokec29f0f68556d046db3755c7cbfbe7e19", - "children": { - "SdkProvider": { - "id": "SdkProvider", - "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokec29f0f68556d046db3755c7cbfbe7e19/SdkProvider", - "children": { - "AssertionsProvider": { - "id": "AssertionsProvider", - "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokec29f0f68556d046db3755c7cbfbe7e19/SdkProvider/AssertionsProvider", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.4.2" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests-alpha.AssertionsProvider", - "version": "0.0.0" - } - }, - "Default": { - "id": "Default", - "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokec29f0f68556d046db3755c7cbfbe7e19/Default", - "children": { - "Default": { - "id": "Default", - "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokec29f0f68556d046db3755c7cbfbe7e19/Default/Default", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.CustomResource", - "version": "0.0.0" - } - }, - "Invoke": { - "id": "Invoke", - "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokec29f0f68556d046db3755c7cbfbe7e19/Invoke", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnResource", - "version": "0.0.0" - } - }, - "AssertionResults": { - "id": "AssertionResults", - "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokec29f0f68556d046db3755c7cbfbe7e19/AssertionResults", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnOutput", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests-alpha.LambdaInvokeFunction", - "version": "0.0.0" - } - }, - "LambdaInvokea874c7c1c2bb0bdf9469eb5260003abf": { - "id": "LambdaInvokea874c7c1c2bb0bdf9469eb5260003abf", - "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokea874c7c1c2bb0bdf9469eb5260003abf", + "LambdaInvokedd13d1be8acd5c33cf49dd164c4d4607": { + "id": "LambdaInvokedd13d1be8acd5c33cf49dd164c4d4607", + "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokedd13d1be8acd5c33cf49dd164c4d4607", "children": { "SdkProvider": { "id": "SdkProvider", - "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokea874c7c1c2bb0bdf9469eb5260003abf/SdkProvider", + "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokedd13d1be8acd5c33cf49dd164c4d4607/SdkProvider", "children": { "AssertionsProvider": { "id": "AssertionsProvider", - "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokea874c7c1c2bb0bdf9469eb5260003abf/SdkProvider/AssertionsProvider", + "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokedd13d1be8acd5c33cf49dd164c4d4607/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", "version": "10.4.2" @@ -762,11 +572,11 @@ }, "Default": { "id": "Default", - "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokea874c7c1c2bb0bdf9469eb5260003abf/Default", + "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokedd13d1be8acd5c33cf49dd164c4d4607/Default", "children": { "Default": { "id": "Default", - "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokea874c7c1c2bb0bdf9469eb5260003abf/Default/Default", + "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokedd13d1be8acd5c33cf49dd164c4d4607/Default/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -780,7 +590,7 @@ }, "Invoke": { "id": "Invoke", - "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokea874c7c1c2bb0bdf9469eb5260003abf/Invoke", + "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokedd13d1be8acd5c33cf49dd164c4d4607/Invoke", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -788,7 +598,7 @@ }, "AssertionResults": { "id": "AssertionResults", - "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokea874c7c1c2bb0bdf9469eb5260003abf/AssertionResults", + "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokedd13d1be8acd5c33cf49dd164c4d4607/AssertionResults", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" @@ -800,17 +610,17 @@ "version": "0.0.0" } }, - "LambdaInvokec6dea6fa9264d7676abde417ce6fbf04": { - "id": "LambdaInvokec6dea6fa9264d7676abde417ce6fbf04", - "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokec6dea6fa9264d7676abde417ce6fbf04", + "LambdaInvoke7f65e5f1728f1ebc1dc4358d2a6d1dec": { + "id": "LambdaInvoke7f65e5f1728f1ebc1dc4358d2a6d1dec", + "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke7f65e5f1728f1ebc1dc4358d2a6d1dec", "children": { "SdkProvider": { "id": "SdkProvider", - "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokec6dea6fa9264d7676abde417ce6fbf04/SdkProvider", + "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke7f65e5f1728f1ebc1dc4358d2a6d1dec/SdkProvider", "children": { "AssertionsProvider": { "id": "AssertionsProvider", - "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokec6dea6fa9264d7676abde417ce6fbf04/SdkProvider/AssertionsProvider", + "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke7f65e5f1728f1ebc1dc4358d2a6d1dec/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", "version": "10.4.2" @@ -824,11 +634,11 @@ }, "Default": { "id": "Default", - "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokec6dea6fa9264d7676abde417ce6fbf04/Default", + "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke7f65e5f1728f1ebc1dc4358d2a6d1dec/Default", "children": { "Default": { "id": "Default", - "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokec6dea6fa9264d7676abde417ce6fbf04/Default/Default", + "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke7f65e5f1728f1ebc1dc4358d2a6d1dec/Default/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -842,7 +652,7 @@ }, "Invoke": { "id": "Invoke", - "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokec6dea6fa9264d7676abde417ce6fbf04/Invoke", + "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke7f65e5f1728f1ebc1dc4358d2a6d1dec/Invoke", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -850,7 +660,7 @@ }, "AssertionResults": { "id": "AssertionResults", - "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvokec6dea6fa9264d7676abde417ce6fbf04/AssertionResults", + "path": "LambdaNodeJsLatestInteg/DefaultTest/DeployAssert/LambdaInvoke7f65e5f1728f1ebc1dc4358d2a6d1dec/AssertionResults", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.ts index a536c6e31e741..87e6168c831fc 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.ts @@ -15,8 +15,10 @@ class TestStack extends Stack { Runtime.NODEJS_18_X, Runtime.NODEJS_20_X, Runtime.NODEJS_LATEST, Runtime.NODEJS_22_X, ]; - runtimes.forEach((runtime, index) => { - this.lambdaFunctions.push(new lambda.NodejsFunction(this, `func-${runtime.name}-${index}`, { + const uniqueRuntimes: Runtime[] = runtimes.filter((value, index, array) => array.findIndex(value1 => value1.runtimeEquals(value)) === index); + + uniqueRuntimes.forEach((runtime) => { + this.lambdaFunctions.push(new lambda.NodejsFunction(this, `func-${runtime.name}`, { entry: path.join(__dirname, 'integ-handlers/dependencies.ts'), runtime: runtime, bundling: { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task-ref-definition.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task-ref-definition.ts index c0c0fddf5ed3d..60003da29968e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task-ref-definition.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task-ref-definition.ts @@ -7,7 +7,12 @@ import * as tasks from 'aws-cdk-lib/aws-stepfunctions-tasks'; import { IntegTest } from '@aws-cdk/integ-tests-alpha'; import { EC2_RESTRICT_DEFAULT_SECURITY_GROUP, STEPFUNCTIONS_TASKS_FIX_RUN_ECS_TASK_POLICY } from 'aws-cdk-lib/cx-api'; -const app = new cdk.App(); +const app = new cdk.App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new cdk.Stack(app, 'aws-sfn-tasks-ecs-run-task-ref-task-definition'); stack.node.setContext(EC2_RESTRICT_DEFAULT_SECURITY_GROUP, false); stack.node.setContext(STEPFUNCTIONS_TASKS_FIX_RUN_ECS_TASK_POLICY, false); 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 3c374a583984d..a6f8fe8a9b24c 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 @@ -17,7 +17,12 @@ import { IntegTest } from '@aws-cdk/integ-tests-alpha'; * -- 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 app = new cdk.App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new cdk.Stack(app, 'aws-sfn-tasks-ecs-run-task'); stack.node.setContext(EC2_RESTRICT_DEFAULT_SECURITY_GROUP, false); stack.node.setContext(STEPFUNCTIONS_TASKS_FIX_RUN_ECS_TASK_POLICY, false); 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 9ed50631515d6..6acd65bc8523c 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 @@ -17,7 +17,12 @@ import { IntegTest } from '@aws-cdk/integ-tests-alpha'; * -- 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 app = new cdk.App({ + postCliContext: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, +}); const stack = new cdk.Stack(app, 'aws-sfn-tasks-ecs-task'); stack.node.setContext(EC2_RESTRICT_DEFAULT_SECURITY_GROUP, false); diff --git a/packages/@aws-cdk/aws-apprunner-alpha/lib/service.ts b/packages/@aws-cdk/aws-apprunner-alpha/lib/service.ts index f9beecdab30b3..3f25b1ed1b681 100644 --- a/packages/@aws-cdk/aws-apprunner-alpha/lib/service.ts +++ b/packages/@aws-cdk/aws-apprunner-alpha/lib/service.ts @@ -1103,6 +1103,7 @@ export interface IService extends cdk.IResource { /** * The ARN of the service. + * @attribute */ readonly serviceArn: string; } @@ -1178,7 +1179,7 @@ export abstract class Secret { /** * The App Runner Service. */ -export class Service extends cdk.Resource implements iam.IGrantable { +export class Service extends cdk.Resource implements IService, iam.IGrantable { /** * Import from service name. */ diff --git a/packages/@aws-cdk/aws-eks-v2-alpha/lib/kubectl-provider.ts b/packages/@aws-cdk/aws-eks-v2-alpha/lib/kubectl-provider.ts index 5823788ededeb..0ddbc3477ff67 100644 --- a/packages/@aws-cdk/aws-eks-v2-alpha/lib/kubectl-provider.ts +++ b/packages/@aws-cdk/aws-eks-v2-alpha/lib/kubectl-provider.ts @@ -2,7 +2,7 @@ import { Construct, IConstruct } from 'constructs'; import { ICluster, Cluster } from './cluster'; import * as iam from 'aws-cdk-lib/aws-iam'; import * as lambda from 'aws-cdk-lib/aws-lambda'; -import { Duration, Stack, NestedStack, Names, CfnCondition, Fn, Aws } from 'aws-cdk-lib/core'; +import { Duration, Stack, Names, CfnCondition, Fn, Aws } from 'aws-cdk-lib/core'; import * as cr from 'aws-cdk-lib/custom-resources'; import { AwsCliLayer } from 'aws-cdk-lib/lambda-layer-awscli'; import { KubectlLayer } from 'aws-cdk-lib/lambda-layer-kubectl'; @@ -61,7 +61,7 @@ export interface IKubectlProvider extends IConstruct { /** * Implementation of Kubectl Lambda */ -export class KubectlProvider extends NestedStack implements IKubectlProvider { +export class KubectlProvider extends Construct implements IKubectlProvider { /** * Take existing provider or create new based on cluster diff --git a/packages/@aws-cdk/aws-eks-v2-alpha/test/cluster.test.ts b/packages/@aws-cdk/aws-eks-v2-alpha/test/cluster.test.ts index 0d8908645dde9..0ac8a5d54c5a8 100644 --- a/packages/@aws-cdk/aws-eks-v2-alpha/test/cluster.test.ts +++ b/packages/@aws-cdk/aws-eks-v2-alpha/test/cluster.test.ts @@ -1084,7 +1084,7 @@ describe('cluster', () => { Type: 'Custom::AWSCDK-EKS-KubernetesResource', Properties: { ServiceToken: { - 'Fn::ImportValue': 'Stack:ExportsOutputFnGetAttawscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6BOutputsStackawscdkawseksKubectlProviderframeworkonEvent8897FD9BArn49BEF20C', + 'Fn::ImportValue': 'Stack:ExportsOutputFnGetAttawscdkawseksKubectlProviderframeworkonEvent0A650005Arn27EC41A8', }, Manifest: '[{\"foo\":\"bar\"}]', ClusterName: { 'Fn::ImportValue': 'Stack:ExportsOutputRefcluster611F8AFFA07FC079' }, @@ -2069,11 +2069,9 @@ describe('cluster', () => { }, }); - // the kubectl provider is inside a nested stack. - const nested = stack.node.tryFindChild('@aws-cdk/aws-eks.KubectlProvider') as cdk.NestedStack; - Template.fromStack(nested).hasResourceProperties('AWS::Lambda::Function', { + Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { VpcConfig: { - SecurityGroupIds: [{ Ref: 'referencetoStackCluster17032651AClusterSecurityGroupId' }], + SecurityGroupIds: [{ 'Fn::GetAtt': ['Cluster192CD0375', 'ClusterSecurityGroupId'] }], }, }); }); @@ -2101,9 +2099,7 @@ describe('cluster', () => { }, }); - // the kubectl provider is inside a nested stack. - const nested = stack.node.tryFindChild('@aws-cdk/aws-eks.KubectlProvider') as cdk.NestedStack; - Template.fromStack(nested).hasResourceProperties('AWS::Lambda::Function', { + Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { Environment: { Variables: { Foo: 'Bar', @@ -2139,11 +2135,9 @@ describe('cluster', () => { }, }); - // the kubectl provider is inside a nested stack. - const nested = stack.node.tryFindChild('@aws-cdk/aws-eks.KubectlProvider') as cdk.NestedStack; - Template.fromStack(nested).hasResourceProperties('AWS::Lambda::Function', { + Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { Role: { - Ref: 'referencetoStackKubectlIamRole02F8947EArn', + 'Fn::GetAtt': ['awscdkawseksKubectlProviderframeworkonEventServiceRoleF4FAF053', 'Arn'], }, }); }); @@ -2165,10 +2159,9 @@ describe('cluster', () => { chart, }); - const nested = stack.node.tryFindChild('Imported-KubectlProvider') as cdk.NestedStack; - Template.fromStack(nested).hasResourceProperties('AWS::Lambda::Function', { + Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { Role: { - Ref: 'referencetoKubectlLambdaRole7D084D94Arn', + 'Fn::GetAtt': ['ImportedKubectlProviderframeworkonEventServiceRole6603B49A', 'Arn'], }, }); Template.fromStack(stack).hasResourceProperties(HelmChart.RESOURCE_TYPE, { @@ -2199,11 +2192,9 @@ describe('cluster', () => { vpcSubnets: [{ subnetType: ec2.SubnetType.PUBLIC }], }); - const nested = stack.node.tryFindChild('@aws-cdk/aws-eks.KubectlProvider') as cdk.NestedStack; - // we don't attach vpc config in case endpoint is public only, regardless of whether // the vpc has private subnets or not. - Template.fromStack(nested).hasResourceProperties('AWS::Lambda::Function', { + Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { VpcConfig: Match.absent(), }); }); @@ -2217,11 +2208,9 @@ describe('cluster', () => { endpointAccess: eks.EndpointAccess.PUBLIC, }); - const nested = stack.node.tryFindChild('@aws-cdk/aws-eks.KubectlProvider') as cdk.NestedStack; - // we don't attach vpc config in case endpoint is public only, regardless of whether // the vpc has private subnets or not. - Template.fromStack(nested).hasResourceProperties('AWS::Lambda::Function', { + Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { VpcConfig: Match.absent(), }); }); @@ -2248,11 +2237,9 @@ describe('cluster', () => { endpointAccess: eks.EndpointAccess.PRIVATE, }); - const nested = stack.node.tryFindChild('@aws-cdk/aws-eks.KubectlProvider') as cdk.NestedStack; - - const functions = Template.fromStack(nested).findResources('AWS::Lambda::Function'); - expect(functions.Handler886CB40B.Properties.VpcConfig.SubnetIds.length).not.toEqual(0); - expect(functions.Handler886CB40B.Properties.VpcConfig.SecurityGroupIds.length).not.toEqual(0); + const functions = Template.fromStack(stack).findResources('AWS::Lambda::Function'); + expect(functions.awscdkawseksKubectlProviderHandlerAABA4423.Properties.VpcConfig.SubnetIds.length).not.toEqual(0); + expect(functions.awscdkawseksKubectlProviderHandlerAABA4423.Properties.VpcConfig.SecurityGroupIds.length).not.toEqual(0); }); test('private and non restricted public without private subnets', () => { @@ -2265,11 +2252,9 @@ describe('cluster', () => { vpcSubnets: [{ subnetType: ec2.SubnetType.PUBLIC }], }); - const nested = stack.node.tryFindChild('@aws-cdk/aws-eks.KubectlProvider') as cdk.NestedStack; - // we don't have private subnets, but we don't need them since public access // is not restricted. - Template.fromStack(nested).hasResourceProperties('AWS::Lambda::Function', { + Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { VpcConfig: Match.absent(), }); }); @@ -2283,12 +2268,10 @@ describe('cluster', () => { endpointAccess: eks.EndpointAccess.PUBLIC_AND_PRIVATE, }); - const nested = stack.node.tryFindChild('@aws-cdk/aws-eks.KubectlProvider') as cdk.NestedStack; - // we have private subnets so we should use them. - const functions = Template.fromStack(nested).findResources('AWS::Lambda::Function'); - expect(functions.Handler886CB40B.Properties.VpcConfig.SubnetIds.length).not.toEqual(0); - expect(functions.Handler886CB40B.Properties.VpcConfig.SecurityGroupIds.length).not.toEqual(0); + const functions = Template.fromStack(stack).findResources('AWS::Lambda::Function'); + expect(functions.awscdkawseksKubectlProviderHandlerAABA4423.Properties.VpcConfig.SubnetIds.length).not.toEqual(0); + expect(functions.awscdkawseksKubectlProviderHandlerAABA4423.Properties.VpcConfig.SecurityGroupIds.length).not.toEqual(0); }); test('private and restricted public without private subnets', () => { @@ -2313,12 +2296,10 @@ describe('cluster', () => { endpointAccess: eks.EndpointAccess.PUBLIC_AND_PRIVATE.onlyFrom('1.2.3.4/32'), }); - const nested = stack.node.tryFindChild('@aws-cdk/aws-eks.KubectlProvider') as cdk.NestedStack; - // we have private subnets so we should use them. - const functions = Template.fromStack(nested).findResources('AWS::Lambda::Function'); - expect(functions.Handler886CB40B.Properties.VpcConfig.SubnetIds.length).not.toEqual(0); - expect(functions.Handler886CB40B.Properties.VpcConfig.SecurityGroupIds.length).not.toEqual(0); + const functions = Template.fromStack(stack).findResources('AWS::Lambda::Function'); + expect(functions.awscdkawseksKubectlProviderHandlerAABA4423.Properties.VpcConfig.SubnetIds.length).not.toEqual(0); + expect(functions.awscdkawseksKubectlProviderHandlerAABA4423.Properties.VpcConfig.SecurityGroupIds.length).not.toEqual(0); }); test('private endpoint access selects only private subnets from looked up vpc', () => { @@ -2372,8 +2353,7 @@ describe('cluster', () => { endpointAccess: eks.EndpointAccess.PRIVATE, }); - const nested = stack.node.tryFindChild('@aws-cdk/aws-eks.KubectlProvider') as cdk.NestedStack; - Template.fromStack(nested).hasResourceProperties('AWS::Lambda::Function', { + Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { VpcConfig: { SubnetIds: ['subnet-private-in-us-east-1a'] }, }); }); @@ -2437,8 +2417,7 @@ describe('cluster', () => { }], }); - const nested = stack.node.tryFindChild('@aws-cdk/aws-eks.KubectlProvider') as cdk.NestedStack; - Template.fromStack(nested).hasResourceProperties('AWS::Lambda::Function', { + Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { VpcConfig: { SubnetIds: ['subnet-private-in-us-east-1a'] }, }); }); @@ -2462,11 +2441,10 @@ describe('cluster', () => { }], }); - const nested = stack.node.tryFindChild('@aws-cdk/aws-eks.KubectlProvider') as cdk.NestedStack; - Template.fromStack(nested).hasResourceProperties('AWS::Lambda::Function', { + Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { VpcConfig: { SubnetIds: [ - { Ref: 'referencetoStackVpcPrivateSubnet1Subnet8E6A14CBRef' }, + { Ref: 'VpcPrivateSubnet1Subnet536B997A' }, 'subnet-unknown', ], }, @@ -2488,8 +2466,7 @@ describe('cluster', () => { }], }); - const nested = stack.node.tryFindChild('@aws-cdk/aws-eks.KubectlProvider') as cdk.NestedStack; - Template.fromStack(nested).hasResourceProperties('AWS::Lambda::Function', { + Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { VpcConfig: { SubnetIds: ['subnet1'] }, }); }); @@ -2541,21 +2518,19 @@ describe('cluster', () => { }, }); - // the kubectl provider is inside a nested stack. - const nested = stack.node.tryFindChild('@aws-cdk/aws-eks.KubectlProvider') as cdk.NestedStack; - Template.fromStack(nested).hasResourceProperties('AWS::Lambda::Function', { + Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { VpcConfig: { SecurityGroupIds: [ { - Ref: 'referencetoStackCluster17032651AClusterSecurityGroupId', + 'Fn::GetAtt': ['Cluster192CD0375', 'ClusterSecurityGroupId'], }, ], SubnetIds: [ { - Ref: 'referencetoStackVpcPrivate1Subnet1Subnet6764A0F6Ref', + Ref: 'VpcPrivate1Subnet1SubnetC688B2B1', }, { - Ref: 'referencetoStackVpcPrivate1Subnet2SubnetDFD49645Ref', + Ref: 'VpcPrivate1Subnet2SubnetA2AF15C7', }, ], }, @@ -2604,10 +2579,8 @@ describe('cluster', () => { }, }); - // the kubectl provider is inside a nested stack. - const nested = stack.node.tryFindChild('@aws-cdk/aws-eks.KubectlProvider') as cdk.NestedStack; - const functions = Template.fromStack(nested).findResources('AWS::Lambda::Function'); - expect(functions.Handler886CB40B.Properties.VpcConfig.SubnetIds.length).toEqual(16); + const functions = Template.fromStack(stack).findResources('AWS::Lambda::Function'); + expect(functions.awscdkawseksKubectlProviderHandlerAABA4423.Properties.VpcConfig.SubnetIds.length).toEqual(16); }); test('kubectl provider considers vpc subnet selection', () => { @@ -2653,27 +2626,25 @@ describe('cluster', () => { }, }); - // the kubectl provider is inside a nested stack. - const nested = stack.node.tryFindChild('@aws-cdk/aws-eks.KubectlProvider') as cdk.NestedStack; - Template.fromStack(nested).hasResourceProperties('AWS::Lambda::Function', { + Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { VpcConfig: { SecurityGroupIds: [ { - Ref: 'referencetoStackCluster17032651AClusterSecurityGroupId', + 'Fn::GetAtt': ['Cluster192CD0375', 'ClusterSecurityGroupId'], }, ], SubnetIds: [ { - Ref: 'referencetoStackVpcPrivate1Subnet1Subnet6764A0F6Ref', + Ref: 'VpcPrivate1Subnet1SubnetC688B2B1', }, { - Ref: 'referencetoStackVpcPrivate1Subnet2SubnetDFD49645Ref', + Ref: 'VpcPrivate1Subnet2SubnetA2AF15C7', }, { - Ref: 'referencetoStackVpcPrivate2Subnet1Subnet586AD392Ref', + Ref: 'VpcPrivate2Subnet1SubnetE13E2E30', }, { - Ref: 'referencetoStackVpcPrivate2Subnet2SubnetE42148C0Ref', + Ref: 'VpcPrivate2Subnet2Subnet158A38AB', }, ], }, @@ -2734,8 +2705,8 @@ describe('cluster', () => { expect(resources[expectedKubernetesGetId].Properties).toEqual({ ServiceToken: { 'Fn::GetAtt': [ - 'awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B', - 'Outputs.StackawscdkawseksKubectlProviderframeworkonEvent8897FD9BArn', + 'awscdkawseksKubectlProviderframeworkonEvent0A650005', + 'Arn', ], }, ClusterName: { @@ -2773,10 +2744,9 @@ describe('cluster', () => { }); // THEN - const providerStack = stack.node.tryFindChild('@aws-cdk/aws-eks.KubectlProvider') as cdk.NestedStack; - Template.fromStack(providerStack).hasResourceProperties('AWS::Lambda::Function', { + Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { Layers: [ - { Ref: 'AwsCliLayerF44AAF94' }, + { Ref: 'awscdkawseksKubectlProviderAwsCliLayerF72FE066' }, 'arn:of:layer', ], }); @@ -2833,11 +2803,10 @@ describe('cluster', () => { }); // THEN - const providerStack = stack.node.tryFindChild('@aws-cdk/aws-eks.KubectlProvider') as cdk.NestedStack; - Template.fromStack(providerStack).hasResourceProperties('AWS::Lambda::Function', { + Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { Layers: [ 'arn:of:layer', - { Ref: 'KubectlLayer600207B5' }, + { Ref: 'awscdkawseksKubectlProviderKubectlLayerA7F2FE55' }, ], }); }); @@ -2870,42 +2839,6 @@ describe('cluster', () => { }); }); - test('custom memory size for kubectl provider', () => { - // GIVEN - const { stack, vpc, app } = testFixture(); - - // WHEN - new eks.Cluster(stack, 'Cluster', { - vpc, - version: CLUSTER_VERSION, - kubectlMemory: cdk.Size.gibibytes(2), - }); - - // THEN - const casm = app.synth(); - const providerNestedStackTemplate = JSON.parse(fs.readFileSync(path.join(casm.directory, 'StackawscdkawseksKubectlProvider7346F799.nested.template.json'), 'utf-8')); - expect(providerNestedStackTemplate?.Resources?.Handler886CB40B?.Properties?.MemorySize).toEqual(2048); - }); - - test('custom memory size for imported clusters', () => { - // GIVEN - const { stack, app } = testFixture(); - - // WHEN - const cluster = eks.Cluster.fromClusterAttributes(stack, 'Imported', { - clusterName: 'my-cluster', - kubectlRoleArn: 'arn:aws:iam::123456789012:role/MyRole', - kubectlMemory: cdk.Size.gibibytes(4), - }); - - cluster.addManifest('foo', { bar: 123 }); - - // THEN - const casm = app.synth(); - const providerNestedStackTemplate = JSON.parse(fs.readFileSync(path.join(casm.directory, 'StackStackImported1CBA9C50KubectlProviderAA00BA49.nested.template.json'), 'utf-8')); - expect(providerNestedStackTemplate?.Resources?.Handler886CB40B?.Properties?.MemorySize).toEqual(4096); - }); - test('create a cluster using custom kubernetes network config', () => { // GIVEN const { stack } = testFixture(); diff --git a/packages/@aws-cdk/aws-eks-v2-alpha/test/k8s-object-value.test.ts b/packages/@aws-cdk/aws-eks-v2-alpha/test/k8s-object-value.test.ts index e82267161c35f..af23712d33d1c 100644 --- a/packages/@aws-cdk/aws-eks-v2-alpha/test/k8s-object-value.test.ts +++ b/packages/@aws-cdk/aws-eks-v2-alpha/test/k8s-object-value.test.ts @@ -29,8 +29,8 @@ describe('k8s object value', () => { Properties: { ServiceToken: { 'Fn::GetAtt': [ - 'awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B', - 'Outputs.awscdkawseksKubectlProviderframeworkonEvent0A650005Arn', + 'awscdkawseksKubectlProviderframeworkonEvent0A650005', + 'Arn', ], }, ClusterName: { Ref: 'MyCluster4C1BA579' }, @@ -70,8 +70,8 @@ describe('k8s object value', () => { Properties: { ServiceToken: { 'Fn::GetAtt': [ - 'awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B', - 'Outputs.awscdkawseksKubectlProviderframeworkonEvent0A650005Arn', + 'awscdkawseksKubectlProviderframeworkonEvent0A650005', + 'Arn', ], }, ClusterName: { Ref: 'MyCluster4C1BA579' }, diff --git a/packages/@aws-cdk/aws-eks-v2-alpha/test/k8s-patch.test.ts b/packages/@aws-cdk/aws-eks-v2-alpha/test/k8s-patch.test.ts index 32e2acbfd13a9..c76e5dcfdd9ee 100644 --- a/packages/@aws-cdk/aws-eks-v2-alpha/test/k8s-patch.test.ts +++ b/packages/@aws-cdk/aws-eks-v2-alpha/test/k8s-patch.test.ts @@ -23,8 +23,8 @@ describe('k8s patch', () => { Template.fromStack(stack).hasResourceProperties('Custom::AWSCDK-EKS-KubernetesPatch', { ServiceToken: { 'Fn::GetAtt': [ - 'awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B', - 'Outputs.awscdkawseksKubectlProviderframeworkonEvent0A650005Arn', + 'awscdkawseksKubectlProviderframeworkonEvent0A650005', + 'Arn', ], }, ResourceName: 'myResourceName', diff --git a/packages/@aws-cdk/aws-eks-v2-alpha/test/service-account.test.ts b/packages/@aws-cdk/aws-eks-v2-alpha/test/service-account.test.ts index e2f4a79dcc24b..3ddbdabd9ea12 100644 --- a/packages/@aws-cdk/aws-eks-v2-alpha/test/service-account.test.ts +++ b/packages/@aws-cdk/aws-eks-v2-alpha/test/service-account.test.ts @@ -18,8 +18,8 @@ describe('service account', () => { Template.fromStack(stack).hasResourceProperties(eks.KubernetesManifest.RESOURCE_TYPE, { ServiceToken: { 'Fn::GetAtt': [ - 'awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B', - 'Outputs.StackawscdkawseksKubectlProviderframeworkonEvent8897FD9BArn', + 'awscdkawseksKubectlProviderframeworkonEvent0A650005', + 'Arn', ], }, Manifest: { @@ -83,8 +83,8 @@ describe('service account', () => { Template.fromStack(stack).hasResourceProperties(eks.KubernetesManifest.RESOURCE_TYPE, { ServiceToken: { 'Fn::GetAtt': [ - 'awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B', - 'Outputs.StackawscdkawseksKubectlProviderframeworkonEvent8897FD9BArn', + 'awscdkawseksKubectlProviderframeworkonEvent0A650005', + 'Arn', ], }, Manifest: { @@ -141,8 +141,8 @@ describe('service account', () => { Template.fromStack(stack).hasResourceProperties(eks.KubernetesManifest.RESOURCE_TYPE, { ServiceToken: { 'Fn::GetAtt': [ - 'awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B', - 'Outputs.StackawscdkawseksKubectlProviderframeworkonEvent8897FD9BArn', + 'awscdkawseksKubectlProviderframeworkonEvent0A650005', + 'Arn', ], }, Manifest: { @@ -190,8 +190,8 @@ describe('service account', () => { Template.fromStack(stack).hasResourceProperties(eks.KubernetesManifest.RESOURCE_TYPE, { ServiceToken: { 'Fn::GetAtt': [ - 'StackClusterF0EB02FAKubectlProviderNestedStackStackClusterF0EB02FAKubectlProviderNestedStackResource739D12C4', - 'Outputs.StackStackClusterF0EB02FAKubectlProviderframeworkonEvent8377F076Arn', + 'StackClusterF0EB02FAKubectlProviderframeworkonEvent0A3AB271', + 'Arn', ], }, PruneLabel: 'aws.cdk.eks/prune-c8d8e1722a4f3ed332f8ac74cb3d962f01fbb62291', diff --git a/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/asset.b98abee59e034ed29eeb601684dc34752baa86509a7d457d72305d4e19ecc80b.bundle/index.js b/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/asset.bfcf4228d6660f50e81f19efdb64c6388dda6796296eb239decdff1dbc2f4981.bundle/index.js similarity index 99% rename from packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/asset.b98abee59e034ed29eeb601684dc34752baa86509a7d457d72305d4e19ecc80b.bundle/index.js rename to packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/asset.bfcf4228d6660f50e81f19efdb64c6388dda6796296eb239decdff1dbc2f4981.bundle/index.js index b585fd2bb4a19..60e59701bc0e1 100644 --- a/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/asset.b98abee59e034ed29eeb601684dc34752baa86509a7d457d72305d4e19ecc80b.bundle/index.js +++ b/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/asset.bfcf4228d6660f50e81f19efdb64c6388dda6796296eb239decdff1dbc2f4981.bundle/index.js @@ -152,7 +152,6 @@ var init_matcher = __esm({ */ toHumanStrings() { const failures = new Array(); - debugger; recurse(this, []); return failures.map((r) => { const loc = r.path.length === 0 ? "" : ` at /${r.path.join("/")}`; @@ -23574,9 +23573,9 @@ var require_safer = __commonJS({ } }); -// ../../../node_modules/iconv-lite/lib/bom-handling.js +// ../../../node_modules/encoding/node_modules/iconv-lite/lib/bom-handling.js var require_bom_handling = __commonJS({ - "../../../node_modules/iconv-lite/lib/bom-handling.js"(exports2) { + "../../../node_modules/encoding/node_modules/iconv-lite/lib/bom-handling.js"(exports2) { "use strict"; var BOMChar = "\uFEFF"; exports2.PrependBOM = PrependBOMWrapper; @@ -23618,9 +23617,9 @@ var require_bom_handling = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/internal.js +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/internal.js var require_internal = __commonJS({ - "../../../node_modules/iconv-lite/encodings/internal.js"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/internal.js"(exports2, module2) { "use strict"; var Buffer2 = require_safer().Buffer; module2.exports = { @@ -23770,9 +23769,9 @@ var require_internal = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/utf32.js +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/utf32.js var require_utf32 = __commonJS({ - "../../../node_modules/iconv-lite/encodings/utf32.js"(exports2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/utf32.js"(exports2) { "use strict"; var Buffer2 = require_safer().Buffer; exports2._utf32 = Utf32Codec; @@ -23989,9 +23988,9 @@ var require_utf32 = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/utf16.js +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/utf16.js var require_utf16 = __commonJS({ - "../../../node_modules/iconv-lite/encodings/utf16.js"(exports2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/utf16.js"(exports2) { "use strict"; var Buffer2 = require_safer().Buffer; exports2.utf16be = Utf16BECodec; @@ -24123,9 +24122,9 @@ var require_utf16 = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/utf7.js +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/utf7.js var require_utf7 = __commonJS({ - "../../../node_modules/iconv-lite/encodings/utf7.js"(exports2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/utf7.js"(exports2) { "use strict"; var Buffer2 = require_safer().Buffer; exports2.utf7 = Utf7Codec; @@ -24324,9 +24323,9 @@ var require_utf7 = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/sbcs-codec.js +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-codec.js var require_sbcs_codec = __commonJS({ - "../../../node_modules/iconv-lite/encodings/sbcs-codec.js"(exports2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-codec.js"(exports2) { "use strict"; var Buffer2 = require_safer().Buffer; exports2._sbcs = SBCSCodec; @@ -24380,9 +24379,9 @@ var require_sbcs_codec = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/sbcs-data.js +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-data.js var require_sbcs_data = __commonJS({ - "../../../node_modules/iconv-lite/encodings/sbcs-data.js"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-data.js"(exports2, module2) { "use strict"; module2.exports = { // Not supported by iconv, not sure why. @@ -24533,9 +24532,9 @@ var require_sbcs_data = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/sbcs-data-generated.js +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-data-generated.js var require_sbcs_data_generated = __commonJS({ - "../../../node_modules/iconv-lite/encodings/sbcs-data-generated.js"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-data-generated.js"(exports2, module2) { "use strict"; module2.exports = { "437": "cp437", @@ -24988,9 +24987,9 @@ var require_sbcs_data_generated = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/dbcs-codec.js +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/dbcs-codec.js var require_dbcs_codec = __commonJS({ - "../../../node_modules/iconv-lite/encodings/dbcs-codec.js"(exports2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/dbcs-codec.js"(exports2) { "use strict"; var Buffer2 = require_safer().Buffer; exports2._dbcs = DBCSCodec; @@ -25405,9 +25404,9 @@ var require_dbcs_codec = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/tables/shiftjis.json +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/shiftjis.json var require_shiftjis = __commonJS({ - "../../../node_modules/iconv-lite/encodings/tables/shiftjis.json"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/shiftjis.json"(exports2, module2) { module2.exports = [ ["0", "\0", 128], ["a1", "\uFF61", 62], @@ -25536,9 +25535,9 @@ var require_shiftjis = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/tables/eucjp.json +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/eucjp.json var require_eucjp = __commonJS({ - "../../../node_modules/iconv-lite/encodings/tables/eucjp.json"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/eucjp.json"(exports2, module2) { module2.exports = [ ["0", "\0", 127], ["8ea1", "\uFF61", 62], @@ -25724,9 +25723,9 @@ var require_eucjp = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/tables/cp936.json +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/cp936.json var require_cp936 = __commonJS({ - "../../../node_modules/iconv-lite/encodings/tables/cp936.json"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/cp936.json"(exports2, module2) { module2.exports = [ ["0", "\0", 127, "\u20AC"], ["8140", "\u4E02\u4E04\u4E05\u4E06\u4E0F\u4E12\u4E17\u4E1F\u4E20\u4E21\u4E23\u4E26\u4E29\u4E2E\u4E2F\u4E31\u4E33\u4E35\u4E37\u4E3C\u4E40\u4E41\u4E42\u4E44\u4E46\u4E4A\u4E51\u4E55\u4E57\u4E5A\u4E5B\u4E62\u4E63\u4E64\u4E65\u4E67\u4E68\u4E6A", 5, "\u4E72\u4E74", 9, "\u4E7F", 6, "\u4E87\u4E8A"], @@ -25994,9 +25993,9 @@ var require_cp936 = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/tables/gbk-added.json +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/gbk-added.json var require_gbk_added = __commonJS({ - "../../../node_modules/iconv-lite/encodings/tables/gbk-added.json"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/gbk-added.json"(exports2, module2) { module2.exports = [ ["a140", "\uE4C6", 62], ["a180", "\uE505", 32], @@ -26056,16 +26055,16 @@ var require_gbk_added = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json var require_gb18030_ranges = __commonJS({ - "../../../node_modules/iconv-lite/encodings/tables/gb18030-ranges.json"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json"(exports2, module2) { module2.exports = { uChars: [128, 165, 169, 178, 184, 216, 226, 235, 238, 244, 248, 251, 253, 258, 276, 284, 300, 325, 329, 334, 364, 463, 465, 467, 469, 471, 473, 475, 477, 506, 594, 610, 712, 716, 730, 930, 938, 962, 970, 1026, 1104, 1106, 8209, 8215, 8218, 8222, 8231, 8241, 8244, 8246, 8252, 8365, 8452, 8454, 8458, 8471, 8482, 8556, 8570, 8596, 8602, 8713, 8720, 8722, 8726, 8731, 8737, 8740, 8742, 8748, 8751, 8760, 8766, 8777, 8781, 8787, 8802, 8808, 8816, 8854, 8858, 8870, 8896, 8979, 9322, 9372, 9548, 9588, 9616, 9622, 9634, 9652, 9662, 9672, 9676, 9680, 9702, 9735, 9738, 9793, 9795, 11906, 11909, 11913, 11917, 11928, 11944, 11947, 11951, 11956, 11960, 11964, 11979, 12284, 12292, 12312, 12319, 12330, 12351, 12436, 12447, 12535, 12543, 12586, 12842, 12850, 12964, 13200, 13215, 13218, 13253, 13263, 13267, 13270, 13384, 13428, 13727, 13839, 13851, 14617, 14703, 14801, 14816, 14964, 15183, 15471, 15585, 16471, 16736, 17208, 17325, 17330, 17374, 17623, 17997, 18018, 18212, 18218, 18301, 18318, 18760, 18811, 18814, 18820, 18823, 18844, 18848, 18872, 19576, 19620, 19738, 19887, 40870, 59244, 59336, 59367, 59413, 59417, 59423, 59431, 59437, 59443, 59452, 59460, 59478, 59493, 63789, 63866, 63894, 63976, 63986, 64016, 64018, 64021, 64025, 64034, 64037, 64042, 65074, 65093, 65107, 65112, 65127, 65132, 65375, 65510, 65536], gbChars: [0, 36, 38, 45, 50, 81, 89, 95, 96, 100, 103, 104, 105, 109, 126, 133, 148, 172, 175, 179, 208, 306, 307, 308, 309, 310, 311, 312, 313, 341, 428, 443, 544, 545, 558, 741, 742, 749, 750, 805, 819, 820, 7922, 7924, 7925, 7927, 7934, 7943, 7944, 7945, 7950, 8062, 8148, 8149, 8152, 8164, 8174, 8236, 8240, 8262, 8264, 8374, 8380, 8381, 8384, 8388, 8390, 8392, 8393, 8394, 8396, 8401, 8406, 8416, 8419, 8424, 8437, 8439, 8445, 8482, 8485, 8496, 8521, 8603, 8936, 8946, 9046, 9050, 9063, 9066, 9076, 9092, 9100, 9108, 9111, 9113, 9131, 9162, 9164, 9218, 9219, 11329, 11331, 11334, 11336, 11346, 11361, 11363, 11366, 11370, 11372, 11375, 11389, 11682, 11686, 11687, 11692, 11694, 11714, 11716, 11723, 11725, 11730, 11736, 11982, 11989, 12102, 12336, 12348, 12350, 12384, 12393, 12395, 12397, 12510, 12553, 12851, 12962, 12973, 13738, 13823, 13919, 13933, 14080, 14298, 14585, 14698, 15583, 15847, 16318, 16434, 16438, 16481, 16729, 17102, 17122, 17315, 17320, 17402, 17418, 17859, 17909, 17911, 17915, 17916, 17936, 17939, 17961, 18664, 18703, 18814, 18962, 19043, 33469, 33470, 33471, 33484, 33485, 33490, 33497, 33501, 33505, 33513, 33520, 33536, 33550, 37845, 37921, 37948, 38029, 38038, 38064, 38065, 38066, 38069, 38075, 38076, 38078, 39108, 39109, 39113, 39114, 39115, 39116, 39265, 39394, 189e3] }; } }); -// ../../../node_modules/iconv-lite/encodings/tables/cp949.json +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/cp949.json var require_cp949 = __commonJS({ - "../../../node_modules/iconv-lite/encodings/tables/cp949.json"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/cp949.json"(exports2, module2) { module2.exports = [ ["0", "\0", 127], ["8141", "\uAC02\uAC03\uAC05\uAC06\uAC0B", 4, "\uAC18\uAC1E\uAC1F\uAC21\uAC22\uAC23\uAC25", 6, "\uAC2E\uAC32\uAC33\uAC34"], @@ -26342,9 +26341,9 @@ var require_cp949 = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/tables/cp950.json +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/cp950.json var require_cp950 = __commonJS({ - "../../../node_modules/iconv-lite/encodings/tables/cp950.json"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/cp950.json"(exports2, module2) { module2.exports = [ ["0", "\0", 127], ["a140", "\u3000\uFF0C\u3001\u3002\uFF0E\u2027\uFF1B\uFF1A\uFF1F\uFF01\uFE30\u2026\u2025\uFE50\uFE51\uFE52\xB7\uFE54\uFE55\uFE56\uFE57\uFF5C\u2013\uFE31\u2014\uFE33\u2574\uFE34\uFE4F\uFF08\uFF09\uFE35\uFE36\uFF5B\uFF5D\uFE37\uFE38\u3014\u3015\uFE39\uFE3A\u3010\u3011\uFE3B\uFE3C\u300A\u300B\uFE3D\uFE3E\u3008\u3009\uFE3F\uFE40\u300C\u300D\uFE41\uFE42\u300E\u300F\uFE43\uFE44\uFE59\uFE5A"], @@ -26525,9 +26524,9 @@ var require_cp950 = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/tables/big5-added.json +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/big5-added.json var require_big5_added = __commonJS({ - "../../../node_modules/iconv-lite/encodings/tables/big5-added.json"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/big5-added.json"(exports2, module2) { module2.exports = [ ["8740", "\u43F0\u4C32\u4603\u45A6\u4578\u{27267}\u4D77\u45B3\u{27CB1}\u4CE2\u{27CC5}\u3B95\u4736\u4744\u4C47\u4C40\u{242BF}\u{23617}\u{27352}\u{26E8B}\u{270D2}\u4C57\u{2A351}\u474F\u45DA\u4C85\u{27C6C}\u4D07\u4AA4\u46A1\u{26B23}\u7225\u{25A54}\u{21A63}\u{23E06}\u{23F61}\u664D\u56FB"], ["8767", "\u7D95\u591D\u{28BB9}\u3DF4\u9734\u{27BEF}\u5BDB\u{21D5E}\u5AA4\u3625\u{29EB0}\u5AD1\u5BB7\u5CFC\u676E\u8593\u{29945}\u7461\u749D\u3875\u{21D53}\u{2369E}\u{26021}\u3EEC"], @@ -26653,9 +26652,9 @@ var require_big5_added = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/dbcs-data.js +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/dbcs-data.js var require_dbcs_data = __commonJS({ - "../../../node_modules/iconv-lite/encodings/dbcs-data.js"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/dbcs-data.js"(exports2, module2) { "use strict"; module2.exports = { // == Japanese/ShiftJIS ==================================================== @@ -26900,9 +26899,9 @@ var require_dbcs_data = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/index.js +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/index.js var require_encodings = __commonJS({ - "../../../node_modules/iconv-lite/encodings/index.js"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/index.js"(exports2, module2) { "use strict"; var modules = [ require_internal(), @@ -26927,9 +26926,9 @@ var require_encodings = __commonJS({ } }); -// ../../../node_modules/iconv-lite/lib/streams.js +// ../../../node_modules/encoding/node_modules/iconv-lite/lib/streams.js var require_streams = __commonJS({ - "../../../node_modules/iconv-lite/lib/streams.js"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/lib/streams.js"(exports2, module2) { "use strict"; var Buffer2 = require_safer().Buffer; module2.exports = function(stream_module) { @@ -27022,9 +27021,9 @@ var require_streams = __commonJS({ } }); -// ../../../node_modules/iconv-lite/lib/index.js +// ../../../node_modules/encoding/node_modules/iconv-lite/lib/index.js var require_lib2 = __commonJS({ - "../../../node_modules/iconv-lite/lib/index.js"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/lib/index.js"(exports2, module2) { "use strict"; var Buffer2 = require_safer().Buffer; var bomHandling = require_bom_handling(); diff --git a/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/cdk-integ-lambda-golang-provided-al2023.assets.json b/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/cdk-integ-lambda-golang-provided-al2023.assets.json index 5fe8b813a1182..455f1c8bbbd4a 100644 --- a/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/cdk-integ-lambda-golang-provided-al2023.assets.json +++ b/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/cdk-integ-lambda-golang-provided-al2023.assets.json @@ -1,5 +1,5 @@ { - "version": "38.0.1", + "version": "39.0.0", "files": { "3ca3899fd89ffddaa38e2f556f7357f6e178b0d94502b5dc21dce70490ed642f": { "source": { @@ -14,7 +14,7 @@ } } }, - "34293767b5134bd2028237f5362259b4594a9e316e6ac19bbc42f610af769649": { + "3f0e36eb78dda330bbc187441af285d86fc089f15d6e7bd0cc02e6c2ee42df39": { "source": { "path": "cdk-integ-lambda-golang-provided-al2023.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "34293767b5134bd2028237f5362259b4594a9e316e6ac19bbc42f610af769649.json", + "objectKey": "3f0e36eb78dda330bbc187441af285d86fc089f15d6e7bd0cc02e6c2ee42df39.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/cdk-integ-lambda-golang-provided-al2023.template.json b/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/cdk-integ-lambda-golang-provided-al2023.template.json index 435eea9fad102..b98ea67886bd3 100644 --- a/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/cdk-integ-lambda-golang-provided-al2023.template.json +++ b/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/cdk-integ-lambda-golang-provided-al2023.template.json @@ -1,6 +1,6 @@ { "Resources": { - "gohandlerprovidedal20ServiceRole8426AEF6": { + "gohandlerprovidedal2ServiceRole0304E98B": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { @@ -31,7 +31,7 @@ ] } }, - "gohandlerprovidedal20A3EC5933": { + "gohandlerprovidedal263372523": { "Type": "AWS::Lambda::Function", "Properties": { "Code": { @@ -43,17 +43,17 @@ "Handler": "bootstrap", "Role": { "Fn::GetAtt": [ - "gohandlerprovidedal20ServiceRole8426AEF6", + "gohandlerprovidedal2ServiceRole0304E98B", "Arn" ] }, "Runtime": "provided.al2" }, "DependsOn": [ - "gohandlerprovidedal20ServiceRole8426AEF6" + "gohandlerprovidedal2ServiceRole0304E98B" ] }, - "gohandlerprovidedal20231ServiceRole68A34C3F": { + "gohandlerprovidedal2023ServiceRole27484815": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { @@ -84,7 +84,7 @@ ] } }, - "gohandlerprovidedal2023182E754E4": { + "gohandlerprovidedal2023FA840EAA": { "Type": "AWS::Lambda::Function", "Properties": { "Code": { @@ -96,32 +96,32 @@ "Handler": "bootstrap", "Role": { "Fn::GetAtt": [ - "gohandlerprovidedal20231ServiceRole68A34C3F", + "gohandlerprovidedal2023ServiceRole27484815", "Arn" ] }, "Runtime": "provided.al2023" }, "DependsOn": [ - "gohandlerprovidedal20231ServiceRole68A34C3F" + "gohandlerprovidedal2023ServiceRole27484815" ] } }, "Outputs": { - "ExportsOutputRefgohandlerprovidedal20A3EC5933F5EA8606": { + "ExportsOutputRefgohandlerprovidedal2633725233CB9A54A": { "Value": { - "Ref": "gohandlerprovidedal20A3EC5933" + "Ref": "gohandlerprovidedal263372523" }, "Export": { - "Name": "cdk-integ-lambda-golang-provided-al2023:ExportsOutputRefgohandlerprovidedal20A3EC5933F5EA8606" + "Name": "cdk-integ-lambda-golang-provided-al2023:ExportsOutputRefgohandlerprovidedal2633725233CB9A54A" } }, - "ExportsOutputRefgohandlerprovidedal2023182E754E4D088A80B": { + "ExportsOutputRefgohandlerprovidedal2023FA840EAA50E75800": { "Value": { - "Ref": "gohandlerprovidedal2023182E754E4" + "Ref": "gohandlerprovidedal2023FA840EAA" }, "Export": { - "Name": "cdk-integ-lambda-golang-provided-al2023:ExportsOutputRefgohandlerprovidedal2023182E754E4D088A80B" + "Name": "cdk-integ-lambda-golang-provided-al2023:ExportsOutputRefgohandlerprovidedal2023FA840EAA50E75800" } } }, diff --git a/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/cdk.out b/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/cdk.out index c6e612584e352..91e1a8b9901d5 100644 --- a/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"38.0.1"} \ No newline at end of file +{"version":"39.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/integ.json b/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/integ.json index 8ba08298d5139..8ec551e6624d8 100644 --- a/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "38.0.1", + "version": "39.0.0", "testCases": { "lambda-go-runtime/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/lambdagoruntimeDefaultTestDeployAssert366012A1.assets.json b/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/lambdagoruntimeDefaultTestDeployAssert366012A1.assets.json index 6e4c211319246..0c3194218bf12 100644 --- a/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/lambdagoruntimeDefaultTestDeployAssert366012A1.assets.json +++ b/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/lambdagoruntimeDefaultTestDeployAssert366012A1.assets.json @@ -1,20 +1,20 @@ { - "version": "38.0.1", + "version": "39.0.0", "files": { - "b98abee59e034ed29eeb601684dc34752baa86509a7d457d72305d4e19ecc80b": { + "bfcf4228d6660f50e81f19efdb64c6388dda6796296eb239decdff1dbc2f4981": { "source": { - "path": "asset.b98abee59e034ed29eeb601684dc34752baa86509a7d457d72305d4e19ecc80b.bundle", + "path": "asset.bfcf4228d6660f50e81f19efdb64c6388dda6796296eb239decdff1dbc2f4981.bundle", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "b98abee59e034ed29eeb601684dc34752baa86509a7d457d72305d4e19ecc80b.zip", + "objectKey": "bfcf4228d6660f50e81f19efdb64c6388dda6796296eb239decdff1dbc2f4981.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "665413b584435ebdf5f793a7d2380a56e3148d53574757886dc43130ffda7d9d": { + "ce322481ad3bfac89a715809309aa35d5b70de5dfc6cd6732f7bd3c6a590023d": { "source": { "path": "lambdagoruntimeDefaultTestDeployAssert366012A1.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "665413b584435ebdf5f793a7d2380a56e3148d53574757886dc43130ffda7d9d.json", + "objectKey": "ce322481ad3bfac89a715809309aa35d5b70de5dfc6cd6732f7bd3c6a590023d.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/lambdagoruntimeDefaultTestDeployAssert366012A1.template.json b/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/lambdagoruntimeDefaultTestDeployAssert366012A1.template.json index fa42272b8ac2c..f53ab7a8ae459 100644 --- a/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/lambdagoruntimeDefaultTestDeployAssert366012A1.template.json +++ b/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/lambdagoruntimeDefaultTestDeployAssert366012A1.template.json @@ -1,6 +1,6 @@ { "Resources": { - "LambdaInvokef3b58fd2af78e934527e05bc469d07dc": { + "LambdaInvoke2b6e8ea895f068736d6c24688beb0ea1": { "Type": "Custom::DeployAssert@SdkCallLambdainvoke", "Properties": { "ServiceToken": { @@ -19,7 +19,7 @@ [ "\"", { - "Fn::ImportValue": "cdk-integ-lambda-golang-provided-al2023:ExportsOutputRefgohandlerprovidedal20A3EC5933F5EA8606" + "Fn::ImportValue": "cdk-integ-lambda-golang-provided-al2023:ExportsOutputRefgohandlerprovidedal2633725233CB9A54A" }, "\"" ] @@ -27,17 +27,17 @@ } }, "flattenResponse": "false", - "salt": "1732467508037" + "salt": "1736374512627" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, - "LambdaInvokef3b58fd2af78e934527e05bc469d07dcInvokeFB39F386": { + "LambdaInvoke2b6e8ea895f068736d6c24688beb0ea1InvokeECEDC4C5": { "Type": "AWS::Lambda::Permission", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { - "Fn::ImportValue": "cdk-integ-lambda-golang-provided-al2023:ExportsOutputRefgohandlerprovidedal20A3EC5933F5EA8606" + "Fn::ImportValue": "cdk-integ-lambda-golang-provided-al2023:ExportsOutputRefgohandlerprovidedal2633725233CB9A54A" }, "Principal": { "Fn::GetAtt": [ @@ -106,7 +106,7 @@ }, ":function:", { - "Fn::ImportValue": "cdk-integ-lambda-golang-provided-al2023:ExportsOutputRefgohandlerprovidedal20A3EC5933F5EA8606" + "Fn::ImportValue": "cdk-integ-lambda-golang-provided-al2023:ExportsOutputRefgohandlerprovidedal2633725233CB9A54A" } ] ] @@ -146,7 +146,7 @@ }, ":function:", { - "Fn::ImportValue": "cdk-integ-lambda-golang-provided-al2023:ExportsOutputRefgohandlerprovidedal2023182E754E4D088A80B" + "Fn::ImportValue": "cdk-integ-lambda-golang-provided-al2023:ExportsOutputRefgohandlerprovidedal2023FA840EAA50E75800" } ] ] @@ -175,7 +175,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "b98abee59e034ed29eeb601684dc34752baa86509a7d457d72305d4e19ecc80b.zip" + "S3Key": "bfcf4228d6660f50e81f19efdb64c6388dda6796296eb239decdff1dbc2f4981.zip" }, "Timeout": 120, "Handler": "index.handler", @@ -187,7 +187,7 @@ } } }, - "LambdaInvokee64be71dc9e61c18c827e4067293abf7": { + "LambdaInvokee243f6063740d52875d805d005f0d7bf": { "Type": "Custom::DeployAssert@SdkCallLambdainvoke", "Properties": { "ServiceToken": { @@ -206,7 +206,7 @@ [ "\"", { - "Fn::ImportValue": "cdk-integ-lambda-golang-provided-al2023:ExportsOutputRefgohandlerprovidedal2023182E754E4D088A80B" + "Fn::ImportValue": "cdk-integ-lambda-golang-provided-al2023:ExportsOutputRefgohandlerprovidedal2023FA840EAA50E75800" }, "\"" ] @@ -214,17 +214,17 @@ } }, "flattenResponse": "false", - "salt": "1732467508039" + "salt": "1736374512629" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, - "LambdaInvokee64be71dc9e61c18c827e4067293abf7Invoke6B51EA75": { + "LambdaInvokee243f6063740d52875d805d005f0d7bfInvoke13D1276D": { "Type": "AWS::Lambda::Permission", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { - "Fn::ImportValue": "cdk-integ-lambda-golang-provided-al2023:ExportsOutputRefgohandlerprovidedal2023182E754E4D088A80B" + "Fn::ImportValue": "cdk-integ-lambda-golang-provided-al2023:ExportsOutputRefgohandlerprovidedal2023FA840EAA50E75800" }, "Principal": { "Fn::GetAtt": [ @@ -236,18 +236,18 @@ } }, "Outputs": { - "AssertionResultsLambdaInvokef3b58fd2af78e934527e05bc469d07dc": { + "AssertionResultsLambdaInvoke2b6e8ea895f068736d6c24688beb0ea1": { "Value": { "Fn::GetAtt": [ - "LambdaInvokef3b58fd2af78e934527e05bc469d07dc", + "LambdaInvoke2b6e8ea895f068736d6c24688beb0ea1", "assertion" ] } }, - "AssertionResultsLambdaInvokee64be71dc9e61c18c827e4067293abf7": { + "AssertionResultsLambdaInvokee243f6063740d52875d805d005f0d7bf": { "Value": { "Fn::GetAtt": [ - "LambdaInvokee64be71dc9e61c18c827e4067293abf7", + "LambdaInvokee243f6063740d52875d805d005f0d7bf", "assertion" ] } diff --git a/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/manifest.json b/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/manifest.json index 2a0b7a2ec1d31..c22b9a5a673b7 100644 --- a/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "38.0.1", + "version": "39.0.0", "artifacts": { "cdk-integ-lambda-golang-provided-al2023.assets": { "type": "cdk:asset-manifest", @@ -18,7 +18,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}/34293767b5134bd2028237f5362259b4594a9e316e6ac19bbc42f610af769649.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/3f0e36eb78dda330bbc187441af285d86fc089f15d6e7bd0cc02e6c2ee42df39.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -34,40 +34,40 @@ "cdk-integ-lambda-golang-provided-al2023.assets" ], "metadata": { - "/cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2-0/ServiceRole/Resource": [ + "/cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", - "data": "gohandlerprovidedal20ServiceRole8426AEF6" + "data": "gohandlerprovidedal2ServiceRole0304E98B" } ], - "/cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2-0/Resource": [ + "/cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2/Resource": [ { "type": "aws:cdk:logicalId", - "data": "gohandlerprovidedal20A3EC5933" + "data": "gohandlerprovidedal263372523" } ], - "/cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2023-1/ServiceRole/Resource": [ + "/cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2023/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", - "data": "gohandlerprovidedal20231ServiceRole68A34C3F" + "data": "gohandlerprovidedal2023ServiceRole27484815" } ], - "/cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2023-1/Resource": [ + "/cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2023/Resource": [ { "type": "aws:cdk:logicalId", - "data": "gohandlerprovidedal2023182E754E4" + "data": "gohandlerprovidedal2023FA840EAA" } ], - "/cdk-integ-lambda-golang-provided-al2023/Exports/Output{\"Ref\":\"gohandlerprovidedal20A3EC5933\"}": [ + "/cdk-integ-lambda-golang-provided-al2023/Exports/Output{\"Ref\":\"gohandlerprovidedal263372523\"}": [ { "type": "aws:cdk:logicalId", - "data": "ExportsOutputRefgohandlerprovidedal20A3EC5933F5EA8606" + "data": "ExportsOutputRefgohandlerprovidedal2633725233CB9A54A" } ], - "/cdk-integ-lambda-golang-provided-al2023/Exports/Output{\"Ref\":\"gohandlerprovidedal2023182E754E4\"}": [ + "/cdk-integ-lambda-golang-provided-al2023/Exports/Output{\"Ref\":\"gohandlerprovidedal2023FA840EAA\"}": [ { "type": "aws:cdk:logicalId", - "data": "ExportsOutputRefgohandlerprovidedal2023182E754E4D088A80B" + "data": "ExportsOutputRefgohandlerprovidedal2023FA840EAA50E75800" } ], "/cdk-integ-lambda-golang-provided-al2023/BootstrapVersion": [ @@ -81,6 +81,42 @@ "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } + ], + "gohandlerprovidedal20ServiceRole8426AEF6": [ + { + "type": "aws:cdk:logicalId", + "data": "gohandlerprovidedal20ServiceRole8426AEF6", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "gohandlerprovidedal20A3EC5933": [ + { + "type": "aws:cdk:logicalId", + "data": "gohandlerprovidedal20A3EC5933", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "gohandlerprovidedal20231ServiceRole68A34C3F": [ + { + "type": "aws:cdk:logicalId", + "data": "gohandlerprovidedal20231ServiceRole68A34C3F", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "gohandlerprovidedal2023182E754E4": [ + { + "type": "aws:cdk:logicalId", + "data": "gohandlerprovidedal2023182E754E4", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } ] }, "displayName": "cdk-integ-lambda-golang-provided-al2023" @@ -102,7 +138,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}/665413b584435ebdf5f793a7d2380a56e3148d53574757886dc43130ffda7d9d.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/ce322481ad3bfac89a715809309aa35d5b70de5dfc6cd6732f7bd3c6a590023d.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -119,22 +155,22 @@ "lambdagoruntimeDefaultTestDeployAssert366012A1.assets" ], "metadata": { - "/lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokef3b58fd2af78e934527e05bc469d07dc/Default/Default": [ + "/lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvoke2b6e8ea895f068736d6c24688beb0ea1/Default/Default": [ { "type": "aws:cdk:logicalId", - "data": "LambdaInvokef3b58fd2af78e934527e05bc469d07dc" + "data": "LambdaInvoke2b6e8ea895f068736d6c24688beb0ea1" } ], - "/lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokef3b58fd2af78e934527e05bc469d07dc/Invoke": [ + "/lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvoke2b6e8ea895f068736d6c24688beb0ea1/Invoke": [ { "type": "aws:cdk:logicalId", - "data": "LambdaInvokef3b58fd2af78e934527e05bc469d07dcInvokeFB39F386" + "data": "LambdaInvoke2b6e8ea895f068736d6c24688beb0ea1InvokeECEDC4C5" } ], - "/lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokef3b58fd2af78e934527e05bc469d07dc/AssertionResults": [ + "/lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvoke2b6e8ea895f068736d6c24688beb0ea1/AssertionResults": [ { "type": "aws:cdk:logicalId", - "data": "AssertionResultsLambdaInvokef3b58fd2af78e934527e05bc469d07dc" + "data": "AssertionResultsLambdaInvoke2b6e8ea895f068736d6c24688beb0ea1" } ], "/lambda-go-runtime/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role": [ @@ -155,22 +191,22 @@ "data": "LatestNodeRuntimeMap" } ], - "/lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokee64be71dc9e61c18c827e4067293abf7/Default/Default": [ + "/lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokee243f6063740d52875d805d005f0d7bf/Default/Default": [ { "type": "aws:cdk:logicalId", - "data": "LambdaInvokee64be71dc9e61c18c827e4067293abf7" + "data": "LambdaInvokee243f6063740d52875d805d005f0d7bf" } ], - "/lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokee64be71dc9e61c18c827e4067293abf7/Invoke": [ + "/lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokee243f6063740d52875d805d005f0d7bf/Invoke": [ { "type": "aws:cdk:logicalId", - "data": "LambdaInvokee64be71dc9e61c18c827e4067293abf7Invoke6B51EA75" + "data": "LambdaInvokee243f6063740d52875d805d005f0d7bfInvoke13D1276D" } ], - "/lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokee64be71dc9e61c18c827e4067293abf7/AssertionResults": [ + "/lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokee243f6063740d52875d805d005f0d7bf/AssertionResults": [ { "type": "aws:cdk:logicalId", - "data": "AssertionResultsLambdaInvokee64be71dc9e61c18c827e4067293abf7" + "data": "AssertionResultsLambdaInvokee243f6063740d52875d805d005f0d7bf" } ], "/lambda-go-runtime/DefaultTest/DeployAssert/BootstrapVersion": [ diff --git a/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/tree.json b/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/tree.json index 5e6926e4949fe..cda75186195a3 100644 --- a/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.js.snapshot/tree.json @@ -8,17 +8,17 @@ "id": "cdk-integ-lambda-golang-provided-al2023", "path": "cdk-integ-lambda-golang-provided-al2023", "children": { - "go-handler-provided.al2-0": { - "id": "go-handler-provided.al2-0", - "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2-0", + "go-handler-provided.al2": { + "id": "go-handler-provided.al2", + "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2-0/ServiceRole", + "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2-0/ServiceRole/ImportServiceRole", + "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -26,7 +26,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2-0/ServiceRole/Resource", + "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -71,11 +71,11 @@ }, "Code": { "id": "Code", - "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2-0/Code", + "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2/Code", "children": { "Stage": { "id": "Stage", - "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2-0/Code/Stage", + "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -83,7 +83,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2-0/Code/AssetBucket", + "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -97,7 +97,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2-0/Resource", + "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -110,7 +110,7 @@ "handler": "bootstrap", "role": { "Fn::GetAtt": [ - "gohandlerprovidedal20ServiceRole8426AEF6", + "gohandlerprovidedal2ServiceRole0304E98B", "Arn" ] }, @@ -124,21 +124,21 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.Function", + "fqn": "@aws-cdk/aws-lambda-go-alpha.GoFunction", "version": "0.0.0" } }, - "go-handler-provided.al2023-1": { - "id": "go-handler-provided.al2023-1", - "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2023-1", + "go-handler-provided.al2023": { + "id": "go-handler-provided.al2023", + "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2023", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2023-1/ServiceRole", + "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2023/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2023-1/ServiceRole/ImportServiceRole", + "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2023/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -146,7 +146,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2023-1/ServiceRole/Resource", + "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2023/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -191,11 +191,11 @@ }, "Code": { "id": "Code", - "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2023-1/Code", + "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2023/Code", "children": { "Stage": { "id": "Stage", - "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2023-1/Code/Stage", + "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2023/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -203,7 +203,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2023-1/Code/AssetBucket", + "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2023/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -217,7 +217,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2023-1/Resource", + "path": "cdk-integ-lambda-golang-provided-al2023/go-handler-provided.al2023/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -230,7 +230,7 @@ "handler": "bootstrap", "role": { "Fn::GetAtt": [ - "gohandlerprovidedal20231ServiceRole68A34C3F", + "gohandlerprovidedal2023ServiceRole27484815", "Arn" ] }, @@ -244,7 +244,7 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.Function", + "fqn": "@aws-cdk/aws-lambda-go-alpha.GoFunction", "version": "0.0.0" } }, @@ -252,17 +252,17 @@ "id": "Exports", "path": "cdk-integ-lambda-golang-provided-al2023/Exports", "children": { - "Output{\"Ref\":\"gohandlerprovidedal20A3EC5933\"}": { - "id": "Output{\"Ref\":\"gohandlerprovidedal20A3EC5933\"}", - "path": "cdk-integ-lambda-golang-provided-al2023/Exports/Output{\"Ref\":\"gohandlerprovidedal20A3EC5933\"}", + "Output{\"Ref\":\"gohandlerprovidedal263372523\"}": { + "id": "Output{\"Ref\":\"gohandlerprovidedal263372523\"}", + "path": "cdk-integ-lambda-golang-provided-al2023/Exports/Output{\"Ref\":\"gohandlerprovidedal263372523\"}", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" } }, - "Output{\"Ref\":\"gohandlerprovidedal2023182E754E4\"}": { - "id": "Output{\"Ref\":\"gohandlerprovidedal2023182E754E4\"}", - "path": "cdk-integ-lambda-golang-provided-al2023/Exports/Output{\"Ref\":\"gohandlerprovidedal2023182E754E4\"}", + "Output{\"Ref\":\"gohandlerprovidedal2023FA840EAA\"}": { + "id": "Output{\"Ref\":\"gohandlerprovidedal2023FA840EAA\"}", + "path": "cdk-integ-lambda-golang-provided-al2023/Exports/Output{\"Ref\":\"gohandlerprovidedal2023FA840EAA\"}", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" @@ -316,17 +316,17 @@ "id": "DeployAssert", "path": "lambda-go-runtime/DefaultTest/DeployAssert", "children": { - "LambdaInvokef3b58fd2af78e934527e05bc469d07dc": { - "id": "LambdaInvokef3b58fd2af78e934527e05bc469d07dc", - "path": "lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokef3b58fd2af78e934527e05bc469d07dc", + "LambdaInvoke2b6e8ea895f068736d6c24688beb0ea1": { + "id": "LambdaInvoke2b6e8ea895f068736d6c24688beb0ea1", + "path": "lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvoke2b6e8ea895f068736d6c24688beb0ea1", "children": { "SdkProvider": { "id": "SdkProvider", - "path": "lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokef3b58fd2af78e934527e05bc469d07dc/SdkProvider", + "path": "lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvoke2b6e8ea895f068736d6c24688beb0ea1/SdkProvider", "children": { "AssertionsProvider": { "id": "AssertionsProvider", - "path": "lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokef3b58fd2af78e934527e05bc469d07dc/SdkProvider/AssertionsProvider", + "path": "lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvoke2b6e8ea895f068736d6c24688beb0ea1/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", "version": "10.4.2" @@ -340,11 +340,11 @@ }, "Default": { "id": "Default", - "path": "lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokef3b58fd2af78e934527e05bc469d07dc/Default", + "path": "lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvoke2b6e8ea895f068736d6c24688beb0ea1/Default", "children": { "Default": { "id": "Default", - "path": "lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokef3b58fd2af78e934527e05bc469d07dc/Default/Default", + "path": "lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvoke2b6e8ea895f068736d6c24688beb0ea1/Default/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -358,7 +358,7 @@ }, "Invoke": { "id": "Invoke", - "path": "lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokef3b58fd2af78e934527e05bc469d07dc/Invoke", + "path": "lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvoke2b6e8ea895f068736d6c24688beb0ea1/Invoke", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -366,7 +366,7 @@ }, "AssertionResults": { "id": "AssertionResults", - "path": "lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokef3b58fd2af78e934527e05bc469d07dc/AssertionResults", + "path": "lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvoke2b6e8ea895f068736d6c24688beb0ea1/AssertionResults", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" @@ -420,17 +420,17 @@ "version": "0.0.0" } }, - "LambdaInvokee64be71dc9e61c18c827e4067293abf7": { - "id": "LambdaInvokee64be71dc9e61c18c827e4067293abf7", - "path": "lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokee64be71dc9e61c18c827e4067293abf7", + "LambdaInvokee243f6063740d52875d805d005f0d7bf": { + "id": "LambdaInvokee243f6063740d52875d805d005f0d7bf", + "path": "lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokee243f6063740d52875d805d005f0d7bf", "children": { "SdkProvider": { "id": "SdkProvider", - "path": "lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokee64be71dc9e61c18c827e4067293abf7/SdkProvider", + "path": "lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokee243f6063740d52875d805d005f0d7bf/SdkProvider", "children": { "AssertionsProvider": { "id": "AssertionsProvider", - "path": "lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokee64be71dc9e61c18c827e4067293abf7/SdkProvider/AssertionsProvider", + "path": "lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokee243f6063740d52875d805d005f0d7bf/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", "version": "10.4.2" @@ -444,11 +444,11 @@ }, "Default": { "id": "Default", - "path": "lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokee64be71dc9e61c18c827e4067293abf7/Default", + "path": "lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokee243f6063740d52875d805d005f0d7bf/Default", "children": { "Default": { "id": "Default", - "path": "lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokee64be71dc9e61c18c827e4067293abf7/Default/Default", + "path": "lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokee243f6063740d52875d805d005f0d7bf/Default/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -462,7 +462,7 @@ }, "Invoke": { "id": "Invoke", - "path": "lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokee64be71dc9e61c18c827e4067293abf7/Invoke", + "path": "lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokee243f6063740d52875d805d005f0d7bf/Invoke", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -470,7 +470,7 @@ }, "AssertionResults": { "id": "AssertionResults", - "path": "lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokee64be71dc9e61c18c827e4067293abf7/AssertionResults", + "path": "lambda-go-runtime/DefaultTest/DeployAssert/LambdaInvokee243f6063740d52875d805d005f0d7bf/AssertionResults", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" diff --git a/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.ts b/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.ts index 0448fc396fb46..e12ed671185df 100644 --- a/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.ts +++ b/packages/@aws-cdk/aws-lambda-go-alpha/test/integ.function.provided.runtimes.ts @@ -13,8 +13,10 @@ class TestStack extends Stack { Runtime.PROVIDED_AL2, Runtime.PROVIDED_AL2023, ]; - runtimes.forEach((runtime, index) => { - this.lambdaFunctions.push(new lambda.GoFunction(this, `go-handler-${runtime.name}-${index}`, { + const uniqueRuntimes: Runtime[] = runtimes.filter((value, index, array) => array.findIndex(value1 => value1.runtimeEquals(value)) === index); + + uniqueRuntimes.forEach((runtime) => { + this.lambdaFunctions.push(new lambda.GoFunction(this, `go-handler-${runtime.name}`, { entry: path.join(__dirname, 'lambda-handler-vendor', 'cmd', 'api'), runtime: runtime, bundling: { diff --git a/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/asset.b98abee59e034ed29eeb601684dc34752baa86509a7d457d72305d4e19ecc80b.bundle/index.js b/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/asset.bfcf4228d6660f50e81f19efdb64c6388dda6796296eb239decdff1dbc2f4981.bundle/index.js similarity index 99% rename from packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/asset.b98abee59e034ed29eeb601684dc34752baa86509a7d457d72305d4e19ecc80b.bundle/index.js rename to packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/asset.bfcf4228d6660f50e81f19efdb64c6388dda6796296eb239decdff1dbc2f4981.bundle/index.js index b585fd2bb4a19..60e59701bc0e1 100644 --- a/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/asset.b98abee59e034ed29eeb601684dc34752baa86509a7d457d72305d4e19ecc80b.bundle/index.js +++ b/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/asset.bfcf4228d6660f50e81f19efdb64c6388dda6796296eb239decdff1dbc2f4981.bundle/index.js @@ -152,7 +152,6 @@ var init_matcher = __esm({ */ toHumanStrings() { const failures = new Array(); - debugger; recurse(this, []); return failures.map((r) => { const loc = r.path.length === 0 ? "" : ` at /${r.path.join("/")}`; @@ -23574,9 +23573,9 @@ var require_safer = __commonJS({ } }); -// ../../../node_modules/iconv-lite/lib/bom-handling.js +// ../../../node_modules/encoding/node_modules/iconv-lite/lib/bom-handling.js var require_bom_handling = __commonJS({ - "../../../node_modules/iconv-lite/lib/bom-handling.js"(exports2) { + "../../../node_modules/encoding/node_modules/iconv-lite/lib/bom-handling.js"(exports2) { "use strict"; var BOMChar = "\uFEFF"; exports2.PrependBOM = PrependBOMWrapper; @@ -23618,9 +23617,9 @@ var require_bom_handling = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/internal.js +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/internal.js var require_internal = __commonJS({ - "../../../node_modules/iconv-lite/encodings/internal.js"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/internal.js"(exports2, module2) { "use strict"; var Buffer2 = require_safer().Buffer; module2.exports = { @@ -23770,9 +23769,9 @@ var require_internal = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/utf32.js +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/utf32.js var require_utf32 = __commonJS({ - "../../../node_modules/iconv-lite/encodings/utf32.js"(exports2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/utf32.js"(exports2) { "use strict"; var Buffer2 = require_safer().Buffer; exports2._utf32 = Utf32Codec; @@ -23989,9 +23988,9 @@ var require_utf32 = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/utf16.js +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/utf16.js var require_utf16 = __commonJS({ - "../../../node_modules/iconv-lite/encodings/utf16.js"(exports2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/utf16.js"(exports2) { "use strict"; var Buffer2 = require_safer().Buffer; exports2.utf16be = Utf16BECodec; @@ -24123,9 +24122,9 @@ var require_utf16 = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/utf7.js +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/utf7.js var require_utf7 = __commonJS({ - "../../../node_modules/iconv-lite/encodings/utf7.js"(exports2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/utf7.js"(exports2) { "use strict"; var Buffer2 = require_safer().Buffer; exports2.utf7 = Utf7Codec; @@ -24324,9 +24323,9 @@ var require_utf7 = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/sbcs-codec.js +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-codec.js var require_sbcs_codec = __commonJS({ - "../../../node_modules/iconv-lite/encodings/sbcs-codec.js"(exports2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-codec.js"(exports2) { "use strict"; var Buffer2 = require_safer().Buffer; exports2._sbcs = SBCSCodec; @@ -24380,9 +24379,9 @@ var require_sbcs_codec = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/sbcs-data.js +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-data.js var require_sbcs_data = __commonJS({ - "../../../node_modules/iconv-lite/encodings/sbcs-data.js"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-data.js"(exports2, module2) { "use strict"; module2.exports = { // Not supported by iconv, not sure why. @@ -24533,9 +24532,9 @@ var require_sbcs_data = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/sbcs-data-generated.js +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-data-generated.js var require_sbcs_data_generated = __commonJS({ - "../../../node_modules/iconv-lite/encodings/sbcs-data-generated.js"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-data-generated.js"(exports2, module2) { "use strict"; module2.exports = { "437": "cp437", @@ -24988,9 +24987,9 @@ var require_sbcs_data_generated = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/dbcs-codec.js +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/dbcs-codec.js var require_dbcs_codec = __commonJS({ - "../../../node_modules/iconv-lite/encodings/dbcs-codec.js"(exports2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/dbcs-codec.js"(exports2) { "use strict"; var Buffer2 = require_safer().Buffer; exports2._dbcs = DBCSCodec; @@ -25405,9 +25404,9 @@ var require_dbcs_codec = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/tables/shiftjis.json +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/shiftjis.json var require_shiftjis = __commonJS({ - "../../../node_modules/iconv-lite/encodings/tables/shiftjis.json"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/shiftjis.json"(exports2, module2) { module2.exports = [ ["0", "\0", 128], ["a1", "\uFF61", 62], @@ -25536,9 +25535,9 @@ var require_shiftjis = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/tables/eucjp.json +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/eucjp.json var require_eucjp = __commonJS({ - "../../../node_modules/iconv-lite/encodings/tables/eucjp.json"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/eucjp.json"(exports2, module2) { module2.exports = [ ["0", "\0", 127], ["8ea1", "\uFF61", 62], @@ -25724,9 +25723,9 @@ var require_eucjp = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/tables/cp936.json +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/cp936.json var require_cp936 = __commonJS({ - "../../../node_modules/iconv-lite/encodings/tables/cp936.json"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/cp936.json"(exports2, module2) { module2.exports = [ ["0", "\0", 127, "\u20AC"], ["8140", "\u4E02\u4E04\u4E05\u4E06\u4E0F\u4E12\u4E17\u4E1F\u4E20\u4E21\u4E23\u4E26\u4E29\u4E2E\u4E2F\u4E31\u4E33\u4E35\u4E37\u4E3C\u4E40\u4E41\u4E42\u4E44\u4E46\u4E4A\u4E51\u4E55\u4E57\u4E5A\u4E5B\u4E62\u4E63\u4E64\u4E65\u4E67\u4E68\u4E6A", 5, "\u4E72\u4E74", 9, "\u4E7F", 6, "\u4E87\u4E8A"], @@ -25994,9 +25993,9 @@ var require_cp936 = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/tables/gbk-added.json +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/gbk-added.json var require_gbk_added = __commonJS({ - "../../../node_modules/iconv-lite/encodings/tables/gbk-added.json"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/gbk-added.json"(exports2, module2) { module2.exports = [ ["a140", "\uE4C6", 62], ["a180", "\uE505", 32], @@ -26056,16 +26055,16 @@ var require_gbk_added = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json var require_gb18030_ranges = __commonJS({ - "../../../node_modules/iconv-lite/encodings/tables/gb18030-ranges.json"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json"(exports2, module2) { module2.exports = { uChars: [128, 165, 169, 178, 184, 216, 226, 235, 238, 244, 248, 251, 253, 258, 276, 284, 300, 325, 329, 334, 364, 463, 465, 467, 469, 471, 473, 475, 477, 506, 594, 610, 712, 716, 730, 930, 938, 962, 970, 1026, 1104, 1106, 8209, 8215, 8218, 8222, 8231, 8241, 8244, 8246, 8252, 8365, 8452, 8454, 8458, 8471, 8482, 8556, 8570, 8596, 8602, 8713, 8720, 8722, 8726, 8731, 8737, 8740, 8742, 8748, 8751, 8760, 8766, 8777, 8781, 8787, 8802, 8808, 8816, 8854, 8858, 8870, 8896, 8979, 9322, 9372, 9548, 9588, 9616, 9622, 9634, 9652, 9662, 9672, 9676, 9680, 9702, 9735, 9738, 9793, 9795, 11906, 11909, 11913, 11917, 11928, 11944, 11947, 11951, 11956, 11960, 11964, 11979, 12284, 12292, 12312, 12319, 12330, 12351, 12436, 12447, 12535, 12543, 12586, 12842, 12850, 12964, 13200, 13215, 13218, 13253, 13263, 13267, 13270, 13384, 13428, 13727, 13839, 13851, 14617, 14703, 14801, 14816, 14964, 15183, 15471, 15585, 16471, 16736, 17208, 17325, 17330, 17374, 17623, 17997, 18018, 18212, 18218, 18301, 18318, 18760, 18811, 18814, 18820, 18823, 18844, 18848, 18872, 19576, 19620, 19738, 19887, 40870, 59244, 59336, 59367, 59413, 59417, 59423, 59431, 59437, 59443, 59452, 59460, 59478, 59493, 63789, 63866, 63894, 63976, 63986, 64016, 64018, 64021, 64025, 64034, 64037, 64042, 65074, 65093, 65107, 65112, 65127, 65132, 65375, 65510, 65536], gbChars: [0, 36, 38, 45, 50, 81, 89, 95, 96, 100, 103, 104, 105, 109, 126, 133, 148, 172, 175, 179, 208, 306, 307, 308, 309, 310, 311, 312, 313, 341, 428, 443, 544, 545, 558, 741, 742, 749, 750, 805, 819, 820, 7922, 7924, 7925, 7927, 7934, 7943, 7944, 7945, 7950, 8062, 8148, 8149, 8152, 8164, 8174, 8236, 8240, 8262, 8264, 8374, 8380, 8381, 8384, 8388, 8390, 8392, 8393, 8394, 8396, 8401, 8406, 8416, 8419, 8424, 8437, 8439, 8445, 8482, 8485, 8496, 8521, 8603, 8936, 8946, 9046, 9050, 9063, 9066, 9076, 9092, 9100, 9108, 9111, 9113, 9131, 9162, 9164, 9218, 9219, 11329, 11331, 11334, 11336, 11346, 11361, 11363, 11366, 11370, 11372, 11375, 11389, 11682, 11686, 11687, 11692, 11694, 11714, 11716, 11723, 11725, 11730, 11736, 11982, 11989, 12102, 12336, 12348, 12350, 12384, 12393, 12395, 12397, 12510, 12553, 12851, 12962, 12973, 13738, 13823, 13919, 13933, 14080, 14298, 14585, 14698, 15583, 15847, 16318, 16434, 16438, 16481, 16729, 17102, 17122, 17315, 17320, 17402, 17418, 17859, 17909, 17911, 17915, 17916, 17936, 17939, 17961, 18664, 18703, 18814, 18962, 19043, 33469, 33470, 33471, 33484, 33485, 33490, 33497, 33501, 33505, 33513, 33520, 33536, 33550, 37845, 37921, 37948, 38029, 38038, 38064, 38065, 38066, 38069, 38075, 38076, 38078, 39108, 39109, 39113, 39114, 39115, 39116, 39265, 39394, 189e3] }; } }); -// ../../../node_modules/iconv-lite/encodings/tables/cp949.json +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/cp949.json var require_cp949 = __commonJS({ - "../../../node_modules/iconv-lite/encodings/tables/cp949.json"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/cp949.json"(exports2, module2) { module2.exports = [ ["0", "\0", 127], ["8141", "\uAC02\uAC03\uAC05\uAC06\uAC0B", 4, "\uAC18\uAC1E\uAC1F\uAC21\uAC22\uAC23\uAC25", 6, "\uAC2E\uAC32\uAC33\uAC34"], @@ -26342,9 +26341,9 @@ var require_cp949 = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/tables/cp950.json +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/cp950.json var require_cp950 = __commonJS({ - "../../../node_modules/iconv-lite/encodings/tables/cp950.json"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/cp950.json"(exports2, module2) { module2.exports = [ ["0", "\0", 127], ["a140", "\u3000\uFF0C\u3001\u3002\uFF0E\u2027\uFF1B\uFF1A\uFF1F\uFF01\uFE30\u2026\u2025\uFE50\uFE51\uFE52\xB7\uFE54\uFE55\uFE56\uFE57\uFF5C\u2013\uFE31\u2014\uFE33\u2574\uFE34\uFE4F\uFF08\uFF09\uFE35\uFE36\uFF5B\uFF5D\uFE37\uFE38\u3014\u3015\uFE39\uFE3A\u3010\u3011\uFE3B\uFE3C\u300A\u300B\uFE3D\uFE3E\u3008\u3009\uFE3F\uFE40\u300C\u300D\uFE41\uFE42\u300E\u300F\uFE43\uFE44\uFE59\uFE5A"], @@ -26525,9 +26524,9 @@ var require_cp950 = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/tables/big5-added.json +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/big5-added.json var require_big5_added = __commonJS({ - "../../../node_modules/iconv-lite/encodings/tables/big5-added.json"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/tables/big5-added.json"(exports2, module2) { module2.exports = [ ["8740", "\u43F0\u4C32\u4603\u45A6\u4578\u{27267}\u4D77\u45B3\u{27CB1}\u4CE2\u{27CC5}\u3B95\u4736\u4744\u4C47\u4C40\u{242BF}\u{23617}\u{27352}\u{26E8B}\u{270D2}\u4C57\u{2A351}\u474F\u45DA\u4C85\u{27C6C}\u4D07\u4AA4\u46A1\u{26B23}\u7225\u{25A54}\u{21A63}\u{23E06}\u{23F61}\u664D\u56FB"], ["8767", "\u7D95\u591D\u{28BB9}\u3DF4\u9734\u{27BEF}\u5BDB\u{21D5E}\u5AA4\u3625\u{29EB0}\u5AD1\u5BB7\u5CFC\u676E\u8593\u{29945}\u7461\u749D\u3875\u{21D53}\u{2369E}\u{26021}\u3EEC"], @@ -26653,9 +26652,9 @@ var require_big5_added = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/dbcs-data.js +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/dbcs-data.js var require_dbcs_data = __commonJS({ - "../../../node_modules/iconv-lite/encodings/dbcs-data.js"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/dbcs-data.js"(exports2, module2) { "use strict"; module2.exports = { // == Japanese/ShiftJIS ==================================================== @@ -26900,9 +26899,9 @@ var require_dbcs_data = __commonJS({ } }); -// ../../../node_modules/iconv-lite/encodings/index.js +// ../../../node_modules/encoding/node_modules/iconv-lite/encodings/index.js var require_encodings = __commonJS({ - "../../../node_modules/iconv-lite/encodings/index.js"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/encodings/index.js"(exports2, module2) { "use strict"; var modules = [ require_internal(), @@ -26927,9 +26926,9 @@ var require_encodings = __commonJS({ } }); -// ../../../node_modules/iconv-lite/lib/streams.js +// ../../../node_modules/encoding/node_modules/iconv-lite/lib/streams.js var require_streams = __commonJS({ - "../../../node_modules/iconv-lite/lib/streams.js"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/lib/streams.js"(exports2, module2) { "use strict"; var Buffer2 = require_safer().Buffer; module2.exports = function(stream_module) { @@ -27022,9 +27021,9 @@ var require_streams = __commonJS({ } }); -// ../../../node_modules/iconv-lite/lib/index.js +// ../../../node_modules/encoding/node_modules/iconv-lite/lib/index.js var require_lib2 = __commonJS({ - "../../../node_modules/iconv-lite/lib/index.js"(exports2, module2) { + "../../../node_modules/encoding/node_modules/iconv-lite/lib/index.js"(exports2, module2) { "use strict"; var Buffer2 = require_safer().Buffer; var bomHandling = require_bom_handling(); diff --git a/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/cdk.out b/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/cdk.out index c6e612584e352..91e1a8b9901d5 100644 --- a/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"38.0.1"} \ No newline at end of file +{"version":"39.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/integ-lambda-python-test-build-images.assets.json b/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/integ-lambda-python-test-build-images.assets.json index cf399cec24a51..00a2f22a5c3c5 100644 --- a/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/integ-lambda-python-test-build-images.assets.json +++ b/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/integ-lambda-python-test-build-images.assets.json @@ -1,85 +1,72 @@ { - "version": "38.0.1", + "version": "39.0.0", "files": { - "5460d7e540a2c310c947f772c884382675ac0a06ba60e11fb8c1864feb6d642a": { + "f0d84a92fcedcb86c75a171578ce1049be08692d576eefe2785798d3966559f8": { "source": { - "path": "asset.5460d7e540a2c310c947f772c884382675ac0a06ba60e11fb8c1864feb6d642a", + "path": "asset.f0d84a92fcedcb86c75a171578ce1049be08692d576eefe2785798d3966559f8", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "5460d7e540a2c310c947f772c884382675ac0a06ba60e11fb8c1864feb6d642a.zip", + "objectKey": "f0d84a92fcedcb86c75a171578ce1049be08692d576eefe2785798d3966559f8.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "c6315ec36c3caa6d7af488cc4a3d4e2cdb314e006f146c196b2c29acf018cf00": { + "603cf7a1b4100a862c9deef2e2868ed4e835a95f8aaf0c2179fc73c560603ab7": { "source": { - "path": "asset.c6315ec36c3caa6d7af488cc4a3d4e2cdb314e006f146c196b2c29acf018cf00", + "path": "asset.603cf7a1b4100a862c9deef2e2868ed4e835a95f8aaf0c2179fc73c560603ab7", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "c6315ec36c3caa6d7af488cc4a3d4e2cdb314e006f146c196b2c29acf018cf00.zip", + "objectKey": "603cf7a1b4100a862c9deef2e2868ed4e835a95f8aaf0c2179fc73c560603ab7.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "7c56b2150fc5df63cdcdb3596617be55b3c8b5b8d6aff8a254740ac53ff247f9": { + "2eec7314a6eaa29434975bf12ae867f360393e41ee78fc2bab858fe940ff18f1": { "source": { - "path": "asset.7c56b2150fc5df63cdcdb3596617be55b3c8b5b8d6aff8a254740ac53ff247f9", + "path": "asset.2eec7314a6eaa29434975bf12ae867f360393e41ee78fc2bab858fe940ff18f1", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "7c56b2150fc5df63cdcdb3596617be55b3c8b5b8d6aff8a254740ac53ff247f9.zip", + "objectKey": "2eec7314a6eaa29434975bf12ae867f360393e41ee78fc2bab858fe940ff18f1.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "e09f78a4fdb87fb9eb5035afda64212ecf2ad072580e870a2d665036d482b5f7": { + "4556386f866bfec99a16c2d6a08ccafd85513a07078f7253255a132cde85644d": { "source": { - "path": "asset.e09f78a4fdb87fb9eb5035afda64212ecf2ad072580e870a2d665036d482b5f7", + "path": "asset.4556386f866bfec99a16c2d6a08ccafd85513a07078f7253255a132cde85644d", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "e09f78a4fdb87fb9eb5035afda64212ecf2ad072580e870a2d665036d482b5f7.zip", + "objectKey": "4556386f866bfec99a16c2d6a08ccafd85513a07078f7253255a132cde85644d.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "5873808ef8cdd51f37645d88568d2c07313b9bc5990984c12df6c3725b2f4b69": { + "0287b06105fd20f2a11d7afcd2939968452bad969729dde7d1ac46cc71b1b18a": { "source": { - "path": "asset.5873808ef8cdd51f37645d88568d2c07313b9bc5990984c12df6c3725b2f4b69", + "path": "asset.0287b06105fd20f2a11d7afcd2939968452bad969729dde7d1ac46cc71b1b18a", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "5873808ef8cdd51f37645d88568d2c07313b9bc5990984c12df6c3725b2f4b69.zip", + "objectKey": "0287b06105fd20f2a11d7afcd2939968452bad969729dde7d1ac46cc71b1b18a.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "fc9e9296f7d6c6238ccc33e0f45e0183f3c9aae92eca22d6b4744633e439b802": { - "source": { - "path": "asset.fc9e9296f7d6c6238ccc33e0f45e0183f3c9aae92eca22d6b4744633e439b802", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "fc9e9296f7d6c6238ccc33e0f45e0183f3c9aae92eca22d6b4744633e439b802.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "b137af517a6361552724231af66a692319b567f04214dac25b362dc47335e5d3": { + "a7a4fb29dd2634794668ee93203cee2f6731c30c1934ef6fbe0f80ca8b0962f9": { "source": { "path": "integ-lambda-python-test-build-images.template.json", "packaging": "file" @@ -87,7 +74,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "b137af517a6361552724231af66a692319b567f04214dac25b362dc47335e5d3.json", + "objectKey": "a7a4fb29dd2634794668ee93203cee2f6731c30c1934ef6fbe0f80ca8b0962f9.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/integ-lambda-python-test-build-images.template.json b/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/integ-lambda-python-test-build-images.template.json index c18d29c41c3f9..e9124db0f3544 100644 --- a/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/integ-lambda-python-test-build-images.template.json +++ b/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/integ-lambda-python-test-build-images.template.json @@ -1,6 +1,6 @@ { "Resources": { - "funcpython380ServiceRoleEAFB3F8E": { + "funcpython39ServiceRole0E545AAB": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { @@ -31,82 +31,29 @@ ] } }, - "funcpython380BF74015B": { + "funcpython395C6514A4": { "Type": "AWS::Lambda::Function", "Properties": { "Code": { "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "5460d7e540a2c310c947f772c884382675ac0a06ba60e11fb8c1864feb6d642a.zip" + "S3Key": "f0d84a92fcedcb86c75a171578ce1049be08692d576eefe2785798d3966559f8.zip" }, "Handler": "index.handler", "Role": { "Fn::GetAtt": [ - "funcpython380ServiceRoleEAFB3F8E", - "Arn" - ] - }, - "Runtime": "python3.8" - }, - "DependsOn": [ - "funcpython380ServiceRoleEAFB3F8E" - ] - }, - "funcpython391ServiceRoleB031D4B2": { - "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" - ] - ] - } - ] - } - }, - "funcpython391BF9E5A5D": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "c6315ec36c3caa6d7af488cc4a3d4e2cdb314e006f146c196b2c29acf018cf00.zip" - }, - "Handler": "index.handler", - "Role": { - "Fn::GetAtt": [ - "funcpython391ServiceRoleB031D4B2", + "funcpython39ServiceRole0E545AAB", "Arn" ] }, "Runtime": "python3.9" }, "DependsOn": [ - "funcpython391ServiceRoleB031D4B2" + "funcpython39ServiceRole0E545AAB" ] }, - "funcpython3102ServiceRole2EEE2C30": { + "funcpython310ServiceRole420BCC1A": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { @@ -137,29 +84,29 @@ ] } }, - "funcpython310250533D21": { + "funcpython310172B0718": { "Type": "AWS::Lambda::Function", "Properties": { "Code": { "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "7c56b2150fc5df63cdcdb3596617be55b3c8b5b8d6aff8a254740ac53ff247f9.zip" + "S3Key": "603cf7a1b4100a862c9deef2e2868ed4e835a95f8aaf0c2179fc73c560603ab7.zip" }, "Handler": "index.handler", "Role": { "Fn::GetAtt": [ - "funcpython3102ServiceRole2EEE2C30", + "funcpython310ServiceRole420BCC1A", "Arn" ] }, "Runtime": "python3.10" }, "DependsOn": [ - "funcpython3102ServiceRole2EEE2C30" + "funcpython310ServiceRole420BCC1A" ] }, - "funcpython3113ServiceRole85D1934B": { + "funcpython311ServiceRoleE57E73A3": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { @@ -190,29 +137,29 @@ ] } }, - "funcpython3113A38A32E0": { + "funcpython3111F585CD4": { "Type": "AWS::Lambda::Function", "Properties": { "Code": { "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "e09f78a4fdb87fb9eb5035afda64212ecf2ad072580e870a2d665036d482b5f7.zip" + "S3Key": "2eec7314a6eaa29434975bf12ae867f360393e41ee78fc2bab858fe940ff18f1.zip" }, "Handler": "index.handler", "Role": { "Fn::GetAtt": [ - "funcpython3113ServiceRole85D1934B", + "funcpython311ServiceRoleE57E73A3", "Arn" ] }, "Runtime": "python3.11" }, "DependsOn": [ - "funcpython3113ServiceRole85D1934B" + "funcpython311ServiceRoleE57E73A3" ] }, - "funcpython3124ServiceRoleC78288F5": { + "funcpython312ServiceRole100DA5E2": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { @@ -243,29 +190,29 @@ ] } }, - "funcpython3124329A17EA": { + "funcpython3122CBD643A": { "Type": "AWS::Lambda::Function", "Properties": { "Code": { "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "5873808ef8cdd51f37645d88568d2c07313b9bc5990984c12df6c3725b2f4b69.zip" + "S3Key": "4556386f866bfec99a16c2d6a08ccafd85513a07078f7253255a132cde85644d.zip" }, "Handler": "index.handler", "Role": { "Fn::GetAtt": [ - "funcpython3124ServiceRoleC78288F5", + "funcpython312ServiceRole100DA5E2", "Arn" ] }, "Runtime": "python3.12" }, "DependsOn": [ - "funcpython3124ServiceRoleC78288F5" + "funcpython312ServiceRole100DA5E2" ] }, - "funcpython3135ServiceRoleA06F3D90": { + "funcpython313ServiceRoleB9C1B3D0": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { @@ -296,76 +243,68 @@ ] } }, - "funcpython313531E5474B": { + "funcpython313412235A8": { "Type": "AWS::Lambda::Function", "Properties": { "Code": { "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "fc9e9296f7d6c6238ccc33e0f45e0183f3c9aae92eca22d6b4744633e439b802.zip" + "S3Key": "0287b06105fd20f2a11d7afcd2939968452bad969729dde7d1ac46cc71b1b18a.zip" }, "Handler": "index.handler", "Role": { "Fn::GetAtt": [ - "funcpython3135ServiceRoleA06F3D90", + "funcpython313ServiceRoleB9C1B3D0", "Arn" ] }, "Runtime": "python3.13" }, "DependsOn": [ - "funcpython3135ServiceRoleA06F3D90" + "funcpython313ServiceRoleB9C1B3D0" ] } }, "Outputs": { - "ExportsOutputReffuncpython380BF74015B373B58A8": { - "Value": { - "Ref": "funcpython380BF74015B" - }, - "Export": { - "Name": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython380BF74015B373B58A8" - } - }, - "ExportsOutputReffuncpython391BF9E5A5D2A1CC211": { + "ExportsOutputReffuncpython395C6514A4FF6AA1CF": { "Value": { - "Ref": "funcpython391BF9E5A5D" + "Ref": "funcpython395C6514A4" }, "Export": { - "Name": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython391BF9E5A5D2A1CC211" + "Name": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython395C6514A4FF6AA1CF" } }, - "ExportsOutputReffuncpython310250533D219FAC6CD2": { + "ExportsOutputReffuncpython310172B07183FDAB4C5": { "Value": { - "Ref": "funcpython310250533D21" + "Ref": "funcpython310172B0718" }, "Export": { - "Name": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython310250533D219FAC6CD2" + "Name": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython310172B07183FDAB4C5" } }, - "ExportsOutputReffuncpython3113A38A32E025FF457A": { + "ExportsOutputReffuncpython3111F585CD475F56B0A": { "Value": { - "Ref": "funcpython3113A38A32E0" + "Ref": "funcpython3111F585CD4" }, "Export": { - "Name": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython3113A38A32E025FF457A" + "Name": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython3111F585CD475F56B0A" } }, - "ExportsOutputReffuncpython3124329A17EAFCC62348": { + "ExportsOutputReffuncpython3122CBD643AA9BB5D5A": { "Value": { - "Ref": "funcpython3124329A17EA" + "Ref": "funcpython3122CBD643A" }, "Export": { - "Name": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython3124329A17EAFCC62348" + "Name": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython3122CBD643AA9BB5D5A" } }, - "ExportsOutputReffuncpython313531E5474BAFBC149D": { + "ExportsOutputReffuncpython313412235A8A629B84E": { "Value": { - "Ref": "funcpython313531E5474B" + "Ref": "funcpython313412235A8" }, "Export": { - "Name": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython313531E5474BAFBC149D" + "Name": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython313412235A8A629B84E" } } }, diff --git a/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/integ.json b/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/integ.json index e0f176a8b25ac..fdd58c195f8b5 100644 --- a/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "38.0.1", + "version": "39.0.0", "testCases": { "lambda-python-build-images/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/lambdapythonbuildimagesDefaultTestDeployAssertB7623923.assets.json b/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/lambdapythonbuildimagesDefaultTestDeployAssertB7623923.assets.json index 4f6b71ce2cb23..6aba9a520ab5f 100644 --- a/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/lambdapythonbuildimagesDefaultTestDeployAssertB7623923.assets.json +++ b/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/lambdapythonbuildimagesDefaultTestDeployAssertB7623923.assets.json @@ -1,20 +1,20 @@ { - "version": "38.0.1", + "version": "39.0.0", "files": { - "b98abee59e034ed29eeb601684dc34752baa86509a7d457d72305d4e19ecc80b": { + "bfcf4228d6660f50e81f19efdb64c6388dda6796296eb239decdff1dbc2f4981": { "source": { - "path": "asset.b98abee59e034ed29eeb601684dc34752baa86509a7d457d72305d4e19ecc80b.bundle", + "path": "asset.bfcf4228d6660f50e81f19efdb64c6388dda6796296eb239decdff1dbc2f4981.bundle", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "b98abee59e034ed29eeb601684dc34752baa86509a7d457d72305d4e19ecc80b.zip", + "objectKey": "bfcf4228d6660f50e81f19efdb64c6388dda6796296eb239decdff1dbc2f4981.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "0220f10efe41cfec1b747afa780558e4d437f4596192126f3f52b044d9f78a7c": { + "ad166f40f32315b00dfabd440c98523d82500dc16a52cf7e474a92efec36c7f2": { "source": { "path": "lambdapythonbuildimagesDefaultTestDeployAssertB7623923.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "0220f10efe41cfec1b747afa780558e4d437f4596192126f3f52b044d9f78a7c.json", + "objectKey": "ad166f40f32315b00dfabd440c98523d82500dc16a52cf7e474a92efec36c7f2.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/lambdapythonbuildimagesDefaultTestDeployAssertB7623923.template.json b/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/lambdapythonbuildimagesDefaultTestDeployAssertB7623923.template.json index aea26d0fe4f65..b7b1e11337631 100644 --- a/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/lambdapythonbuildimagesDefaultTestDeployAssertB7623923.template.json +++ b/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/lambdapythonbuildimagesDefaultTestDeployAssertB7623923.template.json @@ -1,6 +1,6 @@ { "Resources": { - "LambdaInvoke4fc1d0a7bd77a13e1f50b9923bf9e57a": { + "LambdaInvoke4650aafbbe2e36433a126276d078658c": { "Type": "Custom::DeployAssert@SdkCallLambdainvoke", "Properties": { "ServiceToken": { @@ -19,7 +19,7 @@ [ "\"", { - "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython380BF74015B373B58A8" + "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython395C6514A4FF6AA1CF" }, "\"" ] @@ -27,17 +27,17 @@ } }, "flattenResponse": "false", - "salt": "1732468146431" + "salt": "1736369711421" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, - "LambdaInvoke4fc1d0a7bd77a13e1f50b9923bf9e57aInvoke616147C3": { + "LambdaInvoke4650aafbbe2e36433a126276d078658cInvoke00F25FEC": { "Type": "AWS::Lambda::Permission", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { - "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython380BF74015B373B58A8" + "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython395C6514A4FF6AA1CF" }, "Principal": { "Fn::GetAtt": [ @@ -106,7 +106,7 @@ }, ":function:", { - "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython380BF74015B373B58A8" + "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython395C6514A4FF6AA1CF" } ] ] @@ -146,7 +146,7 @@ }, ":function:", { - "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython391BF9E5A5D2A1CC211" + "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython310172B07183FDAB4C5" } ] ] @@ -186,7 +186,7 @@ }, ":function:", { - "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython310250533D219FAC6CD2" + "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython3111F585CD475F56B0A" } ] ] @@ -226,7 +226,7 @@ }, ":function:", { - "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython3113A38A32E025FF457A" + "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython3122CBD643AA9BB5D5A" } ] ] @@ -266,47 +266,7 @@ }, ":function:", { - "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython3124329A17EAFCC62348" - } - ] - ] - } - ] - }, - { - "Action": [ - "lambda:Invoke" - ], - "Effect": "Allow", - "Resource": [ - "*" - ] - }, - { - "Action": [ - "lambda:InvokeFunction" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":lambda:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":function:", - { - "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython313531E5474BAFBC149D" + "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython313412235A8A629B84E" } ] ] @@ -335,7 +295,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "b98abee59e034ed29eeb601684dc34752baa86509a7d457d72305d4e19ecc80b.zip" + "S3Key": "bfcf4228d6660f50e81f19efdb64c6388dda6796296eb239decdff1dbc2f4981.zip" }, "Timeout": 120, "Handler": "index.handler", @@ -347,7 +307,7 @@ } } }, - "LambdaInvoke4707fc22bb930064a0aa4daddd8e9724": { + "LambdaInvoke27dacea55ae28848262afba8ca16ad80": { "Type": "Custom::DeployAssert@SdkCallLambdainvoke", "Properties": { "ServiceToken": { @@ -366,7 +326,7 @@ [ "\"", { - "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython391BF9E5A5D2A1CC211" + "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython310172B07183FDAB4C5" }, "\"" ] @@ -374,17 +334,17 @@ } }, "flattenResponse": "false", - "salt": "1732468146440" + "salt": "1736369711423" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, - "LambdaInvoke4707fc22bb930064a0aa4daddd8e9724InvokeDA192FC8": { + "LambdaInvoke27dacea55ae28848262afba8ca16ad80Invoke71D9945A": { "Type": "AWS::Lambda::Permission", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { - "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython391BF9E5A5D2A1CC211" + "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython310172B07183FDAB4C5" }, "Principal": { "Fn::GetAtt": [ @@ -394,7 +354,7 @@ } } }, - "LambdaInvokea14da806a02dc330fe79e6272b5cb4a2": { + "LambdaInvokef88cb886ad84615afbbcb0f0c3db07f0": { "Type": "Custom::DeployAssert@SdkCallLambdainvoke", "Properties": { "ServiceToken": { @@ -413,7 +373,7 @@ [ "\"", { - "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython310250533D219FAC6CD2" + "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython3111F585CD475F56B0A" }, "\"" ] @@ -421,17 +381,17 @@ } }, "flattenResponse": "false", - "salt": "1732468146441" + "salt": "1736369711423" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, - "LambdaInvokea14da806a02dc330fe79e6272b5cb4a2InvokeE5D4E2D2": { + "LambdaInvokef88cb886ad84615afbbcb0f0c3db07f0InvokeD196D5AF": { "Type": "AWS::Lambda::Permission", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { - "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython310250533D219FAC6CD2" + "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython3111F585CD475F56B0A" }, "Principal": { "Fn::GetAtt": [ @@ -441,7 +401,7 @@ } } }, - "LambdaInvoked94ae5ddb38d1dc5e431fe152e2d51f4": { + "LambdaInvokeb44964fb0d419ef7e8d915cdb662e346": { "Type": "Custom::DeployAssert@SdkCallLambdainvoke", "Properties": { "ServiceToken": { @@ -460,7 +420,7 @@ [ "\"", { - "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython3113A38A32E025FF457A" + "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython3122CBD643AA9BB5D5A" }, "\"" ] @@ -468,17 +428,17 @@ } }, "flattenResponse": "false", - "salt": "1732468146441" + "salt": "1736369711423" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, - "LambdaInvoked94ae5ddb38d1dc5e431fe152e2d51f4Invoke8FCD61D9": { + "LambdaInvokeb44964fb0d419ef7e8d915cdb662e346Invoke47E1EFBF": { "Type": "AWS::Lambda::Permission", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { - "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython3113A38A32E025FF457A" + "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython3122CBD643AA9BB5D5A" }, "Principal": { "Fn::GetAtt": [ @@ -488,7 +448,7 @@ } } }, - "LambdaInvoke93b8a4fb01c1d0d88873f49b99b27bba": { + "LambdaInvokec96c44400b6e11ce551edcc6cedc0f39": { "Type": "Custom::DeployAssert@SdkCallLambdainvoke", "Properties": { "ServiceToken": { @@ -507,7 +467,7 @@ [ "\"", { - "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython3124329A17EAFCC62348" + "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython313412235A8A629B84E" }, "\"" ] @@ -515,64 +475,17 @@ } }, "flattenResponse": "false", - "salt": "1732468146441" + "salt": "1736369711424" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, - "LambdaInvoke93b8a4fb01c1d0d88873f49b99b27bbaInvoke5AB32309": { + "LambdaInvokec96c44400b6e11ce551edcc6cedc0f39InvokeE744DC6B": { "Type": "AWS::Lambda::Permission", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { - "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython3124329A17EAFCC62348" - }, - "Principal": { - "Fn::GetAtt": [ - "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", - "Arn" - ] - } - } - }, - "LambdaInvoke25576161f786619878cd1227f298bb94": { - "Type": "Custom::DeployAssert@SdkCallLambdainvoke", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", - "Arn" - ] - }, - "service": "Lambda", - "api": "invoke", - "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", - "parameters": { - "FunctionName": { - "Fn::Join": [ - "", - [ - "\"", - { - "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython313531E5474BAFBC149D" - }, - "\"" - ] - ] - } - }, - "flattenResponse": "false", - "salt": "1732468146441" - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "LambdaInvoke25576161f786619878cd1227f298bb94Invoke2EB3CA92": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython313531E5474BAFBC149D" + "Fn::ImportValue": "integ-lambda-python-test-build-images:ExportsOutputReffuncpython313412235A8A629B84E" }, "Principal": { "Fn::GetAtt": [ @@ -584,50 +497,42 @@ } }, "Outputs": { - "AssertionResultsLambdaInvoke4fc1d0a7bd77a13e1f50b9923bf9e57a": { - "Value": { - "Fn::GetAtt": [ - "LambdaInvoke4fc1d0a7bd77a13e1f50b9923bf9e57a", - "assertion" - ] - } - }, - "AssertionResultsLambdaInvoke4707fc22bb930064a0aa4daddd8e9724": { + "AssertionResultsLambdaInvoke4650aafbbe2e36433a126276d078658c": { "Value": { "Fn::GetAtt": [ - "LambdaInvoke4707fc22bb930064a0aa4daddd8e9724", + "LambdaInvoke4650aafbbe2e36433a126276d078658c", "assertion" ] } }, - "AssertionResultsLambdaInvokea14da806a02dc330fe79e6272b5cb4a2": { + "AssertionResultsLambdaInvoke27dacea55ae28848262afba8ca16ad80": { "Value": { "Fn::GetAtt": [ - "LambdaInvokea14da806a02dc330fe79e6272b5cb4a2", + "LambdaInvoke27dacea55ae28848262afba8ca16ad80", "assertion" ] } }, - "AssertionResultsLambdaInvoked94ae5ddb38d1dc5e431fe152e2d51f4": { + "AssertionResultsLambdaInvokef88cb886ad84615afbbcb0f0c3db07f0": { "Value": { "Fn::GetAtt": [ - "LambdaInvoked94ae5ddb38d1dc5e431fe152e2d51f4", + "LambdaInvokef88cb886ad84615afbbcb0f0c3db07f0", "assertion" ] } }, - "AssertionResultsLambdaInvoke93b8a4fb01c1d0d88873f49b99b27bba": { + "AssertionResultsLambdaInvokeb44964fb0d419ef7e8d915cdb662e346": { "Value": { "Fn::GetAtt": [ - "LambdaInvoke93b8a4fb01c1d0d88873f49b99b27bba", + "LambdaInvokeb44964fb0d419ef7e8d915cdb662e346", "assertion" ] } }, - "AssertionResultsLambdaInvoke25576161f786619878cd1227f298bb94": { + "AssertionResultsLambdaInvokec96c44400b6e11ce551edcc6cedc0f39": { "Value": { "Fn::GetAtt": [ - "LambdaInvoke25576161f786619878cd1227f298bb94", + "LambdaInvokec96c44400b6e11ce551edcc6cedc0f39", "assertion" ] } diff --git a/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/manifest.json b/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/manifest.json index ede2fe7a3351b..3809077de5a5e 100644 --- a/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "38.0.1", + "version": "39.0.0", "artifacts": { "integ-lambda-python-test-build-images.assets": { "type": "cdk:asset-manifest", @@ -18,7 +18,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}/b137af517a6361552724231af66a692319b567f04214dac25b362dc47335e5d3.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/a7a4fb29dd2634794668ee93203cee2f6731c30c1934ef6fbe0f80ca8b0962f9.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -34,124 +34,196 @@ "integ-lambda-python-test-build-images.assets" ], "metadata": { - "/integ-lambda-python-test-build-images/func-python3.8-0/ServiceRole/Resource": [ + "/integ-lambda-python-test-build-images/func-python3.9/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", - "data": "funcpython380ServiceRoleEAFB3F8E" + "data": "funcpython39ServiceRole0E545AAB" } ], - "/integ-lambda-python-test-build-images/func-python3.8-0/Resource": [ + "/integ-lambda-python-test-build-images/func-python3.9/Resource": [ { "type": "aws:cdk:logicalId", - "data": "funcpython380BF74015B" + "data": "funcpython395C6514A4" } ], - "/integ-lambda-python-test-build-images/func-python3.9-1/ServiceRole/Resource": [ + "/integ-lambda-python-test-build-images/func-python3.10/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", - "data": "funcpython391ServiceRoleB031D4B2" + "data": "funcpython310ServiceRole420BCC1A" } ], - "/integ-lambda-python-test-build-images/func-python3.9-1/Resource": [ + "/integ-lambda-python-test-build-images/func-python3.10/Resource": [ { "type": "aws:cdk:logicalId", - "data": "funcpython391BF9E5A5D" + "data": "funcpython310172B0718" } ], - "/integ-lambda-python-test-build-images/func-python3.10-2/ServiceRole/Resource": [ + "/integ-lambda-python-test-build-images/func-python3.11/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", - "data": "funcpython3102ServiceRole2EEE2C30" + "data": "funcpython311ServiceRoleE57E73A3" } ], - "/integ-lambda-python-test-build-images/func-python3.10-2/Resource": [ + "/integ-lambda-python-test-build-images/func-python3.11/Resource": [ { "type": "aws:cdk:logicalId", - "data": "funcpython310250533D21" + "data": "funcpython3111F585CD4" } ], - "/integ-lambda-python-test-build-images/func-python3.11-3/ServiceRole/Resource": [ + "/integ-lambda-python-test-build-images/func-python3.12/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", - "data": "funcpython3113ServiceRole85D1934B" + "data": "funcpython312ServiceRole100DA5E2" } ], - "/integ-lambda-python-test-build-images/func-python3.11-3/Resource": [ + "/integ-lambda-python-test-build-images/func-python3.12/Resource": [ { "type": "aws:cdk:logicalId", - "data": "funcpython3113A38A32E0" + "data": "funcpython3122CBD643A" } ], - "/integ-lambda-python-test-build-images/func-python3.12-4/ServiceRole/Resource": [ + "/integ-lambda-python-test-build-images/func-python3.13/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", - "data": "funcpython3124ServiceRoleC78288F5" + "data": "funcpython313ServiceRoleB9C1B3D0" } ], - "/integ-lambda-python-test-build-images/func-python3.12-4/Resource": [ + "/integ-lambda-python-test-build-images/func-python3.13/Resource": [ { "type": "aws:cdk:logicalId", - "data": "funcpython3124329A17EA" + "data": "funcpython313412235A8" } ], - "/integ-lambda-python-test-build-images/func-python3.13-5/ServiceRole/Resource": [ + "/integ-lambda-python-test-build-images/Exports/Output{\"Ref\":\"funcpython395C6514A4\"}": [ { "type": "aws:cdk:logicalId", - "data": "funcpython3135ServiceRoleA06F3D90" + "data": "ExportsOutputReffuncpython395C6514A4FF6AA1CF" } ], - "/integ-lambda-python-test-build-images/func-python3.13-5/Resource": [ + "/integ-lambda-python-test-build-images/Exports/Output{\"Ref\":\"funcpython310172B0718\"}": [ { "type": "aws:cdk:logicalId", - "data": "funcpython313531E5474B" + "data": "ExportsOutputReffuncpython310172B07183FDAB4C5" } ], - "/integ-lambda-python-test-build-images/Exports/Output{\"Ref\":\"funcpython380BF74015B\"}": [ + "/integ-lambda-python-test-build-images/Exports/Output{\"Ref\":\"funcpython3111F585CD4\"}": [ { "type": "aws:cdk:logicalId", - "data": "ExportsOutputReffuncpython380BF74015B373B58A8" + "data": "ExportsOutputReffuncpython3111F585CD475F56B0A" } ], - "/integ-lambda-python-test-build-images/Exports/Output{\"Ref\":\"funcpython391BF9E5A5D\"}": [ + "/integ-lambda-python-test-build-images/Exports/Output{\"Ref\":\"funcpython3122CBD643A\"}": [ { "type": "aws:cdk:logicalId", - "data": "ExportsOutputReffuncpython391BF9E5A5D2A1CC211" + "data": "ExportsOutputReffuncpython3122CBD643AA9BB5D5A" } ], - "/integ-lambda-python-test-build-images/Exports/Output{\"Ref\":\"funcpython310250533D21\"}": [ + "/integ-lambda-python-test-build-images/Exports/Output{\"Ref\":\"funcpython313412235A8\"}": [ { "type": "aws:cdk:logicalId", - "data": "ExportsOutputReffuncpython310250533D219FAC6CD2" + "data": "ExportsOutputReffuncpython313412235A8A629B84E" } ], - "/integ-lambda-python-test-build-images/Exports/Output{\"Ref\":\"funcpython3113A38A32E0\"}": [ + "/integ-lambda-python-test-build-images/BootstrapVersion": [ { "type": "aws:cdk:logicalId", - "data": "ExportsOutputReffuncpython3113A38A32E025FF457A" + "data": "BootstrapVersion" } ], - "/integ-lambda-python-test-build-images/Exports/Output{\"Ref\":\"funcpython3124329A17EA\"}": [ + "/integ-lambda-python-test-build-images/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", - "data": "ExportsOutputReffuncpython3124329A17EAFCC62348" + "data": "CheckBootstrapVersion" } ], - "/integ-lambda-python-test-build-images/Exports/Output{\"Ref\":\"funcpython313531E5474B\"}": [ + "funcpython390ServiceRole02A01172": [ { "type": "aws:cdk:logicalId", - "data": "ExportsOutputReffuncpython313531E5474BAFBC149D" + "data": "funcpython390ServiceRole02A01172", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] } ], - "/integ-lambda-python-test-build-images/BootstrapVersion": [ + "funcpython3900426EA0F": [ { "type": "aws:cdk:logicalId", - "data": "BootstrapVersion" + "data": "funcpython3900426EA0F", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] } ], - "/integ-lambda-python-test-build-images/CheckBootstrapVersion": [ + "funcpython3101ServiceRole383A2D2B": [ { "type": "aws:cdk:logicalId", - "data": "CheckBootstrapVersion" + "data": "funcpython3101ServiceRole383A2D2B", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "funcpython3101663DCBA4": [ + { + "type": "aws:cdk:logicalId", + "data": "funcpython3101663DCBA4", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "funcpython3112ServiceRole28831AE7": [ + { + "type": "aws:cdk:logicalId", + "data": "funcpython3112ServiceRole28831AE7", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "funcpython311237E1A864": [ + { + "type": "aws:cdk:logicalId", + "data": "funcpython311237E1A864", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "funcpython3123ServiceRole518636DC": [ + { + "type": "aws:cdk:logicalId", + "data": "funcpython3123ServiceRole518636DC", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "funcpython31232EE13CCD": [ + { + "type": "aws:cdk:logicalId", + "data": "funcpython31232EE13CCD", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "funcpython3134ServiceRole83E60B67": [ + { + "type": "aws:cdk:logicalId", + "data": "funcpython3134ServiceRole83E60B67", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "funcpython31342B5CC056": [ + { + "type": "aws:cdk:logicalId", + "data": "funcpython31342B5CC056", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] } ] }, @@ -174,7 +246,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}/0220f10efe41cfec1b747afa780558e4d437f4596192126f3f52b044d9f78a7c.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/ad166f40f32315b00dfabd440c98523d82500dc16a52cf7e474a92efec36c7f2.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -191,22 +263,22 @@ "lambdapythonbuildimagesDefaultTestDeployAssertB7623923.assets" ], "metadata": { - "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4fc1d0a7bd77a13e1f50b9923bf9e57a/Default/Default": [ + "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4650aafbbe2e36433a126276d078658c/Default/Default": [ { "type": "aws:cdk:logicalId", - "data": "LambdaInvoke4fc1d0a7bd77a13e1f50b9923bf9e57a" + "data": "LambdaInvoke4650aafbbe2e36433a126276d078658c" } ], - "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4fc1d0a7bd77a13e1f50b9923bf9e57a/Invoke": [ + "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4650aafbbe2e36433a126276d078658c/Invoke": [ { "type": "aws:cdk:logicalId", - "data": "LambdaInvoke4fc1d0a7bd77a13e1f50b9923bf9e57aInvoke616147C3" + "data": "LambdaInvoke4650aafbbe2e36433a126276d078658cInvoke00F25FEC" } ], - "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4fc1d0a7bd77a13e1f50b9923bf9e57a/AssertionResults": [ + "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4650aafbbe2e36433a126276d078658c/AssertionResults": [ { "type": "aws:cdk:logicalId", - "data": "AssertionResultsLambdaInvoke4fc1d0a7bd77a13e1f50b9923bf9e57a" + "data": "AssertionResultsLambdaInvoke4650aafbbe2e36433a126276d078658c" } ], "/lambda-python-build-images/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role": [ @@ -227,94 +299,76 @@ "data": "LatestNodeRuntimeMap" } ], - "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4707fc22bb930064a0aa4daddd8e9724/Default/Default": [ - { - "type": "aws:cdk:logicalId", - "data": "LambdaInvoke4707fc22bb930064a0aa4daddd8e9724" - } - ], - "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4707fc22bb930064a0aa4daddd8e9724/Invoke": [ - { - "type": "aws:cdk:logicalId", - "data": "LambdaInvoke4707fc22bb930064a0aa4daddd8e9724InvokeDA192FC8" - } - ], - "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4707fc22bb930064a0aa4daddd8e9724/AssertionResults": [ - { - "type": "aws:cdk:logicalId", - "data": "AssertionResultsLambdaInvoke4707fc22bb930064a0aa4daddd8e9724" - } - ], - "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokea14da806a02dc330fe79e6272b5cb4a2/Default/Default": [ + "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke27dacea55ae28848262afba8ca16ad80/Default/Default": [ { "type": "aws:cdk:logicalId", - "data": "LambdaInvokea14da806a02dc330fe79e6272b5cb4a2" + "data": "LambdaInvoke27dacea55ae28848262afba8ca16ad80" } ], - "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokea14da806a02dc330fe79e6272b5cb4a2/Invoke": [ + "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke27dacea55ae28848262afba8ca16ad80/Invoke": [ { "type": "aws:cdk:logicalId", - "data": "LambdaInvokea14da806a02dc330fe79e6272b5cb4a2InvokeE5D4E2D2" + "data": "LambdaInvoke27dacea55ae28848262afba8ca16ad80Invoke71D9945A" } ], - "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokea14da806a02dc330fe79e6272b5cb4a2/AssertionResults": [ + "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke27dacea55ae28848262afba8ca16ad80/AssertionResults": [ { "type": "aws:cdk:logicalId", - "data": "AssertionResultsLambdaInvokea14da806a02dc330fe79e6272b5cb4a2" + "data": "AssertionResultsLambdaInvoke27dacea55ae28848262afba8ca16ad80" } ], - "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoked94ae5ddb38d1dc5e431fe152e2d51f4/Default/Default": [ + "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokef88cb886ad84615afbbcb0f0c3db07f0/Default/Default": [ { "type": "aws:cdk:logicalId", - "data": "LambdaInvoked94ae5ddb38d1dc5e431fe152e2d51f4" + "data": "LambdaInvokef88cb886ad84615afbbcb0f0c3db07f0" } ], - "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoked94ae5ddb38d1dc5e431fe152e2d51f4/Invoke": [ + "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokef88cb886ad84615afbbcb0f0c3db07f0/Invoke": [ { "type": "aws:cdk:logicalId", - "data": "LambdaInvoked94ae5ddb38d1dc5e431fe152e2d51f4Invoke8FCD61D9" + "data": "LambdaInvokef88cb886ad84615afbbcb0f0c3db07f0InvokeD196D5AF" } ], - "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoked94ae5ddb38d1dc5e431fe152e2d51f4/AssertionResults": [ + "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokef88cb886ad84615afbbcb0f0c3db07f0/AssertionResults": [ { "type": "aws:cdk:logicalId", - "data": "AssertionResultsLambdaInvoked94ae5ddb38d1dc5e431fe152e2d51f4" + "data": "AssertionResultsLambdaInvokef88cb886ad84615afbbcb0f0c3db07f0" } ], - "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke93b8a4fb01c1d0d88873f49b99b27bba/Default/Default": [ + "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokeb44964fb0d419ef7e8d915cdb662e346/Default/Default": [ { "type": "aws:cdk:logicalId", - "data": "LambdaInvoke93b8a4fb01c1d0d88873f49b99b27bba" + "data": "LambdaInvokeb44964fb0d419ef7e8d915cdb662e346" } ], - "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke93b8a4fb01c1d0d88873f49b99b27bba/Invoke": [ + "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokeb44964fb0d419ef7e8d915cdb662e346/Invoke": [ { "type": "aws:cdk:logicalId", - "data": "LambdaInvoke93b8a4fb01c1d0d88873f49b99b27bbaInvoke5AB32309" + "data": "LambdaInvokeb44964fb0d419ef7e8d915cdb662e346Invoke47E1EFBF" } ], - "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke93b8a4fb01c1d0d88873f49b99b27bba/AssertionResults": [ + "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokeb44964fb0d419ef7e8d915cdb662e346/AssertionResults": [ { "type": "aws:cdk:logicalId", - "data": "AssertionResultsLambdaInvoke93b8a4fb01c1d0d88873f49b99b27bba" + "data": "AssertionResultsLambdaInvokeb44964fb0d419ef7e8d915cdb662e346" } ], - "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke25576161f786619878cd1227f298bb94/Default/Default": [ + "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokec96c44400b6e11ce551edcc6cedc0f39/Default/Default": [ { "type": "aws:cdk:logicalId", - "data": "LambdaInvoke25576161f786619878cd1227f298bb94" + "data": "LambdaInvokec96c44400b6e11ce551edcc6cedc0f39" } ], - "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke25576161f786619878cd1227f298bb94/Invoke": [ + "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokec96c44400b6e11ce551edcc6cedc0f39/Invoke": [ { "type": "aws:cdk:logicalId", - "data": "LambdaInvoke25576161f786619878cd1227f298bb94Invoke2EB3CA92" + "data": "LambdaInvokec96c44400b6e11ce551edcc6cedc0f39InvokeE744DC6B" } ], - "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke25576161f786619878cd1227f298bb94/AssertionResults": [ + "/lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokec96c44400b6e11ce551edcc6cedc0f39/AssertionResults": [ { "type": "aws:cdk:logicalId", - "data": "AssertionResultsLambdaInvoke25576161f786619878cd1227f298bb94" + "data": "AssertionResultsLambdaInvokec96c44400b6e11ce551edcc6cedc0f39" } ], "/lambda-python-build-images/DefaultTest/DeployAssert/BootstrapVersion": [ diff --git a/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/tree.json b/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/tree.json index 9fac798f32075..2a6f00aae62b7 100644 --- a/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.js.snapshot/tree.json @@ -8,17 +8,17 @@ "id": "integ-lambda-python-test-build-images", "path": "integ-lambda-python-test-build-images", "children": { - "func-python3.8-0": { - "id": "func-python3.8-0", - "path": "integ-lambda-python-test-build-images/func-python3.8-0", + "func-python3.9": { + "id": "func-python3.9", + "path": "integ-lambda-python-test-build-images/func-python3.9", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "integ-lambda-python-test-build-images/func-python3.8-0/ServiceRole", + "path": "integ-lambda-python-test-build-images/func-python3.9/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "integ-lambda-python-test-build-images/func-python3.8-0/ServiceRole/ImportServiceRole", + "path": "integ-lambda-python-test-build-images/func-python3.9/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -26,7 +26,7 @@ }, "Resource": { "id": "Resource", - "path": "integ-lambda-python-test-build-images/func-python3.8-0/ServiceRole/Resource", + "path": "integ-lambda-python-test-build-images/func-python3.9/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -71,11 +71,11 @@ }, "Code": { "id": "Code", - "path": "integ-lambda-python-test-build-images/func-python3.8-0/Code", + "path": "integ-lambda-python-test-build-images/func-python3.9/Code", "children": { "Stage": { "id": "Stage", - "path": "integ-lambda-python-test-build-images/func-python3.8-0/Code/Stage", + "path": "integ-lambda-python-test-build-images/func-python3.9/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -83,7 +83,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "integ-lambda-python-test-build-images/func-python3.8-0/Code/AssetBucket", + "path": "integ-lambda-python-test-build-images/func-python3.9/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -97,7 +97,7 @@ }, "Resource": { "id": "Resource", - "path": "integ-lambda-python-test-build-images/func-python3.8-0/Resource", + "path": "integ-lambda-python-test-build-images/func-python3.9/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -105,132 +105,12 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "5460d7e540a2c310c947f772c884382675ac0a06ba60e11fb8c1864feb6d642a.zip" + "s3Key": "f0d84a92fcedcb86c75a171578ce1049be08692d576eefe2785798d3966559f8.zip" }, "handler": "index.handler", "role": { "Fn::GetAtt": [ - "funcpython380ServiceRoleEAFB3F8E", - "Arn" - ] - }, - "runtime": "python3.8" - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.Function", - "version": "0.0.0" - } - }, - "func-python3.9-1": { - "id": "func-python3.9-1", - "path": "integ-lambda-python-test-build-images/func-python3.9-1", - "children": { - "ServiceRole": { - "id": "ServiceRole", - "path": "integ-lambda-python-test-build-images/func-python3.9-1/ServiceRole", - "children": { - "ImportServiceRole": { - "id": "ImportServiceRole", - "path": "integ-lambda-python-test-build-images/func-python3.9-1/ServiceRole/ImportServiceRole", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "integ-lambda-python-test-build-images/func-python3.9-1/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" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" - } - }, - "Code": { - "id": "Code", - "path": "integ-lambda-python-test-build-images/func-python3.9-1/Code", - "children": { - "Stage": { - "id": "Stage", - "path": "integ-lambda-python-test-build-images/func-python3.9-1/Code/Stage", - "constructInfo": { - "fqn": "aws-cdk-lib.AssetStaging", - "version": "0.0.0" - } - }, - "AssetBucket": { - "id": "AssetBucket", - "path": "integ-lambda-python-test-build-images/func-python3.9-1/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": "integ-lambda-python-test-build-images/func-python3.9-1/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": "c6315ec36c3caa6d7af488cc4a3d4e2cdb314e006f146c196b2c29acf018cf00.zip" - }, - "handler": "index.handler", - "role": { - "Fn::GetAtt": [ - "funcpython391ServiceRoleB031D4B2", + "funcpython39ServiceRole0E545AAB", "Arn" ] }, @@ -244,21 +124,21 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.Function", + "fqn": "@aws-cdk/aws-lambda-python-alpha.PythonFunction", "version": "0.0.0" } }, - "func-python3.10-2": { - "id": "func-python3.10-2", - "path": "integ-lambda-python-test-build-images/func-python3.10-2", + "func-python3.10": { + "id": "func-python3.10", + "path": "integ-lambda-python-test-build-images/func-python3.10", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "integ-lambda-python-test-build-images/func-python3.10-2/ServiceRole", + "path": "integ-lambda-python-test-build-images/func-python3.10/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "integ-lambda-python-test-build-images/func-python3.10-2/ServiceRole/ImportServiceRole", + "path": "integ-lambda-python-test-build-images/func-python3.10/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -266,7 +146,7 @@ }, "Resource": { "id": "Resource", - "path": "integ-lambda-python-test-build-images/func-python3.10-2/ServiceRole/Resource", + "path": "integ-lambda-python-test-build-images/func-python3.10/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -311,11 +191,11 @@ }, "Code": { "id": "Code", - "path": "integ-lambda-python-test-build-images/func-python3.10-2/Code", + "path": "integ-lambda-python-test-build-images/func-python3.10/Code", "children": { "Stage": { "id": "Stage", - "path": "integ-lambda-python-test-build-images/func-python3.10-2/Code/Stage", + "path": "integ-lambda-python-test-build-images/func-python3.10/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -323,7 +203,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "integ-lambda-python-test-build-images/func-python3.10-2/Code/AssetBucket", + "path": "integ-lambda-python-test-build-images/func-python3.10/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -337,7 +217,7 @@ }, "Resource": { "id": "Resource", - "path": "integ-lambda-python-test-build-images/func-python3.10-2/Resource", + "path": "integ-lambda-python-test-build-images/func-python3.10/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -345,12 +225,12 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "7c56b2150fc5df63cdcdb3596617be55b3c8b5b8d6aff8a254740ac53ff247f9.zip" + "s3Key": "603cf7a1b4100a862c9deef2e2868ed4e835a95f8aaf0c2179fc73c560603ab7.zip" }, "handler": "index.handler", "role": { "Fn::GetAtt": [ - "funcpython3102ServiceRole2EEE2C30", + "funcpython310ServiceRole420BCC1A", "Arn" ] }, @@ -364,21 +244,21 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.Function", + "fqn": "@aws-cdk/aws-lambda-python-alpha.PythonFunction", "version": "0.0.0" } }, - "func-python3.11-3": { - "id": "func-python3.11-3", - "path": "integ-lambda-python-test-build-images/func-python3.11-3", + "func-python3.11": { + "id": "func-python3.11", + "path": "integ-lambda-python-test-build-images/func-python3.11", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "integ-lambda-python-test-build-images/func-python3.11-3/ServiceRole", + "path": "integ-lambda-python-test-build-images/func-python3.11/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "integ-lambda-python-test-build-images/func-python3.11-3/ServiceRole/ImportServiceRole", + "path": "integ-lambda-python-test-build-images/func-python3.11/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -386,7 +266,7 @@ }, "Resource": { "id": "Resource", - "path": "integ-lambda-python-test-build-images/func-python3.11-3/ServiceRole/Resource", + "path": "integ-lambda-python-test-build-images/func-python3.11/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -431,11 +311,11 @@ }, "Code": { "id": "Code", - "path": "integ-lambda-python-test-build-images/func-python3.11-3/Code", + "path": "integ-lambda-python-test-build-images/func-python3.11/Code", "children": { "Stage": { "id": "Stage", - "path": "integ-lambda-python-test-build-images/func-python3.11-3/Code/Stage", + "path": "integ-lambda-python-test-build-images/func-python3.11/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -443,7 +323,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "integ-lambda-python-test-build-images/func-python3.11-3/Code/AssetBucket", + "path": "integ-lambda-python-test-build-images/func-python3.11/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -457,7 +337,7 @@ }, "Resource": { "id": "Resource", - "path": "integ-lambda-python-test-build-images/func-python3.11-3/Resource", + "path": "integ-lambda-python-test-build-images/func-python3.11/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -465,12 +345,12 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "e09f78a4fdb87fb9eb5035afda64212ecf2ad072580e870a2d665036d482b5f7.zip" + "s3Key": "2eec7314a6eaa29434975bf12ae867f360393e41ee78fc2bab858fe940ff18f1.zip" }, "handler": "index.handler", "role": { "Fn::GetAtt": [ - "funcpython3113ServiceRole85D1934B", + "funcpython311ServiceRoleE57E73A3", "Arn" ] }, @@ -484,21 +364,21 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.Function", + "fqn": "@aws-cdk/aws-lambda-python-alpha.PythonFunction", "version": "0.0.0" } }, - "func-python3.12-4": { - "id": "func-python3.12-4", - "path": "integ-lambda-python-test-build-images/func-python3.12-4", + "func-python3.12": { + "id": "func-python3.12", + "path": "integ-lambda-python-test-build-images/func-python3.12", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "integ-lambda-python-test-build-images/func-python3.12-4/ServiceRole", + "path": "integ-lambda-python-test-build-images/func-python3.12/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "integ-lambda-python-test-build-images/func-python3.12-4/ServiceRole/ImportServiceRole", + "path": "integ-lambda-python-test-build-images/func-python3.12/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -506,7 +386,7 @@ }, "Resource": { "id": "Resource", - "path": "integ-lambda-python-test-build-images/func-python3.12-4/ServiceRole/Resource", + "path": "integ-lambda-python-test-build-images/func-python3.12/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -551,11 +431,11 @@ }, "Code": { "id": "Code", - "path": "integ-lambda-python-test-build-images/func-python3.12-4/Code", + "path": "integ-lambda-python-test-build-images/func-python3.12/Code", "children": { "Stage": { "id": "Stage", - "path": "integ-lambda-python-test-build-images/func-python3.12-4/Code/Stage", + "path": "integ-lambda-python-test-build-images/func-python3.12/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -563,7 +443,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "integ-lambda-python-test-build-images/func-python3.12-4/Code/AssetBucket", + "path": "integ-lambda-python-test-build-images/func-python3.12/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -577,7 +457,7 @@ }, "Resource": { "id": "Resource", - "path": "integ-lambda-python-test-build-images/func-python3.12-4/Resource", + "path": "integ-lambda-python-test-build-images/func-python3.12/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -585,12 +465,12 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "5873808ef8cdd51f37645d88568d2c07313b9bc5990984c12df6c3725b2f4b69.zip" + "s3Key": "4556386f866bfec99a16c2d6a08ccafd85513a07078f7253255a132cde85644d.zip" }, "handler": "index.handler", "role": { "Fn::GetAtt": [ - "funcpython3124ServiceRoleC78288F5", + "funcpython312ServiceRole100DA5E2", "Arn" ] }, @@ -604,21 +484,21 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.Function", + "fqn": "@aws-cdk/aws-lambda-python-alpha.PythonFunction", "version": "0.0.0" } }, - "func-python3.13-5": { - "id": "func-python3.13-5", - "path": "integ-lambda-python-test-build-images/func-python3.13-5", + "func-python3.13": { + "id": "func-python3.13", + "path": "integ-lambda-python-test-build-images/func-python3.13", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "integ-lambda-python-test-build-images/func-python3.13-5/ServiceRole", + "path": "integ-lambda-python-test-build-images/func-python3.13/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "integ-lambda-python-test-build-images/func-python3.13-5/ServiceRole/ImportServiceRole", + "path": "integ-lambda-python-test-build-images/func-python3.13/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -626,7 +506,7 @@ }, "Resource": { "id": "Resource", - "path": "integ-lambda-python-test-build-images/func-python3.13-5/ServiceRole/Resource", + "path": "integ-lambda-python-test-build-images/func-python3.13/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -671,11 +551,11 @@ }, "Code": { "id": "Code", - "path": "integ-lambda-python-test-build-images/func-python3.13-5/Code", + "path": "integ-lambda-python-test-build-images/func-python3.13/Code", "children": { "Stage": { "id": "Stage", - "path": "integ-lambda-python-test-build-images/func-python3.13-5/Code/Stage", + "path": "integ-lambda-python-test-build-images/func-python3.13/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -683,7 +563,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "integ-lambda-python-test-build-images/func-python3.13-5/Code/AssetBucket", + "path": "integ-lambda-python-test-build-images/func-python3.13/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -697,7 +577,7 @@ }, "Resource": { "id": "Resource", - "path": "integ-lambda-python-test-build-images/func-python3.13-5/Resource", + "path": "integ-lambda-python-test-build-images/func-python3.13/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -705,12 +585,12 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "fc9e9296f7d6c6238ccc33e0f45e0183f3c9aae92eca22d6b4744633e439b802.zip" + "s3Key": "0287b06105fd20f2a11d7afcd2939968452bad969729dde7d1ac46cc71b1b18a.zip" }, "handler": "index.handler", "role": { "Fn::GetAtt": [ - "funcpython3135ServiceRoleA06F3D90", + "funcpython313ServiceRoleB9C1B3D0", "Arn" ] }, @@ -724,7 +604,7 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.Function", + "fqn": "@aws-cdk/aws-lambda-python-alpha.PythonFunction", "version": "0.0.0" } }, @@ -732,49 +612,41 @@ "id": "Exports", "path": "integ-lambda-python-test-build-images/Exports", "children": { - "Output{\"Ref\":\"funcpython380BF74015B\"}": { - "id": "Output{\"Ref\":\"funcpython380BF74015B\"}", - "path": "integ-lambda-python-test-build-images/Exports/Output{\"Ref\":\"funcpython380BF74015B\"}", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnOutput", - "version": "0.0.0" - } - }, - "Output{\"Ref\":\"funcpython391BF9E5A5D\"}": { - "id": "Output{\"Ref\":\"funcpython391BF9E5A5D\"}", - "path": "integ-lambda-python-test-build-images/Exports/Output{\"Ref\":\"funcpython391BF9E5A5D\"}", + "Output{\"Ref\":\"funcpython395C6514A4\"}": { + "id": "Output{\"Ref\":\"funcpython395C6514A4\"}", + "path": "integ-lambda-python-test-build-images/Exports/Output{\"Ref\":\"funcpython395C6514A4\"}", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" } }, - "Output{\"Ref\":\"funcpython310250533D21\"}": { - "id": "Output{\"Ref\":\"funcpython310250533D21\"}", - "path": "integ-lambda-python-test-build-images/Exports/Output{\"Ref\":\"funcpython310250533D21\"}", + "Output{\"Ref\":\"funcpython310172B0718\"}": { + "id": "Output{\"Ref\":\"funcpython310172B0718\"}", + "path": "integ-lambda-python-test-build-images/Exports/Output{\"Ref\":\"funcpython310172B0718\"}", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" } }, - "Output{\"Ref\":\"funcpython3113A38A32E0\"}": { - "id": "Output{\"Ref\":\"funcpython3113A38A32E0\"}", - "path": "integ-lambda-python-test-build-images/Exports/Output{\"Ref\":\"funcpython3113A38A32E0\"}", + "Output{\"Ref\":\"funcpython3111F585CD4\"}": { + "id": "Output{\"Ref\":\"funcpython3111F585CD4\"}", + "path": "integ-lambda-python-test-build-images/Exports/Output{\"Ref\":\"funcpython3111F585CD4\"}", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" } }, - "Output{\"Ref\":\"funcpython3124329A17EA\"}": { - "id": "Output{\"Ref\":\"funcpython3124329A17EA\"}", - "path": "integ-lambda-python-test-build-images/Exports/Output{\"Ref\":\"funcpython3124329A17EA\"}", + "Output{\"Ref\":\"funcpython3122CBD643A\"}": { + "id": "Output{\"Ref\":\"funcpython3122CBD643A\"}", + "path": "integ-lambda-python-test-build-images/Exports/Output{\"Ref\":\"funcpython3122CBD643A\"}", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" } }, - "Output{\"Ref\":\"funcpython313531E5474B\"}": { - "id": "Output{\"Ref\":\"funcpython313531E5474B\"}", - "path": "integ-lambda-python-test-build-images/Exports/Output{\"Ref\":\"funcpython313531E5474B\"}", + "Output{\"Ref\":\"funcpython313412235A8\"}": { + "id": "Output{\"Ref\":\"funcpython313412235A8\"}", + "path": "integ-lambda-python-test-build-images/Exports/Output{\"Ref\":\"funcpython313412235A8\"}", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" @@ -828,17 +700,17 @@ "id": "DeployAssert", "path": "lambda-python-build-images/DefaultTest/DeployAssert", "children": { - "LambdaInvoke4fc1d0a7bd77a13e1f50b9923bf9e57a": { - "id": "LambdaInvoke4fc1d0a7bd77a13e1f50b9923bf9e57a", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4fc1d0a7bd77a13e1f50b9923bf9e57a", + "LambdaInvoke4650aafbbe2e36433a126276d078658c": { + "id": "LambdaInvoke4650aafbbe2e36433a126276d078658c", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4650aafbbe2e36433a126276d078658c", "children": { "SdkProvider": { "id": "SdkProvider", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4fc1d0a7bd77a13e1f50b9923bf9e57a/SdkProvider", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4650aafbbe2e36433a126276d078658c/SdkProvider", "children": { "AssertionsProvider": { "id": "AssertionsProvider", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4fc1d0a7bd77a13e1f50b9923bf9e57a/SdkProvider/AssertionsProvider", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4650aafbbe2e36433a126276d078658c/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", "version": "10.4.2" @@ -852,11 +724,11 @@ }, "Default": { "id": "Default", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4fc1d0a7bd77a13e1f50b9923bf9e57a/Default", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4650aafbbe2e36433a126276d078658c/Default", "children": { "Default": { "id": "Default", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4fc1d0a7bd77a13e1f50b9923bf9e57a/Default/Default", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4650aafbbe2e36433a126276d078658c/Default/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -870,7 +742,7 @@ }, "Invoke": { "id": "Invoke", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4fc1d0a7bd77a13e1f50b9923bf9e57a/Invoke", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4650aafbbe2e36433a126276d078658c/Invoke", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -878,7 +750,7 @@ }, "AssertionResults": { "id": "AssertionResults", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4fc1d0a7bd77a13e1f50b9923bf9e57a/AssertionResults", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4650aafbbe2e36433a126276d078658c/AssertionResults", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" @@ -932,79 +804,17 @@ "version": "0.0.0" } }, - "LambdaInvoke4707fc22bb930064a0aa4daddd8e9724": { - "id": "LambdaInvoke4707fc22bb930064a0aa4daddd8e9724", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4707fc22bb930064a0aa4daddd8e9724", - "children": { - "SdkProvider": { - "id": "SdkProvider", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4707fc22bb930064a0aa4daddd8e9724/SdkProvider", - "children": { - "AssertionsProvider": { - "id": "AssertionsProvider", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4707fc22bb930064a0aa4daddd8e9724/SdkProvider/AssertionsProvider", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.4.2" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests-alpha.AssertionsProvider", - "version": "0.0.0" - } - }, - "Default": { - "id": "Default", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4707fc22bb930064a0aa4daddd8e9724/Default", - "children": { - "Default": { - "id": "Default", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4707fc22bb930064a0aa4daddd8e9724/Default/Default", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.CustomResource", - "version": "0.0.0" - } - }, - "Invoke": { - "id": "Invoke", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4707fc22bb930064a0aa4daddd8e9724/Invoke", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnResource", - "version": "0.0.0" - } - }, - "AssertionResults": { - "id": "AssertionResults", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke4707fc22bb930064a0aa4daddd8e9724/AssertionResults", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnOutput", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests-alpha.LambdaInvokeFunction", - "version": "0.0.0" - } - }, - "LambdaInvokea14da806a02dc330fe79e6272b5cb4a2": { - "id": "LambdaInvokea14da806a02dc330fe79e6272b5cb4a2", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokea14da806a02dc330fe79e6272b5cb4a2", + "LambdaInvoke27dacea55ae28848262afba8ca16ad80": { + "id": "LambdaInvoke27dacea55ae28848262afba8ca16ad80", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke27dacea55ae28848262afba8ca16ad80", "children": { "SdkProvider": { "id": "SdkProvider", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokea14da806a02dc330fe79e6272b5cb4a2/SdkProvider", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke27dacea55ae28848262afba8ca16ad80/SdkProvider", "children": { "AssertionsProvider": { "id": "AssertionsProvider", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokea14da806a02dc330fe79e6272b5cb4a2/SdkProvider/AssertionsProvider", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke27dacea55ae28848262afba8ca16ad80/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", "version": "10.4.2" @@ -1018,11 +828,11 @@ }, "Default": { "id": "Default", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokea14da806a02dc330fe79e6272b5cb4a2/Default", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke27dacea55ae28848262afba8ca16ad80/Default", "children": { "Default": { "id": "Default", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokea14da806a02dc330fe79e6272b5cb4a2/Default/Default", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke27dacea55ae28848262afba8ca16ad80/Default/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -1036,7 +846,7 @@ }, "Invoke": { "id": "Invoke", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokea14da806a02dc330fe79e6272b5cb4a2/Invoke", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke27dacea55ae28848262afba8ca16ad80/Invoke", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -1044,7 +854,7 @@ }, "AssertionResults": { "id": "AssertionResults", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokea14da806a02dc330fe79e6272b5cb4a2/AssertionResults", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke27dacea55ae28848262afba8ca16ad80/AssertionResults", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" @@ -1056,17 +866,17 @@ "version": "0.0.0" } }, - "LambdaInvoked94ae5ddb38d1dc5e431fe152e2d51f4": { - "id": "LambdaInvoked94ae5ddb38d1dc5e431fe152e2d51f4", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoked94ae5ddb38d1dc5e431fe152e2d51f4", + "LambdaInvokef88cb886ad84615afbbcb0f0c3db07f0": { + "id": "LambdaInvokef88cb886ad84615afbbcb0f0c3db07f0", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokef88cb886ad84615afbbcb0f0c3db07f0", "children": { "SdkProvider": { "id": "SdkProvider", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoked94ae5ddb38d1dc5e431fe152e2d51f4/SdkProvider", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokef88cb886ad84615afbbcb0f0c3db07f0/SdkProvider", "children": { "AssertionsProvider": { "id": "AssertionsProvider", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoked94ae5ddb38d1dc5e431fe152e2d51f4/SdkProvider/AssertionsProvider", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokef88cb886ad84615afbbcb0f0c3db07f0/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", "version": "10.4.2" @@ -1080,11 +890,11 @@ }, "Default": { "id": "Default", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoked94ae5ddb38d1dc5e431fe152e2d51f4/Default", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokef88cb886ad84615afbbcb0f0c3db07f0/Default", "children": { "Default": { "id": "Default", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoked94ae5ddb38d1dc5e431fe152e2d51f4/Default/Default", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokef88cb886ad84615afbbcb0f0c3db07f0/Default/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -1098,7 +908,7 @@ }, "Invoke": { "id": "Invoke", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoked94ae5ddb38d1dc5e431fe152e2d51f4/Invoke", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokef88cb886ad84615afbbcb0f0c3db07f0/Invoke", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -1106,7 +916,7 @@ }, "AssertionResults": { "id": "AssertionResults", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoked94ae5ddb38d1dc5e431fe152e2d51f4/AssertionResults", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokef88cb886ad84615afbbcb0f0c3db07f0/AssertionResults", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" @@ -1118,17 +928,17 @@ "version": "0.0.0" } }, - "LambdaInvoke93b8a4fb01c1d0d88873f49b99b27bba": { - "id": "LambdaInvoke93b8a4fb01c1d0d88873f49b99b27bba", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke93b8a4fb01c1d0d88873f49b99b27bba", + "LambdaInvokeb44964fb0d419ef7e8d915cdb662e346": { + "id": "LambdaInvokeb44964fb0d419ef7e8d915cdb662e346", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokeb44964fb0d419ef7e8d915cdb662e346", "children": { "SdkProvider": { "id": "SdkProvider", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke93b8a4fb01c1d0d88873f49b99b27bba/SdkProvider", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokeb44964fb0d419ef7e8d915cdb662e346/SdkProvider", "children": { "AssertionsProvider": { "id": "AssertionsProvider", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke93b8a4fb01c1d0d88873f49b99b27bba/SdkProvider/AssertionsProvider", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokeb44964fb0d419ef7e8d915cdb662e346/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", "version": "10.4.2" @@ -1142,11 +952,11 @@ }, "Default": { "id": "Default", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke93b8a4fb01c1d0d88873f49b99b27bba/Default", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokeb44964fb0d419ef7e8d915cdb662e346/Default", "children": { "Default": { "id": "Default", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke93b8a4fb01c1d0d88873f49b99b27bba/Default/Default", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokeb44964fb0d419ef7e8d915cdb662e346/Default/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -1160,7 +970,7 @@ }, "Invoke": { "id": "Invoke", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke93b8a4fb01c1d0d88873f49b99b27bba/Invoke", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokeb44964fb0d419ef7e8d915cdb662e346/Invoke", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -1168,7 +978,7 @@ }, "AssertionResults": { "id": "AssertionResults", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke93b8a4fb01c1d0d88873f49b99b27bba/AssertionResults", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokeb44964fb0d419ef7e8d915cdb662e346/AssertionResults", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" @@ -1180,17 +990,17 @@ "version": "0.0.0" } }, - "LambdaInvoke25576161f786619878cd1227f298bb94": { - "id": "LambdaInvoke25576161f786619878cd1227f298bb94", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke25576161f786619878cd1227f298bb94", + "LambdaInvokec96c44400b6e11ce551edcc6cedc0f39": { + "id": "LambdaInvokec96c44400b6e11ce551edcc6cedc0f39", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokec96c44400b6e11ce551edcc6cedc0f39", "children": { "SdkProvider": { "id": "SdkProvider", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke25576161f786619878cd1227f298bb94/SdkProvider", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokec96c44400b6e11ce551edcc6cedc0f39/SdkProvider", "children": { "AssertionsProvider": { "id": "AssertionsProvider", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke25576161f786619878cd1227f298bb94/SdkProvider/AssertionsProvider", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokec96c44400b6e11ce551edcc6cedc0f39/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", "version": "10.4.2" @@ -1204,11 +1014,11 @@ }, "Default": { "id": "Default", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke25576161f786619878cd1227f298bb94/Default", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokec96c44400b6e11ce551edcc6cedc0f39/Default", "children": { "Default": { "id": "Default", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke25576161f786619878cd1227f298bb94/Default/Default", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokec96c44400b6e11ce551edcc6cedc0f39/Default/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -1222,7 +1032,7 @@ }, "Invoke": { "id": "Invoke", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke25576161f786619878cd1227f298bb94/Invoke", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokec96c44400b6e11ce551edcc6cedc0f39/Invoke", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -1230,7 +1040,7 @@ }, "AssertionResults": { "id": "AssertionResults", - "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvoke25576161f786619878cd1227f298bb94/AssertionResults", + "path": "lambda-python-build-images/DefaultTest/DeployAssert/LambdaInvokec96c44400b6e11ce551edcc6cedc0f39/AssertionResults", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" diff --git a/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.ts b/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.ts index 119ec95ea5ea2..72c53a0fb0f0f 100644 --- a/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.ts +++ b/packages/@aws-cdk/aws-lambda-python-alpha/test/integ.python.build.images.ts @@ -19,11 +19,13 @@ class TestStack extends Stack { super(scope, id, props); const runtimes: Runtime[]= [ - Runtime.PYTHON_3_8, Runtime.PYTHON_3_9, Runtime.PYTHON_3_10, Runtime.PYTHON_3_11, Runtime.PYTHON_3_12, Runtime.PYTHON_3_13, + Runtime.PYTHON_3_9, Runtime.PYTHON_3_10, Runtime.PYTHON_3_11, Runtime.PYTHON_3_12, Runtime.PYTHON_3_13, ]; - runtimes.forEach((runtime, index) => { - const func = new lambda.PythonFunction(this, `func-${runtime.name}-${index}`, { + const uniqueRuntimes: Runtime[] = runtimes.filter((value, index, array) => array.findIndex(value1 => value1.runtimeEquals(value)) === index); + + uniqueRuntimes.forEach((runtime) => { + const func = new lambda.PythonFunction(this, `func-${runtime.name}`, { entry: path.join(__dirname, 'lambda-handler'), runtime: runtime, }); diff --git a/packages/@aws-cdk/example-construct-library/lib/example-resource.ts b/packages/@aws-cdk/example-construct-library/lib/example-resource.ts index 8308bb0a340f5..9715ef09581e9 100644 --- a/packages/@aws-cdk/example-construct-library/lib/example-resource.ts +++ b/packages/@aws-cdk/example-construct-library/lib/example-resource.ts @@ -11,9 +11,9 @@ import * as ec2 from 'aws-cdk-lib/aws-ec2'; import * as events from 'aws-cdk-lib/aws-events'; import * as iam from 'aws-cdk-lib/aws-iam'; import * as s3 from 'aws-cdk-lib/aws-s3'; -import * as core from 'aws-cdk-lib/core'; import { Construct } from 'constructs'; -// for files that are part of this package, we do import individual classes or functions +// for files that are part of this package or part of core, we do import individual classes or functions +import { CfnWaitCondition, CfnWaitConditionHandle, Fn, IResource, RemovalPolicy, Resource, Stack, Token } from 'aws-cdk-lib/core'; import { exampleResourceArnComponents } from './private/example-resource-common'; /** @@ -58,7 +58,7 @@ import { exampleResourceArnComponents } from './private/example-resource-common' */ export interface IExampleResource extends // all L2 interfaces need to extend IResource - core.IResource, + IResource, // Only for resources that have an associated IAM Role. // Allows this resource to be the target in calls like bucket.grantRead(exampleResource). @@ -149,7 +149,7 @@ export interface IExampleResource extends * * Notice that the class is not exported - it's not part of the public API of this module! */ -abstract class ExampleResourceBase extends core.Resource implements IExampleResource { +abstract class ExampleResourceBase extends Resource implements IExampleResource { // these stay abstract at this level public abstract readonly exampleResourceArn: string; public abstract readonly exampleResourceName: string; @@ -319,7 +319,7 @@ export interface ExampleResourceProps { * * @default RemovalPolicy.RETAIN */ - readonly removalPolicy?: core.RemovalPolicy; + readonly removalPolicy?: RemovalPolicy; } /** @@ -364,7 +364,7 @@ export class ExampleResource extends ExampleResourceBase { // using the Stack.formatArn helper method from the core library. // We have to know the ARN components of ExampleResource in a few places, so, // to avoid duplication, extract that into a module-private function - public readonly exampleResourceArn = core.Stack.of(scope) + public readonly exampleResourceArn = Stack.of(scope) .formatArn(exampleResourceArnComponents(exampleResourceName)); } @@ -382,8 +382,8 @@ export class ExampleResource extends ExampleResourceBase { /** * The constructor of a construct has always 3 arguments: - * the parent Construct, the string identifier, - * locally unique within the scope of the parent, + * the parent Construct, the string identifier + * (locally unique within the scope of the parent), * and a properties struct. * * If the props only have optional properties, like in our case, @@ -412,7 +412,7 @@ export class ExampleResource extends ExampleResourceBase { // so, we need to use the Token.isUnresolved() method from the core library // to skip validation in that case. if (props.waitConditionHandleName !== undefined && - !core.Token.isUnresolved(props.waitConditionHandleName) && + !Token.isUnresolved(props.waitConditionHandleName) && !/^[_a-zA-Z]+$/.test(props.waitConditionHandleName)) { throw new Error('waitConditionHandleName must be non-empty and contain only letters and underscores, ' + `got: '${props.waitConditionHandleName}'`); @@ -435,12 +435,12 @@ export class ExampleResource extends ExampleResourceBase { // This guarantees that they get scoped correctly, // and the CDK will make sure their locally-unique identifiers // are globally unique, which makes your L2 compose. - const waitConditionHandle = new core.CfnWaitConditionHandle(this, 'WaitConditionHandle'); + const waitConditionHandle = new CfnWaitConditionHandle(this, 'WaitConditionHandle'); // The 'main' L1 you create should always have the logical ID 'Resource'. // This is important, so that the ConstructNode.defaultChild method works correctly. // The local variable representing the L1 is often called 'resource' as well. - const resource = new core.CfnWaitCondition(this, 'Resource', { + const resource = new CfnWaitCondition(this, 'Resource', { count: 0, handle: waitConditionHandle.ref, timeout: '10', @@ -460,7 +460,7 @@ export class ExampleResource extends ExampleResourceBase { // and the ARN for your resource is of the form 'arn:aws::::resource/physical-name', // which is quite common, // you can use Fn::Select and Fn::Split to take out the part after the '/' from the ARN: - core.Fn.select(1, core.Fn.split('/', resource.ref)), + Fn.select(1, Fn.split('/', resource.ref)), ); this.exampleResourceArn = this.getResourceArnAttribute( // A lot of the L1 classes have an 'attrArn' property - @@ -469,7 +469,7 @@ export class ExampleResource extends ExampleResourceBase { // you can often formulate the ARN yourself, // using the Stack.formatArn helper function. // Here, we assume resource.ref returns the physical name of the resource. - core.Stack.of(this).formatArn(exampleResourceArnComponents(resource.ref)), + Stack.of(this).formatArn(exampleResourceArnComponents(resource.ref)), // always use the protected physicalName property for this second argument exampleResourceArnComponents(this.physicalName)); @@ -505,7 +505,7 @@ export class ExampleResource extends ExampleResourceBase { // this is how you apply the removal policy resource.applyRemovalPolicy(props.removalPolicy, { // this is the default to apply if props.removalPolicy is undefined - default: core.RemovalPolicy.RETAIN, + default: RemovalPolicy.RETAIN, }); } } diff --git a/packages/aws-cdk-lib/aws-appconfig/README.md b/packages/aws-cdk-lib/aws-appconfig/README.md index 66c7034db0c23..2a84c45645b03 100644 --- a/packages/aws-cdk-lib/aws-appconfig/README.md +++ b/packages/aws-cdk-lib/aws-appconfig/README.md @@ -96,6 +96,24 @@ const user = new iam.User(this, 'MyUser'); env.grantReadConfig(user); ``` +### Deletion Protection Check + +You can enable [deletion protection](https://docs.aws.amazon.com/appconfig/latest/userguide/deletion-protection.html) on the environment by setting the `deletionProtectionCheck` property. + +- ACCOUNT_DEFAULT: The default setting, which uses account-level deletion protection. To configure account-level deletion protection, use the UpdateAccountSettings API. +- APPLY: Instructs the deletion protection check to run, even if deletion protection is disabled at the account level. APPLY also forces the deletion protection check to run against resources created in the past hour, which are normally excluded from deletion protection checks. +- BYPASS: Instructs AWS AppConfig to bypass the deletion protection check and delete an environment even if deletion protection would have otherwise prevented it. + +```ts +declare const application: appconfig.Application; +declare const alarm: cloudwatch.Alarm; +declare const compositeAlarm: cloudwatch.CompositeAlarm; + +new appconfig.Environment(this, 'MyEnvironment', { + application, + deletionProtectionCheck: appconfig.DeletionProtectionCheck.APPLY, +}); +``` ## Deployment Strategy diff --git a/packages/aws-cdk-lib/aws-appconfig/lib/environment.ts b/packages/aws-cdk-lib/aws-appconfig/lib/environment.ts index 705cc9c2144cc..9c3c4318f33ca 100644 --- a/packages/aws-cdk-lib/aws-appconfig/lib/environment.ts +++ b/packages/aws-cdk-lib/aws-appconfig/lib/environment.ts @@ -4,6 +4,7 @@ import { IApplication } from './application'; import { IConfiguration } from './configuration'; import { ActionPoint, IEventDestination, ExtensionOptions, IExtension, IExtensible, ExtensibleBase } from './extension'; import { getHash } from './private/hash'; +import { DeletionProtectionCheck } from './util'; import * as cloudwatch from '../../aws-cloudwatch'; import * as iam from '../../aws-iam'; import { Resource, IResource, Stack, ArnFormat, PhysicalName, Names } from '../../core'; @@ -165,6 +166,13 @@ export interface EnvironmentOptions { * @default - No monitors. */ readonly monitors?: Monitor[]; + + /** + * A property to prevent accidental deletion of active environments. + * + * @default undefined - AppConfig default is ACCOUNT_DEFAULT + */ + readonly deletionProtectionCheck?: DeletionProtectionCheck; } /** @@ -309,6 +317,7 @@ export class Environment extends EnvironmentBase { applicationId: this.applicationId, name: this.name, description: this.description, + deletionProtectionCheck: props.deletionProtectionCheck, monitors: this.monitors?.map((monitor) => { return { alarmArn: monitor.alarmArn, diff --git a/packages/aws-cdk-lib/aws-appconfig/lib/index.ts b/packages/aws-cdk-lib/aws-appconfig/lib/index.ts index ff835da7514d6..062dfeee027b1 100644 --- a/packages/aws-cdk-lib/aws-appconfig/lib/index.ts +++ b/packages/aws-cdk-lib/aws-appconfig/lib/index.ts @@ -3,6 +3,7 @@ export * from './deployment-strategy'; export * from './extension'; export * from './application'; export * from './configuration'; +export * from './util'; // AWS::AppConfig CloudFormation Resources: export * from './appconfig.generated'; diff --git a/packages/aws-cdk-lib/aws-appconfig/lib/util.ts b/packages/aws-cdk-lib/aws-appconfig/lib/util.ts new file mode 100644 index 0000000000000..9e054d837b94b --- /dev/null +++ b/packages/aws-cdk-lib/aws-appconfig/lib/util.ts @@ -0,0 +1,25 @@ +/** + * The deletion protection check options. + */ +export enum DeletionProtectionCheck { + /** + * The default setting, + * which uses account-level deletion protection. To configure account-level deletion protection, use the UpdateAccountSettings API. + */ + ACCOUNT_DEFAULT = 'ACCOUNT_DEFAULT', + + /** + * Instructs the deletion protection check to run, + * even if deletion protection is disabled at the account level. + * + * APPLY also forces the deletion protection check to run against resources created in the past hour, + * which are normally excluded from deletion protection checks. + */ + APPLY = 'APPLY', + + /** + * Instructs AWS AppConfig to bypass the deletion protection check and delete an environment or a configuration profile + * even if deletion protection would have otherwise prevented it. + */ + BYPASS = 'BYPASS', +} diff --git a/packages/aws-cdk-lib/aws-appconfig/test/environment.test.ts b/packages/aws-cdk-lib/aws-appconfig/test/environment.test.ts index 398a5dbc728ee..4ee3b62abe865 100644 --- a/packages/aws-cdk-lib/aws-appconfig/test/environment.test.ts +++ b/packages/aws-cdk-lib/aws-appconfig/test/environment.test.ts @@ -2,7 +2,7 @@ import { Template } from '../../assertions'; import { Alarm, CompositeAlarm, Metric } from '../../aws-cloudwatch'; import * as iam from '../../aws-iam'; import * as cdk from '../../core'; -import { Application, ConfigurationContent, Environment, HostedConfiguration, Monitor } from '../lib'; +import { Application, ConfigurationContent, DeletionProtectionCheck, Environment, HostedConfiguration, Monitor } from '../lib'; describe('environment', () => { test('default environment', () => { @@ -20,6 +20,27 @@ describe('environment', () => { }); }); + test.each([ + DeletionProtectionCheck.ACCOUNT_DEFAULT, + DeletionProtectionCheck.APPLY, + DeletionProtectionCheck.BYPASS, + ])('environment with deletion protection check', (deletionProtectionCheck) => { + const stack = new cdk.Stack(); + const app = new Application(stack, 'MyAppConfig'); + new Environment(stack, 'MyEnvironment', { + application: app, + deletionProtectionCheck, + }); + + Template.fromStack(stack).hasResourceProperties('AWS::AppConfig::Environment', { + Name: 'MyEnvironment', + ApplicationId: { + Ref: 'MyAppConfigB4B63E75', + }, + DeletionProtectionCheck: deletionProtectionCheck, + }); + }); + test('environment with name', () => { const stack = new cdk.Stack(); const app = new Application(stack, 'MyAppConfig'); diff --git a/packages/aws-cdk-lib/aws-cloudwatch/lib/metric-types.ts b/packages/aws-cdk-lib/aws-cloudwatch/lib/metric-types.ts index 7b02013c48a27..46efb0bc56a87 100644 --- a/packages/aws-cdk-lib/aws-cloudwatch/lib/metric-types.ts +++ b/packages/aws-cdk-lib/aws-cloudwatch/lib/metric-types.ts @@ -323,6 +323,20 @@ export interface MetricStatConfig { * @default Deployment account. */ readonly account?: string; + + /** + * Region set directly on the metric, not inherited from the attached stack. + * + * @default No override. + */ + readonly regionOverride?: string; + + /** + * Account set directly on the metric, not inherited from the attached stack. + * + * @default No override. + */ + readonly accountOverride?: string; } /** diff --git a/packages/aws-cdk-lib/aws-cloudwatch/lib/metric.ts b/packages/aws-cdk-lib/aws-cloudwatch/lib/metric.ts index 428598e9602b5..a39a439ddcabf 100644 --- a/packages/aws-cdk-lib/aws-cloudwatch/lib/metric.ts +++ b/packages/aws-cdk-lib/aws-cloudwatch/lib/metric.ts @@ -6,6 +6,7 @@ import { normalizeStatistic, pairStatisticToString, parseStatistic, singleStatis import { Stats } from './stats'; import * as iam from '../../aws-iam'; import * as cdk from '../../core'; +import { makeEnumerable } from './private/make-enumerable'; export type DimensionHash = { [dim: string]: any }; @@ -115,6 +116,20 @@ export interface CommonMetricOptions { * @default - Deployment region. */ readonly region?: string; + + /** + * Account of the stack this metric is attached to. + * + * @default - Deployment account. + */ + readonly stackAccount?: string; + + /** + * Region of the stack this metric is attached to. + * + * @default - Deployment region. + */ + readonly stackRegion?: string; } /** @@ -306,11 +321,17 @@ export class Metric implements IMetric { /** Unit of the metric. */ public readonly unit?: Unit; - /** Account which this metric comes from */ - public readonly account?: string; + /** Account of the stack this metric is attached to. */ + readonly #stackAccount?: string; + + /** Region of the stack this metric is attached to. */ + readonly #stackRegion?: string; - /** Region which this metric comes from. */ - public readonly region?: string; + /** Account set directly on the metric, taking precedence over the stack account. */ + readonly #accountOverride?: string; + + /** Region set directly on the metric, taking precedence over the stack region. */ + readonly #regionOverride?: string; /** * Warnings attached to this metric. @@ -352,8 +373,14 @@ export class Metric implements IMetric { this.label = props.label; this.color = props.color; this.unit = props.unit; - this.account = props.account; - this.region = props.region; + this.#accountOverride = props.account; + this.#regionOverride = props.region; + this.#stackAccount = props.stackAccount; + this.#stackRegion = props.stackRegion; + + // Make getters enumerable. + makeEnumerable(Metric.prototype, this, 'account'); + makeEnumerable(Metric.prototype, this, 'region'); } /** @@ -369,8 +396,10 @@ export class Metric implements IMetric { && (props.color === undefined || props.color === this.color) && (props.statistic === undefined || props.statistic === this.statistic) && (props.unit === undefined || props.unit === this.unit) - && (props.account === undefined || props.account === this.account) - && (props.region === undefined || props.region === this.region) + && (props.account === undefined || props.account === this.#accountOverride) + && (props.region === undefined || props.region === this.#regionOverride) + && (props.stackAccount === undefined || props.stackAccount === this.#stackAccount) + && (props.stackRegion === undefined || props.stackRegion === this.#stackRegion) // For these we're not going to do deep equality, misses some opportunity for optimization // but that's okay. && (props.dimensions === undefined) @@ -388,8 +417,10 @@ export class Metric implements IMetric { unit: ifUndefined(props.unit, this.unit), label: ifUndefined(props.label, this.label), color: ifUndefined(props.color, this.color), - account: ifUndefined(props.account, this.account), - region: ifUndefined(props.region, this.region), + account: ifUndefined(props.account, this.#accountOverride), + region: ifUndefined(props.region, this.#regionOverride), + stackAccount: ifUndefined(props.stackAccount, this.#stackAccount), + stackRegion: ifUndefined(props.stackRegion, this.#stackRegion), }); } @@ -409,11 +440,25 @@ export class Metric implements IMetric { const stack = cdk.Stack.of(scope); return this.with({ - region: cdk.Token.isUnresolved(stack.region) ? undefined : stack.region, - account: cdk.Token.isUnresolved(stack.account) ? undefined : stack.account, + stackAccount: cdk.Token.isUnresolved(stack.account) ? undefined : stack.account, + stackRegion: cdk.Token.isUnresolved(stack.region) ? undefined : stack.region, }); } + /** + * Account which this metric comes from. + */ + public get account(): string | undefined { + return this.#accountOverride || this.#stackAccount; + } + + /** + * Region which this metric comes from. + */ + public get region(): string | undefined { + return this.#regionOverride || this.#stackRegion; + } + public toMetricConfig(): MetricConfig { const dims = this.dimensionsAsList(); return { @@ -426,6 +471,8 @@ export class Metric implements IMetric { unitFilter: this.unit, account: this.account, region: this.region, + accountOverride: this.#accountOverride, + regionOverride: this.#regionOverride, }, renderingProperties: { color: this.color, diff --git a/packages/aws-cdk-lib/aws-cloudwatch/lib/private/make-enumerable.ts b/packages/aws-cdk-lib/aws-cloudwatch/lib/private/make-enumerable.ts new file mode 100644 index 0000000000000..ab721bfa9f605 --- /dev/null +++ b/packages/aws-cdk-lib/aws-cloudwatch/lib/private/make-enumerable.ts @@ -0,0 +1,9 @@ +/** + * Make a property from the specified prototype enumerable on the specific instance. + */ +export function makeEnumerable(prototype: object, instance: object, propertyKey: string) { + Object.defineProperty(instance, propertyKey, { + ...Object.getOwnPropertyDescriptor(prototype, propertyKey), + enumerable: true, + }); +} diff --git a/packages/aws-cdk-lib/aws-cloudwatch/lib/private/rendering.ts b/packages/aws-cdk-lib/aws-cloudwatch/lib/private/rendering.ts index 1aff96bbd120b..db815e42986c4 100644 --- a/packages/aws-cdk-lib/aws-cloudwatch/lib/private/rendering.ts +++ b/packages/aws-cdk-lib/aws-cloudwatch/lib/private/rendering.ts @@ -47,8 +47,16 @@ function metricGraphJson(metric: IMetric, yAxis?: string, id?: string) { } // Metric attributes that are rendered to graph options - if (stat.account) { options.accountId = accountIfDifferentFromStack(stat.account); } - if (stat.region) { options.region = regionIfDifferentFromStack(stat.region); } + if (stat.accountOverride) { + options.accountId = stat.accountOverride; + } else if (stat.account) { + options.accountId = accountIfDifferentFromStack(stat.account); + } + if (stat.regionOverride) { + options.region = stat.regionOverride; + } else if (stat.region) { + options.region = regionIfDifferentFromStack(stat.region); + } if (stat.period && stat.period.toSeconds() !== 300) { options.period = stat.period.toSeconds(); } if (stat.statistic && stat.statistic !== 'Average') { options.stat = stat.statistic; } }, diff --git a/packages/aws-cdk-lib/aws-cloudwatch/test/cross-environment.test.ts b/packages/aws-cdk-lib/aws-cloudwatch/test/cross-environment.test.ts index 14a68d64355fd..ece55e300cf21 100644 --- a/packages/aws-cdk-lib/aws-cloudwatch/test/cross-environment.test.ts +++ b/packages/aws-cdk-lib/aws-cloudwatch/test/cross-environment.test.ts @@ -59,7 +59,20 @@ describe('cross environment', () => { graphMetricsAre(new Stack(), graph, [ ['Test', 'ACount', { accountId: '1234', region: 'us-north-5' }], ]); + }); + test('metric with explicit account and region that match stack will render as-is', () => { + // GIVEN + const graph = new GraphWidget({ + left: [ + a.with({ account: '1234', region: 'us-north-5' }), + ], + }); + + // THEN + graphMetricsAre(new Stack(undefined, undefined, { env: { region: 'us-north-5', account: '1234' } }), graph, [ + ['Test', 'ACount', { accountId: '1234', region: 'us-north-5' }], + ]); }); test('metric attached to agnostic stack will not render in agnostic stack', () => { diff --git a/packages/aws-cdk-lib/aws-cloudwatch/test/metrics.test.ts b/packages/aws-cdk-lib/aws-cloudwatch/test/metrics.test.ts index 42f3bd14a1fbb..3fb54f4e1b58d 100644 --- a/packages/aws-cdk-lib/aws-cloudwatch/test/metrics.test.ts +++ b/packages/aws-cdk-lib/aws-cloudwatch/test/metrics.test.ts @@ -273,6 +273,35 @@ describe('Metrics', () => { expect(metric.statistic).toEqual(customStat); }); + test('region and account getters are enumerable', () => { + const metric = new Metric({ + namespace: 'Test', + metricName: 'Metric', + period: cdk.Duration.minutes(10), + region: 'test-region', + account: 'test-account', + }); + + expect(metric.region).toBe('test-region'); + expect(metric.account).toBe('test-account'); + + const metricObject = { ...metric }; + expect(metricObject).toEqual(expect.objectContaining({ + region: 'test-region', + account: 'test-account', + })); + + // Check that private fields are not included. + // @ts-expect-error + expect(metricObject.accountOverride).toBeUndefined(); + // @ts-expect-error + expect(metricObject.stackAccount).toBeUndefined(); + // @ts-expect-error + expect(metricObject.regionOverride).toBeUndefined(); + // @ts-expect-error + expect(metricObject.stackRegion).toBeUndefined(); + }); + test('statistic is properly parsed', () => { const checkParsingSingle = (statistic: string, statPrefix: string, statName: string, value: number) => { const parsed = parseStatistic(statistic); diff --git a/packages/aws-cdk-lib/aws-ecs-patterns/README.md b/packages/aws-cdk-lib/aws-ecs-patterns/README.md index 1ea629d90fe8c..c61643ab1aab8 100644 --- a/packages/aws-cdk-lib/aws-ecs-patterns/README.md +++ b/packages/aws-cdk-lib/aws-ecs-patterns/README.md @@ -30,6 +30,7 @@ const loadBalancedEcsService = new ecsPatterns.ApplicationLoadBalancedEc2Service entryPoint: ['entry', 'point'], }, desiredCount: 2, + minHealthyPercent: 100, }); ``` @@ -46,6 +47,7 @@ const loadBalancedFargateService = new ecsPatterns.ApplicationLoadBalancedFargat command: ['command'], entryPoint: ['entry', 'point'], }, + minHealthyPercent: 100, }); loadBalancedFargateService.targetGroup.configureHealthCheck({ @@ -142,6 +144,7 @@ const loadBalancedEcsService = new ecsPatterns.NetworkLoadBalancedEc2Service(thi }, }, desiredCount: 2, + minHealthyPercent: 100, }); ``` @@ -156,6 +159,7 @@ const loadBalancedFargateService = new ecsPatterns.NetworkLoadBalancedFargateSer taskImageOptions: { image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"), }, + minHealthyPercent: 100, }); ``` @@ -272,6 +276,7 @@ const queueProcessingEc2Service = new ecsPatterns.QueueProcessingEc2Service(this }, maxScalingCapacity: 5, containerName: 'test', + minHealthyPercent: 100, }); ``` @@ -292,6 +297,7 @@ const queueProcessingFargateService = new ecsPatterns.QueueProcessingFargateServ }, maxScalingCapacity: 5, containerName: 'test', + minHealthyPercent: 100, }); ``` @@ -314,6 +320,7 @@ const queueProcessingFargateService = new ecsPatterns.QueueProcessingFargateServ }, maxScalingCapacity: 5, containerName: 'test', + minHealthyPercent: 100, disableCpuBasedScaling: true, }); ``` @@ -332,6 +339,7 @@ const queueProcessingFargateService = new ecsPatterns.QueueProcessingFargateServ environment: {}, maxScalingCapacity: 5, containerName: 'test', + minHealthyPercent: 100, cpuTargetUtilizationPercent: 90, }); ``` @@ -392,6 +400,7 @@ declare const cluster: ecs.Cluster; const loadBalancedFargateService = new ecsPatterns.ApplicationLoadBalancedFargateService(this, 'Service', { vpc, cluster, + minHealthyPercent: 100, certificate, sslPolicy: SslPolicy.RECOMMENDED, domainName: 'api.example.com', @@ -414,6 +423,7 @@ const loadBalancedFargateService = new ecsPatterns.ApplicationLoadBalancedFargat taskImageOptions: { image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"), }, + minHealthyPercent: 100, capacityProviderStrategies: [ { capacityProvider: 'FARGATE_SPOT', @@ -441,6 +451,7 @@ const loadBalancedFargateService = new ecsPatterns.ApplicationLoadBalancedFargat taskImageOptions: { image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"), }, + minHealthyPercent: 100, }); const scalableTarget = loadBalancedFargateService.service.autoScaleTaskCount({ @@ -471,6 +482,7 @@ const loadBalancedFargateService = new ecsPatterns.ApplicationLoadBalancedFargat taskImageOptions: { image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"), }, + minHealthyPercent: 100, }); const scalableTarget = loadBalancedFargateService.service.autoScaleTaskCount({ @@ -499,6 +511,7 @@ const loadBalancedFargateService = new ecsPatterns.ApplicationLoadBalancedFargat taskImageOptions: { image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"), }, + minHealthyPercent: 100, deploymentController: { type: ecs.DeploymentControllerType.CODE_DEPLOY, }, @@ -522,6 +535,7 @@ const service = new ecsPatterns.ApplicationLoadBalancedFargateService(this, 'Ser taskImageOptions: { image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"), }, + minHealthyPercent: 100, circuitBreaker: { rollback: true }, }); ``` @@ -553,6 +567,7 @@ const queueProcessingFargateService = new ecsPatterns.QueueProcessingFargateServ vpc, memoryLimitMiB: 512, image: ecs.ContainerImage.fromRegistry('test'), + minHealthyPercent: 100, securityGroups: [securityGroup], taskSubnets: { subnetType: ec2.SubnetType.PRIVATE_ISOLATED }, }); @@ -566,6 +581,7 @@ const queueProcessingFargateService = new ecsPatterns.QueueProcessingFargateServ vpc, memoryLimitMiB: 512, image: ecs.ContainerImage.fromRegistry('test'), + minHealthyPercent: 100, assignPublicIp: true, }); ``` @@ -578,6 +594,7 @@ const queueProcessingFargateService = new ecsPatterns.QueueProcessingFargateServ vpc, memoryLimitMiB: 512, image: ecs.ContainerImage.fromRegistry('test'), + minHealthyPercent: 100, maxReceiveCount: 42, retentionPeriod: Duration.days(7), visibilityTimeout: Duration.minutes(5), @@ -595,6 +612,7 @@ const queueProcessingFargateService = new ecsPatterns.QueueProcessingFargateServ vpc, memoryLimitMiB: 512, image: ecs.ContainerImage.fromRegistry('test'), + minHealthyPercent: 100, assignPublicIp: true, cooldown: Duration.seconds(500), }); @@ -610,6 +628,7 @@ const queueProcessingFargateService = new ecsPatterns.QueueProcessingFargateServ cluster, memoryLimitMiB: 512, image: ecs.ContainerImage.fromRegistry('test'), + minHealthyPercent: 100, capacityProviderStrategies: [ { capacityProvider: 'FARGATE_SPOT', @@ -632,6 +651,7 @@ const queueProcessingFargateService = new ecsPatterns.QueueProcessingFargateServ vpc, memoryLimitMiB: 512, image: ecs.ContainerImage.fromRegistry('test'), + minHealthyPercent: 100, healthCheck: { command: [ "CMD-SHELL", "curl -f http://localhost/ || exit 1" ], // the properties below are optional @@ -664,6 +684,7 @@ const queueProcessingEc2Service = new ecsPatterns.QueueProcessingEc2Service(this cluster, memoryLimitMiB: 512, image: ecs.ContainerImage.fromRegistry('test'), + minHealthyPercent: 100, capacityProviderStrategies: [ { capacityProvider: capacityProvider.capacityProviderName, @@ -684,6 +705,7 @@ const loadBalancedFargateService = new ecsPatterns.ApplicationLoadBalancedFargat taskImageOptions: { image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"), }, + minHealthyPercent: 100, taskSubnets: { subnets: [ec2.Subnet.fromSubnetId(this, 'subnet', 'VpcISOLATEDSubnet1Subnet80F07FA0')], }, @@ -702,6 +724,7 @@ const loadBalancedFargateService = new ecsPatterns.ApplicationLoadBalancedFargat taskImageOptions: { image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"), }, + minHealthyPercent: 100, idleTimeout: Duration.seconds(120), }); ``` @@ -881,6 +904,7 @@ const applicationLoadBalancedFargateService = new ecsPatterns.ApplicationLoadBal taskImageOptions: { image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'), }, + minHealthyPercent: 100, runtimePlatform: { cpuArchitecture: ecs.CpuArchitecture.ARM64, operatingSystemFamily: ecs.OperatingSystemFamily.LINUX, @@ -966,6 +990,7 @@ const service = new ecsPatterns.ApplicationLoadBalancedFargateService(this, 'Ser cluster, vpc, desiredCount: 1, + minHealthyPercent: 100, taskImageOptions: { image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"), dockerLabels: { @@ -992,6 +1017,7 @@ const loadBalancedFargateService = new ecsPatterns.ApplicationLoadBalancedFargat taskImageOptions: { image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"), }, + minHealthyPercent: 100, taskSubnets: { subnets: [ec2.Subnet.fromSubnetId(this, 'subnet', 'VpcISOLATEDSubnet1Subnet80F07FA0')], }, @@ -1020,6 +1046,7 @@ const loadBalancedFargateService = new ecsPatterns.ApplicationLoadBalancedFargat taskImageOptions: { image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"), }, + minHealthyPercent: 100, enableExecuteCommand: true }); ``` @@ -1095,6 +1122,7 @@ const applicationLoadBalancedFargateService = new ecsPatterns.ApplicationLoadBal taskImageOptions: { image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'), }, + minHealthyPercent: 100, }); const networkLoadBalancedFargateService = new ecsPatterns.NetworkLoadBalancedFargateService(this, 'NLBFargateServiceWithCustomEphemeralStorage', { @@ -1105,6 +1133,7 @@ const networkLoadBalancedFargateService = new ecsPatterns.NetworkLoadBalancedFar taskImageOptions: { image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'), }, + minHealthyPercent: 100, }); ``` @@ -1119,6 +1148,7 @@ const queueProcessingFargateService = new ecsPatterns.NetworkLoadBalancedFargate taskImageOptions: { image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'), }, + minHealthyPercent: 100, securityGroups: [securityGroup], }); ``` @@ -1195,6 +1225,7 @@ const service = new ecsPatterns.ApplicationLoadBalancedFargateService(this, 'myS taskImageOptions: { image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'), }, + minHealthyPercent: 100, ipAddressType: elbv2.IpAddressType.DUAL_STACK, }); @@ -1203,6 +1234,7 @@ const applicationLoadBalancedEc2Service = new ecsPatterns.ApplicationLoadBalance taskImageOptions: { image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'), }, + minHealthyPercent: 100, ipAddressType: elbv2.IpAddressType.DUAL_STACK, }); ``` @@ -1225,6 +1257,7 @@ const networkLoadbalancedFargateService = new ecsPatterns.NetworkLoadBalancedFar taskImageOptions: { image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'), }, + minHealthyPercent: 100, ipAddressType: elbv2.IpAddressType.DUAL_STACK, }); @@ -1233,6 +1266,7 @@ const networkLoadbalancedEc2Service = new ecsPatterns.NetworkLoadBalancedEc2Serv taskImageOptions: { image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'), }, + minHealthyPercent: 100, ipAddressType: elbv2.IpAddressType.DUAL_STACK, }); ``` diff --git a/packages/aws-cdk-lib/aws-ecs/README.md b/packages/aws-cdk-lib/aws-ecs/README.md index dce4c0c88c817..9e765b3cb4b34 100644 --- a/packages/aws-cdk-lib/aws-ecs/README.md +++ b/packages/aws-cdk-lib/aws-ecs/README.md @@ -35,6 +35,7 @@ taskDefinition.addContainer('DefaultContainer', { const ecsService = new ecs.Ec2Service(this, 'Service', { cluster, taskDefinition, + minHealthyPercent: 100, }); ``` @@ -85,12 +86,12 @@ const cluster = new ecs.Cluster(this, 'Cluster', { }); ``` -To encrypt the fargate ephemeral storage configure a KMS key. +To encrypt the fargate ephemeral storage configure a KMS key. ```ts declare const key: kms.Key; -const cluster = new ecs.Cluster(this, 'Cluster', { - managedStorageConfiguration: { +const cluster = new ecs.Cluster(this, 'Cluster', { + managedStorageConfiguration: { fargateEphemeralStorageKmsKey: key, }, }); @@ -646,6 +647,22 @@ taskDefinition.addContainer('container', { }); ``` +### Enable Fault Injection +You can utilize fault injection with Amazon ECS on both Amazon EC2 and Fargate to test how their application responds to certain impairment scenarios. These tests provide information you can use to optimize your application's performance and resiliency. + +When fault injection is enabled, the Amazon ECS container agent allows tasks access to new fault injection endpoints. +Fault injection only works with tasks using the `AWS_VPC` or `HOST` network modes. + +For more infomation, see [Use fault injection with your Amazon ECS and Fargate workloads](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/fault-injection.html). + +To enable Fault Injection for the task definiton, set `enableFaultInjection` to true. + +```ts +new ecs.Ec2TaskDefinition(this, 'Ec2TaskDefinition', { + enableFaultInjection: true, +}); +``` + ## Docker labels You can add labels to the container with the `dockerLabels` property or with the `addDockerLabel` method: @@ -761,6 +778,7 @@ const service = new ecs.FargateService(this, 'Service', { cluster, taskDefinition, desiredCount: 5, + minHealthyPercent: 100, }); ``` @@ -774,6 +792,7 @@ const service = new ecs.ExternalService(this, 'Service', { cluster, taskDefinition, desiredCount: 5, + minHealthyPercent: 100, }); ``` @@ -794,14 +813,16 @@ new ecs.ExternalService(this, 'Service', { cluster, taskDefinition, desiredCount: 5, - taskDefinitionRevision: ecs.TaskDefinitionRevision.of(1) + minHealthyPercent: 100, + taskDefinitionRevision: ecs.TaskDefinitionRevision.of(1), }); new ecs.ExternalService(this, 'Service', { cluster, taskDefinition, desiredCount: 5, - taskDefinitionRevision: ecs.TaskDefinitionRevision.LATEST + minHealthyPercent: 100, + taskDefinitionRevision: ecs.TaskDefinitionRevision.LATEST, }); ``` @@ -822,6 +843,7 @@ declare const taskDefinition: ecs.TaskDefinition; const service = new ecs.FargateService(this, 'Service', { cluster, taskDefinition, + minHealthyPercent: 100, circuitBreaker: { enable: true, rollback: true @@ -858,6 +880,7 @@ declare const elbAlarm: cw.Alarm; const service = new ecs.FargateService(this, 'Service', { cluster, taskDefinition, + minHealthyPercent: 100, deploymentAlarms: { alarmNames: [elbAlarm.alarmName], behavior: ecs.AlarmBehavior.ROLLBACK_ON_ALARM, @@ -944,6 +967,7 @@ const service = new ecs.FargateService(this, 'Service', { serviceName, cluster, taskDefinition, + minHealthyPercent: 100, }); const cpuMetric = new cw.Metric({ @@ -981,7 +1005,7 @@ on the service, there will be no restrictions on the alarm name. declare const vpc: ec2.Vpc; declare const cluster: ecs.Cluster; declare const taskDefinition: ecs.TaskDefinition; -const service = new ecs.FargateService(this, 'Service', { cluster, taskDefinition }); +const service = new ecs.FargateService(this, 'Service', { cluster, taskDefinition, minHealthyPercent: 100 }); const lb = new elbv2.ApplicationLoadBalancer(this, 'LB', { vpc, internetFacing: true }); const listener = lb.addListener('Listener', { port: 80 }); @@ -1008,7 +1032,7 @@ Alternatively, you can also create all load balancer targets to be registered in declare const cluster: ecs.Cluster; declare const taskDefinition: ecs.TaskDefinition; declare const vpc: ec2.Vpc; -const service = new ecs.FargateService(this, 'Service', { cluster, taskDefinition }); +const service = new ecs.FargateService(this, 'Service', { cluster, taskDefinition, minHealthyPercent: 100 }); const lb = new elbv2.ApplicationLoadBalancer(this, 'LB', { vpc, internetFacing: true }); const listener = lb.addListener('Listener', { port: 80 }); @@ -1047,7 +1071,7 @@ for the alternatives. declare const cluster: ecs.Cluster; declare const taskDefinition: ecs.TaskDefinition; declare const vpc: ec2.Vpc; -const service = new ecs.Ec2Service(this, 'Service', { cluster, taskDefinition }); +const service = new ecs.Ec2Service(this, 'Service', { cluster, taskDefinition, minHealthyPercent: 100 }); const lb = new elb.LoadBalancer(this, 'LB', { vpc }); lb.addListener({ externalPort: 80 }); @@ -1060,7 +1084,7 @@ Similarly, if you want to have more control over load balancer targeting: declare const cluster: ecs.Cluster; declare const taskDefinition: ecs.TaskDefinition; declare const vpc: ec2.Vpc; -const service = new ecs.Ec2Service(this, 'Service', { cluster, taskDefinition }); +const service = new ecs.Ec2Service(this, 'Service', { cluster, taskDefinition, minHealthyPercent: 100 }); const lb = new elb.LoadBalancer(this, 'LB', { vpc }); lb.addListener({ externalPort: 80 }); @@ -1396,6 +1420,7 @@ specificContainer.addPortMappings({ new ecs.Ec2Service(this, 'Service', { cluster, taskDefinition, + minHealthyPercent: 100, cloudMapOptions: { // Create SRV records - useful for bridge networking dnsRecordType: cloudmap.DnsRecordType.SRV, @@ -1453,6 +1478,7 @@ taskDefinition.addContainer('web', { new ecs.FargateService(this, 'FargateService', { cluster, taskDefinition, + minHealthyPercent: 100, capacityProviderStrategies: [ { capacityProvider: 'FARGATE_SPOT', @@ -1530,6 +1556,7 @@ taskDefinition.addContainer('web', { new ecs.Ec2Service(this, 'EC2Service', { cluster, taskDefinition, + minHealthyPercent: 100, capacityProviderStrategies: [ { capacityProvider: capacityProvider.capacityProviderName, @@ -1626,6 +1653,7 @@ declare const taskDefinition: ecs.TaskDefinition; const service = new ecs.Ec2Service(this, 'Service', { cluster, taskDefinition, + minHealthyPercent: 100, enableExecuteCommand: true, }); ``` @@ -1699,6 +1727,7 @@ cluster.addDefaultCloudMapNamespace({ const service = new ecs.FargateService(this, 'Service', { cluster, taskDefinition, + minHealthyPercent: 100, serviceConnectConfiguration: { services: [ { @@ -1723,6 +1752,7 @@ declare const taskDefinition: ecs.TaskDefinition; const service = new ecs.FargateService(this, 'Service', { cluster, taskDefinition, + minHealthyPercent: 100, }); service.enableServiceConnect(); ``` @@ -1736,6 +1766,7 @@ declare const taskDefinition: ecs.TaskDefinition; const customService = new ecs.FargateService(this, 'CustomizedService', { cluster, taskDefinition, + minHealthyPercent: 100, serviceConnectConfiguration: { logDriver: ecs.LogDrivers.awsLogs({ streamPrefix: 'sc-traffic', @@ -1765,6 +1796,7 @@ declare const taskDefinition: ecs.TaskDefinition; const service = new ecs.FargateService(this, 'Service', { cluster, taskDefinition, + minHealthyPercent: 100, serviceConnectConfiguration: { services: [ { @@ -1828,6 +1860,7 @@ taskDefinition.addVolume(volume); const service = new ecs.FargateService(this, 'FargateService', { cluster, taskDefinition, + minHealthyPercent: 100, }); service.addVolume(volume); @@ -1857,6 +1890,7 @@ taskDefinition.addVolume(volumeFromSnapshot); const service = new ecs.FargateService(this, 'FargateService', { cluster, taskDefinition, + minHealthyPercent: 100, }); service.addVolume(volumeFromSnapshot); diff --git a/packages/aws-cdk-lib/aws-ecs/lib/base/base-service.ts b/packages/aws-cdk-lib/aws-ecs/lib/base/base-service.ts index 9f5891ba78e55..9c627fe7d0baf 100644 --- a/packages/aws-cdk-lib/aws-ecs/lib/base/base-service.ts +++ b/packages/aws-cdk-lib/aws-ecs/lib/base/base-service.ts @@ -708,6 +708,10 @@ export abstract class BaseService extends Resource throw new Error('CODE_DEPLOY deploymentController can only be used with the `latest` task definition revision'); } + if (props.minHealthyPercent === undefined) { + Annotations.of(this).addWarningV2('@aws-cdk/aws-ecs:minHealthyPercent', 'minHealthyPercent has not been configured so the default value of 50% is used. The number of running tasks will decrease below the desired count during deployments etc. See https://github.com/aws/aws-cdk/issues/31705'); + } + if (props.deploymentController?.type === DeploymentControllerType.CODE_DEPLOY) { // Strip the revision ID from the service's task definition property to // prevent new task def revisions in the stack from triggering updates diff --git a/packages/aws-cdk-lib/aws-ecs/lib/base/task-definition.ts b/packages/aws-cdk-lib/aws-ecs/lib/base/task-definition.ts index 7ab075ae777ce..c15e9ebdce9d5 100644 --- a/packages/aws-cdk-lib/aws-ecs/lib/base/task-definition.ts +++ b/packages/aws-cdk-lib/aws-ecs/lib/base/task-definition.ts @@ -99,6 +99,15 @@ export interface CommonTaskDefinitionProps { * @default - No volumes are passed to the Docker daemon on a container instance. */ readonly volumes?: Volume[]; + + /** + * Enables fault injection and allows for fault injection requests to be accepted from the task's containers. + * + * Fault injection only works with tasks using the {@link NetworkMode.AWS_VPC} or {@link NetworkMode.HOST} network modes. + * + * @default undefined - ECS default setting is false + */ + readonly enableFaultInjection?: boolean; } /** @@ -458,6 +467,11 @@ export class TaskDefinition extends TaskDefinitionBase { throw new Error('Cannot specify runtimePlatform in non-Fargate compatible tasks'); } + // https://docs.aws.amazon.com/AmazonECS/latest/developerguide/fault-injection.html + if (props.enableFaultInjection && ![NetworkMode.AWS_VPC, NetworkMode.HOST].includes(this.networkMode)) { + throw new Error(`Only AWS_VPC and HOST Network Modes are supported for enabling Fault Injection, got ${this.networkMode} mode.`); + } + this._executionRole = props.executionRole; this.taskRole = props.taskRole || new iam.Role(this, 'TaskRole', { @@ -514,6 +528,7 @@ export class TaskDefinition extends TaskDefinitionBase { cpuArchitecture: this.runtimePlatform?.cpuArchitecture?._cpuArchitecture, operatingSystemFamily: this.runtimePlatform?.operatingSystemFamily?._operatingSystemFamily, } : undefined, + enableFaultInjection: props.enableFaultInjection, }); if (props.placementConstraints) { @@ -565,7 +580,7 @@ export class TaskDefinition extends TaskDefinitionBase { private renderInferenceAccelerators(): CfnTaskDefinition.InferenceAcceleratorProperty[] { return this._inferenceAccelerators.map(renderInferenceAccelerator); - function renderInferenceAccelerator(inferenceAccelerator: InferenceAccelerator) : CfnTaskDefinition.InferenceAcceleratorProperty { + function renderInferenceAccelerator(inferenceAccelerator: InferenceAccelerator): CfnTaskDefinition.InferenceAcceleratorProperty { return { deviceName: inferenceAccelerator.deviceName, deviceType: inferenceAccelerator.deviceType, @@ -675,7 +690,7 @@ export class TaskDefinition extends TaskDefinitionBase { this.volumes.push(volume); } - private validateVolume(volume: Volume):void { + private validateVolume(volume: Volume): void { if (volume.configuredAtLaunch !== true) { return; } @@ -884,7 +899,7 @@ export class TaskDefinition extends TaskDefinitionBase { private checkFargateWindowsBasedTasksSize(cpu: string, memory: string, runtimePlatform: RuntimePlatform) { if (Number(cpu) === 1024) { - if (Number(memory) < 1024 || Number(memory) > 8192 || (Number(memory)% 1024 !== 0)) { + if (Number(memory) < 1024 || Number(memory) > 8192 || (Number(memory) % 1024 !== 0)) { throw new Error(`If provided cpu is ${cpu}, then memoryMiB must have a min of 1024 and a max of 8192, in 1024 increments. Provided memoryMiB was ${Number(memory)}.`); } } else if (Number(cpu) === 2048) { @@ -893,7 +908,7 @@ export class TaskDefinition extends TaskDefinitionBase { } } else if (Number(cpu) === 4096) { if (Number(memory) < 8192 || Number(memory) > 30720 || (Number(memory) % 1024 !== 0)) { - throw new Error(`If provided cpu is ${ cpu }, then memoryMiB must have a min of 8192 and a max of 30720, in 1024 increments.Provided memoryMiB was ${ Number(memory) }.`); + throw new Error(`If provided cpu is ${cpu}, then memoryMiB must have a min of 8192 and a max of 30720, in 1024 increments.Provided memoryMiB was ${Number(memory)}.`); } } else { throw new Error(`If operatingSystemFamily is ${runtimePlatform.operatingSystemFamily!._operatingSystemFamily}, then cpu must be in 1024 (1 vCPU), 2048 (2 vCPU), or 4096 (4 vCPU). Provided value was: ${cpu}`); @@ -1031,7 +1046,7 @@ export interface Volume { * * @default false */ - readonly configuredAtLaunch ?: boolean; + readonly configuredAtLaunch?: boolean; /** * This property is specified when you are using Docker volumes. @@ -1131,7 +1146,7 @@ export interface DockerVolumeConfiguration { * * @default No options */ - readonly driverOpts?: {[key: string]: string}; + readonly driverOpts?: { [key: string]: string }; /** * Custom metadata to add to your Docker volume. * diff --git a/packages/aws-cdk-lib/aws-ecs/lib/cluster.ts b/packages/aws-cdk-lib/aws-ecs/lib/cluster.ts index 2ae3186d3a2f1..a4d15dee57855 100644 --- a/packages/aws-cdk-lib/aws-ecs/lib/cluster.ts +++ b/packages/aws-cdk-lib/aws-ecs/lib/cluster.ts @@ -13,7 +13,21 @@ import { IKey } from '../../aws-kms'; import * as logs from '../../aws-logs'; import * as s3 from '../../aws-s3'; import * as cloudmap from '../../aws-servicediscovery'; -import { Aws, Duration, IResource, Resource, Stack, Aspects, ArnFormat, IAspect, Token, Names, AspectPriority } from '../../core'; +import { + Aws, + Duration, + IResource, + Resource, + Stack, + Aspects, + ArnFormat, + IAspect, + Token, + Names, + AspectPriority, + FeatureFlags, Annotations, +} from '../../core'; +import { Disable_ECS_IMDS_Blocking, Enable_IMDS_Blocking_Deprecated_Feature } from '../../cx-api'; const CLUSTER_SYMBOL = Symbol.for('@aws-cdk/aws-ecs/lib/cluster.Cluster'); @@ -101,6 +115,23 @@ export enum MachineImageType { BOTTLEROCKET, } +/** + * Determine the value for the canContainersAccessInstanceRole option if it is undefined. + * The value is determined based on the @aws-cdk/aws-ecs:disableEcsImdsBlocking feature flag. + */ +const getCanContainersAccessInstanceRoleDefault = (canContainersAccessInstanceRole: boolean | undefined, + disableEcsImdsBlockingFlag: boolean | undefined): boolean => { + if (canContainersAccessInstanceRole !== undefined) { + return canContainersAccessInstanceRole; + } + + if (disableEcsImdsBlockingFlag === true) { + return true; + } else { + return false; + } +}; + /** * A regional grouping of one or more container instances on which you can run tasks and services. */ @@ -515,7 +546,9 @@ export class Cluster extends Resource implements ICluster { machineImageType: provider.machineImageType, // Don't enable the instance-draining lifecycle hook if managed termination protection or managed draining is enabled taskDrainTime: (provider.enableManagedTerminationProtection || provider.enableManagedDraining) ? Duration.seconds(0) : options.taskDrainTime, - canContainersAccessInstanceRole: options.canContainersAccessInstanceRole ?? provider.canContainersAccessInstanceRole, + canContainersAccessInstanceRole: getCanContainersAccessInstanceRoleDefault( + options.canContainersAccessInstanceRole ?? provider.canContainersAccessInstanceRole, + FeatureFlags.of(this).isEnabled(Disable_ECS_IMDS_Blocking)), }); this._capacityProviderNames.push(provider.capacityProviderName); @@ -536,14 +569,24 @@ export class Cluster extends Resource implements ICluster { } private configureAutoScalingGroup(autoScalingGroup: autoscaling.AutoScalingGroup, options: AddAutoScalingGroupCapacityOptions = {}) { + // mutating the original options may cause unexpected behavioral change, hence, creating a clone here to avoid mutation + const optionsClone: AddAutoScalingGroupCapacityOptions = { + ...options, + machineImageType: options.machineImageType ?? MachineImageType.AMAZON_LINUX_2, + canContainersAccessInstanceRole: getCanContainersAccessInstanceRoleDefault( + options.canContainersAccessInstanceRole, + FeatureFlags.of(this).isEnabled(Disable_ECS_IMDS_Blocking)), + }; + if (!(autoScalingGroup instanceof autoscaling.AutoScalingGroup)) { throw new Error('Cannot configure the AutoScalingGroup because it is an imported resource.'); } + if (autoScalingGroup.osType === ec2.OperatingSystemType.WINDOWS) { - this.configureWindowsAutoScalingGroup(autoScalingGroup, options); + this.configureWindowsAutoScalingGroup(autoScalingGroup, optionsClone); } else { // Tie instances to cluster - switch (options.machineImageType) { + switch (optionsClone.machineImageType) { // Bottlerocket AMI case MachineImageType.BOTTLEROCKET: { autoScalingGroup.addUserData( @@ -557,23 +600,26 @@ export class Cluster extends Resource implements ICluster { autoScalingGroup.role.addManagedPolicy(iam.ManagedPolicy.fromAwsManagedPolicyName('AmazonSSMManagedInstanceCore')); // required managed policy autoScalingGroup.role.addManagedPolicy(iam.ManagedPolicy.fromAwsManagedPolicyName('service-role/AmazonEC2ContainerServiceforEC2Role')); + + this.handleCanContainersAccessInstanceRoleForBottleRocket(optionsClone); break; } - default: - // Amazon ECS-optimized AMI for Amazon Linux 2 + case MachineImageType.AMAZON_LINUX_2: { autoScalingGroup.addUserData(`echo ECS_CLUSTER=${this.clusterName} >> /etc/ecs/ecs.config`); - if (!options.canContainersAccessInstanceRole) { - // Deny containers access to instance metadata service - // Source: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/instance_IAM_role.html - autoScalingGroup.addUserData('sudo iptables --insert FORWARD 1 --in-interface docker+ --destination 169.254.169.254/32 --jump DROP'); - autoScalingGroup.addUserData('sudo service iptables save'); - // The following is only for AwsVpc networking mode, but doesn't hurt for the other modes. - autoScalingGroup.addUserData('echo ECS_AWSVPC_BLOCK_IMDS=true >> /etc/ecs/ecs.config'); - } - - if (autoScalingGroup.spotPrice && options.spotInstanceDraining) { + this.handleCanContainersAccessInstanceRoleForAL2(autoScalingGroup, optionsClone); + if (autoScalingGroup.spotPrice && optionsClone.spotInstanceDraining) { autoScalingGroup.addUserData('echo ECS_ENABLE_SPOT_INSTANCE_DRAINING=true >> /etc/ecs/ecs.config'); } + break; + } + default: { + Annotations.of(this).addWarningV2('@aws-cdk/aws-ecs:unknownImageType', + `Unknown ECS Image type: ${optionsClone.machineImageType}.`); + if (optionsClone.canContainersAccessInstanceRole === false) { + throw new Error('The canContainersAccessInstanceRole option is not supported. See https://github.com/aws/aws-cdk/discussions/32609'); + } + break; + } } } @@ -631,6 +677,48 @@ export class Cluster extends Resource implements ICluster { } } + private handleCanContainersAccessInstanceRoleForBottleRocket(options: AddAutoScalingGroupCapacityOptions): void { + if ((options.canContainersAccessInstanceRole === false || options.canContainersAccessInstanceRole === undefined) && + !FeatureFlags.of(this).isEnabled(Disable_ECS_IMDS_Blocking)) { + Annotations.of(this).addWarningV2('@aws-cdk/aws-ecs:deprecatedImdsBlocking', + 'Blocking container accessing instance role is not supported. See https://github.com/aws/aws-cdk/discussions/32609'); + } + + if (options.canContainersAccessInstanceRole === false && + FeatureFlags.of(this).isEnabled(Disable_ECS_IMDS_Blocking)) { + throw new Error('The canContainersAccessInstanceRole option is not supported. See https://github.com/aws/aws-cdk/discussions/32609'); + } + } + + private handleCanContainersAccessInstanceRoleForAL2(autoScalingGroup: autoscaling.AutoScalingGroup, + options: AddAutoScalingGroupCapacityOptions): void { + if (options.canContainersAccessInstanceRole === false && + FeatureFlags.of(this).isEnabled(Disable_ECS_IMDS_Blocking)) { + throw new Error('The canContainersAccessInstanceRole option is not supported. See https://github.com/aws/aws-cdk/discussions/32609'); + } + + if (options.canContainersAccessInstanceRole === false || + options.canContainersAccessInstanceRole === undefined) { + + if (!FeatureFlags.of(this).isEnabled(Disable_ECS_IMDS_Blocking) && + FeatureFlags.of(this).isEnabled(Enable_IMDS_Blocking_Deprecated_Feature)) { + // new commands from https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html#task-iam-role-considerations + autoScalingGroup.addUserData('sudo yum install -y iptables-services; sudo iptables --insert DOCKER-USER 1 --in-interface docker+ --destination 169.254.169.254/32 --jump DROP'); + autoScalingGroup.addUserData('sudo iptables-save | sudo tee /etc/sysconfig/iptables && sudo systemctl enable --now iptables'); + } else if (!FeatureFlags.of(this).isEnabled(Disable_ECS_IMDS_Blocking) && + !FeatureFlags.of(this).isEnabled(Enable_IMDS_Blocking_Deprecated_Feature)) { + // old commands + autoScalingGroup.addUserData('sudo iptables --insert FORWARD 1 --in-interface docker+ --destination 169.254.169.254/32 --jump DROP'); + autoScalingGroup.addUserData('sudo service iptables save'); + + Annotations.of(this).addWarningV2('@aws-cdk/aws-ecs:deprecatedImdsBlocking', + 'Blocking container access to instance role will be deprecated. Use the @aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature feature flag' + + 'to keep this feature temporarily. See https://github.com/aws/aws-cdk/discussions/32609'); + } + // The following is only for AwsVpc networking mode, but doesn't hurt for the other modes. + autoScalingGroup.addUserData('echo ECS_AWSVPC_BLOCK_IMDS=true >> /etc/ecs/ecs.config'); + } + } /** * This method enables the Fargate or Fargate Spot capacity providers on the cluster. * @@ -679,6 +767,17 @@ export class Cluster extends Resource implements ICluster { } private configureWindowsAutoScalingGroup(autoScalingGroup: autoscaling.AutoScalingGroup, options: AddAutoScalingGroupCapacityOptions = {}) { + if ((options.canContainersAccessInstanceRole === false || options.canContainersAccessInstanceRole === undefined) && + !FeatureFlags.of(this).isEnabled(Disable_ECS_IMDS_Blocking)) { + Annotations.of(this).addWarningV2('@aws-cdk/aws-ecs:deprecatedImdsBlocking', + 'Blocking container accessing instance role is not supported. See https://github.com/aws/aws-cdk/discussions/32609'); + } + + if (options.canContainersAccessInstanceRole === false && + FeatureFlags.of(this).isEnabled(Disable_ECS_IMDS_Blocking)) { + throw new Error('The canContainersAccessInstanceRole option is not supported. See https://github.com/aws/aws-cdk/discussions/32609'); + } + // clear the cache of the agent autoScalingGroup.addUserData('Remove-Item -Recurse C:\\ProgramData\\Amazon\\ECS\\Cache'); @@ -977,7 +1076,9 @@ export interface AddAutoScalingGroupCapacityOptions { /** * Specifies whether the containers can access the container instance role. * - * @default false + * @deprecated See https://github.com/aws/aws-cdk/discussions/32609 + * @default true if @aws-cdk/aws-ecs:disableEcsImdsBlocking feature flag is set to true. + * false if @aws-cdk/aws-ecs:disableEcsImdsBlocking is set to false. */ readonly canContainersAccessInstanceRole?: boolean; @@ -1369,7 +1470,9 @@ export class AsgCapacityProvider extends Construct { /** * Specifies whether the containers can access the container instance role. * - * @default false + * @deprecated See https://github.com/aws/aws-cdk/discussions/32609 + * @default true if @aws-cdk/aws-ecs:disableEcsImdsBlocking feature flag is set to true. + * false if @aws-cdk/aws-ecs:disableEcsImdsBlocking is set to false. */ readonly canContainersAccessInstanceRole?: boolean; @@ -1378,7 +1481,8 @@ export class AsgCapacityProvider extends Construct { let capacityProviderName = props.capacityProviderName; this.autoScalingGroup = props.autoScalingGroup as autoscaling.AutoScalingGroup; this.machineImageType = props.machineImageType ?? MachineImageType.AMAZON_LINUX_2; - this.canContainersAccessInstanceRole = props.canContainersAccessInstanceRole; + this.canContainersAccessInstanceRole = getCanContainersAccessInstanceRoleDefault( + props.canContainersAccessInstanceRole, FeatureFlags.of(this).isEnabled(Disable_ECS_IMDS_Blocking)); this.enableManagedTerminationProtection = props.enableManagedTerminationProtection ?? true; this.enableManagedDraining = props.enableManagedDraining; diff --git a/packages/aws-cdk-lib/aws-ecs/lib/ec2/ec2-service.ts b/packages/aws-cdk-lib/aws-ecs/lib/ec2/ec2-service.ts index 09c731f40517f..0b5eeae081948 100644 --- a/packages/aws-cdk-lib/aws-ecs/lib/ec2/ec2-service.ts +++ b/packages/aws-cdk-lib/aws-ecs/lib/ec2/ec2-service.ts @@ -1,6 +1,6 @@ import { Construct } from 'constructs'; import * as ec2 from '../../../aws-ec2'; -import { Lazy, Resource, Stack } from '../../../core'; +import { Lazy, Resource, Stack, Annotations } from '../../../core'; import { BaseService, BaseServiceOptions, DeploymentControllerType, IBaseService, IService, LaunchType } from '../base/base-service'; import { fromServiceAttributes, extractServiceNameFromArn } from '../base/from-service-attributes'; import { NetworkMode, TaskDefinition } from '../base/task-definition'; @@ -220,6 +220,10 @@ export class Ec2Service extends BaseService implements IEc2Service { }); this.node.addValidation({ validate: this.validateEc2Service.bind(this) }); + + if (props.minHealthyPercent === undefined && props.daemon) { + Annotations.of(this).addWarningV2('@aws-cdk/aws-ecs:minHealthyPercentDaemon', 'minHealthyPercent has not been configured so the default value of 0% for a daemon service is used. See https://github.com/aws/aws-cdk/issues/31705'); + } } /** diff --git a/packages/aws-cdk-lib/aws-ecs/lib/external/external-service.ts b/packages/aws-cdk-lib/aws-ecs/lib/external/external-service.ts index 89b52f908554a..4c79f5b917e03 100644 --- a/packages/aws-cdk-lib/aws-ecs/lib/external/external-service.ts +++ b/packages/aws-cdk-lib/aws-ecs/lib/external/external-service.ts @@ -3,7 +3,7 @@ import * as appscaling from '../../../aws-applicationautoscaling'; import * as ec2 from '../../../aws-ec2'; import * as elbv2 from '../../../aws-elasticloadbalancingv2'; import * as cloudmap from '../../../aws-servicediscovery'; -import { ArnFormat, Resource, Stack } from '../../../core'; +import { ArnFormat, Resource, Stack, Annotations } from '../../../core'; import { AssociateCloudMapServiceOptions, BaseService, BaseServiceOptions, CloudMapOptions, DeploymentControllerType, EcsTarget, IBaseService, IEcsLoadBalancerTarget, IService, LaunchType, PropagatedTagSource } from '../base/base-service'; import { fromServiceAttributes } from '../base/from-service-attributes'; import { ScalableTaskCount } from '../base/scalable-task-count'; @@ -132,6 +132,11 @@ export class ExternalService extends BaseService implements IExternalService { this.node.addValidation({ validate: () => this.networkConfiguration !== undefined ? ['Network configurations not supported for an external service'] : [], }); + + if (props.minHealthyPercent === undefined) { + Annotations.of(this).addWarningV2('@aws-cdk/aws-ecs:minHealthyPercentExternal', 'minHealthyPercent has not been configured so the default value of 0% for an external service is used. The number of running tasks will decrease below the desired count during deployments etc. See https://github.com/aws/aws-cdk/issues/31705'); + } + } /** diff --git a/packages/aws-cdk-lib/aws-ecs/test/cluster.test.ts b/packages/aws-cdk-lib/aws-ecs/test/cluster.test.ts index 0337ff49bd066..4231655b57d39 100644 --- a/packages/aws-cdk-lib/aws-ecs/test/cluster.test.ts +++ b/packages/aws-cdk-lib/aws-ecs/test/cluster.test.ts @@ -1,5 +1,5 @@ import { testDeprecated } from '@aws-cdk/cdk-build-tools'; -import { Match, Template } from '../../assertions'; +import { Annotations, Match, Template } from '../../assertions'; import * as autoscaling from '../../aws-autoscaling'; import * as ec2 from '../../aws-ec2'; import * as iam from '../../aws-iam'; @@ -8,9 +8,9 @@ import * as logs from '../../aws-logs'; import * as s3 from '../../aws-s3'; import * as cloudmap from '../../aws-servicediscovery'; import * as cdk from '../../core'; -import { getWarnings } from '../../core/test/util'; import * as cxapi from '../../cx-api'; import * as ecs from '../lib'; +import { CfnCluster, MachineImageType } from '../lib'; describe('cluster', () => { describe('isCluster() returns', () => { @@ -3353,3 +3353,939 @@ describe('Accessing container instance role', function () { expect(autoScalingGroup.addUserData).not.toHaveBeenCalledWith('echo ECS_AWSVPC_BLOCK_IMDS=true >> /etc/ecs/ecs.config'); }); }); + +describe('canContainersAccessInstanceRole behaviour', () => { + const ECS_CLUSTER_LOGICAL_ID = 'EcsCluster'; + + const retrieveUserData = (template: Template) => { + const launchTemplate = template.findResources('AWS::AutoScaling::LaunchConfiguration'); + expect(Object.keys(launchTemplate).length).toBe(1); + return Object.values(launchTemplate)[0].Properties.UserData['Fn::Base64']; + }; + + describe('when using Linux as OS', () => { + const assertUserDataHasLinuxOldIptableCommands = (userData: object) => { + expect(userData).toMatchObject({ + 'Fn::Join': [ + '', + [ + '#!/bin/bash\necho ECS_CLUSTER=', + { + Ref: ECS_CLUSTER_LOGICAL_ID, + }, + ' >> /etc/ecs/ecs.config\nsudo iptables --insert FORWARD 1 --in-interface docker+ --destination 169.254.169.254/32 --jump DROP\nsudo service iptables save\necho ECS_AWSVPC_BLOCK_IMDS=true >> /etc/ecs/ecs.config', + ], + ], + }); + }; + + const assertUserDataHasLinuxUpdatedIptableCommands = (userData: object) => { + expect(userData).toMatchObject({ + 'Fn::Join': [ + '', + [ + '#!/bin/bash\necho ECS_CLUSTER=', + { + Ref: ECS_CLUSTER_LOGICAL_ID, + }, + ' >> /etc/ecs/ecs.config\nsudo yum install -y iptables-services; sudo iptables --insert DOCKER-USER 1 --in-interface docker+ --destination 169.254.169.254/32 --jump DROP\nsudo iptables-save | sudo tee /etc/sysconfig/iptables && sudo systemctl enable --now iptables\necho ECS_AWSVPC_BLOCK_IMDS=true >> /etc/ecs/ecs.config', + ], + ], + }); + }; + + const assertUserDataDoesNotHaveNetworkingCommands = (userData: object) => { + expect(userData).toMatchObject({ + 'Fn::Join': [ + '', + [ + '#!/bin/bash\necho ECS_CLUSTER=', + { + Ref: ECS_CLUSTER_LOGICAL_ID, + }, + ' >> /etc/ecs/ecs.config', + ], + ], + }); + }; + + const createClusterUsingAddAutoScalingGroup = (options: { + stack: cdk.Stack; + canContainersAccessInstanceRole: boolean; + }) => { + const vpc = new ec2.Vpc(options.stack, 'Vpc'); + const cluster = new ecs.Cluster(options.stack, 'EcsCluster'); + (cluster.node.defaultChild as CfnCluster).overrideLogicalId(ECS_CLUSTER_LOGICAL_ID); + const autoScalingGroup = new autoscaling.AutoScalingGroup(options.stack, 'asg', { + vpc, + instanceType: new ec2.InstanceType('fake'), + machineImage: ecs.EcsOptimizedImage.amazonLinux2(), + }); + cluster.addAutoScalingGroup(autoScalingGroup, { canContainersAccessInstanceRole: options.canContainersAccessInstanceRole }); + + return cluster; + }; + + const createClusterUsingAddAsgCapacityProvider = (options: { + stack: cdk.Stack; + canContainersAccessInstanceRole: boolean; + }) => { + const vpc = new ec2.Vpc(options.stack, 'Vpc'); + const cluster = new ecs.Cluster(options.stack, 'EcsCluster'); + (cluster.node.defaultChild as CfnCluster).overrideLogicalId(ECS_CLUSTER_LOGICAL_ID); + const autoScalingGroup = new autoscaling.AutoScalingGroup(options.stack, 'asg', { + vpc, + instanceType: new ec2.InstanceType('fake'), + machineImage: ecs.EcsOptimizedImage.amazonLinux2(), + }); + const capacityProvider = new ecs.AsgCapacityProvider(options.stack, 'provider', { + autoScalingGroup, + canContainersAccessInstanceRole: options.canContainersAccessInstanceRole, + }); + cluster.addAsgCapacityProvider(capacityProvider); + + return cluster; + }; + + const createClusterUsingAddCapacity = (options: { + stack: cdk.Stack; + canContainersAccessInstanceRole: boolean; + }) => { + const cluster = new ecs.Cluster(options.stack, 'EcsCluster'); + (cluster.node.defaultChild as CfnCluster).overrideLogicalId(ECS_CLUSTER_LOGICAL_ID); + cluster.addCapacity('DefaultAutoScalingGroupCapacity', { + instanceType: new ec2.InstanceType('fake'), + machineImage: ecs.EcsOptimizedImage.amazonLinux2(), + canContainersAccessInstanceRole: options.canContainersAccessInstanceRole, + }); + + return cluster; + }; + + const waysToCreateCluster = [ + createClusterUsingAddAutoScalingGroup, + createClusterUsingAddAsgCapacityProvider, + createClusterUsingAddCapacity, + ]; + + [ + // canContainersAccessInstanceRole=undefined + { + featureFlags: { + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': true, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': true, + }, + canContainersAccessInstanceRole: undefined, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasNoWarning( + '*', + Match.anyValue(), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataDoesNotHaveNetworkingCommands(userData); + }, + }, + { + featureFlags: { + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': true, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + }, + canContainersAccessInstanceRole: undefined, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasNoWarning( + '*', + Match.anyValue(), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataDoesNotHaveNetworkingCommands(userData); + }, + }, + { + featureFlags: { + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': true, + }, + canContainersAccessInstanceRole: undefined, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasNoWarning( + '*', + Match.anyValue(), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataHasLinuxUpdatedIptableCommands(userData); + }, + }, + { + featureFlags: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, + canContainersAccessInstanceRole: undefined, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasWarning( + '*', + Match.stringLikeRegexp('Blocking container access to instance role will be deprecated. Use the @aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature feature flag'), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataHasLinuxOldIptableCommands(userData); + }, + }, + // canContainersAccessInstanceRole=false + { + featureFlags: { + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': true, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': true, + }, + canContainersAccessInstanceRole: false, + expectedSynthError: 'The canContainersAccessInstanceRole option is not supported.', + assertion: (_: cdk.Stack) => { /* no-op */ }, + }, + { + featureFlags: { + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': true, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + }, + canContainersAccessInstanceRole: false, + expectedSynthError: 'The canContainersAccessInstanceRole option is not supported.', + assertion: (_: cdk.Stack) => { /* no-op */ }, + }, + { + featureFlags: { + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': true, + }, + canContainersAccessInstanceRole: false, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasNoWarning( + '*', + Match.anyValue(), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataHasLinuxUpdatedIptableCommands(userData); + }, + }, + { + featureFlags: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, + canContainersAccessInstanceRole: false, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasWarning( + '*', + Match.stringLikeRegexp('Blocking container access to instance role will be deprecated. Use the @aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature feature flag'), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataHasLinuxOldIptableCommands(userData); + }, + }, + // canContainersAccessInstanceRole=true + { + featureFlags: { + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': true, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': true, + }, + canContainersAccessInstanceRole: true, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasNoWarning( + '*', + Match.anyValue(), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataDoesNotHaveNetworkingCommands(userData); + }, + }, + { + featureFlags: { + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': true, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + }, + canContainersAccessInstanceRole: true, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasNoWarning( + '*', + Match.anyValue(), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataDoesNotHaveNetworkingCommands(userData); + }, + }, + { + featureFlags: { + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': true, + }, + canContainersAccessInstanceRole: true, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasNoWarning( + '*', + Match.anyValue(), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataDoesNotHaveNetworkingCommands(userData); + }, + }, + { + featureFlags: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, + canContainersAccessInstanceRole: true, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasNoWarning( + '*', + Match.anyValue(), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataDoesNotHaveNetworkingCommands(userData); + }, + }, + ].forEach(cdkConfigurations => { + waysToCreateCluster.forEach(wayToCreateCluster => { + test(`${wayToCreateCluster.name} with canContainersAccessInstanceRole=${cdkConfigurations.canContainersAccessInstanceRole}` + + ` and feature flags: ${JSON.stringify(cdkConfigurations.featureFlags)}`, () => { + const app = new cdk.App({ + postCliContext: cdkConfigurations.featureFlags, + }); + const stack = new cdk.Stack(app, 'test'); + + if (cdkConfigurations.expectedSynthError !== undefined) { + expect(() => { + wayToCreateCluster({ stack, canContainersAccessInstanceRole: cdkConfigurations.canContainersAccessInstanceRole }); + }).toThrow(cdkConfigurations.expectedSynthError); + } else { + wayToCreateCluster({ stack, canContainersAccessInstanceRole: cdkConfigurations.canContainersAccessInstanceRole }); + cdkConfigurations.assertion(stack); + } + }); + }); + }); + }); + + describe('when using BottleRocket as OS', () => { + const assertUserDataHasBottleRocketCommands = (userData: object) => { + expect(userData).toMatchObject({ + 'Fn::Join': [ + '', + [ + '\n[settings.ecs]\ncluster = "', + { + Ref: 'EcsCluster', + }, + '"', + ], + ], + }); + }; + + const createClusterUsingAddAutoScalingGroup = (options: { + stack: cdk.Stack; + canContainersAccessInstanceRole: boolean; + }) => { + const vpc = new ec2.Vpc(options.stack, 'Vpc'); + const cluster = new ecs.Cluster(options.stack, 'EcsCluster'); + (cluster.node.defaultChild as CfnCluster).overrideLogicalId(ECS_CLUSTER_LOGICAL_ID); + const autoScalingGroup = new autoscaling.AutoScalingGroup(options.stack, 'asg', { + vpc, + instanceType: new ec2.InstanceType('fake'), + machineImage: new ecs.BottleRocketImage(), + }); + cluster.addAutoScalingGroup(autoScalingGroup, { + canContainersAccessInstanceRole: options.canContainersAccessInstanceRole, + machineImageType: MachineImageType.BOTTLEROCKET, + }); + + return cluster; + }; + + const createClusterUsingAddAsgCapacityProvider = (options: { + stack: cdk.Stack; + canContainersAccessInstanceRole: boolean; + }) => { + const vpc = new ec2.Vpc(options.stack, 'Vpc'); + const cluster = new ecs.Cluster(options.stack, 'EcsCluster'); + (cluster.node.defaultChild as CfnCluster).overrideLogicalId(ECS_CLUSTER_LOGICAL_ID); + const autoScalingGroup = new autoscaling.AutoScalingGroup(options.stack, 'asg', { + vpc, + instanceType: new ec2.InstanceType('fake'), + machineImage: new ecs.BottleRocketImage(), + }); + const capacityProvider = new ecs.AsgCapacityProvider(options.stack, 'provider', { + autoScalingGroup, + canContainersAccessInstanceRole: options.canContainersAccessInstanceRole, + machineImageType: MachineImageType.BOTTLEROCKET, + }); + cluster.addAsgCapacityProvider(capacityProvider); + + return cluster; + }; + + const createClusterUsingAddCapacity = (options: { + stack: cdk.Stack; + canContainersAccessInstanceRole: boolean; + }) => { + const cluster = new ecs.Cluster(options.stack, 'EcsCluster'); + (cluster.node.defaultChild as CfnCluster).overrideLogicalId(ECS_CLUSTER_LOGICAL_ID); + cluster.addCapacity('DefaultAutoScalingGroupCapacity', { + instanceType: new ec2.InstanceType('fake'), + machineImage: new ecs.BottleRocketImage(), + canContainersAccessInstanceRole: options.canContainersAccessInstanceRole, + }); + + return cluster; + }; + + const waysToCreateCluster = [ + createClusterUsingAddAutoScalingGroup, + createClusterUsingAddAsgCapacityProvider, + createClusterUsingAddCapacity, + ]; + + [ + // canContainersAccessInstanceRole=undefined + { + featureFlags: { + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': true, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': true, + }, + canContainersAccessInstanceRole: undefined, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasNoWarning( + '*', + Match.anyValue(), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataHasBottleRocketCommands(userData); + }, + }, + { + featureFlags: { + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': true, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + }, + canContainersAccessInstanceRole: undefined, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasNoWarning( + '*', + Match.anyValue(), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataHasBottleRocketCommands(userData); + }, + }, + { + featureFlags: { + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': true, + }, + canContainersAccessInstanceRole: undefined, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasWarning( + '*', + Match.stringLikeRegexp('Blocking container accessing instance role is not supported.'), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataHasBottleRocketCommands(userData); + }, + }, + { + featureFlags: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, + canContainersAccessInstanceRole: undefined, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasWarning( + '*', + Match.stringLikeRegexp('Blocking container accessing instance role is not supported.'), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataHasBottleRocketCommands(userData); + }, + }, + // canContainersAccessInstanceRole=false + { + featureFlags: { + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': true, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': true, + }, + canContainersAccessInstanceRole: false, + expectedSynthError: 'The canContainersAccessInstanceRole option is not supported.', + assertion: (_: cdk.Stack) => { /* no-op */ }, + }, + { + featureFlags: { + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': true, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + }, + canContainersAccessInstanceRole: false, + expectedSynthError: 'The canContainersAccessInstanceRole option is not supported.', + assertion: (_: cdk.Stack) => { /* no-op */ }, + }, + { + featureFlags: { + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': true, + }, + canContainersAccessInstanceRole: false, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasWarning( + '*', + Match.stringLikeRegexp('Blocking container accessing instance role is not supported.'), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataHasBottleRocketCommands(userData); + }, + }, + { + featureFlags: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, + canContainersAccessInstanceRole: false, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasWarning( + '*', + Match.stringLikeRegexp('Blocking container accessing instance role is not supported.'), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataHasBottleRocketCommands(userData); + }, + }, + // canContainersAccessInstanceRole=true + { + featureFlags: { + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': true, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': true, + }, + canContainersAccessInstanceRole: true, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasNoWarning( + '*', + Match.anyValue(), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataHasBottleRocketCommands(userData); + }, + }, + { + featureFlags: { + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': true, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + }, + canContainersAccessInstanceRole: true, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasNoWarning( + '*', + Match.anyValue(), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataHasBottleRocketCommands(userData); + }, + }, + { + featureFlags: { + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': true, + }, + canContainersAccessInstanceRole: true, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasNoWarning( + '*', + Match.anyValue(), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataHasBottleRocketCommands(userData); + }, + }, + { + featureFlags: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, + canContainersAccessInstanceRole: true, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasNoWarning( + '*', + Match.anyValue(), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataHasBottleRocketCommands(userData); + }, + }, + ].forEach(cdkConfigurations => { + waysToCreateCluster.forEach(wayToCreateCluster => { + test(`${wayToCreateCluster.name} with canContainersAccessInstanceRole=${cdkConfigurations.canContainersAccessInstanceRole}` + + ` and feature flags: ${JSON.stringify(cdkConfigurations.featureFlags)}`, () => { + const app = new cdk.App({ + postCliContext: cdkConfigurations.featureFlags, + }); + const stack = new cdk.Stack(app, 'test'); + + if (cdkConfigurations.expectedSynthError !== undefined) { + expect(() => { + wayToCreateCluster({ stack, canContainersAccessInstanceRole: cdkConfigurations.canContainersAccessInstanceRole }); + }).toThrow(cdkConfigurations.expectedSynthError); + } else { + wayToCreateCluster({ stack, canContainersAccessInstanceRole: cdkConfigurations.canContainersAccessInstanceRole }); + cdkConfigurations.assertion(stack); + } + }); + }); + }); + }); + + describe('when using Windows as OS', () => { + const assertUserDataDoesNotHaveTaskRoleCommands = (userData: object) => { + expect(userData).toMatchObject({ + 'Fn::Join': [ + '', + [ + 'Remove-Item -Recurse C:\\ProgramData\\Amazon\\ECS\\Cache\nImport-Module ECSTools\n[Environment]::SetEnvironmentVariable("ECS_CLUSTER", "', + { + Ref: 'EcsCluster', + }, + "\", \"Machine\")\n[Environment]::SetEnvironmentVariable(\"ECS_ENABLE_AWSLOGS_EXECUTIONROLE_OVERRIDE\", \"true\", \"Machine\")\n[Environment]::SetEnvironmentVariable(\"ECS_AVAILABLE_LOGGING_DRIVERS\", '[\"json-file\",\"awslogs\"]', \"Machine\")\nInitialize-ECSAgent -Cluster '", + { + Ref: 'EcsCluster', + }, + "'", + ], + ], + }); + }; + + const assertUserDataHasTaskRoleCommands = (userData: object) => { + expect(userData).toMatchObject({ + 'Fn::Join': [ + '', + [ + 'Remove-Item -Recurse C:\\ProgramData\\Amazon\\ECS\\Cache\nImport-Module ECSTools\n[Environment]::SetEnvironmentVariable("ECS_CLUSTER", "', + { + Ref: 'EcsCluster', + }, + "\", \"Machine\")\n[Environment]::SetEnvironmentVariable(\"ECS_ENABLE_AWSLOGS_EXECUTIONROLE_OVERRIDE\", \"true\", \"Machine\")\n[Environment]::SetEnvironmentVariable(\"ECS_AVAILABLE_LOGGING_DRIVERS\", '[\"json-file\",\"awslogs\"]', \"Machine\")\n[Environment]::SetEnvironmentVariable(\"ECS_ENABLE_TASK_IAM_ROLE\", \"true\", \"Machine\")\nInitialize-ECSAgent -Cluster '", + { + Ref: 'EcsCluster', + }, + "' -EnableTaskIAMRole", + ], + ], + }); + }; + + const createClusterUsingAddAutoScalingGroup = (options: { + stack: cdk.Stack; + canContainersAccessInstanceRole: boolean; + }) => { + const vpc = new ec2.Vpc(options.stack, 'Vpc'); + const cluster = new ecs.Cluster(options.stack, 'EcsCluster'); + (cluster.node.defaultChild as CfnCluster).overrideLogicalId(ECS_CLUSTER_LOGICAL_ID); + const autoScalingGroup = new autoscaling.AutoScalingGroup(options.stack, 'asg', { + vpc, + instanceType: new ec2.InstanceType('fake'), + machineImage: ecs.EcsOptimizedImage.windows(ecs.WindowsOptimizedVersion.SERVER_2022), + }); + cluster.addAutoScalingGroup(autoScalingGroup, { + canContainersAccessInstanceRole: options.canContainersAccessInstanceRole, + }); + + return cluster; + }; + + const createClusterUsingAddAsgCapacityProvider = (options: { + stack: cdk.Stack; + canContainersAccessInstanceRole: boolean; + }) => { + const vpc = new ec2.Vpc(options.stack, 'Vpc'); + const cluster = new ecs.Cluster(options.stack, 'EcsCluster'); + (cluster.node.defaultChild as CfnCluster).overrideLogicalId(ECS_CLUSTER_LOGICAL_ID); + const autoScalingGroup = new autoscaling.AutoScalingGroup(options.stack, 'asg', { + vpc, + instanceType: new ec2.InstanceType('fake'), + machineImage: ecs.EcsOptimizedImage.windows(ecs.WindowsOptimizedVersion.SERVER_2022), + }); + const capacityProvider = new ecs.AsgCapacityProvider(options.stack, 'provider', { + autoScalingGroup, + canContainersAccessInstanceRole: options.canContainersAccessInstanceRole, + }); + cluster.addAsgCapacityProvider(capacityProvider); + + return cluster; + }; + + const createClusterUsingAddCapacity = (options: { + stack: cdk.Stack; + canContainersAccessInstanceRole: boolean; + }) => { + const cluster = new ecs.Cluster(options.stack, 'EcsCluster'); + (cluster.node.defaultChild as CfnCluster).overrideLogicalId(ECS_CLUSTER_LOGICAL_ID); + cluster.addCapacity('DefaultAutoScalingGroupCapacity', { + instanceType: new ec2.InstanceType('fake'), + machineImage: ecs.EcsOptimizedImage.windows(ecs.WindowsOptimizedVersion.SERVER_2022), + canContainersAccessInstanceRole: options.canContainersAccessInstanceRole, + }); + + return cluster; + }; + + const waysToCreateCluster = [ + createClusterUsingAddAutoScalingGroup, + createClusterUsingAddAsgCapacityProvider, + createClusterUsingAddCapacity, + ]; + + [ + // canContainersAccessInstanceRole=undefined + { + featureFlags: { + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': true, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': true, + }, + canContainersAccessInstanceRole: undefined, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasNoWarning( + '*', + Match.anyValue(), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataDoesNotHaveTaskRoleCommands(userData); + }, + }, + { + featureFlags: { + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': true, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + }, + canContainersAccessInstanceRole: undefined, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasNoWarning( + '*', + Match.anyValue(), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataDoesNotHaveTaskRoleCommands(userData); + }, + }, + { + featureFlags: { + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': true, + }, + canContainersAccessInstanceRole: undefined, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasWarning( + '*', + Match.stringLikeRegexp('Blocking container accessing instance role is not supported.'), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataHasTaskRoleCommands(userData); + }, + }, + { + featureFlags: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, + canContainersAccessInstanceRole: undefined, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasWarning( + '*', + Match.stringLikeRegexp('Blocking container accessing instance role is not supported.'), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataHasTaskRoleCommands(userData); + }, + }, + // canContainersAccessInstanceRole=false + { + featureFlags: { + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': true, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': true, + }, + canContainersAccessInstanceRole: false, + expectedSynthError: 'The canContainersAccessInstanceRole option is not supported.', + assertion: (_: cdk.Stack) => { /* no-op */ }, + }, + { + featureFlags: { + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': true, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + }, + canContainersAccessInstanceRole: false, + expectedSynthError: 'The canContainersAccessInstanceRole option is not supported.', + assertion: (_: cdk.Stack) => { /* no-op */ }, + }, + { + featureFlags: { + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': true, + }, + canContainersAccessInstanceRole: false, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasWarning( + '*', + Match.stringLikeRegexp('Blocking container accessing instance role is not supported.'), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataHasTaskRoleCommands(userData); + }, + }, + { + featureFlags: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, + canContainersAccessInstanceRole: false, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasWarning( + '*', + Match.stringLikeRegexp('Blocking container accessing instance role is not supported.'), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataHasTaskRoleCommands(userData); + }, + }, + // canContainersAccessInstanceRole=true + { + featureFlags: { + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': true, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': true, + }, + canContainersAccessInstanceRole: true, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasNoWarning( + '*', + Match.anyValue(), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataDoesNotHaveTaskRoleCommands(userData); + }, + }, + { + featureFlags: { + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': true, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + }, + canContainersAccessInstanceRole: true, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasNoWarning( + '*', + Match.anyValue(), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataDoesNotHaveTaskRoleCommands(userData); + }, + }, + { + featureFlags: { + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': true, + }, + canContainersAccessInstanceRole: true, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasNoWarning( + '*', + Match.anyValue(), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataDoesNotHaveTaskRoleCommands(userData); + }, + }, + { + featureFlags: { + '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false, + '@aws-cdk/aws-ecs:disableEcsImdsBlocking': false, + }, + canContainersAccessInstanceRole: true, + expectedSynthError: undefined, + assertion: (stack: cdk.Stack) => { + Annotations.fromStack(stack).hasNoWarning( + '*', + Match.anyValue(), + ); + const template = Template.fromStack(stack); + const userData = retrieveUserData(template); + assertUserDataDoesNotHaveTaskRoleCommands(userData); + }, + }, + ].forEach(cdkConfigurations => { + waysToCreateCluster.forEach(wayToCreateCluster => { + test(`${wayToCreateCluster.name} with canContainersAccessInstanceRole=${cdkConfigurations.canContainersAccessInstanceRole}` + + ` and feature flags: ${JSON.stringify(cdkConfigurations.featureFlags)}`, () => { + const app = new cdk.App({ + postCliContext: cdkConfigurations.featureFlags, + }); + const stack = new cdk.Stack(app, 'test'); + + if (cdkConfigurations.expectedSynthError !== undefined) { + expect(() => { + wayToCreateCluster({ stack, canContainersAccessInstanceRole: cdkConfigurations.canContainersAccessInstanceRole }); + }).toThrow(cdkConfigurations.expectedSynthError); + } else { + wayToCreateCluster({ stack, canContainersAccessInstanceRole: cdkConfigurations.canContainersAccessInstanceRole }); + cdkConfigurations.assertion(stack); + } + }); + }); + }); + }); +}); diff --git a/packages/aws-cdk-lib/aws-ecs/test/ec2/ec2-service.test.ts b/packages/aws-cdk-lib/aws-ecs/test/ec2/ec2-service.test.ts index b6aff9a744f7a..b40634812a452 100644 --- a/packages/aws-cdk-lib/aws-ecs/test/ec2/ec2-service.test.ts +++ b/packages/aws-cdk-lib/aws-ecs/test/ec2/ec2-service.test.ts @@ -1630,6 +1630,100 @@ describe('ec2 service', () => { }); + test('warning if minHealthyPercent not set', () => { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'MyVpc', {}); + const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc }); + addDefaultCapacityProvider(cluster, stack, vpc); + const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef'); + + const container = taskDefinition.addContainer('web', { + image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'), + memoryLimitMiB: 512, + }); + + new ecs.Ec2Service(stack, 'Ec2Service', { + cluster, + taskDefinition, + }); + + // THEN + Annotations.fromStack(stack).hasWarning('/Default/Ec2Service', 'minHealthyPercent has not been configured so the default value of 50% is used. The number of running tasks will decrease below the desired count during deployments etc. See https://github.com/aws/aws-cdk/issues/31705 [ack: @aws-cdk/aws-ecs:minHealthyPercent]'); + }); + + test('no warning if minHealthyPercent set', () => { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'MyVpc', {}); + const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc }); + addDefaultCapacityProvider(cluster, stack, vpc); + const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef'); + + const container = taskDefinition.addContainer('web', { + image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'), + memoryLimitMiB: 512, + }); + + new ecs.Ec2Service(stack, 'Ec2Service', { + cluster, + taskDefinition, + minHealthyPercent: 50, + }); + + // THEN + Annotations.fromStack(stack).hasNoWarning('/Default/Ec2Service', 'minHealthyPercent has not been configured so the default value of 50% is used. The number of running tasks will decrease below the desired count during deployments etc. See https://github.com/aws/aws-cdk/issues/31705 [ack: @aws-cdk/aws-ecs:minHealthyPercent]'); + }); + + test('warning if minHealthyPercent not set for a daemon service', () => { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'MyVpc', {}); + const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc }); + addDefaultCapacityProvider(cluster, stack, vpc); + const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef'); + + const container = taskDefinition.addContainer('web', { + image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'), + memoryLimitMiB: 512, + }); + + new ecs.Ec2Service(stack, 'Ec2Service', { + cluster, + taskDefinition, + daemon: true, + }); + + // THEN + Annotations.fromStack(stack).hasWarning('/Default/Ec2Service', 'minHealthyPercent has not been configured so the default value of 0% for a daemon service is used. See https://github.com/aws/aws-cdk/issues/31705 [ack: @aws-cdk/aws-ecs:minHealthyPercentDaemon]'); + Annotations.fromStack(stack).hasNoWarning('/Default/Ec2Service', 'minHealthyPercent has not been configured so the default value of 50% is used. The number of running tasks will decrease below the desired count during deployments etc. See https://github.com/aws/aws-cdk/issues/31705 [ack: @aws-cdk/aws-ecs:minHealthyPercent]'); + }); + + test('no warning if minHealthyPercent set for a daemon service', () => { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'MyVpc', {}); + const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc }); + addDefaultCapacityProvider(cluster, stack, vpc); + const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef'); + + const container = taskDefinition.addContainer('web', { + image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'), + memoryLimitMiB: 512, + }); + + new ecs.Ec2Service(stack, 'Ec2Service', { + cluster, + taskDefinition, + minHealthyPercent: 50, + daemon: true, + }); + + // THEN + Annotations.fromStack(stack).hasNoWarning('/Default/Ec2Service', 'minHealthyPercent has not been configured so the default value of 0% for a daemon service is used. See https://github.com/aws/aws-cdk/issues/31705 [ack: @aws-cdk/aws-ecs:minHealthyPercentDaemon]'); + Annotations.fromStack(stack).hasNoWarning('/Default/Ec2Service', 'minHealthyPercent has not been configured so the default value of 50% is used. The number of running tasks will decrease below the desired count during deployments etc. See https://github.com/aws/aws-cdk/issues/31705 [ack: @aws-cdk/aws-ecs:minHealthyPercent]'); + }); + describe('with a TaskDefinition with Bridge network mode', () => { test('it errors if vpcSubnets is specified', () => { // GIVEN diff --git a/packages/aws-cdk-lib/aws-ecs/test/external/external-service.test.ts b/packages/aws-cdk-lib/aws-ecs/test/external/external-service.test.ts index d77246d693959..9eeb40aafee2e 100644 --- a/packages/aws-cdk-lib/aws-ecs/test/external/external-service.test.ts +++ b/packages/aws-cdk-lib/aws-ecs/test/external/external-service.test.ts @@ -1,4 +1,4 @@ -import { Template } from '../../../assertions'; +import { Template, Annotations } from '../../../assertions'; import * as autoscaling from '../../../aws-autoscaling'; import * as cloudwatch from '../../../aws-cloudwatch'; import * as ec2 from '../../../aws-ec2'; @@ -581,6 +581,7 @@ describe('external service', () => { type: DeploymentControllerType.EXTERNAL, }, circuitBreaker: { rollback: true }, + minHealthyPercent: 100, // required to prevent test failure due to warning }); app.synth(); @@ -590,4 +591,52 @@ describe('external service', () => { 'Deployment circuit breaker requires the ECS deployment controller.', ]); }); + + test('warning if minHealthyPercent not set for an external service', () => { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'MyVpc', {}); + const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc }); + addDefaultCapacityProvider(cluster, stack, vpc); + const taskDefinition = new ecs.ExternalTaskDefinition(stack, 'ExternalTaskDef'); + + taskDefinition.addContainer('web', { + image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'), + memoryLimitMiB: 512, + }); + + const service = new ecs.ExternalService(stack, 'ExternalService', { + cluster, + taskDefinition, + }); + + // THEN + Annotations.fromStack(stack).hasWarning('/Default/ExternalService', 'minHealthyPercent has not been configured so the default value of 0% for an external service is used. The number of running tasks will decrease below the desired count during deployments etc. See https://github.com/aws/aws-cdk/issues/31705 [ack: @aws-cdk/aws-ecs:minHealthyPercentExternal]'); + Annotations.fromStack(stack).hasNoWarning('/Default/ExternalService', 'minHealthyPercent has not been configured so the default value of 50% is used. The number of running tasks will decrease below the desired count during deployments etc. See https://github.com/aws/aws-cdk/issues/31705 [ack: @aws-cdk/aws-ecs:minHealthyPercent]'); + }); + + test('no warning if minHealthyPercent set for an external service', () => { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'MyVpc', {}); + const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc }); + addDefaultCapacityProvider(cluster, stack, vpc); + const taskDefinition = new ecs.ExternalTaskDefinition(stack, 'ExternalTaskDef'); + + taskDefinition.addContainer('web', { + image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'), + memoryLimitMiB: 512, + }); + + const service = new ecs.ExternalService(stack, 'ExternalService', { + cluster, + taskDefinition, + minHealthyPercent: 100, + }); + + // THEN + Annotations.fromStack(stack).hasNoWarning('/Default/ExternalService', 'minHealthyPercent has not been configured so the default value of 0% for an external service is used. The number of running tasks will decrease below the desired count during deployments etc. See https://github.com/aws/aws-cdk/issues/31705 [ack: @aws-cdk/aws-ecs:minHealthyPercentExternal]'); + Annotations.fromStack(stack).hasNoWarning('/Default/ExternalService', 'minHealthyPercent has not been configured so the default value of 50% is used. The number of running tasks will decrease below the desired count during deployments etc. See https://github.com/aws/aws-cdk/issues/31705 [ack: @aws-cdk/aws-ecs:minHealthyPercent]'); + }); + }); diff --git a/packages/aws-cdk-lib/aws-ecs/test/fargate/fargate-service.test.ts b/packages/aws-cdk-lib/aws-ecs/test/fargate/fargate-service.test.ts index e8659057ef90b..59d353ba5a611 100644 --- a/packages/aws-cdk-lib/aws-ecs/test/fargate/fargate-service.test.ts +++ b/packages/aws-cdk-lib/aws-ecs/test/fargate/fargate-service.test.ts @@ -1343,6 +1343,47 @@ describe('fargate service', () => { }, }); }); + + test('warning if minHealthyPercent not set', () => { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'MyVpc', {}); + const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc }); + const taskDefinition = new ecs.FargateTaskDefinition(stack, 'FargateTaskDef'); + + taskDefinition.addContainer('web', { + image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'), + }); + + const service = new ecs.FargateService(stack, 'FargateService', { + cluster, + taskDefinition, + }); + + // THEN + Annotations.fromStack(stack).hasWarning('/Default/FargateService', 'minHealthyPercent has not been configured so the default value of 50% is used. The number of running tasks will decrease below the desired count during deployments etc. See https://github.com/aws/aws-cdk/issues/31705 [ack: @aws-cdk/aws-ecs:minHealthyPercent]'); + }); + + test('no warning if minHealthyPercent set', () => { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'MyVpc', {}); + const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc }); + const taskDefinition = new ecs.FargateTaskDefinition(stack, 'FargateTaskDef'); + + taskDefinition.addContainer('web', { + image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'), + }); + + const service = new ecs.FargateService(stack, 'FargateService', { + cluster, + taskDefinition, + minHealthyPercent: 50, + }); + + // THEN + Annotations.fromStack(stack).hasNoWarning('/Default/FargateService', 'minHealthyPercent has not been configured so the default value of 50% is used. The number of running tasks will decrease below the desired count during deployments etc. See https://github.com/aws/aws-cdk/issues/31705 [ack: @aws-cdk/aws-ecs:minHealthyPercent]'); + }); }); describe('when enabling service connect', () => { @@ -3502,6 +3543,7 @@ describe('fargate service', () => { const service = new ecs.FargateService(stack, 'Service', { cluster, taskDefinition, + minHealthyPercent: 50, // must be set to avoid warning causing test failure }); // WHEN diff --git a/packages/aws-cdk-lib/aws-ecs/test/task-definition.test.ts b/packages/aws-cdk-lib/aws-ecs/test/task-definition.test.ts index f098b3e89afcb..72af3300eb88d 100644 --- a/packages/aws-cdk-lib/aws-ecs/test/task-definition.test.ts +++ b/packages/aws-cdk-lib/aws-ecs/test/task-definition.test.ts @@ -457,6 +457,39 @@ describe('task definition', () => { Template.fromStack(stack); }).toThrow("ECS Container Container must have at least one of 'memoryLimitMiB' or 'memoryReservationMiB' specified"); }); + + test.each([true, false])('set enableFaultInjection to %s.', (enableFaultInjection) => { + // GIVEN + const stack = new cdk.Stack(); + + // WHEN + new ecs.TaskDefinition(stack, 'TD', { + cpu: '512', + compatibility: ecs.Compatibility.EC2, + enableFaultInjection, + networkMode: ecs.NetworkMode.HOST, + }); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::ECS::TaskDefinition', { + EnableFaultInjection: enableFaultInjection, + }); + }); + + test('throws when enableFaultInjection is true with non AWSVPC or HOST Network Mode', () => { + // GIVEN + const stack = new cdk.Stack(); + + // THEN + expect(() => { + new ecs.TaskDefinition(stack, 'TD', { + cpu: '512', + compatibility: ecs.Compatibility.EC2, + enableFaultInjection: true, + networkMode: ecs.NetworkMode.BRIDGE, + }); + }).toThrow('Only AWS_VPC and HOST Network Modes are supported for enabling Fault Injection, got bridge mode.'); + }); }); describe('When importing from an existing Task definition', () => { diff --git a/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md b/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md index 703d404082431..d278d6b3064ac 100644 --- a/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md +++ b/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md @@ -84,6 +84,8 @@ Flags come in three types: | [@aws-cdk/aws-ec2:bastionHostUseAmazonLinux2023ByDefault](#aws-cdkaws-ec2bastionhostuseamazonlinux2023bydefault) | When enabled, the BastionHost construct will use the latest Amazon Linux 2023 AMI, instead of Amazon Linux 2. | 2.172.0 | (default) | | [@aws-cdk/core:aspectStabilization](#aws-cdkcoreaspectstabilization) | When enabled, a stabilization loop will be run when invoking Aspects during synthesis. | 2.172.0 | (config) | | [@aws-cdk/aws-route53-targets:userPoolDomainNameMethodWithoutCustomResource](#aws-cdkaws-route53-targetsuserpooldomainnamemethodwithoutcustomresource) | When enabled, use a new method for DNS Name of user pool domain target without creating a custom resource. | 2.174.0 | (fix) | +| [@aws-cdk/aws-ecs:disableEcsImdsBlocking](#aws-cdkaws-ecsdisableecsimdsblocking) | When set to true, CDK synth will throw exception if canContainersAccessInstanceRole is false. **IMPORTANT: See [details.](#aws-cdkaws-ecsdisableEcsImdsBlocking)** | 2.175.0 | (temporary) | +| [@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature](#aws-cdkaws-ecsenableimdsblockingdeprecatedfeature) | When set to true along with canContainersAccessInstanceRole=false in ECS cluster, new updated commands will be added to UserData to block container accessing IMDS. **Applicable to Linux only. IMPORTANT: See [details.](#aws-cdkaws-ecsenableImdsBlockingDeprecatedFeature)** | 2.175.0 | (temporary) | @@ -146,6 +148,8 @@ The following json shows the current recommended set of flags, as `cdk init` wou "@aws-cdk/aws-ecs:removeDefaultDeploymentAlarm": true, "@aws-cdk/custom-resources:logApiResponseDataPropertyTrueDefault": false, "@aws-cdk/aws-s3:keepNotificationInImportedBucket": false, + "@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature": false, + "@aws-cdk/aws-ecs:disableEcsImdsBlocking": true, "@aws-cdk/aws-ecs:reduceEc2FargateCloudWatchPermissions": true, "@aws-cdk/aws-dynamodb:resourcePolicyPerReplica": true, "@aws-cdk/aws-ec2:ec2SumTImeoutEnabled": true, @@ -215,10 +219,7 @@ Here is an example of a `cdk.json` file that restores v1 behavior for these flag "@aws-cdk/aws-rds:lowercaseDbIdentifier": false, "@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": false, "@aws-cdk/aws-lambda:recognizeVersionProps": false, - "@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021": false, - "@aws-cdk/pipelines:reduceAssetRoleTrustScope": false, - "@aws-cdk/aws-stepfunctions-tasks:useNewS3UriParametersForBedrockInvokeModelTask": false, - "@aws-cdk/core:aspectStabilization": false + "@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021": false } } ``` @@ -1588,4 +1589,43 @@ If the flag is set to false then a custom resource will be created when using `U | 2.174.0 | `false` | `true` | +### @aws-cdk/aws-ecs:disableEcsImdsBlocking + +*When set to true, CDK synth will throw exception if canContainersAccessInstanceRole is false. **IMPORTANT: See [details.](#aws-cdkaws-ecsdisableEcsImdsBlocking)*** (temporary) + +In an ECS Cluster with `MachineImageType.AMAZON_LINUX_2`, the canContainersAccessInstanceRole=false option attempts to add commands to block containers from +accessing IMDS. CDK cannot guarantee the correct execution of the feature in all platforms. Setting this feature flag +to true will ensure CDK does not attempt to implement IMDS blocking. By **end of 2025**, CDK will remove the +IMDS blocking feature. See [Github discussion](https://github.com/aws/aws-cdk/discussions/32609) for more information. + +It is recommended to follow ECS documentation to block IMDS for your specific platform and cluster configuration. + + +| Since | Default | Recommended | +| ----- | ----- | ----- | +| (not in v1) | | | +| 2.175.0 | `false` | `true` | + +**Compatibility with old behavior:** It is strongly recommended to set this flag to true. However, if necessary, set this flag to false to continue using the old implementation. + + +### @aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature + +*When set to true along with canContainersAccessInstanceRole=false in ECS cluster, new updated commands will be added to UserData to block container accessing IMDS. **Applicable to Linux only. IMPORTANT: See [details.](#aws-cdkaws-ecsenableImdsBlockingDeprecatedFeature)*** (temporary) + +In an ECS Cluster with `MachineImageType.AMAZON_LINUX_2`, the canContainersAccessInstanceRole=false option attempts to add commands to block containers from +accessing IMDS. Set this flag to true in order to use new and updated commands. Please note that this +feature alone with this feature flag will be deprecated by **end of 2025** as CDK cannot +guarantee the correct execution of the feature in all platforms. See [Github discussion](https://github.com/aws/aws-cdk/discussions/32609) for more information. +It is recommended to follow ECS documentation to block IMDS for your specific platform and cluster configuration. + + +| Since | Default | Recommended | +| ----- | ----- | ----- | +| (not in v1) | | | +| 2.175.0 | `false` | `false` | + +**Compatibility with old behavior:** Set this flag to false in order to continue using old and outdated commands. However, it is **not** recommended. + + diff --git a/packages/aws-cdk-lib/cx-api/README.md b/packages/aws-cdk-lib/cx-api/README.md index 5bba4c9198135..e1cf51ff8364e 100644 --- a/packages/aws-cdk-lib/cx-api/README.md +++ b/packages/aws-cdk-lib/cx-api/README.md @@ -513,3 +513,46 @@ _cdk.json_ } } ``` + +* `@aws-cdk/aws-ecs:disableEcsImdsBlocking` + +When set to true, CDK synth will throw exception if canContainersAccessInstanceRole is false. + +In an ECS Cluster with `MachineImageType.AMAZON_LINUX_2`, the canContainersAccessInstanceRole=false option attempts to add commands to block containers from +accessing IMDS. CDK cannot guarantee the correct execution of the feature in all platforms. Setting this feature flag +to true will ensure CDK does not attempt to implement IMDS blocking. By **end of 2025**, CDK will remove the +IMDS blocking feature. See [Github discussion](https://github.com/aws/aws-cdk/discussions/32609) for more information. + +**It is recommended to follow ECS documentation to block IMDS for your specific platform and cluster configuration.** + +_cdk.json_ + +```json +{ + "context": { + "@aws-cdk/aws-ecs:disableEcsImdsBlocking": true + } +} +``` + +* `@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature` + +When set to true along with canContainersAccessInstanceRole=false in ECS cluster, new updated commands will be added to UserData to block container accessing IMDS. **Applicable to Linux only.** + +In an ECS Cluster with `MachineImageType.AMAZON_LINUX_2`, the canContainersAccessInstanceRole=false option attempts to add commands to block containers from +accessing IMDS. Set this flag to true in order to use new and updated commands. Please note that this +feature alone with this feature flag will be deprecated by end of 2025 as CDK cannot +guarantee the correct execution of the feature in all platforms. See [Github discussion](https://github.com/aws/aws-cdk/discussions/32609) for more information. + +**It is recommended to follow ECS documentation to block IMDS for your specific platform and cluster configuration.** + + +_cdk.json_ + +```json +{ + "context": { + "@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature": false, + }, +} +``` \ No newline at end of file diff --git a/packages/aws-cdk-lib/cx-api/build-tools/flag-report.ts b/packages/aws-cdk-lib/cx-api/build-tools/flag-report.ts index 00477c8833876..4987193d082a2 100644 --- a/packages/aws-cdk-lib/cx-api/build-tools/flag-report.ts +++ b/packages/aws-cdk-lib/cx-api/build-tools/flag-report.ts @@ -65,7 +65,7 @@ function changedFlags() { } function migrateJson() { - const changedInV2 = flags(flag => !!flag.defaults?.v2 && !!flag.introducedIn.v2); + const changedInV2 = flags(flag => !!flag.defaults?.v2 && !!flag.introducedIn.v2 && !!flag.introducedIn.v1); const context = Object.fromEntries(changedInV2.map(([name, _]) => [name, false])); @@ -114,6 +114,7 @@ function oldBehavior(flag: FlagInfo): string | undefined { case FlagType.ApiDefault: return flag.compatibilityWithOldBehaviorMd; case FlagType.BugFix: return flag.compatibilityWithOldBehaviorMd; case FlagType.VisibleContext: return undefined; + case FlagType.Temporary: return flag.compatibilityWithOldBehaviorMd; } } @@ -148,6 +149,7 @@ function renderType(type: FlagType): string { case FlagType.ApiDefault: return '(default)'; case FlagType.BugFix: return '(fix)'; case FlagType.VisibleContext: return '(config)'; + case FlagType.Temporary: return '(temporary)'; } } diff --git a/packages/aws-cdk-lib/cx-api/lib/features.ts b/packages/aws-cdk-lib/cx-api/lib/features.ts index 3d57ceb0bbe6f..98189fd5a3965 100644 --- a/packages/aws-cdk-lib/cx-api/lib/features.ts +++ b/packages/aws-cdk-lib/cx-api/lib/features.ts @@ -118,6 +118,8 @@ export const STEPFUNCTIONS_TASKS_FIX_RUN_ECS_TASK_POLICY = '@aws-cdk/aws-stepfun export const BASTION_HOST_USE_AMAZON_LINUX_2023_BY_DEFAULT = '@aws-cdk/aws-ec2:bastionHostUseAmazonLinux2023ByDefault'; export const ASPECT_STABILIZATION = '@aws-cdk/core:aspectStabilization'; export const USER_POOL_DOMAIN_NAME_METHOD_WITHOUT_CUSTOM_RESOURCE = '@aws-cdk/aws-route53-targets:userPoolDomainNameMethodWithoutCustomResource'; +export const Enable_IMDS_Blocking_Deprecated_Feature = '@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature'; +export const Disable_ECS_IMDS_Blocking = '@aws-cdk/aws-ecs:disableEcsImdsBlocking'; export const FLAGS: Record = { ////////////////////////////////////////////////////////////////////// @@ -1138,6 +1140,44 @@ export const FLAGS: Record = { compatibilityWithOldBehaviorMd: 'Disable the feature flag to use input and output path fields for s3 URI', }, + ////////////////////////////////////////////////////////////////////// + [Enable_IMDS_Blocking_Deprecated_Feature]: { + type: FlagType.Temporary, + summary: 'When set to true along with canContainersAccessInstanceRole=false in ECS cluster, new updated ' + + 'commands will be added to UserData to block container accessing IMDS. ' + + '**Applicable to Linux only. IMPORTANT: See [details.](#aws-cdkaws-ecsenableImdsBlockingDeprecatedFeature)**', + detailsMd: ` + In an ECS Cluster with \`MachineImageType.AMAZON_LINUX_2\`, the canContainersAccessInstanceRole=false option attempts to add commands to block containers from + accessing IMDS. Set this flag to true in order to use new and updated commands. Please note that this + feature alone with this feature flag will be deprecated by **end of 2025** as CDK cannot + guarantee the correct execution of the feature in all platforms. See [Github discussion](https://github.com/aws/aws-cdk/discussions/32609) for more information. + It is recommended to follow ECS documentation to block IMDS for your specific platform and cluster configuration. + `, + introducedIn: { v2: '2.175.0' }, + recommendedValue: false, + compatibilityWithOldBehaviorMd: 'Set this flag to false in order to continue using old and outdated commands. ' + + 'However, it is **not** recommended.', + }, + + ////////////////////////////////////////////////////////////////////// + [Disable_ECS_IMDS_Blocking]: { + type: FlagType.Temporary, + summary: 'When set to true, CDK synth will throw exception if canContainersAccessInstanceRole is false.' + + ' **IMPORTANT: See [details.](#aws-cdkaws-ecsdisableEcsImdsBlocking)**', + detailsMd: ` + In an ECS Cluster with \`MachineImageType.AMAZON_LINUX_2\`, the canContainersAccessInstanceRole=false option attempts to add commands to block containers from + accessing IMDS. CDK cannot guarantee the correct execution of the feature in all platforms. Setting this feature flag + to true will ensure CDK does not attempt to implement IMDS blocking. By **end of 2025**, CDK will remove the + IMDS blocking feature. See [Github discussion](https://github.com/aws/aws-cdk/discussions/32609) for more information. + + It is recommended to follow ECS documentation to block IMDS for your specific platform and cluster configuration. + `, + introducedIn: { v2: '2.175.0' }, + recommendedValue: true, + compatibilityWithOldBehaviorMd: 'It is strongly recommended to set this flag to true. However, if necessary, set ' + + 'this flag to false to continue using the old implementation.', + }, + ////////////////////////////////////////////////////////////////////// [REDUCE_EC2_FARGATE_CLOUDWATCH_PERMISSIONS]: { type: FlagType.BugFix, diff --git a/packages/aws-cdk-lib/cx-api/lib/private/flag-modeling.ts b/packages/aws-cdk-lib/cx-api/lib/private/flag-modeling.ts index 55279650d075e..2747f12d90041 100644 --- a/packages/aws-cdk-lib/cx-api/lib/private/flag-modeling.ts +++ b/packages/aws-cdk-lib/cx-api/lib/private/flag-modeling.ts @@ -20,6 +20,11 @@ export enum FlagType { * Advertise the presence of this context option in `cdk.json` */ VisibleContext, + + /** + * Use this type for flags that are to be removed on a set date + */ + Temporary, }; export interface FlagInfoBase { @@ -45,6 +50,8 @@ export type FlagInfo = FlagInfoBase & ( /** Describe restoring old behavior or dealing with the change (Markdown) */ readonly compatibilityWithOldBehaviorMd?: string; } | { readonly type: FlagType.VisibleContext } + | { readonly type: FlagType.Temporary; + readonly compatibilityWithOldBehaviorMd?: string; } ); /** diff --git a/packages/aws-cdk-lib/recommended-feature-flags.json b/packages/aws-cdk-lib/recommended-feature-flags.json index 30a08f65a928c..71285e804b547 100644 --- a/packages/aws-cdk-lib/recommended-feature-flags.json +++ b/packages/aws-cdk-lib/recommended-feature-flags.json @@ -50,6 +50,8 @@ "@aws-cdk/aws-ecs:removeDefaultDeploymentAlarm": true, "@aws-cdk/custom-resources:logApiResponseDataPropertyTrueDefault": false, "@aws-cdk/aws-s3:keepNotificationInImportedBucket": false, + "@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature": false, + "@aws-cdk/aws-ecs:disableEcsImdsBlocking": true, "@aws-cdk/aws-ecs:reduceEc2FargateCloudWatchPermissions": true, "@aws-cdk/aws-dynamodb:resourcePolicyPerReplica": true, "@aws-cdk/aws-ec2:ec2SumTImeoutEnabled": true, diff --git a/packages/aws-cdk/lib/cli-arguments.ts b/packages/aws-cdk/lib/cli-arguments.ts index 665f81b2ce9d1..f67451c73176a 100644 --- a/packages/aws-cdk/lib/cli-arguments.ts +++ b/packages/aws-cdk/lib/cli-arguments.ts @@ -14,7 +14,7 @@ export interface CliArguments { /** * The CLI command name */ - readonly _: Command; + readonly _?: Command; /** * Global options available to all CLI commands diff --git a/packages/aws-cdk/lib/convert-to-cli-args.ts b/packages/aws-cdk/lib/convert-to-cli-args.ts index 3fc1b9a2bc541..9b742c8b0f303 100644 --- a/packages/aws-cdk/lib/convert-to-cli-args.ts +++ b/packages/aws-cdk/lib/convert-to-cli-args.ts @@ -7,7 +7,7 @@ import { CliArguments, GlobalOptions } from './cli-arguments'; import { Command } from './settings'; // @ts-ignore TS6133 -export function convertToCliArgs(args: any): CliArguments { +export function convertYargsToCliArgs(args: any): CliArguments { const globalOptions: GlobalOptions = { app: args.app, build: args.build, @@ -38,6 +38,7 @@ export function convertToCliArgs(args: any): CliArguments { let commandOptions; switch (args._[0] as Command) { case 'list': + case 'ls': commandOptions = { long: args.long, showDependencies: args.showDependencies, @@ -46,6 +47,7 @@ export function convertToCliArgs(args: any): CliArguments { break; case 'synthesize': + case 'synth': commandOptions = { exclusively: args.exclusively, validation: args.validation, @@ -193,6 +195,7 @@ export function convertToCliArgs(args: any): CliArguments { break; case 'acknowledge': + case 'ack': commandOptions = { ID: args.ID, }; @@ -237,6 +240,7 @@ export function convertToCliArgs(args: any): CliArguments { break; case 'docs': + case 'doc': commandOptions = { browser: args.browser, }; @@ -254,3 +258,197 @@ export function convertToCliArgs(args: any): CliArguments { return cliArguments; } + +// @ts-ignore TS6133 +export function convertConfigToCliArgs(config: any): CliArguments { + const globalOptions: GlobalOptions = { + app: config.app, + build: config.build, + context: config.context, + plugin: config.plugin, + trace: config.trace, + strict: config.strict, + lookups: config.lookups, + ignoreErrors: config.ignoreErrors, + json: config.json, + verbose: config.verbose, + debug: config.debug, + profile: config.profile, + proxy: config.proxy, + caBundlePath: config.caBundlePath, + ec2creds: config.ec2creds, + versionReporting: config.versionReporting, + pathMetadata: config.pathMetadata, + assetMetadata: config.assetMetadata, + roleArn: config.roleArn, + staging: config.staging, + output: config.output, + notices: config.notices, + noColor: config.noColor, + ci: config.ci, + unstable: config.unstable, + }; + const listOptions = { + long: config.list?.long, + showDependencies: config.list?.showDependencies, + }; + const synthesizeOptions = { + exclusively: config.synthesize?.exclusively, + validation: config.synthesize?.validation, + quiet: config.synthesize?.quiet, + }; + const bootstrapOptions = { + bootstrapBucketName: config.bootstrap?.bootstrapBucketName, + bootstrapKmsKeyId: config.bootstrap?.bootstrapKmsKeyId, + examplePermissionsBoundary: config.bootstrap?.examplePermissionsBoundary, + customPermissionsBoundary: config.bootstrap?.customPermissionsBoundary, + bootstrapCustomerKey: config.bootstrap?.bootstrapCustomerKey, + qualifier: config.bootstrap?.qualifier, + publicAccessBlockConfiguration: config.bootstrap?.publicAccessBlockConfiguration, + tags: config.bootstrap?.tags, + execute: config.bootstrap?.execute, + trust: config.bootstrap?.trust, + trustForLookup: config.bootstrap?.trustForLookup, + cloudformationExecutionPolicies: config.bootstrap?.cloudformationExecutionPolicies, + force: config.bootstrap?.force, + terminationProtection: config.bootstrap?.terminationProtection, + showTemplate: config.bootstrap?.showTemplate, + toolkitStackName: config.bootstrap?.toolkitStackName, + template: config.bootstrap?.template, + previousParameters: config.bootstrap?.previousParameters, + }; + const gcOptions = { + action: config.gc?.action, + type: config.gc?.type, + rollbackBufferDays: config.gc?.rollbackBufferDays, + createdBufferDays: config.gc?.createdBufferDays, + confirm: config.gc?.confirm, + bootstrapStackName: config.gc?.bootstrapStackName, + }; + const deployOptions = { + all: config.deploy?.all, + buildExclude: config.deploy?.buildExclude, + exclusively: config.deploy?.exclusively, + requireApproval: config.deploy?.requireApproval, + notificationArns: config.deploy?.notificationArns, + tags: config.deploy?.tags, + execute: config.deploy?.execute, + changeSetName: config.deploy?.changeSetName, + method: config.deploy?.method, + importExistingResources: config.deploy?.importExistingResources, + force: config.deploy?.force, + parameters: config.deploy?.parameters, + outputsFile: config.deploy?.outputsFile, + previousParameters: config.deploy?.previousParameters, + toolkitStackName: config.deploy?.toolkitStackName, + progress: config.deploy?.progress, + rollback: config.deploy?.rollback, + hotswap: config.deploy?.hotswap, + hotswapFallback: config.deploy?.hotswapFallback, + watch: config.deploy?.watch, + logs: config.deploy?.logs, + concurrency: config.deploy?.concurrency, + assetParallelism: config.deploy?.assetParallelism, + assetPrebuild: config.deploy?.assetPrebuild, + ignoreNoStacks: config.deploy?.ignoreNoStacks, + }; + const rollbackOptions = { + all: config.rollback?.all, + toolkitStackName: config.rollback?.toolkitStackName, + force: config.rollback?.force, + validateBootstrapVersion: config.rollback?.validateBootstrapVersion, + orphan: config.rollback?.orphan, + }; + const importOptions = { + execute: config.import?.execute, + changeSetName: config.import?.changeSetName, + toolkitStackName: config.import?.toolkitStackName, + rollback: config.import?.rollback, + force: config.import?.force, + recordResourceMapping: config.import?.recordResourceMapping, + resourceMapping: config.import?.resourceMapping, + }; + const watchOptions = { + buildExclude: config.watch?.buildExclude, + exclusively: config.watch?.exclusively, + changeSetName: config.watch?.changeSetName, + force: config.watch?.force, + toolkitStackName: config.watch?.toolkitStackName, + progress: config.watch?.progress, + rollback: config.watch?.rollback, + hotswap: config.watch?.hotswap, + hotswapFallback: config.watch?.hotswapFallback, + logs: config.watch?.logs, + concurrency: config.watch?.concurrency, + }; + const destroyOptions = { + all: config.destroy?.all, + exclusively: config.destroy?.exclusively, + force: config.destroy?.force, + }; + const diffOptions = { + exclusively: config.diff?.exclusively, + contextLines: config.diff?.contextLines, + template: config.diff?.template, + strict: config.diff?.strict, + securityOnly: config.diff?.securityOnly, + fail: config.diff?.fail, + processed: config.diff?.processed, + quiet: config.diff?.quiet, + changeSet: config.diff?.changeSet, + }; + const metadataOptions = {}; + const acknowledgeOptions = {}; + const noticesOptions = { + unacknowledged: config.notices?.unacknowledged, + }; + const initOptions = { + language: config.init?.language, + list: config.init?.list, + generateOnly: config.init?.generateOnly, + }; + const migrateOptions = { + stackName: config.migrate?.stackName, + language: config.migrate?.language, + account: config.migrate?.account, + region: config.migrate?.region, + fromPath: config.migrate?.fromPath, + fromStack: config.migrate?.fromStack, + outputPath: config.migrate?.outputPath, + fromScan: config.migrate?.fromScan, + filter: config.migrate?.filter, + compress: config.migrate?.compress, + }; + const contextOptions = { + reset: config.context?.reset, + force: config.context?.force, + clear: config.context?.clear, + }; + const docsOptions = { + browser: config.docs?.browser, + }; + const doctorOptions = {}; + const cliArguments: CliArguments = { + globalOptions, + list: listOptions, + synthesize: synthesizeOptions, + bootstrap: bootstrapOptions, + gc: gcOptions, + deploy: deployOptions, + rollback: rollbackOptions, + import: importOptions, + watch: watchOptions, + destroy: destroyOptions, + diff: diffOptions, + metadata: metadataOptions, + acknowledge: acknowledgeOptions, + notices: noticesOptions, + init: initOptions, + migrate: migrateOptions, + context: contextOptions, + docs: docsOptions, + doctor: doctorOptions, + }; + + return cliArguments; +} diff --git a/packages/aws-cdk/lib/settings.ts b/packages/aws-cdk/lib/settings.ts index c29ae2045c0ac..9c6e680e6c8d8 100644 --- a/packages/aws-cdk/lib/settings.ts +++ b/packages/aws-cdk/lib/settings.ts @@ -36,10 +36,12 @@ export enum Command { ROLLBACK = 'rollback', IMPORT = 'import', ACKNOWLEDGE = 'acknowledge', + ACK = 'ack', NOTICES = 'notices', MIGRATE = 'migrate', CONTEXT = 'context', DOCS = 'docs', + DOC = 'doc', DOCTOR = 'doctor', } diff --git a/packages/aws-cdk/test/cli-arguments.test.ts b/packages/aws-cdk/test/cli-arguments.test.ts index 3024bfaae524a..ddcf9d02b6fb3 100644 --- a/packages/aws-cdk/test/cli-arguments.test.ts +++ b/packages/aws-cdk/test/cli-arguments.test.ts @@ -1,95 +1,143 @@ -import { convertToCliArgs } from '../lib/convert-to-cli-args'; +import { convertConfigToCliArgs, convertYargsToCliArgs } from '../lib/convert-to-cli-args'; import { parseCommandLineArguments } from '../lib/parse-command-line-arguments'; -test('yargs object can be converted to cli arguments', async () => { - const input = await parseCommandLineArguments(['deploy', '-R', '-v', '--ci']); +describe('yargs', () => { + test('yargs object can be converted to cli arguments', async () => { + const input = await parseCommandLineArguments(['deploy', '-R', '-v', '--ci']); - const result = convertToCliArgs(input); + const result = convertYargsToCliArgs(input); - expect(result).toEqual({ - _: 'deploy', - globalOptions: { - app: undefined, - assetMetadata: undefined, - build: undefined, - caBundlePath: undefined, - context: [], - ignoreErrors: false, - noColor: false, - pathMetadata: undefined, - plugin: [], - profile: undefined, - proxy: undefined, - roleArn: undefined, - staging: true, - strict: undefined, - verbose: 1, - versionReporting: undefined, - ci: true, - debug: false, - ec2creds: undefined, - json: false, - lookups: true, - trace: undefined, - unstable: [], - notices: undefined, - output: undefined, - }, - deploy: { - STACKS: undefined, - all: false, - assetParallelism: undefined, - assetPrebuild: true, - buildExclude: [], - changeSetName: undefined, - concurrency: 1, - execute: undefined, - exclusively: undefined, - force: false, - hotswap: undefined, - hotswapFallback: undefined, - ignoreNoStacks: false, - importExistingResources: false, - logs: true, - method: undefined, - notificationArns: undefined, - outputsFile: undefined, - parameters: [{}], - previousParameters: true, - progress: undefined, - requireApproval: undefined, - rollback: false, - tags: [], - toolkitStackName: undefined, - watch: undefined, - }, + expect(result).toEqual({ + _: 'deploy', + globalOptions: { + app: undefined, + assetMetadata: undefined, + build: undefined, + caBundlePath: undefined, + context: [], + ignoreErrors: false, + noColor: false, + pathMetadata: undefined, + plugin: [], + profile: undefined, + proxy: undefined, + roleArn: undefined, + staging: true, + strict: undefined, + verbose: 1, + versionReporting: undefined, + ci: true, + debug: false, + ec2creds: undefined, + json: false, + lookups: true, + trace: undefined, + unstable: [], + notices: undefined, + output: undefined, + }, + deploy: { + STACKS: undefined, + all: false, + assetParallelism: undefined, + assetPrebuild: true, + buildExclude: [], + changeSetName: undefined, + concurrency: 1, + execute: undefined, + exclusively: undefined, + force: false, + hotswap: undefined, + hotswapFallback: undefined, + ignoreNoStacks: false, + importExistingResources: false, + logs: true, + method: undefined, + notificationArns: undefined, + outputsFile: undefined, + parameters: [{}], + previousParameters: true, + progress: undefined, + requireApproval: undefined, + rollback: false, + tags: [], + toolkitStackName: undefined, + watch: undefined, + }, + }); + }); + + test('positional argument is correctly passed through -- variadic', async () => { + const input = await parseCommandLineArguments(['deploy', 'stack1', 'stack2', '-R', '-v', '--ci']); + + const result = convertYargsToCliArgs(input); + + expect(result).toEqual({ + _: 'deploy', + deploy: expect.objectContaining({ + STACKS: ['stack1', 'stack2'], + }), + globalOptions: expect.anything(), + }); }); -}); -test('positional argument is correctly passed through -- variadic', async () => { - const input = await parseCommandLineArguments(['deploy', 'stack1', 'stack2', '-R', '-v', '--ci']); + test('positional argument is correctly passed through -- single', async () => { + const input = await parseCommandLineArguments(['acknowledge', 'id1', '-v', '--ci']); - const result = convertToCliArgs(input); + const result = convertYargsToCliArgs(input); - expect(result).toEqual({ - _: 'deploy', - deploy: expect.objectContaining({ - STACKS: ['stack1', 'stack2'], - }), - globalOptions: expect.anything(), + expect(result).toEqual({ + _: 'acknowledge', + acknowledge: expect.objectContaining({ + ID: 'id1', + }), + globalOptions: expect.anything(), + }); }); }); -test('positional argument is correctly passed through -- single', async () => { - const input = await parseCommandLineArguments(['acknowledge', 'id1', '-v', '--ci']); +describe('config', () => { + test('cdk.json arguments can be converted to cli argumets', async () => { + const input = { + output: 'blah.out', + build: 'yarn build', + list: { + long: true, + }, + bootstrap: { + bootstrapBucketName: 'bucketName', + }, + }; - const result = convertToCliArgs(input); + const result = convertConfigToCliArgs(input); - expect(result).toEqual({ - _: 'acknowledge', - acknowledge: expect.objectContaining({ - ID: 'id1', - }), - globalOptions: expect.anything(), + expect(result).toEqual({ + globalOptions: expect.objectContaining({ + output: 'blah.out', + build: 'yarn build', + }), + list: expect.objectContaining({ + long: true, + }), + bootstrap: expect.objectContaining({ + bootstrapBucketName: 'bucketName', + }), + context: expect.anything(), + acknowledge: expect.anything(), + deploy: expect.anything(), + destroy: expect.anything(), + diff: expect.anything(), + init: expect.anything(), + metadata: expect.anything(), + migrate: expect.anything(), + rollback: expect.anything(), + synthesize: expect.anything(), + watch: expect.anything(), + notices: expect.anything(), + import: expect.anything(), + gc: expect.anything(), + doctor: expect.anything(), + docs: expect.anything(), + }); }); }); diff --git a/tools/@aws-cdk/cli-args-gen/lib/cli-args-function-gen.ts b/tools/@aws-cdk/cli-args-gen/lib/cli-args-function-gen.ts index cb7e6a6dd22d4..ffe1d947abed4 100644 --- a/tools/@aws-cdk/cli-args-gen/lib/cli-args-function-gen.ts +++ b/tools/@aws-cdk/cli-args-gen/lib/cli-args-function-gen.ts @@ -4,6 +4,9 @@ import * as prettier from 'prettier'; import { kebabToCamelCase } from './util'; import { CliAction, CliConfig } from './yargs-types'; +const CLI_ARG_NAME = 'args'; +const CONFIG_ARG_NAME = 'config'; + export async function renderCliArgsFunc(config: CliConfig): Promise { const scope = new Module('aws-cdk'); @@ -18,7 +21,7 @@ export async function renderCliArgsFunc(config: CliConfig): Promise { scope.addImport(new SelectiveModuleImport(scope, './settings', ['Command'])); const createCliArguments = new FreeFunction(scope, { - name: 'convertToCliArgs', + name: 'convertYargsToCliArgs', export: true, returnType: cliArgType, parameters: [ @@ -27,6 +30,16 @@ export async function renderCliArgsFunc(config: CliConfig): Promise { }); createCliArguments.addBody(code.expr.directCode(buildCliArgsFunction(config))); + const createConfigArguments = new FreeFunction(scope, { + name: 'convertConfigToCliArgs', + export: true, + returnType: cliArgType, + parameters: [ + { name: 'config', type: Type.ANY }, + ], + }); + createConfigArguments.addBody(code.expr.directCode(buildConfigArgsFunction(config))); + const ts = new TypeScriptRenderer({ disabledEsLintRules: [EsLintRules.MAX_LEN], // the default disabled rules result in 'Definition for rule 'prettier/prettier' was not found' }).render(scope); @@ -40,9 +53,9 @@ export async function renderCliArgsFunc(config: CliConfig): Promise { } function buildCliArgsFunction(config: CliConfig): string { - const globalOptions = buildGlobalOptions(config); - const commandSwitch = buildCommandSwitch(config); - const cliArgs = buildCliArgs(); + const globalOptions = buildGlobalOptions(config, CLI_ARG_NAME); + const commandSwitch = buildCommandSwitch(config, CLI_ARG_NAME); + const cliArgs = buildCliArgs(CLI_ARG_NAME); return [ globalOptions, commandSwitch, @@ -50,24 +63,50 @@ function buildCliArgsFunction(config: CliConfig): string { ].join('\n'); } -function buildGlobalOptions(config: CliConfig): string { +function buildConfigArgsFunction(config: CliConfig): string { + const globalOptions = buildGlobalOptions(config, CONFIG_ARG_NAME); + const commandList = buildCommandsList(config, CONFIG_ARG_NAME); + const configArgs = buildConfigArgs(config); + return [ + globalOptions, + commandList, + configArgs, + ].join('\n'); +} + +function buildGlobalOptions(config: CliConfig, argName: string): string { const globalOptionExprs = ['const globalOptions: GlobalOptions = {']; for (const optionName of Object.keys(config.globalOptions)) { const name = kebabToCamelCase(optionName); - globalOptionExprs.push(`'${name}': args.${name},`); + globalOptionExprs.push(`'${name}': ${argName}.${name},`); } globalOptionExprs.push('}'); return globalOptionExprs.join('\n'); } -function buildCommandSwitch(config: CliConfig): string { - const commandSwitchExprs = ['let commandOptions;', 'switch (args._[0] as Command) {']; +function buildCommandsList(config: CliConfig, argName: string): string { + const commandOptions = []; + // Note: we are intentionally not including aliases for the default options that can be + // specified via `cdk.json`. These options must be specified by the command name + // i.e. acknowledge rather than ack. + for (const commandName of Object.keys(config.commands)) { + commandOptions.push(`const ${kebabToCamelCase(commandName)}Options = {`); + commandOptions.push(...buildCommandOptions(config.commands[commandName], argName, kebabToCamelCase(commandName))); + commandOptions.push('}'); + } + return commandOptions.join('\n'); +} + +function buildCommandSwitch(config: CliConfig, argName: string): string { + const commandSwitchExprs = ['let commandOptions;', `switch (${argName}._[0] as Command) {`]; for (const commandName of Object.keys(config.commands)) { commandSwitchExprs.push( - `case '${commandName}':`, + // All aliases of the command should map to the same switch branch + // This ensures that we store options of the command regardless of what alias is specified + ...buildAliases(commandName, config.commands[commandName].aliases), 'commandOptions = {', - ...buildCommandOptions(config.commands[commandName]), - ...(config.commands[commandName].arg ? [buildPositionalArguments(config.commands[commandName].arg)] : []), + ...buildCommandOptions(config.commands[commandName], argName), + ...(config.commands[commandName].arg ? [buildPositionalArguments(config.commands[commandName].arg, argName)] : []), '};', `break; `); @@ -76,28 +115,50 @@ function buildCommandSwitch(config: CliConfig): string { return commandSwitchExprs.join('\n'); } -function buildCommandOptions(options: CliAction): string[] { +function buildAliases(commandName: string, aliases: string[] = []): string[] { + const cases = [commandName, ...aliases]; + return cases.map((c) => `case '${c}':`); +} + +function buildCommandOptions(options: CliAction, argName: string, prefix?: string): string[] { const commandOptions: string[] = []; for (const optionName of Object.keys(options.options ?? {})) { const name = kebabToCamelCase(optionName); - commandOptions.push(`'${name}': args.${name},`); + if (prefix) { + commandOptions.push(`'${name}': ${argName}.${prefix}?.${name},`); + } else { + commandOptions.push(`'${name}': ${argName}.${name},`); + } } return commandOptions; } -function buildPositionalArguments(arg: { name: string; variadic: boolean }): string { +function buildPositionalArguments(arg: { name: string; variadic: boolean }, argName: string): string { if (arg.variadic) { - return `${arg.name}: args.${arg.name}`; + return `${arg.name}: ${argName}.${arg.name}`; } - return `${arg.name}: args.${arg.name}`; + return `${arg.name}: ${argName}.${arg.name}`; +} + +function buildCliArgs(argName: string): string { + return [ + 'const cliArguments: CliArguments = {', + `_: ${argName}._[0],`, + 'globalOptions,', + `[${argName}._[0]]: commandOptions`, + '}', + '', + 'return cliArguments', + ].join('\n'); } -function buildCliArgs(): string { +function buildConfigArgs(config: CliConfig): string { return [ 'const cliArguments: CliArguments = {', - '_: args._[0],', 'globalOptions,', - '[args._[0]]: commandOptions', + ...(Object.keys(config.commands).map((commandName) => { + return `'${commandName}': ${kebabToCamelCase(commandName)}Options,`; + })), '}', '', 'return cliArguments', diff --git a/tools/@aws-cdk/cli-args-gen/lib/cli-args-gen.ts b/tools/@aws-cdk/cli-args-gen/lib/cli-args-gen.ts index da469e5cb9dc0..b8be1e8a636a6 100644 --- a/tools/@aws-cdk/cli-args-gen/lib/cli-args-gen.ts +++ b/tools/@aws-cdk/cli-args-gen/lib/cli-args-gen.ts @@ -30,6 +30,7 @@ export async function renderCliArgsType(config: CliConfig): Promise { docs: { summary: 'The CLI command name', }, + optional: true, }); // add global options diff --git a/tools/@aws-cdk/cli-args-gen/test/cli-args-function-gen.test.ts b/tools/@aws-cdk/cli-args-gen/test/cli-args-function-gen.test.ts index 24b92c7fe291e..0ea58ff8fde91 100644 --- a/tools/@aws-cdk/cli-args-gen/test/cli-args-function-gen.test.ts +++ b/tools/@aws-cdk/cli-args-gen/test/cli-args-function-gen.test.ts @@ -31,6 +31,7 @@ describe('render', () => { variadic: true, }, description: 'Deploy a stack', + aliases: ['d'], options: { all: { type: 'boolean', @@ -52,7 +53,7 @@ describe('render', () => { import { Command } from './settings'; // @ts-ignore TS6133 - export function convertToCliArgs(args: any): CliArguments { + export function convertYargsToCliArgs(args: any): CliArguments { const globalOptions: GlobalOptions = { app: args.app, debug: args.debug, @@ -62,6 +63,7 @@ describe('render', () => { let commandOptions; switch (args._[0] as Command) { case 'deploy': + case 'd': commandOptions = { all: args.all, STACKS: args.STACKS, @@ -76,6 +78,25 @@ describe('render', () => { return cliArguments; } + + // @ts-ignore TS6133 + export function convertConfigToCliArgs(config: any): CliArguments { + const globalOptions: GlobalOptions = { + app: config.app, + debug: config.debug, + context: config.context, + plugin: config.plugin, + }; + const deployOptions = { + all: config.deploy?.all, + }; + const cliArguments: CliArguments = { + globalOptions, + deploy: deployOptions, + }; + + return cliArguments; + } " `); }); diff --git a/tools/@aws-cdk/cli-args-gen/test/cli-args-gen.test.ts b/tools/@aws-cdk/cli-args-gen/test/cli-args-gen.test.ts index 341931d53e8f8..3e1fa8e69305a 100644 --- a/tools/@aws-cdk/cli-args-gen/test/cli-args-gen.test.ts +++ b/tools/@aws-cdk/cli-args-gen/test/cli-args-gen.test.ts @@ -60,7 +60,7 @@ describe('render', () => { /** * The CLI command name */ - readonly _: Command; + readonly _?: Command; /** * Global options available to all CLI commands @@ -169,7 +169,7 @@ describe('render', () => { /** * The CLI command name */ - readonly _: Command; + readonly _?: Command; /** * Global options available to all CLI commands @@ -251,7 +251,7 @@ describe('render', () => { /** * The CLI command name */ - readonly _: Command; + readonly _?: Command; /** * Global options available to all CLI commands diff --git a/version.v2.json b/version.v2.json index f370a12f2e0cc..59ce09bc5156d 100644 --- a/version.v2.json +++ b/version.v2.json @@ -1,4 +1,4 @@ { - "version": "2.174.1", - "alphaVersion": "2.174.1-alpha.0" + "version": "2.175.0", + "alphaVersion": "2.175.0-alpha.0" } \ No newline at end of file