From 757290e18755c2e8092f4d2541a0fe9d1fdbda27 Mon Sep 17 00:00:00 2001 From: "Eric Z. Beard" Date: Tue, 26 May 2020 09:40:24 -0700 Subject: [PATCH 01/78] docs(contributing): Add note on global npm installs, change OpenJDK URL --- CONTRIBUTING.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ddd76ca329bbf..ad4328ebde45a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -77,7 +77,8 @@ you need to have the following SDKs and tools locally: - We recommend using a version in [Active LTS](https://nodejs.org/en/about/releases/) - ⚠️ versions `13.0.0` to `13.6.0` are not supported due to compatibility issues with our dependencies. - [Yarn >= 1.19.1](https://yarnpkg.com/lang/en/docs/install) -- [Java OpenJDK 8](http://openjdk.java.net/install/) +- [Java OpenJDK 8](https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/downloads-list.html) +- [Apache Maven](http://maven.apache.org/install.html) - [.NET Core SDK 3.1](https://www.microsoft.com/net/download) - [Python 3.6.5](https://www.python.org/downloads/release/python-365/) - [Ruby 2.5.1](https://www.ruby-lang.org/en/news/2018/03/28/ruby-2-5-1-released/) @@ -91,6 +92,13 @@ $ yarn install $ yarn build ``` +If you get compiler errors when building, a common cause is globally installed tools like tslint and typescript. Try uninstalling them. + +``` +npm uninstall -g tslint +npm uninstall -g typescript +``` + Alternatively, the [Full Docker build](#full-docker-build) workflow can be used so that you don't have to worry about installing all those tools on your local machine and instead only depend on having a working Docker install. @@ -197,7 +205,7 @@ Examples: ### Step 4: Commit -Create a commit with the proposed change changes: +Create a commit with the proposed changes: * Commit title and message (and PR title and description) must adhere to [conventionalcommits](https://www.conventionalcommits.org). * The title must begin with `feat(module): title`, `fix(module): title`, `refactor(module): title` or From b42de3b24396ac92d2f5728e37e4c4440de59296 Mon Sep 17 00:00:00 2001 From: "Eric Z. Beard" Date: Mon, 14 Sep 2020 15:33:18 -0700 Subject: [PATCH 02/78] Added missing package maturities --- packages/@aws-cdk/aws-apigatewayv2/package.json | 1 + packages/@aws-cdk/aws-cloudfront/package.json | 1 + packages/@aws-cdk/aws-cognito/package.json | 1 + 3 files changed, 3 insertions(+) diff --git a/packages/@aws-cdk/aws-apigatewayv2/package.json b/packages/@aws-cdk/aws-apigatewayv2/package.json index 5068cb8ede434..945cb89bb4586 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/package.json +++ b/packages/@aws-cdk/aws-apigatewayv2/package.json @@ -100,6 +100,7 @@ ] }, "stability": "experimental", + "maturity": "experimental", "features": [ { "name": "Higher level constructs for HTTP APIs", diff --git a/packages/@aws-cdk/aws-cloudfront/package.json b/packages/@aws-cdk/aws-cloudfront/package.json index f1a90c70944ba..c78093eac141f 100644 --- a/packages/@aws-cdk/aws-cloudfront/package.json +++ b/packages/@aws-cdk/aws-cloudfront/package.json @@ -95,6 +95,7 @@ "node": ">= 10.13.0 <13 || >=13.7.0" }, "stability": "experimental", + "maturity": "experimental", "features": [ { "name": "Higher level constructs for Distribution", diff --git a/packages/@aws-cdk/aws-cognito/package.json b/packages/@aws-cdk/aws-cognito/package.json index 0affaf0812b44..79edc01537c57 100644 --- a/packages/@aws-cdk/aws-cognito/package.json +++ b/packages/@aws-cdk/aws-cognito/package.json @@ -103,6 +103,7 @@ ] }, "stability": "experimental", + "maturity": "developer-preview", "features": [ { "name": "Higher level constructs for User Pools", From bd9977fe51ad049dc4034bfec4b825eca4c0af39 Mon Sep 17 00:00:00 2001 From: "Eric Z. Beard" Date: Wed, 14 Oct 2020 12:16:31 -0700 Subject: [PATCH 03/78] Change id to stack_id in Python init template --- .../%name.PythonModule%/%name.PythonModule%_stack.template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/aws-cdk/lib/init-templates/app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py b/packages/aws-cdk/lib/init-templates/app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py index adf164cd876c7..376b10b8e710f 100644 --- a/packages/aws-cdk/lib/init-templates/app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py +++ b/packages/aws-cdk/lib/init-templates/app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py @@ -3,7 +3,7 @@ class %name.PascalCased%Stack(core.Stack): - def __init__(self, scope: core.Construct, id: str, **kwargs) -> None: + def __init__(self, scope: core.Construct, stack_id: str, **kwargs) -> None: super().__init__(scope, id, **kwargs) # The code that defines your stack goes here From bdcf717295a7c4dbb512ec7ac26c6a893e39375c Mon Sep 17 00:00:00 2001 From: "Eric Z. Beard" Date: Tue, 20 Oct 2020 07:24:47 -0700 Subject: [PATCH 04/78] Change stack_id to construct_id --- .../%name.PythonModule%/%name.PythonModule%_stack.template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/aws-cdk/lib/init-templates/app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py b/packages/aws-cdk/lib/init-templates/app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py index 376b10b8e710f..cfd42d316ba4d 100644 --- a/packages/aws-cdk/lib/init-templates/app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py +++ b/packages/aws-cdk/lib/init-templates/app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py @@ -3,7 +3,7 @@ class %name.PascalCased%Stack(core.Stack): - def __init__(self, scope: core.Construct, stack_id: str, **kwargs) -> None: + def __init__(self, scope: core.Construct, construct_id: str, **kwargs) -> None: super().__init__(scope, id, **kwargs) # The code that defines your stack goes here From d14f860d01c45f9e2d37c439b50f70657b217eac Mon Sep 17 00:00:00 2001 From: "Eric Z. Beard" Date: Tue, 20 Oct 2020 07:27:12 -0700 Subject: [PATCH 05/78] Change id to construct_id in Python sample-app --- .../%name.PythonModule%/%name.PythonModule%_stack.template.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/aws-cdk/lib/init-templates/sample-app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py b/packages/aws-cdk/lib/init-templates/sample-app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py index 910a4b838c933..c20594882b8c0 100644 --- a/packages/aws-cdk/lib/init-templates/sample-app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py +++ b/packages/aws-cdk/lib/init-templates/sample-app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py @@ -7,9 +7,9 @@ ) -class %name.PascalCased%Stack(core.Stack): +class % name.PascalCased % Stack(core.Stack): - def __init__(self, scope: core.Construct, id: str, **kwargs) -> None: + def __init__(self, scope: core.Construct, construct_id: str, **kwargs) -> None: super().__init__(scope, id, **kwargs) queue = sqs.Queue( From 1907b58c5d589f943b967024e00e5fd9f5ee2192 Mon Sep 17 00:00:00 2001 From: "Eric Z. Beard" Date: Tue, 20 Oct 2020 07:28:23 -0700 Subject: [PATCH 06/78] Fix construct_id --- .../%name.PythonModule%/%name.PythonModule%_stack.template.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/aws-cdk/lib/init-templates/app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py b/packages/aws-cdk/lib/init-templates/app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py index cfd42d316ba4d..2ef0850e4a972 100644 --- a/packages/aws-cdk/lib/init-templates/app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py +++ b/packages/aws-cdk/lib/init-templates/app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py @@ -1,9 +1,9 @@ from aws_cdk import core -class %name.PascalCased%Stack(core.Stack): +class % name.PascalCased % Stack(core.Stack): def __init__(self, scope: core.Construct, construct_id: str, **kwargs) -> None: - super().__init__(scope, id, **kwargs) + super().__init__(scope, construct_id, **kwargs) # The code that defines your stack goes here From 0f856e99bb4e7938a9c80c17b29e8d72ec64169c Mon Sep 17 00:00:00 2001 From: "Eric Z. Beard" Date: Fri, 23 Oct 2020 09:47:24 -0700 Subject: [PATCH 07/78] Fix super with construct_id --- .../%name.PythonModule%/%name.PythonModule%_stack.template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/aws-cdk/lib/init-templates/sample-app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py b/packages/aws-cdk/lib/init-templates/sample-app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py index c20594882b8c0..0b8597b0b6c8a 100644 --- a/packages/aws-cdk/lib/init-templates/sample-app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py +++ b/packages/aws-cdk/lib/init-templates/sample-app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py @@ -10,7 +10,7 @@ class % name.PascalCased % Stack(core.Stack): def __init__(self, scope: core.Construct, construct_id: str, **kwargs) -> None: - super().__init__(scope, id, **kwargs) + super().__init__(scope, construct_id, **kwargs) queue = sqs.Queue( self, "%name.PascalCased%Queue", From 884be45f969f3ac98e5d3c49e5c6019f6def1e2d Mon Sep 17 00:00:00 2001 From: "Eric Z. Beard" Date: Mon, 26 Oct 2020 15:48:29 -0700 Subject: [PATCH 08/78] Fix broken init templates --- .../%name.PythonModule%/%name.PythonModule%_stack.template.py | 2 +- .../%name.PythonModule%/%name.PythonModule%_stack.template.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/aws-cdk/lib/init-templates/app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py b/packages/aws-cdk/lib/init-templates/app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py index 2ef0850e4a972..c8d1e9f923221 100644 --- a/packages/aws-cdk/lib/init-templates/app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py +++ b/packages/aws-cdk/lib/init-templates/app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py @@ -1,7 +1,7 @@ from aws_cdk import core -class % name.PascalCased % Stack(core.Stack): +class %name.PascalCased% Stack(core.Stack): def __init__(self, scope: core.Construct, construct_id: str, **kwargs) -> None: super().__init__(scope, construct_id, **kwargs) diff --git a/packages/aws-cdk/lib/init-templates/sample-app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py b/packages/aws-cdk/lib/init-templates/sample-app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py index 0b8597b0b6c8a..44167db50d7df 100644 --- a/packages/aws-cdk/lib/init-templates/sample-app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py +++ b/packages/aws-cdk/lib/init-templates/sample-app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py @@ -7,7 +7,7 @@ ) -class % name.PascalCased % Stack(core.Stack): +class %name.PascalCased% Stack(core.Stack): def __init__(self, scope: core.Construct, construct_id: str, **kwargs) -> None: super().__init__(scope, construct_id, **kwargs) From 5f1790e9add08778fe29277a783c2f82b1e445c3 Mon Sep 17 00:00:00 2001 From: "Eric Z. Beard" Date: Mon, 26 Oct 2020 15:57:36 -0700 Subject: [PATCH 09/78] Fix init templates --- .../%name.PythonModule%/%name.PythonModule%_stack.template.py | 2 +- .../%name.PythonModule%/%name.PythonModule%_stack.template.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/aws-cdk/lib/init-templates/app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py b/packages/aws-cdk/lib/init-templates/app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py index c8d1e9f923221..9d86ad16906e6 100644 --- a/packages/aws-cdk/lib/init-templates/app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py +++ b/packages/aws-cdk/lib/init-templates/app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py @@ -1,7 +1,7 @@ from aws_cdk import core -class %name.PascalCased% Stack(core.Stack): +class %name.PascalCased%Stack(core.Stack): def __init__(self, scope: core.Construct, construct_id: str, **kwargs) -> None: super().__init__(scope, construct_id, **kwargs) diff --git a/packages/aws-cdk/lib/init-templates/sample-app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py b/packages/aws-cdk/lib/init-templates/sample-app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py index 44167db50d7df..ace9c193df291 100644 --- a/packages/aws-cdk/lib/init-templates/sample-app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py +++ b/packages/aws-cdk/lib/init-templates/sample-app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py @@ -7,7 +7,7 @@ ) -class %name.PascalCased% Stack(core.Stack): +class %name.PascalCased%Stack(core.Stack): def __init__(self, scope: core.Construct, construct_id: str, **kwargs) -> None: super().__init__(scope, construct_id, **kwargs) From 5ba87595cc999e7a92c6e11728b42161dd5caa29 Mon Sep 17 00:00:00 2001 From: "Eric Z. Beard" Date: Thu, 4 Feb 2021 09:57:54 -0800 Subject: [PATCH 10/78] ownership changes --- .github/workflows/issue-label-assign.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/issue-label-assign.yml b/.github/workflows/issue-label-assign.yml index 9e2f2ce7e3e34..8074ea68c3ee3 100644 --- a/.github/workflows/issue-label-assign.yml +++ b/.github/workflows/issue-label-assign.yml @@ -54,8 +54,8 @@ jobs: {"keywords":["(@aws-cdk/aws-cloudfront)","(aws-cloudfront)","(cloudfront)","(cloud front)"],"labels":["@aws-cdk/aws-cloudfront"],"assignees":["njlynch"]}, {"keywords":["(@aws-cdk/aws-cloudfront-origins)","(aws-cloudfront-origins)","(cloudfront-origins)","(cloudfront origins)"],"labels":["@aws-cdk/aws-cloudfront-origins"],"assignees":["njlynch"]}, {"keywords":["(@aws-cdk/aws-cloudtrail)","(aws-cloudtrail)","(cloudtrail)","(cloud trail)"],"labels":["@aws-cdk/aws-cloudtrail"],"assignees":["NetaNir"]}, - {"keywords":["(@aws-cdk/aws-cloudwatch)","(aws-cloudwatch)","(cloudwatch)","(cloud watch)"],"labels":["@aws-cdk/aws-cloudwatch"],"assignees":["rix0rrr"]}, - {"keywords":["(@aws-cdk/aws-cloudwatch-actions)","(aws-cloudwatch-actions)","(cloudwatch-actions)","(cloudwatch actions)"],"labels":["@aws-cdk/aws-cloudwatch-actions"],"assignees":["rix0rrr"]}, + {"keywords":["(@aws-cdk/aws-cloudwatch)","(aws-cloudwatch)","(cloudwatch)","(cloud watch)"],"labels":["@aws-cdk/aws-cloudwatch"],"assignees":["NetaNir"]}, + {"keywords":["(@aws-cdk/aws-cloudwatch-actions)","(aws-cloudwatch-actions)","(cloudwatch-actions)","(cloudwatch actions)"],"labels":["@aws-cdk/aws-cloudwatch-actions"],"assignees":["NetaNir"]}, {"keywords":["(@aws-cdk/aws-codeartifact)","(aws-codeartifact)","(codeartifact)","(code artifact)","(code-artifact)"],"labels":["@aws-cdk/aws-codeartifact"],"assignees":["njlynch"]}, {"keywords":["(@aws-cdk/aws-codebuild)","(aws-codebuild)","(codebuild)","(code build)","(code-build)"],"labels":["@aws-cdk/aws-codebuild"],"assignees":["skinny85"]}, {"keywords":["(@aws-cdk/aws-codecommit)","(aws-codecommit)","(codecommit)","(code commit)", "(code-commit)"],"labels":["@aws-cdk/aws-codecommit"],"assignees":["skinny85"]}, @@ -76,8 +76,8 @@ jobs: {"keywords":["(@aws-cdk/aws-dlm)","(aws-dlm)","(dlm)"],"labels":["@aws-cdk/aws-dlm"],"assignees":["njlynch"]}, {"keywords":["(@aws-cdk/aws-dms)","(aws-dms)","(dms)"],"labels":["@aws-cdk/aws-dms"],"assignees":["njlynch"]}, {"keywords":["(@aws-cdk/aws-docdb)","(aws-docdb)","(docdb)","(doc db)","(doc-db)"],"labels":["@aws-cdk/aws-docdb"],"assignees":["iliapolo"]}, - {"keywords":["(@aws-cdk/aws-dynamodb)","(aws-dynamodb)","(dynamodb)","(dynamo db)","(dynamo-db)"],"labels":["@aws-cdk/aws-dynamodb"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-dynamodb-global)","(aws-dynamodb-global)","(dynamodb-global)","(dynamodb global)"],"labels":["@aws-cdk/aws-dynamodb-global"],"assignees":["skinny85"]}, + {"keywords":["(@aws-cdk/aws-dynamodb)","(aws-dynamodb)","(dynamodb)","(dynamo db)","(dynamo-db)"],"labels":["@aws-cdk/aws-dynamodb"],"assignees":["RomainMuller"]}, + {"keywords":["(@aws-cdk/aws-dynamodb-global)","(aws-dynamodb-global)","(dynamodb-global)","(dynamodb global)"],"labels":["@aws-cdk/aws-dynamodb-global"],"assignees":["RomainMuller"]}, {"keywords":["(@aws-cdk/aws-ec2)","(aws-ec2)","(ec2)","(vpc)"],"labels":["@aws-cdk/aws-ec2"],"assignees":["rix0rrr"]}, {"keywords":["(@aws-cdk/aws-ecr)","(aws-ecr)","(ecr)"],"labels":["@aws-cdk/aws-ecr"],"assignees":["MrArnoldPalmer"]}, {"keywords":["(@aws-cdk/aws-ecr-assets)","(aws-ecr-assets)","(ecr-assets)","(ecr assets)","(ecrassets)"],"labels":["@aws-cdk/aws-ecr-assets"],"assignees":["eladb"]}, From 0f728cef6c6a03e42a10db5ac45ddf55304563e4 Mon Sep 17 00:00:00 2001 From: AWS CDK Automation <43080478+aws-cdk-automation@users.noreply.github.com> Date: Tue, 23 Feb 2021 13:14:17 +0200 Subject: [PATCH 11/78] chore(release): 1.91.0 (#13211) See [CHANGELOG](https://github.com/aws/aws-cdk/blob/bump/1.91.0/CHANGELOG.md) --- .dependabot/config.yml | 19 - .github/dependabot.yml | 13 + .github/workflows/auto-approve-dependabot.yml | 27 - .github/workflows/auto-approve.yml | 15 + .github/workflows/v2-pull-request.yml | 12 - .github/workflows/yarn-upgrade.yml | 4 +- CHANGELOG.md | 29 + CONTRIBUTING.md | 64 +- package.json | 2 +- .../test/integ.assign-public-ip.expected.json | 26 +- .../integ.imported-environment.expected.json | 4 +- .../test/integ.cicd.expected.json | 4 +- packages/@aws-cdk/aws-apigateway/package.json | 4 +- .../integ.cognito-authorizer.expected.json | 4 +- .../integ.restapi-import.lit.expected.json | 12 +- .../test/http/integ.user-pool.expected.json | 4 +- packages/@aws-cdk/aws-appsync/README.md | 14 +- .../@aws-cdk/aws-appsync/lib/data-source.ts | 25 +- .../aws-appsync/lib/graphqlapi-base.ts | 21 +- .../aws-appsync/test/appsync-rds.test.ts | 62 +- .../@aws-cdk/aws-appsync/test/appsync.test.ts | 3 +- .../test/integ.api-import.expected.json | 4 +- .../test/integ.auth-apikey.expected.json | 4 +- .../test/integ.graphql-iam.expected.json | 22 +- .../test/integ.graphql.expected.json | 446 ++--- .../test/integ.backup.expected.json | 4 +- .../@aws-cdk/aws-backup/test/integ.backup.ts | 3 +- .../aws-backup/test/selection.test.ts | 5 +- .../test/integ.nested-stack.expected.json | 12 +- .../integ.nested-stacks-assets.expected.json | 42 +- ...teg.nested-stacks-multi-refs.expected.json | 42 +- .../integ.nested-stacks-multi.expected.json | 22 +- ...cks-nested-export-to-sibling.expected.json | 4 +- .../integ.nested-stacks-refs1.expected.json | 4 +- .../integ.nested-stacks-refs2.expected.json | 4 +- .../integ.nested-stacks-refs3.expected.json | 8 +- .../test/test.nested-stack.ts | 13 +- .../aws-cloudfront-origins/package.json | 2 +- packages/@aws-cdk/aws-cloudfront/package.json | 2 +- packages/@aws-cdk/aws-cloudtrail/package.json | 2 +- packages/@aws-cdk/aws-codebuild/package.json | 2 +- .../test/integ.caching.expected.json | 4 +- ....project-buildspec-artifacts.expected.json | 4 +- .../test/integ.project-logging.expected.json | 4 +- ...-secondary-sources-artifacts.expected.json | 4 +- packages/@aws-cdk/aws-codecommit/package.json | 2 +- .../aws-codepipeline-actions/package.json | 2 +- ...g.cfn-template-from-repo.lit.expected.json | 4 +- ...yed-through-codepipeline.lit.expected.json | 10 +- .../test/integ.lambda-pipeline.expected.json | 4 +- .../integ.pipeline-alexa-deploy.expected.json | 4 +- ...eg.pipeline-cfn-cross-region.expected.json | 6 +- ...ipeline-cfn-with-action-role.expected.json | 6 +- .../test/integ.pipeline-cfn.expected.json | 6 +- ...eg.pipeline-code-build-batch.expected.json | 2 +- ...uild-multiple-inputs-outputs.expected.json | 6 +- ...g.pipeline-code-commit-build.expected.json | 6 +- .../integ.pipeline-code-commit.expected.json | 4 +- ...teg.pipeline-code-deploy-ecs.expected.json | 6 +- .../integ.pipeline-code-deploy.expected.json | 6 +- .../integ.pipeline-ecr-source.expected.json | 6 +- .../integ.pipeline-ecs-deploy.expected.json | 8 +- ...line-ecs-separate-source.lit.expected.json | 8 +- .../test/integ.pipeline-events.expected.json | 6 +- .../test/integ.pipeline-jenkins.expected.json | 6 +- ...teg.pipeline-manual-approval.expected.json | 6 +- .../integ.pipeline-s3-deploy.expected.json | 8 +- ...integ.pipeline-stepfunctions.expected.json | 4 +- .../@aws-cdk/aws-cognito/lib/user-pool.ts | 10 +- ...r-pool-client-explicit-props.expected.json | 26 +- .../integ.user-pool-client-explicit-props.ts | 6 +- ...nteg.user-pool-domain-cfdist.expected.json | 68 +- .../test/integ.user-pool-domain-cfdist.ts | 6 +- ...g.user-pool-domain-signinurl.expected.json | 4 +- .../test/integ.user-pool-domain-signinurl.ts | 6 +- ...teg.user-pool-explicit-props.expected.json | 64 +- .../test/integ.user-pool-explicit-props.ts | 3 +- .../integ.user-pool-idp.amazon.expected.json | 4 +- .../test/integ.user-pool-idp.amazon.ts | 6 +- .../integ.user-pool-idp.google.expected.json | 4 +- .../test/integ.user-pool-idp.google.ts | 6 +- ...eg.user-pool-resource-server.expected.json | 4 +- .../test/integ.user-pool-resource-server.ts | 3 +- .../integ.user-pool-signup-code.expected.json | 4 +- .../test/integ.user-pool-signup-code.ts | 3 +- .../integ.user-pool-signup-link.expected.json | 4 +- .../test/integ.user-pool-signup-link.ts | 3 +- .../test/integ.user-pool.expected.json | 4 +- .../aws-cognito/test/integ.user-pool.ts | 3 +- .../aws-cognito/test/user-pool.test.ts | 6 +- packages/@aws-cdk/aws-docdb/lib/endpoint.ts | 2 +- packages/@aws-cdk/aws-dynamodb/package.json | 2 +- .../aws-dynamodb/test/dynamodb.test.ts | 27 +- ....global-replicas-provisioned.expected.json | 4 +- .../test/integ.global.expected.json | 62 +- packages/@aws-cdk/aws-ec2/lib/volume.ts | 10 +- packages/@aws-cdk/aws-ec2/test/volume.test.ts | 4 +- .../integ.nested-stacks-docker.expected.json | 6 +- packages/@aws-cdk/aws-ecs-patterns/README.md | 13 +- .../queue-processing-fargate-service.ts | 10 + ...ing-fargate-service-isolated.expected.json | 8 +- ...ssing-fargate-service-public.expected.json | 1004 +++++++++++ ...queue-processing-fargate-service-public.ts | 19 + ...e-processing-fargate-service.expected.json | 8 +- .../test.queue-processing-fargate-service.ts | 45 +- packages/@aws-cdk/aws-ecs/.gitignore | 3 +- packages/@aws-cdk/aws-ecs/.npmignore | 3 +- packages/@aws-cdk/aws-ecs/jest.config.js | 2 + packages/@aws-cdk/aws-ecs/package.json | 3 +- ...s => app-mesh-proxy-configuration.test.ts} | 6 +- ...s-log-driver.ts => aws-log-driver.test.ts} | 6 +- ...nition.ts => container-definition.test.ts} | 520 +++--- ...est.cross-stack.ts => cross-stack.test.ts} | 6 +- ...est.ec2-service.ts => ec2-service.test.ts} | 6 +- ...inition.ts => ec2-task-definition.test.ts} | 285 ++- .../ec2/integ.environment-file.expected.json | 4 +- ...est.ecs-cluster.ts => ecs-cluster.test.ts} | 6 +- ...nment-file.ts => environment-file.test.ts} | 6 +- ...ate-service.ts => fargate-service.test.ts} | 6 +- ...ion.ts => fargate-task-definition.test.ts} | 6 +- ...-driver.ts => firelens-log-driver.test.ts} | 6 +- ...g-driver.ts => fluentd-log-driver.test.ts} | 6 +- ...-log-driver.ts => gelf-log-driver.test.ts} | 6 +- ... => tag-parameter-container-image.test.ts} | 6 +- ...-driver.ts => journald-log-driver.test.ts} | 6 +- ...driver.ts => json-file-log-driver.test.ts} | 6 +- ...og-driver.ts => splunk-log-driver.test.ts} | 6 +- ...og-driver.ts => syslog-log-driver.test.ts} | 6 +- ...-definition.ts => task-definition.test.ts} | 6 +- packages/@aws-cdk/aws-eks/README.md | 4 +- .../@aws-cdk/aws-eks/lib/cluster-resource.ts | 26 +- .../@aws-cdk/aws-eks/lib/kubectl-provider.ts | 1 + packages/@aws-cdk/aws-eks/package.json | 2 +- ...teg.eks-cluster-handlers-vpc.expected.json | 123 +- ...eks-cluster-private-endpoint.expected.json | 63 +- .../test/integ.eks-cluster.expected.json | 65 +- .../test/integ.fargate-cluster.expected.json | 63 +- .../@aws-cdk/aws-eks/test/test.cluster.ts | 97 +- .../@aws-cdk/aws-eks/test/test.fargate.ts | 42 +- .../test/integ.cognito.lit.expected.json | 24 +- .../@aws-cdk/aws-elasticsearch/lib/domain.ts | 8 + .../aws-elasticsearch/test/domain.test.ts | 10 + ...asticsearch.advancedsecurity.expected.json | 4 +- .../integ.elasticsearch.advancedsecurity.ts | 3 +- ...elasticsearch.custom-kms-key.expected.json | 6 +- .../integ.elasticsearch.custom-kms-key.ts | 3 +- .../test/integ.elasticsearch.expected.json | 10 +- .../test/integ.elasticsearch.ts | 3 +- ...nteg.elasticsearch.ultrawarm.expected.json | 4 +- .../test/integ.elasticsearch.ultrawarm.ts | 3 +- ...sticsearch.unsignedbasicauth.expected.json | 6 +- .../integ.elasticsearch.unsignedbasicauth.ts | 3 +- .../@aws-cdk/aws-events-targets/package.json | 2 +- .../integ.project-events.expected.json | 6 +- .../integ.pipeline-event-target.expected.json | 2 +- ...nteg.kinesis-firehose-stream.expected.json | 4 +- .../integ.sns-event-rule-target.expected.json | 4 +- .../integ.sqs-event-rule-target.expected.json | 4 +- packages/@aws-cdk/aws-fsx/lib/file-system.ts | 9 +- .../aws-fsx/lib/lustre-file-system.ts | 1 + .../integ.lustre-file-system.expected.json | 4 +- .../aws-fsx/test/integ.lustre-file-system.ts | 3 +- .../aws-fsx/test/lustre-file-system.test.ts | 6 +- .../aws-glue/test/integ.table.expected.json | 6 +- packages/@aws-cdk/aws-kms/lib/key.ts | 10 +- .../test/integ.destinations.expected.json | 10 +- .../test/integ.kinesiswithdlq.expected.json | 18 +- .../test/integ.sqs.expected.json | 16 +- packages/@aws-cdk/aws-lambda-nodejs/README.md | 12 +- .../@aws-cdk/aws-lambda-nodejs/package.json | 2 +- packages/@aws-cdk/aws-lambda/package.json | 2 +- packages/@aws-cdk/aws-logs/package.json | 2 +- packages/@aws-cdk/aws-rds/lib/cluster.ts | 20 +- packages/@aws-cdk/aws-rds/lib/instance.ts | 10 +- packages/@aws-cdk/aws-rds/lib/private/util.ts | 38 +- .../aws-rds/lib/serverless-cluster.ts | 4 +- .../@aws-cdk/aws-rds/test/cluster.test.ts | 44 +- .../test/database-secretmanager.test.ts | 4 +- .../@aws-cdk/aws-rds/test/instance.test.ts | 29 +- .../integ.cluster-rotation.lit.expected.json | 11 +- .../test/integ.cluster-s3.expected.json | 15 +- .../aws-rds/test/integ.cluster.expected.json | 13 +- ...ance-from-generated-password.expected.json | 3 +- .../test/integ.instance-s3.expected.json | 4 +- .../test/integ.instance.lit.expected.json | 11 +- .../aws-rds/test/integ.proxy.expected.json | 3 +- .../integ.serverless-cluster.expected.json | 3 +- .../aws-rds/test/serverless-cluster.test.ts | 6 +- packages/@aws-cdk/aws-route53/package.json | 2 +- packages/@aws-cdk/aws-s3-deployment/README.md | 29 +- ...bucket-deployment-cloudfront.expected.json | 4 +- .../integ.bucket-deployment.expected.json | 8 +- .../integ.bucket-notifications.expected.json | 8 +- packages/@aws-cdk/aws-s3/lib/bucket.ts | 4 +- packages/@aws-cdk/aws-s3/test/bucket.test.ts | 2 +- .../integ.bucket-sharing.lit.expected.json | 4 +- .../aws-s3/test/integ.bucket.expected.json | 4 +- .../test/integ.sns-lambda.expected.json | 8 +- .../test/integ.sns-sqs.lit.expected.json | 8 +- .../aws-sns-subscriptions/test/subs.test.ts | 10 + packages/@aws-cdk/aws-sqs/lib/queue.ts | 15 +- packages/@aws-cdk/aws-sqs/package.json | 2 +- .../aws-sqs/test/integ.sqs.expected.json | 12 +- packages/@aws-cdk/aws-sqs/test/test.sqs.ts | 22 +- .../aws-stepfunctions-tasks/README.md | 37 +- .../aws-stepfunctions-tasks/lib/eks/call.ts | 137 ++ .../aws-stepfunctions-tasks/lib/index.ts | 1 + .../aws-stepfunctions-tasks/package.json | 2 + .../test/eks/call.test.ts | 234 +++ .../test/eks/integ.call.expected.json | 1580 +++++++++++++++++ .../test/eks/integ.call.ts | 52 + .../integ.call-sagemaker.expected.json | 2 +- .../integ.create-training-job.expected.json | 2 +- .../test/sns/integ.publish.expected.json | 16 +- .../test/sqs/integ.send-message.expected.json | 16 +- packages/@aws-cdk/aws-synthetics/README.md | 8 +- .../@aws-cdk/aws-synthetics/lib/canary.ts | 10 + .../aws-synthetics/test/canary.test.ts | 4 +- packages/@aws-cdk/cfnspec/CHANGELOG.md | 80 + .../@aws-cdk/cfnspec/build-tools/build.ts | 59 +- .../cfnspec/build-tools/update-cfnlint.sh | 18 + packages/@aws-cdk/cfnspec/cfn.version | 2 +- .../cfnspec/lib/_private_schema/cfn-lint.ts | 23 + packages/@aws-cdk/cfnspec/lib/index.ts | 14 + .../@aws-cdk/cfnspec/lib/schema/cfn-lint.ts | 14 + packages/@aws-cdk/cfnspec/lib/schema/index.ts | 1 + packages/@aws-cdk/cfnspec/package.json | 2 +- ...0_CloudFormationResourceSpecification.json | 1489 +++++++++++++++- .../cfn-lint/StatefulResources/000.json | 30 + .../cfnspec/test/test.cfnlint-annotations.ts | 28 + .../cloudformation-diff/lib/diffable.ts | 4 +- .../lib/iam/iam-changes.ts | 61 +- .../lib/iam/managed-policy.ts | 20 +- .../cloudformation-diff/lib/iam/statement.ts | 101 +- .../test/iam/detect-changes.test.ts | 109 +- packages/@aws-cdk/core/lib/cfn-resource.ts | 8 +- .../@aws-cdk/core/lib/construct-compat.ts | 7 + packages/@aws-cdk/core/lib/nested-stack.ts | 13 + .../@aws-cdk/core/lib/private/synthesis.ts | 11 +- packages/@aws-cdk/core/lib/removal-policy.ts | 25 + packages/@aws-cdk/core/lib/resource.ts | 44 +- packages/@aws-cdk/core/package.json | 4 +- packages/@aws-cdk/core/test/stack.test.ts | 18 + .../lib/provider-framework/provider.ts | 13 + .../@aws-cdk/custom-resources/package.json | 2 +- .../test/provider-framework/provider.test.ts | 69 + packages/@aws-cdk/cx-api/lib/features.ts | 2 +- .../integ.pipeline-with-assets.expected.json | 4 +- .../test/integ.pipeline.expected.json | 4 +- .../@monocdk-experiment/assert/package.json | 2 +- .../rewrite-imports/package.json | 2 +- packages/aws-cdk-lib/package.json | 2 +- packages/aws-cdk/lib/init.ts | 7 +- packages/aws-cdk/package.json | 6 +- packages/aws-cdk/test/init.test.ts | 9 +- packages/cdk-assets/package.json | 4 +- .../test/__snapshots__/synth.test.js.snap | 10 +- packages/decdk/test/fixture/tsconfig.json | 7 +- packages/decdk/test/synth.test.ts | 6 +- packages/monocdk/package.json | 2 +- tools/cdk-integ-tools/lib/integ-helpers.ts | 6 +- tools/cfn2ts/lib/codegen.ts | 46 +- tools/eslint-plugin-cdk/package.json | 2 +- tools/nodeunit-shim/package.json | 2 +- tools/yarn-cling/package.json | 2 +- version.v1.json | 2 +- yarn.lock | 365 ++-- 267 files changed, 7476 insertions(+), 1992 deletions(-) delete mode 100644 .dependabot/config.yml create mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/auto-approve-dependabot.yml create mode 100644 .github/workflows/auto-approve.yml create mode 100644 packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.queue-processing-fargate-service-public.expected.json create mode 100644 packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.queue-processing-fargate-service-public.ts create mode 100644 packages/@aws-cdk/aws-ecs/jest.config.js rename packages/@aws-cdk/aws-ecs/test/{test.app-mesh-proxy-configuration.ts => app-mesh-proxy-configuration.test.ts} (98%) rename packages/@aws-cdk/aws-ecs/test/{test.aws-log-driver.ts => aws-log-driver.test.ts} (98%) rename packages/@aws-cdk/aws-ecs/test/{test.container-definition.ts => container-definition.test.ts} (82%) rename packages/@aws-cdk/aws-ecs/test/ec2/{test.cross-stack.ts => cross-stack.test.ts} (97%) rename packages/@aws-cdk/aws-ecs/test/ec2/{test.ec2-service.ts => ec2-service.test.ts} (99%) rename packages/@aws-cdk/aws-ecs/test/ec2/{test.ec2-task-definition.ts => ec2-task-definition.test.ts} (84%) rename packages/@aws-cdk/aws-ecs/test/{test.ecs-cluster.ts => ecs-cluster.test.ts} (99%) rename packages/@aws-cdk/aws-ecs/test/{test.environment-file.ts => environment-file.test.ts} (96%) rename packages/@aws-cdk/aws-ecs/test/fargate/{test.fargate-service.ts => fargate-service.test.ts} (99%) rename packages/@aws-cdk/aws-ecs/test/fargate/{test.fargate-task-definition.ts => fargate-task-definition.test.ts} (97%) rename packages/@aws-cdk/aws-ecs/test/{test.firelens-log-driver.ts => firelens-log-driver.test.ts} (98%) rename packages/@aws-cdk/aws-ecs/test/{test.fluentd-log-driver.ts => fluentd-log-driver.test.ts} (97%) rename packages/@aws-cdk/aws-ecs/test/{test.gelf-log-driver.ts => gelf-log-driver.test.ts} (95%) rename packages/@aws-cdk/aws-ecs/test/images/{test.tag-parameter-container-image.ts => tag-parameter-container-image.test.ts} (91%) rename packages/@aws-cdk/aws-ecs/test/{test.journald-log-driver.ts => journald-log-driver.test.ts} (96%) rename packages/@aws-cdk/aws-ecs/test/{test.json-file-log-driver.ts => json-file-log-driver.test.ts} (96%) rename packages/@aws-cdk/aws-ecs/test/{test.splunk-log-driver.ts => splunk-log-driver.test.ts} (97%) rename packages/@aws-cdk/aws-ecs/test/{test.syslog-log-driver.ts => syslog-log-driver.test.ts} (96%) rename packages/@aws-cdk/aws-ecs/test/{test.task-definition.ts => task-definition.test.ts} (88%) create mode 100644 packages/@aws-cdk/aws-stepfunctions-tasks/lib/eks/call.ts create mode 100644 packages/@aws-cdk/aws-stepfunctions-tasks/test/eks/call.test.ts create mode 100644 packages/@aws-cdk/aws-stepfunctions-tasks/test/eks/integ.call.expected.json create mode 100644 packages/@aws-cdk/aws-stepfunctions-tasks/test/eks/integ.call.ts create mode 100755 packages/@aws-cdk/cfnspec/build-tools/update-cfnlint.sh create mode 100644 packages/@aws-cdk/cfnspec/lib/_private_schema/cfn-lint.ts create mode 100644 packages/@aws-cdk/cfnspec/lib/schema/cfn-lint.ts create mode 100644 packages/@aws-cdk/cfnspec/spec-source/cfn-lint/StatefulResources/000.json create mode 100644 packages/@aws-cdk/cfnspec/test/test.cfnlint-annotations.ts diff --git a/.dependabot/config.yml b/.dependabot/config.yml deleted file mode 100644 index c54ea38a24f81..0000000000000 --- a/.dependabot/config.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -# See: https://dependabot.com/docs/config-file/ -version: 1 -update_configs: - # Dependabot will detect the lerna mono-repo and discover packages in there - - directory: / - package_manager: javascript - update_schedule: live - version_requirement_updates: increase_versions - ignored_updates: - - match: - dependency_name: "jsii*" - - match: - dependency_name: "@jsii/*" - - match: - dependency_name: "codemaker" - - match: - dependency_name: "@types/node" - version_requirement: ">=11.0.0-0" diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000000..1d4633809b73b --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +# Reference: https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates +# NOTE: dependabot only takes care of updating non-npm deps +# npm dependencies are updated through the "yarn-upgrade" github workflow. + +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + labels: + - "pr/auto-approve" + open-pull-requests-limit: 5 diff --git a/.github/workflows/auto-approve-dependabot.yml b/.github/workflows/auto-approve-dependabot.yml deleted file mode 100644 index 5eb14a05c1890..0000000000000 --- a/.github/workflows/auto-approve-dependabot.yml +++ /dev/null @@ -1,27 +0,0 @@ -# Automatically approve PRs made by Dependabot -# -# Written to look at the original author of the PR (instead of the current -# actor) in order to be able to backresolve existing PRs using this action (by -# mass labeling them). Leads to slightly unnecessary spammage of aprovals in a -# PR... -# -# Only does approvals! A different GitHub Action takes care of merging. -name: Auto-approve Dependabot -on: - pull_request: - types: - - labeled - - opened - - ready_for_review - - reopened - - synchronize - - unlabeled - - unlocked -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: hmarr/auto-approve-action@7782c7e2bdf62b4d79bdcded8332808fd2f179cd - if: github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'dependabot-preview[bot]' - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml new file mode 100644 index 0000000000000..d36f6255bbc7d --- /dev/null +++ b/.github/workflows/auto-approve.yml @@ -0,0 +1,15 @@ +# Approve PRs with "pr/auto-approve". mergify takes care of the actual merge. + +name: auto-approve +on: pull_request + +jobs: + auto-approve: + if: > + contains(github.event.pull_request.labels.*.name, 'pr/auto-approve') && + contains(['aws-cdk-automation', 'dependabot[bot]', 'dependabot-preview[bot]'], github.event.pull_request.user.login) + runs-on: ubuntu-latest + steps: + - uses: hmarr/auto-approve-action@v2.0.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/v2-pull-request.yml b/.github/workflows/v2-pull-request.yml index c4118d3298a00..e820647947705 100644 --- a/.github/workflows/v2-pull-request.yml +++ b/.github/workflows/v2-pull-request.yml @@ -32,15 +32,3 @@ jobs: uses: stefanzweifel/git-auto-commit-action@v4 with: commit_message: 'automatic pkglint fixes' - - # Approve automated PRs - # Only approve! mergify takes care of the actual merge. - auto-approve: - if: > - github.event.pull_request.user.login == 'aws-cdk-automation' - && contains(github.event.pull_request.labels.*.name, 'pr/auto-approve') - runs-on: ubuntu-latest - steps: - - uses: hmarr/auto-approve-action@v2.0.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/yarn-upgrade.yml b/.github/workflows/yarn-upgrade.yml index 6734719a67184..17617a75537d3 100644 --- a/.github/workflows/yarn-upgrade.yml +++ b/.github/workflows/yarn-upgrade.yml @@ -25,7 +25,7 @@ jobs: run: echo "::set-output name=dir::$(yarn cache dir)" - name: Restore Yarn cache - uses: actions/cache@v2 + uses: actions/cache@v2.1.4 with: path: ${{ steps.yarn-cache.outputs.dir }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} @@ -74,7 +74,7 @@ jobs: title: 'chore: npm-check-updates && yarn upgrade' body: |- Ran npm-check-updates and yarn upgrade to keep the `yarn.lock` file up-to-date. - labels: contribution/core,dependencies + labels: contribution/core,dependencies,pr/auto-approve team-reviewers: aws-cdk-team # Privileged token so automated PR validation happens token: ${{ secrets.AUTOMATION_GITHUB_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index f8f6aec305888..ce9e72a3d6855 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,35 @@ 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. +## [1.91.0](https://github.com/aws/aws-cdk/compare/v1.90.1...v1.91.0) (2021-02-23) + + +### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES + +* **aws-appsync:** RdsDataSource now takes a ServerlessCluster instead of a DatabaseCluster +* **aws-appsync:** graphqlapi.addRdsDataSource now takes databaseName as its fourth argument + +### Features + +* **aws-appsync:** add databaseName to rdsDataSource ([#12575](https://github.com/aws/aws-cdk/issues/12575)) ([f92b65e](https://github.com/aws/aws-cdk/commit/f92b65e2a158f918d8f05132ed12a4bb85228997)), closes [#12572](https://github.com/aws/aws-cdk/issues/12572) +* **cfnspec:** cloudformation spec v28.0.0 ([#13101](https://github.com/aws/aws-cdk/issues/13101)) ([13c9859](https://github.com/aws/aws-cdk/commit/13c9859cc62b3d472ba1be84b12d478f61f02ec9)) +* **ecs-patterns:** Add support for assignPublicIp for QueueProcessingFargateService ([#13122](https://github.com/aws/aws-cdk/issues/13122)) ([3fb4600](https://github.com/aws/aws-cdk/commit/3fb46001a7345cbefa6df70893999bcb304ed40d)), closes [#12815](https://github.com/aws/aws-cdk/issues/12815) +* **lambda:** Code.fromDockerBuildAsset ([#12258](https://github.com/aws/aws-cdk/issues/12258)) ([09afed5](https://github.com/aws/aws-cdk/commit/09afed5ca2b39919c1c84d200370d490110cd0d1)), closes [#11914](https://github.com/aws/aws-cdk/issues/11914) +* **stepfunctions-tasks:** add EKS call to SFN-tasks ([#12779](https://github.com/aws/aws-cdk/issues/12779)) ([296a10d](https://github.com/aws/aws-cdk/commit/296a10d76a9f6fc2a374d1a6461c460bcc3eeb79)) +* **synthetics:** Update CloudWatch Synthetics NodeJS runtimes ([#12907](https://github.com/aws/aws-cdk/issues/12907)) ([6aac3b6](https://github.com/aws/aws-cdk/commit/6aac3b6a9bb1586ee16e7a85ca657b544d0f8304)), closes [#12906](https://github.com/aws/aws-cdk/issues/12906) + + +### Bug Fixes + +* UserPool, Volume, ElasticSearch, FSx are now RETAIN by default ([#12920](https://github.com/aws/aws-cdk/issues/12920)) ([5a54741](https://github.com/aws/aws-cdk/commit/5a54741a414d3f8b7913163f4785759b984b41d8)), closes [#12563](https://github.com/aws/aws-cdk/issues/12563) +* **appsync:** revert to allow resolver creation from data source ([#12973](https://github.com/aws/aws-cdk/issues/12973)) ([d35f032](https://github.com/aws/aws-cdk/commit/d35f03226d6d7fb5be246b4d3584ee9205b0ef2d)), closes [#12635](https://github.com/aws/aws-cdk/issues/12635) [#11522](https://github.com/aws/aws-cdk/issues/11522) +* **aws-appsync:** use serverlessCluster on rdsDataSource ([#13206](https://github.com/aws/aws-cdk/issues/13206)) ([45cf387](https://github.com/aws/aws-cdk/commit/45cf3873fb48d4043e7a22284d36695ea6bde6ef)), closes [#12567](https://github.com/aws/aws-cdk/issues/12567) +* **cfn-diff:** handle Fn::If inside policies and statements ([#12975](https://github.com/aws/aws-cdk/issues/12975)) ([daf4e47](https://github.com/aws/aws-cdk/commit/daf4e47a790ab99639e471f6792f22e3e4f8ee73)), closes [#12887](https://github.com/aws/aws-cdk/issues/12887) +* **core:** ENOTDIR invalid cwd on "cdk deploy" ([#13145](https://github.com/aws/aws-cdk/issues/13145)) ([cd7a3ed](https://github.com/aws/aws-cdk/commit/cd7a3ed333570a3b26446e1e3a054ca886cd3906)), closes [#12258](https://github.com/aws/aws-cdk/issues/12258) [#13076](https://github.com/aws/aws-cdk/issues/13076) [#13131](https://github.com/aws/aws-cdk/issues/13131) +* **eks:** `KubectlProvider` creates un-necessary security group ([#13178](https://github.com/aws/aws-cdk/issues/13178)) ([c5e8b6d](https://github.com/aws/aws-cdk/commit/c5e8b6df1e5f0359d51d025edcc68508ab5daef1)) +* **eks:** Deployment fails for the first deployment in an account ([#13103](https://github.com/aws/aws-cdk/issues/13103)) ([e042879](https://github.com/aws/aws-cdk/commit/e042879851f8ddd558d20941019c9a6692a1c2bf)), closes [/github.com/aws/aws-cdk/issues/9027#issuecomment-780482124](https://github.com/aws//github.com/aws/aws-cdk/issues/9027/issues/issuecomment-780482124) +* **lambda-nodejs:** invalid sample in documentation ([#12404](https://github.com/aws/aws-cdk/issues/12404)) ([520c263](https://github.com/aws/aws-cdk/commit/520c263ca3c6b0ea7d9c09c23e509a3373ee2b8a)) + ## [1.90.1](https://github.com/aws/aws-cdk/compare/v1.90.0...v1.90.1) (2021-02-19) ### Bug Fixes diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8f26e8198abc2..2b1a950a551fe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -129,12 +129,12 @@ and instead only depend on having a working Docker install. ### Step 1: Open Issue If there isn't one already, open an issue describing what you intend to contribute. It's useful to communicate in -advance, because sometimes, someone is already working in this space, so maybe it's worth collaborating with them -instead of duplicating the efforts. +advance because if someone is already working in this space, it may be worth collaborating with them +instead of duplicating the effort. ### Step 2: Design (optional) -In some cases, it is useful to seek for feedback by iterating on a design document. This is useful +In some cases, it is useful to seek feedback by iterating on a design document. This is useful when you plan a big change or feature, or you want advice on what would be the best path forward. Sometimes, the GitHub issue is sufficient for such discussions, and can be sufficient to get @@ -166,7 +166,7 @@ Work your magic. Here are some guidelines: * Every change requires a unit test * If you change APIs, make sure to update the module's README file * Try to maintain a single feature/bugfix per pull request. It's okay to introduce a little bit of housekeeping - changes along the way, but try to avoid conflating multiple features. Eventually all these are going to go into a + changes along the way, but try to avoid conflating multiple features. Eventually, all these are going to go into a single commit, so you can use that to frame your scope. * If your change introduces a new construct, take a look at the our [example Construct Library](packages/@aws-cdk/example-construct-library) for an explanation of the common patterns we use. @@ -249,7 +249,7 @@ BREAKING CHANGE: Description of what broke and how to achieve this behavior now ### Step 5: Pull Request -* Push to a GitHub fork or to a branch (naming convention: `/`) +* Push to a GitHub fork or to a branch (naming convention: `/`). * Submit a Pull Request on GitHub. A reviewer will later be assigned by the maintainers. * Please follow the PR checklist written below. We trust our contributors to self-check, and this helps that process! * Discuss review comments and iterate until you get at least one “Approve”. When iterating, push new commits to the @@ -262,15 +262,15 @@ BREAKING CHANGE: Description of what broke and how to achieve this behavior now ### Step 6: Merge -* Make sure your PR builds successfully (we have CodeBuild setup to automatically build all PRs) +* Make sure your PR builds successfully (we have CodeBuild setup to automatically build all PRs). * Once approved and tested, a maintainer will squash-merge to master and will use your PR title/description as the commit message. ## Tools -The CDK is a big project, and, at the moment, all of the CDK modules are mastered in a single monolithic repository +The CDK is a big project, and at the moment, all of the CDK modules are mastered in a single monolithic repository (uses [lerna](https://github.com/lerna/lerna)). There are pros and cons to this approach, and it's especially valuable -to maintain integrity in the early stage of the project where things constantly change across the stack. In the future +to maintain integrity in the early stage of the project where things constantly change across the stack. In the future, we believe many of these modules will be extracted to their own repositories. Another complexity is that the CDK is packaged using [jsii](https://github.com/aws/jsii) to multiple programming @@ -328,7 +328,7 @@ They can also be executed independently of the build script. From the root of a yarn lint ``` -The following linters are used - +The following linters are used: - [eslint](#eslint) - [pkglint](#pkglint) @@ -375,7 +375,7 @@ the [guidelines](./DESIGN_GUIDELINES.md). Here are a few useful commands: * `yarn awslint` in every module will run __awslint__ for that module. - * `yarn awslint list` prints all rules (details and rationale in the guidelines doc) + * `yarn awslint list` prints all rules (details and rationale in the guidelines doc). * `scripts/foreach.sh yarn awslint` will start linting the entire repo, progressively. Rerun `scripts/foreach.sh` after fixing to continue. * `lerna run awslint --no-bail --stream 2> awslint.txt` will run __awslint__ in all modules and collect all results into awslint.txt * `lerna run awslint -- -i ` will run awslint throughout the repo and @@ -391,7 +391,7 @@ examples are still accurate. Successfully building examples is also necessary to other supported languages (`C#`, `Java`, `Python`, ...). > Note that examples may use libraries that are not part of the `dependencies` or `devDependencies` of the documented -> package. For example `@aws-cdk/core` contains mainy examples that leverage libraries built *on top of it* (such as +> package. For example, `@aws-cdk/core` contains many examples that leverage libraries built *on top of it* (such as > `@aws-cdk/aws-sns`). Such libraries must be built (using `yarn build`) before **jsii-rosetta** can verify that > examples are correct. @@ -426,7 +426,7 @@ Each module also has an npm script called `cfn2ts`: ### scripts/foreach.sh This wonderful tool allows you to execute a command for all modules in this repo -in topological order, but has the incredible property of being stateful. this +in topological order, but has the incredible property of being stateful. This means that if a command fails, you can fix the issue and resume from where you left off. @@ -437,7 +437,7 @@ $ scripts/foreach.sh COMMAND ``` This will execute "COMMAND" for each module in the repo (cwd will be the directory of the module). -if a task fails, it will stop, and then to resume, simply run `foreach.sh` again (with or without the same command). +If a task fails, it will stop. To resume, simply run `foreach.sh` again (with or without the same command). To reset the session (either when all tasks finished or if you wish to run a different session), run: @@ -452,11 +452,11 @@ $ cd packages/my-module $ ../scripts/foreach.sh --up COMMAND ``` -This will execute `COMMAND` against `my-module` and all it's deps (in a topological order of course). +This will execute `COMMAND` against `my-module` and all its deps (in a topological order, of course). ### Jetbrains support (WebStorm/IntelliJ) -This project uses lerna and utilizes symlinks inside nested node_modules directories. You may encounter an issue during +This project uses lerna and utilizes symlinks inside nested `node_modules` directories. You may encounter an issue during indexing where the IDE attempts to index these directories and keeps following links until the process runs out of available memory and crashes. To fix this, you can run ```node ./scripts/jetbrains-remove-node-modules.js``` to exclude these directories. @@ -528,12 +528,12 @@ $ cd packages/@aws-cdk/aws-ec2 $ ../../../scripts/buildup ``` -Note that `buildup` uses `foreach.sh`, which means it's resumable. If your build fails and you wish to resume, just run +Note that `buildup` uses `foreach.sh`, which means it is resumable. If your build fails and you wish to resume, just run `buildup --resume`. If you wish to restart, run `buildup` again. ### Partial pack -Packing involves generating CDK code in the various target languages, and packaged up ready to be published to the +Packing involves generating CDK code in the various target languages and packaging them up to be published to their respective package managers. Once in a while, these will need to be generated either to test the experience of a new feature, or reproduce a packaging failure. @@ -569,14 +569,14 @@ Code... Now to test, you can either use `yarn test` or invoke nodeunit/jest directly: -Running nodeunit tests directly on a module +Running nodeunit tests directly on a module: ```console $ cd packages/@aws-cdk/aws-iam $ nodeunit test/test.*.js ``` -Running jest tests directly on a module +Running jest tests directly on a module: ```console $ cd packages/@aws-cdk/aws-iam $ jest test/*test.js @@ -599,7 +599,7 @@ One can use the `postinstall` script to symlink this repo: ``` This assumes this repo is a sibling of the target repo and will install the CDK as a linked dependency during -__yarn install__. +`yarn install`. ### Running integration tests in parallel @@ -713,7 +713,7 @@ can be used in these cases. #### Fixture Files Examples typed in fenced code blocks (looking like `'''ts`, but then with backticks -instead of regular quotes) will be automatically extrated, compiled and translated +instead of regular quotes) will be automatically extracted, compiled and translated to other languages when the bindings are generated. To successfully do that, they must be compilable. The easiest way to do that is using @@ -765,14 +765,14 @@ In order to offer a consistent documentation style throughout the AWS CDK codebase, example code should follow the following recommendations (there may be cases where some of those do not apply - good judgement is to be applied): -- Types from the documented module should be **un-qualified** +- Types from the documented module should be **un-qualified**: ```ts // An example in the @aws-cdk/core library, which defines Duration Duration.minutes(15); ``` -- Types from other modules should be **qualified** +- Types from other modules should be **qualified**: ```ts // An example in the @aws-cdk/core library, using something from @aws-cdk/aws-s3 @@ -880,7 +880,7 @@ this branch belongs to. To reduce merge conflicts in automatic merges between version branches, the current version number is stored under `version.vNN.json` (where `NN` is `majorVersion`) and changelogs are stored under `CHANGELOG.NN.md` (for -historical reasons, the changelog for 1.x is under `CHANGELOG.md`). When we +historical reasons, the changelog for 1.x is under `CHANGELOG.md`). When we fork to a new release branch (e.g. `v2-main`), we will update `release.json` in this branch to reflect the new version line, and this information will be used to determine how releases are cut. @@ -931,8 +931,7 @@ $ yarn build However, this will be time consuming. In this section we'll describe some common issues you may encounter and some more targeted commands you can run to resolve your issue. -* The compiler is throwing errors on files that I renamed/it's running old tests that I meant to remove/code coverage is - low and I didn't change anything. +#### The compiler is throwing errors on files that I renamed/it's running old tests that I meant to remove/code coverage is low and I didn't change anything. If you switch to a branch in which `.ts` files got renamed or deleted, the generated `.js` and `.d.ts` files from the previous compilation run are still around and may in some cases still be picked up by the compiler or test runners. @@ -943,7 +942,7 @@ Run the following to clear out stale build artifacts: $ scripts/clean-stale-files.sh ``` -* I added a dependency but it's not being picked up by the build +#### I added a dependency but it's not being picked up by the build You need to tell Lerna to update all dependencies: @@ -951,19 +950,18 @@ You need to tell Lerna to update all dependencies: $ node_modules/.bin/lerna bootstrap ``` -* I added a dependency but it's not being picked up by a `watch` background compilation run. +#### I added a dependency but it's not being picked up by a `watch` background compilation run. No it's not. After re-bootstrapping you need to restart the watch command. -* I added a dependency but it's not being picked up by Visual Studio Code (I still get red underlines). +#### I added a dependency but it's not being picked up by Visual Studio Code (I still get red underlines). The TypeScript compiler that's running has cached your dependency tree. After re-bootstrapping, restart the TypeScript compiler. Hit F1, type `> TypeScript: Restart TS Server`. -* I'm doing refactorings between packages and compile times are killing me/I need to switch between - differently-verionsed branches a lot and rebuilds because of version errors are taking too long. +#### I'm doing refactorings between packages and compile times are killing me/I need to switch between differently-verionsed branches a lot and rebuilds because of version errors are taking too long. Our build steps for each package do a couple of things, such as generating code and generating JSII assemblies. If you've done a full build at least once to generate all source files, you can do a quicker TypeScript-only rebuild of the @@ -996,7 +994,7 @@ $ CDK_TEST_BUILD=false lr test To debug your CDK application along with the CDK repository, 1. Clone the CDK repository locally and build the repository. See [Workflows](#workflows) section for the different build options. -2. Build the CDK application using the appropriate npm script (typically, `yarn build`) and then run the `link-all.sh` script as so - +2. Build the CDK application using the appropriate npm script (typically, `yarn build`) and then run the `link-all.sh` script as follows: ``` cd /path/to/cdk/app @@ -1036,7 +1034,7 @@ To debug your CDK application along with the CDK repository, } ``` - *Go [here](https://code.visualstudio.com/docs/editor/debugging#_launch-configurations) for more about launch configurations.* + *NOTE: Go [here](https://code.visualstudio.com/docs/editor/debugging#_launch-configurations) for more about launch configurations.* 6. The debug view, should now have a launch configuration called 'Debug hello-cdk' and launching that will start the debugger. 7. Any time you modify the CDK app or any of the CDK modules, they need to be re-built and depending on the change the `link-all.sh` script from step#2, may need to be re-run. Only then, would VS code recognize the change and potentially the breakpoint. diff --git a/package.json b/package.json index e2ff66c0e9476..a986d658240f5 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "jsii-pacmak": "^1.21.0", "jsii-rosetta": "^1.21.0", "lerna": "^3.22.1", - "standard-version": "^9.1.0", + "standard-version": "^9.1.1", "typescript": "~3.9.9" }, "resolutions-comment": "should be removed or reviewed when nodeunit dependency is dropped or adjusted", diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.assign-public-ip.expected.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.assign-public-ip.expected.json index 6a9f04c284047..6b7a3f0e42086 100644 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.assign-public-ip.expected.json +++ b/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.assign-public-ip.expected.json @@ -400,7 +400,9 @@ "Type": "AWS::SQS::Queue", "Properties": { "MessageRetentionPeriod": 1209600 - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "nameserviceTaskRecordManagerEventsQueueF805A6C1": { "Type": "AWS::SQS::Queue", @@ -415,7 +417,9 @@ "maxReceiveCount": 500 }, "VisibilityTimeout": 30 - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "nameserviceTaskRecordManagerEventsQueuePolicy65CC6F9E": { "Type": "AWS::SQS::QueuePolicy", @@ -746,14 +750,12 @@ ] } }, - "Handler": "index.queue_handler", "Role": { "Fn::GetAtt": [ "nameserviceTaskRecordManagerEventHandlerServiceRoleE66EE52A", "Arn" ] }, - "Runtime": "python3.8", "Environment": { "Variables": { "HOSTED_ZONE_ID": { @@ -777,7 +779,9 @@ } } }, + "Handler": "index.queue_handler", "ReservedConcurrentExecutions": 1, + "Runtime": "python3.8", "Timeout": 30 }, "DependsOn": [ @@ -788,14 +792,14 @@ "nameserviceTaskRecordManagerEventHandlerSqsEventSourceawsecsintegnameserviceTaskRecordManagerEventsQueueC5EE9A869F1EB155": { "Type": "AWS::Lambda::EventSourceMapping", "Properties": { + "FunctionName": { + "Ref": "nameserviceTaskRecordManagerEventHandler4B8C6905" + }, "EventSourceArn": { "Fn::GetAtt": [ "nameserviceTaskRecordManagerEventsQueueF805A6C1", "Arn" ] - }, - "FunctionName": { - "Ref": "nameserviceTaskRecordManagerEventHandler4B8C6905" } } }, @@ -909,13 +913,13 @@ ] } }, - "Handler": "index.cleanup_resource_handler", "Role": { "Fn::GetAtt": [ "nameserviceTaskRecordManagerCleanupResourceProviderHandlerServiceRoleCCA462F0", "Arn" ] }, + "Handler": "index.cleanup_resource_handler", "Runtime": "python3.8", "Timeout": 300 }, @@ -1022,14 +1026,12 @@ ] } }, - "Handler": "framework.onEvent", "Role": { "Fn::GetAtt": [ "nameserviceTaskRecordManagerCleanupResourceProviderframeworkonEventServiceRoleF0570BD0", "Arn" ] }, - "Runtime": "nodejs10.x", "Description": "AWS CDK resource provider framework - onEvent (aws-ecs-integ/name-service/TaskRecordManager/CleanupResourceProvider)", "Environment": { "Variables": { @@ -1041,6 +1043,8 @@ } } }, + "Handler": "framework.onEvent", + "Runtime": "nodejs10.x", "Timeout": 900 }, "DependsOn": [ @@ -1242,13 +1246,13 @@ ] } }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2", "Arn" ] }, + "Handler": "index.handler", "Runtime": "nodejs12.x", "Timeout": 120 }, diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.imported-environment.expected.json b/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.imported-environment.expected.json index 80156c0ed0d2d..dbc216370e40d 100644 --- a/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.imported-environment.expected.json +++ b/packages/@aws-cdk-containers/ecs-service-extensions/test/integ.imported-environment.expected.json @@ -49,7 +49,9 @@ ] ] } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "ServiceloadbalancerD5D60894": { "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer", diff --git a/packages/@aws-cdk/app-delivery/test/integ.cicd.expected.json b/packages/@aws-cdk/app-delivery/test/integ.cicd.expected.json index da4773e7fb72e..9b2ed51da9ff2 100644 --- a/packages/@aws-cdk/app-delivery/test/integ.cicd.expected.json +++ b/packages/@aws-cdk/app-delivery/test/integ.cicd.expected.json @@ -33,7 +33,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -467,4 +467,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/aws-apigateway/package.json b/packages/@aws-cdk/aws-apigateway/package.json index a7e21f2842eca..7465b7d45a6bd 100644 --- a/packages/@aws-cdk/aws-apigateway/package.json +++ b/packages/@aws-cdk/aws-apigateway/package.json @@ -318,7 +318,9 @@ "attribute-tag:@aws-cdk/aws-apigateway.RestApi.restApiName", "attribute-tag:@aws-cdk/aws-apigateway.SpecRestApi.restApiName", "attribute-tag:@aws-cdk/aws-apigateway.LambdaRestApi.restApiName", - "from-method:@aws-cdk/aws-apigateway.Stage" + "from-method:@aws-cdk/aws-apigateway.Stage", + "resource-attribute:@aws-cdk/aws-apigateway.ApiKey.apiKeyId", + "resource-attribute:@aws-cdk/aws-apigateway.RateLimitedApiKey.apiKeyId" ] }, "stability": "stable", diff --git a/packages/@aws-cdk/aws-apigateway/test/authorizers/integ.cognito-authorizer.expected.json b/packages/@aws-cdk/aws-apigateway/test/authorizers/integ.cognito-authorizer.expected.json index 990619cb495d4..ef5bfef19c2c3 100644 --- a/packages/@aws-cdk/aws-apigateway/test/authorizers/integ.cognito-authorizer.expected.json +++ b/packages/@aws-cdk/aws-apigateway/test/authorizers/integ.cognito-authorizer.expected.json @@ -27,7 +27,9 @@ "EmailSubject": "Verify your new account", "SmsMessage": "The verification code to your new account is {####}" } - } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" }, "myauthorizer23CB99DD": { "Type": "AWS::ApiGateway::Authorizer", diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.restapi-import.lit.expected.json b/packages/@aws-cdk/aws-apigateway/test/integ.restapi-import.lit.expected.json index 349ae37ce27c8..54805c9f2e682 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.restapi-import.lit.expected.json +++ b/packages/@aws-cdk/aws-apigateway/test/integ.restapi-import.lit.expected.json @@ -130,7 +130,9 @@ "Ref": "RestApi0C43BF4B" } } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "integrestapiimportBooksStackNestedStackintegrestapiimportBooksStackNestedStackResource395C2C9B": { "Type": "AWS::CloudFormation::Stack", @@ -192,7 +194,9 @@ "Ref": "RestApi0C43BF4B" } } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "integrestapiimportDeployStackNestedStackintegrestapiimportDeployStackNestedStackResource0D0EE737": { "Type": "AWS::CloudFormation::Stack", @@ -252,7 +256,9 @@ "DependsOn": [ "integrestapiimportBooksStackNestedStackintegrestapiimportBooksStackNestedStackResource395C2C9B", "integrestapiimportPetsStackNestedStackintegrestapiimportPetsStackNestedStackResource2B31898B" - ] + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" } }, "Outputs": { diff --git a/packages/@aws-cdk/aws-apigatewayv2-authorizers/test/http/integ.user-pool.expected.json b/packages/@aws-cdk/aws-apigatewayv2-authorizers/test/http/integ.user-pool.expected.json index b53be9c1b9c27..17e2ae9976378 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-authorizers/test/http/integ.user-pool.expected.json +++ b/packages/@aws-cdk/aws-apigatewayv2-authorizers/test/http/integ.user-pool.expected.json @@ -157,7 +157,9 @@ "EmailSubject": "Verify your new account", "SmsMessage": "The verification code to your new account is {####}" } - } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" }, "userpoolmyclientFAD947AB": { "Type": "AWS::Cognito::UserPoolClient", diff --git a/packages/@aws-cdk/aws-appsync/README.md b/packages/@aws-cdk/aws-appsync/README.md index 61c4e797f5bb4..d15051d191a25 100644 --- a/packages/@aws-cdk/aws-appsync/README.md +++ b/packages/@aws-cdk/aws-appsync/README.md @@ -89,7 +89,7 @@ demoDS.createResolver({ fieldName: 'addDemo', requestMappingTemplate: appsync.MappingTemplate.dynamoDbPutItem( appsync.PrimaryKey.partition('id').auto(), - appsync.Values.projecting('demo') + appsync.Values.projecting('input') ), responseMappingTemplate: appsync.MappingTemplate.dynamoDbResultItem(), }); @@ -107,16 +107,20 @@ const secret = new rds.DatabaseSecret(stack, 'AuroraSecret', { username: 'clusteradmin', }); -// Create the DB cluster, provide all values needed to customise the database. -const cluster = new rds.DatabaseCluster(stack, 'AuroraCluster', { - engine: rds.DatabaseClusterEngine.auroraMysql({ version: rds.AuroraMysqlEngineVersion.VER_2_07_1 }), +// The VPC to place the cluster in +const vpc = new ec2.Vpc(stack, 'AuroraVpc'); + +// Create the serverless cluster, provide all values needed to customise the database. +const cluster = new rds.ServerlessCluster(stack, 'AuroraCluster', { + engine: rds.DatabaseClusterEngine.AURORA_MYSQL, + vpc, credentials: { username: 'clusteradmin' }, clusterIdentifier: 'db-endpoint-test', defaultDatabaseName: 'demos', }); // Build a data source for AppSync to access the database. -const rdsDS = api.addRdsDataSource('rds', 'The rds data source', cluster, secret); +const rdsDS = api.addRdsDataSource('rds', cluster, secret, 'demos'); // Set up a resolver for an RDS query. rdsDS.createResolver({ diff --git a/packages/@aws-cdk/aws-appsync/lib/data-source.ts b/packages/@aws-cdk/aws-appsync/lib/data-source.ts index 21646e8573193..ac22771916400 100644 --- a/packages/@aws-cdk/aws-appsync/lib/data-source.ts +++ b/packages/@aws-cdk/aws-appsync/lib/data-source.ts @@ -1,7 +1,7 @@ import { ITable } from '@aws-cdk/aws-dynamodb'; import { Grant, IGrantable, IPrincipal, IRole, Role, ServicePrincipal } from '@aws-cdk/aws-iam'; import { IFunction } from '@aws-cdk/aws-lambda'; -import { IDatabaseCluster } from '@aws-cdk/aws-rds'; +import { IServerlessCluster } from '@aws-cdk/aws-rds'; import { ISecret } from '@aws-cdk/aws-secretsmanager'; import { IResolvable, Lazy, Stack } from '@aws-cdk/core'; import { Construct } from 'constructs'; @@ -126,7 +126,11 @@ export abstract class BaseDataSource extends CoreConstruct { * creates a new resolver for this datasource and API using the given properties */ public createResolver(props: BaseResolverProps): Resolver { - return this.api.createResolver({ dataSource: this, ...props }); + return new Resolver(this, `${props.typeName}${props.fieldName}Resolver`, { + api: this.api, + dataSource: this, + ...props, + }); } /** @@ -299,13 +303,19 @@ export class LambdaDataSource extends BackedDataSource { */ export interface RdsDataSourceProps extends BackedDataSourceProps { /** - * The database cluster to call to interact with this data source + * The serverless cluster to call to interact with this data source */ - readonly databaseCluster: IDatabaseCluster; + readonly serverlessCluster: IServerlessCluster; /** * The secret containing the credentials for the database */ readonly secretStore: ISecret; + /** + * The name of the database to use within the cluster + * + * @default - None + */ + readonly databaseName?: string; } /** @@ -317,23 +327,24 @@ export class RdsDataSource extends BackedDataSource { type: 'RELATIONAL_DATABASE', relationalDatabaseConfig: { rdsHttpEndpointConfig: { - awsRegion: props.databaseCluster.stack.region, + awsRegion: props.serverlessCluster.stack.region, dbClusterIdentifier: Lazy.string({ produce: () => { return Stack.of(this).formatArn({ service: 'rds', - resource: `cluster:${props.databaseCluster.clusterIdentifier}`, + resource: `cluster:${props.serverlessCluster.clusterIdentifier}`, }); }, }), awsSecretStoreArn: props.secretStore.secretArn, + databaseName: props.databaseName, }, relationalDatabaseSourceType: 'RDS_HTTP_ENDPOINT', }, }); const clusterArn = Stack.of(this).formatArn({ service: 'rds', - resource: `cluster:${props.databaseCluster.clusterIdentifier}`, + resource: `cluster:${props.serverlessCluster.clusterIdentifier}`, }); props.secretStore.grantRead(this); diff --git a/packages/@aws-cdk/aws-appsync/lib/graphqlapi-base.ts b/packages/@aws-cdk/aws-appsync/lib/graphqlapi-base.ts index 3b037101e97ee..060d57a34c276 100644 --- a/packages/@aws-cdk/aws-appsync/lib/graphqlapi-base.ts +++ b/packages/@aws-cdk/aws-appsync/lib/graphqlapi-base.ts @@ -1,6 +1,6 @@ import { ITable } from '@aws-cdk/aws-dynamodb'; import { IFunction } from '@aws-cdk/aws-lambda'; -import { IDatabaseCluster } from '@aws-cdk/aws-rds'; +import { IServerlessCluster } from '@aws-cdk/aws-rds'; import { ISecret } from '@aws-cdk/aws-secretsmanager'; import { CfnResource, IResource, Resource } from '@aws-cdk/core'; import { DynamoDbDataSource, HttpDataSource, LambdaDataSource, NoneDataSource, RdsDataSource, AwsIamConfig } from './data-source'; @@ -97,14 +97,16 @@ export interface IGraphqlApi extends IResource { * add a new Rds data source to this API * * @param id The data source's id - * @param databaseCluster The database cluster to interact with this data source - * @param secretStore The secret store that contains the username and password for the database cluster + * @param serverlessCluster The serverless cluster to interact with this data source + * @param secretStore The secret store that contains the username and password for the serverless cluster + * @param databaseName The optional name of the database to use within the cluster * @param options The optional configuration for this data source */ addRdsDataSource( id: string, - databaseCluster: IDatabaseCluster, + serverlessCluster: IServerlessCluster, secretStore: ISecret, + databaseName?: string, options?: DataSourceOptions ): RdsDataSource; @@ -204,22 +206,25 @@ export abstract class GraphqlApiBase extends Resource implements IGraphqlApi { /** * add a new Rds data source to this API * @param id The data source's id - * @param databaseCluster The database cluster to interact with this data source - * @param secretStore The secret store that contains the username and password for the database cluster + * @param serverlessCluster The serverless cluster to interact with this data source + * @param secretStore The secret store that contains the username and password for the serverless cluster + * @param databaseName The optional name of the database to use within the cluster * @param options The optional configuration for this data source */ public addRdsDataSource( id: string, - databaseCluster: IDatabaseCluster, + serverlessCluster: IServerlessCluster, secretStore: ISecret, + databaseName?: string, options?: DataSourceOptions, ): RdsDataSource { return new RdsDataSource(this, id, { api: this, name: options?.name, description: options?.description, - databaseCluster, + serverlessCluster, secretStore, + databaseName, }); } diff --git a/packages/@aws-cdk/aws-appsync/test/appsync-rds.test.ts b/packages/@aws-cdk/aws-appsync/test/appsync-rds.test.ts index 97cea819de8f3..5a1b278dfc10f 100644 --- a/packages/@aws-cdk/aws-appsync/test/appsync-rds.test.ts +++ b/packages/@aws-cdk/aws-appsync/test/appsync-rds.test.ts @@ -1,7 +1,7 @@ import '@aws-cdk/assert/jest'; import * as path from 'path'; -import { Vpc, SecurityGroup, SubnetType, InstanceType, InstanceClass, InstanceSize } from '@aws-cdk/aws-ec2'; -import { DatabaseSecret, DatabaseCluster, DatabaseClusterEngine, AuroraMysqlEngineVersion } from '@aws-cdk/aws-rds'; +import { Vpc, SecurityGroup, SubnetType } from '@aws-cdk/aws-ec2'; +import { DatabaseSecret, DatabaseClusterEngine, AuroraMysqlEngineVersion, ServerlessCluster } from '@aws-cdk/aws-rds'; import * as cdk from '@aws-cdk/core'; import * as appsync from '../lib'; @@ -21,7 +21,7 @@ beforeEach(() => { describe('Rds Data Source configuration', () => { // GIVEN let secret: DatabaseSecret; - let cluster: DatabaseCluster; + let cluster: ServerlessCluster; beforeEach(() => { const vpc = new Vpc(stack, 'Vpc', { maxAzs: 2 }); const securityGroup = new SecurityGroup(stack, 'AuroraSecurityGroup', { @@ -31,16 +31,13 @@ describe('Rds Data Source configuration', () => { secret = new DatabaseSecret(stack, 'AuroraSecret', { username: 'clusteradmin', }); - cluster = new DatabaseCluster(stack, 'AuroraCluster', { + cluster = new ServerlessCluster(stack, 'AuroraCluster', { engine: DatabaseClusterEngine.auroraMysql({ version: AuroraMysqlEngineVersion.VER_2_07_1 }), credentials: { username: 'clusteradmin' }, clusterIdentifier: 'db-endpoint-test', - instanceProps: { - instanceType: InstanceType.of(InstanceClass.BURSTABLE2, InstanceSize.SMALL), - vpcSubnets: { subnetType: SubnetType.PRIVATE }, - vpc, - securityGroups: [securityGroup], - }, + vpc, + vpcSubnets: { subnetType: SubnetType.PRIVATE }, + securityGroups: [securityGroup], defaultDatabaseName: 'Animals', }); }); @@ -123,6 +120,34 @@ describe('Rds Data Source configuration', () => { }); }); + test('databaseName saved to RdsHttpEndpointConfig', () => { + // WHEN + const testDatabaseName = 'testDatabaseName'; + api.addRdsDataSource('ds', cluster, secret, testDatabaseName); + + // THEN + expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Type: 'RELATIONAL_DATABASE', + RelationalDatabaseConfig: { + RdsHttpEndpointConfig: { + AwsRegion: { Ref: 'AWS::Region' }, + AwsSecretStoreArn: { Ref: 'AuroraSecret41E6E877' }, + DbClusterIdentifier: { + 'Fn::Join': ['', ['arn:', + { Ref: 'AWS::Partition' }, + ':rds:', + { Ref: 'AWS::Region' }, + ':', + { Ref: 'AWS::AccountId' }, + ':cluster:', + { Ref: 'AuroraCluster23D869C0' }]], + }, + DatabaseName: testDatabaseName, + }, + }, + }); + }); + test('default configuration produces name identical to the id', () => { // WHEN api.addRdsDataSource('ds', cluster, secret); @@ -136,7 +161,7 @@ describe('Rds Data Source configuration', () => { test('appsync configures name correctly', () => { // WHEN - api.addRdsDataSource('ds', cluster, secret, { + api.addRdsDataSource('ds', cluster, secret, undefined, { name: 'custom', }); @@ -149,7 +174,7 @@ describe('Rds Data Source configuration', () => { test('appsync configures name and description correctly', () => { // WHEN - api.addRdsDataSource('ds', cluster, secret, { + api.addRdsDataSource('ds', cluster, secret, undefined, { name: 'custom', description: 'custom description', }); @@ -177,7 +202,7 @@ describe('Rds Data Source configuration', () => { describe('adding rds data source from imported api', () => { // GIVEN let secret: DatabaseSecret; - let cluster: DatabaseCluster; + let cluster: ServerlessCluster; beforeEach(() => { const vpc = new Vpc(stack, 'Vpc', { maxAzs: 2 }); const securityGroup = new SecurityGroup(stack, 'AuroraSecurityGroup', { @@ -187,16 +212,13 @@ describe('adding rds data source from imported api', () => { secret = new DatabaseSecret(stack, 'AuroraSecret', { username: 'clusteradmin', }); - cluster = new DatabaseCluster(stack, 'AuroraCluster', { + cluster = new ServerlessCluster(stack, 'AuroraCluster', { engine: DatabaseClusterEngine.auroraMysql({ version: AuroraMysqlEngineVersion.VER_2_07_1 }), credentials: { username: 'clusteradmin' }, clusterIdentifier: 'db-endpoint-test', - instanceProps: { - instanceType: InstanceType.of(InstanceClass.BURSTABLE2, InstanceSize.SMALL), - vpcSubnets: { subnetType: SubnetType.PRIVATE }, - vpc, - securityGroups: [securityGroup], - }, + vpc, + vpcSubnets: { subnetType: SubnetType.PRIVATE }, + securityGroups: [securityGroup], defaultDatabaseName: 'Animals', }); }); diff --git a/packages/@aws-cdk/aws-appsync/test/appsync.test.ts b/packages/@aws-cdk/aws-appsync/test/appsync.test.ts index ca496e99afbff..f4ddfc3ba9da0 100644 --- a/packages/@aws-cdk/aws-appsync/test/appsync.test.ts +++ b/packages/@aws-cdk/aws-appsync/test/appsync.test.ts @@ -55,8 +55,7 @@ test('appsync should error when creating pipeline resolver with data source', () // THEN expect(() => { - api.createResolver({ - dataSource: ds, + ds.createResolver({ typeName: 'test', fieldName: 'test2', pipelineConfig: [test1, test2], diff --git a/packages/@aws-cdk/aws-appsync/test/integ.api-import.expected.json b/packages/@aws-cdk/aws-appsync/test/integ.api-import.expected.json index 87f6776cc79d1..e4b54f04116fc 100644 --- a/packages/@aws-cdk/aws-appsync/test/integ.api-import.expected.json +++ b/packages/@aws-cdk/aws-appsync/test/integ.api-import.expected.json @@ -135,7 +135,7 @@ } } }, - "ApiQuerygetTestsResolver025B8E0A": { + "ApidsQuerygetTestsResolver952F49EE": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { @@ -152,7 +152,7 @@ "Apids0DB53FEA" ] }, - "ApiMutationaddTestResolver7A08AE91": { + "ApidsMutationaddTestResolverBCF0400B": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { diff --git a/packages/@aws-cdk/aws-appsync/test/integ.auth-apikey.expected.json b/packages/@aws-cdk/aws-appsync/test/integ.auth-apikey.expected.json index 390d55bd9bb38..2d1ef3f31504f 100644 --- a/packages/@aws-cdk/aws-appsync/test/integ.auth-apikey.expected.json +++ b/packages/@aws-cdk/aws-appsync/test/integ.auth-apikey.expected.json @@ -121,7 +121,7 @@ } } }, - "ApiQuerygetTestsResolver025B8E0A": { + "ApitestDataSourceQuerygetTestsResolverA3BBB672": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { @@ -142,7 +142,7 @@ "ApitestDataSource96AE54D5" ] }, - "ApiMutationaddTestResolver7A08AE91": { + "ApitestDataSourceMutationaddTestResolver36203D6B": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { diff --git a/packages/@aws-cdk/aws-appsync/test/integ.graphql-iam.expected.json b/packages/@aws-cdk/aws-appsync/test/integ.graphql-iam.expected.json index 4cd9043b28c4b..374a89dc33d14 100644 --- a/packages/@aws-cdk/aws-appsync/test/integ.graphql-iam.expected.json +++ b/packages/@aws-cdk/aws-appsync/test/integ.graphql-iam.expected.json @@ -28,7 +28,9 @@ "EmailSubject": "Verify your new account", "SmsMessage": "The verification code to your new account is {####}" } - } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" }, "ApiF70053CD": { "Type": "AWS::AppSync::GraphQLApi", @@ -150,7 +152,7 @@ } } }, - "ApiQuerygetTestResolver4C1F8B0C": { + "ApidsQuerygetTestResolverCCED7EC2": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { @@ -171,7 +173,7 @@ "ApiSchema510EECD7" ] }, - "ApiQuerygetTestsResolver025B8E0A": { + "ApidsQuerygetTestsResolver952F49EE": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { @@ -192,7 +194,7 @@ "ApiSchema510EECD7" ] }, - "ApiMutationaddTestResolver7A08AE91": { + "ApidsMutationaddTestResolverBCF0400B": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { @@ -400,14 +402,12 @@ ] } }, - "Handler": "iam-query.handler", "Role": { "Fn::GetAtt": [ "LambdaIAM687B49AF", "Arn" ] }, - "Runtime": "nodejs12.x", "Environment": { "Variables": { "APPSYNC_ENDPOINT": { @@ -417,7 +417,9 @@ ] } } - } + }, + "Handler": "iam-query.handler", + "Runtime": "nodejs12.x" }, "DependsOn": [ "LambdaIAMDefaultPolicy96DEA124", @@ -496,14 +498,12 @@ ] } }, - "Handler": "iam-query.handler", "Role": { "Fn::GetAtt": [ "testFailServiceRole9FF22F85", "Arn" ] }, - "Runtime": "nodejs12.x", "Environment": { "Variables": { "APPSYNC_ENDPOINT": { @@ -513,7 +513,9 @@ ] } } - } + }, + "Handler": "iam-query.handler", + "Runtime": "nodejs12.x" }, "DependsOn": [ "testFailServiceRole9FF22F85" diff --git a/packages/@aws-cdk/aws-appsync/test/integ.graphql.expected.json b/packages/@aws-cdk/aws-appsync/test/integ.graphql.expected.json index d540f3777ed00..6f9fd9c12d899 100644 --- a/packages/@aws-cdk/aws-appsync/test/integ.graphql.expected.json +++ b/packages/@aws-cdk/aws-appsync/test/integ.graphql.expected.json @@ -28,7 +28,9 @@ "EmailSubject": "Verify your new account", "SmsMessage": "The verification code to your new account is {####}" } - } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" }, "ApiF70053CD": { "Type": "AWS::AppSync::GraphQLApi", @@ -90,7 +92,7 @@ "Type": "NONE" } }, - "ApiQuerygetServiceVersionResolver269A74C1": { + "ApinoneQuerygetServiceVersionResolver336A3C2C": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { @@ -198,204 +200,7 @@ } } }, - "ApiorderDsServiceRoleCC2040C0": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "appsync.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "ApiorderDsServiceRoleDefaultPolicy3315FCF4": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "dynamodb:BatchGetItem", - "dynamodb:GetRecords", - "dynamodb:GetShardIterator", - "dynamodb:Query", - "dynamodb:GetItem", - "dynamodb:Scan", - "dynamodb:ConditionCheckItem", - "dynamodb:BatchWriteItem", - "dynamodb:PutItem", - "dynamodb:UpdateItem", - "dynamodb:DeleteItem" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "OrderTable416EB896", - "Arn" - ] - }, - { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "OrderTable416EB896", - "Arn" - ] - }, - "/index/*" - ] - ] - } - ] - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "ApiorderDsServiceRoleDefaultPolicy3315FCF4", - "Roles": [ - { - "Ref": "ApiorderDsServiceRoleCC2040C0" - } - ] - } - }, - "ApiorderDsB50C8AAD": { - "Type": "AWS::AppSync::DataSource", - "Properties": { - "ApiId": { - "Fn::GetAtt": [ - "ApiF70053CD", - "ApiId" - ] - }, - "Name": "Order", - "Type": "AMAZON_DYNAMODB", - "DynamoDBConfig": { - "AwsRegion": { - "Ref": "AWS::Region" - }, - "TableName": { - "Ref": "OrderTable416EB896" - } - }, - "ServiceRoleArn": { - "Fn::GetAtt": [ - "ApiorderDsServiceRoleCC2040C0", - "Arn" - ] - } - } - }, - "ApipaymentDsServiceRole0DAC58D6": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "appsync.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "ApipaymentDsServiceRoleDefaultPolicy528E42B0": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "dynamodb:BatchGetItem", - "dynamodb:GetRecords", - "dynamodb:GetShardIterator", - "dynamodb:Query", - "dynamodb:GetItem", - "dynamodb:Scan", - "dynamodb:ConditionCheckItem", - "dynamodb:BatchWriteItem", - "dynamodb:PutItem", - "dynamodb:UpdateItem", - "dynamodb:DeleteItem" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":dynamodb:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":table/PaymentTable" - ] - ] - }, - { - "Ref": "AWS::NoValue" - } - ] - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "ApipaymentDsServiceRoleDefaultPolicy528E42B0", - "Roles": [ - { - "Ref": "ApipaymentDsServiceRole0DAC58D6" - } - ] - } - }, - "ApipaymentDs95C7AC36": { - "Type": "AWS::AppSync::DataSource", - "Properties": { - "ApiId": { - "Fn::GetAtt": [ - "ApiF70053CD", - "ApiId" - ] - }, - "Name": "Payment", - "Type": "AMAZON_DYNAMODB", - "DynamoDBConfig": { - "AwsRegion": { - "Ref": "AWS::Region" - }, - "TableName": "PaymentTable" - }, - "ServiceRoleArn": { - "Fn::GetAtt": [ - "ApipaymentDsServiceRole0DAC58D6", - "Arn" - ] - } - } - }, - "ApiQuerygetCustomersResolver522EE433": { + "ApicustomerDsQuerygetCustomersResolverA74C8A2E": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { @@ -416,7 +221,7 @@ "ApiSchema510EECD7" ] }, - "ApiQuerygetCustomerResolver007520DC": { + "ApicustomerDsQuerygetCustomerResolver3649A130": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { @@ -437,7 +242,7 @@ "ApiSchema510EECD7" ] }, - "ApiMutationaddCustomerResolver53321A05": { + "ApicustomerDsMutationaddCustomerResolver4DE5B517": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { @@ -458,7 +263,7 @@ "ApiSchema510EECD7" ] }, - "ApiMutationsaveCustomerResolver85516C23": { + "ApicustomerDsMutationsaveCustomerResolver241DD231": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { @@ -479,7 +284,7 @@ "ApiSchema510EECD7" ] }, - "ApiMutationsaveCustomerWithFirstOrderResolver66DBDFD0": { + "ApicustomerDsMutationsaveCustomerWithFirstOrderResolver7DE2CBC8": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { @@ -500,7 +305,7 @@ "ApiSchema510EECD7" ] }, - "ApiMutationremoveCustomerResolver8435F803": { + "ApicustomerDsMutationremoveCustomerResolverAD3AE7F5": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { @@ -521,7 +326,105 @@ "ApiSchema510EECD7" ] }, - "ApiQuerygetCustomerOrdersEqResolver6DA88A11": { + "ApiorderDsServiceRoleCC2040C0": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "appsync.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "ApiorderDsServiceRoleDefaultPolicy3315FCF4": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "dynamodb:BatchGetItem", + "dynamodb:GetRecords", + "dynamodb:GetShardIterator", + "dynamodb:Query", + "dynamodb:GetItem", + "dynamodb:Scan", + "dynamodb:ConditionCheckItem", + "dynamodb:BatchWriteItem", + "dynamodb:PutItem", + "dynamodb:UpdateItem", + "dynamodb:DeleteItem" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "OrderTable416EB896", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "OrderTable416EB896", + "Arn" + ] + }, + "/index/*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ApiorderDsServiceRoleDefaultPolicy3315FCF4", + "Roles": [ + { + "Ref": "ApiorderDsServiceRoleCC2040C0" + } + ] + } + }, + "ApiorderDsB50C8AAD": { + "Type": "AWS::AppSync::DataSource", + "Properties": { + "ApiId": { + "Fn::GetAtt": [ + "ApiF70053CD", + "ApiId" + ] + }, + "Name": "Order", + "Type": "AMAZON_DYNAMODB", + "DynamoDBConfig": { + "AwsRegion": { + "Ref": "AWS::Region" + }, + "TableName": { + "Ref": "OrderTable416EB896" + } + }, + "ServiceRoleArn": { + "Fn::GetAtt": [ + "ApiorderDsServiceRoleCC2040C0", + "Arn" + ] + } + } + }, + "ApiorderDsQuerygetCustomerOrdersEqResolverEF9D5350": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { @@ -542,7 +445,7 @@ "ApiSchema510EECD7" ] }, - "ApiQuerygetOrderCustomersEqResolverA8612570": { + "ApiorderDsQuerygetOrderCustomersEqResolverE58570FF": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { @@ -563,7 +466,7 @@ "ApiSchema510EECD7" ] }, - "ApiQuerygetCustomerOrdersLtResolver284B37E8": { + "ApiorderDsQuerygetCustomerOrdersLtResolver909F3D8F": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { @@ -584,7 +487,7 @@ "ApiSchema510EECD7" ] }, - "ApiQuerygetOrderCustomersLtResolver618A88A9": { + "ApiorderDsQuerygetOrderCustomersLtResolver77468800": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { @@ -605,7 +508,7 @@ "ApiSchema510EECD7" ] }, - "ApiQuerygetCustomerOrdersLeResolverFB2A506A": { + "ApiorderDsQuerygetCustomerOrdersLeResolverF230A8BE": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { @@ -626,7 +529,7 @@ "ApiSchema510EECD7" ] }, - "ApiQuerygetOrderCustomersLeResolverFAA205B9": { + "ApiorderDsQuerygetOrderCustomersLeResolver836A0389": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { @@ -647,7 +550,7 @@ "ApiSchema510EECD7" ] }, - "ApiQuerygetCustomerOrdersGtResolver13F90EA5": { + "ApiorderDsQuerygetCustomerOrdersGtResolverF01F806B": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { @@ -668,7 +571,7 @@ "ApiSchema510EECD7" ] }, - "ApiQuerygetOrderCustomersGtResolver9487ECD9": { + "ApiorderDsQuerygetOrderCustomersGtResolver3197CCFE": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { @@ -689,7 +592,7 @@ "ApiSchema510EECD7" ] }, - "ApiQuerygetCustomerOrdersGeResolver2A181899": { + "ApiorderDsQuerygetCustomerOrdersGeResolver63CAD303": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { @@ -710,7 +613,7 @@ "ApiSchema510EECD7" ] }, - "ApiQuerygetOrderCustomersGeResolver8441E608": { + "ApiorderDsQuerygetOrderCustomersGeResolver0B78B0B4": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { @@ -731,7 +634,7 @@ "ApiSchema510EECD7" ] }, - "ApiQuerygetCustomerOrdersFilterResolver96245084": { + "ApiorderDsQuerygetCustomerOrdersFilterResolverCD2B8747": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { @@ -752,7 +655,7 @@ "ApiSchema510EECD7" ] }, - "ApiQuerygetCustomerOrdersBetweenResolver97B6D708": { + "ApiorderDsQuerygetCustomerOrdersBetweenResolver7DEE368E": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { @@ -773,7 +676,7 @@ "ApiSchema510EECD7" ] }, - "ApiQuerygetOrderCustomersFilterResolverF1015ABD": { + "ApiorderDsQuerygetOrderCustomersFilterResolver628CC68D": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { @@ -794,7 +697,7 @@ "ApiSchema510EECD7" ] }, - "ApiQuerygetOrderCustomersBetweenResolver92680CEC": { + "ApiorderDsQuerygetOrderCustomersBetweenResolver2048F3CB": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { @@ -815,7 +718,106 @@ "ApiSchema510EECD7" ] }, - "ApiQuerygetPaymentResolver29598AC3": { + "ApipaymentDsServiceRole0DAC58D6": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "appsync.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "ApipaymentDsServiceRoleDefaultPolicy528E42B0": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "dynamodb:BatchGetItem", + "dynamodb:GetRecords", + "dynamodb:GetShardIterator", + "dynamodb:Query", + "dynamodb:GetItem", + "dynamodb:Scan", + "dynamodb:ConditionCheckItem", + "dynamodb:BatchWriteItem", + "dynamodb:PutItem", + "dynamodb:UpdateItem", + "dynamodb:DeleteItem" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":dynamodb:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":table/PaymentTable" + ] + ] + }, + { + "Ref": "AWS::NoValue" + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ApipaymentDsServiceRoleDefaultPolicy528E42B0", + "Roles": [ + { + "Ref": "ApipaymentDsServiceRole0DAC58D6" + } + ] + } + }, + "ApipaymentDs95C7AC36": { + "Type": "AWS::AppSync::DataSource", + "Properties": { + "ApiId": { + "Fn::GetAtt": [ + "ApiF70053CD", + "ApiId" + ] + }, + "Name": "Payment", + "Type": "AMAZON_DYNAMODB", + "DynamoDBConfig": { + "AwsRegion": { + "Ref": "AWS::Region" + }, + "TableName": "PaymentTable" + }, + "ServiceRoleArn": { + "Fn::GetAtt": [ + "ApipaymentDsServiceRole0DAC58D6", + "Arn" + ] + } + } + }, + "ApipaymentDsQuerygetPaymentResolverD172BFC9": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { @@ -836,7 +838,7 @@ "ApiSchema510EECD7" ] }, - "ApiMutationsavePaymentResolver03088E76": { + "ApipaymentDsMutationsavePaymentResolverE09FE5BB": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { @@ -896,7 +898,7 @@ } } }, - "ApiMutationdoPostOnAwsResolverEDACEA42": { + "ApidsMutationdoPostOnAwsResolver9583D8A3": { "Type": "AWS::AppSync::Resolver", "Properties": { "ApiId": { diff --git a/packages/@aws-cdk/aws-backup/test/integ.backup.expected.json b/packages/@aws-cdk/aws-backup/test/integ.backup.expected.json index 2ba1356211377..1ad2aefc7c46e 100644 --- a/packages/@aws-cdk/aws-backup/test/integ.backup.expected.json +++ b/packages/@aws-cdk/aws-backup/test/integ.backup.expected.json @@ -24,7 +24,9 @@ "DeletionPolicy": "Delete" }, "FileSystem": { - "Type": "AWS::EFS::FileSystem" + "Type": "AWS::EFS::FileSystem", + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "Vault23237E5B": { "Type": "AWS::Backup::BackupVault", diff --git a/packages/@aws-cdk/aws-backup/test/integ.backup.ts b/packages/@aws-cdk/aws-backup/test/integ.backup.ts index bf71de03a1cb8..e04d3ba68671a 100644 --- a/packages/@aws-cdk/aws-backup/test/integ.backup.ts +++ b/packages/@aws-cdk/aws-backup/test/integ.backup.ts @@ -16,7 +16,8 @@ class TestStack extends Stack { removalPolicy: RemovalPolicy.DESTROY, }); - new efs.CfnFileSystem(this, 'FileSystem'); + const fs = new efs.CfnFileSystem(this, 'FileSystem'); + fs.applyRemovalPolicy(RemovalPolicy.DESTROY); const vault = new backup.BackupVault(this, 'Vault', { removalPolicy: RemovalPolicy.DESTROY, diff --git a/packages/@aws-cdk/aws-backup/test/selection.test.ts b/packages/@aws-cdk/aws-backup/test/selection.test.ts index b5523b963c20e..d801efb34894c 100644 --- a/packages/@aws-cdk/aws-backup/test/selection.test.ts +++ b/packages/@aws-cdk/aws-backup/test/selection.test.ts @@ -2,7 +2,7 @@ import '@aws-cdk/assert/jest'; import * as dynamodb from '@aws-cdk/aws-dynamodb'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as efs from '@aws-cdk/aws-efs'; -import { Stack } from '@aws-cdk/core'; +import { RemovalPolicy, Stack } from '@aws-cdk/core'; import { Construct } from 'constructs'; import { BackupPlan, BackupResource, BackupSelection } from '../lib'; @@ -128,7 +128,8 @@ test('fromConstruct', () => { class EfsConstruct extends CoreConstruct { constructor(scope: Construct, id: string) { super(scope, id); - new efs.CfnFileSystem(this, 'FileSystem'); + const fs = new efs.CfnFileSystem(this, 'FileSystem'); + fs.applyRemovalPolicy(RemovalPolicy.DESTROY); } } class MyConstruct extends CoreConstruct { diff --git a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stack.expected.json b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stack.expected.json index 8626fa9281ca5..d290134fa1cb6 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stack.expected.json +++ b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stack.expected.json @@ -1,7 +1,9 @@ { "Resources": { "SubscriberQueueC193DC66": { - "Type": "AWS::SQS::Queue" + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "SubscriberQueuePolicy25A0799E": { "Type": "AWS::SQS::QueuePolicy", @@ -196,7 +198,9 @@ "Ref": "SubscriberQueueC193DC66" } } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "NestedStack2NestedStackNestedStack2NestedStackResourceFDF82E43": { "Type": "AWS::CloudFormation::Stack", @@ -250,7 +254,9 @@ "Parameters": { "TopicNamePrefix": "Prefix2" } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" } }, "Parameters": { diff --git a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-assets.expected.json b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-assets.expected.json index d18d72744be00..45b52a4c8016d 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-assets.expected.json +++ b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-assets.expected.json @@ -17,7 +17,7 @@ }, "/", { - "Ref": "AssetParameters28e3582cfc7c551f42435f44110c499fb2c415fe0f02a02a77139cf43edd1145S3BucketFDBB032A" + "Ref": "AssetParameters7bd7ccfde94a4ad94f13971f10733ee01020eb6d7538b7a5c2b05966db2c0aabS3Bucket2E4E0318" }, "/", { @@ -27,7 +27,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters28e3582cfc7c551f42435f44110c499fb2c415fe0f02a02a77139cf43edd1145S3VersionKey58263016" + "Ref": "AssetParameters7bd7ccfde94a4ad94f13971f10733ee01020eb6d7538b7a5c2b05966db2c0aabS3VersionKeyF6AB1DF2" } ] } @@ -40,7 +40,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters28e3582cfc7c551f42435f44110c499fb2c415fe0f02a02a77139cf43edd1145S3VersionKey58263016" + "Ref": "AssetParameters7bd7ccfde94a4ad94f13971f10733ee01020eb6d7538b7a5c2b05966db2c0aabS3VersionKeyF6AB1DF2" } ] } @@ -50,40 +50,42 @@ ] }, "Parameters": { - "referencetonestedstacksassetsAssetParametersb13aad60258df1fbe5fb1312a7b2f8f25c03b3e07113782f7c12f00e023e148aS3BucketE2268D38Ref": { - "Ref": "AssetParametersb13aad60258df1fbe5fb1312a7b2f8f25c03b3e07113782f7c12f00e023e148aS3BucketC5E2D427" + "referencetonestedstacksassetsAssetParametersbbe209afddb09a12327bab7a105e085758a29b769b5b4bf5b6320ac41b05fc51S3BucketFE27EEBCRef": { + "Ref": "AssetParametersbbe209afddb09a12327bab7a105e085758a29b769b5b4bf5b6320ac41b05fc51S3Bucket8C5997AB" }, - "referencetonestedstacksassetsAssetParametersb13aad60258df1fbe5fb1312a7b2f8f25c03b3e07113782f7c12f00e023e148aS3VersionKeyD31C6796Ref": { - "Ref": "AssetParametersb13aad60258df1fbe5fb1312a7b2f8f25c03b3e07113782f7c12f00e023e148aS3VersionKey31422F11" + "referencetonestedstacksassetsAssetParametersbbe209afddb09a12327bab7a105e085758a29b769b5b4bf5b6320ac41b05fc51S3VersionKey24D35F02Ref": { + "Ref": "AssetParametersbbe209afddb09a12327bab7a105e085758a29b769b5b4bf5b6320ac41b05fc51S3VersionKey81BEC7FB" } } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" } }, "Parameters": { - "AssetParametersb13aad60258df1fbe5fb1312a7b2f8f25c03b3e07113782f7c12f00e023e148aS3BucketC5E2D427": { + "AssetParametersbbe209afddb09a12327bab7a105e085758a29b769b5b4bf5b6320ac41b05fc51S3Bucket8C5997AB": { "Type": "String", - "Description": "S3 bucket for asset \"b13aad60258df1fbe5fb1312a7b2f8f25c03b3e07113782f7c12f00e023e148a\"" + "Description": "S3 bucket for asset \"bbe209afddb09a12327bab7a105e085758a29b769b5b4bf5b6320ac41b05fc51\"" }, - "AssetParametersb13aad60258df1fbe5fb1312a7b2f8f25c03b3e07113782f7c12f00e023e148aS3VersionKey31422F11": { + "AssetParametersbbe209afddb09a12327bab7a105e085758a29b769b5b4bf5b6320ac41b05fc51S3VersionKey81BEC7FB": { "Type": "String", - "Description": "S3 key for asset version \"b13aad60258df1fbe5fb1312a7b2f8f25c03b3e07113782f7c12f00e023e148a\"" + "Description": "S3 key for asset version \"bbe209afddb09a12327bab7a105e085758a29b769b5b4bf5b6320ac41b05fc51\"" }, - "AssetParametersb13aad60258df1fbe5fb1312a7b2f8f25c03b3e07113782f7c12f00e023e148aArtifactHash2897446E": { + "AssetParametersbbe209afddb09a12327bab7a105e085758a29b769b5b4bf5b6320ac41b05fc51ArtifactHashB77349F4": { "Type": "String", - "Description": "Artifact hash for asset \"b13aad60258df1fbe5fb1312a7b2f8f25c03b3e07113782f7c12f00e023e148a\"" + "Description": "Artifact hash for asset \"bbe209afddb09a12327bab7a105e085758a29b769b5b4bf5b6320ac41b05fc51\"" }, - "AssetParameters28e3582cfc7c551f42435f44110c499fb2c415fe0f02a02a77139cf43edd1145S3BucketFDBB032A": { + "AssetParameters7bd7ccfde94a4ad94f13971f10733ee01020eb6d7538b7a5c2b05966db2c0aabS3Bucket2E4E0318": { "Type": "String", - "Description": "S3 bucket for asset \"28e3582cfc7c551f42435f44110c499fb2c415fe0f02a02a77139cf43edd1145\"" + "Description": "S3 bucket for asset \"7bd7ccfde94a4ad94f13971f10733ee01020eb6d7538b7a5c2b05966db2c0aab\"" }, - "AssetParameters28e3582cfc7c551f42435f44110c499fb2c415fe0f02a02a77139cf43edd1145S3VersionKey58263016": { + "AssetParameters7bd7ccfde94a4ad94f13971f10733ee01020eb6d7538b7a5c2b05966db2c0aabS3VersionKeyF6AB1DF2": { "Type": "String", - "Description": "S3 key for asset version \"28e3582cfc7c551f42435f44110c499fb2c415fe0f02a02a77139cf43edd1145\"" + "Description": "S3 key for asset version \"7bd7ccfde94a4ad94f13971f10733ee01020eb6d7538b7a5c2b05966db2c0aab\"" }, - "AssetParameters28e3582cfc7c551f42435f44110c499fb2c415fe0f02a02a77139cf43edd1145ArtifactHash592B4471": { + "AssetParameters7bd7ccfde94a4ad94f13971f10733ee01020eb6d7538b7a5c2b05966db2c0aabArtifactHash63670210": { "Type": "String", - "Description": "Artifact hash for asset \"28e3582cfc7c551f42435f44110c499fb2c415fe0f02a02a77139cf43edd1145\"" + "Description": "Artifact hash for asset \"7bd7ccfde94a4ad94f13971f10733ee01020eb6d7538b7a5c2b05966db2c0aab\"" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-multi-refs.expected.json b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-multi-refs.expected.json index bc546994b8e41..8e1abf0743734 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-multi-refs.expected.json +++ b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-multi-refs.expected.json @@ -20,7 +20,7 @@ }, "/", { - "Ref": "AssetParametersad23da1cfc8b3fd7916c6ffc7debacadf084765e62fab8acf0b8b0a9b0289f95S3BucketDB605F9E" + "Ref": "AssetParameters2fa66e9dea71b1e05ebeed281df124cbaca34247ae93c767a533b6346cc17703S3BucketD17502DC" }, "/", { @@ -30,7 +30,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParametersad23da1cfc8b3fd7916c6ffc7debacadf084765e62fab8acf0b8b0a9b0289f95S3VersionKey26685906" + "Ref": "AssetParameters2fa66e9dea71b1e05ebeed281df124cbaca34247ae93c767a533b6346cc17703S3VersionKeyA042251F" } ] } @@ -43,7 +43,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParametersad23da1cfc8b3fd7916c6ffc7debacadf084765e62fab8acf0b8b0a9b0289f95S3VersionKey26685906" + "Ref": "AssetParameters2fa66e9dea71b1e05ebeed281df124cbaca34247ae93c767a533b6346cc17703S3VersionKeyA042251F" } ] } @@ -65,14 +65,16 @@ "referencetonestedstacksmultirefsAssetParameters495a6bc36c13a0adeb3778c921d18ac4a8205f5471108fcc199a291d14855c3aS3VersionKey5F9CF809Ref": { "Ref": "AssetParameters495a6bc36c13a0adeb3778c921d18ac4a8205f5471108fcc199a291d14855c3aS3VersionKey2CCE0573" }, - "referencetonestedstacksmultirefsAssetParameterscc623add53df153cf6a7df1cea4dc90740d7be087472579110754a633ec90847S3Bucket8F1E17B9Ref": { - "Ref": "AssetParameterscc623add53df153cf6a7df1cea4dc90740d7be087472579110754a633ec90847S3Bucket9A14AA6D" + "referencetonestedstacksmultirefsAssetParametersc2fbfb6df004b51bb870bd1f5cabda73830a59765a6c766aca0e906ec1e22441S3Bucket119ED767Ref": { + "Ref": "AssetParametersc2fbfb6df004b51bb870bd1f5cabda73830a59765a6c766aca0e906ec1e22441S3BucketAF9A3A0F" }, - "referencetonestedstacksmultirefsAssetParameterscc623add53df153cf6a7df1cea4dc90740d7be087472579110754a633ec90847S3VersionKey9EEEF950Ref": { - "Ref": "AssetParameterscc623add53df153cf6a7df1cea4dc90740d7be087472579110754a633ec90847S3VersionKeyF124C0D9" + "referencetonestedstacksmultirefsAssetParametersc2fbfb6df004b51bb870bd1f5cabda73830a59765a6c766aca0e906ec1e22441S3VersionKeyDCF85FE2Ref": { + "Ref": "AssetParametersc2fbfb6df004b51bb870bd1f5cabda73830a59765a6c766aca0e906ec1e22441S3VersionKey2F85340C" } } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" } }, "Parameters": { @@ -88,29 +90,29 @@ "Type": "String", "Description": "Artifact hash for asset \"495a6bc36c13a0adeb3778c921d18ac4a8205f5471108fcc199a291d14855c3a\"" }, - "AssetParameterscc623add53df153cf6a7df1cea4dc90740d7be087472579110754a633ec90847S3Bucket9A14AA6D": { + "AssetParametersc2fbfb6df004b51bb870bd1f5cabda73830a59765a6c766aca0e906ec1e22441S3BucketAF9A3A0F": { "Type": "String", - "Description": "S3 bucket for asset \"cc623add53df153cf6a7df1cea4dc90740d7be087472579110754a633ec90847\"" + "Description": "S3 bucket for asset \"c2fbfb6df004b51bb870bd1f5cabda73830a59765a6c766aca0e906ec1e22441\"" }, - "AssetParameterscc623add53df153cf6a7df1cea4dc90740d7be087472579110754a633ec90847S3VersionKeyF124C0D9": { + "AssetParametersc2fbfb6df004b51bb870bd1f5cabda73830a59765a6c766aca0e906ec1e22441S3VersionKey2F85340C": { "Type": "String", - "Description": "S3 key for asset version \"cc623add53df153cf6a7df1cea4dc90740d7be087472579110754a633ec90847\"" + "Description": "S3 key for asset version \"c2fbfb6df004b51bb870bd1f5cabda73830a59765a6c766aca0e906ec1e22441\"" }, - "AssetParameterscc623add53df153cf6a7df1cea4dc90740d7be087472579110754a633ec90847ArtifactHashAF64C405": { + "AssetParametersc2fbfb6df004b51bb870bd1f5cabda73830a59765a6c766aca0e906ec1e22441ArtifactHash5D93ED07": { "Type": "String", - "Description": "Artifact hash for asset \"cc623add53df153cf6a7df1cea4dc90740d7be087472579110754a633ec90847\"" + "Description": "Artifact hash for asset \"c2fbfb6df004b51bb870bd1f5cabda73830a59765a6c766aca0e906ec1e22441\"" }, - "AssetParametersad23da1cfc8b3fd7916c6ffc7debacadf084765e62fab8acf0b8b0a9b0289f95S3BucketDB605F9E": { + "AssetParameters2fa66e9dea71b1e05ebeed281df124cbaca34247ae93c767a533b6346cc17703S3BucketD17502DC": { "Type": "String", - "Description": "S3 bucket for asset \"ad23da1cfc8b3fd7916c6ffc7debacadf084765e62fab8acf0b8b0a9b0289f95\"" + "Description": "S3 bucket for asset \"2fa66e9dea71b1e05ebeed281df124cbaca34247ae93c767a533b6346cc17703\"" }, - "AssetParametersad23da1cfc8b3fd7916c6ffc7debacadf084765e62fab8acf0b8b0a9b0289f95S3VersionKey26685906": { + "AssetParameters2fa66e9dea71b1e05ebeed281df124cbaca34247ae93c767a533b6346cc17703S3VersionKeyA042251F": { "Type": "String", - "Description": "S3 key for asset version \"ad23da1cfc8b3fd7916c6ffc7debacadf084765e62fab8acf0b8b0a9b0289f95\"" + "Description": "S3 key for asset version \"2fa66e9dea71b1e05ebeed281df124cbaca34247ae93c767a533b6346cc17703\"" }, - "AssetParametersad23da1cfc8b3fd7916c6ffc7debacadf084765e62fab8acf0b8b0a9b0289f95ArtifactHashAF8D54FC": { + "AssetParameters2fa66e9dea71b1e05ebeed281df124cbaca34247ae93c767a533b6346cc17703ArtifactHash8853E261": { "Type": "String", - "Description": "Artifact hash for asset \"ad23da1cfc8b3fd7916c6ffc7debacadf084765e62fab8acf0b8b0a9b0289f95\"" + "Description": "Artifact hash for asset \"2fa66e9dea71b1e05ebeed281df124cbaca34247ae93c767a533b6346cc17703\"" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-multi.expected.json b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-multi.expected.json index 6a10c9252c79a..0145629ff176e 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-multi.expected.json +++ b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-multi.expected.json @@ -17,7 +17,7 @@ }, "/", { - "Ref": "AssetParametersf94d2259295147a175eeb7f8b31856e4beb5d4d4654f0bf956ee51d5e2ee5d8eS3Bucket0211CC54" + "Ref": "AssetParameters686794a6d724e01e517bba15106edebf9db8d4bb309f0c60d5ff55a11db4a856S3BucketDF3BC15F" }, "/", { @@ -27,7 +27,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParametersf94d2259295147a175eeb7f8b31856e4beb5d4d4654f0bf956ee51d5e2ee5d8eS3VersionKey5D85E7DD" + "Ref": "AssetParameters686794a6d724e01e517bba15106edebf9db8d4bb309f0c60d5ff55a11db4a856S3VersionKey1BCA0E57" } ] } @@ -40,7 +40,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParametersf94d2259295147a175eeb7f8b31856e4beb5d4d4654f0bf956ee51d5e2ee5d8eS3VersionKey5D85E7DD" + "Ref": "AssetParameters686794a6d724e01e517bba15106edebf9db8d4bb309f0c60d5ff55a11db4a856S3VersionKey1BCA0E57" } ] } @@ -57,7 +57,9 @@ "Ref": "AssetParameterse3410ccec04414535f1c8035ce0ea42f59eedf66d0e6d0eec8bc435c4a4e809dS3VersionKey8C8E79CA" } } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" } }, "Parameters": { @@ -73,17 +75,17 @@ "Type": "String", "Description": "Artifact hash for asset \"e3410ccec04414535f1c8035ce0ea42f59eedf66d0e6d0eec8bc435c4a4e809d\"" }, - "AssetParametersf94d2259295147a175eeb7f8b31856e4beb5d4d4654f0bf956ee51d5e2ee5d8eS3Bucket0211CC54": { + "AssetParameters686794a6d724e01e517bba15106edebf9db8d4bb309f0c60d5ff55a11db4a856S3BucketDF3BC15F": { "Type": "String", - "Description": "S3 bucket for asset \"f94d2259295147a175eeb7f8b31856e4beb5d4d4654f0bf956ee51d5e2ee5d8e\"" + "Description": "S3 bucket for asset \"686794a6d724e01e517bba15106edebf9db8d4bb309f0c60d5ff55a11db4a856\"" }, - "AssetParametersf94d2259295147a175eeb7f8b31856e4beb5d4d4654f0bf956ee51d5e2ee5d8eS3VersionKey5D85E7DD": { + "AssetParameters686794a6d724e01e517bba15106edebf9db8d4bb309f0c60d5ff55a11db4a856S3VersionKey1BCA0E57": { "Type": "String", - "Description": "S3 key for asset version \"f94d2259295147a175eeb7f8b31856e4beb5d4d4654f0bf956ee51d5e2ee5d8e\"" + "Description": "S3 key for asset version \"686794a6d724e01e517bba15106edebf9db8d4bb309f0c60d5ff55a11db4a856\"" }, - "AssetParametersf94d2259295147a175eeb7f8b31856e4beb5d4d4654f0bf956ee51d5e2ee5d8eArtifactHashD0519824": { + "AssetParameters686794a6d724e01e517bba15106edebf9db8d4bb309f0c60d5ff55a11db4a856ArtifactHash9043932C": { "Type": "String", - "Description": "Artifact hash for asset \"f94d2259295147a175eeb7f8b31856e4beb5d4d4654f0bf956ee51d5e2ee5d8e\"" + "Description": "Artifact hash for asset \"686794a6d724e01e517bba15106edebf9db8d4bb309f0c60d5ff55a11db4a856\"" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-nested-export-to-sibling.expected.json b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-nested-export-to-sibling.expected.json index 3cac1b07eb420..115a1f9130ae3 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-nested-export-to-sibling.expected.json +++ b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-nested-export-to-sibling.expected.json @@ -50,7 +50,9 @@ ] ] } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" } }, "Outputs": { diff --git a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-refs1.expected.json b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-refs1.expected.json index cf2e508a0f8eb..299d5005eff0f 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-refs1.expected.json +++ b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-refs1.expected.json @@ -70,7 +70,9 @@ ] ] } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" } }, "Parameters": { diff --git a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-refs2.expected.json b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-refs2.expected.json index ee7be9113bdcb..c6e818da02313 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-refs2.expected.json +++ b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-refs2.expected.json @@ -50,7 +50,9 @@ ] ] } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" } }, "Outputs": { diff --git a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-refs3.expected.json b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-refs3.expected.json index 80a2f7712026c..2ef738be2c023 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-refs3.expected.json +++ b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-refs3.expected.json @@ -49,7 +49,9 @@ ] ] } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "Nested2NestedStackNested2NestedStackResource877A1112": { "Type": "AWS::CloudFormation::Stack", @@ -108,7 +110,9 @@ ] } } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" } }, "Parameters": { diff --git a/packages/@aws-cdk/aws-cloudformation/test/test.nested-stack.ts b/packages/@aws-cdk/aws-cloudformation/test/test.nested-stack.ts index 64656faf0fca3..2149c48be5fd3 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/test.nested-stack.ts +++ b/packages/@aws-cdk/aws-cloudformation/test/test.nested-stack.ts @@ -130,6 +130,8 @@ export = { Resources: { nestedstackNestedStacknestedstackNestedStackResource71CDD241: { Type: 'AWS::CloudFormation::Stack', + DeletionPolicy: 'Delete', + UpdateReplacePolicy: 'Delete', Properties: { TemplateURL: { 'Fn::Join': [ @@ -718,7 +720,10 @@ export = { }, }); - const middleStackHash = 'b2670b4c0c3fdf1d8fd9b9272bb8bf8173d18c0f67a888ba165cc569a248a84f'; + const middleStackHash = '7c426f7299a739900279ac1ece040397c1913cdf786f5228677b289f4d5e4c48'; + const bucketSuffix = 'C706B101'; + const versionSuffix = '4B193AA5'; + const hashSuffix = 'E28F0693'; // nested1 wires the nested2 template through parameters, so we expect those expect(nested1).to(haveResource('Resource::1')); @@ -735,9 +740,9 @@ export = { AssetParameters8169c6f8aaeaf5e2e8620f5f895ffe2099202ccb4b6889df48fe0967a894235cS3BucketDE3B88D6: { Type: 'String', Description: 'S3 bucket for asset "8169c6f8aaeaf5e2e8620f5f895ffe2099202ccb4b6889df48fe0967a894235c"' }, AssetParameters8169c6f8aaeaf5e2e8620f5f895ffe2099202ccb4b6889df48fe0967a894235cS3VersionKey3A62EFEA: { Type: 'String', Description: 'S3 key for asset version "8169c6f8aaeaf5e2e8620f5f895ffe2099202ccb4b6889df48fe0967a894235c"' }, AssetParameters8169c6f8aaeaf5e2e8620f5f895ffe2099202ccb4b6889df48fe0967a894235cArtifactHash7DC546E0: { Type: 'String', Description: 'Artifact hash for asset "8169c6f8aaeaf5e2e8620f5f895ffe2099202ccb4b6889df48fe0967a894235c"' }, - [`AssetParameters${middleStackHash}S3Bucket3DB431CB`]: { Type: 'String', Description: `S3 bucket for asset "${middleStackHash}"` }, - [`AssetParameters${middleStackHash}S3VersionKeyBFFDABE9`]: { Type: 'String', Description: `S3 key for asset version "${middleStackHash}"` }, - [`AssetParameters${middleStackHash}ArtifactHash8EA52875`]: { Type: 'String', Description: `Artifact hash for asset "${middleStackHash}"` }, + [`AssetParameters${middleStackHash}S3Bucket${bucketSuffix}`]: { Type: 'String', Description: `S3 bucket for asset "${middleStackHash}"` }, + [`AssetParameters${middleStackHash}S3VersionKey${versionSuffix}`]: { Type: 'String', Description: `S3 key for asset version "${middleStackHash}"` }, + [`AssetParameters${middleStackHash}ArtifactHash${hashSuffix}`]: { Type: 'String', Description: `Artifact hash for asset "${middleStackHash}"` }, }); // proxy asset params to nested stack diff --git a/packages/@aws-cdk/aws-cloudfront-origins/package.json b/packages/@aws-cdk/aws-cloudfront-origins/package.json index 7ea4b267dbf32..d90ce2d097315 100644 --- a/packages/@aws-cdk/aws-cloudfront-origins/package.json +++ b/packages/@aws-cdk/aws-cloudfront-origins/package.json @@ -71,7 +71,7 @@ "devDependencies": { "@aws-cdk/assert": "0.0.0", "@aws-cdk/aws-ec2": "0.0.0", - "aws-sdk": "^2.845.0", + "aws-sdk": "^2.848.0", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "pkglint": "0.0.0" diff --git a/packages/@aws-cdk/aws-cloudfront/package.json b/packages/@aws-cdk/aws-cloudfront/package.json index e2faa8f8e12cf..75b18c5b95444 100644 --- a/packages/@aws-cdk/aws-cloudfront/package.json +++ b/packages/@aws-cdk/aws-cloudfront/package.json @@ -72,7 +72,7 @@ "license": "Apache-2.0", "devDependencies": { "@aws-cdk/assert": "0.0.0", - "aws-sdk": "^2.845.0", + "aws-sdk": "^2.848.0", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "cfn2ts": "0.0.0", diff --git a/packages/@aws-cdk/aws-cloudtrail/package.json b/packages/@aws-cdk/aws-cloudtrail/package.json index a3e7573dfe731..ce2c1f2e647ed 100644 --- a/packages/@aws-cdk/aws-cloudtrail/package.json +++ b/packages/@aws-cdk/aws-cloudtrail/package.json @@ -72,7 +72,7 @@ "license": "Apache-2.0", "devDependencies": { "@aws-cdk/assert": "0.0.0", - "aws-sdk": "^2.845.0", + "aws-sdk": "^2.848.0", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "cfn2ts": "0.0.0", diff --git a/packages/@aws-cdk/aws-codebuild/package.json b/packages/@aws-cdk/aws-codebuild/package.json index cddc43d715ba0..7b268062d474f 100644 --- a/packages/@aws-cdk/aws-codebuild/package.json +++ b/packages/@aws-cdk/aws-codebuild/package.json @@ -78,7 +78,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@types/nodeunit": "^0.0.31", - "aws-sdk": "^2.845.0", + "aws-sdk": "^2.848.0", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "cfn2ts": "0.0.0", diff --git a/packages/@aws-cdk/aws-codebuild/test/integ.caching.expected.json b/packages/@aws-cdk/aws-codebuild/test/integ.caching.expected.json index 248d2e31c9ac8..c1680ca40cea9 100644 --- a/packages/@aws-cdk/aws-codebuild/test/integ.caching.expected.json +++ b/packages/@aws-cdk/aws-codebuild/test/integ.caching.expected.json @@ -33,7 +33,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -171,4 +171,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/aws-codebuild/test/integ.project-buildspec-artifacts.expected.json b/packages/@aws-cdk/aws-codebuild/test/integ.project-buildspec-artifacts.expected.json index b2101c7135f2f..9ad98f441d7a6 100644 --- a/packages/@aws-cdk/aws-codebuild/test/integ.project-buildspec-artifacts.expected.json +++ b/packages/@aws-cdk/aws-codebuild/test/integ.project-buildspec-artifacts.expected.json @@ -33,7 +33,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -163,4 +163,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/aws-codebuild/test/integ.project-logging.expected.json b/packages/@aws-cdk/aws-codebuild/test/integ.project-logging.expected.json index e68bc6b47d2b4..722f076547ea3 100644 --- a/packages/@aws-cdk/aws-codebuild/test/integ.project-logging.expected.json +++ b/packages/@aws-cdk/aws-codebuild/test/integ.project-logging.expected.json @@ -38,7 +38,7 @@ { "Action": [ "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -220,4 +220,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/aws-codebuild/test/integ.project-secondary-sources-artifacts.expected.json b/packages/@aws-cdk/aws-codebuild/test/integ.project-secondary-sources-artifacts.expected.json index 7d6a3f783c899..c346580c024f1 100644 --- a/packages/@aws-cdk/aws-codebuild/test/integ.project-secondary-sources-artifacts.expected.json +++ b/packages/@aws-cdk/aws-codebuild/test/integ.project-secondary-sources-artifacts.expected.json @@ -63,7 +63,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -215,4 +215,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/aws-codecommit/package.json b/packages/@aws-cdk/aws-codecommit/package.json index 36d6a84f8ad2e..0580fab198c85 100644 --- a/packages/@aws-cdk/aws-codecommit/package.json +++ b/packages/@aws-cdk/aws-codecommit/package.json @@ -78,7 +78,7 @@ "@aws-cdk/assert": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@types/nodeunit": "^0.0.31", - "aws-sdk": "^2.845.0", + "aws-sdk": "^2.848.0", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "cfn2ts": "0.0.0", diff --git a/packages/@aws-cdk/aws-codepipeline-actions/package.json b/packages/@aws-cdk/aws-codepipeline-actions/package.json index c5b2115f2d944..76381cfdbbb47 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/package.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/package.json @@ -72,7 +72,7 @@ "@types/nodeunit": "^0.0.31", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", - "lodash": "^4.17.20", + "lodash": "^4.17.21", "nodeunit": "^0.11.3", "pkglint": "0.0.0" }, diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.cfn-template-from-repo.lit.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.cfn-template-from-repo.lit.expected.json index 8f708cfa71a21..2ce8cf8f817bf 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.cfn-template-from-repo.lit.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.cfn-template-from-repo.lit.expected.json @@ -111,7 +111,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -392,7 +392,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.expected.json index 9547f050e1e8b..3605965c27ac5 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.expected.json @@ -105,7 +105,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -460,7 +460,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -573,7 +573,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -1302,7 +1302,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -1521,7 +1521,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-pipeline.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-pipeline.expected.json index 3ff81600a78eb..a273e176cd6e7 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-pipeline.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-pipeline.expected.json @@ -105,7 +105,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -340,7 +340,7 @@ { "Action": [ "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-alexa-deploy.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-alexa-deploy.expected.json index 561b739cb4b1c..8e0fde48bed21 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-alexa-deploy.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-alexa-deploy.expected.json @@ -115,7 +115,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -339,7 +339,7 @@ { "Action": [ "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn-cross-region.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn-cross-region.expected.json index 33fc6ee2f7b1e..127ce4b1fae86 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn-cross-region.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn-cross-region.expected.json @@ -38,7 +38,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -264,7 +264,7 @@ { "Action": [ "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -482,4 +482,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn-with-action-role.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn-with-action-role.expected.json index c9511c58846fa..9c3b1e1940fde 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn-with-action-role.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn-with-action-role.expected.json @@ -163,7 +163,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -383,7 +383,7 @@ { "Action": [ "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -485,4 +485,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn.expected.json index 67aaceac34f75..4b54eb7757227 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn.expected.json @@ -105,7 +105,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -392,7 +392,7 @@ { "Action": [ "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -515,7 +515,7 @@ { "Action": [ "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-build-batch.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-build-batch.expected.json index 3e9b5d76ec027..67025b2e96c68 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-build-batch.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-build-batch.expected.json @@ -109,7 +109,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-build-multiple-inputs-outputs.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-build-multiple-inputs-outputs.expected.json index ce11844d4a671..c5041087d978a 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-build-multiple-inputs-outputs.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-build-multiple-inputs-outputs.expected.json @@ -109,7 +109,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -195,7 +195,7 @@ { "Action": [ "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -556,7 +556,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-commit-build.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-commit-build.expected.json index e2292c1bbbdbd..6292ae43e5811 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-commit-build.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-commit-build.expected.json @@ -91,7 +91,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -362,7 +362,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -620,7 +620,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-commit.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-commit.expected.json index bde54408d887d..fe71ea09ade8d 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-commit.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-commit.expected.json @@ -176,7 +176,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -382,7 +382,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-deploy-ecs.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-deploy-ecs.expected.json index bf74072797472..90ac50068841e 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-deploy-ecs.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-deploy-ecs.expected.json @@ -38,7 +38,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -257,7 +257,7 @@ { "Action": [ "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -470,4 +470,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-deploy.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-deploy.expected.json index 6f9ce9cbd417f..78e721477f5ce 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-deploy.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-deploy.expected.json @@ -123,7 +123,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -340,7 +340,7 @@ { "Action": [ "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -548,4 +548,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecr-source.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecr-source.expected.json index 9610c9c53705a..384e784a5ca76 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecr-source.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecr-source.expected.json @@ -33,7 +33,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -216,7 +216,7 @@ { "Action": [ "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -412,4 +412,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecs-deploy.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecs-deploy.expected.json index 90360e47b3b27..5704161a5f89c 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecs-deploy.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecs-deploy.expected.json @@ -426,7 +426,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -572,7 +572,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -839,7 +839,7 @@ { "Action": [ "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -1043,4 +1043,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecs-separate-source.lit.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecs-separate-source.lit.expected.json index 5b487d51f1219..e8cbcadeef665 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecs-separate-source.lit.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecs-separate-source.lit.expected.json @@ -393,7 +393,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -632,7 +632,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -955,7 +955,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -1052,7 +1052,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-events.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-events.expected.json index 50e081f6300f9..7506be08efa70 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-events.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-events.expected.json @@ -105,7 +105,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -326,7 +326,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -713,7 +713,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-jenkins.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-jenkins.expected.json index 631c4bb0795a3..a77528a3a8240 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-jenkins.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-jenkins.expected.json @@ -38,7 +38,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -275,7 +275,7 @@ { "Action": [ "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -372,4 +372,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-manual-approval.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-manual-approval.expected.json index 5e1ea9110c95e..1730744a18c4d 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-manual-approval.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-manual-approval.expected.json @@ -33,7 +33,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -242,7 +242,7 @@ { "Action": [ "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -349,4 +349,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-s3-deploy.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-s3-deploy.expected.json index d37bdc0c6798c..6f0330fa93862 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-s3-deploy.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-s3-deploy.expected.json @@ -43,7 +43,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -260,7 +260,7 @@ { "Action": [ "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -338,7 +338,7 @@ { "Action": [ "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -425,4 +425,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-stepfunctions.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-stepfunctions.expected.json index da70221749108..973a1d986205a 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-stepfunctions.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-stepfunctions.expected.json @@ -148,7 +148,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -385,7 +385,7 @@ { "Action": [ "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", diff --git a/packages/@aws-cdk/aws-cognito/lib/user-pool.ts b/packages/@aws-cdk/aws-cognito/lib/user-pool.ts index d85199ee6507f..eff29527ab4af 100644 --- a/packages/@aws-cdk/aws-cognito/lib/user-pool.ts +++ b/packages/@aws-cdk/aws-cognito/lib/user-pool.ts @@ -1,6 +1,6 @@ import { IRole, PolicyDocument, PolicyStatement, Role, ServicePrincipal } from '@aws-cdk/aws-iam'; import * as lambda from '@aws-cdk/aws-lambda'; -import { Duration, IResource, Lazy, Names, Resource, Stack, Token } from '@aws-cdk/core'; +import { Duration, IResource, Lazy, Names, RemovalPolicy, Resource, Stack, Token } from '@aws-cdk/core'; import { Construct } from 'constructs'; import { toASCII as punycodeEncode } from 'punycode/'; import { CfnUserPool } from './cognito.generated'; @@ -567,6 +567,13 @@ export interface UserPoolProps { * @default AccountRecovery.PHONE_WITHOUT_MFA_AND_EMAIL */ readonly accountRecovery?: AccountRecovery; + + /** + * Policy to apply when the user pool is removed from the stack + * + * @default RemovalPolicy.RETAIN + */ + readonly removalPolicy?: RemovalPolicy; } /** @@ -756,6 +763,7 @@ export class UserPool extends UserPoolBase { }), accountRecoverySetting: this.accountRecovery(props), }); + userPool.applyRemovalPolicy(props.removalPolicy); this.userPoolId = userPool.ref; this.userPoolArn = userPool.attrArn; diff --git a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-client-explicit-props.expected.json b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-client-explicit-props.expected.json index 6d118b0cf046c..c2c5b4d18b269 100644 --- a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-client-explicit-props.expected.json +++ b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-client-explicit-props.expected.json @@ -27,7 +27,9 @@ "EmailSubject": "Verify your new account", "SmsMessage": "The verification code to your new account is {####}" } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "myuserpoolmyuserpoolclientAFB2274E": { "Type": "AWS::Cognito::UserPoolClient", @@ -64,9 +66,25 @@ "COGNITO" ], "WriteAttributes": [ - "address", "birthdate", "custom:attribute_one", "custom:attribute_two", "email", - "family_name", "gender", "given_name", "locale", "middle_name", "name", "nickname", "phone_number", - "picture", "preferred_username", "profile", "updated_at", "website", "zoneinfo" + "address", + "birthdate", + "custom:attribute_one", + "custom:attribute_two", + "email", + "family_name", + "gender", + "given_name", + "locale", + "middle_name", + "name", + "nickname", + "phone_number", + "picture", + "preferred_username", + "profile", + "updated_at", + "website", + "zoneinfo" ] } } diff --git a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-client-explicit-props.ts b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-client-explicit-props.ts index 2cd4557cdb48a..d8a058a86d9c8 100644 --- a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-client-explicit-props.ts +++ b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-client-explicit-props.ts @@ -1,10 +1,12 @@ -import { App, Stack } from '@aws-cdk/core'; +import { App, RemovalPolicy, Stack } from '@aws-cdk/core'; import { OAuthScope, UserPool, ClientAttributes } from '../lib'; const app = new App(); const stack = new Stack(app, 'integ-user-pool-client-explicit-props'); -const userpool = new UserPool(stack, 'myuserpool'); +const userpool = new UserPool(stack, 'myuserpool', { + removalPolicy: RemovalPolicy.DESTROY, +}); userpool.addClient('myuserpoolclient', { userPoolClientName: 'myuserpoolclient', diff --git a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-domain-cfdist.expected.json b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-domain-cfdist.expected.json index 5f3a61539ea8a..e9a67d39c9235 100644 --- a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-domain-cfdist.expected.json +++ b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-domain-cfdist.expected.json @@ -27,7 +27,9 @@ "EmailSubject": "Verify your new account", "SmsMessage": "The verification code to your new account is {####}" } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "UserPoolDomainD0EA232A": { "Type": "AWS::Cognito::UserPoolDomain", @@ -38,6 +40,27 @@ } } }, + "UserPoolDomainCloudFrontDomainNameCustomResourcePolicy7DE54188": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "cognito-idp:DescribeUserPoolDomain", + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "UserPoolDomainCloudFrontDomainNameCustomResourcePolicy7DE54188", + "Roles": [ + { + "Ref": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" + } + ] + } + }, "UserPoolDomainCloudFrontDomainNameE213E594": { "Type": "Custom::UserPoolCloudFrontDomainName", "Properties": { @@ -77,11 +100,11 @@ }, "InstallLatestAwsSdk": true }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete", "DependsOn": [ "UserPoolDomainCloudFrontDomainNameCustomResourcePolicy7DE54188" - ] + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2": { "Type": "AWS::IAM::Role", @@ -114,29 +137,12 @@ ] } }, - "UserPoolDomainCloudFrontDomainNameCustomResourcePolicy7DE54188": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action":"cognito-idp:DescribeUserPoolDomain", - "Effect":"Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "UserPoolDomainCloudFrontDomainNameCustomResourcePolicy7DE54188", - "Roles": [{"Ref":"AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2"}] - } - }, "AWS679f53fac002430cb0da5b7982bd22872D164C4C": { "Type": "AWS::Lambda::Function", "Properties": { "Code": { "S3Bucket": { - "Ref": "AssetParametersd731b1475f16a318a48a76c83d255f7422cfa5f025c5bff93537b8f0b8e94557S3BucketA250C084" + "Ref": "AssetParametersb64b129569a5ac7a9abf88a18ac0b504d1fb1208872460476ed3fd435830eb94S3Bucket38F1BB8E" }, "S3Key": { "Fn::Join": [ @@ -149,7 +155,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParametersd731b1475f16a318a48a76c83d255f7422cfa5f025c5bff93537b8f0b8e94557S3VersionKeyDC4F0CD7" + "Ref": "AssetParametersb64b129569a5ac7a9abf88a18ac0b504d1fb1208872460476ed3fd435830eb94S3VersionKeyCCDC67C0" } ] } @@ -162,7 +168,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParametersd731b1475f16a318a48a76c83d255f7422cfa5f025c5bff93537b8f0b8e94557S3VersionKeyDC4F0CD7" + "Ref": "AssetParametersb64b129569a5ac7a9abf88a18ac0b504d1fb1208872460476ed3fd435830eb94S3VersionKeyCCDC67C0" } ] } @@ -172,13 +178,13 @@ ] } }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2", "Arn" ] }, + "Handler": "index.handler", "Runtime": "nodejs12.x", "Timeout": 120 }, @@ -203,17 +209,17 @@ } }, "Parameters": { - "AssetParametersd731b1475f16a318a48a76c83d255f7422cfa5f025c5bff93537b8f0b8e94557S3BucketA250C084": { + "AssetParametersb64b129569a5ac7a9abf88a18ac0b504d1fb1208872460476ed3fd435830eb94S3Bucket38F1BB8E": { "Type": "String", - "Description": "S3 bucket for asset \"d731b1475f16a318a48a76c83d255f7422cfa5f025c5bff93537b8f0b8e94557\"" + "Description": "S3 bucket for asset \"b64b129569a5ac7a9abf88a18ac0b504d1fb1208872460476ed3fd435830eb94\"" }, - "AssetParametersd731b1475f16a318a48a76c83d255f7422cfa5f025c5bff93537b8f0b8e94557S3VersionKeyDC4F0CD7": { + "AssetParametersb64b129569a5ac7a9abf88a18ac0b504d1fb1208872460476ed3fd435830eb94S3VersionKeyCCDC67C0": { "Type": "String", - "Description": "S3 key for asset version \"d731b1475f16a318a48a76c83d255f7422cfa5f025c5bff93537b8f0b8e94557\"" + "Description": "S3 key for asset version \"b64b129569a5ac7a9abf88a18ac0b504d1fb1208872460476ed3fd435830eb94\"" }, - "AssetParametersd731b1475f16a318a48a76c83d255f7422cfa5f025c5bff93537b8f0b8e94557ArtifactHash5701DE73": { + "AssetParametersb64b129569a5ac7a9abf88a18ac0b504d1fb1208872460476ed3fd435830eb94ArtifactHash782948FC": { "Type": "String", - "Description": "Artifact hash for asset \"d731b1475f16a318a48a76c83d255f7422cfa5f025c5bff93537b8f0b8e94557\"" + "Description": "Artifact hash for asset \"b64b129569a5ac7a9abf88a18ac0b504d1fb1208872460476ed3fd435830eb94\"" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-domain-cfdist.ts b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-domain-cfdist.ts index 7a45e144ffc3c..2c646a52721ae 100644 --- a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-domain-cfdist.ts +++ b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-domain-cfdist.ts @@ -1,5 +1,5 @@ /// !cdk-integ pragma:ignore-assets -import { App, CfnOutput, Stack } from '@aws-cdk/core'; +import { App, CfnOutput, RemovalPolicy, Stack } from '@aws-cdk/core'; import { UserPool } from '../lib'; /* @@ -10,7 +10,9 @@ import { UserPool } from '../lib'; const app = new App(); const stack = new Stack(app, 'integ-user-pool-domain-cfdist'); -const userpool = new UserPool(stack, 'UserPool'); +const userpool = new UserPool(stack, 'UserPool', { + removalPolicy: RemovalPolicy.DESTROY, +}); const domain = userpool.addDomain('Domain', { cognitoDomain: { diff --git a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-domain-signinurl.expected.json b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-domain-signinurl.expected.json index 694cf43b5f5ea..f19f82379b701 100644 --- a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-domain-signinurl.expected.json +++ b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-domain-signinurl.expected.json @@ -27,7 +27,9 @@ "EmailSubject": "Verify your new account", "SmsMessage": "The verification code to your new account is {####}" } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "UserPoolDomainD0EA232A": { "Type": "AWS::Cognito::UserPoolDomain", diff --git a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-domain-signinurl.ts b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-domain-signinurl.ts index 7d55d08fe12bb..7b26359354f9b 100644 --- a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-domain-signinurl.ts +++ b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-domain-signinurl.ts @@ -1,4 +1,4 @@ -import { App, CfnOutput, Stack } from '@aws-cdk/core'; +import { App, CfnOutput, RemovalPolicy, Stack } from '@aws-cdk/core'; import { UserPool } from '../lib'; /* @@ -10,7 +10,9 @@ import { UserPool } from '../lib'; const app = new App(); const stack = new Stack(app, 'integ-user-pool-domain-signinurl'); -const userpool = new UserPool(stack, 'UserPool'); +const userpool = new UserPool(stack, 'UserPool', { + removalPolicy: RemovalPolicy.DESTROY, +}); const domain = userpool.addDomain('Domain', { cognitoDomain: { diff --git a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-explicit-props.expected.json b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-explicit-props.expected.json index ed77c3b7baa53..50da9815a769b 100644 --- a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-explicit-props.expected.json +++ b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-explicit-props.expected.json @@ -37,15 +37,15 @@ "Code": { "ZipFile": "foo" }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "createAuthChallengeServiceRole611710B5", "Arn" ] }, - "Runtime": "nodejs12.x", - "FunctionName": "createAuthChallenge" + "FunctionName": "createAuthChallenge", + "Handler": "index.handler", + "Runtime": "nodejs12.x" }, "DependsOn": [ "createAuthChallengeServiceRole611710B5" @@ -101,15 +101,15 @@ "Code": { "ZipFile": "foo" }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "customMessageServiceRoleB4AE7F17", "Arn" ] }, - "Runtime": "nodejs12.x", - "FunctionName": "customMessage" + "FunctionName": "customMessage", + "Handler": "index.handler", + "Runtime": "nodejs12.x" }, "DependsOn": [ "customMessageServiceRoleB4AE7F17" @@ -165,15 +165,15 @@ "Code": { "ZipFile": "foo" }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "defineAuthChallengeServiceRole9E2D15DF", "Arn" ] }, - "Runtime": "nodejs12.x", - "FunctionName": "defineAuthChallenge" + "FunctionName": "defineAuthChallenge", + "Handler": "index.handler", + "Runtime": "nodejs12.x" }, "DependsOn": [ "defineAuthChallengeServiceRole9E2D15DF" @@ -229,15 +229,15 @@ "Code": { "ZipFile": "foo" }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "postAuthenticationServiceRole5B3B242A", "Arn" ] }, - "Runtime": "nodejs12.x", - "FunctionName": "postAuthentication" + "FunctionName": "postAuthentication", + "Handler": "index.handler", + "Runtime": "nodejs12.x" }, "DependsOn": [ "postAuthenticationServiceRole5B3B242A" @@ -293,15 +293,15 @@ "Code": { "ZipFile": "foo" }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "postConfirmationServiceRole864BE5F9", "Arn" ] }, - "Runtime": "nodejs12.x", - "FunctionName": "postConfirmation" + "FunctionName": "postConfirmation", + "Handler": "index.handler", + "Runtime": "nodejs12.x" }, "DependsOn": [ "postConfirmationServiceRole864BE5F9" @@ -357,15 +357,15 @@ "Code": { "ZipFile": "foo" }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "preAuthenticationServiceRole9712F4D8", "Arn" ] }, - "Runtime": "nodejs12.x", - "FunctionName": "preAuthentication" + "FunctionName": "preAuthentication", + "Handler": "index.handler", + "Runtime": "nodejs12.x" }, "DependsOn": [ "preAuthenticationServiceRole9712F4D8" @@ -421,15 +421,15 @@ "Code": { "ZipFile": "foo" }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "preSignUpServiceRole0A7E91EB", "Arn" ] }, - "Runtime": "nodejs12.x", - "FunctionName": "preSignUp" + "FunctionName": "preSignUp", + "Handler": "index.handler", + "Runtime": "nodejs12.x" }, "DependsOn": [ "preSignUpServiceRole0A7E91EB" @@ -485,15 +485,15 @@ "Code": { "ZipFile": "foo" }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "preTokenGenerationServiceRole430C3D14", "Arn" ] }, - "Runtime": "nodejs12.x", - "FunctionName": "preTokenGeneration" + "FunctionName": "preTokenGeneration", + "Handler": "index.handler", + "Runtime": "nodejs12.x" }, "DependsOn": [ "preTokenGenerationServiceRole430C3D14" @@ -549,15 +549,15 @@ "Code": { "ZipFile": "foo" }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "userMigrationServiceRole091766B0", "Arn" ] }, - "Runtime": "nodejs12.x", - "FunctionName": "userMigration" + "FunctionName": "userMigration", + "Handler": "index.handler", + "Runtime": "nodejs12.x" }, "DependsOn": [ "userMigrationServiceRole091766B0" @@ -613,15 +613,15 @@ "Code": { "ZipFile": "foo" }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "verifyAuthChallengeResponseServiceRole7077884C", "Arn" ] }, - "Runtime": "nodejs12.x", - "FunctionName": "verifyAuthChallengeResponse" + "FunctionName": "verifyAuthChallengeResponse", + "Handler": "index.handler", + "Runtime": "nodejs12.x" }, "DependsOn": [ "verifyAuthChallengeResponseServiceRole7077884C" @@ -843,7 +843,9 @@ "EmailSubject": "verification email subject from the integ test", "SmsMessage": "verification sms message from the integ test. Code is {####}." } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "myuserpoolmyuserpooldomainEE1E11AF": { "Type": "AWS::Cognito::UserPoolDomain", diff --git a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-explicit-props.ts b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-explicit-props.ts index 261251e1e2592..1bc35003fa472 100644 --- a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-explicit-props.ts +++ b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-explicit-props.ts @@ -1,11 +1,12 @@ import { Code, Function, IFunction, Runtime } from '@aws-cdk/aws-lambda'; -import { App, CfnOutput, Duration, Stack } from '@aws-cdk/core'; +import { App, CfnOutput, Duration, RemovalPolicy, Stack } from '@aws-cdk/core'; import { BooleanAttribute, DateTimeAttribute, Mfa, NumberAttribute, StringAttribute, UserPool } from '../lib'; const app = new App(); const stack = new Stack(app, 'integ-user-pool'); const userpool = new UserPool(stack, 'myuserpool', { + removalPolicy: RemovalPolicy.DESTROY, userPoolName: 'MyUserPool', userInvitation: { emailSubject: 'invitation email subject from the integ test', diff --git a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-idp.amazon.expected.json b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-idp.amazon.expected.json index e68a262eb7ee3..dd2188ee4e517 100644 --- a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-idp.amazon.expected.json +++ b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-idp.amazon.expected.json @@ -27,7 +27,9 @@ "EmailSubject": "Verify your new account", "SmsMessage": "The verification code to your new account is {####}" } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "poolclient2623294C": { "Type": "AWS::Cognito::UserPoolClient", diff --git a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-idp.amazon.ts b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-idp.amazon.ts index 7252dfc0a8a40..77b95a5857330 100644 --- a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-idp.amazon.ts +++ b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-idp.amazon.ts @@ -1,4 +1,4 @@ -import { App, CfnOutput, Stack } from '@aws-cdk/core'; +import { App, CfnOutput, RemovalPolicy, Stack } from '@aws-cdk/core'; import { ProviderAttribute, UserPool, UserPoolIdentityProviderAmazon } from '../lib'; /* @@ -9,7 +9,9 @@ import { ProviderAttribute, UserPool, UserPoolIdentityProviderAmazon } from '../ const app = new App(); const stack = new Stack(app, 'integ-user-pool-idp-amazon'); -const userpool = new UserPool(stack, 'pool'); +const userpool = new UserPool(stack, 'pool', { + removalPolicy: RemovalPolicy.DESTROY, +}); new UserPoolIdentityProviderAmazon(stack, 'amazon', { userPool: userpool, diff --git a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-idp.google.expected.json b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-idp.google.expected.json index c767ee9d2d260..b90dd7faec0dd 100644 --- a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-idp.google.expected.json +++ b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-idp.google.expected.json @@ -27,7 +27,9 @@ "EmailSubject": "Verify your new account", "SmsMessage": "The verification code to your new account is {####}" } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "poolclient2623294C": { "Type": "AWS::Cognito::UserPoolClient", diff --git a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-idp.google.ts b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-idp.google.ts index fac20b8351d38..f4ea4d077286d 100644 --- a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-idp.google.ts +++ b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-idp.google.ts @@ -1,4 +1,4 @@ -import { App, CfnOutput, Stack } from '@aws-cdk/core'; +import { App, CfnOutput, RemovalPolicy, Stack } from '@aws-cdk/core'; import { ProviderAttribute, UserPool, UserPoolIdentityProviderGoogle } from '../lib'; /* @@ -9,7 +9,9 @@ import { ProviderAttribute, UserPool, UserPoolIdentityProviderGoogle } from '../ const app = new App(); const stack = new Stack(app, 'integ-user-pool-idp-google'); -const userpool = new UserPool(stack, 'pool'); +const userpool = new UserPool(stack, 'pool', { + removalPolicy: RemovalPolicy.DESTROY, +}); new UserPoolIdentityProviderGoogle(stack, 'google', { userPool: userpool, diff --git a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-resource-server.expected.json b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-resource-server.expected.json index ffc765b879357..36b033a51f2fb 100644 --- a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-resource-server.expected.json +++ b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-resource-server.expected.json @@ -28,7 +28,9 @@ "EmailSubject": "Verify your new account", "SmsMessage": "The verification code to your new account is {####}" } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "myuserpoolmyserver50C4D8E9": { "Type": "AWS::Cognito::UserPoolResourceServer", diff --git a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-resource-server.ts b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-resource-server.ts index 8610d7a3e1296..cd56612c65cd7 100644 --- a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-resource-server.ts +++ b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-resource-server.ts @@ -1,4 +1,4 @@ -import { App, CfnOutput, Stack } from '@aws-cdk/core'; +import { App, CfnOutput, RemovalPolicy, Stack } from '@aws-cdk/core'; import { OAuthScope, ResourceServerScope, UserPool } from '../lib'; const app = new App(); @@ -14,6 +14,7 @@ const stack = new Stack(app, 'integ-user-pool-resource-server'); */ const userPool = new UserPool(stack, 'myuserpool', { userPoolName: 'MyUserPool', + removalPolicy: RemovalPolicy.DESTROY, }); const readScope = new ResourceServerScope({ scopeName: 'read', scopeDescription: 'read only' }); diff --git a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-signup-code.expected.json b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-signup-code.expected.json index 5cc13052434f2..091b5f4cb7a8a 100644 --- a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-signup-code.expected.json +++ b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-signup-code.expected.json @@ -87,7 +87,9 @@ "EmailSubject": "integ-test: Verify your account", "SmsMessage": "integ-test: Account verification code is {####}" } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "myuserpoolclient8A58A3E4": { "Type": "AWS::Cognito::UserPoolClient", diff --git a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-signup-code.ts b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-signup-code.ts index 12e8c1d354ea3..9118b4c912adf 100644 --- a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-signup-code.ts +++ b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-signup-code.ts @@ -1,4 +1,4 @@ -import { App, CfnOutput, Stack } from '@aws-cdk/core'; +import { App, CfnOutput, RemovalPolicy, Stack } from '@aws-cdk/core'; import { UserPool, UserPoolClient, VerificationEmailStyle } from '../lib'; /* @@ -15,6 +15,7 @@ const app = new App(); const stack = new Stack(app, 'integ-user-pool-signup-code'); const userpool = new UserPool(stack, 'myuserpool', { + removalPolicy: RemovalPolicy.DESTROY, userPoolName: 'MyUserPool', autoVerify: { email: true, diff --git a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-signup-link.expected.json b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-signup-link.expected.json index 53c9f89ed8031..f5cca975e608b 100644 --- a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-signup-link.expected.json +++ b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-signup-link.expected.json @@ -85,7 +85,9 @@ "EmailSubjectByLink": "integ-test: Verify your account", "SmsMessage": "integ-test: Account verification code is {####}" } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "myuserpoolmyuserpooldomainEE1E11AF": { "Type": "AWS::Cognito::UserPoolDomain", diff --git a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-signup-link.ts b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-signup-link.ts index 92f0452010f22..b7121720ad940 100644 --- a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-signup-link.ts +++ b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-signup-link.ts @@ -1,4 +1,4 @@ -import { App, CfnOutput, Stack } from '@aws-cdk/core'; +import { App, CfnOutput, RemovalPolicy, Stack } from '@aws-cdk/core'; import { UserPool, UserPoolClient, VerificationEmailStyle } from '../lib'; /* @@ -15,6 +15,7 @@ const app = new App(); const stack = new Stack(app, 'integ-user-pool-signup-link'); const userpool = new UserPool(stack, 'myuserpool', { + removalPolicy: RemovalPolicy.DESTROY, userPoolName: 'MyUserPool', autoVerify: { email: true, diff --git a/packages/@aws-cdk/aws-cognito/test/integ.user-pool.expected.json b/packages/@aws-cdk/aws-cognito/test/integ.user-pool.expected.json index 85214615c050d..a3a50d2f5287b 100644 --- a/packages/@aws-cdk/aws-cognito/test/integ.user-pool.expected.json +++ b/packages/@aws-cdk/aws-cognito/test/integ.user-pool.expected.json @@ -28,7 +28,9 @@ "EmailSubject": "Verify your new account", "SmsMessage": "The verification code to your new account is {####}" } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" } }, "Outputs": { diff --git a/packages/@aws-cdk/aws-cognito/test/integ.user-pool.ts b/packages/@aws-cdk/aws-cognito/test/integ.user-pool.ts index 565a6b1dd549e..5b587b8f94f75 100644 --- a/packages/@aws-cdk/aws-cognito/test/integ.user-pool.ts +++ b/packages/@aws-cdk/aws-cognito/test/integ.user-pool.ts @@ -1,4 +1,4 @@ -import { App, CfnOutput, Stack } from '@aws-cdk/core'; +import { App, CfnOutput, RemovalPolicy, Stack } from '@aws-cdk/core'; import { UserPool } from '../lib'; const app = new App(); @@ -6,6 +6,7 @@ const stack = new Stack(app, 'integ-user-pool'); const userpool = new UserPool(stack, 'myuserpool', { userPoolName: 'MyUserPool', + removalPolicy: RemovalPolicy.DESTROY, }); new CfnOutput(stack, 'user-pool-id', { diff --git a/packages/@aws-cdk/aws-cognito/test/user-pool.test.ts b/packages/@aws-cdk/aws-cognito/test/user-pool.test.ts index a2199eecce800..6801e8ada2568 100644 --- a/packages/@aws-cdk/aws-cognito/test/user-pool.test.ts +++ b/packages/@aws-cdk/aws-cognito/test/user-pool.test.ts @@ -1,5 +1,5 @@ import '@aws-cdk/assert/jest'; -import { ABSENT } from '@aws-cdk/assert/lib/assertions/have-resource'; +import { ABSENT, ResourcePart } from '@aws-cdk/assert/lib/assertions/have-resource'; import { Role, ServicePrincipal } from '@aws-cdk/aws-iam'; import * as lambda from '@aws-cdk/aws-lambda'; import { CfnParameter, Duration, Stack, Tags } from '@aws-cdk/core'; @@ -32,6 +32,10 @@ describe('User Pool', () => { SmsConfiguration: ABSENT, lambdaTriggers: ABSENT, }); + + expect(stack).toHaveResource('AWS::Cognito::UserPool', { + DeletionPolicy: 'Retain', + }, ResourcePart.CompleteDefinition); }); test('self sign up option is correctly configured', () => { diff --git a/packages/@aws-cdk/aws-docdb/lib/endpoint.ts b/packages/@aws-cdk/aws-docdb/lib/endpoint.ts index 229a0bf7f0e70..fcec7b3eb4a1a 100644 --- a/packages/@aws-cdk/aws-docdb/lib/endpoint.ts +++ b/packages/@aws-cdk/aws-docdb/lib/endpoint.ts @@ -40,7 +40,7 @@ export class Endpoint { public readonly port: number; /** - * The combination of "HOSTNAME:PORT" for this endpoint + * The combination of ``HOSTNAME:PORT`` for this endpoint. */ public readonly socketAddress: string; diff --git a/packages/@aws-cdk/aws-dynamodb/package.json b/packages/@aws-cdk/aws-dynamodb/package.json index ad19b5e91da6b..6ca3616c33ac8 100644 --- a/packages/@aws-cdk/aws-dynamodb/package.json +++ b/packages/@aws-cdk/aws-dynamodb/package.json @@ -73,7 +73,7 @@ "devDependencies": { "@aws-cdk/assert": "0.0.0", "@types/jest": "^26.0.20", - "aws-sdk": "^2.845.0", + "aws-sdk": "^2.848.0", "aws-sdk-mock": "^5.1.0", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", diff --git a/packages/@aws-cdk/aws-dynamodb/test/dynamodb.test.ts b/packages/@aws-cdk/aws-dynamodb/test/dynamodb.test.ts index 30dae02e8a0df..768094c253213 100644 --- a/packages/@aws-cdk/aws-dynamodb/test/dynamodb.test.ts +++ b/packages/@aws-cdk/aws-dynamodb/test/dynamodb.test.ts @@ -3,8 +3,9 @@ import '@aws-cdk/assert/jest'; import * as appscaling from '@aws-cdk/aws-applicationautoscaling'; import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; -import { App, Aws, CfnDeletionPolicy, ConstructNode, Duration, PhysicalName, RemovalPolicy, Stack, Tags } from '@aws-cdk/core'; +import { App, Aws, CfnDeletionPolicy, ConstructNode, Duration, PhysicalName, RemovalPolicy, Resource, Stack, Tags } from '@aws-cdk/core'; import { testLegacyBehavior } from 'cdk-build-tools/lib/feature-flag'; +import { Construct } from 'constructs'; import { Attribute, AttributeType, @@ -16,6 +17,7 @@ import { Table, TableEncryption, Operation, + CfnTable, } from '../lib'; /* eslint-disable quote-props */ @@ -2814,6 +2816,29 @@ describe('global', () => { }); }); +test('L1 inside L2 expects removalpolicy to have been set', () => { + // Check that the "stateful L1 validation generation" works. Do it here + // because we know DDB tables are stateful. + const app = new App(); + const stack = new Stack(app, 'Stack'); + + class FakeTableL2 extends Resource { + constructor(scope: Construct, id: string) { + super(scope, id); + + new CfnTable(this, 'Resource', { + keySchema: [{ attributeName: 'hash', keyType: 'S' }], + }); + } + } + + new FakeTableL2(stack, 'Table'); + + expect(() => { + SynthUtils.toCloudFormation(stack); + }).toThrow(/is a stateful resource type/); +}); + function testGrant(expectedActions: string[], invocation: (user: iam.IPrincipal, table: Table) => void) { // GIVEN const stack = new Stack(); diff --git a/packages/@aws-cdk/aws-dynamodb/test/integ.global-replicas-provisioned.expected.json b/packages/@aws-cdk/aws-dynamodb/test/integ.global-replicas-provisioned.expected.json index ec15f88fdfea8..89a9c3807fc21 100644 --- a/packages/@aws-cdk/aws-dynamodb/test/integ.global-replicas-provisioned.expected.json +++ b/packages/@aws-cdk/aws-dynamodb/test/integ.global-replicas-provisioned.expected.json @@ -302,7 +302,9 @@ "Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3VersionKeyA495226F" } } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" } }, "Conditions": { diff --git a/packages/@aws-cdk/aws-dynamodb/test/integ.global.expected.json b/packages/@aws-cdk/aws-dynamodb/test/integ.global.expected.json index 2301663780e86..a66dd3d965ed9 100644 --- a/packages/@aws-cdk/aws-dynamodb/test/integ.global.expected.json +++ b/packages/@aws-cdk/aws-dynamodb/test/integ.global.expected.json @@ -231,7 +231,7 @@ }, "/", { - "Ref": "AssetParameters51ac5fed1b824803906219cb11f0c17572739bd4fb019d961cdc1fbbfefc620eS3Bucket58C634A6" + "Ref": "AssetParametersf8cfc24954f0c95960d9a93888c01bf5e95802f26bfa5dc6fde5c913a1429ceaS3Bucket434BDB62" }, "/", { @@ -241,7 +241,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters51ac5fed1b824803906219cb11f0c17572739bd4fb019d961cdc1fbbfefc620eS3VersionKeyE8ACA4C1" + "Ref": "AssetParametersf8cfc24954f0c95960d9a93888c01bf5e95802f26bfa5dc6fde5c913a1429ceaS3VersionKey01638790" } ] } @@ -254,7 +254,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters51ac5fed1b824803906219cb11f0c17572739bd4fb019d961cdc1fbbfefc620eS3VersionKeyE8ACA4C1" + "Ref": "AssetParametersf8cfc24954f0c95960d9a93888c01bf5e95802f26bfa5dc6fde5c913a1429ceaS3VersionKey01638790" } ] } @@ -264,58 +264,60 @@ ] }, "Parameters": { - "referencetocdkdynamodbglobal20191121AssetParameters23c5f8cc1bdef276fc20dbb166d24d1b7d8cb516a5d5822ed0d38feec9631fd1S3BucketFE71C2D0Ref": { - "Ref": "AssetParameters23c5f8cc1bdef276fc20dbb166d24d1b7d8cb516a5d5822ed0d38feec9631fd1S3Bucket492F02B7" + "referencetocdkdynamodbglobal20191121AssetParametersf13d472270faaa08099009152a8848a0e7434b14773f3c3f94acca6f6c3ae714S3Bucket71E24D5BRef": { + "Ref": "AssetParametersf13d472270faaa08099009152a8848a0e7434b14773f3c3f94acca6f6c3ae714S3Bucket1C6779E0" }, - "referencetocdkdynamodbglobal20191121AssetParameters23c5f8cc1bdef276fc20dbb166d24d1b7d8cb516a5d5822ed0d38feec9631fd1S3VersionKey849A4FA5Ref": { - "Ref": "AssetParameters23c5f8cc1bdef276fc20dbb166d24d1b7d8cb516a5d5822ed0d38feec9631fd1S3VersionKeyC7F72494" + "referencetocdkdynamodbglobal20191121AssetParametersf13d472270faaa08099009152a8848a0e7434b14773f3c3f94acca6f6c3ae714S3VersionKeyD88E8BACRef": { + "Ref": "AssetParametersf13d472270faaa08099009152a8848a0e7434b14773f3c3f94acca6f6c3ae714S3VersionKey5C1D9275" }, - "referencetocdkdynamodbglobal20191121AssetParameters956c2f92ddbde06f551fdf914445c679dcadb21c6e8d1ee9c9632144ef5a2ad3S3Bucket80086951Ref": { - "Ref": "AssetParameters956c2f92ddbde06f551fdf914445c679dcadb21c6e8d1ee9c9632144ef5a2ad3S3Bucket0EEA1C2E" + "referencetocdkdynamodbglobal20191121AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3BucketC7F3A147Ref": { + "Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3BucketDC4B98B1" }, - "referencetocdkdynamodbglobal20191121AssetParameters956c2f92ddbde06f551fdf914445c679dcadb21c6e8d1ee9c9632144ef5a2ad3S3VersionKeyC3096D21Ref": { - "Ref": "AssetParameters956c2f92ddbde06f551fdf914445c679dcadb21c6e8d1ee9c9632144ef5a2ad3S3VersionKey7BCE18C9" + "referencetocdkdynamodbglobal20191121AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3VersionKeyB6346792Ref": { + "Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3VersionKeyA495226F" } } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" } }, "Parameters": { - "AssetParameters23c5f8cc1bdef276fc20dbb166d24d1b7d8cb516a5d5822ed0d38feec9631fd1S3Bucket492F02B7": { + "AssetParametersf13d472270faaa08099009152a8848a0e7434b14773f3c3f94acca6f6c3ae714S3Bucket1C6779E0": { "Type": "String", - "Description": "S3 bucket for asset \"23c5f8cc1bdef276fc20dbb166d24d1b7d8cb516a5d5822ed0d38feec9631fd1\"" + "Description": "S3 bucket for asset \"f13d472270faaa08099009152a8848a0e7434b14773f3c3f94acca6f6c3ae714\"" }, - "AssetParameters23c5f8cc1bdef276fc20dbb166d24d1b7d8cb516a5d5822ed0d38feec9631fd1S3VersionKeyC7F72494": { + "AssetParametersf13d472270faaa08099009152a8848a0e7434b14773f3c3f94acca6f6c3ae714S3VersionKey5C1D9275": { "Type": "String", - "Description": "S3 key for asset version \"23c5f8cc1bdef276fc20dbb166d24d1b7d8cb516a5d5822ed0d38feec9631fd1\"" + "Description": "S3 key for asset version \"f13d472270faaa08099009152a8848a0e7434b14773f3c3f94acca6f6c3ae714\"" }, - "AssetParameters23c5f8cc1bdef276fc20dbb166d24d1b7d8cb516a5d5822ed0d38feec9631fd1ArtifactHash43BB7053": { + "AssetParametersf13d472270faaa08099009152a8848a0e7434b14773f3c3f94acca6f6c3ae714ArtifactHash477AAEA7": { "Type": "String", - "Description": "Artifact hash for asset \"23c5f8cc1bdef276fc20dbb166d24d1b7d8cb516a5d5822ed0d38feec9631fd1\"" + "Description": "Artifact hash for asset \"f13d472270faaa08099009152a8848a0e7434b14773f3c3f94acca6f6c3ae714\"" }, - "AssetParameters956c2f92ddbde06f551fdf914445c679dcadb21c6e8d1ee9c9632144ef5a2ad3S3Bucket0EEA1C2E": { + "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3BucketDC4B98B1": { "Type": "String", - "Description": "S3 bucket for asset \"956c2f92ddbde06f551fdf914445c679dcadb21c6e8d1ee9c9632144ef5a2ad3\"" + "Description": "S3 bucket for asset \"daeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1\"" }, - "AssetParameters956c2f92ddbde06f551fdf914445c679dcadb21c6e8d1ee9c9632144ef5a2ad3S3VersionKey7BCE18C9": { + "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3VersionKeyA495226F": { "Type": "String", - "Description": "S3 key for asset version \"956c2f92ddbde06f551fdf914445c679dcadb21c6e8d1ee9c9632144ef5a2ad3\"" + "Description": "S3 key for asset version \"daeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1\"" }, - "AssetParameters956c2f92ddbde06f551fdf914445c679dcadb21c6e8d1ee9c9632144ef5a2ad3ArtifactHash2CBB11D2": { + "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1ArtifactHashA521A16F": { "Type": "String", - "Description": "Artifact hash for asset \"956c2f92ddbde06f551fdf914445c679dcadb21c6e8d1ee9c9632144ef5a2ad3\"" + "Description": "Artifact hash for asset \"daeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1\"" }, - "AssetParameters51ac5fed1b824803906219cb11f0c17572739bd4fb019d961cdc1fbbfefc620eS3Bucket58C634A6": { + "AssetParametersf8cfc24954f0c95960d9a93888c01bf5e95802f26bfa5dc6fde5c913a1429ceaS3Bucket434BDB62": { "Type": "String", - "Description": "S3 bucket for asset \"51ac5fed1b824803906219cb11f0c17572739bd4fb019d961cdc1fbbfefc620e\"" + "Description": "S3 bucket for asset \"f8cfc24954f0c95960d9a93888c01bf5e95802f26bfa5dc6fde5c913a1429cea\"" }, - "AssetParameters51ac5fed1b824803906219cb11f0c17572739bd4fb019d961cdc1fbbfefc620eS3VersionKeyE8ACA4C1": { + "AssetParametersf8cfc24954f0c95960d9a93888c01bf5e95802f26bfa5dc6fde5c913a1429ceaS3VersionKey01638790": { "Type": "String", - "Description": "S3 key for asset version \"51ac5fed1b824803906219cb11f0c17572739bd4fb019d961cdc1fbbfefc620e\"" + "Description": "S3 key for asset version \"f8cfc24954f0c95960d9a93888c01bf5e95802f26bfa5dc6fde5c913a1429cea\"" }, - "AssetParameters51ac5fed1b824803906219cb11f0c17572739bd4fb019d961cdc1fbbfefc620eArtifactHashDF827F41": { + "AssetParametersf8cfc24954f0c95960d9a93888c01bf5e95802f26bfa5dc6fde5c913a1429ceaArtifactHashD0E61C22": { "Type": "String", - "Description": "Artifact hash for asset \"51ac5fed1b824803906219cb11f0c17572739bd4fb019d961cdc1fbbfefc620e\"" + "Description": "Artifact hash for asset \"f8cfc24954f0c95960d9a93888c01bf5e95802f26bfa5dc6fde5c913a1429cea\"" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ec2/lib/volume.ts b/packages/@aws-cdk/aws-ec2/lib/volume.ts index a23614b89ed63..64f920866a17b 100644 --- a/packages/@aws-cdk/aws-ec2/lib/volume.ts +++ b/packages/@aws-cdk/aws-ec2/lib/volume.ts @@ -2,7 +2,7 @@ import * as crypto from 'crypto'; import { AccountRootPrincipal, Grant, IGrantable } from '@aws-cdk/aws-iam'; import { IKey, ViaServicePrincipal } from '@aws-cdk/aws-kms'; -import { IResource, Resource, Size, SizeRoundingBehavior, Stack, Token, Tags, Names } from '@aws-cdk/core'; +import { IResource, Resource, Size, SizeRoundingBehavior, Stack, Token, Tags, Names, RemovalPolicy } from '@aws-cdk/core'; import { Construct } from 'constructs'; import { CfnVolume } from './ec2.generated'; import { IInstance } from './instance'; @@ -431,6 +431,13 @@ export interface VolumeProps { * @default None -- Required for io1 and io2 volumes. The default for gp3 volumes is 3,000 IOPS if omitted. */ readonly iops?: number; + + /** + * Policy to apply when the volume is removed from the stack + * + * @default RemovalPolicy.RETAIN + */ + readonly removalPolicy?: RemovalPolicy; } /** @@ -605,6 +612,7 @@ export class Volume extends VolumeBase { snapshotId: props.snapshotId, volumeType: props.volumeType ?? EbsDeviceVolumeType.GENERAL_PURPOSE_SSD, }); + resource.applyRemovalPolicy(props.removalPolicy); this.volumeId = resource.ref; this.availabilityZone = props.availabilityZone; diff --git a/packages/@aws-cdk/aws-ec2/test/volume.test.ts b/packages/@aws-cdk/aws-ec2/test/volume.test.ts index 4e5da04a38976..edd0323bc84ef 100644 --- a/packages/@aws-cdk/aws-ec2/test/volume.test.ts +++ b/packages/@aws-cdk/aws-ec2/test/volume.test.ts @@ -41,7 +41,9 @@ describe('volume', () => { VolumeType: 'gp2', }, ResourcePart.Properties)); - + cdkExpect(stack).to(haveResource('AWS::EC2::Volume', { + DeletionPolicy: 'Retain', + }, ResourcePart.CompleteDefinition)); }); test('fromVolumeAttributes', () => { diff --git a/packages/@aws-cdk/aws-ecr-assets/test/integ.nested-stacks-docker.expected.json b/packages/@aws-cdk/aws-ecr-assets/test/integ.nested-stacks-docker.expected.json index 779ad22187591..f86d0e5fea7ab 100644 --- a/packages/@aws-cdk/aws-ecr-assets/test/integ.nested-stacks-docker.expected.json +++ b/packages/@aws-cdk/aws-ecr-assets/test/integ.nested-stacks-docker.expected.json @@ -49,7 +49,9 @@ ] ] } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" } }, "Parameters": { @@ -66,4 +68,4 @@ "Description": "Artifact hash for asset \"41589ef1a760129e41441e85e58fe02db5f019ed532b8a4a20729f3245b0593b\"" } } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ecs-patterns/README.md b/packages/@aws-cdk/aws-ecs-patterns/README.md index c52f35bb65f02..12f56a2b70102 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/README.md +++ b/packages/@aws-cdk/aws-ecs-patterns/README.md @@ -413,7 +413,7 @@ const queueProcessingFargateService = new QueueProcessingFargateService(stack, ' }); ``` -### Set taskSubnets and securityGroups on QueueProcessingFargateService +### Set taskSubnets and securityGroups for QueueProcessingFargateService ```ts const queueProcessingFargateService = new QueueProcessingFargateService(stack, 'Service', { @@ -425,6 +425,17 @@ const queueProcessingFargateService = new QueueProcessingFargateService(stack, ' }); ``` +### Define tasks with public IPs for QueueProcessingFargateService + +```ts +const queueProcessingFargateService = new QueueProcessingFargateService(stack, 'Service', { + vpc, + memoryLimitMiB: 512, + image: ecs.ContainerImage.fromRegistry('test'), + assignPublicIp: true, +}); +``` + ### Select specific vpc subnets for ApplicationLoadBalancedFargateService ```ts diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts index 8ba7fed3f5e76..e3712b00ae4b1 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts @@ -81,6 +81,15 @@ export interface QueueProcessingFargateServiceProps extends QueueProcessingServi * @default - A new security group is created. */ readonly securityGroups?: ec2.ISecurityGroup[]; + + /** + * Specifies whether the task's elastic network interface receives a public IP address. + * + * If true, each task will receive a public IP address. + * + * @default false + */ + readonly assignPublicIp?: boolean; } /** @@ -134,6 +143,7 @@ export class QueueProcessingFargateService extends QueueProcessingServiceBase { deploymentController: props.deploymentController, securityGroups: props.securityGroups, vpcSubnets: props.taskSubnets, + assignPublicIp: props.assignPublicIp, }); this.configureAutoscalingForService(this.service); this.grantPermissionsToService(this.service); diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.queue-processing-fargate-service-isolated.expected.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.queue-processing-fargate-service-isolated.expected.json index d19d9c6a9fbb9..b1d88ed107154 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.queue-processing-fargate-service-isolated.expected.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.queue-processing-fargate-service-isolated.expected.json @@ -668,7 +668,9 @@ "Type": "AWS::SQS::Queue", "Properties": { "MessageRetentionPeriod": 1209600 - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "IsolatedQueueServiceEcsProcessingQueueCCE172F1": { "Type": "AWS::SQS::Queue", @@ -682,7 +684,9 @@ }, "maxReceiveCount": 3 } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "IsolatedQueueServiceQueueProcessingTaskDefTaskRoleCFCB7511": { "Type": "AWS::IAM::Role", diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.queue-processing-fargate-service-public.expected.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.queue-processing-fargate-service-public.expected.json new file mode 100644 index 0000000000000..fd8f791e3a868 --- /dev/null +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.queue-processing-fargate-service-public.expected.json @@ -0,0 +1,1004 @@ +{ + "Resources": { + "VPCB9E5F0B4": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-patterns-queue-public/VPC" + } + ] + } + }, + "VPCPublicSubnet1SubnetB4246D30": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "CidrBlock": "10.0.0.0/19", + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "AvailabilityZone": "test-region-1a", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "aws-ecs-patterns-queue-public/VPC/PublicSubnet1" + } + ] + } + }, + "VPCPublicSubnet1RouteTableFEE4B781": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-patterns-queue-public/VPC/PublicSubnet1" + } + ] + } + }, + "VPCPublicSubnet1RouteTableAssociation0B0896DC": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + }, + "SubnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + } + } + }, + "VPCPublicSubnet1DefaultRoute91CEF279": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VPCIGWB7E252D3" + } + }, + "DependsOn": [ + "VPCVPCGW99B986DC" + ] + }, + "VPCPublicSubnet1EIP6AD938E8": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-patterns-queue-public/VPC/PublicSubnet1" + } + ] + } + }, + "VPCPublicSubnet1NATGatewayE0556630": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet1EIP6AD938E8", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-patterns-queue-public/VPC/PublicSubnet1" + } + ] + } + }, + "VPCPublicSubnet2Subnet74179F39": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "CidrBlock": "10.0.32.0/19", + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "AvailabilityZone": "test-region-1b", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "aws-ecs-patterns-queue-public/VPC/PublicSubnet2" + } + ] + } + }, + "VPCPublicSubnet2RouteTable6F1A15F1": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-patterns-queue-public/VPC/PublicSubnet2" + } + ] + } + }, + "VPCPublicSubnet2RouteTableAssociation5A808732": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + }, + "SubnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + } + } + }, + "VPCPublicSubnet2DefaultRouteB7481BBA": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VPCIGWB7E252D3" + } + }, + "DependsOn": [ + "VPCVPCGW99B986DC" + ] + }, + "VPCPublicSubnet2EIP4947BC00": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-patterns-queue-public/VPC/PublicSubnet2" + } + ] + } + }, + "VPCPublicSubnet2NATGateway3C070193": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet2EIP4947BC00", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-patterns-queue-public/VPC/PublicSubnet2" + } + ] + } + }, + "VPCPublicSubnet3Subnet631C5E25": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "CidrBlock": "10.0.64.0/19", + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "AvailabilityZone": "test-region-1c", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "aws-ecs-patterns-queue-public/VPC/PublicSubnet3" + } + ] + } + }, + "VPCPublicSubnet3RouteTable98AE0E14": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-patterns-queue-public/VPC/PublicSubnet3" + } + ] + } + }, + "VPCPublicSubnet3RouteTableAssociation427FE0C6": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPublicSubnet3RouteTable98AE0E14" + }, + "SubnetId": { + "Ref": "VPCPublicSubnet3Subnet631C5E25" + } + } + }, + "VPCPublicSubnet3DefaultRouteA0D29D46": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "VPCPublicSubnet3RouteTable98AE0E14" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VPCIGWB7E252D3" + } + }, + "DependsOn": [ + "VPCVPCGW99B986DC" + ] + }, + "VPCPublicSubnet3EIPAD4BC883": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-patterns-queue-public/VPC/PublicSubnet3" + } + ] + } + }, + "VPCPublicSubnet3NATGatewayD3048F5C": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet3EIPAD4BC883", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "VPCPublicSubnet3Subnet631C5E25" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-patterns-queue-public/VPC/PublicSubnet3" + } + ] + } + }, + "VPCPrivateSubnet1Subnet8BCA10E0": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "CidrBlock": "10.0.96.0/19", + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "AvailabilityZone": "test-region-1a", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "aws-ecs-patterns-queue-public/VPC/PrivateSubnet1" + } + ] + } + }, + "VPCPrivateSubnet1RouteTableBE8A6027": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-patterns-queue-public/VPC/PrivateSubnet1" + } + ] + } + }, + "VPCPrivateSubnet1RouteTableAssociation347902D1": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + }, + "SubnetId": { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + } + } + }, + "VPCPrivateSubnet1DefaultRouteAE1D6490": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "VPCPublicSubnet1NATGatewayE0556630" + } + } + }, + "VPCPrivateSubnet2SubnetCFCDAA7A": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "CidrBlock": "10.0.128.0/19", + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "AvailabilityZone": "test-region-1b", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "aws-ecs-patterns-queue-public/VPC/PrivateSubnet2" + } + ] + } + }, + "VPCPrivateSubnet2RouteTable0A19E10E": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-patterns-queue-public/VPC/PrivateSubnet2" + } + ] + } + }, + "VPCPrivateSubnet2RouteTableAssociation0C73D413": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + }, + "SubnetId": { + "Ref": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + } + }, + "VPCPrivateSubnet2DefaultRouteF4F5CFD2": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "VPCPublicSubnet2NATGateway3C070193" + } + } + }, + "VPCPrivateSubnet3Subnet3EDCD457": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "CidrBlock": "10.0.160.0/19", + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "AvailabilityZone": "test-region-1c", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "aws-ecs-patterns-queue-public/VPC/PrivateSubnet3" + } + ] + } + }, + "VPCPrivateSubnet3RouteTable192186F8": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-patterns-queue-public/VPC/PrivateSubnet3" + } + ] + } + }, + "VPCPrivateSubnet3RouteTableAssociationC28D144E": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPrivateSubnet3RouteTable192186F8" + }, + "SubnetId": { + "Ref": "VPCPrivateSubnet3Subnet3EDCD457" + } + } + }, + "VPCPrivateSubnet3DefaultRoute27F311AE": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "VPCPrivateSubnet3RouteTable192186F8" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "VPCPublicSubnet3NATGatewayD3048F5C" + } + } + }, + "VPCIGWB7E252D3": { + "Type": "AWS::EC2::InternetGateway", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-patterns-queue-public/VPC" + } + ] + } + }, + "VPCVPCGW99B986DC": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "InternetGatewayId": { + "Ref": "VPCIGWB7E252D3" + } + } + }, + "PublicQueueServiceEcsProcessingDeadLetterQueueBC492277": { + "Type": "AWS::SQS::Queue", + "Properties": { + "MessageRetentionPeriod": 1209600 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "PublicQueueServiceEcsProcessingQueue84CD309D": { + "Type": "AWS::SQS::Queue", + "Properties": { + "RedrivePolicy": { + "deadLetterTargetArn": { + "Fn::GetAtt": [ + "PublicQueueServiceEcsProcessingDeadLetterQueueBC492277", + "Arn" + ] + }, + "maxReceiveCount": 3 + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "PublicQueueServiceQueueProcessingTaskDefTaskRole172D980F": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "PublicQueueServiceQueueProcessingTaskDefTaskRoleDefaultPolicy5417957C": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "sqs:ReceiveMessage", + "sqs:ChangeMessageVisibility", + "sqs:GetQueueUrl", + "sqs:DeleteMessage", + "sqs:GetQueueAttributes" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "PublicQueueServiceEcsProcessingQueue84CD309D", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "PublicQueueServiceQueueProcessingTaskDefTaskRoleDefaultPolicy5417957C", + "Roles": [ + { + "Ref": "PublicQueueServiceQueueProcessingTaskDefTaskRole172D980F" + } + ] + } + }, + "PublicQueueServiceQueueProcessingTaskDef858327F6": { + "Type": "AWS::ECS::TaskDefinition", + "Properties": { + "ContainerDefinitions": [ + { + "Environment": [ + { + "Name": "QUEUE_NAME", + "Value": { + "Fn::GetAtt": [ + "PublicQueueServiceEcsProcessingQueue84CD309D", + "QueueName" + ] + } + } + ], + "Essential": true, + "Image": { + "Fn::Join": [ + "", + [ + { + "Ref": "AWS::AccountId" + }, + ".dkr.ecr.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/aws-cdk/assets:3a8ba3ad06ed212b075efa3157fb407649c5996812bc64eeb5209e220aab4be5" + ] + ] + }, + "LogConfiguration": { + "LogDriver": "awslogs", + "Options": { + "awslogs-group": { + "Ref": "PublicQueueServiceQueueProcessingTaskDefQueueProcessingContainerLogGroupCFF67B64" + }, + "awslogs-stream-prefix": "PublicQueueService", + "awslogs-region": { + "Ref": "AWS::Region" + } + } + }, + "Name": "QueueProcessingContainer" + } + ], + "Cpu": "256", + "ExecutionRoleArn": { + "Fn::GetAtt": [ + "PublicQueueServiceQueueProcessingTaskDefExecutionRoleE22721BA", + "Arn" + ] + }, + "Family": "awsecspatternsqueuepublicPublicQueueServiceQueueProcessingTaskDefB3738118", + "Memory": "512", + "NetworkMode": "awsvpc", + "RequiresCompatibilities": [ + "FARGATE" + ], + "TaskRoleArn": { + "Fn::GetAtt": [ + "PublicQueueServiceQueueProcessingTaskDefTaskRole172D980F", + "Arn" + ] + } + } + }, + "PublicQueueServiceQueueProcessingTaskDefQueueProcessingContainerLogGroupCFF67B64": { + "Type": "AWS::Logs::LogGroup", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "PublicQueueServiceQueueProcessingTaskDefExecutionRoleE22721BA": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "PublicQueueServiceQueueProcessingTaskDefExecutionRoleDefaultPolicyD7FF680F": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ecr:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":repository/aws-cdk/assets" + ] + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "PublicQueueServiceQueueProcessingTaskDefQueueProcessingContainerLogGroupCFF67B64", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "PublicQueueServiceQueueProcessingTaskDefExecutionRoleDefaultPolicyD7FF680F", + "Roles": [ + { + "Ref": "PublicQueueServiceQueueProcessingTaskDefExecutionRoleE22721BA" + } + ] + } + }, + "PublicQueueServiceQueueProcessingFargateService7DE3D65B": { + "Type": "AWS::ECS::Service", + "Properties": { + "Cluster": { + "Ref": "EcsDefaultClusterMnL3mNNYNVPC9C1EC7A3" + }, + "DeploymentConfiguration": { + "MaximumPercent": 200, + "MinimumHealthyPercent": 50 + }, + "DesiredCount": 1, + "EnableECSManagedTags": false, + "LaunchType": "FARGATE", + "NetworkConfiguration": { + "AwsvpcConfiguration": { + "AssignPublicIp": "ENABLED", + "SecurityGroups": [ + { + "Fn::GetAtt": [ + "PublicQueueServiceQueueProcessingFargateServiceSecurityGroupFC07A65A", + "GroupId" + ] + } + ], + "Subnets": [ + { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, + { + "Ref": "VPCPublicSubnet2Subnet74179F39" + }, + { + "Ref": "VPCPublicSubnet3Subnet631C5E25" + } + ] + } + }, + "TaskDefinition": { + "Ref": "PublicQueueServiceQueueProcessingTaskDef858327F6" + } + } + }, + "PublicQueueServiceQueueProcessingFargateServiceSecurityGroupFC07A65A": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "aws-ecs-patterns-queue-public/PublicQueueService/QueueProcessingFargateService/SecurityGroup", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "PublicQueueServiceQueueProcessingFargateServiceTaskCountTargetE040C118": { + "Type": "AWS::ApplicationAutoScaling::ScalableTarget", + "Properties": { + "MaxCapacity": 2, + "MinCapacity": 1, + "ResourceId": { + "Fn::Join": [ + "", + [ + "service/", + { + "Ref": "EcsDefaultClusterMnL3mNNYNVPC9C1EC7A3" + }, + "/", + { + "Fn::GetAtt": [ + "PublicQueueServiceQueueProcessingFargateService7DE3D65B", + "Name" + ] + } + ] + ] + }, + "RoleARN": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/aws-service-role/ecs.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_ECSService" + ] + ] + }, + "ScalableDimension": "ecs:service:DesiredCount", + "ServiceNamespace": "ecs" + } + }, + "PublicQueueServiceQueueProcessingFargateServiceTaskCountTargetCpuScaling559C41BF": { + "Type": "AWS::ApplicationAutoScaling::ScalingPolicy", + "Properties": { + "PolicyName": "awsecspatternsqueuepublicPublicQueueServiceQueueProcessingFargateServiceTaskCountTargetCpuScalingF36D44B7", + "PolicyType": "TargetTrackingScaling", + "ScalingTargetId": { + "Ref": "PublicQueueServiceQueueProcessingFargateServiceTaskCountTargetE040C118" + }, + "TargetTrackingScalingPolicyConfiguration": { + "PredefinedMetricSpecification": { + "PredefinedMetricType": "ECSServiceAverageCPUUtilization" + }, + "TargetValue": 50 + } + } + }, + "PublicQueueServiceQueueProcessingFargateServiceTaskCountTargetQueueMessagesVisibleScalingLowerPolicyB2B27FF9": { + "Type": "AWS::ApplicationAutoScaling::ScalingPolicy", + "Properties": { + "PolicyName": "awsecspatternsqueuepublicPublicQueueServiceQueueProcessingFargateServiceTaskCountTargetQueueMessagesVisibleScalingLowerPolicy2DB1A503", + "PolicyType": "StepScaling", + "ScalingTargetId": { + "Ref": "PublicQueueServiceQueueProcessingFargateServiceTaskCountTargetE040C118" + }, + "StepScalingPolicyConfiguration": { + "AdjustmentType": "ChangeInCapacity", + "MetricAggregationType": "Maximum", + "StepAdjustments": [ + { + "MetricIntervalUpperBound": 0, + "ScalingAdjustment": -1 + } + ] + } + } + }, + "PublicQueueServiceQueueProcessingFargateServiceTaskCountTargetQueueMessagesVisibleScalingLowerAlarm5782C233": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "ComparisonOperator": "LessThanOrEqualToThreshold", + "EvaluationPeriods": 1, + "AlarmActions": [ + { + "Ref": "PublicQueueServiceQueueProcessingFargateServiceTaskCountTargetQueueMessagesVisibleScalingLowerPolicyB2B27FF9" + } + ], + "AlarmDescription": "Lower threshold scaling alarm", + "Dimensions": [ + { + "Name": "QueueName", + "Value": { + "Fn::GetAtt": [ + "PublicQueueServiceEcsProcessingQueue84CD309D", + "QueueName" + ] + } + } + ], + "MetricName": "ApproximateNumberOfMessagesVisible", + "Namespace": "AWS/SQS", + "Period": 300, + "Statistic": "Maximum", + "Threshold": 0 + } + }, + "PublicQueueServiceQueueProcessingFargateServiceTaskCountTargetQueueMessagesVisibleScalingUpperPolicyDCB40C8A": { + "Type": "AWS::ApplicationAutoScaling::ScalingPolicy", + "Properties": { + "PolicyName": "awsecspatternsqueuepublicPublicQueueServiceQueueProcessingFargateServiceTaskCountTargetQueueMessagesVisibleScalingUpperPolicy89C3D196", + "PolicyType": "StepScaling", + "ScalingTargetId": { + "Ref": "PublicQueueServiceQueueProcessingFargateServiceTaskCountTargetE040C118" + }, + "StepScalingPolicyConfiguration": { + "AdjustmentType": "ChangeInCapacity", + "MetricAggregationType": "Maximum", + "StepAdjustments": [ + { + "MetricIntervalLowerBound": 0, + "MetricIntervalUpperBound": 400, + "ScalingAdjustment": 1 + }, + { + "MetricIntervalLowerBound": 400, + "ScalingAdjustment": 5 + } + ] + } + } + }, + "PublicQueueServiceQueueProcessingFargateServiceTaskCountTargetQueueMessagesVisibleScalingUpperAlarm5D67333D": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "EvaluationPeriods": 1, + "AlarmActions": [ + { + "Ref": "PublicQueueServiceQueueProcessingFargateServiceTaskCountTargetQueueMessagesVisibleScalingUpperPolicyDCB40C8A" + } + ], + "AlarmDescription": "Upper threshold scaling alarm", + "Dimensions": [ + { + "Name": "QueueName", + "Value": { + "Fn::GetAtt": [ + "PublicQueueServiceEcsProcessingQueue84CD309D", + "QueueName" + ] + } + } + ], + "MetricName": "ApproximateNumberOfMessagesVisible", + "Namespace": "AWS/SQS", + "Period": 300, + "Statistic": "Maximum", + "Threshold": 100 + } + }, + "EcsDefaultClusterMnL3mNNYNVPC9C1EC7A3": { + "Type": "AWS::ECS::Cluster" + } + }, + "Outputs": { + "PublicQueueServiceSQSDeadLetterQueueBCE86DBC": { + "Value": { + "Fn::GetAtt": [ + "PublicQueueServiceEcsProcessingDeadLetterQueueBC492277", + "QueueName" + ] + } + }, + "PublicQueueServiceSQSDeadLetterQueueArn6E134EA4": { + "Value": { + "Fn::GetAtt": [ + "PublicQueueServiceEcsProcessingDeadLetterQueueBC492277", + "Arn" + ] + } + }, + "PublicQueueServiceSQSQueue4D3FBD5C": { + "Value": { + "Fn::GetAtt": [ + "PublicQueueServiceEcsProcessingQueue84CD309D", + "QueueName" + ] + } + }, + "PublicQueueServiceSQSQueueArn38014FDC": { + "Value": { + "Fn::GetAtt": [ + "PublicQueueServiceEcsProcessingQueue84CD309D", + "Arn" + ] + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.queue-processing-fargate-service-public.ts b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.queue-processing-fargate-service-public.ts new file mode 100644 index 0000000000000..5b0d74f9e3ceb --- /dev/null +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.queue-processing-fargate-service-public.ts @@ -0,0 +1,19 @@ +import * as path from 'path'; +import * as ec2 from '@aws-cdk/aws-ec2'; +import * as ecs from '@aws-cdk/aws-ecs'; +import { App, Stack } from '@aws-cdk/core'; + +import { QueueProcessingFargateService } from '../../lib'; + +const app = new App(); +const stack = new Stack(app, 'aws-ecs-patterns-queue-public'); +const vpc = new ec2.Vpc(stack, 'VPC'); + +new QueueProcessingFargateService(stack, 'PublicQueueService', { + vpc, + memoryLimitMiB: 512, + image: new ecs.AssetImage(path.join(__dirname, '..', 'sqs-reader')), + assignPublicIp: true, +}); + +app.synth(); diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.queue-processing-fargate-service.expected.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.queue-processing-fargate-service.expected.json index 3fd9825b7db3b..889eeefcd985e 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.queue-processing-fargate-service.expected.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.queue-processing-fargate-service.expected.json @@ -359,7 +359,9 @@ "Type": "AWS::SQS::Queue", "Properties": { "MessageRetentionPeriod": 1209600 - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "QueueProcessingServiceEcsProcessingQueue552F0B37": { "Type": "AWS::SQS::Queue", @@ -373,7 +375,9 @@ }, "maxReceiveCount": 3 } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "QueueProcessingServiceQueueProcessingTaskDefTaskRole782B79A6": { "Type": "AWS::IAM::Role", diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.queue-processing-fargate-service.ts b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.queue-processing-fargate-service.ts index 0bee7da1c51f3..9d2d5dd0747a6 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.queue-processing-fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.queue-processing-fargate-service.ts @@ -331,7 +331,7 @@ export = { vpc, }); - // WHEN + // WHEN - SecurityGroups and taskSubnets selection is defined new ecsPatterns.QueueProcessingFargateService(stack, 'Service', { vpc, memoryLimitMiB: 512, @@ -340,7 +340,7 @@ export = { taskSubnets: { subnetType: ec2.SubnetType.ISOLATED }, }); - // THEN - QueueWorker is of FARGATE launch type, an SQS queue is created and all default properties are set. + // THEN - NetworkConfiguration is created with the specific security groups and selected subnets expect(stack).to(haveResource('AWS::ECS::Service', { LaunchType: 'FARGATE', NetworkConfiguration: { @@ -368,4 +368,45 @@ export = { test.done(); }, + + 'can set use public IP'(test: Test) { + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'VPC'); + + // WHEN - Assign Public IP is set to True + new ecsPatterns.QueueProcessingFargateService(stack, 'Service', { + vpc, + memoryLimitMiB: 512, + image: ecs.ContainerImage.fromRegistry('test'), + assignPublicIp: true, + }); + + // THEN - The Subnets defaults to Public and AssignPublicIp settings change to ENABLED + expect(stack).to(haveResource('AWS::ECS::Service', { + LaunchType: 'FARGATE', + NetworkConfiguration: { + AwsvpcConfiguration: { + AssignPublicIp: 'ENABLED', + SecurityGroups: [ + { + 'Fn::GetAtt': [ + 'ServiceQueueProcessingFargateServiceSecurityGroup6E981512', + 'GroupId', + ], + }, + ], + Subnets: [ + { + Ref: 'VPCPublicSubnet1SubnetB4246D30', + }, + { + Ref: 'VPCPublicSubnet2Subnet74179F39', + }, + ], + }, + }, + })); + + test.done(); + }, }; diff --git a/packages/@aws-cdk/aws-ecs/.gitignore b/packages/@aws-cdk/aws-ecs/.gitignore index 255c76b856cb1..52228730a371f 100644 --- a/packages/@aws-cdk/aws-ecs/.gitignore +++ b/packages/@aws-cdk/aws-ecs/.gitignore @@ -16,4 +16,5 @@ nyc.config.js *.snk !.eslintrc.js -junit.xml \ No newline at end of file +junit.xml +!jest.config.js \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ecs/.npmignore b/packages/@aws-cdk/aws-ecs/.npmignore index 40fbede1f02dc..6c1b9b8c69ec6 100644 --- a/packages/@aws-cdk/aws-ecs/.npmignore +++ b/packages/@aws-cdk/aws-ecs/.npmignore @@ -23,4 +23,5 @@ tsconfig.json # exclude cdk artifacts **/cdk.out junit.xml -test/ \ No newline at end of file +test/ +jest.config.js \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ecs/jest.config.js b/packages/@aws-cdk/aws-ecs/jest.config.js new file mode 100644 index 0000000000000..f5d5c4c8ad18f --- /dev/null +++ b/packages/@aws-cdk/aws-ecs/jest.config.js @@ -0,0 +1,2 @@ +const baseConfig = require('../../../tools/cdk-build-tools/config/jest.config'); +module.exports = baseConfig; \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ecs/package.json b/packages/@aws-cdk/aws-ecs/package.json index 418619f6ee09c..f7408e518f2fe 100644 --- a/packages/@aws-cdk/aws-ecs/package.json +++ b/packages/@aws-cdk/aws-ecs/package.json @@ -53,6 +53,7 @@ }, "cdk-build": { "cloudformation": "AWS::ECS", + "jest": "true", "env": { "AWSLINT_BASE_CONSTRUCT": true } @@ -77,7 +78,7 @@ "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "cfn2ts": "0.0.0", - "nodeunit": "^0.11.3", + "nodeunit-shim": "0.0.0", "pkglint": "0.0.0", "proxyquire": "^2.1.3" }, diff --git a/packages/@aws-cdk/aws-ecs/test/test.app-mesh-proxy-configuration.ts b/packages/@aws-cdk/aws-ecs/test/app-mesh-proxy-configuration.test.ts similarity index 98% rename from packages/@aws-cdk/aws-ecs/test/test.app-mesh-proxy-configuration.ts rename to packages/@aws-cdk/aws-ecs/test/app-mesh-proxy-configuration.test.ts index 1633d90234ee0..69f3d30e9b865 100644 --- a/packages/@aws-cdk/aws-ecs/test/test.app-mesh-proxy-configuration.ts +++ b/packages/@aws-cdk/aws-ecs/test/app-mesh-proxy-configuration.test.ts @@ -1,9 +1,9 @@ import { expect, haveResourceLike } from '@aws-cdk/assert'; import * as cdk from '@aws-cdk/core'; -import { Test } from 'nodeunit'; +import { nodeunitShim, Test } from 'nodeunit-shim'; import * as ecs from '../lib'; -export = { +nodeunitShim({ 'correctly sets all appMeshProxyConfiguration'(test: Test) { // GIVEN const stack = new cdk.Stack(); @@ -204,4 +204,4 @@ export = { test.done(); }, -}; +}); diff --git a/packages/@aws-cdk/aws-ecs/test/test.aws-log-driver.ts b/packages/@aws-cdk/aws-ecs/test/aws-log-driver.test.ts similarity index 98% rename from packages/@aws-cdk/aws-ecs/test/test.aws-log-driver.ts rename to packages/@aws-cdk/aws-ecs/test/aws-log-driver.test.ts index a4d5c9af9c53d..d36fb943e8b2d 100644 --- a/packages/@aws-cdk/aws-ecs/test/test.aws-log-driver.ts +++ b/packages/@aws-cdk/aws-ecs/test/aws-log-driver.test.ts @@ -1,14 +1,14 @@ import { expect, haveResource, haveResourceLike } from '@aws-cdk/assert'; import * as logs from '@aws-cdk/aws-logs'; import * as cdk from '@aws-cdk/core'; -import { Test } from 'nodeunit'; +import { nodeunitShim, Test } from 'nodeunit-shim'; import * as ecs from '../lib'; let stack: cdk.Stack; let td: ecs.TaskDefinition; const image = ecs.ContainerImage.fromRegistry('test-image'); -export = { +nodeunitShim({ 'setUp'(cb: () => void) { stack = new cdk.Stack(); td = new ecs.FargateTaskDefinition(stack, 'TaskDefinition'); @@ -154,4 +154,4 @@ export = { test.done(); }, -}; +}); diff --git a/packages/@aws-cdk/aws-ecs/test/test.container-definition.ts b/packages/@aws-cdk/aws-ecs/test/container-definition.test.ts similarity index 82% rename from packages/@aws-cdk/aws-ecs/test/test.container-definition.ts rename to packages/@aws-cdk/aws-ecs/test/container-definition.test.ts index e994a9174f51d..c167720e362cf 100644 --- a/packages/@aws-cdk/aws-ecs/test/test.container-definition.ts +++ b/packages/@aws-cdk/aws-ecs/test/container-definition.test.ts @@ -1,16 +1,17 @@ +import '@aws-cdk/assert/jest'; import * as path from 'path'; -import { expect, haveResource, haveResourceLike, InspectionFailure } from '@aws-cdk/assert'; +import { InspectionFailure } from '@aws-cdk/assert'; import * as ecr_assets from '@aws-cdk/aws-ecr-assets'; import * as s3 from '@aws-cdk/aws-s3'; import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; import * as ssm from '@aws-cdk/aws-ssm'; import * as cdk from '@aws-cdk/core'; -import { Test } from 'nodeunit'; +import { testFutureBehavior } from 'cdk-build-tools/lib/feature-flag'; import * as ecs from '../lib'; -export = { - 'When creating a Task Definition': { - 'add a container using default props'(test: Test) { +describe('container definition', () => { + describe('When creating a Task Definition', () => { + test('add a container using default props', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); @@ -22,7 +23,7 @@ export = { }); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { ContainerDefinitions: [ { Essential: true, @@ -31,12 +32,12 @@ export = { Name: 'Container', }, ], - })); + }); + - test.done(); - }, + }); - 'add a container using all props'(test: Test) { + test('add a container using all props', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); @@ -85,7 +86,7 @@ export = { }); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { ContainerDefinitions: [ { Command: [ @@ -219,31 +220,31 @@ export = { WorkingDirectory: 'a/b/c', }, ], - })); + }); - test.done(); - }, - 'throws when MemoryLimit is less than MemoryReservationLimit'(test: Test) { + }); + + test('throws when MemoryLimit is less than MemoryReservationLimit', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); // THEN - test.throws(() => { + expect(() => { new ecs.ContainerDefinition(stack, 'Container', { image: ecs.ContainerImage.fromRegistry('/aws/aws-example-app'), taskDefinition, memoryLimitMiB: 512, memoryReservationMiB: 1024, }); - }, /MemoryLimitMiB should not be less than MemoryReservationMiB./); + }).toThrow(/MemoryLimitMiB should not be less than MemoryReservationMiB./); + - test.done(); - }, + }); - 'With network mode AwsVpc': { - 'throws when Host port is different from container port'(test: Test) { + describe('With network mode AwsVpc', () => { + test('throws when Host port is different from container port', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', { @@ -256,17 +257,17 @@ export = { }); // THEN - test.throws(() => { + expect(() => { container.addPortMappings({ containerPort: 8080, hostPort: 8081, }); - }); + }).toThrow(); - test.done(); - }, - 'Host port is the same as container port'(test: Test) { + }); + + test('Host port is the same as container port', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', { @@ -284,10 +285,10 @@ export = { }); // THEN no exception raised - test.done(); - }, - 'Host port can be empty '(test: Test) { + }); + + test('Host port can be empty ', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', { @@ -305,12 +306,12 @@ export = { }); // THEN no exception raised - test.done(); - }, - }, - 'With network mode Host ': { - 'throws when Host port is different from container port'(test: Test) { + }); + }); + + describe('With network mode Host ', () => { + test('throws when Host port is different from container port', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', { @@ -323,17 +324,17 @@ export = { }); // THEN - test.throws(() => { + expect(() => { container.addPortMappings({ containerPort: 8080, hostPort: 8081, }); - }); + }).toThrow(); - test.done(); - }, - 'when host port is the same as container port'(test: Test) { + }); + + test('when host port is the same as container port', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', { @@ -351,10 +352,10 @@ export = { }); // THEN no exception raised - test.done(); - }, - 'Host port can be empty '(test: Test) { + }); + + test('Host port can be empty ', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', { @@ -372,10 +373,10 @@ export = { }); // THEN no exception raised - test.done(); - }, - 'errors when adding links'(test: Test) { + }); + + test('errors when adding links', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', { @@ -393,16 +394,16 @@ export = { }); // THEN - test.throws(() => { + expect(() => { container.addLink(logger); - }); + }).toThrow(); - test.done(); - }, - }, - 'With network mode Bridge': { - 'when Host port is empty '(test: Test) { + }); + }); + + describe('With network mode Bridge', () => { + test('when Host port is empty ', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', { @@ -419,10 +420,10 @@ export = { }); // THEN no exception raises - test.done(); - }, - 'when Host port is not empty '(test: Test) { + }); + + test('when Host port is not empty ', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', { @@ -440,10 +441,10 @@ export = { }); // THEN no exception raises - test.done(); - }, - 'allows adding links'(test: Test) { + }); + + test('allows adding links', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', { @@ -463,12 +464,12 @@ export = { // THEN container.addLink(logger); - test.done(); - }, - }, - 'With network mode NAT': { - 'produces undefined CF networkMode property'(test: Test) { + }); + }); + + describe('With network mode NAT', () => { + test('produces undefined CF networkMode property', () => { // GIVEN const stack = new cdk.Stack(); @@ -479,22 +480,22 @@ export = { }); // THEN - expect(stack).to(haveResource('AWS::ECS::TaskDefinition', (props: any, inspection: InspectionFailure) => { + expect(stack).toHaveResource('AWS::ECS::TaskDefinition', (props: any, inspection: InspectionFailure) => { if (props.NetworkMode === undefined) { return true; } inspection.failureReason = 'CF template should not have NetworkMode defined for a task definition that relies on NAT network mode.'; return false; - })); + }); - test.done(); - }, - }, - }, - 'Container Port': { - 'should return the first container port in PortMappings'(test: Test) { + }); + }); + }); + + describe('Container Port', () => { + test('should return the first container port in PortMappings', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', { @@ -518,11 +519,11 @@ export = { // THEN const expected = 8080; - test.equal(actual, expected, 'containerPort should return the first container port in PortMappings'); - test.done(); - }, + expect(actual).toEqual(expected); - 'throws when calling containerPort with no PortMappings'(test: Test) { + }); + + test('throws when calling containerPort with no PortMappings', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', { @@ -535,19 +536,19 @@ export = { }); // THEN - test.throws(() => { + expect(() => { const actual = container.containerPort; const expected = 8080; - test.equal(actual, expected); - }, /Container MyContainer hasn't defined any ports. Call addPortMappings()./); + expect(actual).toEqual(expected); + }).toThrow(/Container MyContainer hasn't defined any ports. Call addPortMappings()./); + - test.done(); - }, - }, + }); + }); - 'Ingress Port': { - 'With network mode AwsVpc': { - 'Ingress port should be the same as container port'(test: Test) { + describe('Ingress Port', () => { + describe('With network mode AwsVpc', () => { + test('Ingress port should be the same as container port', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', { @@ -567,11 +568,11 @@ export = { // THEN const expected = 8080; - test.equal(actual, expected, 'Ingress port should be the same as container port'); - test.done(); - }, + expect(actual).toEqual(expected); - 'throws when calling ingressPort with no PortMappings'(test: Test) { + }); + + test('throws when calling ingressPort with no PortMappings', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', { @@ -584,18 +585,18 @@ export = { }); // THEN - test.throws(() => { + expect(() => { const actual = container.ingressPort; const expected = 8080; - test.equal(actual, expected); - }, /Container MyContainer hasn't defined any ports. Call addPortMappings()./); + expect(actual).toEqual(expected); + }).toThrow(/Container MyContainer hasn't defined any ports. Call addPortMappings()./); - test.done(); - }, - }, - 'With network mode Host ': { - 'Ingress port should be the same as container port'(test: Test) { + }); + }); + + describe('With network mode Host ', () => { + test('Ingress port should be the same as container port', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', { @@ -615,13 +616,13 @@ export = { // THEN const expected = 8080; - test.equal(actual, expected); - test.done(); - }, - }, + expect(actual).toEqual( expected); - 'With network mode Bridge': { - 'Ingress port should be the same as host port if supplied'(test: Test) { + }); + }); + + describe('With network mode Bridge', () => { + test('Ingress port should be the same as host port if supplied', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', { @@ -642,11 +643,11 @@ export = { // THEN const expected = 8081; - test.equal(actual, expected); - test.done(); - }, + expect(actual).toEqual( expected); + + }); - 'Ingress port should be 0 if not supplied'(test: Test) { + test('Ingress port should be 0 if not supplied', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', { @@ -666,13 +667,13 @@ export = { // THEN const expected = 0; - test.equal(actual, expected); - test.done(); - }, - }, - }, + expect(actual).toEqual(expected); + + }); + }); + }); - 'can add environment variables to the container definition'(test: Test) { + test('can add environment variables to the container definition', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); @@ -687,7 +688,7 @@ export = { }); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { ContainerDefinitions: [ { Environment: [{ @@ -696,15 +697,14 @@ export = { }], }, ], - })); + }); - test.done(); - }, + }); - 'Environment Files': { - 'with EC2 task definitions': { - 'can add asset environment file to the container definition'(test: Test) { + describe('Environment Files', () => { + describe('with EC2 task definitions', () => { + test('can add asset environment file to the container definition', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); @@ -717,7 +717,7 @@ export = { }); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { ContainerDefinitions: [ { EnvironmentFiles: [{ @@ -763,11 +763,11 @@ export = { }], }, ], - })); + }); - test.done(); - }, - 'can add s3 bucket environment file to the container definition'(test: Test) { + + }); + test('can add s3 bucket environment file to the container definition', () => { // GIVEN const stack = new cdk.Stack(); const bucket = new s3.Bucket(stack, 'Bucket', { @@ -783,7 +783,7 @@ export = { }); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { ContainerDefinitions: [ { EnvironmentFiles: [{ @@ -803,13 +803,13 @@ export = { }], }, ], - })); + }); - test.done(); - }, - }, - 'with Fargate task definitions': { - 'can add asset environment file to the container definition'(test: Test) { + + }); + }); + describe('with Fargate task definitions', () => { + test('can add asset environment file to the container definition', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.FargateTaskDefinition(stack, 'TaskDef'); @@ -822,7 +822,7 @@ export = { }); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { ContainerDefinitions: [ { EnvironmentFiles: [{ @@ -868,11 +868,11 @@ export = { }], }, ], - })); + }); - test.done(); - }, - 'can add s3 bucket environment file to the container definition'(test: Test) { + + }); + test('can add s3 bucket environment file to the container definition', () => { // GIVEN const stack = new cdk.Stack(); const bucket = new s3.Bucket(stack, 'Bucket', { @@ -888,7 +888,7 @@ export = { }); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { ContainerDefinitions: [ { EnvironmentFiles: [{ @@ -908,15 +908,15 @@ export = { }], }, ], - })); + }); - test.done(); - }, - }, - }, - 'Given GPU count parameter': { - 'will add resource requirements to container definition'(test: Test) { + }); + }); + }); + + describe('Given GPU count parameter', () => { + test('will add resource requirements to container definition', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); @@ -929,7 +929,7 @@ export = { }); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { ContainerDefinitions: [ { Image: 'test', @@ -941,13 +941,13 @@ export = { ], }, ], - })); + }); - test.done(); - }, - }, - 'can add secret environment variables to the container definition'(test: Test) { + }); + }); + + test('can add secret environment variables to the container definition', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); @@ -969,7 +969,7 @@ export = { }); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { ContainerDefinitions: [ { Secrets: [ @@ -1005,9 +1005,9 @@ export = { ], }, ], - })); + }); - expect(stack).to(haveResourceLike('AWS::IAM::Policy', { + expect(stack).toHaveResourceLike('AWS::IAM::Policy', { PolicyDocument: { Statement: [ { @@ -1052,13 +1052,12 @@ export = { ], Version: '2012-10-17', }, - })); + }); - test.done(); - }, + }); - 'use a specific secret JSON key as environment variable'(test: Test) { + test('use a specific secret JSON key as environment variable', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); @@ -1075,7 +1074,7 @@ export = { }); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { ContainerDefinitions: [ { Secrets: [ @@ -1096,13 +1095,12 @@ export = { ], }, ], - })); + }); - test.done(); - }, + }); - 'use a specific secret JSON field as environment variable for a Fargate task'(test: Test) { + test('use a specific secret JSON field as environment variable for a Fargate task', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.FargateTaskDefinition(stack, 'TaskDef'); @@ -1119,7 +1117,7 @@ export = { }); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { ContainerDefinitions: [ { Secrets: [ @@ -1140,12 +1138,12 @@ export = { ], }, ], - })); + }); + - test.done(); - }, + }); - 'can add AWS logging to container definition'(test: Test) { + test('can add AWS logging to container definition', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); @@ -1158,7 +1156,7 @@ export = { }); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { ContainerDefinitions: [ { LogConfiguration: { @@ -1171,9 +1169,9 @@ export = { }, }, ], - })); + }); - expect(stack).to(haveResource('AWS::IAM::Policy', { + expect(stack).toHaveResource('AWS::IAM::Policy', { PolicyDocument: { Statement: [ { @@ -1184,12 +1182,12 @@ export = { ], Version: '2012-10-17', }, - })); + }); - test.done(); - }, - 'can set Health Check with defaults'(test: Test) { + }); + + test('can set Health Check with defaults', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); @@ -1205,7 +1203,7 @@ export = { }); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { ContainerDefinitions: [ { HealthCheck: { @@ -1216,12 +1214,12 @@ export = { }, }, ], - })); + }); - test.done(); - }, - 'throws when setting Health Check with no commands'(test: Test) { + }); + + test('throws when setting Health Check with no commands', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); @@ -1236,8 +1234,8 @@ export = { }); // THEN - test.throws(() => { - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(() => { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { ContainerDefinitions: [ { HealthCheck: { @@ -1248,13 +1246,13 @@ export = { }, }, ], - })); - }, /At least one argument must be supplied for health check command./); + }); + }).toThrow(/At least one argument must be supplied for health check command./); - test.done(); - }, - 'can specify Health Check values in shell form'(test: Test) { + }); + + test('can specify Health Check values in shell form', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); @@ -1273,7 +1271,7 @@ export = { }); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { ContainerDefinitions: [ { HealthCheck: { @@ -1285,12 +1283,12 @@ export = { }, }, ], - })); + }); - test.done(); - }, - 'can specify Health Check values in array form starting with CMD-SHELL'(test: Test) { + }); + + test('can specify Health Check values in array form starting with CMD-SHELL', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); @@ -1309,7 +1307,7 @@ export = { }); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { ContainerDefinitions: [ { HealthCheck: { @@ -1321,12 +1319,12 @@ export = { }, }, ], - })); + }); + - test.done(); - }, + }); - 'can specify Health Check values in array form starting with CMD'(test: Test) { + test('can specify Health Check values in array form starting with CMD', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); @@ -1345,7 +1343,7 @@ export = { }); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { ContainerDefinitions: [ { HealthCheck: { @@ -1357,12 +1355,12 @@ export = { }, }, ], - })); + }); + - test.done(); - }, + }); - 'can specify private registry credentials'(test: Test) { + test('can specify private registry credentials', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); @@ -1379,7 +1377,7 @@ export = { }); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { ContainerDefinitions: [ { Image: 'user-x/my-app', @@ -1388,9 +1386,9 @@ export = { }, }, ], - })); + }); - expect(stack).to(haveResourceLike('AWS::IAM::Policy', { + expect(stack).toHaveResourceLike('AWS::IAM::Policy', { PolicyDocument: { Statement: [ { @@ -1403,13 +1401,13 @@ export = { }, ], }, - })); + }); - test.done(); - }, - '_linkContainer works properly': { - 'when the props passed in is an essential container'(test: Test) { + }); + + describe('_linkContainer works properly', () => { + test('when the props passed in is an essential container', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); @@ -1422,12 +1420,12 @@ export = { }); // THEN - test.equal(taskDefinition.defaultContainer, container); + expect(taskDefinition.defaultContainer).toEqual( container); + - test.done(); - }, + }); - 'when the props passed in is not an essential container'(test: Test) { + test('when the props passed in is not an essential container', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); @@ -1440,14 +1438,14 @@ export = { }); // THEN - test.equal(taskDefinition.defaultContainer, undefined); + expect(taskDefinition.defaultContainer).toEqual( undefined); + - test.done(); - }, - }, + }); + }); - 'Can specify linux parameters': { - 'with only required properties set, it correctly sets default properties'(test: Test) { + describe('Can specify linux parameters', () => { + test('with only required properties set, it correctly sets default properties', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); @@ -1462,7 +1460,7 @@ export = { }); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { ContainerDefinitions: [ { Image: 'test', @@ -1471,12 +1469,12 @@ export = { }, }, ], - })); + }); - test.done(); - }, - 'before calling addContainer'(test: Test) { + }); + + test('before calling addContainer', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); @@ -1497,7 +1495,7 @@ export = { }); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { ContainerDefinitions: [ { Image: 'test', @@ -1511,12 +1509,12 @@ export = { }, }, ], - })); + }); - test.done(); - }, - 'after calling addContainer'(test: Test) { + }); + + test('after calling addContainer', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); @@ -1539,7 +1537,7 @@ export = { linuxParameters.dropCapabilities(ecs.Capability.SETUID); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { ContainerDefinitions: [ { Image: 'test', @@ -1553,12 +1551,12 @@ export = { }, }, ], - })); + }); + - test.done(); - }, + }); - 'with one or more host devices'(test: Test) { + test('with one or more host devices', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); @@ -1580,7 +1578,7 @@ export = { }); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { ContainerDefinitions: [ { Image: 'test', @@ -1595,12 +1593,12 @@ export = { }, }, ], - })); + }); - test.done(); - }, - 'with the tmpfs mount for a container'(test: Test) { + }); + + test('with the tmpfs mount for a container', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); @@ -1623,7 +1621,7 @@ export = { }); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { ContainerDefinitions: [ { Image: 'test', @@ -1639,19 +1637,14 @@ export = { }, }, ], - })); + }); - test.done(); - }, - }, - 'can use a DockerImageAsset directly for a container image'(test: Test) { - // GIVEN - const app = new cdk.App({ - context: { - '@aws-cdk/aws-ecr-assets:dockerIgnoreSupport': true, - }, }); + }); + + testFutureBehavior('can use a DockerImageAsset directly for a container image', { '@aws-cdk/aws-ecr-assets:dockerIgnoreSupport': true }, cdk.App, (app) => { + // GIVEN const stack = new cdk.Stack(app, 'Stack'); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); const asset = new ecr_assets.DockerImageAsset(stack, 'MyDockerImage', { @@ -1665,7 +1658,7 @@ export = { }); // THEN - expect(stack).to(haveResource('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResource('AWS::ECS::TaskDefinition', { ContainerDefinitions: [ { Essential: true, @@ -1686,8 +1679,8 @@ export = { Name: 'default', }, ], - })); - expect(stack).to(haveResource('AWS::IAM::Policy', { + }); + expect(stack).toHaveResource('AWS::IAM::Policy', { PolicyDocument: { Statement: [ { @@ -1712,17 +1705,12 @@ export = { ], Version: '2012-10-17', }, - })); - test.done(); - }, + }); - 'docker image asset options can be used when using container image'(test: Test) { + }); + + testFutureBehavior('docker image asset options can be used when using container image', { '@aws-cdk/aws-ecr-assets:dockerIgnoreSupport': true }, cdk.App, (app) => { // GIVEN - const app = new cdk.App({ - context: { - '@aws-cdk/aws-ecr-assets:dockerIgnoreSupport': true, - }, - }); const stack = new cdk.Stack(app, 'MyStack'); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); @@ -1737,7 +1725,7 @@ export = { // THEN const asm = app.synth(); - test.deepEqual(asm.getStackArtifact(stack.artifactId).assets[0], { + expect(asm.getStackArtifact(stack.artifactId).assets[0]).toEqual({ repositoryName: 'aws-cdk/assets', imageTag: 'ce3419d7c5d2d44e2789b13ccbd2d54ddf682557669f68bcee753231f5f1c0a5', id: 'ce3419d7c5d2d44e2789b13ccbd2d54ddf682557669f68bcee753231f5f1c0a5', @@ -1747,6 +1735,6 @@ export = { target: 'build-target', file: 'index.py', }); - test.done(); - }, -}; + + }); +}); diff --git a/packages/@aws-cdk/aws-ecs/test/ec2/test.cross-stack.ts b/packages/@aws-cdk/aws-ecs/test/ec2/cross-stack.test.ts similarity index 97% rename from packages/@aws-cdk/aws-ecs/test/ec2/test.cross-stack.ts rename to packages/@aws-cdk/aws-ecs/test/ec2/cross-stack.test.ts index 5eb7c61a6d346..12d908957fc88 100644 --- a/packages/@aws-cdk/aws-ecs/test/ec2/test.cross-stack.ts +++ b/packages/@aws-cdk/aws-ecs/test/ec2/cross-stack.test.ts @@ -2,7 +2,7 @@ import { expect, haveResource } from '@aws-cdk/assert'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as elbv2 from '@aws-cdk/aws-elasticloadbalancingv2'; import { App, Stack } from '@aws-cdk/core'; -import { Test } from 'nodeunit'; +import { nodeunitShim, Test } from 'nodeunit-shim'; import * as ecs from '../../lib'; // Test various cross-stack Cluster/Service/ALB scenario's @@ -13,7 +13,7 @@ let stack2: Stack; let cluster: ecs.Cluster; let service: ecs.Ec2Service; -export = { +nodeunitShim({ 'setUp'(cb: () => void) { app = new App(); @@ -89,7 +89,7 @@ export = { test.done(); }, -}; +}); function expectIngress(stack: Stack) { expect(stack).to(haveResource('AWS::EC2::SecurityGroupIngress', { diff --git a/packages/@aws-cdk/aws-ecs/test/ec2/test.ec2-service.ts b/packages/@aws-cdk/aws-ecs/test/ec2/ec2-service.test.ts similarity index 99% rename from packages/@aws-cdk/aws-ecs/test/ec2/test.ec2-service.ts rename to packages/@aws-cdk/aws-ecs/test/ec2/ec2-service.test.ts index c4b2816234595..2279245aebaa4 100644 --- a/packages/@aws-cdk/aws-ecs/test/ec2/test.ec2-service.ts +++ b/packages/@aws-cdk/aws-ecs/test/ec2/ec2-service.test.ts @@ -4,12 +4,12 @@ import * as elb from '@aws-cdk/aws-elasticloadbalancing'; import * as elbv2 from '@aws-cdk/aws-elasticloadbalancingv2'; import * as cloudmap from '@aws-cdk/aws-servicediscovery'; import * as cdk from '@aws-cdk/core'; -import { Test } from 'nodeunit'; +import { nodeunitShim, Test } from 'nodeunit-shim'; import * as ecs from '../../lib'; import { DeploymentControllerType, LaunchType, PropagatedTagSource } from '../../lib/base/base-service'; import { PlacementConstraint, PlacementStrategy } from '../../lib/placement'; -export = { +nodeunitShim({ 'When creating an EC2 Service': { 'with only required properties set, it correctly sets default properties'(test: Test) { // GIVEN @@ -2269,4 +2269,4 @@ export = { test.done(); }, }, -}; +}); diff --git a/packages/@aws-cdk/aws-ecs/test/ec2/test.ec2-task-definition.ts b/packages/@aws-cdk/aws-ecs/test/ec2/ec2-task-definition.test.ts similarity index 84% rename from packages/@aws-cdk/aws-ecs/test/ec2/test.ec2-task-definition.ts rename to packages/@aws-cdk/aws-ecs/test/ec2/ec2-task-definition.test.ts index 9264c47e4550c..bea2e3c0733e5 100644 --- a/packages/@aws-cdk/aws-ecs/test/ec2/test.ec2-task-definition.ts +++ b/packages/@aws-cdk/aws-ecs/test/ec2/ec2-task-definition.test.ts @@ -1,33 +1,33 @@ +import '@aws-cdk/assert/jest'; import * as path from 'path'; -import { expect, haveResource, haveResourceLike } from '@aws-cdk/assert'; import { Protocol } from '@aws-cdk/aws-ec2'; import { Repository } from '@aws-cdk/aws-ecr'; import * as iam from '@aws-cdk/aws-iam'; import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; import * as ssm from '@aws-cdk/aws-ssm'; import * as cdk from '@aws-cdk/core'; -import { Test } from 'nodeunit'; +import { testFutureBehavior } from 'cdk-build-tools/lib/feature-flag'; import * as ecs from '../../lib'; -export = { - 'When creating an ECS TaskDefinition': { - 'with only required properties set, it correctly sets default properties'(test: Test) { +describe('ec2 task definition', () => { + describe('When creating an ECS TaskDefinition', () => { + test('with only required properties set, it correctly sets default properties', () => { // GIVEN const stack = new cdk.Stack(); new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef'); // THEN - expect(stack).to(haveResource('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResource('AWS::ECS::TaskDefinition', { Family: 'Ec2TaskDef', NetworkMode: ecs.NetworkMode.BRIDGE, RequiresCompatibilities: ['EC2'], - })); + }); // test error if no container defs? - test.done(); - }, - 'with all properties set'(test: Test) { + }); + + test('with all properties set', () => { // GIVEN const stack = new cdk.Stack(); new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef', { @@ -55,7 +55,7 @@ export = { }); // THEN - expect(stack).to(haveResource('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResource('AWS::ECS::TaskDefinition', { ExecutionRoleArn: { 'Fn::GetAtt': [ 'ExecutionRole605A040B', @@ -89,12 +89,12 @@ export = { Name: 'scratch', }, ], - })); + }); - test.done(); - }, - 'correctly sets placement constraint'(test: Test) { + }); + + test('correctly sets placement constraint', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef'); @@ -103,7 +103,7 @@ export = { taskDefinition.addPlacementConstraint(ecs.PlacementConstraint.memberOf('attribute:ecs.instance-type =~ t2.*')); // THEN - expect(stack).to(haveResource('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResource('AWS::ECS::TaskDefinition', { PlacementConstraints: [ { Expression: 'attribute:ecs.instance-type =~ t2.*', @@ -111,12 +111,12 @@ export = { }, ], - })); + }); - test.done(); - }, - 'correctly sets network mode'(test: Test) { + }); + + test('correctly sets network mode', () => { // GIVEN const stack = new cdk.Stack(); new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef', { @@ -124,14 +124,14 @@ export = { }); // THEN - expect(stack).to(haveResource('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResource('AWS::ECS::TaskDefinition', { NetworkMode: ecs.NetworkMode.AWS_VPC, - })); + }); + - test.done(); - }, + }); - 'correctly sets ipc mode'(test: Test) { + test('correctly sets ipc mode', () => { // GIVEN const stack = new cdk.Stack(); new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef', { @@ -139,14 +139,14 @@ export = { }); // THEN - expect(stack).to(haveResource('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResource('AWS::ECS::TaskDefinition', { IpcMode: ecs.IpcMode.TASK, - })); + }); + - test.done(); - }, + }); - 'correctly sets pid mode'(test: Test) { + test('correctly sets pid mode', () => { // GIVEN const stack = new cdk.Stack(); new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef', { @@ -154,14 +154,14 @@ export = { }); // THEN - expect(stack).to(haveResource('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResource('AWS::ECS::TaskDefinition', { PidMode: ecs.PidMode.HOST, - })); + }); + - test.done(); - }, + }); - 'correctly sets containers'(test: Test) { + test('correctly sets containers', () => { // GIVEN const stack = new cdk.Stack(); @@ -193,7 +193,7 @@ export = { })); // THEN - expect(stack).to(haveResource('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResource('AWS::ECS::TaskDefinition', { Family: 'Ec2TaskDef', ContainerDefinitions: [{ Essential: true, @@ -219,9 +219,9 @@ export = { }, ], }], - })); + }); - expect(stack).to(haveResource('AWS::IAM::Policy', { + expect(stack).toHaveResource('AWS::IAM::Policy', { PolicyDocument: { Version: '2012-10-17', Statement: [ @@ -232,12 +232,12 @@ export = { }, ], }, - })); + }); - test.done(); - }, - 'all container definition options defined'(test: Test) { + }); + + test('all container definition options defined', () => { // GIVEN const stack = new cdk.Stack(); @@ -287,7 +287,7 @@ export = { }); // THEN - expect(stack).to(haveResource('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResource('AWS::ECS::TaskDefinition', { Family: 'Ec2TaskDef', ContainerDefinitions: [ { @@ -434,12 +434,12 @@ export = { WorkingDirectory: 'app/', }, ], - })); + }); - test.done(); - }, - 'correctly sets containers from ECR repository using all props'(test: Test) { + }); + + test('correctly sets containers from ECR repository using all props', () => { // GIVEN const stack = new cdk.Stack(); @@ -460,16 +460,16 @@ export = { }); // THEN - expect(stack).to(haveResource('AWS::ECR::Repository', { + expect(stack).toHaveResource('AWS::ECR::Repository', { LifecyclePolicy: { // eslint-disable-next-line max-len LifecyclePolicyText: '{"rules":[{"rulePriority":10,"selection":{"tagStatus":"tagged","tagPrefixList":["abc"],"countType":"imageCountMoreThan","countNumber":1},"action":{"type":"expire"}}]}', RegistryId: '123456789101', }, RepositoryName: 'project-a/amazon-ecs-sample', - })); + }); - expect(stack).to(haveResource('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResource('AWS::ECS::TaskDefinition', { Family: 'Ec2TaskDef', ContainerDefinitions: [{ Essential: true, @@ -525,12 +525,12 @@ export = { }, Name: 'web', }], - })); + }); + - test.done(); - }, + }); - 'correctly sets containers from ECR repository using default props'(test: Test) { + test('correctly sets containers from ECR repository using default props', () => { // GIVEN const stack = new cdk.Stack(); @@ -543,12 +543,12 @@ export = { }); // THEN - expect(stack).to(haveResource('AWS::ECR::Repository', {})); + expect(stack).toHaveResource('AWS::ECR::Repository', {}); + - test.done(); - }, + }); - 'warns when setting containers from ECR repository using fromRegistry method'(test: Test) { + test('warns when setting containers from ECR repository using fromRegistry method', () => { // GIVEN const stack = new cdk.Stack(); @@ -561,11 +561,11 @@ export = { }); // THEN - test.deepEqual(container.node.metadata[0].data, "Proper policies need to be attached before pulling from ECR repository, or use 'fromEcrRepository'."); - test.done(); - }, + expect(container.node.metadata[0].data).toEqual("Proper policies need to be attached before pulling from ECR repository, or use 'fromEcrRepository'."); - 'warns when setting containers from ECR repository by creating a RepositoryImage class'(test: Test) { + }); + + test('warns when setting containers from ECR repository by creating a RepositoryImage class', () => { // GIVEN const stack = new cdk.Stack(); @@ -580,18 +580,13 @@ export = { }); // THEN - test.deepEqual(container.node.metadata[0].data, "Proper policies need to be attached before pulling from ECR repository, or use 'fromEcrRepository'."); + expect(container.node.metadata[0].data).toEqual("Proper policies need to be attached before pulling from ECR repository, or use 'fromEcrRepository'."); + - test.done(); - }, + }); - 'correctly sets containers from asset using default props'(test: Test) { + testFutureBehavior('correctly sets containers from asset using default props', { '@aws-cdk/aws-ecr-assets:dockerIgnoreSupport': true }, cdk.App, (app) => { // GIVEN - const app = new cdk.App({ - context: { - '@aws-cdk/aws-ecr-assets:dockerIgnoreSupport': true, - }, - }); const stack = new cdk.Stack(app, 'Stack'); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef'); @@ -603,7 +598,7 @@ export = { }); // THEN - expect(stack).to(haveResource('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResource('AWS::ECS::TaskDefinition', { Family: 'StackEc2TaskDefF03698CF', ContainerDefinitions: [ { @@ -631,12 +626,12 @@ export = { Name: 'web', }, ], - })); + }); + - test.done(); - }, + }); - 'correctly sets containers from asset using all props'(test: Test) { + test('correctly sets containers from asset using all props', () => { // GIVEN const stack = new cdk.Stack(); @@ -649,10 +644,10 @@ export = { memoryLimitMiB: 512, }); - test.done(); - }, - 'correctly sets scratch space'(test: Test) { + }); + + test('correctly sets scratch space', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef'); @@ -670,7 +665,7 @@ export = { }); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { Family: 'Ec2TaskDef', ContainerDefinitions: [{ MountPoints: [ @@ -687,11 +682,11 @@ export = { }, Name: 'scratch', }], - })); + }); - test.done(); - }, - 'correctly sets container dependenices'(test: Test) { + + }); + test('correctly sets container dependenices', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef'); @@ -721,7 +716,7 @@ export = { ); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { Family: 'Ec2TaskDef', ContainerDefinitions: [{ Name: 'dependency1', @@ -740,11 +735,11 @@ export = { ContainerName: 'dependency2', }], }], - })); + }); + - test.done(); - }, - 'correctly sets links'(test: Test) { + }); + test('correctly sets links', () => { const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef', { @@ -770,7 +765,7 @@ export = { container.addLink(linkedContainer2); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { ContainerDefinitions: [ { Links: [ @@ -786,12 +781,12 @@ export = { Name: 'linked2', }, ], - })); + }); + - test.done(); - }, + }); - 'correctly set policy statement to the task IAM role'(test: Test) { + test('correctly set policy statement to the task IAM role', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef'); @@ -803,7 +798,7 @@ export = { })); // THEN - expect(stack).to(haveResource('AWS::IAM::Policy', { + expect(stack).toHaveResource('AWS::IAM::Policy', { PolicyDocument: { Version: '2012-10-17', Statement: [ @@ -814,11 +809,11 @@ export = { }, ], }, - })); + }); + - test.done(); - }, - 'correctly sets volumes from'(test: Test) { + }); + test('correctly sets volumes from', () => { const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef', {}); @@ -834,7 +829,7 @@ export = { }); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { ContainerDefinitions: [{ VolumesFrom: [ { @@ -843,12 +838,12 @@ export = { }, ], }], - })); + }); - test.done(); - }, - 'correctly set policy statement to the task execution IAM role'(test: Test) { + }); + + test('correctly set policy statement to the task execution IAM role', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef'); @@ -860,7 +855,7 @@ export = { })); // THEN - expect(stack).to(haveResource('AWS::IAM::Policy', { + expect(stack).toHaveResource('AWS::IAM::Policy', { PolicyDocument: { Version: '2012-10-17', Statement: [ @@ -871,12 +866,12 @@ export = { }, ], }, - })); + }); + - test.done(); - }, + }); - 'correctly sets volumes'(test: Test) { + test('correctly sets volumes', () => { // GIVEN const stack = new cdk.Stack(); const volume = { @@ -904,7 +899,7 @@ export = { }); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { Family: 'Ec2TaskDef', ContainerDefinitions: [{ MountPoints: [ @@ -921,12 +916,12 @@ export = { }, Name: 'scratch', }], - })); + }); - test.done(); - }, - 'correctly sets placement constraints'(test: Test) { + }); + + test('correctly sets placement constraints', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef', { @@ -941,19 +936,19 @@ export = { }); // THEN - expect(stack).to(haveResource('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResource('AWS::ECS::TaskDefinition', { PlacementConstraints: [ { Expression: 'attribute:ecs.instance-type =~ t2.*', Type: 'memberOf', }, ], - })); + }); - test.done(); - }, - 'correctly sets taskRole'(test: Test) { + }); + + test('correctly sets taskRole', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef', { @@ -968,27 +963,27 @@ export = { }); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { TaskRoleArn: stack.resolve(taskDefinition.taskRole.roleArn), - })); + }); - test.done(); - }, - 'automatically sets taskRole by default'(test: Test) { + }); + + test('automatically sets taskRole by default', () => { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef'); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { TaskRoleArn: stack.resolve(taskDefinition.taskRole.roleArn), - })); + }); + - test.done(); - }, + }); - 'correctly sets dockerVolumeConfiguration'(test: Test) { + test('correctly sets dockerVolumeConfiguration', () => { // GIVEN const stack = new cdk.Stack(); const volume = { @@ -1012,7 +1007,7 @@ export = { }); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { Family: 'Ec2TaskDef', Volumes: [{ Name: 'scratch', @@ -1024,12 +1019,12 @@ export = { }, }, }], - })); + }); + - test.done(); - }, + }); - 'correctly sets efsVolumeConfiguration'(test: Test) { + test('correctly sets efsVolumeConfiguration', () => { // GIVEN const stack = new cdk.Stack(); const volume = { @@ -1049,7 +1044,7 @@ export = { }); // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { Family: 'Ec2TaskDef', Volumes: [{ Name: 'scratch', @@ -1057,13 +1052,13 @@ export = { FileSystemId: 'local', }, }], - })); + }); - test.done(); - }, - }, - 'throws when setting proxyConfiguration without networkMode AWS_VPC'(test: Test) { + }); + }); + + test('throws when setting proxyConfiguration without networkMode AWS_VPC', () => { // GIVEN const stack = new cdk.Stack(); @@ -1079,10 +1074,10 @@ export = { }); // THEN - test.throws(() => { + expect(() => { new ecs.Ec2TaskDefinition(stack, 'TaskDef', { networkMode: ecs.NetworkMode.BRIDGE, proxyConfiguration }); - }, /ProxyConfiguration can only be used with AwsVpc network mode, got: bridge/); + }).toThrow(/ProxyConfiguration can only be used with AwsVpc network mode, got: bridge/); + - test.done(); - }, -}; + }); +}); diff --git a/packages/@aws-cdk/aws-ecs/test/ec2/integ.environment-file.expected.json b/packages/@aws-cdk/aws-ecs/test/ec2/integ.environment-file.expected.json index 9376c507c20cf..b287e6ffc33fa 100644 --- a/packages/@aws-cdk/aws-ecs/test/ec2/integ.environment-file.expected.json +++ b/packages/@aws-cdk/aws-ecs/test/ec2/integ.environment-file.expected.json @@ -1176,7 +1176,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -1385,4 +1385,4 @@ "Description": "Artifact hash for asset \"872561bf078edd1685d50c9ff821cdd60d2b2ddfb0013c4087e79bf2bb50724d\"" } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/aws-ecs/test/test.ecs-cluster.ts b/packages/@aws-cdk/aws-ecs/test/ecs-cluster.test.ts similarity index 99% rename from packages/@aws-cdk/aws-ecs/test/test.ecs-cluster.ts rename to packages/@aws-cdk/aws-ecs/test/ecs-cluster.test.ts index 7741c6b5bdb9f..119e6d11a93ce 100644 --- a/packages/@aws-cdk/aws-ecs/test/test.ecs-cluster.ts +++ b/packages/@aws-cdk/aws-ecs/test/ecs-cluster.test.ts @@ -9,10 +9,10 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as kms from '@aws-cdk/aws-kms'; import * as cloudmap from '@aws-cdk/aws-servicediscovery'; import * as cdk from '@aws-cdk/core'; -import { Test } from 'nodeunit'; +import { nodeunitShim, Test } from 'nodeunit-shim'; import * as ecs from '../lib'; -export = { +nodeunitShim({ 'When creating an ECS Cluster': { 'with no properties set, it correctly sets default properties'(test: Test) { // GIVEN @@ -1731,4 +1731,4 @@ export = { test.done(); }, -}; +}); diff --git a/packages/@aws-cdk/aws-ecs/test/test.environment-file.ts b/packages/@aws-cdk/aws-ecs/test/environment-file.test.ts similarity index 96% rename from packages/@aws-cdk/aws-ecs/test/test.environment-file.ts rename to packages/@aws-cdk/aws-ecs/test/environment-file.test.ts index a0d6fc29d3aed..e80651cbbd65b 100644 --- a/packages/@aws-cdk/aws-ecs/test/test.environment-file.ts +++ b/packages/@aws-cdk/aws-ecs/test/environment-file.test.ts @@ -1,11 +1,11 @@ import * as path from 'path'; import * as cdk from '@aws-cdk/core'; -import { Test } from 'nodeunit'; +import { nodeunitShim, Test } from 'nodeunit-shim'; import * as ecs from '../lib'; /* eslint-disable dot-notation */ -export = { +nodeunitShim({ 'ecs.EnvironmentFile.fromAsset': { 'fails if asset is not a single file'(test: Test) { // GIVEN @@ -45,7 +45,7 @@ export = { test.done(); }, }, -}; +}); function defineContainerDefinition(stack: cdk.Stack, environmentFile: ecs.EnvironmentFile) { const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); diff --git a/packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-service.ts b/packages/@aws-cdk/aws-ecs/test/fargate/fargate-service.test.ts similarity index 99% rename from packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-service.ts rename to packages/@aws-cdk/aws-ecs/test/fargate/fargate-service.test.ts index ebb36580d19ba..acddf713d6d0a 100644 --- a/packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs/test/fargate/fargate-service.test.ts @@ -6,11 +6,11 @@ import * as elbv2 from '@aws-cdk/aws-elasticloadbalancingv2'; import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; import * as cloudmap from '@aws-cdk/aws-servicediscovery'; import * as cdk from '@aws-cdk/core'; -import { Test } from 'nodeunit'; +import { nodeunitShim, Test } from 'nodeunit-shim'; import * as ecs from '../../lib'; import { DeploymentControllerType, LaunchType } from '../../lib/base/base-service'; -export = { +nodeunitShim({ 'When creating a Fargate Service': { 'with only required properties set, it correctly sets default properties'(test: Test) { // GIVEN @@ -1935,4 +1935,4 @@ export = { test.done(); }, }, -}; +}); diff --git a/packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-task-definition.ts b/packages/@aws-cdk/aws-ecs/test/fargate/fargate-task-definition.test.ts similarity index 97% rename from packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-task-definition.ts rename to packages/@aws-cdk/aws-ecs/test/fargate/fargate-task-definition.test.ts index 99aeb6da886f9..00ec0028ef1a3 100644 --- a/packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-task-definition.ts +++ b/packages/@aws-cdk/aws-ecs/test/fargate/fargate-task-definition.test.ts @@ -1,10 +1,10 @@ import { expect, haveResourceLike } from '@aws-cdk/assert'; import * as iam from '@aws-cdk/aws-iam'; import * as cdk from '@aws-cdk/core'; -import { Test } from 'nodeunit'; +import { nodeunitShim, Test } from 'nodeunit-shim'; import * as ecs from '../../lib'; -export = { +nodeunitShim({ 'When creating an Fargate TaskDefinition': { 'with only required properties set, it correctly sets default properties'(test: Test) { // GIVEN @@ -114,4 +114,4 @@ export = { test.done(); }, }, -}; +}); diff --git a/packages/@aws-cdk/aws-ecs/test/test.firelens-log-driver.ts b/packages/@aws-cdk/aws-ecs/test/firelens-log-driver.test.ts similarity index 98% rename from packages/@aws-cdk/aws-ecs/test/test.firelens-log-driver.ts rename to packages/@aws-cdk/aws-ecs/test/firelens-log-driver.test.ts index 3a1fb264d6b34..99a1c6b935b64 100644 --- a/packages/@aws-cdk/aws-ecs/test/test.firelens-log-driver.ts +++ b/packages/@aws-cdk/aws-ecs/test/firelens-log-driver.test.ts @@ -1,13 +1,13 @@ import { expect, haveResourceLike } from '@aws-cdk/assert'; import * as cdk from '@aws-cdk/core'; -import { Test } from 'nodeunit'; +import { nodeunitShim, Test } from 'nodeunit-shim'; import * as ecs from '../lib'; let stack: cdk.Stack; let td: ecs.TaskDefinition; const image = ecs.ContainerImage.fromRegistry('test-image'); -export = { +nodeunitShim({ 'setUp'(cb: () => void) { stack = new cdk.Stack(); td = new ecs.Ec2TaskDefinition(stack, 'TaskDefinition'); @@ -229,4 +229,4 @@ export = { test.done(); }, }, -}; +}); diff --git a/packages/@aws-cdk/aws-ecs/test/test.fluentd-log-driver.ts b/packages/@aws-cdk/aws-ecs/test/fluentd-log-driver.test.ts similarity index 97% rename from packages/@aws-cdk/aws-ecs/test/test.fluentd-log-driver.ts rename to packages/@aws-cdk/aws-ecs/test/fluentd-log-driver.test.ts index 5d451ec365683..a317699d1075d 100644 --- a/packages/@aws-cdk/aws-ecs/test/test.fluentd-log-driver.ts +++ b/packages/@aws-cdk/aws-ecs/test/fluentd-log-driver.test.ts @@ -1,13 +1,13 @@ import { expect, haveResourceLike } from '@aws-cdk/assert'; import * as cdk from '@aws-cdk/core'; -import { Test } from 'nodeunit'; +import { nodeunitShim, Test } from 'nodeunit-shim'; import * as ecs from '../lib'; let stack: cdk.Stack; let td: ecs.TaskDefinition; const image = ecs.ContainerImage.fromRegistry('test-image'); -export = { +nodeunitShim({ 'setUp'(cb: () => void) { stack = new cdk.Stack(); td = new ecs.Ec2TaskDefinition(stack, 'TaskDefinition'); @@ -138,4 +138,4 @@ export = { test.done(); }, -}; +}); diff --git a/packages/@aws-cdk/aws-ecs/test/test.gelf-log-driver.ts b/packages/@aws-cdk/aws-ecs/test/gelf-log-driver.test.ts similarity index 95% rename from packages/@aws-cdk/aws-ecs/test/test.gelf-log-driver.ts rename to packages/@aws-cdk/aws-ecs/test/gelf-log-driver.test.ts index f62941f010f59..7907b0532b0ac 100644 --- a/packages/@aws-cdk/aws-ecs/test/test.gelf-log-driver.ts +++ b/packages/@aws-cdk/aws-ecs/test/gelf-log-driver.test.ts @@ -1,13 +1,13 @@ import { expect, haveResourceLike } from '@aws-cdk/assert'; import * as cdk from '@aws-cdk/core'; -import { Test } from 'nodeunit'; +import { nodeunitShim, Test } from 'nodeunit-shim'; import * as ecs from '../lib'; let stack: cdk.Stack; let td: ecs.TaskDefinition; const image = ecs.ContainerImage.fromRegistry('test-image'); -export = { +nodeunitShim({ 'setUp'(cb: () => void) { stack = new cdk.Stack(); td = new ecs.Ec2TaskDefinition(stack, 'TaskDefinition'); @@ -68,4 +68,4 @@ export = { test.done(); }, -}; +}); diff --git a/packages/@aws-cdk/aws-ecs/test/images/test.tag-parameter-container-image.ts b/packages/@aws-cdk/aws-ecs/test/images/tag-parameter-container-image.test.ts similarity index 91% rename from packages/@aws-cdk/aws-ecs/test/images/test.tag-parameter-container-image.ts rename to packages/@aws-cdk/aws-ecs/test/images/tag-parameter-container-image.test.ts index 2a96c471b1417..d0fe101252e26 100644 --- a/packages/@aws-cdk/aws-ecs/test/images/test.tag-parameter-container-image.ts +++ b/packages/@aws-cdk/aws-ecs/test/images/tag-parameter-container-image.test.ts @@ -1,10 +1,10 @@ import { SynthUtils } from '@aws-cdk/assert'; import * as ecr from '@aws-cdk/aws-ecr'; import * as cdk from '@aws-cdk/core'; -import { Test } from 'nodeunit'; +import { nodeunitShim, Test } from 'nodeunit-shim'; import * as ecs from '../../lib'; -export = { +nodeunitShim({ 'TagParameter container image': { 'throws an error when tagParameterName() is used without binding the image'(test: Test) { // GIVEN @@ -22,4 +22,4 @@ export = { test.done(); }, }, -}; +}); diff --git a/packages/@aws-cdk/aws-ecs/test/test.journald-log-driver.ts b/packages/@aws-cdk/aws-ecs/test/journald-log-driver.test.ts similarity index 96% rename from packages/@aws-cdk/aws-ecs/test/test.journald-log-driver.ts rename to packages/@aws-cdk/aws-ecs/test/journald-log-driver.test.ts index f71d796b6d380..31bec4a42e47f 100644 --- a/packages/@aws-cdk/aws-ecs/test/test.journald-log-driver.ts +++ b/packages/@aws-cdk/aws-ecs/test/journald-log-driver.test.ts @@ -1,13 +1,13 @@ import { expect, haveResourceLike } from '@aws-cdk/assert'; import * as cdk from '@aws-cdk/core'; -import { Test } from 'nodeunit'; +import { nodeunitShim, Test } from 'nodeunit-shim'; import * as ecs from '../lib'; let stack: cdk.Stack; let td: ecs.TaskDefinition; const image = ecs.ContainerImage.fromRegistry('test-image'); -export = { +nodeunitShim({ 'setUp'(cb: () => void) { stack = new cdk.Stack(); td = new ecs.Ec2TaskDefinition(stack, 'TaskDefinition'); @@ -86,4 +86,4 @@ export = { test.done(); }, -}; +}); diff --git a/packages/@aws-cdk/aws-ecs/test/test.json-file-log-driver.ts b/packages/@aws-cdk/aws-ecs/test/json-file-log-driver.test.ts similarity index 96% rename from packages/@aws-cdk/aws-ecs/test/test.json-file-log-driver.ts rename to packages/@aws-cdk/aws-ecs/test/json-file-log-driver.test.ts index c7e3f6acec377..e75ff398eeb03 100644 --- a/packages/@aws-cdk/aws-ecs/test/test.json-file-log-driver.ts +++ b/packages/@aws-cdk/aws-ecs/test/json-file-log-driver.test.ts @@ -1,13 +1,13 @@ import { expect, haveResourceLike } from '@aws-cdk/assert'; import * as cdk from '@aws-cdk/core'; -import { Test } from 'nodeunit'; +import { nodeunitShim, Test } from 'nodeunit-shim'; import * as ecs from '../lib'; let stack: cdk.Stack; let td: ecs.TaskDefinition; const image = ecs.ContainerImage.fromRegistry('test-image'); -export = { +nodeunitShim({ 'setUp'(cb: () => void) { stack = new cdk.Stack(); td = new ecs.Ec2TaskDefinition(stack, 'TaskDefinition'); @@ -86,4 +86,4 @@ export = { test.done(); }, -}; +}); diff --git a/packages/@aws-cdk/aws-ecs/test/test.splunk-log-driver.ts b/packages/@aws-cdk/aws-ecs/test/splunk-log-driver.test.ts similarity index 97% rename from packages/@aws-cdk/aws-ecs/test/test.splunk-log-driver.ts rename to packages/@aws-cdk/aws-ecs/test/splunk-log-driver.test.ts index 960f3b749f183..c8afd01daade1 100644 --- a/packages/@aws-cdk/aws-ecs/test/test.splunk-log-driver.ts +++ b/packages/@aws-cdk/aws-ecs/test/splunk-log-driver.test.ts @@ -1,13 +1,13 @@ import { expect, haveResourceLike } from '@aws-cdk/assert'; import * as cdk from '@aws-cdk/core'; -import { Test } from 'nodeunit'; +import { nodeunitShim, Test } from 'nodeunit-shim'; import * as ecs from '../lib'; let stack: cdk.Stack; let td: ecs.TaskDefinition; const image = ecs.ContainerImage.fromRegistry('test-image'); -export = { +nodeunitShim({ 'setUp'(cb: () => void) { stack = new cdk.Stack(); td = new ecs.Ec2TaskDefinition(stack, 'TaskDefinition'); @@ -103,4 +103,4 @@ export = { test.done(); }, -}; +}); diff --git a/packages/@aws-cdk/aws-ecs/test/test.syslog-log-driver.ts b/packages/@aws-cdk/aws-ecs/test/syslog-log-driver.test.ts similarity index 96% rename from packages/@aws-cdk/aws-ecs/test/test.syslog-log-driver.ts rename to packages/@aws-cdk/aws-ecs/test/syslog-log-driver.test.ts index cde1a2a6b1b63..b14c05a5b3234 100644 --- a/packages/@aws-cdk/aws-ecs/test/test.syslog-log-driver.ts +++ b/packages/@aws-cdk/aws-ecs/test/syslog-log-driver.test.ts @@ -1,13 +1,13 @@ import { expect, haveResourceLike } from '@aws-cdk/assert'; import * as cdk from '@aws-cdk/core'; -import { Test } from 'nodeunit'; +import { nodeunitShim, Test } from 'nodeunit-shim'; import * as ecs from '../lib'; let stack: cdk.Stack; let td: ecs.TaskDefinition; const image = ecs.ContainerImage.fromRegistry('test-image'); -export = { +nodeunitShim({ 'setUp'(cb: () => void) { stack = new cdk.Stack(); td = new ecs.Ec2TaskDefinition(stack, 'TaskDefinition'); @@ -86,4 +86,4 @@ export = { test.done(); }, -}; +}); diff --git a/packages/@aws-cdk/aws-ecs/test/test.task-definition.ts b/packages/@aws-cdk/aws-ecs/test/task-definition.test.ts similarity index 88% rename from packages/@aws-cdk/aws-ecs/test/test.task-definition.ts rename to packages/@aws-cdk/aws-ecs/test/task-definition.test.ts index 299e2f81b0651..34a7306106d66 100644 --- a/packages/@aws-cdk/aws-ecs/test/test.task-definition.ts +++ b/packages/@aws-cdk/aws-ecs/test/task-definition.test.ts @@ -1,9 +1,9 @@ import { expect, haveResource } from '@aws-cdk/assert'; import * as cdk from '@aws-cdk/core'; -import { Test } from 'nodeunit'; +import { nodeunitShim, Test } from 'nodeunit-shim'; import * as ecs from '../lib'; -export = { +nodeunitShim({ 'A task definition with both compatibilities defaults to networkmode AwsVpc'(test: Test) { // GIVEN const stack = new cdk.Stack(); @@ -22,4 +22,4 @@ export = { test.done(); }, -}; +}); diff --git a/packages/@aws-cdk/aws-eks/README.md b/packages/@aws-cdk/aws-eks/README.md index ee758461b986f..59909c9ea9a0b 100644 --- a/packages/@aws-cdk/aws-eks/README.md +++ b/packages/@aws-cdk/aws-eks/README.md @@ -466,6 +466,8 @@ const cluster = new eks.Cluster(this, 'hello-eks', { }); ``` +The default value is `eks.EndpointAccess.PUBLIC_AND_PRIVATE`. Which means the cluster endpoint is accessible from outside of your VPC, but worker node traffic and `kubectl` commands issued by this library stay within your VPC. + ### VPC Support You can specify the VPC of the cluster using the `vpc` and `vpcSubnets` properties: @@ -634,8 +636,6 @@ $ aws eks update-kubeconfig --name cluster-xxxxx --role-arn arn:aws:iam::1122334 Added new context arn:aws:eks:rrrrr:112233445566:cluster/cluster-xxxxx to /home/boom/.kube/config ``` -The default value is `eks.EndpointAccess.PUBLIC_AND_PRIVATE`. Which means the cluster endpoint is accessible from outside of your VPC, but worker node traffic and `kubectl` commands issued by this library stay within your VPC. - ### Encryption When you create an Amazon EKS cluster, envelope encryption of Kubernetes secrets using the AWS Key Management Service (AWS KMS) can be enabled. diff --git a/packages/@aws-cdk/aws-eks/lib/cluster-resource.ts b/packages/@aws-cdk/aws-eks/lib/cluster-resource.ts index 5d89741026aa9..e134601aef73d 100644 --- a/packages/@aws-cdk/aws-eks/lib/cluster-resource.ts +++ b/packages/@aws-cdk/aws-eks/lib/cluster-resource.ts @@ -142,14 +142,6 @@ export class ClusterResource extends CoreConstruct { : '*', }); - creationRole.addToPolicy(new iam.PolicyStatement({ - actions: [ - 'ec2:DescribeSubnets', - 'ec2:DescribeRouteTables', - ], - resources: ['*'], - })); - creationRole.addToPolicy(new iam.PolicyStatement({ actions: [ 'eks:CreateCluster', @@ -181,13 +173,19 @@ export class ClusterResource extends CoreConstruct { })); // see https://github.com/aws/aws-cdk/issues/9027 + // these actions are the combined 'ec2:Describe*' actions taken from the EKS SLR policies. + // (AWSServiceRoleForAmazonEKS, AWSServiceRoleForAmazonEKSForFargate, AWSServiceRoleForAmazonEKSNodegroup) creationRole.addToPolicy(new iam.PolicyStatement({ - actions: ['ec2:DescribeVpcs'], - resources: [stack.formatArn({ - service: 'ec2', - resource: 'vpc', - resourceName: props.vpc.vpcId, - })], + actions: [ + 'ec2:DescribeInstances', + 'ec2:DescribeNetworkInterfaces', + 'ec2:DescribeSecurityGroups', + 'ec2:DescribeSubnets', + 'ec2:DescribeRouteTables', + 'ec2:DescribeDhcpOptions', + 'ec2:DescribeVpcs', + ], + resources: ['*'], })); // grant cluster creation role sufficient permission to access the specified key diff --git a/packages/@aws-cdk/aws-eks/lib/kubectl-provider.ts b/packages/@aws-cdk/aws-eks/lib/kubectl-provider.ts index e4c71cfda381c..b5bd8ed51b876 100644 --- a/packages/@aws-cdk/aws-eks/lib/kubectl-provider.ts +++ b/packages/@aws-cdk/aws-eks/lib/kubectl-provider.ts @@ -106,6 +106,7 @@ export class KubectlProvider extends NestedStack { onEventHandler: handler, vpc: cluster.kubectlPrivateSubnets ? cluster.vpc : undefined, vpcSubnets: cluster.kubectlPrivateSubnets ? { subnets: cluster.kubectlPrivateSubnets } : undefined, + securityGroups: cluster.kubectlSecurityGroup ? [cluster.kubectlSecurityGroup] : undefined, }); this.serviceToken = provider.serviceToken; diff --git a/packages/@aws-cdk/aws-eks/package.json b/packages/@aws-cdk/aws-eks/package.json index 6fef676ea0058..4d27cbfaac281 100644 --- a/packages/@aws-cdk/aws-eks/package.json +++ b/packages/@aws-cdk/aws-eks/package.json @@ -73,7 +73,7 @@ "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.31", "@types/yaml": "1.9.6", - "aws-sdk": "^2.845.0", + "aws-sdk": "^2.848.0", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "cfn2ts": "0.0.0", diff --git a/packages/@aws-cdk/aws-eks/test/integ.eks-cluster-handlers-vpc.expected.json b/packages/@aws-cdk/aws-eks/test/integ.eks-cluster-handlers-vpc.expected.json index 50e88fe3277d0..e7e1f394cdc7f 100644 --- a/packages/@aws-cdk/aws-eks/test/integ.eks-cluster-handlers-vpc.expected.json +++ b/packages/@aws-cdk/aws-eks/test/integ.eks-cluster-handlers-vpc.expected.json @@ -711,14 +711,6 @@ ] } }, - { - "Action": [ - "ec2:DescribeSubnets", - "ec2:DescribeRouteTables" - ], - "Effect": "Allow", - "Resource": "*" - }, { "Action": [ "eks:CreateCluster", @@ -758,23 +750,17 @@ "Resource": "*" }, { - "Action": "ec2:DescribeVpcs", + "Action": [ + "ec2:DescribeInstances", + "ec2:DescribeNetworkInterfaces", + "ec2:DescribeSecurityGroups", + "ec2:DescribeSubnets", + "ec2:DescribeRouteTables", + "ec2:DescribeDhcpOptions", + "ec2:DescribeVpcs" + ], "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":ec2:test-region:12345678:vpc/", - { - "Ref": "EksAllHandlersInVpcStackDefaultVpcBE11D4AE" - } - ] - ] - } + "Resource": "*" } ], "Version": "2012-10-17" @@ -1129,7 +1115,7 @@ }, "/", { - "Ref": "AssetParameters1a2bf12b9f0cf5ab2c838e7dd9be4d485bbf32056d6d5333bce57e49d12a172cS3Bucket151BE34C" + "Ref": "AssetParameters70396475d85a52e5c6ccad77894979d07433a207ea3c2668b929f3e70ffde081S3BucketFCD070AE" }, "/", { @@ -1139,7 +1125,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters1a2bf12b9f0cf5ab2c838e7dd9be4d485bbf32056d6d5333bce57e49d12a172cS3VersionKey89E7CC67" + "Ref": "AssetParameters70396475d85a52e5c6ccad77894979d07433a207ea3c2668b929f3e70ffde081S3VersionKeyD47BE42B" } ] } @@ -1152,7 +1138,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters1a2bf12b9f0cf5ab2c838e7dd9be4d485bbf32056d6d5333bce57e49d12a172cS3VersionKey89E7CC67" + "Ref": "AssetParameters70396475d85a52e5c6ccad77894979d07433a207ea3c2668b929f3e70ffde081S3VersionKeyD47BE42B" } ] } @@ -1193,7 +1179,9 @@ "Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3VersionKeyA495226F" } } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B": { "Type": "AWS::CloudFormation::Stack", @@ -1208,7 +1196,7 @@ }, "/", { - "Ref": "AssetParameters11ba420a0c99f0c77f563fb974e76d6110b4445114137af1fe1b69b0d366d2d7S3BucketE510C342" + "Ref": "AssetParameters93bb4c1c6bbced2c1adce602d7643d5475c6e463f4f57f4cd863e064d82a3d82S3Bucket8670C328" }, "/", { @@ -1218,7 +1206,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters11ba420a0c99f0c77f563fb974e76d6110b4445114137af1fe1b69b0d366d2d7S3VersionKeyD31A83B6" + "Ref": "AssetParameters93bb4c1c6bbced2c1adce602d7643d5475c6e463f4f57f4cd863e064d82a3d82S3VersionKeyCEFB3AF5" } ] } @@ -1231,7 +1219,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters11ba420a0c99f0c77f563fb974e76d6110b4445114137af1fe1b69b0d366d2d7S3VersionKeyD31A83B6" + "Ref": "AssetParameters93bb4c1c6bbced2c1adce602d7643d5475c6e463f4f57f4cd863e064d82a3d82S3VersionKeyCEFB3AF5" } ] } @@ -1274,20 +1262,17 @@ "ClusterSecurityGroupId" ] }, - "referencetoawscdkekshandlersinvpctestAssetParametersefd72738f046105c96299fb31b3da40320e71ee9cf74bc37720042898403e2a1S3BucketC0281AE8Ref": { - "Ref": "AssetParametersefd72738f046105c96299fb31b3da40320e71ee9cf74bc37720042898403e2a1S3Bucket6DACDE73" + "referencetoawscdkekshandlersinvpctestAssetParameterse9882ab123687399f934da0d45effe675ecc8ce13b40cb946f3e1d6141fe8d68S3Bucket124CC58FRef": { + "Ref": "AssetParameterse9882ab123687399f934da0d45effe675ecc8ce13b40cb946f3e1d6141fe8d68S3BucketAEADE8C7" }, - "referencetoawscdkekshandlersinvpctestAssetParametersefd72738f046105c96299fb31b3da40320e71ee9cf74bc37720042898403e2a1S3VersionKeyD6BA7117Ref": { - "Ref": "AssetParametersefd72738f046105c96299fb31b3da40320e71ee9cf74bc37720042898403e2a1S3VersionKey015AEA61" + "referencetoawscdkekshandlersinvpctestAssetParameterse9882ab123687399f934da0d45effe675ecc8ce13b40cb946f3e1d6141fe8d68S3VersionKeyF4C27F59Ref": { + "Ref": "AssetParameterse9882ab123687399f934da0d45effe675ecc8ce13b40cb946f3e1d6141fe8d68S3VersionKeyE415415F" }, - "referencetoawscdkekshandlersinvpctestAssetParametersb61858bbf1a0be803552e3efa9647befd728156696dff1b413b7b2fd4da1449fS3Bucket88622CD5Ref": { - "Ref": "AssetParametersb61858bbf1a0be803552e3efa9647befd728156696dff1b413b7b2fd4da1449fS3Bucket7EE7EA15" + "referencetoawscdkekshandlersinvpctestAssetParameters844c1a4b13479b359ea0e607dccb4a04b73e22cf88cf9b64feed2c5f0de213c0S3Bucket68F78FB6Ref": { + "Ref": "AssetParameters844c1a4b13479b359ea0e607dccb4a04b73e22cf88cf9b64feed2c5f0de213c0S3Bucket6ABE1927" }, - "referencetoawscdkekshandlersinvpctestAssetParametersb61858bbf1a0be803552e3efa9647befd728156696dff1b413b7b2fd4da1449fS3VersionKey1C342D31Ref": { - "Ref": "AssetParametersb61858bbf1a0be803552e3efa9647befd728156696dff1b413b7b2fd4da1449fS3VersionKey6C948E78" - }, - "referencetoawscdkekshandlersinvpctestEksAllHandlersInVpcStackDefaultVpcE40EA7ACRef": { - "Ref": "EksAllHandlersInVpcStackDefaultVpcBE11D4AE" + "referencetoawscdkekshandlersinvpctestAssetParameters844c1a4b13479b359ea0e607dccb4a04b73e22cf88cf9b64feed2c5f0de213c0S3VersionKeyCE91E7FDRef": { + "Ref": "AssetParameters844c1a4b13479b359ea0e607dccb4a04b73e22cf88cf9b64feed2c5f0de213c0S3VersionKeyF55A2EA9" }, "referencetoawscdkekshandlersinvpctestAssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3Bucket9D7E9998Ref": { "Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3BucketDC4B98B1" @@ -1296,7 +1281,9 @@ "Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3VersionKeyA495226F" } } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" } }, "Outputs": { @@ -1378,53 +1365,53 @@ "Type": "String", "Description": "Artifact hash for asset \"bafd50ae9f214e496ff8c72c6425f93dca3ccd590e20963706d5d610d9c75757\"" }, - "AssetParametersefd72738f046105c96299fb31b3da40320e71ee9cf74bc37720042898403e2a1S3Bucket6DACDE73": { + "AssetParameterse9882ab123687399f934da0d45effe675ecc8ce13b40cb946f3e1d6141fe8d68S3BucketAEADE8C7": { "Type": "String", - "Description": "S3 bucket for asset \"efd72738f046105c96299fb31b3da40320e71ee9cf74bc37720042898403e2a1\"" + "Description": "S3 bucket for asset \"e9882ab123687399f934da0d45effe675ecc8ce13b40cb946f3e1d6141fe8d68\"" }, - "AssetParametersefd72738f046105c96299fb31b3da40320e71ee9cf74bc37720042898403e2a1S3VersionKey015AEA61": { + "AssetParameterse9882ab123687399f934da0d45effe675ecc8ce13b40cb946f3e1d6141fe8d68S3VersionKeyE415415F": { "Type": "String", - "Description": "S3 key for asset version \"efd72738f046105c96299fb31b3da40320e71ee9cf74bc37720042898403e2a1\"" + "Description": "S3 key for asset version \"e9882ab123687399f934da0d45effe675ecc8ce13b40cb946f3e1d6141fe8d68\"" }, - "AssetParametersefd72738f046105c96299fb31b3da40320e71ee9cf74bc37720042898403e2a1ArtifactHashC9FD06BA": { + "AssetParameterse9882ab123687399f934da0d45effe675ecc8ce13b40cb946f3e1d6141fe8d68ArtifactHashD9A515C3": { "Type": "String", - "Description": "Artifact hash for asset \"efd72738f046105c96299fb31b3da40320e71ee9cf74bc37720042898403e2a1\"" + "Description": "Artifact hash for asset \"e9882ab123687399f934da0d45effe675ecc8ce13b40cb946f3e1d6141fe8d68\"" }, - "AssetParametersb61858bbf1a0be803552e3efa9647befd728156696dff1b413b7b2fd4da1449fS3Bucket7EE7EA15": { + "AssetParameters844c1a4b13479b359ea0e607dccb4a04b73e22cf88cf9b64feed2c5f0de213c0S3Bucket6ABE1927": { "Type": "String", - "Description": "S3 bucket for asset \"b61858bbf1a0be803552e3efa9647befd728156696dff1b413b7b2fd4da1449f\"" + "Description": "S3 bucket for asset \"844c1a4b13479b359ea0e607dccb4a04b73e22cf88cf9b64feed2c5f0de213c0\"" }, - "AssetParametersb61858bbf1a0be803552e3efa9647befd728156696dff1b413b7b2fd4da1449fS3VersionKey6C948E78": { + "AssetParameters844c1a4b13479b359ea0e607dccb4a04b73e22cf88cf9b64feed2c5f0de213c0S3VersionKeyF55A2EA9": { "Type": "String", - "Description": "S3 key for asset version \"b61858bbf1a0be803552e3efa9647befd728156696dff1b413b7b2fd4da1449f\"" + "Description": "S3 key for asset version \"844c1a4b13479b359ea0e607dccb4a04b73e22cf88cf9b64feed2c5f0de213c0\"" }, - "AssetParametersb61858bbf1a0be803552e3efa9647befd728156696dff1b413b7b2fd4da1449fArtifactHash7E705796": { + "AssetParameters844c1a4b13479b359ea0e607dccb4a04b73e22cf88cf9b64feed2c5f0de213c0ArtifactHash1D7A2D6E": { "Type": "String", - "Description": "Artifact hash for asset \"b61858bbf1a0be803552e3efa9647befd728156696dff1b413b7b2fd4da1449f\"" + "Description": "Artifact hash for asset \"844c1a4b13479b359ea0e607dccb4a04b73e22cf88cf9b64feed2c5f0de213c0\"" }, - "AssetParameters1a2bf12b9f0cf5ab2c838e7dd9be4d485bbf32056d6d5333bce57e49d12a172cS3Bucket151BE34C": { + "AssetParameters70396475d85a52e5c6ccad77894979d07433a207ea3c2668b929f3e70ffde081S3BucketFCD070AE": { "Type": "String", - "Description": "S3 bucket for asset \"1a2bf12b9f0cf5ab2c838e7dd9be4d485bbf32056d6d5333bce57e49d12a172c\"" + "Description": "S3 bucket for asset \"70396475d85a52e5c6ccad77894979d07433a207ea3c2668b929f3e70ffde081\"" }, - "AssetParameters1a2bf12b9f0cf5ab2c838e7dd9be4d485bbf32056d6d5333bce57e49d12a172cS3VersionKey89E7CC67": { + "AssetParameters70396475d85a52e5c6ccad77894979d07433a207ea3c2668b929f3e70ffde081S3VersionKeyD47BE42B": { "Type": "String", - "Description": "S3 key for asset version \"1a2bf12b9f0cf5ab2c838e7dd9be4d485bbf32056d6d5333bce57e49d12a172c\"" + "Description": "S3 key for asset version \"70396475d85a52e5c6ccad77894979d07433a207ea3c2668b929f3e70ffde081\"" }, - "AssetParameters1a2bf12b9f0cf5ab2c838e7dd9be4d485bbf32056d6d5333bce57e49d12a172cArtifactHashAEE8C2AB": { + "AssetParameters70396475d85a52e5c6ccad77894979d07433a207ea3c2668b929f3e70ffde081ArtifactHashF56FF52E": { "Type": "String", - "Description": "Artifact hash for asset \"1a2bf12b9f0cf5ab2c838e7dd9be4d485bbf32056d6d5333bce57e49d12a172c\"" + "Description": "Artifact hash for asset \"70396475d85a52e5c6ccad77894979d07433a207ea3c2668b929f3e70ffde081\"" }, - "AssetParameters11ba420a0c99f0c77f563fb974e76d6110b4445114137af1fe1b69b0d366d2d7S3BucketE510C342": { + "AssetParameters93bb4c1c6bbced2c1adce602d7643d5475c6e463f4f57f4cd863e064d82a3d82S3Bucket8670C328": { "Type": "String", - "Description": "S3 bucket for asset \"11ba420a0c99f0c77f563fb974e76d6110b4445114137af1fe1b69b0d366d2d7\"" + "Description": "S3 bucket for asset \"93bb4c1c6bbced2c1adce602d7643d5475c6e463f4f57f4cd863e064d82a3d82\"" }, - "AssetParameters11ba420a0c99f0c77f563fb974e76d6110b4445114137af1fe1b69b0d366d2d7S3VersionKeyD31A83B6": { + "AssetParameters93bb4c1c6bbced2c1adce602d7643d5475c6e463f4f57f4cd863e064d82a3d82S3VersionKeyCEFB3AF5": { "Type": "String", - "Description": "S3 key for asset version \"11ba420a0c99f0c77f563fb974e76d6110b4445114137af1fe1b69b0d366d2d7\"" + "Description": "S3 key for asset version \"93bb4c1c6bbced2c1adce602d7643d5475c6e463f4f57f4cd863e064d82a3d82\"" }, - "AssetParameters11ba420a0c99f0c77f563fb974e76d6110b4445114137af1fe1b69b0d366d2d7ArtifactHash1C37295C": { + "AssetParameters93bb4c1c6bbced2c1adce602d7643d5475c6e463f4f57f4cd863e064d82a3d82ArtifactHashBEC324DA": { "Type": "String", - "Description": "Artifact hash for asset \"11ba420a0c99f0c77f563fb974e76d6110b4445114137af1fe1b69b0d366d2d7\"" + "Description": "Artifact hash for asset \"93bb4c1c6bbced2c1adce602d7643d5475c6e463f4f57f4cd863e064d82a3d82\"" } } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-eks/test/integ.eks-cluster-private-endpoint.expected.json b/packages/@aws-cdk/aws-eks/test/integ.eks-cluster-private-endpoint.expected.json index b8246afd2d180..acbe47374bead 100644 --- a/packages/@aws-cdk/aws-eks/test/integ.eks-cluster-private-endpoint.expected.json +++ b/packages/@aws-cdk/aws-eks/test/integ.eks-cluster-private-endpoint.expected.json @@ -655,14 +655,6 @@ ] } }, - { - "Action": [ - "ec2:DescribeSubnets", - "ec2:DescribeRouteTables" - ], - "Effect": "Allow", - "Resource": "*" - }, { "Action": [ "eks:CreateCluster", @@ -702,23 +694,17 @@ "Resource": "*" }, { - "Action": "ec2:DescribeVpcs", + "Action": [ + "ec2:DescribeInstances", + "ec2:DescribeNetworkInterfaces", + "ec2:DescribeSecurityGroups", + "ec2:DescribeSubnets", + "ec2:DescribeRouteTables", + "ec2:DescribeDhcpOptions", + "ec2:DescribeVpcs" + ], "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":ec2:test-region:12345678:vpc/", - { - "Ref": "Vpc8378EB38" - } - ] - ] - } + "Resource": "*" } ], "Version": "2012-10-17" @@ -1114,7 +1100,9 @@ "Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3VersionKeyA495226F" } } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B": { "Type": "AWS::CloudFormation::Stack", @@ -1129,7 +1117,7 @@ }, "/", { - "Ref": "AssetParameterseb49ce353c5ff251ebe2c3225fe00fb3e9a68fcd8b10207e63a36bfc6e981519S3Bucket686DCA97" + "Ref": "AssetParameters8d4ffe9194a1ca97e2e9377049ddbeb3adbdaa984c8a90c08a5d8d6b328bdf7cS3BucketFEA5F85E" }, "/", { @@ -1139,7 +1127,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameterseb49ce353c5ff251ebe2c3225fe00fb3e9a68fcd8b10207e63a36bfc6e981519S3VersionKey7EDC0140" + "Ref": "AssetParameters8d4ffe9194a1ca97e2e9377049ddbeb3adbdaa984c8a90c08a5d8d6b328bdf7cS3VersionKey226CF52C" } ] } @@ -1152,7 +1140,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameterseb49ce353c5ff251ebe2c3225fe00fb3e9a68fcd8b10207e63a36bfc6e981519S3VersionKey7EDC0140" + "Ref": "AssetParameters8d4ffe9194a1ca97e2e9377049ddbeb3adbdaa984c8a90c08a5d8d6b328bdf7cS3VersionKey226CF52C" } ] } @@ -1207,9 +1195,6 @@ "referencetoawscdkeksclusterprivateendpointtestAssetParameters844c1a4b13479b359ea0e607dccb4a04b73e22cf88cf9b64feed2c5f0de213c0S3VersionKey548D79B4Ref": { "Ref": "AssetParameters844c1a4b13479b359ea0e607dccb4a04b73e22cf88cf9b64feed2c5f0de213c0S3VersionKeyF55A2EA9" }, - "referencetoawscdkeksclusterprivateendpointtestVpcFCD064BFRef": { - "Ref": "Vpc8378EB38" - }, "referencetoawscdkeksclusterprivateendpointtestAssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3Bucket7DDAFC04Ref": { "Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3BucketDC4B98B1" }, @@ -1217,7 +1202,9 @@ "Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3VersionKeyA495226F" } } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" } }, "Outputs": { @@ -1335,17 +1322,17 @@ "Type": "String", "Description": "Artifact hash for asset \"75667ab2bbef2c8efc57fb73bf352f345af1d471fb09cb11f5b7bc27d009b609\"" }, - "AssetParameterseb49ce353c5ff251ebe2c3225fe00fb3e9a68fcd8b10207e63a36bfc6e981519S3Bucket686DCA97": { + "AssetParameters8d4ffe9194a1ca97e2e9377049ddbeb3adbdaa984c8a90c08a5d8d6b328bdf7cS3BucketFEA5F85E": { "Type": "String", - "Description": "S3 bucket for asset \"eb49ce353c5ff251ebe2c3225fe00fb3e9a68fcd8b10207e63a36bfc6e981519\"" + "Description": "S3 bucket for asset \"8d4ffe9194a1ca97e2e9377049ddbeb3adbdaa984c8a90c08a5d8d6b328bdf7c\"" }, - "AssetParameterseb49ce353c5ff251ebe2c3225fe00fb3e9a68fcd8b10207e63a36bfc6e981519S3VersionKey7EDC0140": { + "AssetParameters8d4ffe9194a1ca97e2e9377049ddbeb3adbdaa984c8a90c08a5d8d6b328bdf7cS3VersionKey226CF52C": { "Type": "String", - "Description": "S3 key for asset version \"eb49ce353c5ff251ebe2c3225fe00fb3e9a68fcd8b10207e63a36bfc6e981519\"" + "Description": "S3 key for asset version \"8d4ffe9194a1ca97e2e9377049ddbeb3adbdaa984c8a90c08a5d8d6b328bdf7c\"" }, - "AssetParameterseb49ce353c5ff251ebe2c3225fe00fb3e9a68fcd8b10207e63a36bfc6e981519ArtifactHashE5817DEB": { + "AssetParameters8d4ffe9194a1ca97e2e9377049ddbeb3adbdaa984c8a90c08a5d8d6b328bdf7cArtifactHashA6BF0EB3": { "Type": "String", - "Description": "Artifact hash for asset \"eb49ce353c5ff251ebe2c3225fe00fb3e9a68fcd8b10207e63a36bfc6e981519\"" + "Description": "Artifact hash for asset \"8d4ffe9194a1ca97e2e9377049ddbeb3adbdaa984c8a90c08a5d8d6b328bdf7c\"" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.expected.json b/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.expected.json index 3e172020cae6d..c157211d73f87 100644 --- a/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.expected.json +++ b/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.expected.json @@ -791,14 +791,6 @@ ] } }, - { - "Action": [ - "ec2:DescribeSubnets", - "ec2:DescribeRouteTables" - ], - "Effect": "Allow", - "Resource": "*" - }, { "Action": [ "eks:CreateCluster", @@ -838,23 +830,17 @@ "Resource": "*" }, { - "Action": "ec2:DescribeVpcs", + "Action": [ + "ec2:DescribeInstances", + "ec2:DescribeNetworkInterfaces", + "ec2:DescribeSecurityGroups", + "ec2:DescribeSubnets", + "ec2:DescribeRouteTables", + "ec2:DescribeDhcpOptions", + "ec2:DescribeVpcs" + ], "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":ec2:test-region:12345678:vpc/", - { - "Ref": "Vpc8378EB38" - } - ] - ] - } + "Resource": "*" }, { "Action": [ @@ -3876,7 +3862,9 @@ "Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3VersionKeyA495226F" } } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B": { "Type": "AWS::CloudFormation::Stack", @@ -3891,7 +3879,7 @@ }, "/", { - "Ref": "AssetParameters9f954a0baf5cb008231906c33569617ace43f4b2c804d16d0d4bae15fe9dfabcS3BucketF9C7C3C5" + "Ref": "AssetParameterse00474136b86298d67c0ad626f1dafe622c51168233097531c5ba6791d43aba3S3Bucket5829AD66" }, "/", { @@ -3901,7 +3889,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters9f954a0baf5cb008231906c33569617ace43f4b2c804d16d0d4bae15fe9dfabcS3VersionKey950894D5" + "Ref": "AssetParameterse00474136b86298d67c0ad626f1dafe622c51168233097531c5ba6791d43aba3S3VersionKey44FDB4A8" } ] } @@ -3914,7 +3902,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters9f954a0baf5cb008231906c33569617ace43f4b2c804d16d0d4bae15fe9dfabcS3VersionKey950894D5" + "Ref": "AssetParameterse00474136b86298d67c0ad626f1dafe622c51168233097531c5ba6791d43aba3S3VersionKey44FDB4A8" } ] } @@ -3969,9 +3957,6 @@ "referencetoawscdkeksclustertestAssetParameters844c1a4b13479b359ea0e607dccb4a04b73e22cf88cf9b64feed2c5f0de213c0S3VersionKey1CADE360Ref": { "Ref": "AssetParameters844c1a4b13479b359ea0e607dccb4a04b73e22cf88cf9b64feed2c5f0de213c0S3VersionKeyF55A2EA9" }, - "referencetoawscdkeksclustertestVpc9A302ADDRef": { - "Ref": "Vpc8378EB38" - }, "referencetoawscdkeksclustertestAssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3Bucket0815E7B5Ref": { "Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3BucketDC4B98B1" }, @@ -3979,7 +3964,9 @@ "Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3VersionKeyA495226F" } } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "LaunchTemplate": { "Type": "AWS::EC2::LaunchTemplate", @@ -4723,17 +4710,17 @@ "Type": "String", "Description": "Artifact hash for asset \"264acf17cbf0c643f47bec1f4dbaed805e3bd1bad3f018c093d16fb936227daa\"" }, - "AssetParameters9f954a0baf5cb008231906c33569617ace43f4b2c804d16d0d4bae15fe9dfabcS3BucketF9C7C3C5": { + "AssetParameterse00474136b86298d67c0ad626f1dafe622c51168233097531c5ba6791d43aba3S3Bucket5829AD66": { "Type": "String", - "Description": "S3 bucket for asset \"9f954a0baf5cb008231906c33569617ace43f4b2c804d16d0d4bae15fe9dfabc\"" + "Description": "S3 bucket for asset \"e00474136b86298d67c0ad626f1dafe622c51168233097531c5ba6791d43aba3\"" }, - "AssetParameters9f954a0baf5cb008231906c33569617ace43f4b2c804d16d0d4bae15fe9dfabcS3VersionKey950894D5": { + "AssetParameterse00474136b86298d67c0ad626f1dafe622c51168233097531c5ba6791d43aba3S3VersionKey44FDB4A8": { "Type": "String", - "Description": "S3 key for asset version \"9f954a0baf5cb008231906c33569617ace43f4b2c804d16d0d4bae15fe9dfabc\"" + "Description": "S3 key for asset version \"e00474136b86298d67c0ad626f1dafe622c51168233097531c5ba6791d43aba3\"" }, - "AssetParameters9f954a0baf5cb008231906c33569617ace43f4b2c804d16d0d4bae15fe9dfabcArtifactHash5984E3CE": { + "AssetParameterse00474136b86298d67c0ad626f1dafe622c51168233097531c5ba6791d43aba3ArtifactHashB6A3908A": { "Type": "String", - "Description": "Artifact hash for asset \"9f954a0baf5cb008231906c33569617ace43f4b2c804d16d0d4bae15fe9dfabc\"" + "Description": "Artifact hash for asset \"e00474136b86298d67c0ad626f1dafe622c51168233097531c5ba6791d43aba3\"" }, "SsmParameterValueawsserviceeksoptimizedami119amazonlinux2recommendedimageidC96584B6F00A464EAD1953AFF4B05118Parameter": { "Type": "AWS::SSM::Parameter::Value", @@ -4752,4 +4739,4 @@ "Default": "/aws/service/eks/optimized-ami/1.19/amazon-linux-2-gpu/recommended/image_id" } } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-eks/test/integ.fargate-cluster.expected.json b/packages/@aws-cdk/aws-eks/test/integ.fargate-cluster.expected.json index 631236f803499..441cac51ffd69 100644 --- a/packages/@aws-cdk/aws-eks/test/integ.fargate-cluster.expected.json +++ b/packages/@aws-cdk/aws-eks/test/integ.fargate-cluster.expected.json @@ -711,14 +711,6 @@ ] } }, - { - "Action": [ - "ec2:DescribeSubnets", - "ec2:DescribeRouteTables" - ], - "Effect": "Allow", - "Resource": "*" - }, { "Action": [ "eks:CreateCluster", @@ -758,23 +750,17 @@ "Resource": "*" }, { - "Action": "ec2:DescribeVpcs", + "Action": [ + "ec2:DescribeInstances", + "ec2:DescribeNetworkInterfaces", + "ec2:DescribeSecurityGroups", + "ec2:DescribeSubnets", + "ec2:DescribeRouteTables", + "ec2:DescribeDhcpOptions", + "ec2:DescribeVpcs" + ], "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":ec2:test-region:12345678:vpc/", - { - "Ref": "FargateClusterDefaultVpcE69D3A13" - } - ] - ] - } + "Resource": "*" }, { "Action": "iam:PassRole", @@ -1191,7 +1177,9 @@ "Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3VersionKeyA495226F" } } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B": { "Type": "AWS::CloudFormation::Stack", @@ -1206,7 +1194,7 @@ }, "/", { - "Ref": "AssetParameters37d93b8a35af568f83ecce5e05c6f06adaa06c68b84dfad9c3d82f57cd54ff13S3BucketDCD73A4E" + "Ref": "AssetParametersedcd50bb250cf7cf664a737720e623ad66ada9b9e609205686c476e516cf2f23S3Bucket586F6135" }, "/", { @@ -1216,7 +1204,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters37d93b8a35af568f83ecce5e05c6f06adaa06c68b84dfad9c3d82f57cd54ff13S3VersionKey796F5C1B" + "Ref": "AssetParametersedcd50bb250cf7cf664a737720e623ad66ada9b9e609205686c476e516cf2f23S3VersionKey6EFBFC1D" } ] } @@ -1229,7 +1217,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters37d93b8a35af568f83ecce5e05c6f06adaa06c68b84dfad9c3d82f57cd54ff13S3VersionKey796F5C1B" + "Ref": "AssetParametersedcd50bb250cf7cf664a737720e623ad66ada9b9e609205686c476e516cf2f23S3VersionKey6EFBFC1D" } ] } @@ -1284,9 +1272,6 @@ "referencetoawscdkeksfargateclustertestAssetParameters844c1a4b13479b359ea0e607dccb4a04b73e22cf88cf9b64feed2c5f0de213c0S3VersionKeyFE6D1F78Ref": { "Ref": "AssetParameters844c1a4b13479b359ea0e607dccb4a04b73e22cf88cf9b64feed2c5f0de213c0S3VersionKeyF55A2EA9" }, - "referencetoawscdkeksfargateclustertestFargateClusterDefaultVpcBD3C976FRef": { - "Ref": "FargateClusterDefaultVpcE69D3A13" - }, "referencetoawscdkeksfargateclustertestAssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3Bucket8EEF0922Ref": { "Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3BucketDC4B98B1" }, @@ -1294,7 +1279,9 @@ "Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3VersionKeyA495226F" } } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" } }, "Outputs": { @@ -1412,17 +1399,17 @@ "Type": "String", "Description": "Artifact hash for asset \"3d252d05ccf0ae2934dd20707e8a709b466b2b8ea00c04ee8735667f90b17ac1\"" }, - "AssetParameters37d93b8a35af568f83ecce5e05c6f06adaa06c68b84dfad9c3d82f57cd54ff13S3BucketDCD73A4E": { + "AssetParametersedcd50bb250cf7cf664a737720e623ad66ada9b9e609205686c476e516cf2f23S3Bucket586F6135": { "Type": "String", - "Description": "S3 bucket for asset \"37d93b8a35af568f83ecce5e05c6f06adaa06c68b84dfad9c3d82f57cd54ff13\"" + "Description": "S3 bucket for asset \"edcd50bb250cf7cf664a737720e623ad66ada9b9e609205686c476e516cf2f23\"" }, - "AssetParameters37d93b8a35af568f83ecce5e05c6f06adaa06c68b84dfad9c3d82f57cd54ff13S3VersionKey796F5C1B": { + "AssetParametersedcd50bb250cf7cf664a737720e623ad66ada9b9e609205686c476e516cf2f23S3VersionKey6EFBFC1D": { "Type": "String", - "Description": "S3 key for asset version \"37d93b8a35af568f83ecce5e05c6f06adaa06c68b84dfad9c3d82f57cd54ff13\"" + "Description": "S3 key for asset version \"edcd50bb250cf7cf664a737720e623ad66ada9b9e609205686c476e516cf2f23\"" }, - "AssetParameters37d93b8a35af568f83ecce5e05c6f06adaa06c68b84dfad9c3d82f57cd54ff13ArtifactHash8F2277C1": { + "AssetParametersedcd50bb250cf7cf664a737720e623ad66ada9b9e609205686c476e516cf2f23ArtifactHashB34EB8FE": { "Type": "String", - "Description": "Artifact hash for asset \"37d93b8a35af568f83ecce5e05c6f06adaa06c68b84dfad9c3d82f57cd54ff13\"" + "Description": "Artifact hash for asset \"edcd50bb250cf7cf664a737720e623ad66ada9b9e609205686c476e516cf2f23\"" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-eks/test/test.cluster.ts b/packages/@aws-cdk/aws-eks/test/test.cluster.ts index 0f8ad05549bdd..46554d34dceb0 100644 --- a/packages/@aws-cdk/aws-eks/test/test.cluster.ts +++ b/packages/@aws-cdk/aws-eks/test/test.cluster.ts @@ -1695,14 +1695,6 @@ export = { ], }, }, - { - Action: [ - 'ec2:DescribeSubnets', - 'ec2:DescribeRouteTables', - ], - Effect: 'Allow', - Resource: '*', - }, { Action: [ 'eks:CreateCluster', @@ -1782,27 +1774,17 @@ export = { Resource: '*', }, { - Action: 'ec2:DescribeVpcs', + Action: [ + 'ec2:DescribeInstances', + 'ec2:DescribeNetworkInterfaces', + 'ec2:DescribeSecurityGroups', + 'ec2:DescribeSubnets', + 'ec2:DescribeRouteTables', + 'ec2:DescribeDhcpOptions', + 'ec2:DescribeVpcs', + ], Effect: 'Allow', - Resource: { - 'Fn::Join': [ - '', - [ - 'arn:', - { - Ref: 'AWS::Partition', - }, - ':ec2:us-east-1:', - { - Ref: 'AWS::AccountId', - }, - ':vpc/', - { - Ref: 'MyClusterDefaultVpc76C24A38', - }, - ], - ], - }, + Resource: '*', }, ], Version: '2012-10-17', @@ -1832,14 +1814,6 @@ export = { ], }, }, - { - Action: [ - 'ec2:DescribeSubnets', - 'ec2:DescribeRouteTables', - ], - Effect: 'Allow', - Resource: '*', - }, { Action: [ 'eks:CreateCluster', @@ -1874,27 +1848,17 @@ export = { Resource: '*', }, { - Action: 'ec2:DescribeVpcs', + Action: [ + 'ec2:DescribeInstances', + 'ec2:DescribeNetworkInterfaces', + 'ec2:DescribeSecurityGroups', + 'ec2:DescribeSubnets', + 'ec2:DescribeRouteTables', + 'ec2:DescribeDhcpOptions', + 'ec2:DescribeVpcs', + ], Effect: 'Allow', - Resource: { - 'Fn::Join': [ - '', - [ - 'arn:', - { - Ref: 'AWS::Partition', - }, - ':ec2:us-east-1:', - { - Ref: 'AWS::AccountId', - }, - ':vpc/', - { - Ref: 'MyClusterDefaultVpc76C24A38', - }, - ], - ], - }, + Resource: '*', }, ], Version: '2012-10-17', @@ -2119,6 +2083,27 @@ export = { }, + 'kubectl provider passes security group to provider'(test: Test) { + + const { stack } = testFixture(); + + new eks.Cluster(stack, 'Cluster1', { + version: CLUSTER_VERSION, + prune: false, + endpointAccess: eks.EndpointAccess.PRIVATE, + kubectlEnvironment: { + Foo: 'Bar', + }, + }); + + // the kubectl provider is inside a nested stack. + const nested = stack.node.tryFindChild('@aws-cdk/aws-eks.KubectlProvider') as cdk.NestedStack; + test.deepEqual(expect(nested).value.Resources.ProviderframeworkonEvent83C1D0A7.Properties.VpcConfig.SecurityGroupIds, + [{ Ref: 'referencetoStackCluster18DFEAC17ClusterSecurityGroupId' }]); + + test.done(); + }, + 'kubectl provider passes environment to lambda'(test: Test) { const { stack } = testFixture(); diff --git a/packages/@aws-cdk/aws-eks/test/test.fargate.ts b/packages/@aws-cdk/aws-eks/test/test.fargate.ts index ba1ec4009d1d1..ee17950915e9d 100644 --- a/packages/@aws-cdk/aws-eks/test/test.fargate.ts +++ b/packages/@aws-cdk/aws-eks/test/test.fargate.ts @@ -364,14 +364,6 @@ export = { ], }, }, - { - Action: [ - 'ec2:DescribeSubnets', - 'ec2:DescribeRouteTables', - ], - Effect: 'Allow', - Resource: '*', - }, { Action: [ 'eks:CreateCluster', @@ -408,31 +400,17 @@ export = { Resource: '*', }, { - Action: 'ec2:DescribeVpcs', + Action: [ + 'ec2:DescribeInstances', + 'ec2:DescribeNetworkInterfaces', + 'ec2:DescribeSecurityGroups', + 'ec2:DescribeSubnets', + 'ec2:DescribeRouteTables', + 'ec2:DescribeDhcpOptions', + 'ec2:DescribeVpcs', + ], Effect: 'Allow', - Resource: { - 'Fn::Join': [ - '', - [ - 'arn:', - { - Ref: 'AWS::Partition', - }, - ':ec2:', - { - Ref: 'AWS::Region', - }, - ':', - { - Ref: 'AWS::AccountId', - }, - ':vpc/', - { - Ref: 'FargateClusterDefaultVpcE69D3A13', - }, - ], - ], - }, + Resource: '*', }, { Action: 'iam:PassRole', diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2-actions/test/integ.cognito.lit.expected.json b/packages/@aws-cdk/aws-elasticloadbalancingv2-actions/test/integ.cognito.lit.expected.json index 7aeccb623d6dd..206ab8458383d 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2-actions/test/integ.cognito.lit.expected.json +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2-actions/test/integ.cognito.lit.expected.json @@ -450,22 +450,28 @@ "LoadBalancerArn": { "Ref": "LB8A12904C" }, - "Port": 443, - "Protocol": "HTTPS", "Certificates": [ { "CertificateArn": "" } - ] + ], + "Port": 443, + "Protocol": "HTTPS" } }, "UserPool6BA7E5F2": { "Type": "AWS::Cognito::UserPool", "Properties": { - "AccountRecoverySetting": { + "AccountRecoverySetting": { "RecoveryMechanisms": [ - { "Name": "verified_phone_number", "Priority": 1 }, - { "Name": "verified_email", "Priority": 2 } + { + "Name": "verified_phone_number", + "Priority": 1 + }, + { + "Name": "verified_email", + "Priority": 2 + } ] }, "AdminCreateUserConfig": { @@ -480,7 +486,9 @@ "EmailSubject": "Verify your new account", "SmsMessage": "The verification code to your new account is {####}" } - } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" }, "Client4A7F64DF": { "Type": "AWS::Cognito::UserPoolClient", @@ -544,4 +552,4 @@ } } } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-elasticsearch/lib/domain.ts b/packages/@aws-cdk/aws-elasticsearch/lib/domain.ts index 28728e6cdf58f..905ea5360f139 100644 --- a/packages/@aws-cdk/aws-elasticsearch/lib/domain.ts +++ b/packages/@aws-cdk/aws-elasticsearch/lib/domain.ts @@ -569,6 +569,13 @@ export interface DomainProps { */ readonly enableVersionUpgrade?: boolean; + /** + * Policy to apply when the domain is removed from the stack + * + * @default RemovalPolicy.RETAIN + */ + readonly removalPolicy?: cdk.RemovalPolicy; + /** * To configure a custom domain configure these options * @@ -1663,6 +1670,7 @@ export class Domain extends DomainBase implements IDomain { } : undefined, }); + this.domain.applyRemovalPolicy(props.removalPolicy); if (props.enableVersionUpgrade) { this.domain.cfnOptions.updatePolicy = { diff --git a/packages/@aws-cdk/aws-elasticsearch/test/domain.test.ts b/packages/@aws-cdk/aws-elasticsearch/test/domain.test.ts index 98a6f350d6f34..afd5bf6b45430 100644 --- a/packages/@aws-cdk/aws-elasticsearch/test/domain.test.ts +++ b/packages/@aws-cdk/aws-elasticsearch/test/domain.test.ts @@ -30,6 +30,16 @@ const readWriteActions = [ ...writeActions, ]; +test('default removalpolicy is retain', () => { + new Domain(stack, 'Domain', { + version: ElasticsearchVersion.V7_1, + }); + + expect(stack).toHaveResource('AWS::Elasticsearch::Domain', { + DeletionPolicy: 'Retain', + }, assert.ResourcePart.CompleteDefinition); +}); + test('grants kms permissions if needed', () => { const key = new kms.Key(stack, 'Key'); diff --git a/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.advancedsecurity.expected.json b/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.advancedsecurity.expected.json index dac2d95d68b54..84333cb6005d7 100644 --- a/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.advancedsecurity.expected.json +++ b/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.advancedsecurity.expected.json @@ -44,7 +44,9 @@ "NodeToNodeEncryptionOptions": { "Enabled": true } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.advancedsecurity.ts b/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.advancedsecurity.ts index 5baf8f4e1b99d..828a5c9fe75e7 100644 --- a/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.advancedsecurity.ts +++ b/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.advancedsecurity.ts @@ -1,5 +1,5 @@ import { User } from '@aws-cdk/aws-iam'; -import { App, Stack, StackProps } from '@aws-cdk/core'; +import { App, RemovalPolicy, Stack, StackProps } from '@aws-cdk/core'; import { Construct } from 'constructs'; import * as es from '../lib'; @@ -10,6 +10,7 @@ class TestStack extends Stack { const user = new User(this, 'User'); new es.Domain(this, 'Domain', { + removalPolicy: RemovalPolicy.DESTROY, version: es.ElasticsearchVersion.V7_1, fineGrainedAccessControl: { masterUserArn: user.userArn, diff --git a/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.expected.json b/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.expected.json index 1da03e98c1984..309d8c2831e8d 100644 --- a/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.expected.json +++ b/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.expected.json @@ -221,7 +221,9 @@ "DependsOn": [ "DomainESLogGroupPolicyc82ca7bfe2f2589b859ebab89e88da2efd284adfadCustomResourcePolicy0B41F6DF", "DomainESLogGroupPolicyc82ca7bfe2f2589b859ebab89e88da2efd284adfadA70E756D" - ] + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "DomainESAccessPolicyCustomResourcePolicy9747FC42": { "Type": "AWS::IAM::Policy", @@ -420,13 +422,13 @@ ] } }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2", "Arn" ] }, + "Handler": "index.handler", "Runtime": "nodejs12.x", "Timeout": 120 }, diff --git a/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.ts b/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.ts index 57152d5c70d5c..24bb07e4660ff 100644 --- a/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.ts +++ b/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.ts @@ -1,7 +1,7 @@ import { EbsDeviceVolumeType } from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; -import { App, Stack, StackProps } from '@aws-cdk/core'; +import { App, RemovalPolicy, Stack, StackProps } from '@aws-cdk/core'; import { Construct } from 'constructs'; import * as es from '../lib'; @@ -12,6 +12,7 @@ class TestStack extends Stack { const key = new kms.Key(this, 'Key'); const domainProps: es.DomainProps = { + removalPolicy: RemovalPolicy.DESTROY, version: es.ElasticsearchVersion.V7_1, ebs: { volumeSize: 10, diff --git a/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.expected.json b/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.expected.json index e43b6bb5f62e6..e510eb3534625 100644 --- a/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.expected.json +++ b/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.expected.json @@ -183,7 +183,9 @@ "DependsOn": [ "Domain1ESLogGroupPolicyc8858d5dba055f677469d76cb6ad538fd732ba69a6CustomResourcePolicy24436E05", "Domain1ESLogGroupPolicyc8858d5dba055f677469d76cb6ad538fd732ba69a6D8BDCF36" - ] + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "Domain1ESAccessPolicyCustomResourcePolicyC04432B6": { "Type": "AWS::IAM::Policy", @@ -352,13 +354,13 @@ ] } }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2", "Arn" ] }, + "Handler": "index.handler", "Runtime": "nodejs12.x", "Timeout": 120 }, @@ -549,7 +551,9 @@ "DependsOn": [ "Domain2ESLogGroupPolicyc8405238e455eeabd840cf6933e1814efc51d2de71CustomResourcePolicy77691A33", "Domain2ESLogGroupPolicyc8405238e455eeabd840cf6933e1814efc51d2de71F1DE93A1" - ] + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "Domain2ESAccessPolicyCustomResourcePolicy8EED1F24": { "Type": "AWS::IAM::Policy", diff --git a/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.ts b/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.ts index 4a6232d3ab130..448896e321957 100644 --- a/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.ts +++ b/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.ts @@ -1,6 +1,6 @@ import { EbsDeviceVolumeType } from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; -import { App, Stack, StackProps } from '@aws-cdk/core'; +import { App, RemovalPolicy, Stack, StackProps } from '@aws-cdk/core'; import { Construct } from 'constructs'; import * as es from '../lib'; @@ -9,6 +9,7 @@ class TestStack extends Stack { super(scope, id, props); const domainProps: es.DomainProps = { + removalPolicy: RemovalPolicy.DESTROY, version: es.ElasticsearchVersion.V7_1, ebs: { volumeSize: 10, diff --git a/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.ultrawarm.expected.json b/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.ultrawarm.expected.json index c24aeb2f30740..702d302029600 100644 --- a/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.ultrawarm.expected.json +++ b/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.ultrawarm.expected.json @@ -34,7 +34,9 @@ "NodeToNodeEncryptionOptions": { "Enabled": false } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.ultrawarm.ts b/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.ultrawarm.ts index 259f43fe0cef2..c7c581252fc7e 100644 --- a/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.ultrawarm.ts +++ b/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.ultrawarm.ts @@ -1,4 +1,4 @@ -import { App, Stack, StackProps } from '@aws-cdk/core'; +import { App, RemovalPolicy, Stack, StackProps } from '@aws-cdk/core'; import { Construct } from 'constructs'; import * as es from '../lib'; @@ -7,6 +7,7 @@ class TestStack extends Stack { super(scope, id, props); new es.Domain(this, 'Domain', { + removalPolicy: RemovalPolicy.DESTROY, version: es.ElasticsearchVersion.V7_1, capacity: { masterNodes: 2, diff --git a/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.expected.json b/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.expected.json index b55ac9e14df69..065e569573421 100644 --- a/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.expected.json +++ b/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.expected.json @@ -58,7 +58,9 @@ "NodeToNodeEncryptionOptions": { "Enabled": true } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "DomainESAccessPolicyCustomResourcePolicy9747FC42": { "Type": "AWS::IAM::Policy", @@ -255,13 +257,13 @@ ] } }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2", "Arn" ] }, + "Handler": "index.handler", "Runtime": "nodejs12.x", "Timeout": 120 }, diff --git a/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.ts b/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.ts index 8844e5937305c..5e7fb2787972d 100644 --- a/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.ts +++ b/packages/@aws-cdk/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.ts @@ -1,4 +1,4 @@ -import { App, Stack, StackProps } from '@aws-cdk/core'; +import { App, RemovalPolicy, Stack, StackProps } from '@aws-cdk/core'; import { Construct } from 'constructs'; import * as es from '../lib'; @@ -7,6 +7,7 @@ class TestStack extends Stack { super(scope, id, props); new es.Domain(this, 'Domain', { + removalPolicy: RemovalPolicy.DESTROY, version: es.ElasticsearchVersion.V7_1, useUnsignedBasicAuth: true, }); diff --git a/packages/@aws-cdk/aws-events-targets/package.json b/packages/@aws-cdk/aws-events-targets/package.json index 8e342f7cda858..a4eee23c9a028 100644 --- a/packages/@aws-cdk/aws-events-targets/package.json +++ b/packages/@aws-cdk/aws-events-targets/package.json @@ -74,7 +74,7 @@ "@aws-cdk/assert": "0.0.0", "@aws-cdk/aws-codecommit": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", - "aws-sdk": "^2.845.0", + "aws-sdk": "^2.848.0", "aws-sdk-mock": "^5.1.0", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", diff --git a/packages/@aws-cdk/aws-events-targets/test/codebuild/integ.project-events.expected.json b/packages/@aws-cdk/aws-events-targets/test/codebuild/integ.project-events.expected.json index c9efaffc51134..007503de08383 100644 --- a/packages/@aws-cdk/aws-events-targets/test/codebuild/integ.project-events.expected.json +++ b/packages/@aws-cdk/aws-events-targets/test/codebuild/integ.project-events.expected.json @@ -340,7 +340,9 @@ } }, "MyQueueE6CA6235": { - "Type": "AWS::SQS::Queue" + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "MyQueuePolicy6BBEDDAC": { "Type": "AWS::SQS::QueuePolicy", @@ -422,4 +424,4 @@ } } } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.expected.json b/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.expected.json index 333930c6c23ff..85af1bfde21c1 100644 --- a/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.expected.json +++ b/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.expected.json @@ -111,7 +111,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", diff --git a/packages/@aws-cdk/aws-events-targets/test/kinesis-firehose/integ.kinesis-firehose-stream.expected.json b/packages/@aws-cdk/aws-events-targets/test/kinesis-firehose/integ.kinesis-firehose-stream.expected.json index 8cc4f2c5bbe65..6b76a3d96a32e 100644 --- a/packages/@aws-cdk/aws-events-targets/test/kinesis-firehose/integ.kinesis-firehose-stream.expected.json +++ b/packages/@aws-cdk/aws-events-targets/test/kinesis-firehose/integ.kinesis-firehose-stream.expected.json @@ -33,7 +33,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -161,4 +161,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/aws-events-targets/test/sns/integ.sns-event-rule-target.expected.json b/packages/@aws-cdk/aws-events-targets/test/sns/integ.sns-event-rule-target.expected.json index f4aea52c23274..37a78f010d792 100644 --- a/packages/@aws-cdk/aws-events-targets/test/sns/integ.sns-event-rule-target.expected.json +++ b/packages/@aws-cdk/aws-events-targets/test/sns/integ.sns-event-rule-target.expected.json @@ -45,7 +45,9 @@ } }, "MyQueueE6CA6235": { - "Type": "AWS::SQS::Queue" + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "MyQueuePolicy6BBEDDAC": { "Type": "AWS::SQS::QueuePolicy", diff --git a/packages/@aws-cdk/aws-events-targets/test/sqs/integ.sqs-event-rule-target.expected.json b/packages/@aws-cdk/aws-events-targets/test/sqs/integ.sqs-event-rule-target.expected.json index 645845bc1f44b..eebbc3a996344 100644 --- a/packages/@aws-cdk/aws-events-targets/test/sqs/integ.sqs-event-rule-target.expected.json +++ b/packages/@aws-cdk/aws-events-targets/test/sqs/integ.sqs-event-rule-target.expected.json @@ -19,7 +19,9 @@ } }, "MyQueueE6CA6235": { - "Type": "AWS::SQS::Queue" + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "MyQueuePolicy6BBEDDAC": { "Type": "AWS::SQS::QueuePolicy", diff --git a/packages/@aws-cdk/aws-fsx/lib/file-system.ts b/packages/@aws-cdk/aws-fsx/lib/file-system.ts index 22b4f64d8cd3b..d19c0e7686151 100644 --- a/packages/@aws-cdk/aws-fsx/lib/file-system.ts +++ b/packages/@aws-cdk/aws-fsx/lib/file-system.ts @@ -1,6 +1,6 @@ import { Connections, IConnectable, ISecurityGroup, IVpc } from '@aws-cdk/aws-ec2'; import { IKey } from '@aws-cdk/aws-kms'; -import { Resource } from '@aws-cdk/core'; +import { RemovalPolicy, Resource } from '@aws-cdk/core'; /** * Interface to implement FSx File Systems. @@ -52,6 +52,13 @@ export interface FileSystemProps { * For SCRATCH_2 and PERSISTENT_1 types, valid values are 1,200, 2,400, then continuing in increments of 2,400 GiB. */ readonly storageCapacityGiB: number; + + /** + * Policy to apply when the file system is removed from the stack + * + * @default RemovalPolicy.RETAIN + */ + readonly removalPolicy?: RemovalPolicy; } /** diff --git a/packages/@aws-cdk/aws-fsx/lib/lustre-file-system.ts b/packages/@aws-cdk/aws-fsx/lib/lustre-file-system.ts index 9d27da5bca3cd..2206bb31dfad3 100644 --- a/packages/@aws-cdk/aws-fsx/lib/lustre-file-system.ts +++ b/packages/@aws-cdk/aws-fsx/lib/lustre-file-system.ts @@ -198,6 +198,7 @@ export class LustreFileSystem extends FileSystemBase { securityGroupIds: [securityGroup.securityGroupId], storageCapacity: props.storageCapacityGiB, }); + this.fileSystem.applyRemovalPolicy(props.removalPolicy); this.fileSystemId = this.fileSystem.ref; this.dnsName = `${this.fileSystemId}.fsx.${this.stack.region}.${Aws.URL_SUFFIX}`; diff --git a/packages/@aws-cdk/aws-fsx/test/integ.lustre-file-system.expected.json b/packages/@aws-cdk/aws-fsx/test/integ.lustre-file-system.expected.json index 0164e2f1f0067..c5826b996a6bf 100644 --- a/packages/@aws-cdk/aws-fsx/test/integ.lustre-file-system.expected.json +++ b/packages/@aws-cdk/aws-fsx/test/integ.lustre-file-system.expected.json @@ -593,7 +593,9 @@ } ], "StorageCapacity": 1200 - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "instInstanceSecurityGroup54790689": { "Type": "AWS::EC2::SecurityGroup", diff --git a/packages/@aws-cdk/aws-fsx/test/integ.lustre-file-system.ts b/packages/@aws-cdk/aws-fsx/test/integ.lustre-file-system.ts index 00b32cea3b297..5202df62b2d08 100644 --- a/packages/@aws-cdk/aws-fsx/test/integ.lustre-file-system.ts +++ b/packages/@aws-cdk/aws-fsx/test/integ.lustre-file-system.ts @@ -1,5 +1,5 @@ import { AmazonLinuxGeneration, AmazonLinuxImage, Instance, InstanceClass, InstanceSize, InstanceType, SubnetType, Vpc } from '@aws-cdk/aws-ec2'; -import { App, Stack } from '@aws-cdk/core'; +import { App, RemovalPolicy, Stack } from '@aws-cdk/core'; import { LustreDeploymentType, LustreFileSystem } from '../lib'; const app = new App(); @@ -17,6 +17,7 @@ const fs = new LustreFileSystem(stack, 'FsxLustreFileSystem', { storageCapacityGiB: storageCapacity, vpc, vpcSubnet: vpc.privateSubnets[0], + removalPolicy: RemovalPolicy.DESTROY, }); const inst = new Instance(stack, 'inst', { diff --git a/packages/@aws-cdk/aws-fsx/test/lustre-file-system.test.ts b/packages/@aws-cdk/aws-fsx/test/lustre-file-system.test.ts index 43541cd858fce..fe0159a212140 100644 --- a/packages/@aws-cdk/aws-fsx/test/lustre-file-system.test.ts +++ b/packages/@aws-cdk/aws-fsx/test/lustre-file-system.test.ts @@ -1,5 +1,5 @@ import { strictEqual } from 'assert'; -import { expect as expectCDK, haveResource } from '@aws-cdk/assert'; +import { expect as expectCDK, haveResource, ResourcePart } from '@aws-cdk/assert'; import { ISubnet, Port, SecurityGroup, Subnet, Vpc } from '@aws-cdk/aws-ec2'; import { Key } from '@aws-cdk/aws-kms'; import { Aws, Stack, Token } from '@aws-cdk/core'; @@ -40,6 +40,10 @@ describe('FSx for Lustre File System', () => { strictEqual( fileSystem.dnsName, `${fileSystem.fileSystemId}.fsx.${stack.region}.${Aws.URL_SUFFIX}`); + + expectCDK(stack).to(haveResource('AWS::FSx::FileSystem', { + DeletionPolicy: 'Retain', + }, ResourcePart.CompleteDefinition)); }); test('file system is created correctly when security group is provided', () => { diff --git a/packages/@aws-cdk/aws-glue/test/integ.table.expected.json b/packages/@aws-cdk/aws-glue/test/integ.table.expected.json index c95d567dfa2bd..9d00dcfffab63 100644 --- a/packages/@aws-cdk/aws-glue/test/integ.table.expected.json +++ b/packages/@aws-cdk/aws-glue/test/integ.table.expected.json @@ -482,7 +482,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -560,7 +560,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -673,7 +673,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", diff --git a/packages/@aws-cdk/aws-kms/lib/key.ts b/packages/@aws-cdk/aws-kms/lib/key.ts index 4e18d228fe38e..2176d28f5b5bc 100644 --- a/packages/@aws-cdk/aws-kms/lib/key.ts +++ b/packages/@aws-cdk/aws-kms/lib/key.ts @@ -285,7 +285,7 @@ export interface KeyProps { /** * Custom policy document to attach to the KMS key. * - * NOTE - If the '@aws-cdk/aws-kms:defaultKeyPolicies' feature flag is set (the default for new projects), + * NOTE - If the `@aws-cdk/aws-kms:defaultKeyPolicies` feature flag is set (the default for new projects), * this policy will *override* the default key policy and become the only key policy for the key. If the * feature flag is not set, this policy will be appended to the default key policy. * @@ -322,12 +322,12 @@ export interface KeyProps { * to how it works for other AWS resources). This matches the default behavior * when creating KMS keys via the API or console. * - * If the '@aws-cdk/aws-kms:defaultKeyPolicies' feature flag is set (the default for new projects), + * If the `@aws-cdk/aws-kms:defaultKeyPolicies` feature flag is set (the default for new projects), * this flag will always be treated as 'true' and does not need to be explicitly set. * - * @default - false, unless the '@aws-cdk/aws-kms:defaultKeyPolicies' feature flag is set. + * @default - false, unless the `@aws-cdk/aws-kms:defaultKeyPolicies` feature flag is set. * @see https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam - * @deprecated redundant with the '@aws-cdk/aws-kms:defaultKeyPolicies' feature flag + * @deprecated redundant with the `@aws-cdk/aws-kms:defaultKeyPolicies` feature flag */ readonly trustAccountIdentities?: boolean; @@ -471,7 +471,7 @@ export class Key extends KeyBase { * Grants the account admin privileges -- not full account access -- plus the GenerateDataKey action. * The GenerateDataKey action was added for interop with S3 in https://github.com/aws/aws-cdk/issues/3458. * - * This policy is discouraged and deprecated by the '@aws-cdk/aws-kms:defaultKeyPolicies' feature flag. + * This policy is discouraged and deprecated by the `@aws-cdk/aws-kms:defaultKeyPolicies` feature flag. * * @link https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default * @deprecated diff --git a/packages/@aws-cdk/aws-lambda-destinations/test/integ.destinations.expected.json b/packages/@aws-cdk/aws-lambda-destinations/test/integ.destinations.expected.json index c9c1d8cd64563..510fe8cef21a8 100644 --- a/packages/@aws-cdk/aws-lambda-destinations/test/integ.destinations.expected.json +++ b/packages/@aws-cdk/aws-lambda-destinations/test/integ.destinations.expected.json @@ -4,7 +4,9 @@ "Type": "AWS::SNS::Topic" }, "Queue4A7E3555": { - "Type": "AWS::SQS::Queue" + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "SnsSqsServiceRole869866F7": { "Type": "AWS::IAM::Role", @@ -80,13 +82,13 @@ "Code": { "ZipFile": "exports.handler = async (event) => {\n if (event === 'OK') return 'success';\n throw new Error('failure');\n };" }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "SnsSqsServiceRole869866F7", "Arn" ] }, + "Handler": "index.handler", "Runtime": "nodejs10.x" }, "DependsOn": [ @@ -165,13 +167,13 @@ "Code": { "ZipFile": "exports.handler = async (event) => {\n console.log(event);\n };" }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "OnSuccesServiceRole75E399CF", "Arn" ] }, + "Handler": "index.handler", "Runtime": "nodejs10.x" }, "DependsOn": [ @@ -246,13 +248,13 @@ "Code": { "ZipFile": "exports.handler = async (event) => {\n if (event === 'OK') return 'success';\n throw new Error('failure');\n };" }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "EventBusLambdaServiceRole9BC8901F", "Arn" ] }, + "Handler": "index.handler", "Runtime": "nodejs10.x" }, "DependsOn": [ diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/integ.kinesiswithdlq.expected.json b/packages/@aws-cdk/aws-lambda-event-sources/test/integ.kinesiswithdlq.expected.json index 0e57bd7dc85d1..4d0a6c1a54707 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/test/integ.kinesiswithdlq.expected.json +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/integ.kinesiswithdlq.expected.json @@ -93,13 +93,13 @@ "Code": { "ZipFile": "exports.handler = async function handler(event) {\n // eslint-disable-next-line no-console\n console.log('event:', JSON.stringify(event, undefined, 2));\n throw new Error();\n}" }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "FServiceRole3AC82EE1", "Arn" ] }, + "Handler": "index.handler", "Runtime": "nodejs10.x" }, "DependsOn": [ @@ -110,12 +110,6 @@ "FKinesisEventSourcelambdaeventsourcekinesiswithdlqSD357FCB87EEA8CB4": { "Type": "AWS::Lambda::EventSourceMapping", "Properties": { - "EventSourceArn": { - "Fn::GetAtt": [ - "S509448A1", - "Arn" - ] - }, "FunctionName": { "Ref": "FC4345940" }, @@ -130,6 +124,12 @@ } } }, + "EventSourceArn": { + "Fn::GetAtt": [ + "S509448A1", + "Arn" + ] + }, "MaximumRetryAttempts": 0, "StartingPosition": "TRIM_HORIZON" } @@ -154,7 +154,9 @@ } }, "Q63C6E3AB": { - "Type": "AWS::SQS::Queue" + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" } }, "Outputs": { diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/integ.sqs.expected.json b/packages/@aws-cdk/aws-lambda-event-sources/test/integ.sqs.expected.json index e0bc8e07fece0..9f5565aff21d6 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/test/integ.sqs.expected.json +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/integ.sqs.expected.json @@ -69,13 +69,13 @@ "Code": { "ZipFile": "exports.handler = async function handler(event) {\n console.log('event:', JSON.stringify(event, undefined, 2));\n return { event };\n}" }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "FServiceRole3AC82EE1", "Arn" ] }, + "Handler": "index.handler", "Runtime": "nodejs10.x" }, "DependsOn": [ @@ -86,20 +86,22 @@ "FSqsEventSourcelambdaeventsourcesqsQ67DE9201754EC819": { "Type": "AWS::Lambda::EventSourceMapping", "Properties": { + "FunctionName": { + "Ref": "FC4345940" + }, + "BatchSize": 5, "EventSourceArn": { "Fn::GetAtt": [ "Q63C6E3AB", "Arn" ] - }, - "FunctionName": { - "Ref": "FC4345940" - }, - "BatchSize": 5 + } } }, "Q63C6E3AB": { - "Type": "AWS::SQS::Queue" + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-nodejs/README.md b/packages/@aws-cdk/aws-lambda-nodejs/README.md index bfaa99eb0b243..f35062120fb9d 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/README.md +++ b/packages/@aws-cdk/aws-lambda-nodejs/README.md @@ -162,13 +162,17 @@ It is possible to run additional commands by specifying the `commandHooks` prop: ```ts new lambda.NodejsFunction(this, 'my-handler-with-commands', { - commandHooks: { - // Copy a file so that it will be included in the bundled asset - afterBundling(inputDir: string, outputDir: string): string[] { - return [`cp ${inputDir}/my-binary.node ${outputDir}`]; + bundling: { + commandHooks: { + // Copy a file so that it will be included in the bundled asset + afterBundling(inputDir: string, outputDir: string): string[] { + return [`cp ${inputDir}/my-binary.node ${outputDir}`]; + } + // ... } // ... } + }); ``` diff --git a/packages/@aws-cdk/aws-lambda-nodejs/package.json b/packages/@aws-cdk/aws-lambda-nodejs/package.json index 82762f1a3e690..c2e2f658febac 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/package.json +++ b/packages/@aws-cdk/aws-lambda-nodejs/package.json @@ -67,7 +67,7 @@ "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "delay": "5.0.0", - "esbuild": "^0.8.46", + "esbuild": "^0.8.50", "pkglint": "0.0.0" }, "dependencies": { diff --git a/packages/@aws-cdk/aws-lambda/package.json b/packages/@aws-cdk/aws-lambda/package.json index d9e2c556cf146..de51f290aa4f5 100644 --- a/packages/@aws-cdk/aws-lambda/package.json +++ b/packages/@aws-cdk/aws-lambda/package.json @@ -82,7 +82,7 @@ "cdk-integ-tools": "0.0.0", "cfn2ts": "0.0.0", "jest": "^26.6.3", - "lodash": "^4.17.20", + "lodash": "^4.17.21", "pkglint": "0.0.0" }, "dependencies": { diff --git a/packages/@aws-cdk/aws-logs/package.json b/packages/@aws-cdk/aws-logs/package.json index 51ae5b8acf1cb..f5a004e27bb1f 100644 --- a/packages/@aws-cdk/aws-logs/package.json +++ b/packages/@aws-cdk/aws-logs/package.json @@ -72,7 +72,7 @@ "devDependencies": { "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.31", - "aws-sdk": "^2.845.0", + "aws-sdk": "^2.848.0", "aws-sdk-mock": "^5.1.0", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", diff --git a/packages/@aws-cdk/aws-rds/lib/cluster.ts b/packages/@aws-cdk/aws-rds/lib/cluster.ts index e0f2618a2fdf2..a3f06555afdb9 100644 --- a/packages/@aws-cdk/aws-rds/lib/cluster.ts +++ b/packages/@aws-cdk/aws-rds/lib/cluster.ts @@ -10,7 +10,7 @@ import { IClusterEngine } from './cluster-engine'; import { DatabaseClusterAttributes, IDatabaseCluster } from './cluster-ref'; import { Endpoint } from './endpoint'; import { IParameterGroup } from './parameter-group'; -import { applyRemovalPolicy, DEFAULT_PASSWORD_EXCLUDE_CHARS, defaultDeletionProtection, renderCredentials, setupS3ImportExport } from './private/util'; +import { DEFAULT_PASSWORD_EXCLUDE_CHARS, defaultDeletionProtection, renderCredentials, setupS3ImportExport, helperRemovalPolicy, renderUnless } from './private/util'; import { BackupProps, Credentials, InstanceProps, PerformanceInsightRetention, RotationSingleUserOptions, RotationMultiUserOptions } from './props'; import { DatabaseProxy, DatabaseProxyOptions, ProxyTarget } from './proxy'; import { CfnDBCluster, CfnDBClusterProps, CfnDBInstance } from './rds.generated'; @@ -310,7 +310,7 @@ abstract class DatabaseClusterNew extends DatabaseClusterBase { description: `Subnets for ${id} database`, vpc: props.instanceProps.vpc, vpcSubnets: props.instanceProps.vpcSubnets, - removalPolicy: props.removalPolicy === RemovalPolicy.RETAIN ? props.removalPolicy : undefined, + removalPolicy: renderUnless(helperRemovalPolicy(props.removalPolicy), RemovalPolicy.DESTROY), }); this.securityGroups = props.instanceProps.securityGroups ?? [ @@ -512,7 +512,7 @@ export class DatabaseCluster extends DatabaseClusterNew { defaultPort: ec2.Port.tcp(this.clusterEndpoint.port), }); - applyRemovalPolicy(cluster, props.removalPolicy); + cluster.applyRemovalPolicy(props.removalPolicy ?? RemovalPolicy.SNAPSHOT); if (secret) { this.secret = secret.attach(this); @@ -608,7 +608,7 @@ export class DatabaseClusterFromSnapshot extends DatabaseClusterNew { defaultPort: ec2.Port.tcp(this.clusterEndpoint.port), }); - applyRemovalPolicy(cluster, props.removalPolicy); + cluster.applyRemovalPolicy(props.removalPolicy ?? RemovalPolicy.SNAPSHOT); setLogRetention(this, props); createInstances(this, props, this.subnetGroup); @@ -712,13 +712,11 @@ function createInstances(cluster: DatabaseClusterNew, props: DatabaseClusterBase deleteAutomatedBackups: props.instanceProps.deleteAutomatedBackups, }); - // If removalPolicy isn't explicitly set, - // it's Snapshot for Cluster. - // Because of that, in this case, - // we can safely use the CFN default of Delete for DbInstances with dbClusterIdentifier set. - if (props.removalPolicy) { - applyRemovalPolicy(instance, props.removalPolicy); - } + // For instances that are part of a cluster: + // + // Cluster DESTROY or SNAPSHOT -> DESTROY (snapshot is good enough to recreate) + // Cluster RETAIN -> RETAIN (otherwise cluster state will disappear) + instance.applyRemovalPolicy(helperRemovalPolicy(props.removalPolicy)); // We must have a dependency on the NAT gateway provider here to create // things in the right order. diff --git a/packages/@aws-cdk/aws-rds/lib/instance.ts b/packages/@aws-cdk/aws-rds/lib/instance.ts index cb4c3d3487a8c..f6bbe5481a112 100644 --- a/packages/@aws-cdk/aws-rds/lib/instance.ts +++ b/packages/@aws-cdk/aws-rds/lib/instance.ts @@ -12,7 +12,7 @@ import { Endpoint } from './endpoint'; import { IInstanceEngine } from './instance-engine'; import { IOptionGroup } from './option-group'; import { IParameterGroup } from './parameter-group'; -import { applyRemovalPolicy, DEFAULT_PASSWORD_EXCLUDE_CHARS, defaultDeletionProtection, engineDescription, renderCredentials, setupS3ImportExport } from './private/util'; +import { DEFAULT_PASSWORD_EXCLUDE_CHARS, defaultDeletionProtection, engineDescription, renderCredentials, setupS3ImportExport, helperRemovalPolicy, renderUnless } from './private/util'; import { Credentials, PerformanceInsightRetention, RotationMultiUserOptions, RotationSingleUserOptions, SnapshotCredentials } from './props'; import { DatabaseProxy, DatabaseProxyOptions, ProxyTarget } from './proxy'; import { CfnDBInstance, CfnDBInstanceProps } from './rds.generated'; @@ -642,7 +642,7 @@ abstract class DatabaseInstanceNew extends DatabaseInstanceBase implements IData description: `Subnet group for ${this.node.id} database`, vpc: this.vpc, vpcSubnets: this.vpcPlacement, - removalPolicy: props.removalPolicy === RemovalPolicy.RETAIN ? props.removalPolicy : undefined, + removalPolicy: renderUnless(helperRemovalPolicy(props.removalPolicy), RemovalPolicy.DESTROY), }); const securityGroups = props.securityGroups || [new ec2.SecurityGroup(this, 'SecurityGroup', { @@ -976,7 +976,7 @@ export class DatabaseInstance extends DatabaseInstanceSource implements IDatabas const portAttribute = Token.asNumber(instance.attrEndpointPort); this.instanceEndpoint = new Endpoint(instance.attrEndpointAddress, portAttribute); - applyRemovalPolicy(instance, props.removalPolicy); + instance.applyRemovalPolicy(props.removalPolicy ?? RemovalPolicy.SNAPSHOT); if (secret) { this.secret = secret.attach(this); @@ -1052,7 +1052,7 @@ export class DatabaseInstanceFromSnapshot extends DatabaseInstanceSource impleme const portAttribute = Token.asNumber(instance.attrEndpointPort); this.instanceEndpoint = new Endpoint(instance.attrEndpointAddress, portAttribute); - applyRemovalPolicy(instance, props.removalPolicy); + instance.applyRemovalPolicy(props.removalPolicy ?? RemovalPolicy.SNAPSHOT); if (secret) { this.secret = secret.attach(this); @@ -1128,7 +1128,7 @@ export class DatabaseInstanceReadReplica extends DatabaseInstanceNew implements const portAttribute = Token.asNumber(instance.attrEndpointPort); this.instanceEndpoint = new Endpoint(instance.attrEndpointAddress, portAttribute); - applyRemovalPolicy(instance, props.removalPolicy); + instance.applyRemovalPolicy(props.removalPolicy ?? RemovalPolicy.SNAPSHOT); this.setLogRetention(); } diff --git a/packages/@aws-cdk/aws-rds/lib/private/util.ts b/packages/@aws-cdk/aws-rds/lib/private/util.ts index f97486b5daddf..0b6e2b72ff0be 100644 --- a/packages/@aws-cdk/aws-rds/lib/private/util.ts +++ b/packages/@aws-cdk/aws-rds/lib/private/util.ts @@ -1,6 +1,6 @@ import * as iam from '@aws-cdk/aws-iam'; import * as s3 from '@aws-cdk/aws-s3'; -import { CfnDeletionPolicy, CfnResource, RemovalPolicy } from '@aws-cdk/core'; +import { RemovalPolicy } from '@aws-cdk/core'; import { DatabaseSecret } from '../database-secret'; import { IEngine } from '../engine'; import { Credentials } from '../props'; @@ -76,17 +76,6 @@ export function engineDescription(engine: IEngine) { return engine.engineType + (engine.engineVersion?.fullVersion ? `-${engine.engineVersion.fullVersion}` : ''); } -export function applyRemovalPolicy(cfnDatabase: CfnResource, removalPolicy?: RemovalPolicy): void { - if (!removalPolicy) { - // the default DeletionPolicy is 'Snapshot', which is fine, - // but we should also make it 'Snapshot' for UpdateReplace policy - cfnDatabase.cfnOptions.updateReplacePolicy = CfnDeletionPolicy.SNAPSHOT; - } else { - // just apply whatever removal policy the customer explicitly provided - cfnDatabase.applyRemovalPolicy(removalPolicy); - } -} - /** * By default, deletion protection is disabled. * Enable if explicitly provided or if the RemovalPolicy has been set to RETAIN @@ -118,3 +107,28 @@ export function renderCredentials(scope: Construct, engine: IEngine, credentials return renderedCredentials; } + +/** + * The RemovalPolicy that should be applied to a "helper" resource, if the base resource has the given removal policy + * + * - For Clusters, this determines the RemovalPolicy for Instances/SubnetGroups. + * - For Instances, this determines the RemovalPolicy for SubnetGroups. + * + * If the basePolicy is: + * + * DESTROY or SNAPSHOT -> DESTROY (snapshot is good enough to recreate) + * RETAIN -> RETAIN (anything else will lose data or fail to deploy) + * (undefined) -> DESTROY (base policy is assumed to be SNAPSHOT) + */ +export function helperRemovalPolicy(basePolicy?: RemovalPolicy): RemovalPolicy { + return basePolicy === RemovalPolicy.RETAIN + ? RemovalPolicy.RETAIN + : RemovalPolicy.DESTROY; +} + +/** + * Return a given value unless it's the same as another value + */ +export function renderUnless(value: A, suppressValue: A): A | undefined { + return value === suppressValue ? undefined : value; +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rds/lib/serverless-cluster.ts b/packages/@aws-cdk/aws-rds/lib/serverless-cluster.ts index 39258de8c7748..90438cbaa1c79 100644 --- a/packages/@aws-cdk/aws-rds/lib/serverless-cluster.ts +++ b/packages/@aws-cdk/aws-rds/lib/serverless-cluster.ts @@ -8,7 +8,7 @@ import { IClusterEngine } from './cluster-engine'; import { Endpoint } from './endpoint'; import { IParameterGroup } from './parameter-group'; import { DATA_API_ACTIONS } from './perms'; -import { applyRemovalPolicy, defaultDeletionProtection, DEFAULT_PASSWORD_EXCLUDE_CHARS, renderCredentials } from './private/util'; +import { defaultDeletionProtection, DEFAULT_PASSWORD_EXCLUDE_CHARS, renderCredentials } from './private/util'; import { Credentials, RotationMultiUserOptions, RotationSingleUserOptions } from './props'; import { CfnDBCluster } from './rds.generated'; import { ISubnetGroup, SubnetGroup } from './subnet-group'; @@ -468,7 +468,7 @@ export class ServerlessCluster extends ServerlessClusterBase { defaultPort: ec2.Port.tcp(this.clusterEndpoint.port), }); - applyRemovalPolicy(cluster, props.removalPolicy); + cluster.applyRemovalPolicy(props.removalPolicy ?? RemovalPolicy.SNAPSHOT); if (secret) { this.secret = secret.attach(this); diff --git a/packages/@aws-cdk/aws-rds/test/cluster.test.ts b/packages/@aws-cdk/aws-rds/test/cluster.test.ts index ec7c36129b30d..6bfda0f1cfa50 100644 --- a/packages/@aws-cdk/aws-rds/test/cluster.test.ts +++ b/packages/@aws-cdk/aws-rds/test/cluster.test.ts @@ -39,14 +39,14 @@ nodeunitShim({ MasterUserPassword: 'tooshort', VpcSecurityGroupIds: [{ 'Fn::GetAtt': ['DatabaseSecurityGroup5C91FDCB', 'GroupId'] }], }, - DeletionPolicy: ABSENT, + DeletionPolicy: 'Snapshot', UpdateReplacePolicy: 'Snapshot', }, ResourcePart.CompleteDefinition)); expect(stack).to(countResources('AWS::RDS::DBInstance', 2)); expect(stack).to(haveResource('AWS::RDS::DBInstance', { - DeletionPolicy: ABSENT, - UpdateReplacePolicy: ABSENT, + DeletionPolicy: 'Delete', + UpdateReplacePolicy: 'Delete', }, ResourcePart.CompleteDefinition)); test.done(); @@ -1674,7 +1674,7 @@ nodeunitShim({ VpcSecurityGroupIds: [{ 'Fn::GetAtt': ['DatabaseSecurityGroup5C91FDCB', 'GroupId'] }], SnapshotIdentifier: 'mySnapshot', }, - DeletionPolicy: ABSENT, + DeletionPolicy: 'Snapshot', UpdateReplacePolicy: 'Snapshot', }, ResourcePart.CompleteDefinition)); @@ -1840,6 +1840,42 @@ nodeunitShim({ }, }); +test.each([ + [cdk.RemovalPolicy.RETAIN, 'Retain', 'Retain', 'Retain'], + [cdk.RemovalPolicy.SNAPSHOT, 'Snapshot', 'Delete', ABSENT], + [cdk.RemovalPolicy.DESTROY, 'Delete', 'Delete', ABSENT], +])('if Cluster RemovalPolicy is \'%s\', the DBCluster has DeletionPolicy \'%s\', the DBInstance has \'%s\' and the DBSubnetGroup has \'%s\'', (clusterRemovalPolicy, clusterValue, instanceValue, subnetValue) => { + const stack = new cdk.Stack(); + + // WHEN + new DatabaseCluster(stack, 'Cluster', { + credentials: { username: 'admin' }, + engine: DatabaseClusterEngine.AURORA, + instanceProps: { + instanceType: ec2.InstanceType.of(ec2.InstanceClass.M5, ec2.InstanceSize.LARGE), + vpc: new ec2.Vpc(stack, 'Vpc'), + }, + removalPolicy: clusterRemovalPolicy, + }); + + // THEN + expect(stack).to(haveResourceLike('AWS::RDS::DBCluster', { + DeletionPolicy: clusterValue, + UpdateReplacePolicy: clusterValue, + }, ResourcePart.CompleteDefinition)); + + expect(stack).to(haveResourceLike('AWS::RDS::DBInstance', { + DeletionPolicy: instanceValue, + UpdateReplacePolicy: instanceValue, + }, ResourcePart.CompleteDefinition)); + + expect(stack).to(haveResourceLike('AWS::RDS::DBSubnetGroup', { + DeletionPolicy: subnetValue, + UpdateReplacePolicy: subnetValue, + }, ResourcePart.CompleteDefinition)); +}); + + function testStack() { const stack = new cdk.Stack(undefined, undefined, { env: { account: '12345', region: 'us-test-1' } }); stack.node.setContext('availability-zones:12345:us-test-1', ['us-test-1a', 'us-test-1b']); diff --git a/packages/@aws-cdk/aws-rds/test/database-secretmanager.test.ts b/packages/@aws-cdk/aws-rds/test/database-secretmanager.test.ts index 760a16e228cd7..d307c0f05cec6 100644 --- a/packages/@aws-cdk/aws-rds/test/database-secretmanager.test.ts +++ b/packages/@aws-cdk/aws-rds/test/database-secretmanager.test.ts @@ -1,4 +1,4 @@ -import { ABSENT, expect, haveResource, ResourcePart } from '@aws-cdk/assert'; +import { expect, haveResource, ResourcePart } from '@aws-cdk/assert'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; import * as cdk from '@aws-cdk/core'; @@ -41,7 +41,7 @@ nodeunitShim({ }, ], }, - DeletionPolicy: ABSENT, + DeletionPolicy: 'Snapshot', UpdateReplacePolicy: 'Snapshot', }, ResourcePart.CompleteDefinition)); diff --git a/packages/@aws-cdk/aws-rds/test/instance.test.ts b/packages/@aws-cdk/aws-rds/test/instance.test.ts index 8c4e4460f65f1..625dfa7074ae3 100644 --- a/packages/@aws-cdk/aws-rds/test/instance.test.ts +++ b/packages/@aws-cdk/aws-rds/test/instance.test.ts @@ -114,7 +114,7 @@ nodeunitShim({ }, ], }, - DeletionPolicy: ABSENT, + DeletionPolicy: 'Snapshot', UpdateReplacePolicy: 'Snapshot', }, ResourcePart.CompleteDefinition)); @@ -1243,3 +1243,30 @@ nodeunitShim({ test.done(); }, }); + +test.each([ + [cdk.RemovalPolicy.RETAIN, 'Retain', 'Retain'], + [cdk.RemovalPolicy.SNAPSHOT, 'Snapshot', ABSENT], + [cdk.RemovalPolicy.DESTROY, 'Delete', ABSENT], +])('if Instance RemovalPolicy is \'%s\', the instance has DeletionPolicy \'%s\' and the DBSubnetGroup has \'%s\'', (instanceRemovalPolicy, instanceValue, subnetValue) => { + // WHEN + new rds.DatabaseInstance(stack, 'Instance', { + engine: rds.DatabaseInstanceEngine.mysql({ + version: rds.MysqlEngineVersion.VER_8_0_19, + }), + vpc, + vpcSubnets: { subnetType: ec2.SubnetType.PUBLIC }, + removalPolicy: instanceRemovalPolicy, + }); + + // THEN + expect(stack).to(haveResourceLike('AWS::RDS::DBInstance', { + DeletionPolicy: instanceValue, + UpdateReplacePolicy: instanceValue, + }, ResourcePart.CompleteDefinition)); + + expect(stack).to(haveResourceLike('AWS::RDS::DBSubnetGroup', { + DeletionPolicy: subnetValue, + UpdateReplacePolicy: subnetValue, + }, ResourcePart.CompleteDefinition)); +}); diff --git a/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.expected.json b/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.expected.json index 05293187edb33..74a0642b875c8 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.expected.json +++ b/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.expected.json @@ -706,7 +706,8 @@ } ] }, - "UpdateReplacePolicy": "Snapshot" + "UpdateReplacePolicy": "Snapshot", + "DeletionPolicy": "Snapshot" }, "DatabaseInstance1844F58FD": { "Type": "AWS::RDS::DBInstance", @@ -724,7 +725,9 @@ "VPCPrivateSubnet1DefaultRouteAE1D6490", "VPCPrivateSubnet2DefaultRouteF4F5CFD2", "VPCPrivateSubnet3DefaultRoute27F311AE" - ] + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "DatabaseInstance2AA380DEE": { "Type": "AWS::RDS::DBInstance", @@ -742,7 +745,9 @@ "VPCPrivateSubnet1DefaultRouteAE1D6490", "VPCPrivateSubnet2DefaultRouteF4F5CFD2", "VPCPrivateSubnet3DefaultRoute27F311AE" - ] + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "DatabaseRotationSingleUserSecurityGroupAC6E0E73": { "Type": "AWS::EC2::SecurityGroup", diff --git a/packages/@aws-cdk/aws-rds/test/integ.cluster-s3.expected.json b/packages/@aws-cdk/aws-rds/test/integ.cluster-s3.expected.json index 394c50be1df78..3ee9358bebc33 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.cluster-s3.expected.json +++ b/packages/@aws-cdk/aws-rds/test/integ.cluster-s3.expected.json @@ -547,7 +547,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -652,7 +652,8 @@ } ] }, - "UpdateReplacePolicy": "Snapshot" + "UpdateReplacePolicy": "Snapshot", + "DeletionPolicy": "Snapshot" }, "DatabaseInstance1844F58FD": { "Type": "AWS::RDS::DBInstance", @@ -670,7 +671,9 @@ "DependsOn": [ "VPCPublicSubnet1DefaultRoute91CEF279", "VPCPublicSubnet2DefaultRouteB7481BBA" - ] + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "DatabaseInstance2AA380DEE": { "Type": "AWS::RDS::DBInstance", @@ -688,7 +691,9 @@ "DependsOn": [ "VPCPublicSubnet1DefaultRoute91CEF279", "VPCPublicSubnet2DefaultRouteB7481BBA" - ] + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" } } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rds/test/integ.cluster.expected.json b/packages/@aws-cdk/aws-rds/test/integ.cluster.expected.json index 25f2149bf8a0c..04a2157aba0a8 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.cluster.expected.json +++ b/packages/@aws-cdk/aws-rds/test/integ.cluster.expected.json @@ -484,7 +484,8 @@ } ] }, - "UpdateReplacePolicy": "Snapshot" + "UpdateReplacePolicy": "Snapshot", + "DeletionPolicy": "Snapshot" }, "DatabaseInstance1844F58FD": { "Type": "AWS::RDS::DBInstance", @@ -502,7 +503,9 @@ "DependsOn": [ "VPCPublicSubnet1DefaultRoute91CEF279", "VPCPublicSubnet2DefaultRouteB7481BBA" - ] + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "DatabaseInstance2AA380DEE": { "Type": "AWS::RDS::DBInstance", @@ -520,7 +523,9 @@ "DependsOn": [ "VPCPublicSubnet1DefaultRoute91CEF279", "VPCPublicSubnet2DefaultRouteB7481BBA" - ] + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" } } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rds/test/integ.instance-from-generated-password.expected.json b/packages/@aws-cdk/aws-rds/test/integ.instance-from-generated-password.expected.json index a01587728dac5..ca2ee08c781ad 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.instance-from-generated-password.expected.json +++ b/packages/@aws-cdk/aws-rds/test/integ.instance-from-generated-password.expected.json @@ -619,7 +619,8 @@ } ] }, - "UpdateReplacePolicy": "Snapshot" + "UpdateReplacePolicy": "Snapshot", + "DeletionPolicy": "Snapshot" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rds/test/integ.instance-s3.expected.json b/packages/@aws-cdk/aws-rds/test/integ.instance-s3.expected.json index cd2478b15b818..2b144dedcc3aa 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.instance-s3.expected.json +++ b/packages/@aws-cdk/aws-rds/test/integ.instance-s3.expected.json @@ -453,7 +453,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -613,4 +613,4 @@ "DeletionPolicy": "Delete" } } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rds/test/integ.instance.lit.expected.json b/packages/@aws-cdk/aws-rds/test/integ.instance.lit.expected.json index ca91f92e62644..8a05969830f29 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.instance.lit.expected.json +++ b/packages/@aws-cdk/aws-rds/test/integ.instance.lit.expected.json @@ -694,7 +694,8 @@ } ] }, - "UpdateReplacePolicy": "Snapshot" + "UpdateReplacePolicy": "Snapshot", + "DeletionPolicy": "Snapshot" }, "InstanceLogRetentiontrace487771C8": { "Type": "Custom::LogRetention", @@ -832,7 +833,6 @@ ] }, "functionName": "awscdkrdsinstanceInstanceRotationSingleUserAFE3C214", - "excludeCharacters": " %+~`#$&*()|[]{}:;<>?!'/@\"\\", "vpcSubnetIds": { "Fn::Join": [ "", @@ -852,7 +852,8 @@ "InstanceRotationSingleUserSecurityGroupF3FB5C25", "GroupId" ] - } + }, + "excludeCharacters": " %+~`#$&*()|[]{}:;<>?!'/@\"\\" } } }, @@ -1094,13 +1095,13 @@ "Code": { "ZipFile": "exports.handler = (event) => console.log(event);" }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "FunctionServiceRole675BB04A", "Arn" ] }, + "Handler": "index.handler", "Runtime": "nodejs10.x" }, "DependsOn": [ @@ -1122,4 +1123,4 @@ "Description": "Artifact hash for asset \"884431e2bc651d2b61bd699a29dc9684b0f66911f06bd3ed0635f854bf18e147\"" } } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rds/test/integ.proxy.expected.json b/packages/@aws-cdk/aws-rds/test/integ.proxy.expected.json index 52aab8716ba8c..a18c5f5843512 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.proxy.expected.json +++ b/packages/@aws-cdk/aws-rds/test/integ.proxy.expected.json @@ -495,7 +495,8 @@ } ] }, - "UpdateReplacePolicy": "Snapshot" + "UpdateReplacePolicy": "Snapshot", + "DeletionPolicy": "Snapshot" }, "dbProxyIAMRole662F3AB8": { "Type": "AWS::IAM::Role", diff --git a/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster.expected.json b/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster.expected.json index 3d392f574621e..752eae1b22894 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster.expected.json +++ b/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster.expected.json @@ -432,7 +432,8 @@ } ] }, - "UpdateReplacePolicy": "Snapshot" + "UpdateReplacePolicy": "Snapshot", + "DeletionPolicy": "Snapshot" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rds/test/serverless-cluster.test.ts b/packages/@aws-cdk/aws-rds/test/serverless-cluster.test.ts index 257d23d9ffec2..e370ff915cb6c 100644 --- a/packages/@aws-cdk/aws-rds/test/serverless-cluster.test.ts +++ b/packages/@aws-cdk/aws-rds/test/serverless-cluster.test.ts @@ -1,4 +1,4 @@ -import { ABSENT, expect, haveResource, haveResourceLike, ResourcePart, SynthUtils } from '@aws-cdk/assert'; +import { expect, haveResource, haveResourceLike, ResourcePart, SynthUtils } from '@aws-cdk/assert'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; @@ -44,7 +44,7 @@ nodeunitShim({ }, ], }, - DeletionPolicy: ABSENT, + DeletionPolicy: 'Snapshot', UpdateReplacePolicy: 'Snapshot', }, ResourcePart.CompleteDefinition)); @@ -105,7 +105,7 @@ nodeunitShim({ }, ], }, - DeletionPolicy: ABSENT, + DeletionPolicy: 'Snapshot', UpdateReplacePolicy: 'Snapshot', }, ResourcePart.CompleteDefinition)); test.done(); diff --git a/packages/@aws-cdk/aws-route53/package.json b/packages/@aws-cdk/aws-route53/package.json index 0501fc2b8d654..9a22737d55347 100644 --- a/packages/@aws-cdk/aws-route53/package.json +++ b/packages/@aws-cdk/aws-route53/package.json @@ -73,7 +73,7 @@ "devDependencies": { "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.31", - "aws-sdk": "^2.845.0", + "aws-sdk": "^2.848.0", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "cfn2ts": "0.0.0", diff --git a/packages/@aws-cdk/aws-s3-deployment/README.md b/packages/@aws-cdk/aws-s3-deployment/README.md index f8da930bf947e..b0bb1e2d9ebd5 100644 --- a/packages/@aws-cdk/aws-s3-deployment/README.md +++ b/packages/@aws-cdk/aws-s3-deployment/README.md @@ -156,39 +156,15 @@ import * as origins from '@aws-cdk/aws-cloudfront-origins'; const bucket = new s3.Bucket(this, 'Destination'); -// Option 1 (Experimental): Handles buckets whether or not they are configured for website hosting. +// Handles buckets whether or not they are configured for website hosting. const distribution = new cloudfront.Distribution(this, 'Distribution', { defaultBehavior: { origin: new origins.S3Origin(bucket) }, }); -// Option 2 (Stable): Use this if the bucket has website hosting enabled. -const distribution_for_website_bucket = new cloudfront.CloudFrontWebDistribution(this, 'DistributionForWebBucket', { - originConfigs: [ - { - customOriginSource: { - domainName: bucket.bucketWebsiteDomainName, - }, - behaviors : [ {isDefaultBehavior: true}] - } - ] -}); - -// Option 3 (Stable): Use this version if the bucket does not have website hosting enabled. -const distribution_for_bucket = new cloudfront.CloudFrontWebDistribution(this, 'DistributionForBucket', { - originConfigs: [ - { - s3OriginSource: { - s3BucketSource: bucket - }, - behaviors : [ {isDefaultBehavior: true}] - } - ] -}); - new s3deploy.BucketDeployment(this, 'DeployWithInvalidation', { sources: [s3deploy.Source.asset('./website-dist')], destinationBucket: bucket, - distribution, // or distribution_for_website_bucket or distribution_for_bucket + distribution, distributionPaths: ['/images/*.png'], }); ``` @@ -229,5 +205,4 @@ might be tricky to build on Windows. ## Roadmap - - [ ] Support "progressive" mode (no `--delete`) ([#953](https://github.com/aws/aws-cdk/issues/953)) - [ ] Support "blue/green" deployments ([#954](https://github.com/aws/aws-cdk/issues/954)) diff --git a/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment-cloudfront.expected.json b/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment-cloudfront.expected.json index fa5e26b9d57e9..76f906941f2bd 100644 --- a/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment-cloudfront.expected.json +++ b/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment-cloudfront.expected.json @@ -244,7 +244,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -390,4 +390,4 @@ "Description": "Artifact hash for asset \"fc4481abf279255619ff7418faa5d24456fef3432ea0da59c95542578ff0222e\"" } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.expected.json b/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.expected.json index 92d6c5bb8514b..877298773816b 100644 --- a/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.expected.json +++ b/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.expected.json @@ -195,7 +195,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -228,7 +228,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -261,7 +261,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -725,4 +725,4 @@ "Description": "Artifact hash for asset \"fc4481abf279255619ff7418faa5d24456fef3432ea0da59c95542578ff0222e\"" } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/aws-s3-notifications/test/sqs/integ.bucket-notifications.expected.json b/packages/@aws-cdk/aws-s3-notifications/test/sqs/integ.bucket-notifications.expected.json index dee4dafe9e74b..0da38cd2026c5 100644 --- a/packages/@aws-cdk/aws-s3-notifications/test/sqs/integ.bucket-notifications.expected.json +++ b/packages/@aws-cdk/aws-s3-notifications/test/sqs/integ.bucket-notifications.expected.json @@ -53,7 +53,9 @@ ] }, "MyQueueE6CA6235": { - "Type": "AWS::SQS::Queue" + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "MyQueuePolicy6BBEDDAC": { "Type": "AWS::SQS::QueuePolicy", @@ -325,7 +327,9 @@ "Arn" ] } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "EncryptedQueuePolicy8AEB1708": { "Type": "AWS::SQS::QueuePolicy", diff --git a/packages/@aws-cdk/aws-s3/lib/bucket.ts b/packages/@aws-cdk/aws-s3/lib/bucket.ts index 859f774565a93..4323f47daf575 100644 --- a/packages/@aws-cdk/aws-s3/lib/bucket.ts +++ b/packages/@aws-cdk/aws-s3/lib/bucket.ts @@ -1161,8 +1161,8 @@ export interface BucketProps { * * @see https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html * - * @default false New buckets and objects don't allow public access, but users can modify bucket - * policies or object permissions to allow public access. + * + * @default - CloudFormation defaults will apply. New buckets and objects don't allow public access, but users can modify bucket policies or object permissions to allow public access */ readonly blockPublicAccess?: BlockPublicAccess; diff --git a/packages/@aws-cdk/aws-s3/test/bucket.test.ts b/packages/@aws-cdk/aws-s3/test/bucket.test.ts index b54957f32d500..0fb1bffa3726f 100644 --- a/packages/@aws-cdk/aws-s3/test/bucket.test.ts +++ b/packages/@aws-cdk/aws-s3/test/bucket.test.ts @@ -2406,4 +2406,4 @@ describe('bucket', () => { autoDeleteObjects: true, })).toThrow(/Cannot use \'autoDeleteObjects\' property on a bucket without setting removal policy to \'DESTROY\'/); }); -}); +}); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.lit.expected.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.lit.expected.json index 04e17f51774e9..4197e9179b4ff 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.lit.expected.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.lit.expected.json @@ -37,7 +37,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -71,4 +71,4 @@ } } } -] \ No newline at end of file +] diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.expected.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.expected.json index e816e78115fde..58cd3c5760961 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.expected.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.expected.json @@ -88,7 +88,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -173,4 +173,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/aws-sns-subscriptions/test/integ.sns-lambda.expected.json b/packages/@aws-cdk/aws-sns-subscriptions/test/integ.sns-lambda.expected.json index 38367e9204de2..d20fe9bf9a8db 100644 --- a/packages/@aws-cdk/aws-sns-subscriptions/test/integ.sns-lambda.expected.json +++ b/packages/@aws-cdk/aws-sns-subscriptions/test/integ.sns-lambda.expected.json @@ -40,13 +40,13 @@ "Code": { "ZipFile": "exports.handler = function handler(event, _context, callback) {\n /* eslint-disable no-console */\n console.log('====================================================');\n console.log(JSON.stringify(event, undefined, 2));\n console.log('====================================================');\n return callback(undefined, event);\n}" }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "EchoServiceRoleBE28060B", "Arn" ] }, + "Handler": "index.handler", "Runtime": "nodejs10.x" }, "DependsOn": [ @@ -93,7 +93,9 @@ } }, "DeadLetterQueue9F481546": { - "Type": "AWS::SQS::Queue" + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "DeadLetterQueuePolicyB1FB890C": { "Type": "AWS::SQS::QueuePolicy", @@ -167,13 +169,13 @@ "Code": { "ZipFile": "exports.handler = function handler(event, _context, callback) {\n /* eslint-disable no-console */\n console.log('====================================================');\n console.log(JSON.stringify(event, undefined, 2));\n console.log('====================================================');\n return callback(undefined, event);\n}" }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "FilteredServiceRole16D9DDC1", "Arn" ] }, + "Handler": "index.handler", "Runtime": "nodejs10.x" }, "DependsOn": [ diff --git a/packages/@aws-cdk/aws-sns-subscriptions/test/integ.sns-sqs.lit.expected.json b/packages/@aws-cdk/aws-sns-subscriptions/test/integ.sns-sqs.lit.expected.json index ea6b8345f0469..f9b68ad7da9ca 100644 --- a/packages/@aws-cdk/aws-sns-subscriptions/test/integ.sns-sqs.lit.expected.json +++ b/packages/@aws-cdk/aws-sns-subscriptions/test/integ.sns-sqs.lit.expected.json @@ -4,7 +4,9 @@ "Type": "AWS::SNS::Topic" }, "MyQueueE6CA6235": { - "Type": "AWS::SQS::Queue" + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "MyQueuePolicy6BBEDDAC": { "Type": "AWS::SQS::QueuePolicy", @@ -66,8 +68,8 @@ }, "DeadLetterQueue9F481546": { "Type": "AWS::SQS::Queue", - "Properties": { - } + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "DeadLetterQueuePolicyB1FB890C": { "Type": "AWS::SQS::QueuePolicy", diff --git a/packages/@aws-cdk/aws-sns-subscriptions/test/subs.test.ts b/packages/@aws-cdk/aws-sns-subscriptions/test/subs.test.ts index b2da0de8099b3..4bd8646176d08 100644 --- a/packages/@aws-cdk/aws-sns-subscriptions/test/subs.test.ts +++ b/packages/@aws-cdk/aws-sns-subscriptions/test/subs.test.ts @@ -82,6 +82,8 @@ test('url subscription with user provided dlq', () => { }, 'DeadLetterQueue9F481546': { 'Type': 'AWS::SQS::Queue', + 'DeletionPolicy': 'Delete', + 'UpdateReplacePolicy': 'Delete', 'Properties': { 'MessageRetentionPeriod': 1209600, 'QueueName': 'MySubscription_DLQ', @@ -248,6 +250,8 @@ test('queue subscription', () => { }, 'MyQueueE6CA6235': { 'Type': 'AWS::SQS::Queue', + 'DeletionPolicy': 'Delete', + 'UpdateReplacePolicy': 'Delete', }, 'MyQueuePolicy6BBEDDAC': { 'Type': 'AWS::SQS::QueuePolicy', @@ -325,6 +329,8 @@ test('queue subscription with user provided dlq', () => { }, 'MyQueueE6CA6235': { 'Type': 'AWS::SQS::Queue', + 'DeletionPolicy': 'Delete', + 'UpdateReplacePolicy': 'Delete', }, 'MyQueuePolicy6BBEDDAC': { 'Type': 'AWS::SQS::QueuePolicy', @@ -386,6 +392,8 @@ test('queue subscription with user provided dlq', () => { }, 'DeadLetterQueue9F481546': { 'Type': 'AWS::SQS::Queue', + 'DeletionPolicy': 'Delete', + 'UpdateReplacePolicy': 'Delete', 'Properties': { 'MessageRetentionPeriod': 1209600, 'QueueName': 'MySubscription_DLQ', @@ -745,6 +753,8 @@ test('multiple subscriptions', () => { }, 'MyQueueE6CA6235': { 'Type': 'AWS::SQS::Queue', + 'DeletionPolicy': 'Delete', + 'UpdateReplacePolicy': 'Delete', }, 'MyQueuePolicy6BBEDDAC': { 'Type': 'AWS::SQS::QueuePolicy', diff --git a/packages/@aws-cdk/aws-sqs/lib/queue.ts b/packages/@aws-cdk/aws-sqs/lib/queue.ts index 63b466de84421..1c3067c7a70d6 100644 --- a/packages/@aws-cdk/aws-sqs/lib/queue.ts +++ b/packages/@aws-cdk/aws-sqs/lib/queue.ts @@ -1,5 +1,5 @@ import * as kms from '@aws-cdk/aws-kms'; -import { Duration, Stack, Token } from '@aws-cdk/core'; +import { Duration, RemovalPolicy, Stack, Token } from '@aws-cdk/core'; import { Construct } from 'constructs'; import { IQueue, QueueAttributes, QueueBase } from './queue-base'; import { CfnQueue } from './sqs.generated'; @@ -137,6 +137,18 @@ export interface QueueProps { * @default false */ readonly contentBasedDeduplication?: boolean; + + /** + * Policy to apply when the user pool is removed from the stack + * + * Even though queues are technically stateful, their contents are transient and it + * is common to add and remove Queues while rearchitecting your application. The + * default is therefore `DESTROY`. Change it to `RETAIN` if the messages are so + * valuable that accidentally losing them would be unacceptable. + * + * @default RemovalPolicy.DESTROY + */ + readonly removalPolicy?: RemovalPolicy; } /** @@ -273,6 +285,7 @@ export class Queue extends QueueBase { receiveMessageWaitTimeSeconds: props.receiveMessageWaitTime && props.receiveMessageWaitTime.toSeconds(), visibilityTimeout: props.visibilityTimeout && props.visibilityTimeout.toSeconds(), }); + queue.applyRemovalPolicy(props.removalPolicy ?? RemovalPolicy.DESTROY); this.queueArn = this.getResourceArnAttribute(queue.attrArn, { service: 'sqs', diff --git a/packages/@aws-cdk/aws-sqs/package.json b/packages/@aws-cdk/aws-sqs/package.json index 008b36d37ed4d..7b610c64bb71c 100644 --- a/packages/@aws-cdk/aws-sqs/package.json +++ b/packages/@aws-cdk/aws-sqs/package.json @@ -73,7 +73,7 @@ "@aws-cdk/assert": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@types/nodeunit": "^0.0.31", - "aws-sdk": "^2.845.0", + "aws-sdk": "^2.848.0", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "cfn2ts": "0.0.0", diff --git a/packages/@aws-cdk/aws-sqs/test/integ.sqs.expected.json b/packages/@aws-cdk/aws-sqs/test/integ.sqs.expected.json index 30c3a8a66bfac..c310198cfcae6 100644 --- a/packages/@aws-cdk/aws-sqs/test/integ.sqs.expected.json +++ b/packages/@aws-cdk/aws-sqs/test/integ.sqs.expected.json @@ -1,7 +1,9 @@ { "Resources": { "DeadLetterQueue9F481546": { - "Type": "AWS::SQS::Queue" + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "Queue4A7E3555": { "Type": "AWS::SQS::Queue", @@ -16,7 +18,9 @@ }, "maxReceiveCount": 5 } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "EncryptionKey1B843E66": { "Type": "AWS::KMS::Key", @@ -63,7 +67,9 @@ "Arn" ] } - } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "Role1ABCC5F0": { "Type": "AWS::IAM::Role", diff --git a/packages/@aws-cdk/aws-sqs/test/test.sqs.ts b/packages/@aws-cdk/aws-sqs/test/test.sqs.ts index 87e38c2dcf2ca..ea0233578c5a6 100644 --- a/packages/@aws-cdk/aws-sqs/test/test.sqs.ts +++ b/packages/@aws-cdk/aws-sqs/test/test.sqs.ts @@ -1,4 +1,4 @@ -import { expect, haveResource } from '@aws-cdk/assert'; +import { expect, haveResource, ResourcePart } from '@aws-cdk/assert'; import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; import { CfnParameter, Duration, Stack, App } from '@aws-cdk/core'; @@ -18,10 +18,16 @@ export = { 'Resources': { 'Queue4A7E3555': { 'Type': 'AWS::SQS::Queue', + 'UpdateReplacePolicy': 'Delete', + 'DeletionPolicy': 'Delete', }, }, }); + expect(stack).to(haveResource('AWS::SQS::Queue', { + DeletionPolicy: 'Delete', + }, ResourcePart.CompleteDefinition)); + test.done(); }, 'with a dead letter queue'(test: Test) { @@ -33,6 +39,8 @@ export = { 'Resources': { 'DLQ581697C4': { 'Type': 'AWS::SQS::Queue', + 'UpdateReplacePolicy': 'Delete', + 'DeletionPolicy': 'Delete', }, 'Queue4A7E3555': { 'Type': 'AWS::SQS::Queue', @@ -47,6 +55,8 @@ export = { 'maxReceiveCount': 3, }, }, + 'UpdateReplacePolicy': 'Delete', + 'DeletionPolicy': 'Delete', }, }, }); @@ -99,6 +109,8 @@ export = { 'Ref': 'myretentionperiod', }, }, + 'UpdateReplacePolicy': 'Delete', + 'DeletionPolicy': 'Delete', }, }, }); @@ -119,6 +131,8 @@ export = { 'Resources': { 'MyQueueE6CA6235': { 'Type': 'AWS::SQS::Queue', + 'UpdateReplacePolicy': 'Delete', + 'DeletionPolicy': 'Delete', }, 'MyQueuePolicy6BBEDDAC': { 'Type': 'AWS::SQS::QueuePolicy', @@ -311,6 +325,8 @@ export = { 'Properties': { 'KmsMasterKeyId': 'alias/aws/sqs', }, + 'UpdateReplacePolicy': 'Delete', + 'DeletionPolicy': 'Delete', }, }, }); @@ -378,6 +394,8 @@ export = { 'QueueName': 'MyQueue.fifo', 'FifoQueue': true, }, + 'UpdateReplacePolicy': 'Delete', + 'DeletionPolicy': 'Delete', }, }, }); @@ -400,6 +418,8 @@ export = { 'Properties': { 'FifoQueue': true, }, + 'UpdateReplacePolicy': 'Delete', + 'DeletionPolicy': 'Delete', }, }, }); diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/README.md b/packages/@aws-cdk/aws-stepfunctions-tasks/README.md index 80e1dab5ef73f..e7616028054fd 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/README.md +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/README.md @@ -54,6 +54,8 @@ This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aw - [Cancel Step](#cancel-step) - [Modify Instance Fleet](#modify-instance-fleet) - [Modify Instance Group](#modify-instance-group) +- [EKS](#eks) + - [Call](#call) - [Glue](#glue) - [Glue DataBrew](#glue-databrew) - [Lambda](#lambda) @@ -664,6 +666,37 @@ new tasks.EmrModifyInstanceGroupByName(stack, 'Task', { }); ``` +## EKS + +Step Functions supports Amazon EKS through the service integration pattern. +The service integration APIs correspond to Amazon EKS APIs. + +[Read more](https://docs.aws.amazon.com/step-functions/latest/dg/connect-eks.html) about the differences when using these service integrations. + +### Call + +Read and write Kubernetes resource objects via a Kubernetes API endpoint. +Corresponds to the [`call`](https://docs.aws.amazon.com/step-functions/latest/dg/connect-eks.html) API in Step Functions Connector. + +The following code snippet includes a Task state that uses eks:call to list the pods. + +```ts +import * as eks from '@aws-cdk/aws-eks'; +import * as sfn from '@aws-cdk/aws-stepfunctions'; +import * as tasks from '@aws-cdk/aws-stepfunctions-tasks'; + +const myEksCluster = new eks.Cluster(this, 'my sample cluster', { + version: eks.KubernetesVersion.V1_18, + clusterName: 'myEksCluster', + }); + +new tasks.EksCall(stack, 'Call a EKS Endpoint', { + cluster: myEksCluster, + httpMethod: MethodType.GET, + httpPath: '/api/v1/namespaces/default/pods', +}); +``` + ## Glue Step Functions supports [AWS Glue](https://docs.aws.amazon.com/step-functions/latest/dg/connect-glue.html) through the service integration pattern. @@ -811,7 +844,7 @@ Step Functions supports [AWS SageMaker](https://docs.aws.amazon.com/step-functio You can call the [`CreateTrainingJob`](https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateTrainingJob.html) API from a `Task` state. ```ts -new sfn.SagemakerTrainTask(this, 'TrainSagemaker', { +new sfn.SageMakerCreateTrainingJob(this, 'TrainSagemaker', { trainingJobName: sfn.JsonPath.stringAt('$.JobName'), role, algorithmSpecification: { @@ -846,7 +879,7 @@ new sfn.SagemakerTrainTask(this, 'TrainSagemaker', { You can call the [`CreateTransformJob`](https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateTransformJob.html) API from a `Task` state. ```ts -new sfn.SagemakerTransformTask(this, 'Batch Inference', { +new sfn.SageMakerCreateTransformJob(this, 'Batch Inference', { transformJobName: 'MyTransformJob', modelName: 'MyModelName', modelClientOptions: { diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/eks/call.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/eks/call.ts new file mode 100644 index 0000000000000..8cbf3fcca5886 --- /dev/null +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/eks/call.ts @@ -0,0 +1,137 @@ +import * as eks from '@aws-cdk/aws-eks'; +import * as iam from '@aws-cdk/aws-iam'; +import * as sfn from '@aws-cdk/aws-stepfunctions'; +import { Construct } from 'constructs'; +import { integrationResourceArn, validatePatternSupported } from '../private/task-utils'; + +/** + * Properties for calling a EKS endpoint with EksCall + * @experimental + */ +export interface EksCallProps extends sfn.TaskStateBaseProps { + + /** + * The EKS cluster + */ + readonly cluster: eks.ICluster; + + /** + * HTTP method ("GET", "POST", "PUT", ...) part of HTTP request + */ + readonly httpMethod: HttpMethods; + + /** + * HTTP path of the Kubernetes REST API operation + * For example: /api/v1/namespaces/default/pods + */ + readonly httpPath: string; + + /** + * Query Parameters part of HTTP request + * @default - no query parameters + */ + readonly queryParameters?: { [key: string]: string[] }; + + /** + * Request body part of HTTP request + * @default - No request body + */ + readonly requestBody?: sfn.TaskInput; +} + +/** + * Call a EKS endpoint as a Task + * + * @see https://docs.aws.amazon.com/step-functions/latest/dg/connect-eks.html + * @experimental + */ +export class EksCall extends sfn.TaskStateBase { + + private static readonly SUPPORTED_INTEGRATION_PATTERNS: sfn.IntegrationPattern[] = [ + sfn.IntegrationPattern.REQUEST_RESPONSE, + ]; + + /** No policies are required due to eks:call is an Http service integration and does not call and EKS API directly + * @see https://docs.aws.amazon.com/step-functions/latest/dg/connect-eks.html#connect-eks-permissions + */ + protected readonly taskMetrics?: sfn.TaskMetricsConfig; + protected readonly taskPolicies?: iam.PolicyStatement[]; + + private readonly integrationPattern: sfn.IntegrationPattern; + + private readonly clusterEndpoint: string; + private readonly clusterCertificateAuthorityData: string; + + constructor(scope: Construct, id: string, private readonly props: EksCallProps) { + super(scope, id, props); + this.integrationPattern = props.integrationPattern ?? sfn.IntegrationPattern.REQUEST_RESPONSE; + + validatePatternSupported(this.integrationPattern, EksCall.SUPPORTED_INTEGRATION_PATTERNS); + + try { + this.clusterEndpoint = this.props.cluster.clusterEndpoint; + } catch (e) { + throw new Error('The "clusterEndpoint" property must be specified when using an imported Cluster.'); + } + + try { + this.clusterCertificateAuthorityData = this.props.cluster.clusterCertificateAuthorityData; + } catch (e) { + throw new Error('The "clusterCertificateAuthorityData" property must be specified when using an imported Cluster.'); + } + } + + /** + * Provides the EKS Call service integration task configuration + * @internal + */ + protected _renderTask(): any { + return { + Resource: integrationResourceArn('eks', 'call', this.integrationPattern), + Parameters: sfn.FieldUtils.renderObject({ + ClusterName: this.props.cluster.clusterName, + CertificateAuthority: this.clusterCertificateAuthorityData, + Endpoint: this.clusterEndpoint, + Method: this.props.httpMethod, + Path: this.props.httpPath, + QueryParameters: this.props.queryParameters, + RequestBody: this.props.requestBody?.value, + }), + }; + } +} + +/** + * Method type of a EKS call + */ +export enum HttpMethods { + /** + * Retrieve data from a server at the specified resource + */ + GET = 'GET', + + /** + * Send data to the API endpoint to create or update a resource + */ + POST = 'POST', + + /** + * Send data to the API endpoint to update or create a resource + */ + PUT = 'PUT', + + /** + * Delete the resource at the specified endpoint + */ + DELETE = 'DELETE', + + /** + * Apply partial modifications to the resource + */ + PATCH = 'PATCH', + + /** + * Retrieve data from a server at the specified resource without the response body + */ + HEAD = 'HEAD' +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/index.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/index.ts index 84b790beff216..32e684f6d1adf 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/index.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/index.ts @@ -44,3 +44,4 @@ export * from './athena/stop-query-execution'; export * from './athena/get-query-execution'; export * from './athena/get-query-results'; export * from './databrew/start-job-run'; +export * from './eks/call'; diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/package.json b/packages/@aws-cdk/aws-stepfunctions-tasks/package.json index 63496e7c5fca5..a6137f570b1a3 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/package.json +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/package.json @@ -81,6 +81,7 @@ "@aws-cdk/aws-ecr": "0.0.0", "@aws-cdk/aws-ecr-assets": "0.0.0", "@aws-cdk/aws-ecs": "0.0.0", + "@aws-cdk/aws-eks": "0.0.0", "@aws-cdk/aws-glue": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-kms": "0.0.0", @@ -103,6 +104,7 @@ "@aws-cdk/aws-ecr": "0.0.0", "@aws-cdk/aws-ecr-assets": "0.0.0", "@aws-cdk/aws-ecs": "0.0.0", + "@aws-cdk/aws-eks": "0.0.0", "@aws-cdk/aws-glue": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-kms": "0.0.0", diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/eks/call.test.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/test/eks/call.test.ts new file mode 100644 index 0000000000000..fd7c9f7cb0dd7 --- /dev/null +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/eks/call.test.ts @@ -0,0 +1,234 @@ +import * as eks from '@aws-cdk/aws-eks'; +import * as sfn from '@aws-cdk/aws-stepfunctions'; +import { Stack } from '@aws-cdk/core'; +import { EksCall, HttpMethods } from '../../lib/eks/call'; + +let stack: Stack; +let cluster: eks.Cluster; + +beforeEach(() => { + //GIVEN + stack = new Stack(); + cluster = new eks.Cluster(stack, 'Cluster', { + version: eks.KubernetesVersion.V1_18, + clusterName: 'eksCluster', + }); +}); + +test('Call an EKS endpoint', () => { + // WHEN + const task = new EksCall(stack, 'Call', { + cluster: cluster, + httpMethod: HttpMethods.GET, + httpPath: 'path', + requestBody: sfn.TaskInput.fromObject({ + Body: 'requestBody', + }), + }); + + // THEN + expect(stack.resolve(task.toStateJson())).toEqual({ + Type: 'Task', + Resource: { + 'Fn::Join': [ + '', + [ + 'arn:', + { + Ref: 'AWS::Partition', + }, + ':states:::eks:call', + ], + ], + }, + End: true, + Parameters: { + ClusterName: { + Ref: 'Cluster9EE0221C', + }, + CertificateAuthority: { + 'Fn::GetAtt': [ + 'Cluster9EE0221C', + 'CertificateAuthorityData', + ], + }, + Endpoint: { + 'Fn::GetAtt': [ + 'Cluster9EE0221C', + 'Endpoint', + ], + }, + Method: 'GET', + Path: 'path', + RequestBody: { + Body: 'requestBody', + }, + }, + }); +}); + +test('Call an EKS endpoint with requestBody as a string', () => { + // WHEN + const task = new EksCall(stack, 'Call', { + cluster: cluster, + httpMethod: HttpMethods.GET, + httpPath: 'path', + requestBody: sfn.TaskInput.fromText('requestBody'), + }); + + // THEN + expect(stack.resolve(task.toStateJson())).toEqual({ + Type: 'Task', + Resource: { + 'Fn::Join': [ + '', + [ + 'arn:', + { + Ref: 'AWS::Partition', + }, + ':states:::eks:call', + ], + ], + }, + End: true, + Parameters: { + ClusterName: { + Ref: 'Cluster9EE0221C', + }, + CertificateAuthority: { + 'Fn::GetAtt': [ + 'Cluster9EE0221C', + 'CertificateAuthorityData', + ], + }, + Endpoint: { + 'Fn::GetAtt': [ + 'Cluster9EE0221C', + 'Endpoint', + ], + }, + Method: 'GET', + Path: 'path', + RequestBody: 'requestBody', + }, + }); +}); + +test('Call an EKS endpoint with requestBody supply through path', () => { + // WHEN + const task = new EksCall(stack, 'Call', { + cluster: cluster, + httpMethod: HttpMethods.GET, + httpPath: 'path', + requestBody: sfn.TaskInput.fromJsonPathAt('$.Request.Body'), + }); + + // THEN + expect(stack.resolve(task.toStateJson())).toEqual({ + Type: 'Task', + Resource: { + 'Fn::Join': [ + '', + [ + 'arn:', + { + Ref: 'AWS::Partition', + }, + ':states:::eks:call', + ], + ], + }, + End: true, + Parameters: { + 'ClusterName': { + Ref: 'Cluster9EE0221C', + }, + 'CertificateAuthority': { + 'Fn::GetAtt': [ + 'Cluster9EE0221C', + 'CertificateAuthorityData', + ], + }, + 'Endpoint': { + 'Fn::GetAtt': [ + 'Cluster9EE0221C', + 'Endpoint', + ], + }, + 'Method': 'GET', + 'Path': 'path', + 'RequestBody.$': '$.Request.Body', + }, + }); +}); + +test('Task throws if RUN_JOB is supplied as service integration pattern', () => { + expect(() => { + new EksCall(stack, 'Call', { + cluster: cluster, + httpMethod: HttpMethods.GET, + httpPath: 'path', + requestBody: sfn.TaskInput.fromObject({ + RequestBody: 'requestBody', + }), + integrationPattern: sfn.IntegrationPattern.RUN_JOB, + }); + }).toThrow( + /Unsupported service integration pattern. Supported Patterns: REQUEST_RESPONSE. Received: RUN_JOB/, + ); +}); + +test('Task throws if WAIT_FOR_TASK_TOKEN is supplied as service integration pattern', () => { + expect(() => { + new EksCall(stack, 'Call', { + cluster: cluster, + httpMethod: HttpMethods.GET, + httpPath: 'path', + requestBody: sfn.TaskInput.fromObject({ + RequestBody: 'requestBody', + }), + integrationPattern: sfn.IntegrationPattern.WAIT_FOR_TASK_TOKEN, + }); + }).toThrow( + /Unsupported service integration pattern. Supported Patterns: REQUEST_RESPONSE. Received: WAIT_FOR_TASK_TOKEN/, + ); +}); + +test('Task throws if cluster supplied does not have clusterEndpoint configured', () => { + const importedCluster = eks.Cluster.fromClusterAttributes(stack, 'InvalidCluster', { + clusterName: 'importedCluster', + clusterCertificateAuthorityData: 'clusterCertificateAuthorityData', + }); + expect(() => { + new EksCall(stack, 'Call', { + cluster: importedCluster, + httpMethod: HttpMethods.GET, + httpPath: 'path', + requestBody: sfn.TaskInput.fromObject({ + RequestBody: 'requestBody', + }), + }); + }).toThrow( + /The "clusterEndpoint" property must be specified when using an imported Cluster./, + ); +}); + +test('Task throws if cluster supplied does not have clusterCertificateAuthorityData configured', () => { + const importedCluster = eks.Cluster.fromClusterAttributes(stack, 'InvalidCluster', { + clusterName: 'importedCluster', + clusterEndpoint: 'clusterEndpoint', + }); + expect(() => { + new EksCall(stack, 'Call', { + cluster: importedCluster, + httpMethod: HttpMethods.GET, + httpPath: 'path', + requestBody: sfn.TaskInput.fromObject({ + RequestBody: 'requestBody', + }), + }); + }).toThrow( + /The "clusterCertificateAuthorityData" property must be specified when using an imported Cluster./, + ); +}); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/eks/integ.call.expected.json b/packages/@aws-cdk/aws-stepfunctions-tasks/test/eks/integ.call.expected.json new file mode 100644 index 0000000000000..23ad4160b9f7b --- /dev/null +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/eks/integ.call.expected.json @@ -0,0 +1,1580 @@ +{ + "Resources": { + "EksClusterDefaultVpcB24550B2": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "aws-stepfunctions-tasks-eks-call-integ/EksCluster/DefaultVpc" + } + ] + } + }, + "EksClusterDefaultVpcPublicSubnet1SubnetCB1D1047": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "CidrBlock": "10.0.0.0/19", + "VpcId": { + "Ref": "EksClusterDefaultVpcB24550B2" + }, + "AvailabilityZone": "test-region-1a", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "kubernetes.io/role/elb", + "Value": "1" + }, + { + "Key": "Name", + "Value": "aws-stepfunctions-tasks-eks-call-integ/EksCluster/DefaultVpc/PublicSubnet1" + } + ] + } + }, + "EksClusterDefaultVpcPublicSubnet1RouteTable163DE10A": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "EksClusterDefaultVpcB24550B2" + }, + "Tags": [ + { + "Key": "kubernetes.io/role/elb", + "Value": "1" + }, + { + "Key": "Name", + "Value": "aws-stepfunctions-tasks-eks-call-integ/EksCluster/DefaultVpc/PublicSubnet1" + } + ] + } + }, + "EksClusterDefaultVpcPublicSubnet1RouteTableAssociation36D085C2": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "EksClusterDefaultVpcPublicSubnet1RouteTable163DE10A" + }, + "SubnetId": { + "Ref": "EksClusterDefaultVpcPublicSubnet1SubnetCB1D1047" + } + } + }, + "EksClusterDefaultVpcPublicSubnet1DefaultRouteCE5F6EF3": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "EksClusterDefaultVpcPublicSubnet1RouteTable163DE10A" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "EksClusterDefaultVpcIGWCA6A3220" + } + }, + "DependsOn": [ + "EksClusterDefaultVpcVPCGW0E4A5673" + ] + }, + "EksClusterDefaultVpcPublicSubnet1EIPF53713C9": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "kubernetes.io/role/elb", + "Value": "1" + }, + { + "Key": "Name", + "Value": "aws-stepfunctions-tasks-eks-call-integ/EksCluster/DefaultVpc/PublicSubnet1" + } + ] + } + }, + "EksClusterDefaultVpcPublicSubnet1NATGateway548C2CDF": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "EksClusterDefaultVpcPublicSubnet1EIPF53713C9", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "EksClusterDefaultVpcPublicSubnet1SubnetCB1D1047" + }, + "Tags": [ + { + "Key": "kubernetes.io/role/elb", + "Value": "1" + }, + { + "Key": "Name", + "Value": "aws-stepfunctions-tasks-eks-call-integ/EksCluster/DefaultVpc/PublicSubnet1" + } + ] + } + }, + "EksClusterDefaultVpcPublicSubnet2SubnetA8FE675D": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "CidrBlock": "10.0.32.0/19", + "VpcId": { + "Ref": "EksClusterDefaultVpcB24550B2" + }, + "AvailabilityZone": "test-region-1b", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "kubernetes.io/role/elb", + "Value": "1" + }, + { + "Key": "Name", + "Value": "aws-stepfunctions-tasks-eks-call-integ/EksCluster/DefaultVpc/PublicSubnet2" + } + ] + } + }, + "EksClusterDefaultVpcPublicSubnet2RouteTable1027E4DE": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "EksClusterDefaultVpcB24550B2" + }, + "Tags": [ + { + "Key": "kubernetes.io/role/elb", + "Value": "1" + }, + { + "Key": "Name", + "Value": "aws-stepfunctions-tasks-eks-call-integ/EksCluster/DefaultVpc/PublicSubnet2" + } + ] + } + }, + "EksClusterDefaultVpcPublicSubnet2RouteTableAssociation39E2ABB3": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "EksClusterDefaultVpcPublicSubnet2RouteTable1027E4DE" + }, + "SubnetId": { + "Ref": "EksClusterDefaultVpcPublicSubnet2SubnetA8FE675D" + } + } + }, + "EksClusterDefaultVpcPublicSubnet2DefaultRoute8B910E5C": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "EksClusterDefaultVpcPublicSubnet2RouteTable1027E4DE" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "EksClusterDefaultVpcIGWCA6A3220" + } + }, + "DependsOn": [ + "EksClusterDefaultVpcVPCGW0E4A5673" + ] + }, + "EksClusterDefaultVpcPublicSubnet2EIP16D41D80": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "kubernetes.io/role/elb", + "Value": "1" + }, + { + "Key": "Name", + "Value": "aws-stepfunctions-tasks-eks-call-integ/EksCluster/DefaultVpc/PublicSubnet2" + } + ] + } + }, + "EksClusterDefaultVpcPublicSubnet2NATGateway869DDCBF": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "EksClusterDefaultVpcPublicSubnet2EIP16D41D80", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "EksClusterDefaultVpcPublicSubnet2SubnetA8FE675D" + }, + "Tags": [ + { + "Key": "kubernetes.io/role/elb", + "Value": "1" + }, + { + "Key": "Name", + "Value": "aws-stepfunctions-tasks-eks-call-integ/EksCluster/DefaultVpc/PublicSubnet2" + } + ] + } + }, + "EksClusterDefaultVpcPublicSubnet3SubnetA04EFFC1": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "CidrBlock": "10.0.64.0/19", + "VpcId": { + "Ref": "EksClusterDefaultVpcB24550B2" + }, + "AvailabilityZone": "test-region-1c", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "kubernetes.io/role/elb", + "Value": "1" + }, + { + "Key": "Name", + "Value": "aws-stepfunctions-tasks-eks-call-integ/EksCluster/DefaultVpc/PublicSubnet3" + } + ] + } + }, + "EksClusterDefaultVpcPublicSubnet3RouteTableEBB51B8A": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "EksClusterDefaultVpcB24550B2" + }, + "Tags": [ + { + "Key": "kubernetes.io/role/elb", + "Value": "1" + }, + { + "Key": "Name", + "Value": "aws-stepfunctions-tasks-eks-call-integ/EksCluster/DefaultVpc/PublicSubnet3" + } + ] + } + }, + "EksClusterDefaultVpcPublicSubnet3RouteTableAssociationFE466321": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "EksClusterDefaultVpcPublicSubnet3RouteTableEBB51B8A" + }, + "SubnetId": { + "Ref": "EksClusterDefaultVpcPublicSubnet3SubnetA04EFFC1" + } + } + }, + "EksClusterDefaultVpcPublicSubnet3DefaultRoute1F5BE861": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "EksClusterDefaultVpcPublicSubnet3RouteTableEBB51B8A" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "EksClusterDefaultVpcIGWCA6A3220" + } + }, + "DependsOn": [ + "EksClusterDefaultVpcVPCGW0E4A5673" + ] + }, + "EksClusterDefaultVpcPublicSubnet3EIPF8D34EDE": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "kubernetes.io/role/elb", + "Value": "1" + }, + { + "Key": "Name", + "Value": "aws-stepfunctions-tasks-eks-call-integ/EksCluster/DefaultVpc/PublicSubnet3" + } + ] + } + }, + "EksClusterDefaultVpcPublicSubnet3NATGatewayC35C74D3": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "EksClusterDefaultVpcPublicSubnet3EIPF8D34EDE", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "EksClusterDefaultVpcPublicSubnet3SubnetA04EFFC1" + }, + "Tags": [ + { + "Key": "kubernetes.io/role/elb", + "Value": "1" + }, + { + "Key": "Name", + "Value": "aws-stepfunctions-tasks-eks-call-integ/EksCluster/DefaultVpc/PublicSubnet3" + } + ] + } + }, + "EksClusterDefaultVpcPrivateSubnet1Subnet4D665A2F": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "CidrBlock": "10.0.96.0/19", + "VpcId": { + "Ref": "EksClusterDefaultVpcB24550B2" + }, + "AvailabilityZone": "test-region-1a", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "kubernetes.io/role/internal-elb", + "Value": "1" + }, + { + "Key": "Name", + "Value": "aws-stepfunctions-tasks-eks-call-integ/EksCluster/DefaultVpc/PrivateSubnet1" + } + ] + } + }, + "EksClusterDefaultVpcPrivateSubnet1RouteTable9104CFAB": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "EksClusterDefaultVpcB24550B2" + }, + "Tags": [ + { + "Key": "kubernetes.io/role/internal-elb", + "Value": "1" + }, + { + "Key": "Name", + "Value": "aws-stepfunctions-tasks-eks-call-integ/EksCluster/DefaultVpc/PrivateSubnet1" + } + ] + } + }, + "EksClusterDefaultVpcPrivateSubnet1RouteTableAssociationCC31B65B": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "EksClusterDefaultVpcPrivateSubnet1RouteTable9104CFAB" + }, + "SubnetId": { + "Ref": "EksClusterDefaultVpcPrivateSubnet1Subnet4D665A2F" + } + } + }, + "EksClusterDefaultVpcPrivateSubnet1DefaultRoute790DE5CF": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "EksClusterDefaultVpcPrivateSubnet1RouteTable9104CFAB" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "EksClusterDefaultVpcPublicSubnet1NATGateway548C2CDF" + } + } + }, + "EksClusterDefaultVpcPrivateSubnet2Subnet180B8A71": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "CidrBlock": "10.0.128.0/19", + "VpcId": { + "Ref": "EksClusterDefaultVpcB24550B2" + }, + "AvailabilityZone": "test-region-1b", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "kubernetes.io/role/internal-elb", + "Value": "1" + }, + { + "Key": "Name", + "Value": "aws-stepfunctions-tasks-eks-call-integ/EksCluster/DefaultVpc/PrivateSubnet2" + } + ] + } + }, + "EksClusterDefaultVpcPrivateSubnet2RouteTable04B34031": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "EksClusterDefaultVpcB24550B2" + }, + "Tags": [ + { + "Key": "kubernetes.io/role/internal-elb", + "Value": "1" + }, + { + "Key": "Name", + "Value": "aws-stepfunctions-tasks-eks-call-integ/EksCluster/DefaultVpc/PrivateSubnet2" + } + ] + } + }, + "EksClusterDefaultVpcPrivateSubnet2RouteTableAssociation86243837": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "EksClusterDefaultVpcPrivateSubnet2RouteTable04B34031" + }, + "SubnetId": { + "Ref": "EksClusterDefaultVpcPrivateSubnet2Subnet180B8A71" + } + } + }, + "EksClusterDefaultVpcPrivateSubnet2DefaultRoute99A19B21": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "EksClusterDefaultVpcPrivateSubnet2RouteTable04B34031" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "EksClusterDefaultVpcPublicSubnet2NATGateway869DDCBF" + } + } + }, + "EksClusterDefaultVpcPrivateSubnet3Subnet6C4BFC07": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "CidrBlock": "10.0.160.0/19", + "VpcId": { + "Ref": "EksClusterDefaultVpcB24550B2" + }, + "AvailabilityZone": "test-region-1c", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "kubernetes.io/role/internal-elb", + "Value": "1" + }, + { + "Key": "Name", + "Value": "aws-stepfunctions-tasks-eks-call-integ/EksCluster/DefaultVpc/PrivateSubnet3" + } + ] + } + }, + "EksClusterDefaultVpcPrivateSubnet3RouteTableA8F449F1": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "EksClusterDefaultVpcB24550B2" + }, + "Tags": [ + { + "Key": "kubernetes.io/role/internal-elb", + "Value": "1" + }, + { + "Key": "Name", + "Value": "aws-stepfunctions-tasks-eks-call-integ/EksCluster/DefaultVpc/PrivateSubnet3" + } + ] + } + }, + "EksClusterDefaultVpcPrivateSubnet3RouteTableAssociationCE2741BE": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "EksClusterDefaultVpcPrivateSubnet3RouteTableA8F449F1" + }, + "SubnetId": { + "Ref": "EksClusterDefaultVpcPrivateSubnet3Subnet6C4BFC07" + } + } + }, + "EksClusterDefaultVpcPrivateSubnet3DefaultRouteDC2E9DE0": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "EksClusterDefaultVpcPrivateSubnet3RouteTableA8F449F1" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "EksClusterDefaultVpcPublicSubnet3NATGatewayC35C74D3" + } + } + }, + "EksClusterDefaultVpcIGWCA6A3220": { + "Type": "AWS::EC2::InternetGateway", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-stepfunctions-tasks-eks-call-integ/EksCluster/DefaultVpc" + } + ] + } + }, + "EksClusterDefaultVpcVPCGW0E4A5673": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "VpcId": { + "Ref": "EksClusterDefaultVpcB24550B2" + }, + "InternetGatewayId": { + "Ref": "EksClusterDefaultVpcIGWCA6A3220" + } + } + }, + "EksClusterRoleC84B376F": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "eks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/AmazonEKSClusterPolicy" + ] + ] + } + ] + } + }, + "EksClusterControlPlaneSecurityGroup9257A6D0": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "EKS Control Plane Security Group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": { + "Ref": "EksClusterDefaultVpcB24550B2" + } + } + }, + "EksClusterCreationRole75AABE42": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] + } + } + } + ], + "Version": "2012-10-17" + } + }, + "DependsOn": [ + "EksClusterDefaultVpcIGWCA6A3220", + "EksClusterDefaultVpcPrivateSubnet1DefaultRoute790DE5CF", + "EksClusterDefaultVpcPrivateSubnet1RouteTable9104CFAB", + "EksClusterDefaultVpcPrivateSubnet1RouteTableAssociationCC31B65B", + "EksClusterDefaultVpcPrivateSubnet1Subnet4D665A2F", + "EksClusterDefaultVpcPrivateSubnet2DefaultRoute99A19B21", + "EksClusterDefaultVpcPrivateSubnet2RouteTable04B34031", + "EksClusterDefaultVpcPrivateSubnet2RouteTableAssociation86243837", + "EksClusterDefaultVpcPrivateSubnet2Subnet180B8A71", + "EksClusterDefaultVpcPrivateSubnet3DefaultRouteDC2E9DE0", + "EksClusterDefaultVpcPrivateSubnet3RouteTableA8F449F1", + "EksClusterDefaultVpcPrivateSubnet3RouteTableAssociationCE2741BE", + "EksClusterDefaultVpcPrivateSubnet3Subnet6C4BFC07", + "EksClusterDefaultVpcPublicSubnet1DefaultRouteCE5F6EF3", + "EksClusterDefaultVpcPublicSubnet1EIPF53713C9", + "EksClusterDefaultVpcPublicSubnet1NATGateway548C2CDF", + "EksClusterDefaultVpcPublicSubnet1RouteTable163DE10A", + "EksClusterDefaultVpcPublicSubnet1RouteTableAssociation36D085C2", + "EksClusterDefaultVpcPublicSubnet1SubnetCB1D1047", + "EksClusterDefaultVpcPublicSubnet2DefaultRoute8B910E5C", + "EksClusterDefaultVpcPublicSubnet2EIP16D41D80", + "EksClusterDefaultVpcPublicSubnet2NATGateway869DDCBF", + "EksClusterDefaultVpcPublicSubnet2RouteTable1027E4DE", + "EksClusterDefaultVpcPublicSubnet2RouteTableAssociation39E2ABB3", + "EksClusterDefaultVpcPublicSubnet2SubnetA8FE675D", + "EksClusterDefaultVpcPublicSubnet3DefaultRoute1F5BE861", + "EksClusterDefaultVpcPublicSubnet3EIPF8D34EDE", + "EksClusterDefaultVpcPublicSubnet3NATGatewayC35C74D3", + "EksClusterDefaultVpcPublicSubnet3RouteTableEBB51B8A", + "EksClusterDefaultVpcPublicSubnet3RouteTableAssociationFE466321", + "EksClusterDefaultVpcPublicSubnet3SubnetA04EFFC1", + "EksClusterDefaultVpcB24550B2", + "EksClusterDefaultVpcVPCGW0E4A5673" + ] + }, + "EksClusterCreationRoleDefaultPolicy2DFE4D73": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "iam:PassRole", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "EksClusterRoleC84B376F", + "Arn" + ] + } + }, + { + "Action": [ + "eks:CreateCluster", + "eks:DescribeCluster", + "eks:DescribeUpdate", + "eks:DeleteCluster", + "eks:UpdateClusterVersion", + "eks:UpdateClusterConfig", + "eks:CreateFargateProfile", + "eks:TagResource", + "eks:UntagResource" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":eks:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":cluster/eksCluster" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":eks:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":cluster/eksCluster/*" + ] + ] + } + ] + }, + { + "Action": [ + "eks:DescribeFargateProfile", + "eks:DeleteFargateProfile" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":eks:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":fargateprofile/eksCluster/*" + ] + ] + } + }, + { + "Action": [ + "iam:GetRole", + "iam:listAttachedRolePolicies" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "iam:CreateServiceLinkedRole", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ec2:DescribeInstances", + "ec2:DescribeNetworkInterfaces", + "ec2:DescribeSecurityGroups", + "ec2:DescribeSubnets", + "ec2:DescribeRouteTables", + "ec2:DescribeDhcpOptions", + "ec2:DescribeVpcs" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "EksClusterCreationRoleDefaultPolicy2DFE4D73", + "Roles": [ + { + "Ref": "EksClusterCreationRole75AABE42" + } + ] + }, + "DependsOn": [ + "EksClusterDefaultVpcIGWCA6A3220", + "EksClusterDefaultVpcPrivateSubnet1DefaultRoute790DE5CF", + "EksClusterDefaultVpcPrivateSubnet1RouteTable9104CFAB", + "EksClusterDefaultVpcPrivateSubnet1RouteTableAssociationCC31B65B", + "EksClusterDefaultVpcPrivateSubnet1Subnet4D665A2F", + "EksClusterDefaultVpcPrivateSubnet2DefaultRoute99A19B21", + "EksClusterDefaultVpcPrivateSubnet2RouteTable04B34031", + "EksClusterDefaultVpcPrivateSubnet2RouteTableAssociation86243837", + "EksClusterDefaultVpcPrivateSubnet2Subnet180B8A71", + "EksClusterDefaultVpcPrivateSubnet3DefaultRouteDC2E9DE0", + "EksClusterDefaultVpcPrivateSubnet3RouteTableA8F449F1", + "EksClusterDefaultVpcPrivateSubnet3RouteTableAssociationCE2741BE", + "EksClusterDefaultVpcPrivateSubnet3Subnet6C4BFC07", + "EksClusterDefaultVpcPublicSubnet1DefaultRouteCE5F6EF3", + "EksClusterDefaultVpcPublicSubnet1EIPF53713C9", + "EksClusterDefaultVpcPublicSubnet1NATGateway548C2CDF", + "EksClusterDefaultVpcPublicSubnet1RouteTable163DE10A", + "EksClusterDefaultVpcPublicSubnet1RouteTableAssociation36D085C2", + "EksClusterDefaultVpcPublicSubnet1SubnetCB1D1047", + "EksClusterDefaultVpcPublicSubnet2DefaultRoute8B910E5C", + "EksClusterDefaultVpcPublicSubnet2EIP16D41D80", + "EksClusterDefaultVpcPublicSubnet2NATGateway869DDCBF", + "EksClusterDefaultVpcPublicSubnet2RouteTable1027E4DE", + "EksClusterDefaultVpcPublicSubnet2RouteTableAssociation39E2ABB3", + "EksClusterDefaultVpcPublicSubnet2SubnetA8FE675D", + "EksClusterDefaultVpcPublicSubnet3DefaultRoute1F5BE861", + "EksClusterDefaultVpcPublicSubnet3EIPF8D34EDE", + "EksClusterDefaultVpcPublicSubnet3NATGatewayC35C74D3", + "EksClusterDefaultVpcPublicSubnet3RouteTableEBB51B8A", + "EksClusterDefaultVpcPublicSubnet3RouteTableAssociationFE466321", + "EksClusterDefaultVpcPublicSubnet3SubnetA04EFFC1", + "EksClusterDefaultVpcB24550B2", + "EksClusterDefaultVpcVPCGW0E4A5673" + ] + }, + "EksClusterFAB68BDB": { + "Type": "Custom::AWSCDK-EKS-Cluster", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "awscdkawseksClusterResourceProviderNestedStackawscdkawseksClusterResourceProviderNestedStackResource9827C454", + "Outputs.awsstepfunctionstasksekscallintegawscdkawseksClusterResourceProviderframeworkonEvent5722A6A8Arn" + ] + }, + "Config": { + "name": "eksCluster", + "version": "1.18", + "roleArn": { + "Fn::GetAtt": [ + "EksClusterRoleC84B376F", + "Arn" + ] + }, + "resourcesVpcConfig": { + "subnetIds": [ + { + "Ref": "EksClusterDefaultVpcPublicSubnet1SubnetCB1D1047" + }, + { + "Ref": "EksClusterDefaultVpcPublicSubnet2SubnetA8FE675D" + }, + { + "Ref": "EksClusterDefaultVpcPublicSubnet3SubnetA04EFFC1" + }, + { + "Ref": "EksClusterDefaultVpcPrivateSubnet1Subnet4D665A2F" + }, + { + "Ref": "EksClusterDefaultVpcPrivateSubnet2Subnet180B8A71" + }, + { + "Ref": "EksClusterDefaultVpcPrivateSubnet3Subnet6C4BFC07" + } + ], + "securityGroupIds": [ + { + "Fn::GetAtt": [ + "EksClusterControlPlaneSecurityGroup9257A6D0", + "GroupId" + ] + } + ], + "endpointPublicAccess": true, + "endpointPrivateAccess": true + } + }, + "AssumeRoleArn": { + "Fn::GetAtt": [ + "EksClusterCreationRole75AABE42", + "Arn" + ] + }, + "AttributesRevision": 2 + }, + "DependsOn": [ + "EksClusterDefaultVpcIGWCA6A3220", + "EksClusterDefaultVpcPrivateSubnet1DefaultRoute790DE5CF", + "EksClusterDefaultVpcPrivateSubnet1RouteTable9104CFAB", + "EksClusterDefaultVpcPrivateSubnet1RouteTableAssociationCC31B65B", + "EksClusterDefaultVpcPrivateSubnet1Subnet4D665A2F", + "EksClusterDefaultVpcPrivateSubnet2DefaultRoute99A19B21", + "EksClusterDefaultVpcPrivateSubnet2RouteTable04B34031", + "EksClusterDefaultVpcPrivateSubnet2RouteTableAssociation86243837", + "EksClusterDefaultVpcPrivateSubnet2Subnet180B8A71", + "EksClusterDefaultVpcPrivateSubnet3DefaultRouteDC2E9DE0", + "EksClusterDefaultVpcPrivateSubnet3RouteTableA8F449F1", + "EksClusterDefaultVpcPrivateSubnet3RouteTableAssociationCE2741BE", + "EksClusterDefaultVpcPrivateSubnet3Subnet6C4BFC07", + "EksClusterDefaultVpcPublicSubnet1DefaultRouteCE5F6EF3", + "EksClusterDefaultVpcPublicSubnet1EIPF53713C9", + "EksClusterDefaultVpcPublicSubnet1NATGateway548C2CDF", + "EksClusterDefaultVpcPublicSubnet1RouteTable163DE10A", + "EksClusterDefaultVpcPublicSubnet1RouteTableAssociation36D085C2", + "EksClusterDefaultVpcPublicSubnet1SubnetCB1D1047", + "EksClusterDefaultVpcPublicSubnet2DefaultRoute8B910E5C", + "EksClusterDefaultVpcPublicSubnet2EIP16D41D80", + "EksClusterDefaultVpcPublicSubnet2NATGateway869DDCBF", + "EksClusterDefaultVpcPublicSubnet2RouteTable1027E4DE", + "EksClusterDefaultVpcPublicSubnet2RouteTableAssociation39E2ABB3", + "EksClusterDefaultVpcPublicSubnet2SubnetA8FE675D", + "EksClusterDefaultVpcPublicSubnet3DefaultRoute1F5BE861", + "EksClusterDefaultVpcPublicSubnet3EIPF8D34EDE", + "EksClusterDefaultVpcPublicSubnet3NATGatewayC35C74D3", + "EksClusterDefaultVpcPublicSubnet3RouteTableEBB51B8A", + "EksClusterDefaultVpcPublicSubnet3RouteTableAssociationFE466321", + "EksClusterDefaultVpcPublicSubnet3SubnetA04EFFC1", + "EksClusterDefaultVpcB24550B2", + "EksClusterDefaultVpcVPCGW0E4A5673", + "EksClusterCreationRoleDefaultPolicy2DFE4D73", + "EksClusterCreationRole75AABE42" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "EksClusterKubectlReadyBarrier502B0E83": { + "Type": "AWS::SSM::Parameter", + "Properties": { + "Type": "String", + "Value": "aws:cdk:eks:kubectl-ready" + }, + "DependsOn": [ + "EksClusterCreationRoleDefaultPolicy2DFE4D73", + "EksClusterCreationRole75AABE42", + "EksClusterFAB68BDB" + ] + }, + "EksClusterMastersRole3F49FAC3": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] + } + } + } + ], + "Version": "2012-10-17" + } + } + }, + "EksClusterAwsAuthmanifest4F460A9B": { + "Type": "Custom::AWSCDK-EKS-KubernetesResource", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B", + "Outputs.awsstepfunctionstasksekscallintegawscdkawseksKubectlProviderframeworkonEventAF076895Arn" + ] + }, + "Manifest": { + "Fn::Join": [ + "", + [ + "[{\"apiVersion\":\"v1\",\"kind\":\"ConfigMap\",\"metadata\":{\"name\":\"aws-auth\",\"namespace\":\"kube-system\",\"labels\":{\"aws.cdk.eks/prune-c8f58087a1a3e6c10f65d847befda9c1aa2145a8fc\":\"\"}},\"data\":{\"mapRoles\":\"[{\\\"rolearn\\\":\\\"", + { + "Fn::GetAtt": [ + "EksClusterMastersRole3F49FAC3", + "Arn" + ] + }, + "\\\",\\\"username\\\":\\\"", + { + "Fn::GetAtt": [ + "EksClusterMastersRole3F49FAC3", + "Arn" + ] + }, + "\\\",\\\"groups\\\":[\\\"system:masters\\\"]},{\\\"rolearn\\\":\\\"", + { + "Fn::GetAtt": [ + "EksClusterNodegroupDefaultCapacityNodeGroupRole70D09CEC", + "Arn" + ] + }, + "\\\",\\\"username\\\":\\\"system:node:{{EC2PrivateDNSName}}\\\",\\\"groups\\\":[\\\"system:bootstrappers\\\",\\\"system:nodes\\\"]},{\\\"rolearn\\\":\\\"", + { + "Fn::GetAtt": [ + "Role1ABCC5F0", + "Arn" + ] + }, + "\\\",\\\"username\\\":\\\"", + { + "Fn::GetAtt": [ + "Role1ABCC5F0", + "Arn" + ] + }, + "\\\",\\\"groups\\\":[\\\"system:masters\\\"]}]\",\"mapUsers\":\"[]\",\"mapAccounts\":\"[]\"}}]" + ] + ] + }, + "ClusterName": { + "Ref": "EksClusterFAB68BDB" + }, + "RoleArn": { + "Fn::GetAtt": [ + "EksClusterCreationRole75AABE42", + "Arn" + ] + }, + "PruneLabel": "aws.cdk.eks/prune-c8f58087a1a3e6c10f65d847befda9c1aa2145a8fc", + "Overwrite": true + }, + "DependsOn": [ + "EksClusterKubectlReadyBarrier502B0E83" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "EksClusterNodegroupDefaultCapacityNodeGroupRole70D09CEC": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": { + "Fn::Join": [ + "", + [ + "ec2.", + { + "Ref": "AWS::URLSuffix" + } + ] + ] + } + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/AmazonEKSWorkerNodePolicy" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/AmazonEKS_CNI_Policy" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/AmazonEC2ContainerRegistryReadOnly" + ] + ] + } + ] + } + }, + "EksClusterNodegroupDefaultCapacityA81E70F9": { + "Type": "AWS::EKS::Nodegroup", + "Properties": { + "ClusterName": { + "Ref": "EksClusterFAB68BDB" + }, + "NodeRole": { + "Fn::GetAtt": [ + "EksClusterNodegroupDefaultCapacityNodeGroupRole70D09CEC", + "Arn" + ] + }, + "Subnets": [ + { + "Ref": "EksClusterDefaultVpcPrivateSubnet1Subnet4D665A2F" + }, + { + "Ref": "EksClusterDefaultVpcPrivateSubnet2Subnet180B8A71" + }, + { + "Ref": "EksClusterDefaultVpcPrivateSubnet3Subnet6C4BFC07" + } + ], + "AmiType": "AL2_x86_64", + "ForceUpdateEnabled": true, + "InstanceTypes": [ + "m5.large" + ], + "ScalingConfig": { + "DesiredSize": 2, + "MaxSize": 2, + "MinSize": 2 + } + } + }, + "awscdkawseksClusterResourceProviderNestedStackawscdkawseksClusterResourceProviderNestedStackResource9827C454": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": { + "Fn::Join": [ + "", + [ + "https://s3.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "AssetParameters3aee2b76026cd725af3b14456bf03061e83d56cce0e0354c7c8e88ee1150e527S3Bucket7ED14FA7" + }, + "/", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "||", + { + "Ref": "AssetParameters3aee2b76026cd725af3b14456bf03061e83d56cce0e0354c7c8e88ee1150e527S3VersionKeyF4EF0775" + } + ] + } + ] + }, + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "||", + { + "Ref": "AssetParameters3aee2b76026cd725af3b14456bf03061e83d56cce0e0354c7c8e88ee1150e527S3VersionKeyF4EF0775" + } + ] + } + ] + } + ] + ] + }, + "Parameters": { + "referencetoawsstepfunctionstasksekscallintegEksClusterCreationRole00B486C4Arn": { + "Fn::GetAtt": [ + "EksClusterCreationRole75AABE42", + "Arn" + ] + }, + "referencetoawsstepfunctionstasksekscallintegAssetParameters87b1e2c41f84590d14f7ab8cb0f338c51d6fa3efe78943867af07fa959593dbaS3Bucket61AA45E5Ref": { + "Ref": "AssetParameters87b1e2c41f84590d14f7ab8cb0f338c51d6fa3efe78943867af07fa959593dbaS3Bucket14D204F9" + }, + "referencetoawsstepfunctionstasksekscallintegAssetParameters87b1e2c41f84590d14f7ab8cb0f338c51d6fa3efe78943867af07fa959593dbaS3VersionKey48ACDBCFRef": { + "Ref": "AssetParameters87b1e2c41f84590d14f7ab8cb0f338c51d6fa3efe78943867af07fa959593dbaS3VersionKeyDE8A2F1F" + }, + "referencetoawsstepfunctionstasksekscallintegAssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3BucketCF9FB24DRef": { + "Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3BucketDC4B98B1" + }, + "referencetoawsstepfunctionstasksekscallintegAssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3VersionKey4B465A75Ref": { + "Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3VersionKeyA495226F" + } + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": { + "Fn::Join": [ + "", + [ + "https://s3.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "AssetParameterscad1ae036643e3cd17cd3b2b30a2f9e07c1aacaf5284314f41437e4c20447aeaS3BucketED16A657" + }, + "/", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "||", + { + "Ref": "AssetParameterscad1ae036643e3cd17cd3b2b30a2f9e07c1aacaf5284314f41437e4c20447aeaS3VersionKey37A80BBF" + } + ] + } + ] + }, + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "||", + { + "Ref": "AssetParameterscad1ae036643e3cd17cd3b2b30a2f9e07c1aacaf5284314f41437e4c20447aeaS3VersionKey37A80BBF" + } + ] + } + ] + } + ] + ] + }, + "Parameters": { + "referencetoawsstepfunctionstasksekscallintegEksClusterCA674174Arn": { + "Fn::GetAtt": [ + "EksClusterFAB68BDB", + "Arn" + ] + }, + "referencetoawsstepfunctionstasksekscallintegEksClusterCreationRole00B486C4Arn": { + "Fn::GetAtt": [ + "EksClusterCreationRole75AABE42", + "Arn" + ] + }, + "referencetoawsstepfunctionstasksekscallintegAssetParametersbafd50ae9f214e496ff8c72c6425f93dca3ccd590e20963706d5d610d9c75757S3BucketB45933E2Ref": { + "Ref": "AssetParametersbafd50ae9f214e496ff8c72c6425f93dca3ccd590e20963706d5d610d9c75757S3Bucket008DBB35" + }, + "referencetoawsstepfunctionstasksekscallintegAssetParametersbafd50ae9f214e496ff8c72c6425f93dca3ccd590e20963706d5d610d9c75757S3VersionKey897E2F88Ref": { + "Ref": "AssetParametersbafd50ae9f214e496ff8c72c6425f93dca3ccd590e20963706d5d610d9c75757S3VersionKey97C3E1A0" + }, + "referencetoawsstepfunctionstasksekscallintegEksClusterDefaultVpcPrivateSubnet1Subnet3A6964EARef": { + "Ref": "EksClusterDefaultVpcPrivateSubnet1Subnet4D665A2F" + }, + "referencetoawsstepfunctionstasksekscallintegEksClusterDefaultVpcPrivateSubnet2Subnet08905A58Ref": { + "Ref": "EksClusterDefaultVpcPrivateSubnet2Subnet180B8A71" + }, + "referencetoawsstepfunctionstasksekscallintegEksClusterDefaultVpcPrivateSubnet3SubnetF3A2081ERef": { + "Ref": "EksClusterDefaultVpcPrivateSubnet3Subnet6C4BFC07" + }, + "referencetoawsstepfunctionstasksekscallintegEksClusterCA674174ClusterSecurityGroupId": { + "Fn::GetAtt": [ + "EksClusterFAB68BDB", + "ClusterSecurityGroupId" + ] + }, + "referencetoawsstepfunctionstasksekscallintegAssetParameterse9882ab123687399f934da0d45effe675ecc8ce13b40cb946f3e1d6141fe8d68S3Bucket3F56B6C0Ref": { + "Ref": "AssetParameterse9882ab123687399f934da0d45effe675ecc8ce13b40cb946f3e1d6141fe8d68S3BucketAEADE8C7" + }, + "referencetoawsstepfunctionstasksekscallintegAssetParameterse9882ab123687399f934da0d45effe675ecc8ce13b40cb946f3e1d6141fe8d68S3VersionKey14F73D88Ref": { + "Ref": "AssetParameterse9882ab123687399f934da0d45effe675ecc8ce13b40cb946f3e1d6141fe8d68S3VersionKeyE415415F" + }, + "referencetoawsstepfunctionstasksekscallintegAssetParameters844c1a4b13479b359ea0e607dccb4a04b73e22cf88cf9b64feed2c5f0de213c0S3Bucket82DB0998Ref": { + "Ref": "AssetParameters844c1a4b13479b359ea0e607dccb4a04b73e22cf88cf9b64feed2c5f0de213c0S3Bucket6ABE1927" + }, + "referencetoawsstepfunctionstasksekscallintegAssetParameters844c1a4b13479b359ea0e607dccb4a04b73e22cf88cf9b64feed2c5f0de213c0S3VersionKey5CB2DA63Ref": { + "Ref": "AssetParameters844c1a4b13479b359ea0e607dccb4a04b73e22cf88cf9b64feed2c5f0de213c0S3VersionKeyF55A2EA9" + }, + "referencetoawsstepfunctionstasksekscallintegAssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3BucketCF9FB24DRef": { + "Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3BucketDC4B98B1" + }, + "referencetoawsstepfunctionstasksekscallintegAssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3VersionKey4B465A75Ref": { + "Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3VersionKeyA495226F" + } + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "Role1ABCC5F0": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": { + "Fn::Join": [ + "", + [ + "states.", + { + "Ref": "AWS::Region" + }, + ".amazonaws.com" + ] + ] + } + } + } + ], + "Version": "2012-10-17" + }, + "RoleName": "stateMachineExecutionRole" + } + }, + "StateMachine2E01A3A5": { + "Type": "AWS::StepFunctions::StateMachine", + "Properties": { + "RoleArn": { + "Fn::GetAtt": [ + "Role1ABCC5F0", + "Arn" + ] + }, + "DefinitionString": { + "Fn::Join": [ + "", + [ + "{\"StartAt\":\"Call a EKS Endpoint\",\"States\":{\"Call a EKS Endpoint\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::eks:call\",\"Parameters\":{\"ClusterName\":\"", + { + "Ref": "EksClusterFAB68BDB" + }, + "\",\"CertificateAuthority\":\"", + { + "Fn::GetAtt": [ + "EksClusterFAB68BDB", + "CertificateAuthorityData" + ] + }, + "\",\"Endpoint\":\"", + { + "Fn::GetAtt": [ + "EksClusterFAB68BDB", + "Endpoint" + ] + }, + "\",\"Method\":\"GET\",\"Path\":\"/api/v1/namespaces/default/pods\"}}},\"TimeoutSeconds\":30}" + ] + ] + } + }, + "DependsOn": [ + "Role1ABCC5F0" + ] + } + }, + "Outputs": { + "EksClusterConfigCommand2AE6ED67": { + "Value": { + "Fn::Join": [ + "", + [ + "aws eks update-kubeconfig --name ", + { + "Ref": "EksClusterFAB68BDB" + }, + " --region ", + { + "Ref": "AWS::Region" + }, + " --role-arn ", + { + "Fn::GetAtt": [ + "EksClusterMastersRole3F49FAC3", + "Arn" + ] + } + ] + ] + } + }, + "EksClusterGetTokenCommandDF0BEDB9": { + "Value": { + "Fn::Join": [ + "", + [ + "aws eks get-token --cluster-name ", + { + "Ref": "EksClusterFAB68BDB" + }, + " --region ", + { + "Ref": "AWS::Region" + }, + " --role-arn ", + { + "Fn::GetAtt": [ + "EksClusterMastersRole3F49FAC3", + "Arn" + ] + } + ] + ] + } + }, + "stateMachineArn": { + "Value": { + "Ref": "StateMachine2E01A3A5" + } + } + }, + "Parameters": { + "AssetParameters87b1e2c41f84590d14f7ab8cb0f338c51d6fa3efe78943867af07fa959593dbaS3Bucket14D204F9": { + "Type": "String", + "Description": "S3 bucket for asset \"87b1e2c41f84590d14f7ab8cb0f338c51d6fa3efe78943867af07fa959593dba\"" + }, + "AssetParameters87b1e2c41f84590d14f7ab8cb0f338c51d6fa3efe78943867af07fa959593dbaS3VersionKeyDE8A2F1F": { + "Type": "String", + "Description": "S3 key for asset version \"87b1e2c41f84590d14f7ab8cb0f338c51d6fa3efe78943867af07fa959593dba\"" + }, + "AssetParameters87b1e2c41f84590d14f7ab8cb0f338c51d6fa3efe78943867af07fa959593dbaArtifactHash54822A43": { + "Type": "String", + "Description": "Artifact hash for asset \"87b1e2c41f84590d14f7ab8cb0f338c51d6fa3efe78943867af07fa959593dba\"" + }, + "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3BucketDC4B98B1": { + "Type": "String", + "Description": "S3 bucket for asset \"daeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1\"" + }, + "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3VersionKeyA495226F": { + "Type": "String", + "Description": "S3 key for asset version \"daeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1\"" + }, + "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1ArtifactHashA521A16F": { + "Type": "String", + "Description": "Artifact hash for asset \"daeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1\"" + }, + "AssetParametersbafd50ae9f214e496ff8c72c6425f93dca3ccd590e20963706d5d610d9c75757S3Bucket008DBB35": { + "Type": "String", + "Description": "S3 bucket for asset \"bafd50ae9f214e496ff8c72c6425f93dca3ccd590e20963706d5d610d9c75757\"" + }, + "AssetParametersbafd50ae9f214e496ff8c72c6425f93dca3ccd590e20963706d5d610d9c75757S3VersionKey97C3E1A0": { + "Type": "String", + "Description": "S3 key for asset version \"bafd50ae9f214e496ff8c72c6425f93dca3ccd590e20963706d5d610d9c75757\"" + }, + "AssetParametersbafd50ae9f214e496ff8c72c6425f93dca3ccd590e20963706d5d610d9c75757ArtifactHashF584A7D8": { + "Type": "String", + "Description": "Artifact hash for asset \"bafd50ae9f214e496ff8c72c6425f93dca3ccd590e20963706d5d610d9c75757\"" + }, + "AssetParameterse9882ab123687399f934da0d45effe675ecc8ce13b40cb946f3e1d6141fe8d68S3BucketAEADE8C7": { + "Type": "String", + "Description": "S3 bucket for asset \"e9882ab123687399f934da0d45effe675ecc8ce13b40cb946f3e1d6141fe8d68\"" + }, + "AssetParameterse9882ab123687399f934da0d45effe675ecc8ce13b40cb946f3e1d6141fe8d68S3VersionKeyE415415F": { + "Type": "String", + "Description": "S3 key for asset version \"e9882ab123687399f934da0d45effe675ecc8ce13b40cb946f3e1d6141fe8d68\"" + }, + "AssetParameterse9882ab123687399f934da0d45effe675ecc8ce13b40cb946f3e1d6141fe8d68ArtifactHashD9A515C3": { + "Type": "String", + "Description": "Artifact hash for asset \"e9882ab123687399f934da0d45effe675ecc8ce13b40cb946f3e1d6141fe8d68\"" + }, + "AssetParameters844c1a4b13479b359ea0e607dccb4a04b73e22cf88cf9b64feed2c5f0de213c0S3Bucket6ABE1927": { + "Type": "String", + "Description": "S3 bucket for asset \"844c1a4b13479b359ea0e607dccb4a04b73e22cf88cf9b64feed2c5f0de213c0\"" + }, + "AssetParameters844c1a4b13479b359ea0e607dccb4a04b73e22cf88cf9b64feed2c5f0de213c0S3VersionKeyF55A2EA9": { + "Type": "String", + "Description": "S3 key for asset version \"844c1a4b13479b359ea0e607dccb4a04b73e22cf88cf9b64feed2c5f0de213c0\"" + }, + "AssetParameters844c1a4b13479b359ea0e607dccb4a04b73e22cf88cf9b64feed2c5f0de213c0ArtifactHash1D7A2D6E": { + "Type": "String", + "Description": "Artifact hash for asset \"844c1a4b13479b359ea0e607dccb4a04b73e22cf88cf9b64feed2c5f0de213c0\"" + }, + "AssetParameters3aee2b76026cd725af3b14456bf03061e83d56cce0e0354c7c8e88ee1150e527S3Bucket7ED14FA7": { + "Type": "String", + "Description": "S3 bucket for asset \"3aee2b76026cd725af3b14456bf03061e83d56cce0e0354c7c8e88ee1150e527\"" + }, + "AssetParameters3aee2b76026cd725af3b14456bf03061e83d56cce0e0354c7c8e88ee1150e527S3VersionKeyF4EF0775": { + "Type": "String", + "Description": "S3 key for asset version \"3aee2b76026cd725af3b14456bf03061e83d56cce0e0354c7c8e88ee1150e527\"" + }, + "AssetParameters3aee2b76026cd725af3b14456bf03061e83d56cce0e0354c7c8e88ee1150e527ArtifactHash94EFED5E": { + "Type": "String", + "Description": "Artifact hash for asset \"3aee2b76026cd725af3b14456bf03061e83d56cce0e0354c7c8e88ee1150e527\"" + }, + "AssetParameterscad1ae036643e3cd17cd3b2b30a2f9e07c1aacaf5284314f41437e4c20447aeaS3BucketED16A657": { + "Type": "String", + "Description": "S3 bucket for asset \"cad1ae036643e3cd17cd3b2b30a2f9e07c1aacaf5284314f41437e4c20447aea\"" + }, + "AssetParameterscad1ae036643e3cd17cd3b2b30a2f9e07c1aacaf5284314f41437e4c20447aeaS3VersionKey37A80BBF": { + "Type": "String", + "Description": "S3 key for asset version \"cad1ae036643e3cd17cd3b2b30a2f9e07c1aacaf5284314f41437e4c20447aea\"" + }, + "AssetParameterscad1ae036643e3cd17cd3b2b30a2f9e07c1aacaf5284314f41437e4c20447aeaArtifactHash11CEC9E5": { + "Type": "String", + "Description": "Artifact hash for asset \"cad1ae036643e3cd17cd3b2b30a2f9e07c1aacaf5284314f41437e4c20447aea\"" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/eks/integ.call.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/test/eks/integ.call.ts new file mode 100644 index 0000000000000..7a3f0b70c8e9d --- /dev/null +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/eks/integ.call.ts @@ -0,0 +1,52 @@ +import * as eks from '@aws-cdk/aws-eks'; +import * as iam from '@aws-cdk/aws-iam'; +import * as sfn from '@aws-cdk/aws-stepfunctions'; +import * as cdk from '@aws-cdk/core'; +import { EksCall, HttpMethods } from '../../lib'; + +/* + * Create a state machine with a task state to use the Kubernetes API to read Kubernetes resource objects + * via a Kubernetes API endpoint. + * + * Stack verification steps: + * The generated State Machine can be executed from the CLI (or Step Functions console) + * and runs with an execution status of `Succeeded`. + * + * -- aws stepfunctions start-execution --state-machine-arn provides execution arn + * -- aws stepfunctions describe-execution --execution-arn returns a status of `Succeeded` + */ + +const app = new cdk.App(); +const stack = new cdk.Stack(app, 'aws-stepfunctions-tasks-eks-call-integ'); + +const cluster = new eks.Cluster(stack, 'EksCluster', { + version: eks.KubernetesVersion.V1_18, + clusterName: 'eksCluster', +}); + +const executionRole = new iam.Role(stack, 'Role', { + roleName: 'stateMachineExecutionRole', + assumedBy: new iam.ServicePrincipal('states.amazonaws.com'), +}); + +cluster.awsAuth.addMastersRole(executionRole); + +const callJob = new EksCall(stack, 'Call a EKS Endpoint', { + cluster: cluster, + httpMethod: HttpMethods.GET, + httpPath: '/api/v1/namespaces/default/pods', +}); + +const chain = sfn.Chain.start(callJob); + +const sm = new sfn.StateMachine(stack, 'StateMachine', { + definition: chain, + role: executionRole, + timeout: cdk.Duration.seconds(30), +}); + +new cdk.CfnOutput(stack, 'stateMachineArn', { + value: sm.stateMachineArn, +}); + +app.synth(); diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/sagemaker/integ.call-sagemaker.expected.json b/packages/@aws-cdk/aws-stepfunctions-tasks/test/sagemaker/integ.call-sagemaker.expected.json index 699a2ff2d686b..1e8f55ca57056 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/sagemaker/integ.call-sagemaker.expected.json +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/sagemaker/integ.call-sagemaker.expected.json @@ -147,7 +147,7 @@ { "Action": [ "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/sagemaker/integ.create-training-job.expected.json b/packages/@aws-cdk/aws-stepfunctions-tasks/test/sagemaker/integ.create-training-job.expected.json index 5b60bc0b1e500..209c5520c1c64 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/sagemaker/integ.create-training-job.expected.json +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/sagemaker/integ.create-training-job.expected.json @@ -147,7 +147,7 @@ { "Action": [ "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/sns/integ.publish.expected.json b/packages/@aws-cdk/aws-stepfunctions-tasks/test/sns/integ.publish.expected.json index bf407af2694d8..e5ac1d8ff84a7 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/sns/integ.publish.expected.json +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/sns/integ.publish.expected.json @@ -4,7 +4,9 @@ "Type": "AWS::SNS::Topic" }, "showmethemessages8D16BBDB": { - "Type": "AWS::SQS::Queue" + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "showmethemessagesPolicyB08B04B0": { "Type": "AWS::SQS::QueuePolicy", @@ -110,6 +112,12 @@ "StateMachine2E01A3A5": { "Type": "AWS::StepFunctions::StateMachine", "Properties": { + "RoleArn": { + "Fn::GetAtt": [ + "StateMachineRoleB840431D", + "Arn" + ] + }, "DefinitionString": { "Fn::Join": [ "", @@ -125,12 +133,6 @@ "\",\"Message\":\"sending message over\"}},\"Final step\":{\"Type\":\"Pass\",\"End\":true}},\"TimeoutSeconds\":30}" ] ] - }, - "RoleArn": { - "Fn::GetAtt": [ - "StateMachineRoleB840431D", - "Arn" - ] } }, "DependsOn": [ diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/sqs/integ.send-message.expected.json b/packages/@aws-cdk/aws-stepfunctions-tasks/test/sqs/integ.send-message.expected.json index 7465187d65c20..5d13c58fc0a5b 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/sqs/integ.send-message.expected.json +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/sqs/integ.send-message.expected.json @@ -1,7 +1,9 @@ { "Resources": { "showmethemessages8D16BBDB": { - "Type": "AWS::SQS::Queue" + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "StateMachineRoleB840431D": { "Type": "AWS::IAM::Role", @@ -60,6 +62,12 @@ "StateMachine2E01A3A5": { "Type": "AWS::StepFunctions::StateMachine", "Properties": { + "RoleArn": { + "Fn::GetAtt": [ + "StateMachineRoleB840431D", + "Arn" + ] + }, "DefinitionString": { "Fn::Join": [ "", @@ -75,12 +83,6 @@ "\",\"MessageBody\":\"sending message over\"}},\"Final step\":{\"Type\":\"Pass\",\"End\":true}},\"TimeoutSeconds\":30}" ] ] - }, - "RoleArn": { - "Fn::GetAtt": [ - "StateMachineRoleB840431D", - "Arn" - ] } }, "DependsOn": [ diff --git a/packages/@aws-cdk/aws-synthetics/README.md b/packages/@aws-cdk/aws-synthetics/README.md index fd2310ecaacf3..80a6defd34848 100644 --- a/packages/@aws-cdk/aws-synthetics/README.md +++ b/packages/@aws-cdk/aws-synthetics/README.md @@ -44,7 +44,7 @@ const canary = new synthetics.Canary(this, 'MyCanary', { code: synthetics.Code.fromAsset(path.join(__dirname, 'canary')), handler: 'index.handler', }), - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_2_2, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_0, }); ``` @@ -107,7 +107,7 @@ const canary = new Canary(this, 'MyCanary', { code: synthetics.Code.fromInline('/* Synthetics handler code */'), handler: 'index.handler', // must be 'index.handler' }), - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_2_2, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_0, }); // To supply the code from your local filesystem: @@ -116,7 +116,7 @@ const canary = new Canary(this, 'MyCanary', { code: synthetics.Code.fromAsset(path.join(__dirname, 'canary')), handler: 'index.handler', // must end with '.handler' }), - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_2_2, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_0, }); // To supply the code from a S3 bucket: @@ -125,7 +125,7 @@ const canary = new Canary(this, 'MyCanary', { code: synthetics.Code.fromBucket(bucket, 'canary.zip'), handler: 'index.handler', // must end with '.handler' }), - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_2_2, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_0, }); ``` diff --git a/packages/@aws-cdk/aws-synthetics/lib/canary.ts b/packages/@aws-cdk/aws-synthetics/lib/canary.ts index 7e6d6c8b53b0f..72d4b311ce6e3 100644 --- a/packages/@aws-cdk/aws-synthetics/lib/canary.ts +++ b/packages/@aws-cdk/aws-synthetics/lib/canary.ts @@ -112,6 +112,16 @@ export class Runtime { */ public static readonly SYNTHETICS_NODEJS_2_2 = new Runtime('syn-nodejs-2.2'); + /** + * `syn-nodejs-puppeteer-3.0` includes the following: + * - Lambda runtime Node.js 12.x + * - Puppeteer-core version 5.5.0 + * - Chromium version 88.0.4298.0 + * + * @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Library_nodejs_puppeteer.html#CloudWatch_Synthetics_runtimeversion-nodejs-puppeteer-3.0 + */ + public static readonly SYNTHETICS_NODEJS_PUPPETEER_3_0 = new Runtime('syn-nodejs-puppeteer-3.0'); + /** * @param name The name of the runtime version */ diff --git a/packages/@aws-cdk/aws-synthetics/test/canary.test.ts b/packages/@aws-cdk/aws-synthetics/test/canary.test.ts index d4a505e3a492b..bb5e479e7f7e9 100644 --- a/packages/@aws-cdk/aws-synthetics/test/canary.test.ts +++ b/packages/@aws-cdk/aws-synthetics/test/canary.test.ts @@ -44,7 +44,7 @@ test('Canary can have generated name', () => { handler: 'index.handler', code: synthetics.Code.fromInline('/* Synthetics handler code */'), }), - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_2_0, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_0, }); // THEN @@ -355,4 +355,4 @@ test('can specify custom test', () => { };`, }, }); -}); +}); \ No newline at end of file diff --git a/packages/@aws-cdk/cfnspec/CHANGELOG.md b/packages/@aws-cdk/cfnspec/CHANGELOG.md index d8ca8b54af678..abcd6fa61a9c9 100644 --- a/packages/@aws-cdk/cfnspec/CHANGELOG.md +++ b/packages/@aws-cdk/cfnspec/CHANGELOG.md @@ -1,3 +1,83 @@ +# CloudFormation Resource Specification v28.0.0 + +## New Resource Types + +* AWS::CloudFormation::ResourceDefaultVersion +* AWS::CloudFormation::ResourceVersion +* AWS::EC2::TransitGatewayMulticastDomain +* AWS::EC2::TransitGatewayMulticastDomainAssociation +* AWS::EC2::TransitGatewayMulticastGroupMember +* AWS::EC2::TransitGatewayMulticastGroupSource +* AWS::SageMaker::App +* AWS::SageMaker::AppImageConfig +* AWS::SageMaker::Domain +* AWS::SageMaker::UserProfile +* AWS::ServiceCatalog::ServiceAction +* AWS::ServiceCatalog::ServiceActionAssociation + +## Attribute Changes + +* AWS::ApiGateway::ApiKey APIKeyId (__added__) + +## Property Changes + +* AWS::DMS::Endpoint DocDbSettings (__added__) +* AWS::DMS::Endpoint IbmDb2Settings (__added__) +* AWS::DMS::Endpoint MicrosoftSqlServerSettings (__added__) +* AWS::DMS::Endpoint MySqlSettings (__added__) +* AWS::DMS::Endpoint OracleSettings (__added__) +* AWS::DMS::Endpoint PostgreSqlSettings (__added__) +* AWS::DMS::Endpoint RedshiftSettings (__added__) +* AWS::DMS::Endpoint SybaseSettings (__added__) +* AWS::ECS::Cluster Configuration (__deleted__) +* AWS::ECS::Service EnableExecuteCommand (__deleted__) +* AWS::ManagedBlockchain::Node MemberId.Required (__changed__) + * Old: true + * New: false +* AWS::MediaLive::Channel Vpc (__added__) + +## Property Type Changes + +* AWS::ECS::Cluster.ClusterConfiguration (__removed__) +* AWS::ECS::Cluster.ExecuteCommandConfiguration (__removed__) +* AWS::ECS::Cluster.ExecuteCommandLogConfiguration (__removed__) +* AWS::AppMesh::VirtualGateway.SubjectAlternativeNameMatchers (__added__) +* AWS::AppMesh::VirtualGateway.SubjectAlternativeNames (__added__) +* AWS::AppMesh::VirtualGateway.VirtualGatewayClientTlsCertificate (__added__) +* AWS::AppMesh::VirtualGateway.VirtualGatewayListenerTlsSdsCertificate (__added__) +* AWS::AppMesh::VirtualGateway.VirtualGatewayListenerTlsValidationContext (__added__) +* AWS::AppMesh::VirtualGateway.VirtualGatewayListenerTlsValidationContextTrust (__added__) +* AWS::AppMesh::VirtualGateway.VirtualGatewayTlsValidationContextSdsTrust (__added__) +* AWS::AppMesh::VirtualNode.ClientTlsCertificate (__added__) +* AWS::AppMesh::VirtualNode.ListenerTlsSdsCertificate (__added__) +* AWS::AppMesh::VirtualNode.ListenerTlsValidationContext (__added__) +* AWS::AppMesh::VirtualNode.ListenerTlsValidationContextTrust (__added__) +* AWS::AppMesh::VirtualNode.SubjectAlternativeNameMatchers (__added__) +* AWS::AppMesh::VirtualNode.SubjectAlternativeNames (__added__) +* AWS::AppMesh::VirtualNode.TlsValidationContextSdsTrust (__added__) +* AWS::DMS::Endpoint.DocDbSettings (__added__) +* AWS::DMS::Endpoint.IbmDb2Settings (__added__) +* AWS::DMS::Endpoint.MicrosoftSqlServerSettings (__added__) +* AWS::DMS::Endpoint.MySqlSettings (__added__) +* AWS::DMS::Endpoint.OracleSettings (__added__) +* AWS::DMS::Endpoint.PostgreSqlSettings (__added__) +* AWS::DMS::Endpoint.RedshiftSettings (__added__) +* AWS::DMS::Endpoint.SybaseSettings (__added__) +* AWS::MediaLive::Channel.VpcOutputSettings (__added__) +* AWS::AppMesh::VirtualGateway.VirtualGatewayClientPolicyTls Certificate (__added__) +* AWS::AppMesh::VirtualGateway.VirtualGatewayListenerTls Validation (__added__) +* AWS::AppMesh::VirtualGateway.VirtualGatewayListenerTlsCertificate SDS (__added__) +* AWS::AppMesh::VirtualGateway.VirtualGatewayTlsValidationContext SubjectAlternativeNames (__added__) +* AWS::AppMesh::VirtualGateway.VirtualGatewayTlsValidationContextTrust SDS (__added__) +* AWS::AppMesh::VirtualNode.ClientPolicyTls Certificate (__added__) +* AWS::AppMesh::VirtualNode.ListenerTls Validation (__added__) +* AWS::AppMesh::VirtualNode.ListenerTlsCertificate SDS (__added__) +* AWS::AppMesh::VirtualNode.TlsValidationContext SubjectAlternativeNames (__added__) +* AWS::AppMesh::VirtualNode.TlsValidationContextTrust SDS (__added__) +* AWS::DMS::Endpoint.MongoDbSettings SecretsManagerAccessRoleArn (__added__) +* AWS::DMS::Endpoint.MongoDbSettings SecretsManagerSecretId (__added__) + + # CloudFormation Resource Specification v27.0.0 ## New Resource Types diff --git a/packages/@aws-cdk/cfnspec/build-tools/build.ts b/packages/@aws-cdk/cfnspec/build-tools/build.ts index 913605461e224..a96688ecc36f1 100644 --- a/packages/@aws-cdk/cfnspec/build-tools/build.ts +++ b/packages/@aws-cdk/cfnspec/build-tools/build.ts @@ -13,8 +13,19 @@ import { decorateResourceTypes, forEachSection, massageSpec, merge, normalize, p async function main() { const inputDir = path.join(process.cwd(), 'spec-source'); - const files = await fs.readdir(inputDir); + const outDir = path.join(process.cwd(), 'spec'); + + await generateResourceSpecification(inputDir, path.join(outDir, 'specification.json')); + await mergeSpecificationFromDirs(path.join(inputDir, 'cfn-lint'), path.join(outDir, 'cfn-lint.json')); +} + +/** + * Generate CloudFormation resource specification from sources and patches + */ +async function generateResourceSpecification(inputDir: string, outFile: string) { const spec: schema.Specification = { PropertyTypes: {}, ResourceTypes: {}, Fingerprint: '' }; + + const files = await fs.readdir(inputDir); for (const file of files.filter(n => n.endsWith('.json')).sort()) { const data = await fs.readJson(path.join(inputDir, file)); if (file.indexOf('patch') === -1) { @@ -29,9 +40,49 @@ async function main() { spec.Fingerprint = md5(JSON.stringify(normalize(spec))); - const outDir = path.join(process.cwd(), 'spec'); - await fs.mkdirp(outDir); - await fs.writeJson(path.join(outDir, 'specification.json'), spec, { spaces: 2 }); + await fs.mkdirp(path.dirname(outFile)); + await fs.writeJson(outFile, spec, { spaces: 2 }); +} + +/** + * Generate Cfnlint spec annotations from sources and patches + */ +async function mergeSpecificationFromDirs(inputDir: string, outFile: string) { + const spec: any = {}; + + for (const child of await fs.readdir(inputDir)) { + const fullPath = path.join(inputDir, child); + if (!(await fs.stat(fullPath)).isDirectory()) { continue; } + + const subspec = await loadMergedSpec(fullPath); + spec[child] = subspec; + } + + await fs.mkdirp(path.dirname(outFile)); + await fs.writeJson(outFile, spec, { spaces: 2 }); +} + +/** + * Load all files in the given directory, merge them and apply patches in the order found + * + * The base structure is always an empty object + */ +async function loadMergedSpec(inputDir: string) { + const structure: any = {}; + + const files = await fs.readdir(inputDir); + for (const file of files.filter(n => n.endsWith('.json')).sort()) { + const data = await fs.readJson(path.join(inputDir, file)); + if (file.indexOf('patch') === -1) { + // Copy properties from current object into structure, adding/overwriting whatever is found + Object.assign(structure, data); + } else { + // Apply the loaded file as a patch onto the current structure + patch(structure, data); + } + } + + return structure; } main() diff --git a/packages/@aws-cdk/cfnspec/build-tools/update-cfnlint.sh b/packages/@aws-cdk/cfnspec/build-tools/update-cfnlint.sh new file mode 100755 index 0000000000000..594e7dd165b87 --- /dev/null +++ b/packages/@aws-cdk/cfnspec/build-tools/update-cfnlint.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -euo pipefail +scriptdir=$(cd $(dirname $0) && pwd) + +# Download (parts of) the cfn-lint repo that we use to enhance our model +intermediate="$(mktemp -d)/tmp.zip" + +url="https://github.com/aws-cloudformation/cfn-python-lint/archive/master.zip" +echo >&2 "Downloading from ${url}..." +curl -sSfL "${url}" -o ${intermediate} + +for file in StatefulResources; do + echo >&2 "${file}.json" + mkdir -p "spec-source/cfn-lint/${file}" + unzip -p "${intermediate}" cfn-python-lint-master/src/cfnlint/data/AdditionalSpecs/${file}.json > spec-source/cfn-lint/${file}/000.json +done + +echo >&2 "Done." diff --git a/packages/@aws-cdk/cfnspec/cfn.version b/packages/@aws-cdk/cfnspec/cfn.version index 008c39a438806..0b4dfcf095f29 100644 --- a/packages/@aws-cdk/cfnspec/cfn.version +++ b/packages/@aws-cdk/cfnspec/cfn.version @@ -1 +1 @@ -27.0.0 +28.0.0 diff --git a/packages/@aws-cdk/cfnspec/lib/_private_schema/cfn-lint.ts b/packages/@aws-cdk/cfnspec/lib/_private_schema/cfn-lint.ts new file mode 100644 index 0000000000000..4c11394888ec4 --- /dev/null +++ b/packages/@aws-cdk/cfnspec/lib/_private_schema/cfn-lint.ts @@ -0,0 +1,23 @@ +/** + * All annotations imported from cfn-lint + */ +export interface CfnLintFileSchema { + /** + * Resource types that are in this map are stateful + * + * There is more information in the structure this maps to. + */ + readonly StatefulResources: { readonly ResourceTypes: Record }; +} + +/** + * Extra information on stateful resource types + */ +export interface CfnLintStatefulSchema { + /** + * Whether or not a Delete operation requires the resource to be empty + * + * @default false + */ + readonly DeleteRequiresEmptyResource?: boolean; +} diff --git a/packages/@aws-cdk/cfnspec/lib/index.ts b/packages/@aws-cdk/cfnspec/lib/index.ts index 8584e6877ed62..6ab020d9580cc 100644 --- a/packages/@aws-cdk/cfnspec/lib/index.ts +++ b/packages/@aws-cdk/cfnspec/lib/index.ts @@ -1,4 +1,5 @@ import * as crypto from 'crypto'; +import { CfnLintFileSchema } from './_private_schema/cfn-lint'; import * as schema from './schema'; export { schema }; export * from './canned-metrics'; @@ -38,6 +39,19 @@ export function resourceAugmentation(typeName: string): schema.ResourceAugmentat } } +/** + * Get the resource augmentations for a given type + */ +export function cfnLintAnnotations(typeName: string): schema.CfnLintResourceAnnotations { + // eslint-disable-next-line @typescript-eslint/no-require-imports + const allAnnotations: CfnLintFileSchema = require('../spec/cfn-lint.json'); + + return { + stateful: !!allAnnotations.StatefulResources.ResourceTypes[typeName], + mustBeEmptyToDelete: allAnnotations.StatefulResources.ResourceTypes[typeName]?.DeleteRequiresEmptyResource ?? false, + }; +} + /** * Return the property specification for the given resource's property */ diff --git a/packages/@aws-cdk/cfnspec/lib/schema/cfn-lint.ts b/packages/@aws-cdk/cfnspec/lib/schema/cfn-lint.ts new file mode 100644 index 0000000000000..204892f173a95 --- /dev/null +++ b/packages/@aws-cdk/cfnspec/lib/schema/cfn-lint.ts @@ -0,0 +1,14 @@ +/** + * Additional resource information obtained from cfn-lint + */ +export interface CfnLintResourceAnnotations { + /** + * Whether or not the given resource is stateful + */ + readonly stateful: boolean; + + /** + * Whether or not a Delete operation requires the resource to be empty + */ + readonly mustBeEmptyToDelete: boolean; +} \ No newline at end of file diff --git a/packages/@aws-cdk/cfnspec/lib/schema/index.ts b/packages/@aws-cdk/cfnspec/lib/schema/index.ts index 250e5cc1edd96..e4f8720f79e82 100644 --- a/packages/@aws-cdk/cfnspec/lib/schema/index.ts +++ b/packages/@aws-cdk/cfnspec/lib/schema/index.ts @@ -3,3 +3,4 @@ export * from './property'; export * from './resource-type'; export * from './specification'; export * from './augmentation'; +export * from './cfn-lint'; diff --git a/packages/@aws-cdk/cfnspec/package.json b/packages/@aws-cdk/cfnspec/package.json index 3ab38256028bd..06c46cf79b839 100644 --- a/packages/@aws-cdk/cfnspec/package.json +++ b/packages/@aws-cdk/cfnspec/package.json @@ -3,7 +3,7 @@ "description": "The CloudFormation resource specification used by @aws-cdk packages", "version": "0.0.0", "scripts": { - "update": "cdk-build && /bin/bash build-tools/update.sh", + "update": "cdk-build && /bin/bash build-tools/update.sh && /bin/bash build-tools/update-cfnlint.sh", "update-metrics": "/bin/bash build-tools/update-metrics.sh", "build": "cdk-build && node build-tools/build", "watch": "cdk-watch", diff --git a/packages/@aws-cdk/cfnspec/spec-source/000_CloudFormationResourceSpecification.json b/packages/@aws-cdk/cfnspec/spec-source/000_CloudFormationResourceSpecification.json index a2e212d9f552e..eca5e7601bdb5 100644 --- a/packages/@aws-cdk/cfnspec/spec-source/000_CloudFormationResourceSpecification.json +++ b/packages/@aws-cdk/cfnspec/spec-source/000_CloudFormationResourceSpecification.json @@ -4621,6 +4621,29 @@ } } }, + "AWS::AppMesh::VirtualGateway.SubjectAlternativeNameMatchers": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-subjectalternativenamematchers.html", + "Properties": { + "Exact": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-subjectalternativenamematchers.html#cfn-appmesh-virtualgateway-subjectalternativenamematchers-exact", + "PrimitiveItemType": "String", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + } + } + }, + "AWS::AppMesh::VirtualGateway.SubjectAlternativeNames": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-subjectalternativenames.html", + "Properties": { + "Match": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-subjectalternativenames.html#cfn-appmesh-virtualgateway-subjectalternativenames-match", + "Required": true, + "Type": "SubjectAlternativeNameMatchers", + "UpdateType": "Mutable" + } + } + }, "AWS::AppMesh::VirtualGateway.VirtualGatewayAccessLog": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-virtualgatewayaccesslog.html", "Properties": { @@ -4657,6 +4680,12 @@ "AWS::AppMesh::VirtualGateway.VirtualGatewayClientPolicyTls": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-virtualgatewayclientpolicytls.html", "Properties": { + "Certificate": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-virtualgatewayclientpolicytls.html#cfn-appmesh-virtualgateway-virtualgatewayclientpolicytls-certificate", + "Required": false, + "Type": "VirtualGatewayClientTlsCertificate", + "UpdateType": "Mutable" + }, "Enforce": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-virtualgatewayclientpolicytls.html#cfn-appmesh-virtualgateway-virtualgatewayclientpolicytls-enforce", "PrimitiveType": "Boolean", @@ -4678,6 +4707,23 @@ } } }, + "AWS::AppMesh::VirtualGateway.VirtualGatewayClientTlsCertificate": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-virtualgatewayclienttlscertificate.html", + "Properties": { + "File": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-virtualgatewayclienttlscertificate.html#cfn-appmesh-virtualgateway-virtualgatewayclienttlscertificate-file", + "Required": false, + "Type": "VirtualGatewayListenerTlsFileCertificate", + "UpdateType": "Mutable" + }, + "SDS": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-virtualgatewayclienttlscertificate.html#cfn-appmesh-virtualgateway-virtualgatewayclienttlscertificate-sds", + "Required": false, + "Type": "VirtualGatewayListenerTlsSdsCertificate", + "UpdateType": "Mutable" + } + } + }, "AWS::AppMesh::VirtualGateway.VirtualGatewayConnectionPool": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-virtualgatewayconnectionpool.html", "Properties": { @@ -4841,6 +4887,12 @@ "PrimitiveType": "String", "Required": true, "UpdateType": "Mutable" + }, + "Validation": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-virtualgatewaylistenertls.html#cfn-appmesh-virtualgateway-virtualgatewaylistenertls-validation", + "Required": false, + "Type": "VirtualGatewayListenerTlsValidationContext", + "UpdateType": "Mutable" } } }, @@ -4869,6 +4921,12 @@ "Required": false, "Type": "VirtualGatewayListenerTlsFileCertificate", "UpdateType": "Mutable" + }, + "SDS": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-virtualgatewaylistenertlscertificate.html#cfn-appmesh-virtualgateway-virtualgatewaylistenertlscertificate-sds", + "Required": false, + "Type": "VirtualGatewayListenerTlsSdsCertificate", + "UpdateType": "Mutable" } } }, @@ -4889,6 +4947,51 @@ } } }, + "AWS::AppMesh::VirtualGateway.VirtualGatewayListenerTlsSdsCertificate": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-virtualgatewaylistenertlssdscertificate.html", + "Properties": { + "SecretName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-virtualgatewaylistenertlssdscertificate.html#cfn-appmesh-virtualgateway-virtualgatewaylistenertlssdscertificate-secretname", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + } + } + }, + "AWS::AppMesh::VirtualGateway.VirtualGatewayListenerTlsValidationContext": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-virtualgatewaylistenertlsvalidationcontext.html", + "Properties": { + "SubjectAlternativeNames": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-virtualgatewaylistenertlsvalidationcontext.html#cfn-appmesh-virtualgateway-virtualgatewaylistenertlsvalidationcontext-subjectalternativenames", + "Required": false, + "Type": "SubjectAlternativeNames", + "UpdateType": "Mutable" + }, + "Trust": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-virtualgatewaylistenertlsvalidationcontext.html#cfn-appmesh-virtualgateway-virtualgatewaylistenertlsvalidationcontext-trust", + "Required": true, + "Type": "VirtualGatewayListenerTlsValidationContextTrust", + "UpdateType": "Mutable" + } + } + }, + "AWS::AppMesh::VirtualGateway.VirtualGatewayListenerTlsValidationContextTrust": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-virtualgatewaylistenertlsvalidationcontexttrust.html", + "Properties": { + "File": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-virtualgatewaylistenertlsvalidationcontexttrust.html#cfn-appmesh-virtualgateway-virtualgatewaylistenertlsvalidationcontexttrust-file", + "Required": false, + "Type": "VirtualGatewayTlsValidationContextFileTrust", + "UpdateType": "Mutable" + }, + "SDS": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-virtualgatewaylistenertlsvalidationcontexttrust.html#cfn-appmesh-virtualgateway-virtualgatewaylistenertlsvalidationcontexttrust-sds", + "Required": false, + "Type": "VirtualGatewayTlsValidationContextSdsTrust", + "UpdateType": "Mutable" + } + } + }, "AWS::AppMesh::VirtualGateway.VirtualGatewayLogging": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-virtualgatewaylogging.html", "Properties": { @@ -4944,6 +5047,12 @@ "AWS::AppMesh::VirtualGateway.VirtualGatewayTlsValidationContext": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-virtualgatewaytlsvalidationcontext.html", "Properties": { + "SubjectAlternativeNames": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-virtualgatewaytlsvalidationcontext.html#cfn-appmesh-virtualgateway-virtualgatewaytlsvalidationcontext-subjectalternativenames", + "Required": false, + "Type": "SubjectAlternativeNames", + "UpdateType": "Mutable" + }, "Trust": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-virtualgatewaytlsvalidationcontext.html#cfn-appmesh-virtualgateway-virtualgatewaytlsvalidationcontext-trust", "Required": true, @@ -4975,6 +5084,17 @@ } } }, + "AWS::AppMesh::VirtualGateway.VirtualGatewayTlsValidationContextSdsTrust": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-virtualgatewaytlsvalidationcontextsdstrust.html", + "Properties": { + "SecretName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-virtualgatewaytlsvalidationcontextsdstrust.html#cfn-appmesh-virtualgateway-virtualgatewaytlsvalidationcontextsdstrust-secretname", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + } + } + }, "AWS::AppMesh::VirtualGateway.VirtualGatewayTlsValidationContextTrust": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-virtualgatewaytlsvalidationcontexttrust.html", "Properties": { @@ -4989,6 +5109,12 @@ "Required": false, "Type": "VirtualGatewayTlsValidationContextFileTrust", "UpdateType": "Mutable" + }, + "SDS": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualgateway-virtualgatewaytlsvalidationcontexttrust.html#cfn-appmesh-virtualgateway-virtualgatewaytlsvalidationcontexttrust-sds", + "Required": false, + "Type": "VirtualGatewayTlsValidationContextSdsTrust", + "UpdateType": "Mutable" } } }, @@ -5080,6 +5206,12 @@ "AWS::AppMesh::VirtualNode.ClientPolicyTls": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-clientpolicytls.html", "Properties": { + "Certificate": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-clientpolicytls.html#cfn-appmesh-virtualnode-clientpolicytls-certificate", + "Required": false, + "Type": "ClientTlsCertificate", + "UpdateType": "Mutable" + }, "Enforce": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-clientpolicytls.html#cfn-appmesh-virtualnode-clientpolicytls-enforce", "PrimitiveType": "Boolean", @@ -5101,6 +5233,23 @@ } } }, + "AWS::AppMesh::VirtualNode.ClientTlsCertificate": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-clienttlscertificate.html", + "Properties": { + "File": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-clienttlscertificate.html#cfn-appmesh-virtualnode-clienttlscertificate-file", + "Required": false, + "Type": "ListenerTlsFileCertificate", + "UpdateType": "Mutable" + }, + "SDS": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-clienttlscertificate.html#cfn-appmesh-virtualnode-clienttlscertificate-sds", + "Required": false, + "Type": "ListenerTlsSdsCertificate", + "UpdateType": "Mutable" + } + } + }, "AWS::AppMesh::VirtualNode.DnsServiceDiscovery": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-dnsservicediscovery.html", "Properties": { @@ -5305,6 +5454,12 @@ "PrimitiveType": "String", "Required": true, "UpdateType": "Mutable" + }, + "Validation": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-listenertls.html#cfn-appmesh-virtualnode-listenertls-validation", + "Required": false, + "Type": "ListenerTlsValidationContext", + "UpdateType": "Mutable" } } }, @@ -5333,6 +5488,12 @@ "Required": false, "Type": "ListenerTlsFileCertificate", "UpdateType": "Mutable" + }, + "SDS": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-listenertlscertificate.html#cfn-appmesh-virtualnode-listenertlscertificate-sds", + "Required": false, + "Type": "ListenerTlsSdsCertificate", + "UpdateType": "Mutable" } } }, @@ -5353,6 +5514,51 @@ } } }, + "AWS::AppMesh::VirtualNode.ListenerTlsSdsCertificate": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-listenertlssdscertificate.html", + "Properties": { + "SecretName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-listenertlssdscertificate.html#cfn-appmesh-virtualnode-listenertlssdscertificate-secretname", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + } + } + }, + "AWS::AppMesh::VirtualNode.ListenerTlsValidationContext": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-listenertlsvalidationcontext.html", + "Properties": { + "SubjectAlternativeNames": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-listenertlsvalidationcontext.html#cfn-appmesh-virtualnode-listenertlsvalidationcontext-subjectalternativenames", + "Required": false, + "Type": "SubjectAlternativeNames", + "UpdateType": "Mutable" + }, + "Trust": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-listenertlsvalidationcontext.html#cfn-appmesh-virtualnode-listenertlsvalidationcontext-trust", + "Required": true, + "Type": "ListenerTlsValidationContextTrust", + "UpdateType": "Mutable" + } + } + }, + "AWS::AppMesh::VirtualNode.ListenerTlsValidationContextTrust": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-listenertlsvalidationcontexttrust.html", + "Properties": { + "File": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-listenertlsvalidationcontexttrust.html#cfn-appmesh-virtualnode-listenertlsvalidationcontexttrust-file", + "Required": false, + "Type": "TlsValidationContextFileTrust", + "UpdateType": "Mutable" + }, + "SDS": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-listenertlsvalidationcontexttrust.html#cfn-appmesh-virtualnode-listenertlsvalidationcontexttrust-sds", + "Required": false, + "Type": "TlsValidationContextSdsTrust", + "UpdateType": "Mutable" + } + } + }, "AWS::AppMesh::VirtualNode.Logging": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-logging.html", "Properties": { @@ -5427,6 +5633,29 @@ } } }, + "AWS::AppMesh::VirtualNode.SubjectAlternativeNameMatchers": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-subjectalternativenamematchers.html", + "Properties": { + "Exact": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-subjectalternativenamematchers.html#cfn-appmesh-virtualnode-subjectalternativenamematchers-exact", + "PrimitiveItemType": "String", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + } + } + }, + "AWS::AppMesh::VirtualNode.SubjectAlternativeNames": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-subjectalternativenames.html", + "Properties": { + "Match": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-subjectalternativenames.html#cfn-appmesh-virtualnode-subjectalternativenames-match", + "Required": true, + "Type": "SubjectAlternativeNameMatchers", + "UpdateType": "Mutable" + } + } + }, "AWS::AppMesh::VirtualNode.TcpTimeout": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-tcptimeout.html", "Properties": { @@ -5441,6 +5670,12 @@ "AWS::AppMesh::VirtualNode.TlsValidationContext": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-tlsvalidationcontext.html", "Properties": { + "SubjectAlternativeNames": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-tlsvalidationcontext.html#cfn-appmesh-virtualnode-tlsvalidationcontext-subjectalternativenames", + "Required": false, + "Type": "SubjectAlternativeNames", + "UpdateType": "Mutable" + }, "Trust": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-tlsvalidationcontext.html#cfn-appmesh-virtualnode-tlsvalidationcontext-trust", "Required": true, @@ -5472,6 +5707,17 @@ } } }, + "AWS::AppMesh::VirtualNode.TlsValidationContextSdsTrust": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-tlsvalidationcontextsdstrust.html", + "Properties": { + "SecretName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-tlsvalidationcontextsdstrust.html#cfn-appmesh-virtualnode-tlsvalidationcontextsdstrust-secretname", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + } + } + }, "AWS::AppMesh::VirtualNode.TlsValidationContextTrust": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-tlsvalidationcontexttrust.html", "Properties": { @@ -5486,6 +5732,12 @@ "Required": false, "Type": "TlsValidationContextFileTrust", "UpdateType": "Mutable" + }, + "SDS": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-tlsvalidationcontexttrust.html#cfn-appmesh-virtualnode-tlsvalidationcontexttrust-sds", + "Required": false, + "Type": "TlsValidationContextSdsTrust", + "UpdateType": "Mutable" } } }, @@ -9128,6 +9380,23 @@ } } }, + "AWS::CloudFormation::ResourceVersion.LoggingConfig": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-resourceversion-loggingconfig.html", + "Properties": { + "LogGroupName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-resourceversion-loggingconfig.html#cfn-cloudformation-resourceversion-loggingconfig-loggroupname", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "LogRoleArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-resourceversion-loggingconfig.html#cfn-cloudformation-resourceversion-loggingconfig-logrolearn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + } + } + }, "AWS::CloudFormation::StackSet.AutoDeployment": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-stackset-autodeployment.html", "Properties": { @@ -13771,6 +14040,23 @@ } } }, + "AWS::DMS::Endpoint.DocDbSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-docdbsettings.html", + "Properties": { + "SecretsManagerAccessRoleArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-docdbsettings.html#cfn-dms-endpoint-docdbsettings-secretsmanageraccessrolearn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "SecretsManagerSecretId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-docdbsettings.html#cfn-dms-endpoint-docdbsettings-secretsmanagersecretid", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + } + } + }, "AWS::DMS::Endpoint.DynamoDbSettings": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-dynamodbsettings.html", "Properties": { @@ -13811,6 +14097,23 @@ } } }, + "AWS::DMS::Endpoint.IbmDb2Settings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-ibmdb2settings.html", + "Properties": { + "SecretsManagerAccessRoleArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-ibmdb2settings.html#cfn-dms-endpoint-ibmdb2settings-secretsmanageraccessrolearn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "SecretsManagerSecretId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-ibmdb2settings.html#cfn-dms-endpoint-ibmdb2settings-secretsmanagersecretid", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + } + } + }, "AWS::DMS::Endpoint.KafkaSettings": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-kafkasettings.html", "Properties": { @@ -13851,6 +14154,23 @@ } } }, + "AWS::DMS::Endpoint.MicrosoftSqlServerSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-microsoftsqlserversettings.html", + "Properties": { + "SecretsManagerAccessRoleArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-microsoftsqlserversettings.html#cfn-dms-endpoint-microsoftsqlserversettings-secretsmanageraccessrolearn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "SecretsManagerSecretId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-microsoftsqlserversettings.html#cfn-dms-endpoint-microsoftsqlserversettings-secretsmanagersecretid", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + } + } + }, "AWS::DMS::Endpoint.MongoDbSettings": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-mongodbsettings.html", "Properties": { @@ -13908,6 +14228,18 @@ "Required": false, "UpdateType": "Mutable" }, + "SecretsManagerAccessRoleArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-mongodbsettings.html#cfn-dms-endpoint-mongodbsettings-secretsmanageraccessrolearn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "SecretsManagerSecretId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-mongodbsettings.html#cfn-dms-endpoint-mongodbsettings-secretsmanagersecretid", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, "ServerName": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-mongodbsettings.html#cfn-dms-endpoint-mongodbsettings-servername", "PrimitiveType": "String", @@ -13922,6 +14254,23 @@ } } }, + "AWS::DMS::Endpoint.MySqlSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-mysqlsettings.html", + "Properties": { + "SecretsManagerAccessRoleArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-mysqlsettings.html#cfn-dms-endpoint-mysqlsettings-secretsmanageraccessrolearn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "SecretsManagerSecretId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-mysqlsettings.html#cfn-dms-endpoint-mysqlsettings-secretsmanagersecretid", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + } + } + }, "AWS::DMS::Endpoint.NeptuneSettings": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-neptunesettings.html", "Properties": { @@ -13969,6 +14318,69 @@ } } }, + "AWS::DMS::Endpoint.OracleSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-oraclesettings.html", + "Properties": { + "SecretsManagerAccessRoleArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-oraclesettings.html#cfn-dms-endpoint-oraclesettings-secretsmanageraccessrolearn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "SecretsManagerOracleAsmAccessRoleArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-oraclesettings.html#cfn-dms-endpoint-oraclesettings-secretsmanageroracleasmaccessrolearn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "SecretsManagerOracleAsmSecretId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-oraclesettings.html#cfn-dms-endpoint-oraclesettings-secretsmanageroracleasmsecretid", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "SecretsManagerSecretId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-oraclesettings.html#cfn-dms-endpoint-oraclesettings-secretsmanagersecretid", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + } + } + }, + "AWS::DMS::Endpoint.PostgreSqlSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-postgresqlsettings.html", + "Properties": { + "SecretsManagerAccessRoleArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-postgresqlsettings.html#cfn-dms-endpoint-postgresqlsettings-secretsmanageraccessrolearn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "SecretsManagerSecretId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-postgresqlsettings.html#cfn-dms-endpoint-postgresqlsettings-secretsmanagersecretid", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + } + } + }, + "AWS::DMS::Endpoint.RedshiftSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-redshiftsettings.html", + "Properties": { + "SecretsManagerAccessRoleArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-redshiftsettings.html#cfn-dms-endpoint-redshiftsettings-secretsmanageraccessrolearn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "SecretsManagerSecretId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-redshiftsettings.html#cfn-dms-endpoint-redshiftsettings-secretsmanagersecretid", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + } + } + }, "AWS::DMS::Endpoint.S3Settings": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-s3settings.html", "Properties": { @@ -14016,6 +14428,23 @@ } } }, + "AWS::DMS::Endpoint.SybaseSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-sybasesettings.html", + "Properties": { + "SecretsManagerAccessRoleArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-sybasesettings.html#cfn-dms-endpoint-sybasesettings-secretsmanageraccessrolearn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "SecretsManagerSecretId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dms-endpoint-sybasesettings.html#cfn-dms-endpoint-sybasesettings-secretsmanagersecretid", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + } + } + }, "AWS::DataBrew::Job.CsvOutputOptions": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-job-csvoutputoptions.html", "Properties": { @@ -18529,17 +18958,6 @@ } } }, - "AWS::ECS::Cluster.ClusterConfiguration": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-clusterconfiguration.html", - "Properties": { - "ExecuteCommandConfiguration": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-clusterconfiguration.html#cfn-ecs-cluster-clusterconfiguration-executecommandconfiguration", - "Required": false, - "Type": "ExecuteCommandConfiguration", - "UpdateType": "Mutable" - } - } - }, "AWS::ECS::Cluster.ClusterSettings": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-clustersettings.html", "Properties": { @@ -18557,64 +18975,6 @@ } } }, - "AWS::ECS::Cluster.ExecuteCommandConfiguration": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-executecommandconfiguration.html", - "Properties": { - "KmsKeyId": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-executecommandconfiguration.html#cfn-ecs-cluster-executecommandconfiguration-kmskeyid", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "LogConfiguration": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-executecommandconfiguration.html#cfn-ecs-cluster-executecommandconfiguration-logconfiguration", - "Required": false, - "Type": "ExecuteCommandLogConfiguration", - "UpdateType": "Mutable" - }, - "Logging": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-executecommandconfiguration.html#cfn-ecs-cluster-executecommandconfiguration-logging", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - } - } - }, - "AWS::ECS::Cluster.ExecuteCommandLogConfiguration": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-executecommandlogconfiguration.html", - "Properties": { - "CloudWatchEncryptionEnabled": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-executecommandlogconfiguration.html#cfn-ecs-cluster-executecommandlogconfiguration-cloudwatchencryptionenabled", - "PrimitiveType": "Boolean", - "Required": false, - "UpdateType": "Mutable" - }, - "CloudWatchLogGroupName": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-executecommandlogconfiguration.html#cfn-ecs-cluster-executecommandlogconfiguration-cloudwatchloggroupname", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "S3BucketName": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-executecommandlogconfiguration.html#cfn-ecs-cluster-executecommandlogconfiguration-s3bucketname", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "S3EncryptionEnabled": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-executecommandlogconfiguration.html#cfn-ecs-cluster-executecommandlogconfiguration-s3encryptionenabled", - "PrimitiveType": "Boolean", - "Required": false, - "UpdateType": "Mutable" - }, - "S3KeyPrefix": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-executecommandlogconfiguration.html#cfn-ecs-cluster-executecommandlogconfiguration-s3keyprefix", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - } - } - }, "AWS::ECS::Service.AwsVpcConfiguration": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-awsvpcconfiguration.html", "Properties": { @@ -40121,6 +40481,32 @@ } } }, + "AWS::MediaLive::Channel.VpcOutputSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-medialive-channel-vpcoutputsettings.html", + "Properties": { + "PublicAddressAllocationIds": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-medialive-channel-vpcoutputsettings.html#cfn-medialive-channel-vpcoutputsettings-publicaddressallocationids", + "PrimitiveItemType": "String", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + }, + "SecurityGroupIds": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-medialive-channel-vpcoutputsettings.html#cfn-medialive-channel-vpcoutputsettings-securitygroupids", + "PrimitiveItemType": "String", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + }, + "SubnetIds": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-medialive-channel-vpcoutputsettings.html#cfn-medialive-channel-vpcoutputsettings-subnetids", + "PrimitiveItemType": "String", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + } + } + }, "AWS::MediaLive::Channel.WavSettings": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-medialive-channel-wavsettings.html", "Properties": { @@ -47775,6 +48161,87 @@ } } }, + "AWS::SageMaker::App.ResourceSpec": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-app-resourcespec.html", + "Properties": { + "InstanceType": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-app-resourcespec.html#cfn-sagemaker-app-resourcespec-instancetype", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "SageMakerImageArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-app-resourcespec.html#cfn-sagemaker-app-resourcespec-sagemakerimagearn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "SageMakerImageVersionArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-app-resourcespec.html#cfn-sagemaker-app-resourcespec-sagemakerimageversionarn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + } + } + }, + "AWS::SageMaker::AppImageConfig.FileSystemConfig": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-appimageconfig-filesystemconfig.html", + "Properties": { + "DefaultGid": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-appimageconfig-filesystemconfig.html#cfn-sagemaker-appimageconfig-filesystemconfig-defaultgid", + "PrimitiveType": "Integer", + "Required": false, + "UpdateType": "Mutable" + }, + "DefaultUid": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-appimageconfig-filesystemconfig.html#cfn-sagemaker-appimageconfig-filesystemconfig-defaultuid", + "PrimitiveType": "Integer", + "Required": false, + "UpdateType": "Mutable" + }, + "MountPath": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-appimageconfig-filesystemconfig.html#cfn-sagemaker-appimageconfig-filesystemconfig-mountpath", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + } + } + }, + "AWS::SageMaker::AppImageConfig.KernelGatewayImageConfig": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-appimageconfig-kernelgatewayimageconfig.html", + "Properties": { + "FileSystemConfig": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-appimageconfig-kernelgatewayimageconfig.html#cfn-sagemaker-appimageconfig-kernelgatewayimageconfig-filesystemconfig", + "Required": false, + "Type": "FileSystemConfig", + "UpdateType": "Mutable" + }, + "KernelSpecs": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-appimageconfig-kernelgatewayimageconfig.html#cfn-sagemaker-appimageconfig-kernelgatewayimageconfig-kernelspecs", + "ItemType": "KernelSpec", + "Required": true, + "Type": "List", + "UpdateType": "Mutable" + } + } + }, + "AWS::SageMaker::AppImageConfig.KernelSpec": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-appimageconfig-kernelspec.html", + "Properties": { + "DisplayName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-appimageconfig-kernelspec.html#cfn-sagemaker-appimageconfig-kernelspec-displayname", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "Name": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-appimageconfig-kernelspec.html#cfn-sagemaker-appimageconfig-kernelspec-name", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + } + } + }, "AWS::SageMaker::CodeRepository.GitConfig": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-coderepository-gitconfig.html", "Properties": { @@ -48114,6 +48581,142 @@ } } }, + "AWS::SageMaker::Domain.CustomImage": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-domain-customimage.html", + "Properties": { + "AppImageConfigName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-domain-customimage.html#cfn-sagemaker-domain-customimage-appimageconfigname", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + }, + "ImageName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-domain-customimage.html#cfn-sagemaker-domain-customimage-imagename", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + }, + "ImageVersionNumber": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-domain-customimage.html#cfn-sagemaker-domain-customimage-imageversionnumber", + "PrimitiveType": "Integer", + "Required": false, + "UpdateType": "Mutable" + } + } + }, + "AWS::SageMaker::Domain.JupyterServerAppSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-domain-jupyterserverappsettings.html", + "Properties": { + "DefaultResourceSpec": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-domain-jupyterserverappsettings.html#cfn-sagemaker-domain-jupyterserverappsettings-defaultresourcespec", + "Required": false, + "Type": "ResourceSpec", + "UpdateType": "Mutable" + } + } + }, + "AWS::SageMaker::Domain.KernelGatewayAppSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-domain-kernelgatewayappsettings.html", + "Properties": { + "CustomImages": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-domain-kernelgatewayappsettings.html#cfn-sagemaker-domain-kernelgatewayappsettings-customimages", + "DuplicatesAllowed": true, + "ItemType": "CustomImage", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + }, + "DefaultResourceSpec": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-domain-kernelgatewayappsettings.html#cfn-sagemaker-domain-kernelgatewayappsettings-defaultresourcespec", + "Required": false, + "Type": "ResourceSpec", + "UpdateType": "Mutable" + } + } + }, + "AWS::SageMaker::Domain.ResourceSpec": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-domain-resourcespec.html", + "Properties": { + "InstanceType": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-domain-resourcespec.html#cfn-sagemaker-domain-resourcespec-instancetype", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "SageMakerImageArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-domain-resourcespec.html#cfn-sagemaker-domain-resourcespec-sagemakerimagearn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "SageMakerImageVersionArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-domain-resourcespec.html#cfn-sagemaker-domain-resourcespec-sagemakerimageversionarn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + } + } + }, + "AWS::SageMaker::Domain.SharingSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-domain-sharingsettings.html", + "Properties": { + "NotebookOutputOption": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-domain-sharingsettings.html#cfn-sagemaker-domain-sharingsettings-notebookoutputoption", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "S3KmsKeyId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-domain-sharingsettings.html#cfn-sagemaker-domain-sharingsettings-s3kmskeyid", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "S3OutputPath": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-domain-sharingsettings.html#cfn-sagemaker-domain-sharingsettings-s3outputpath", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + } + } + }, + "AWS::SageMaker::Domain.UserSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-domain-usersettings.html", + "Properties": { + "ExecutionRole": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-domain-usersettings.html#cfn-sagemaker-domain-usersettings-executionrole", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "JupyterServerAppSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-domain-usersettings.html#cfn-sagemaker-domain-usersettings-jupyterserverappsettings", + "Required": false, + "Type": "JupyterServerAppSettings", + "UpdateType": "Mutable" + }, + "KernelGatewayAppSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-domain-usersettings.html#cfn-sagemaker-domain-usersettings-kernelgatewayappsettings", + "Required": false, + "Type": "KernelGatewayAppSettings", + "UpdateType": "Mutable" + }, + "SecurityGroups": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-domain-usersettings.html#cfn-sagemaker-domain-usersettings-securitygroups", + "DuplicatesAllowed": true, + "PrimitiveItemType": "String", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + }, + "SharingSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-domain-usersettings.html#cfn-sagemaker-domain-usersettings-sharingsettings", + "Required": false, + "Type": "SharingSettings", + "UpdateType": "Mutable" + } + } + }, "AWS::SageMaker::Endpoint.Alarm": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpoint-alarm.html", "Properties": { @@ -49752,6 +50355,142 @@ } } }, + "AWS::SageMaker::UserProfile.CustomImage": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-userprofile-customimage.html", + "Properties": { + "AppImageConfigName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-userprofile-customimage.html#cfn-sagemaker-userprofile-customimage-appimageconfigname", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + }, + "ImageName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-userprofile-customimage.html#cfn-sagemaker-userprofile-customimage-imagename", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + }, + "ImageVersionNumber": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-userprofile-customimage.html#cfn-sagemaker-userprofile-customimage-imageversionnumber", + "PrimitiveType": "Integer", + "Required": false, + "UpdateType": "Mutable" + } + } + }, + "AWS::SageMaker::UserProfile.JupyterServerAppSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-userprofile-jupyterserverappsettings.html", + "Properties": { + "DefaultResourceSpec": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-userprofile-jupyterserverappsettings.html#cfn-sagemaker-userprofile-jupyterserverappsettings-defaultresourcespec", + "Required": false, + "Type": "ResourceSpec", + "UpdateType": "Mutable" + } + } + }, + "AWS::SageMaker::UserProfile.KernelGatewayAppSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-userprofile-kernelgatewayappsettings.html", + "Properties": { + "CustomImages": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-userprofile-kernelgatewayappsettings.html#cfn-sagemaker-userprofile-kernelgatewayappsettings-customimages", + "DuplicatesAllowed": true, + "ItemType": "CustomImage", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + }, + "DefaultResourceSpec": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-userprofile-kernelgatewayappsettings.html#cfn-sagemaker-userprofile-kernelgatewayappsettings-defaultresourcespec", + "Required": false, + "Type": "ResourceSpec", + "UpdateType": "Mutable" + } + } + }, + "AWS::SageMaker::UserProfile.ResourceSpec": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-userprofile-resourcespec.html", + "Properties": { + "InstanceType": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-userprofile-resourcespec.html#cfn-sagemaker-userprofile-resourcespec-instancetype", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "SageMakerImageArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-userprofile-resourcespec.html#cfn-sagemaker-userprofile-resourcespec-sagemakerimagearn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "SageMakerImageVersionArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-userprofile-resourcespec.html#cfn-sagemaker-userprofile-resourcespec-sagemakerimageversionarn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + } + } + }, + "AWS::SageMaker::UserProfile.SharingSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-userprofile-sharingsettings.html", + "Properties": { + "NotebookOutputOption": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-userprofile-sharingsettings.html#cfn-sagemaker-userprofile-sharingsettings-notebookoutputoption", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "S3KmsKeyId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-userprofile-sharingsettings.html#cfn-sagemaker-userprofile-sharingsettings-s3kmskeyid", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "S3OutputPath": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-userprofile-sharingsettings.html#cfn-sagemaker-userprofile-sharingsettings-s3outputpath", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + } + } + }, + "AWS::SageMaker::UserProfile.UserSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-userprofile-usersettings.html", + "Properties": { + "ExecutionRole": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-userprofile-usersettings.html#cfn-sagemaker-userprofile-usersettings-executionrole", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "JupyterServerAppSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-userprofile-usersettings.html#cfn-sagemaker-userprofile-usersettings-jupyterserverappsettings", + "Required": false, + "Type": "JupyterServerAppSettings", + "UpdateType": "Mutable" + }, + "KernelGatewayAppSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-userprofile-usersettings.html#cfn-sagemaker-userprofile-usersettings-kernelgatewayappsettings", + "Required": false, + "Type": "KernelGatewayAppSettings", + "UpdateType": "Mutable" + }, + "SecurityGroups": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-userprofile-usersettings.html#cfn-sagemaker-userprofile-usersettings-securitygroups", + "DuplicatesAllowed": true, + "PrimitiveItemType": "String", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + }, + "SharingSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-userprofile-usersettings.html#cfn-sagemaker-userprofile-usersettings-sharingsettings", + "Required": false, + "Type": "SharingSettings", + "UpdateType": "Mutable" + } + } + }, "AWS::SageMaker::Workteam.CognitoMemberDefinition": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-workteam-cognitomemberdefinition.html", "Properties": { @@ -50017,6 +50756,23 @@ } } }, + "AWS::ServiceCatalog::ServiceAction.DefinitionParameter": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-servicecatalog-serviceaction-definitionparameter.html", + "Properties": { + "Key": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-servicecatalog-serviceaction-definitionparameter.html#cfn-servicecatalog-serviceaction-definitionparameter-key", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + }, + "Value": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-servicecatalog-serviceaction-definitionparameter.html#cfn-servicecatalog-serviceaction-definitionparameter-value", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + } + } + }, "AWS::ServiceCatalogAppRegistry::AttributeGroup.Attributes": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-servicecatalogappregistry-attributegroup-attributes.html" }, @@ -52561,7 +53317,7 @@ } } }, - "ResourceSpecificationVersion": "27.0.0", + "ResourceSpecificationVersion": "28.0.0", "ResourceTypes": { "AWS::ACMPCA::Certificate": { "Attributes": { @@ -53248,6 +54004,11 @@ } }, "AWS::ApiGateway::ApiKey": { + "Attributes": { + "APIKeyId": { + "PrimitiveType": "String" + } + }, "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-apikey.html", "Properties": { "CustomerId": { @@ -57882,6 +58643,83 @@ } } }, + "AWS::CloudFormation::ResourceDefaultVersion": { + "Attributes": { + "Arn": { + "PrimitiveType": "String" + } + }, + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-resourcedefaultversion.html", + "Properties": { + "TypeName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-resourcedefaultversion.html#cfn-cloudformation-resourcedefaultversion-typename", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "TypeVersionArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-resourcedefaultversion.html#cfn-cloudformation-resourcedefaultversion-typeversionarn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "VersionId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-resourcedefaultversion.html#cfn-cloudformation-resourcedefaultversion-versionid", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + } + } + }, + "AWS::CloudFormation::ResourceVersion": { + "Attributes": { + "Arn": { + "PrimitiveType": "String" + }, + "IsDefaultVersion": { + "PrimitiveType": "Boolean" + }, + "ProvisioningType": { + "PrimitiveType": "String" + }, + "TypeArn": { + "PrimitiveType": "String" + }, + "VersionId": { + "PrimitiveType": "String" + }, + "Visibility": { + "PrimitiveType": "String" + } + }, + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-resourceversion.html", + "Properties": { + "ExecutionRoleArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-resourceversion.html#cfn-cloudformation-resourceversion-executionrolearn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "LoggingConfig": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-resourceversion.html#cfn-cloudformation-resourceversion-loggingconfig", + "Required": false, + "Type": "LoggingConfig", + "UpdateType": "Mutable" + }, + "SchemaHandlerPackage": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-resourceversion.html#cfn-cloudformation-resourceversion-schemahandlerpackage", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + }, + "TypeName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-resourceversion.html#cfn-cloudformation-resourceversion-typename", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + } + } + }, "AWS::CloudFormation::Stack": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html", "Properties": { @@ -60874,6 +61712,12 @@ "Required": false, "UpdateType": "Mutable" }, + "DocDbSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-endpoint.html#cfn-dms-endpoint-docdbsettings", + "Required": false, + "Type": "DocDbSettings", + "UpdateType": "Mutable" + }, "DynamoDbSettings": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-endpoint.html#cfn-dms-endpoint-dynamodbsettings", "Required": false, @@ -60910,6 +61754,12 @@ "Required": false, "UpdateType": "Mutable" }, + "IbmDb2Settings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-endpoint.html#cfn-dms-endpoint-ibmdb2settings", + "Required": false, + "Type": "IbmDb2Settings", + "UpdateType": "Mutable" + }, "KafkaSettings": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-endpoint.html#cfn-dms-endpoint-kafkasettings", "Required": false, @@ -60928,18 +61778,36 @@ "Required": false, "UpdateType": "Immutable" }, + "MicrosoftSqlServerSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-endpoint.html#cfn-dms-endpoint-microsoftsqlserversettings", + "Required": false, + "Type": "MicrosoftSqlServerSettings", + "UpdateType": "Mutable" + }, "MongoDbSettings": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-endpoint.html#cfn-dms-endpoint-mongodbsettings", "Required": false, "Type": "MongoDbSettings", "UpdateType": "Mutable" }, + "MySqlSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-endpoint.html#cfn-dms-endpoint-mysqlsettings", + "Required": false, + "Type": "MySqlSettings", + "UpdateType": "Mutable" + }, "NeptuneSettings": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-endpoint.html#cfn-dms-endpoint-neptunesettings", "Required": false, "Type": "NeptuneSettings", "UpdateType": "Mutable" }, + "OracleSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-endpoint.html#cfn-dms-endpoint-oraclesettings", + "Required": false, + "Type": "OracleSettings", + "UpdateType": "Mutable" + }, "Password": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-endpoint.html#cfn-dms-endpoint-password", "PrimitiveType": "String", @@ -60952,6 +61820,18 @@ "Required": false, "UpdateType": "Mutable" }, + "PostgreSqlSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-endpoint.html#cfn-dms-endpoint-postgresqlsettings", + "Required": false, + "Type": "PostgreSqlSettings", + "UpdateType": "Mutable" + }, + "RedshiftSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-endpoint.html#cfn-dms-endpoint-redshiftsettings", + "Required": false, + "Type": "RedshiftSettings", + "UpdateType": "Mutable" + }, "S3Settings": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-endpoint.html#cfn-dms-endpoint-s3settings", "Required": false, @@ -60970,6 +61850,12 @@ "Required": false, "UpdateType": "Mutable" }, + "SybaseSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-endpoint.html#cfn-dms-endpoint-sybasesettings", + "Required": false, + "Type": "SybaseSettings", + "UpdateType": "Mutable" + }, "Tags": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-endpoint.html#cfn-dms-endpoint-tags", "ItemType": "Tag", @@ -64677,6 +65563,185 @@ } } }, + "AWS::EC2::TransitGatewayMulticastDomain": { + "Attributes": { + "CreationTime": { + "PrimitiveType": "String" + }, + "State": { + "PrimitiveType": "String" + }, + "TransitGatewayMulticastDomainArn": { + "PrimitiveType": "String" + }, + "TransitGatewayMulticastDomainId": { + "PrimitiveType": "String" + } + }, + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastdomain.html", + "Properties": { + "Options": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastdomain.html#cfn-ec2-transitgatewaymulticastdomain-options", + "PrimitiveType": "Json", + "Required": false, + "UpdateType": "Mutable" + }, + "Tags": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastdomain.html#cfn-ec2-transitgatewaymulticastdomain-tags", + "ItemType": "Tag", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + }, + "TransitGatewayId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastdomain.html#cfn-ec2-transitgatewaymulticastdomain-transitgatewayid", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + } + } + }, + "AWS::EC2::TransitGatewayMulticastDomainAssociation": { + "Attributes": { + "ResourceId": { + "PrimitiveType": "String" + }, + "ResourceType": { + "PrimitiveType": "String" + } + }, + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastdomainassociation.html", + "Properties": { + "State": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastdomainassociation.html#cfn-ec2-transitgatewaymulticastdomainassociation-state", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "SubnetId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastdomainassociation.html#cfn-ec2-transitgatewaymulticastdomainassociation-subnetid", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + }, + "TransitGatewayAttachmentId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastdomainassociation.html#cfn-ec2-transitgatewaymulticastdomainassociation-transitgatewayattachmentid", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + }, + "TransitGatewayMulticastDomainId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastdomainassociation.html#cfn-ec2-transitgatewaymulticastdomainassociation-transitgatewaymulticastdomainid", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + } + } + }, + "AWS::EC2::TransitGatewayMulticastGroupMember": { + "Attributes": { + "GroupMember": { + "PrimitiveType": "Boolean" + }, + "GroupSource": { + "PrimitiveType": "Boolean" + }, + "MemberType": { + "PrimitiveType": "String" + }, + "ResourceId": { + "PrimitiveType": "String" + }, + "ResourceType": { + "PrimitiveType": "String" + }, + "SourceType": { + "PrimitiveType": "String" + }, + "SubnetId": { + "PrimitiveType": "String" + } + }, + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastgroupmember.html", + "Properties": { + "GroupIpAddress": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastgroupmember.html#cfn-ec2-transitgatewaymulticastgroupmember-groupipaddress", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + }, + "NetworkInterfaceId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastgroupmember.html#cfn-ec2-transitgatewaymulticastgroupmember-networkinterfaceid", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + }, + "TransitGatewayAttachmentId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastgroupmember.html#cfn-ec2-transitgatewaymulticastgroupmember-transitgatewayattachmentid", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "TransitGatewayMulticastDomainId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastgroupmember.html#cfn-ec2-transitgatewaymulticastgroupmember-transitgatewaymulticastdomainid", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + } + } + }, + "AWS::EC2::TransitGatewayMulticastGroupSource": { + "Attributes": { + "GroupMember": { + "PrimitiveType": "Boolean" + }, + "GroupSource": { + "PrimitiveType": "Boolean" + }, + "MemberType": { + "PrimitiveType": "String" + }, + "ResourceId": { + "PrimitiveType": "String" + }, + "ResourceType": { + "PrimitiveType": "String" + }, + "SourceType": { + "PrimitiveType": "String" + }, + "SubnetId": { + "PrimitiveType": "String" + } + }, + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastgroupsource.html", + "Properties": { + "GroupIpAddress": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastgroupsource.html#cfn-ec2-transitgatewaymulticastgroupsource-groupipaddress", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + }, + "NetworkInterfaceId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastgroupsource.html#cfn-ec2-transitgatewaymulticastgroupsource-networkinterfaceid", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + }, + "TransitGatewayAttachmentId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastgroupsource.html#cfn-ec2-transitgatewaymulticastgroupsource-transitgatewayattachmentid", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "TransitGatewayMulticastDomainId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastgroupsource.html#cfn-ec2-transitgatewaymulticastgroupsource-transitgatewaymulticastdomainid", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + } + } + }, "AWS::EC2::TransitGatewayRoute": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewayroute.html", "Properties": { @@ -65439,12 +66504,6 @@ "Type": "List", "UpdateType": "Mutable" }, - "Configuration": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-cluster.html#cfn-ecs-cluster-configuration", - "Required": false, - "Type": "ClusterConfiguration", - "UpdateType": "Mutable" - }, "DefaultCapacityProviderStrategy": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-cluster.html#cfn-ecs-cluster-defaultcapacityproviderstrategy", "ItemType": "CapacityProviderStrategyItem", @@ -65529,12 +66588,6 @@ "Required": false, "UpdateType": "Immutable" }, - "EnableExecuteCommand": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-enableexecutecommand", - "PrimitiveType": "Boolean", - "Required": false, - "UpdateType": "Mutable" - }, "HealthCheckGracePeriodSeconds": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-healthcheckgraceperiodseconds", "PrimitiveType": "Integer", @@ -74596,7 +75649,7 @@ "MemberId": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-managedblockchain-node.html#cfn-managedblockchain-node-memberid", "PrimitiveType": "String", - "Required": true, + "Required": false, "UpdateType": "Mutable" }, "NetworkId": { @@ -75158,6 +76211,12 @@ "PrimitiveType": "Json", "Required": false, "UpdateType": "Mutable" + }, + "Vpc": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-medialive-channel.html#cfn-medialive-channel-vpc", + "Required": false, + "Type": "VpcOutputSettings", + "UpdateType": "Immutable" } } }, @@ -81727,6 +82786,84 @@ } } }, + "AWS::SageMaker::App": { + "Attributes": { + "AppArn": { + "PrimitiveType": "String" + } + }, + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-app.html", + "Properties": { + "AppName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-app.html#cfn-sagemaker-app-appname", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "AppType": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-app.html#cfn-sagemaker-app-apptype", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "DomainId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-app.html#cfn-sagemaker-app-domainid", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "ResourceSpec": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-app.html#cfn-sagemaker-app-resourcespec", + "Required": false, + "Type": "ResourceSpec", + "UpdateType": "Mutable" + }, + "Tags": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-app.html#cfn-sagemaker-app-tags", + "DuplicatesAllowed": true, + "ItemType": "Tag", + "Required": false, + "Type": "List", + "UpdateType": "Immutable" + }, + "UserProfileName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-app.html#cfn-sagemaker-app-userprofilename", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + } + } + }, + "AWS::SageMaker::AppImageConfig": { + "Attributes": { + "AppImageConfigArn": { + "PrimitiveType": "String" + } + }, + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-appimageconfig.html", + "Properties": { + "AppImageConfigName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-appimageconfig.html#cfn-sagemaker-appimageconfig-appimageconfigname", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "KernelGatewayImageConfig": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-appimageconfig.html#cfn-sagemaker-appimageconfig-kernelgatewayimageconfig", + "Required": false, + "Type": "KernelGatewayImageConfig", + "UpdateType": "Mutable" + }, + "Tags": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-appimageconfig.html#cfn-sagemaker-appimageconfig-tags", + "DuplicatesAllowed": true, + "ItemType": "Tag", + "Required": false, + "Type": "List", + "UpdateType": "Immutable" + } + } + }, "AWS::SageMaker::CodeRepository": { "Attributes": { "CodeRepositoryName": { @@ -81884,6 +83021,80 @@ } } }, + "AWS::SageMaker::Domain": { + "Attributes": { + "DomainArn": { + "PrimitiveType": "String" + }, + "DomainId": { + "PrimitiveType": "String" + }, + "HomeEfsFileSystemId": { + "PrimitiveType": "String" + }, + "SingleSignOnManagedApplicationInstanceId": { + "PrimitiveType": "String" + }, + "Url": { + "PrimitiveType": "String" + } + }, + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-domain.html", + "Properties": { + "AppNetworkAccessType": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-domain.html#cfn-sagemaker-domain-appnetworkaccesstype", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + }, + "AuthMode": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-domain.html#cfn-sagemaker-domain-authmode", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "DefaultUserSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-domain.html#cfn-sagemaker-domain-defaultusersettings", + "Required": true, + "Type": "UserSettings", + "UpdateType": "Mutable" + }, + "DomainName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-domain.html#cfn-sagemaker-domain-domainname", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "KmsKeyId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-domain.html#cfn-sagemaker-domain-kmskeyid", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + }, + "SubnetIds": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-domain.html#cfn-sagemaker-domain-subnetids", + "DuplicatesAllowed": true, + "PrimitiveItemType": "String", + "Required": true, + "Type": "List", + "UpdateType": "Immutable" + }, + "Tags": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-domain.html#cfn-sagemaker-domain-tags", + "DuplicatesAllowed": true, + "ItemType": "Tag", + "Required": false, + "Type": "List", + "UpdateType": "Immutable" + }, + "VpcId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-domain.html#cfn-sagemaker-domain-vpcid", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + } + } + }, "AWS::SageMaker::Endpoint": { "Attributes": { "EndpointName": { @@ -82631,6 +83842,54 @@ } } }, + "AWS::SageMaker::UserProfile": { + "Attributes": { + "UserProfileArn": { + "PrimitiveType": "String" + } + }, + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-userprofile.html", + "Properties": { + "DomainId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-userprofile.html#cfn-sagemaker-userprofile-domainid", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "SingleSignOnUserIdentifier": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-userprofile.html#cfn-sagemaker-userprofile-singlesignonuseridentifier", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + }, + "SingleSignOnUserValue": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-userprofile.html#cfn-sagemaker-userprofile-singlesignonuservalue", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + }, + "Tags": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-userprofile.html#cfn-sagemaker-userprofile-tags", + "DuplicatesAllowed": true, + "ItemType": "Tag", + "Required": false, + "Type": "List", + "UpdateType": "Immutable" + }, + "UserProfileName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-userprofile.html#cfn-sagemaker-userprofile-userprofilename", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "UserSettings": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-userprofile.html#cfn-sagemaker-userprofile-usersettings", + "Required": false, + "Type": "UserSettings", + "UpdateType": "Mutable" + } + } + }, "AWS::SageMaker::Workteam": { "Attributes": { "WorkteamName": { @@ -83273,6 +84532,70 @@ } } }, + "AWS::ServiceCatalog::ServiceAction": { + "Attributes": { + "Id": { + "PrimitiveType": "String" + } + }, + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicecatalog-serviceaction.html", + "Properties": { + "AcceptLanguage": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicecatalog-serviceaction.html#cfn-servicecatalog-serviceaction-acceptlanguage", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "Definition": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicecatalog-serviceaction.html#cfn-servicecatalog-serviceaction-definition", + "ItemType": "DefinitionParameter", + "Required": true, + "Type": "List", + "UpdateType": "Mutable" + }, + "DefinitionType": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicecatalog-serviceaction.html#cfn-servicecatalog-serviceaction-definitiontype", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + }, + "Description": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicecatalog-serviceaction.html#cfn-servicecatalog-serviceaction-description", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "Name": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicecatalog-serviceaction.html#cfn-servicecatalog-serviceaction-name", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + } + } + }, + "AWS::ServiceCatalog::ServiceActionAssociation": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicecatalog-serviceactionassociation.html", + "Properties": { + "ProductId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicecatalog-serviceactionassociation.html#cfn-servicecatalog-serviceactionassociation-productid", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "ProvisioningArtifactId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicecatalog-serviceactionassociation.html#cfn-servicecatalog-serviceactionassociation-provisioningartifactid", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "ServiceActionId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicecatalog-serviceactionassociation.html#cfn-servicecatalog-serviceactionassociation-serviceactionid", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + } + } + }, "AWS::ServiceCatalog::StackSetConstraint": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicecatalog-stacksetconstraint.html", "Properties": { diff --git a/packages/@aws-cdk/cfnspec/spec-source/cfn-lint/StatefulResources/000.json b/packages/@aws-cdk/cfnspec/spec-source/cfn-lint/StatefulResources/000.json new file mode 100644 index 0000000000000..25c5e11c890ff --- /dev/null +++ b/packages/@aws-cdk/cfnspec/spec-source/cfn-lint/StatefulResources/000.json @@ -0,0 +1,30 @@ +{ + "ResourceTypes": { + "AWS::CloudFormation::Stack" : {}, + "AWS::Backup::BackupVault" : {}, + "AWS::Cognito::UserPool" : {}, + "AWS::DocDB::DBCluster" : {}, + "AWS::DocDB::DBInstance" : {}, + "AWS::DynamoDB::Table" : {}, + "AWS::EC2::Volume" : {}, + "AWS::EFS::FileSystem" : {}, + "AWS::EMR::Cluster" : {}, + "AWS::ElastiCache::CacheCluster" : {}, + "AWS::ElastiCache::ReplicationGroup" : {}, + "AWS::Elasticsearch::Domain" : {}, + "AWS::FSx::FileSystem" : {}, + "AWS::Logs::LogGroup" : {}, + "AWS::Neptune::DBCluster" : {}, + "AWS::Neptune::DBInstance" : {}, + "AWS::QLDB::Ledger" : {}, + "AWS::RDS::DBCluster" : {}, + "AWS::RDS::DBInstance" : {}, + "AWS::Redshift::Cluster" : {}, + "AWS::SDB::Domain" : {}, + "AWS::SQS::Queue" : {}, + "AWS::S3::Bucket" : { + "DeleteRequiresEmptyResource": true + } + } +} + diff --git a/packages/@aws-cdk/cfnspec/test/test.cfnlint-annotations.ts b/packages/@aws-cdk/cfnspec/test/test.cfnlint-annotations.ts new file mode 100644 index 0000000000000..04e0972893d12 --- /dev/null +++ b/packages/@aws-cdk/cfnspec/test/test.cfnlint-annotations.ts @@ -0,0 +1,28 @@ +import { Test } from 'nodeunit'; +import * as cfnspec from '../lib'; + +module.exports = { + 'spot-check Bucket statefulness'(test: Test) { + const anno = cfnspec.cfnLintAnnotations('AWS::S3::Bucket'); + test.equal(anno.stateful, true); + test.equal(anno.mustBeEmptyToDelete, true); + + test.done(); + }, + + 'spot-check Table statefulness'(test: Test) { + const anno = cfnspec.cfnLintAnnotations('AWS::DynamoDB::Table'); + test.equal(anno.stateful, true); + test.equal(anno.mustBeEmptyToDelete, false); + + test.done(); + }, + + 'spot-check MediaStore metrics'(test: Test) { + const anno = cfnspec.cfnLintAnnotations('AWS::MediaStore::Thingy'); + test.equal(anno.stateful, false); + + test.done(); + }, +}; + diff --git a/packages/@aws-cdk/cloudformation-diff/lib/diffable.ts b/packages/@aws-cdk/cloudformation-diff/lib/diffable.ts index 7bc87b51144ef..445f6adcef7c3 100644 --- a/packages/@aws-cdk/cloudformation-diff/lib/diffable.ts +++ b/packages/@aws-cdk/cloudformation-diff/lib/diffable.ts @@ -44,13 +44,13 @@ interface Eq { /** * Whether a collection contains some element (by value) */ -function contains>(element: T, xs: T[]) { +function contains>(element: T, xs: T[]): boolean { return xs.some(x => x.equal(element)); } /** * Return collection except for elements */ -function difference>(collection: T[], elements: T[]) { +function difference>(collection: T[], elements: T[]): T[] { return collection.filter(x => !contains(x, elements)); } diff --git a/packages/@aws-cdk/cloudformation-diff/lib/iam/iam-changes.ts b/packages/@aws-cdk/cloudformation-diff/lib/iam/iam-changes.ts index 824e9403c95d4..291ab9803f4c9 100644 --- a/packages/@aws-cdk/cloudformation-diff/lib/iam/iam-changes.ts +++ b/packages/@aws-cdk/cloudformation-diff/lib/iam/iam-changes.ts @@ -4,8 +4,8 @@ import { PropertyChange, PropertyMap, ResourceChange } from '../diff/types'; import { DiffableCollection } from '../diffable'; import { renderIntrinsics } from '../render-intrinsics'; import { deepRemoveUndefined, dropIfEmpty, flatMap, makeComparator } from '../util'; -import { ManagedPolicyAttachment, ManagedPolicyJson, parseManagedPolicies } from './managed-policy'; -import { parseLambdaPermission, parseStatements, renderCondition, Statement, StatementJson, Targets } from './statement'; +import { ManagedPolicyAttachment, ManagedPolicyJson } from './managed-policy'; +import { parseLambdaPermission, parseStatements, Statement, StatementJson } from './statement'; export interface IamChangesProps { propertyChanges: PropertyChange[]; @@ -69,23 +69,25 @@ export class IamChanges { // First generate all lines, then sort on Resource so that similar resources are together for (const statement of this.statements.additions) { + const renderedStatement = statement.render(); ret.push([ '+', - renderTargets(statement.resources), - statement.effect, - renderTargets(statement.actions), - renderTargets(statement.principals), - renderCondition(statement.condition), + renderedStatement.resource, + renderedStatement.effect, + renderedStatement.action, + renderedStatement.principal, + renderedStatement.condition, ].map(s => colors.green(s))); } for (const statement of this.statements.removals) { + const renderedStatement = statement.render(); ret.push([ colors.red('-'), - renderTargets(statement.resources), - statement.effect, - renderTargets(statement.actions), - renderTargets(statement.principals), - renderCondition(statement.condition), + renderedStatement.resource, + renderedStatement.effect, + renderedStatement.action, + renderedStatement.principal, + renderedStatement.condition, ].map(s => colors.red(s))); } @@ -125,14 +127,17 @@ export class IamChanges { } /** - * Return a machine-readable version of the changes + * Return a machine-readable version of the changes. + * This is only used in tests. + * + * @internal */ - public toJson(): IamChangesJson { + public _toJson(): IamChangesJson { return deepRemoveUndefined({ - statementAdditions: dropIfEmpty(this.statements.additions.map(s => s.toJson())), - statementRemovals: dropIfEmpty(this.statements.removals.map(s => s.toJson())), - managedPolicyAdditions: dropIfEmpty(this.managedPolicies.additions.map(s => s.toJson())), - managedPolicyRemovals: dropIfEmpty(this.managedPolicies.removals.map(s => s.toJson())), + statementAdditions: dropIfEmpty(this.statements.additions.map(s => s._toJson())), + statementRemovals: dropIfEmpty(this.statements.removals.map(s => s._toJson())), + managedPolicyAdditions: dropIfEmpty(this.managedPolicies.additions.map(s => s._toJson())), + managedPolicyRemovals: dropIfEmpty(this.managedPolicies.removals.map(s => s._toJson())), }); } @@ -184,7 +189,11 @@ export class IamChanges { const appliesToPrincipal = 'AWS:${' + logicalId + '}'; return flatMap(policies, (policy: any) => { - return defaultPrincipal(appliesToPrincipal, parseStatements(renderIntrinsics(policy.PolicyDocument.Statement))); + // check if the Policy itself is not an intrinsic, like an Fn::If + const unparsedStatement = policy.PolicyDocument?.Statement + ? policy.PolicyDocument.Statement + : policy; + return defaultPrincipal(appliesToPrincipal, parseStatements(renderIntrinsics(unparsedStatement))); }); } @@ -234,11 +243,11 @@ export class IamChanges { }); } - private readManagedPolicies(policyArns: string[] | undefined, logicalId: string): ManagedPolicyAttachment[] { + private readManagedPolicies(policyArns: any, logicalId: string): ManagedPolicyAttachment[] { if (!policyArns) { return []; } const rep = '${' + logicalId + '}'; - return parseManagedPolicies(rep, renderIntrinsics(policyArns)); + return ManagedPolicyAttachment.parseManagedPolicies(rep, renderIntrinsics(policyArns)); } private readLambdaStatements(properties?: PropertyMap): Statement[] { @@ -266,16 +275,6 @@ function defaultResource(resource: string, statements: Statement[]) { return statements; } -/** - * Render into a summary table cell - */ -function renderTargets(targets: Targets): string { - if (targets.not) { - return targets.values.map(s => `NOT ${s}`).join('\n'); - } - return targets.values.join('\n'); -} - export interface IamChangesJson { statementAdditions?: StatementJson[]; statementRemovals?: StatementJson[]; diff --git a/packages/@aws-cdk/cloudformation-diff/lib/iam/managed-policy.ts b/packages/@aws-cdk/cloudformation-diff/lib/iam/managed-policy.ts index 121b2eae1efd3..f0d54140398bc 100644 --- a/packages/@aws-cdk/cloudformation-diff/lib/iam/managed-policy.ts +++ b/packages/@aws-cdk/cloudformation-diff/lib/iam/managed-policy.ts @@ -1,13 +1,25 @@ export class ManagedPolicyAttachment { + public static parseManagedPolicies(identityArn: string, arns: string | string[]): ManagedPolicyAttachment[] { + return typeof arns === 'string' + ? [new ManagedPolicyAttachment(identityArn, arns)] + : arns.map((arn: string) => new ManagedPolicyAttachment(identityArn, arn)); + } + constructor(public readonly identityArn: string, public readonly managedPolicyArn: string) { } - public equal(other: ManagedPolicyAttachment) { + public equal(other: ManagedPolicyAttachment): boolean { return this.identityArn === other.identityArn && this.managedPolicyArn === other.managedPolicyArn; } - public toJson() { + /** + * Return a machine-readable version of the changes. + * This is only used in tests. + * + * @internal + */ + public _toJson(): ManagedPolicyJson { return { identityArn: this.identityArn, managedPolicyArn: this.managedPolicyArn }; } } @@ -16,7 +28,3 @@ export interface ManagedPolicyJson { identityArn: string; managedPolicyArn: string; } - -export function parseManagedPolicies(identityArn: string, arns: string[]): ManagedPolicyAttachment[] { - return arns.map((arn: string) => new ManagedPolicyAttachment(identityArn, arn)); -} \ No newline at end of file diff --git a/packages/@aws-cdk/cloudformation-diff/lib/iam/statement.ts b/packages/@aws-cdk/cloudformation-diff/lib/iam/statement.ts index c9c950875e8bc..ea89ad4e597ee 100644 --- a/packages/@aws-cdk/cloudformation-diff/lib/iam/statement.ts +++ b/packages/@aws-cdk/cloudformation-diff/lib/iam/statement.ts @@ -32,36 +32,76 @@ export class Statement { */ public readonly condition?: any; - constructor(statement: UnknownMap) { - this.sid = expectString(statement.Sid); - this.effect = expectEffect(statement.Effect); - this.resources = new Targets(statement, 'Resource', 'NotResource'); - this.actions = new Targets(statement, 'Action', 'NotAction'); - this.principals = new Targets(statement, 'Principal', 'NotPrincipal'); - this.condition = statement.Condition; + private readonly serializedIntrinsic: string | undefined; + + constructor(statement: UnknownMap | string) { + if (typeof statement === 'string') { + this.sid = undefined; + this.effect = Effect.Unknown; + this.resources = new Targets({}, '', ''); + this.actions = new Targets({}, '', ''); + this.principals = new Targets({}, '', ''); + this.condition = undefined; + this.serializedIntrinsic = statement; + } else { + this.sid = expectString(statement.Sid); + this.effect = expectEffect(statement.Effect); + this.resources = new Targets(statement, 'Resource', 'NotResource'); + this.actions = new Targets(statement, 'Action', 'NotAction'); + this.principals = new Targets(statement, 'Principal', 'NotPrincipal'); + this.condition = statement.Condition; + this.serializedIntrinsic = undefined; + } } /** * Whether this statement is equal to the other statement */ - public equal(other: Statement) { + public equal(other: Statement): boolean { return (this.sid === other.sid && this.effect === other.effect + && this.serializedIntrinsic === other.serializedIntrinsic && this.resources.equal(other.resources) && this.actions.equal(other.actions) && this.principals.equal(other.principals) && deepEqual(this.condition, other.condition)); } - public toJson(): StatementJson { - return deepRemoveUndefined({ - sid: this.sid, - effect: this.effect, - resources: this.resources.toJson(), - principals: this.principals.toJson(), - actions: this.actions.toJson(), - condition: this.condition, - }); + public render(): RenderedStatement { + return this.serializedIntrinsic + ? { + resource: this.serializedIntrinsic, + effect: '', + action: '', + principal: this.principals.render(), // these will be replaced by the call to replaceEmpty() from IamChanges + condition: '', + } + : { + resource: this.resources.render(), + effect: this.effect, + action: this.actions.render(), + principal: this.principals.render(), + condition: renderCondition(this.condition), + }; + } + + /** + * Return a machine-readable version of the changes. + * This is only used in tests. + * + * @internal + */ + public _toJson(): StatementJson { + return this.serializedIntrinsic + ? this.serializedIntrinsic + : deepRemoveUndefined({ + sid: this.sid, + effect: this.effect, + resources: this.resources._toJson(), + principals: this.principals._toJson(), + actions: this.actions._toJson(), + condition: this.condition, + }); } /** @@ -76,6 +116,14 @@ export class Statement { } } +export interface RenderedStatement { + readonly resource: string; + readonly effect: string; + readonly action: string; + readonly principal: string; + readonly condition: string; +} + export interface StatementJson { sid?: string; effect: string; @@ -199,7 +247,22 @@ export class Targets { this.values.sort(); } - public toJson(): TargetsJson { + /** + * Render into a summary table cell + */ + public render(): string { + return this.not + ? this.values.map(s => `NOT ${s}`).join('\n') + : this.values.join('\n'); + } + + /** + * Return a machine-readable version of the changes. + * This is only used in tests. + * + * @internal + */ + public _toJson(): TargetsJson { return { not: this.not, values: this.values }; } } @@ -243,7 +306,7 @@ function forceListOfStrings(x: unknown): string[] { /** * Render the Condition column */ -export function renderCondition(condition: any) { +export function renderCondition(condition: any): string { if (!condition || Object.keys(condition).length === 0) { return ''; } const jsonRepresentation = JSON.stringify(condition, undefined, 2); diff --git a/packages/@aws-cdk/cloudformation-diff/test/iam/detect-changes.test.ts b/packages/@aws-cdk/cloudformation-diff/test/iam/detect-changes.test.ts index 1cf62c8d5286b..fd457cd701b66 100644 --- a/packages/@aws-cdk/cloudformation-diff/test/iam/detect-changes.test.ts +++ b/packages/@aws-cdk/cloudformation-diff/test/iam/detect-changes.test.ts @@ -14,7 +14,7 @@ test('shows new AssumeRolePolicyDocument', () => { })); // THEN - expect(diff.iamChanges.toJson()).toEqual({ + expect(diff.iamChanges._toJson()).toEqual({ statementAdditions: [ { effect: 'Allow', @@ -41,7 +41,7 @@ test('implicitly knows principal of identity policy for all resource types', () })); // THEN - expect(diff.iamChanges.toJson()).toEqual({ + expect(diff.iamChanges._toJson()).toEqual({ statementAdditions: [ { effect: 'Allow', @@ -73,7 +73,7 @@ test('policies on an identity object', () => { })); // THEN - expect(diff.iamChanges.toJson()).toEqual({ + expect(diff.iamChanges._toJson()).toEqual({ statementAdditions: [ { effect: 'Allow', @@ -100,7 +100,7 @@ test('if policy is attached to multiple roles all are shown', () => { })); // THEN - expect(diff.iamChanges.toJson()).toEqual({ + expect(diff.iamChanges._toJson()).toEqual({ statementAdditions: [ { effect: 'Allow', @@ -131,7 +131,7 @@ test('correctly parses Lambda permissions', () => { })); // THEN - expect(diff.iamChanges.toJson()).toEqual({ + expect(diff.iamChanges._toJson()).toEqual({ statementAdditions: [ { effect: 'Allow', @@ -162,7 +162,7 @@ test('implicitly knows resource of (queue) resource policy even if * given', () })); // THEN - expect(diff.iamChanges.toJson()).toEqual({ + expect(diff.iamChanges._toJson()).toEqual({ statementAdditions: [ { effect: 'Allow', @@ -189,7 +189,7 @@ test('finds sole statement removals', () => { }), {}); // THEN - expect(diff.iamChanges.toJson()).toEqual({ + expect(diff.iamChanges._toJson()).toEqual({ statementRemovals: [ { effect: 'Allow', @@ -233,7 +233,7 @@ test('finds one of many statement removals', () => { })); // THEN - expect(diff.iamChanges.toJson()).toEqual({ + expect(diff.iamChanges._toJson()).toEqual({ statementRemovals: [ { effect: 'Allow', @@ -254,7 +254,7 @@ test('finds policy attachments', () => { })); // THEN - expect(diff.iamChanges.toJson()).toEqual({ + expect(diff.iamChanges._toJson()).toEqual({ managedPolicyAdditions: [ { identityArn: '${SomeRole}', @@ -279,7 +279,7 @@ test('finds policy removals', () => { })); // THEN - expect(diff.iamChanges.toJson()).toEqual({ + expect(diff.iamChanges._toJson()).toEqual({ managedPolicyRemovals: [ { identityArn: '${SomeRole}', @@ -314,7 +314,7 @@ test('queuepolicy queue change counts as removal+addition', () => { })); // THEN - expect(diff.iamChanges.toJson()).toEqual({ + expect(diff.iamChanges._toJson()).toEqual({ statementAdditions: [ { effect: 'Allow', @@ -333,3 +333,90 @@ test('queuepolicy queue change counts as removal+addition', () => { ], }); }); + +test('supports Fn::If in the top-level property value of Role', () => { + // WHEN + const diff = diffTemplate({}, template({ + MyRole: role({ + AssumeRolePolicyDocument: poldoc({ + Action: 'sts:AssumeRole', + Effect: 'Allow', + Principal: { Service: 'lambda.amazonaws.com' }, + }), + ManagedPolicyArns: { + 'Fn::If': [ + 'SomeCondition', + ['then-managed-policy-arn'], + ['else-managed-policy-arn'], + ], + }, + }), + })); + + // THEN + expect(diff.iamChanges._toJson()).toEqual({ + managedPolicyAdditions: [ + { + identityArn: '${MyRole}', + managedPolicyArn: '{"Fn::If":["SomeCondition",["then-managed-policy-arn"],["else-managed-policy-arn"]]}', + }, + ], + statementAdditions: [ + { + effect: 'Allow', + principals: { not: false, values: ['Service:lambda.amazonaws.com'] }, + actions: { not: false, values: ['sts:AssumeRole'] }, + resources: { + not: false, + values: ['${MyRole.Arn}'], + }, + }, + ], + }); +}); + +test('supports Fn::If in the elements of an array-typed property of Role', () => { + // WHEN + const diff = diffTemplate({}, template({ + MyRole: role({ + AssumeRolePolicyDocument: poldoc({ + Action: 'sts:AssumeRole', + Effect: 'Allow', + Principal: { Service: 'lambda.amazonaws.com' }, + }), + Policies: [ + { + 'Fn::If': [ + 'SomeCondition', + { + PolicyName: 'S3', + PolicyDocument: poldoc({ + Effect: 'Allow', + Action: 's3:GetObject', + Resource: '*', + }), + }, + { + Ref: 'AWS::NoValue', + }, + ], + }, + ], + }), + })); + + // THEN + const changedStatements = diff.iamChanges.summarizeStatements(); + + // there are 2 rows of changes + // (one for the AssumeRolePolicyDocument, + // one for the Policies), + // plus a row of headers + expect(changedStatements.length).toBe(3); + + const changedPolicies = changedStatements[2]; + const resourceColumn = 1, principalColumn = 4; + + expect(changedPolicies[resourceColumn]).toContain('{"Fn::If":["SomeCondition",{"PolicyName":"S3","PolicyDocument":{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"s3:GetObject","Resource":"*"}]}}]}'); + expect(changedPolicies[principalColumn]).toContain('AWS:${MyRole}'); +}); diff --git a/packages/@aws-cdk/core/lib/cfn-resource.ts b/packages/@aws-cdk/core/lib/cfn-resource.ts index c436e453cacac..9f9ee669374ed 100644 --- a/packages/@aws-cdk/core/lib/cfn-resource.ts +++ b/packages/@aws-cdk/core/lib/cfn-resource.ts @@ -320,13 +320,13 @@ export class CfnResource extends CfnRefElement { Description: this.cfnOptions.description, Metadata: ignoreEmpty(this.cfnOptions.metadata), Condition: this.cfnOptions.condition && this.cfnOptions.condition.logicalId, - }, props => { - const renderedProps = this.renderProperties(props.Properties || {}); + }, resourceDef => { + const renderedProps = this.renderProperties(resourceDef.Properties || {}); if (renderedProps) { const hasDefined = Object.values(renderedProps).find(v => v !== undefined); - props.Properties = hasDefined !== undefined ? renderedProps : undefined; + resourceDef.Properties = hasDefined !== undefined ? renderedProps : undefined; } - return deepMerge(props, this.rawOverrides); + return deepMerge(resourceDef, this.rawOverrides); }), }, }; diff --git a/packages/@aws-cdk/core/lib/construct-compat.ts b/packages/@aws-cdk/core/lib/construct-compat.ts index 76e95ad38071d..ac7873a837dde 100644 --- a/packages/@aws-cdk/core/lib/construct-compat.ts +++ b/packages/@aws-cdk/core/lib/construct-compat.ts @@ -472,6 +472,13 @@ export class ConstructNode { Aspects.of(this.host).add(aspect); } + /** + * Add a validator to this construct Node + */ + public addValidation(validation: constructs.IValidation) { + this._actualNode.addValidation(validation); + } + /** * All parent scopes of this construct. * diff --git a/packages/@aws-cdk/core/lib/nested-stack.ts b/packages/@aws-cdk/core/lib/nested-stack.ts index f130d00ded80b..648211aab22f0 100644 --- a/packages/@aws-cdk/core/lib/nested-stack.ts +++ b/packages/@aws-cdk/core/lib/nested-stack.ts @@ -8,6 +8,7 @@ import { CfnStack } from './cloudformation.generated'; import { Duration } from './duration'; import { Lazy } from './lazy'; import { Names } from './names'; +import { RemovalPolicy } from './removal-policy'; import { IResolveContext } from './resolvable'; import { Stack } from './stack'; import { NestedStackSynthesizer } from './stack-synthesizers'; @@ -60,6 +61,17 @@ export interface NestedStackProps { * @default - notifications are not sent for this stack. */ readonly notificationArns?: string[]; + + /** + * Policy to apply when the nested stack is removed + * + * The default is `Destroy`, because all Removal Policies of resources inside the + * Nested Stack should already have been set correctly. You normally should + * not need to set this value. + * + * @default RemovalPolicy.DESTROY + */ + readonly removalPolicy?: RemovalPolicy; } /** @@ -126,6 +138,7 @@ export class NestedStack extends Stack { notificationArns: props.notificationArns, timeoutInMinutes: props.timeout ? props.timeout.toMinutes() : undefined, }); + this.resource.applyRemovalPolicy(props.removalPolicy ?? RemovalPolicy.DESTROY); this.nestedStackResource = this.resource; diff --git a/packages/@aws-cdk/core/lib/private/synthesis.ts b/packages/@aws-cdk/core/lib/private/synthesis.ts index bcc6ddc94dbc8..737f11367e13f 100644 --- a/packages/@aws-cdk/core/lib/private/synthesis.ts +++ b/packages/@aws-cdk/core/lib/private/synthesis.ts @@ -171,11 +171,12 @@ function synthesizeTree(root: IConstruct, builder: cxapi.CloudAssemblyBuilder) { function validateTree(root: IConstruct) { const errors = new Array(); - visit(root, 'pre', construct => { - for (const message of construct.onValidate()) { - errors.push({ message, source: construct as unknown as Construct }); - } - }); + // Validations added through `node.addValidation()` + // This automatically also includes Ye Olde Method of validating, using + // the `protected validate()` methods. + errors.push(...constructs.Node.of(root).validate().map(e => ({ + message: e.message, source: e.source as unknown as Construct, + }))); if (errors.length > 0) { const errorList = errors.map(e => `[${e.source.node.path}] ${e.message}`).join('\n '); diff --git a/packages/@aws-cdk/core/lib/removal-policy.ts b/packages/@aws-cdk/core/lib/removal-policy.ts index 879a00f53b4f9..d815967fa2bf0 100644 --- a/packages/@aws-cdk/core/lib/removal-policy.ts +++ b/packages/@aws-cdk/core/lib/removal-policy.ts @@ -1,3 +1,28 @@ +/** + * Possible values for a resource's Removal Policy + * + * The removal policy controls what happens to the resource if it stops being + * managed by CloudFormation. This can happen in one of three situations: + * + * - The resource is removed from the template, so CloudFormation stops managing it; + * - A change to the resource is made that requires it to be replaced, so CloudFormation stops + * managing it; + * - The stack is deleted, so CloudFormation stops managing all resources in it. + * + * The Removal Policy applies to all above cases. + * + * Many stateful resources in the AWS Construct Library will accept a + * `removalPolicy` as a property, typically defaulting it to `RETAIN`. + * + * If the AWS Construct Library resource does not accept a `removalPolicy` + * argument, you can always configure it by using the escape hatch mechanism, + * as shown in the following example: + * + * ```ts + * const cfnBucket = bucket.node.findChild('Resource') as cdk.CfnResource; + * cfnBucket.applyRemovalPolicy(cdk.RemovalPolicy.DESTROY); + * ``` + */ export enum RemovalPolicy { /** * This is the default removal policy. It means that when the resource is diff --git a/packages/@aws-cdk/core/lib/resource.ts b/packages/@aws-cdk/core/lib/resource.ts index 6445fe718c547..a828f0d6cec98 100644 --- a/packages/@aws-cdk/core/lib/resource.ts +++ b/packages/@aws-cdk/core/lib/resource.ts @@ -1,15 +1,19 @@ -// v2 - leave this as a separate section so it reduces merge conflicts when compat is removed -// eslint-disable-next-line import/order -import { IConstruct, Construct as CoreConstruct } from './construct-compat'; - -import { Construct } from 'constructs'; import { ArnComponents } from './arn'; +import { CfnResource } from './cfn-resource'; +import { IConstruct, Construct as CoreConstruct } from './construct-compat'; import { IStringProducer, Lazy } from './lazy'; import { generatePhysicalName, isGeneratedWhenNeededMarker } from './private/physical-name-generator'; +import { Reference } from './reference'; +import { RemovalPolicy } from './removal-policy'; import { IResolveContext } from './resolvable'; import { Stack } from './stack'; import { Token, Tokenization } from './token'; -import { Reference } from './reference'; + +// v2 - leave this as a separate section so it reduces merge conflicts when compat is removed +// eslint-disable-next-line import/order +import { Construct } from 'constructs'; + +const RESOURCE_SYMBOL = Symbol.for('@aws-cdk/core.Resource'); /** * Represents the environment a given resource lives in. @@ -92,6 +96,13 @@ export interface ResourceProps { * A construct which represents an AWS resource. */ export abstract class Resource extends CoreConstruct implements IResource { + /** + * Check whether the given construct is a Resource + */ + public static isResource(construct: IConstruct): construct is CfnResource { + return construct !== null && typeof(construct) === 'object' && RESOURCE_SYMBOL in construct; + } + public readonly stack: Stack; public readonly env: ResourceEnvironment; @@ -115,6 +126,8 @@ export abstract class Resource extends CoreConstruct implements IResource { constructor(scope: Construct, id: string, props: ResourceProps = {}) { super(scope, id); + Object.defineProperty(this, RESOURCE_SYMBOL, { value: true }); + this.stack = Stack.of(this); this.env = { account: props.account ?? this.stack.account, @@ -165,6 +178,25 @@ export abstract class Resource extends CoreConstruct implements IResource { } } + /** + * Apply the given removal policy to this resource + * + * The Removal Policy controls what happens to this resource when it stops + * being managed by CloudFormation, either because you've removed it from the + * CDK application or because you've made a change that requires the resource + * to be replaced. + * + * The resource can be deleted (`RemovalPolicy.DELETE`), or left in your AWS + * account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). + */ + public applyRemovalPolicy(policy: RemovalPolicy) { + const child = this.node.defaultChild; + if (!child || !CfnResource.isCfnResource(child)) { + throw new Error('Cannot apply RemovalPolicy: no child or not a CfnResource. Apply the removal policy on the CfnResource directly.'); + } + child.applyRemovalPolicy(policy); + } + protected generatePhysicalName(): string { return generatePhysicalName(this); } diff --git a/packages/@aws-cdk/core/package.json b/packages/@aws-cdk/core/package.json index d18faeea26e0a..643f809bca142 100644 --- a/packages/@aws-cdk/core/package.json +++ b/packages/@aws-cdk/core/package.json @@ -176,12 +176,12 @@ "devDependencies": { "@types/lodash": "^4.14.168", "@types/minimatch": "^3.0.3", - "@types/node": "^10.17.52", + "@types/node": "^10.17.54", "@types/sinon": "^9.0.10", "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "fast-check": "^2.13.0", - "lodash": "^4.17.20", + "lodash": "^4.17.21", "nodeunit-shim": "0.0.0", "pkglint": "0.0.0", "sinon": "^9.2.4", diff --git a/packages/@aws-cdk/core/test/stack.test.ts b/packages/@aws-cdk/core/test/stack.test.ts index 8891dbaa138c6..849ad10369147 100644 --- a/packages/@aws-cdk/core/test/stack.test.ts +++ b/packages/@aws-cdk/core/test/stack.test.ts @@ -640,7 +640,25 @@ describe('stack', () => { const assembly = app.synth(); expect(assembly.getStackByName(parentStack.stackName).template).toEqual({ Resources: { MyParentResource: { Type: 'Resource::Parent' } } }); expect(assembly.getStackByName(childStack.stackName).template).toEqual({ Resources: { MyChildResource: { Type: 'Resource::Child' } } }); + }); + + test('Nested Stacks are synthesized with DESTROY policy', () => { + const app = new App(); + // WHEN + const parentStack = new Stack(app, 'parent'); + const childStack = new NestedStack(parentStack, 'child'); + new CfnResource(childStack, 'ChildResource', { type: 'Resource::Child' }); + + const assembly = app.synth(); + expect(assembly.getStackByName(parentStack.stackName).template).toEqual(expect.objectContaining({ + Resources: { + childNestedStackchildNestedStackResource7408D03F: expect.objectContaining({ + Type: 'AWS::CloudFormation::Stack', + DeletionPolicy: 'Delete', + }), + }, + })); }); test('cross-stack reference (substack references parent stack)', () => { diff --git a/packages/@aws-cdk/custom-resources/lib/provider-framework/provider.ts b/packages/@aws-cdk/custom-resources/lib/provider-framework/provider.ts index 9da696f268b92..2139866ae3d06 100644 --- a/packages/@aws-cdk/custom-resources/lib/provider-framework/provider.ts +++ b/packages/@aws-cdk/custom-resources/lib/provider-framework/provider.ts @@ -93,6 +93,16 @@ export interface ProviderProps { */ readonly vpcSubnets?: ec2.SubnetSelection; + /** + * Security groups to attach to the provider functions. + * + * Only used if 'vpc' is supplied + * + * @default - If `vpc` is not supplied, no security groups are attached. Otherwise, a dedicated security + * group is created for each function. + */ + readonly securityGroups?: ec2.ISecurityGroup[]; + } /** @@ -122,6 +132,7 @@ export class Provider extends CoreConstruct implements cfn.ICustomResourceProvid private readonly logRetention?: logs.RetentionDays; private readonly vpc?: ec2.IVpc; private readonly vpcSubnets?: ec2.SubnetSelection; + private readonly securityGroups?: ec2.ISecurityGroup[]; constructor(scope: Construct, id: string, props: ProviderProps) { super(scope, id); @@ -137,6 +148,7 @@ export class Provider extends CoreConstruct implements cfn.ICustomResourceProvid this.logRetention = props.logRetention; this.vpc = props.vpc; this.vpcSubnets = props.vpcSubnets; + this.securityGroups = props.securityGroups; const onEventFunction = this.createFunction(consts.FRAMEWORK_ON_EVENT_HANDLER_NAME); @@ -182,6 +194,7 @@ export class Provider extends CoreConstruct implements cfn.ICustomResourceProvid logRetention: this.logRetention, vpc: this.vpc, vpcSubnets: this.vpcSubnets, + securityGroups: this.securityGroups, }); fn.addEnvironment(consts.USER_ON_EVENT_FUNCTION_ARN_ENV, this.onEventHandler.functionArn); diff --git a/packages/@aws-cdk/custom-resources/package.json b/packages/@aws-cdk/custom-resources/package.json index 8fd47caf032b0..aed86e63bdb0f 100644 --- a/packages/@aws-cdk/custom-resources/package.json +++ b/packages/@aws-cdk/custom-resources/package.json @@ -78,7 +78,7 @@ "@types/aws-lambda": "^8.10.72", "@types/fs-extra": "^8.1.1", "@types/sinon": "^9.0.10", - "aws-sdk": "^2.845.0", + "aws-sdk": "^2.848.0", "aws-sdk-mock": "^5.1.0", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", diff --git a/packages/@aws-cdk/custom-resources/test/provider-framework/provider.test.ts b/packages/@aws-cdk/custom-resources/test/provider-framework/provider.test.ts index deed031d8909f..b60ef1a602431 100644 --- a/packages/@aws-cdk/custom-resources/test/provider-framework/provider.test.ts +++ b/packages/@aws-cdk/custom-resources/test/provider-framework/provider.test.ts @@ -8,6 +8,75 @@ import * as util from '../../lib/provider-framework/util'; import '@aws-cdk/assert/jest'; +test('security groups are applied to all framework functions', () => { + + // GIVEN + const stack = new Stack(); + + const vpc = new ec2.Vpc(stack, 'Vpc'); + const securityGroup = new ec2.SecurityGroup(stack, 'SecurityGroup', { vpc }); + + // WHEN + new cr.Provider(stack, 'MyProvider', { + onEventHandler: new lambda.Function(stack, 'OnEvent', { + code: lambda.Code.fromInline('foo'), + handler: 'index.onEvent', + runtime: lambda.Runtime.NODEJS_10_X, + }), + isCompleteHandler: new lambda.Function(stack, 'IsComplete', { + code: lambda.Code.fromInline('foo'), + handler: 'index.isComplete', + runtime: lambda.Runtime.NODEJS_10_X, + }), + vpc: vpc, + vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE }, + securityGroups: [securityGroup], + }); + + expect(stack).toHaveResourceLike('AWS::Lambda::Function', { + Handler: 'framework.onEvent', + VpcConfig: { + SecurityGroupIds: [ + { + 'Fn::GetAtt': [ + 'SecurityGroupDD263621', + 'GroupId', + ], + }, + ], + }, + }); + + expect(stack).toHaveResourceLike('AWS::Lambda::Function', { + Handler: 'framework.isComplete', + VpcConfig: { + SecurityGroupIds: [ + { + 'Fn::GetAtt': [ + 'SecurityGroupDD263621', + 'GroupId', + ], + }, + ], + }, + }); + + expect(stack).toHaveResourceLike('AWS::Lambda::Function', { + Handler: 'framework.onTimeout', + VpcConfig: { + SecurityGroupIds: [ + { + 'Fn::GetAtt': [ + 'SecurityGroupDD263621', + 'GroupId', + ], + }, + ], + }, + }); + +}); + test('vpc is applied to all framework functions', () => { // GIVEN diff --git a/packages/@aws-cdk/cx-api/lib/features.ts b/packages/@aws-cdk/cx-api/lib/features.ts index 57c9a5738ee96..24ba471882644 100644 --- a/packages/@aws-cdk/cx-api/lib/features.ts +++ b/packages/@aws-cdk/cx-api/lib/features.ts @@ -102,7 +102,7 @@ export const S3_GRANT_WRITE_WITHOUT_ACL = '@aws-cdk/aws-s3:grantWriteWithoutAcl' * * Tests must cover the default (disabled) case and the future (enabled) case. */ -export const FUTURE_FLAGS = { +export const FUTURE_FLAGS: { [key: string]: any } = { [ENABLE_STACK_NAME_DUPLICATES_CONTEXT]: 'true', [ENABLE_DIFF_NO_FAIL_CONTEXT]: 'true', [STACK_RELATIVE_EXPORTS_CONTEXT]: 'true', diff --git a/packages/@aws-cdk/pipelines/test/integ.pipeline-with-assets.expected.json b/packages/@aws-cdk/pipelines/test/integ.pipeline-with-assets.expected.json index f0427b95f7b51..248e3b79911c9 100644 --- a/packages/@aws-cdk/pipelines/test/integ.pipeline-with-assets.expected.json +++ b/packages/@aws-cdk/pipelines/test/integ.pipeline-with-assets.expected.json @@ -133,7 +133,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -688,7 +688,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", diff --git a/packages/@aws-cdk/pipelines/test/integ.pipeline.expected.json b/packages/@aws-cdk/pipelines/test/integ.pipeline.expected.json index 787f89f4c09fb..5d1569fbadc84 100644 --- a/packages/@aws-cdk/pipelines/test/integ.pipeline.expected.json +++ b/packages/@aws-cdk/pipelines/test/integ.pipeline.expected.json @@ -133,7 +133,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", @@ -621,7 +621,7 @@ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*" ], "Effect": "Allow", diff --git a/packages/@monocdk-experiment/assert/package.json b/packages/@monocdk-experiment/assert/package.json index 63fd5a2e86164..86806f041880f 100644 --- a/packages/@monocdk-experiment/assert/package.json +++ b/packages/@monocdk-experiment/assert/package.json @@ -35,7 +35,7 @@ "devDependencies": { "@monocdk-experiment/rewrite-imports": "0.0.0", "@types/jest": "^26.0.20", - "@types/node": "^10.17.52", + "@types/node": "^10.17.54", "cdk-build-tools": "0.0.0", "constructs": "^3.2.0", "jest": "^26.6.3", diff --git a/packages/@monocdk-experiment/rewrite-imports/package.json b/packages/@monocdk-experiment/rewrite-imports/package.json index 678eba3f64183..b824068d0354f 100644 --- a/packages/@monocdk-experiment/rewrite-imports/package.json +++ b/packages/@monocdk-experiment/rewrite-imports/package.json @@ -38,7 +38,7 @@ "devDependencies": { "@types/glob": "^7.1.3", "@types/jest": "^26.0.20", - "@types/node": "^10.17.52", + "@types/node": "^10.17.54", "cdk-build-tools": "0.0.0", "pkglint": "0.0.0" }, diff --git a/packages/aws-cdk-lib/package.json b/packages/aws-cdk-lib/package.json index cb0a8f61b8892..6eadd958185df 100644 --- a/packages/aws-cdk-lib/package.json +++ b/packages/aws-cdk-lib/package.json @@ -283,7 +283,7 @@ "@aws-cdk/region-info": "0.0.0", "@aws-cdk/yaml-cfn": "0.0.0", "@types/fs-extra": "^8.1.1", - "@types/node": "^10.17.52", + "@types/node": "^10.17.54", "cdk-build-tools": "0.0.0", "constructs": "^3.2.0", "fs-extra": "^9.1.0", diff --git a/packages/aws-cdk/lib/init.ts b/packages/aws-cdk/lib/init.ts index 6166736f3e8da..78c844b0a6550 100644 --- a/packages/aws-cdk/lib/init.ts +++ b/packages/aws-cdk/lib/init.ts @@ -179,10 +179,15 @@ export class InitTemplate { return; } + const futureFlags: {[key: string]: any} = {}; + Object.entries(cxapi.FUTURE_FLAGS) + .filter(([k, _]) => !cxapi.FUTURE_FLAGS_EXPIRED.includes(k)) + .forEach(([k, v]) => futureFlags[k] = v); + const config = await fs.readJson(cdkJson); config.context = { ...config.context, - ...cxapi.FUTURE_FLAGS, + ...futureFlags, }; await fs.writeJson(cdkJson, config, { spaces: 2 }); diff --git a/packages/aws-cdk/package.json b/packages/aws-cdk/package.json index a1c39059aeb8e..a3f34cdacf9d4 100644 --- a/packages/aws-cdk/package.json +++ b/packages/aws-cdk/package.json @@ -39,14 +39,14 @@ "license": "Apache-2.0", "devDependencies": { "@aws-cdk/core": "0.0.0", - "@octokit/rest": "^18.1.1", + "@octokit/rest": "^18.2.0", "@types/archiver": "^5.1.0", "@types/fs-extra": "^8.1.1", "@types/glob": "^7.1.3", "@types/jest": "^26.0.20", "@types/minimatch": "^3.0.3", "@types/mockery": "^1.4.29", - "@types/node": "^10.17.52", + "@types/node": "^10.17.54", "@types/promptly": "^3.0.1", "@types/semver": "^7.3.4", "@types/sinon": "^9.0.10", @@ -73,7 +73,7 @@ "@aws-cdk/region-info": "0.0.0", "@aws-cdk/yaml-cfn": "0.0.0", "archiver": "^5.2.0", - "aws-sdk": "^2.845.0", + "aws-sdk": "^2.848.0", "camelcase": "^6.2.0", "cdk-assets": "0.0.0", "colors": "^1.4.0", diff --git a/packages/aws-cdk/test/init.test.ts b/packages/aws-cdk/test/init.test.ts index db042d76fc25d..e659161fbb38a 100644 --- a/packages/aws-cdk/test/init.test.ts +++ b/packages/aws-cdk/test/init.test.ts @@ -83,10 +83,15 @@ describe.each(['1', '2'])('v%s tests', (majorVersion) => { const config = await fs.readJson(path.join(tmpDir, 'cdk.json')); const context = config.context || {}; - for (const [key, expected] of Object.entries(cxapi.FUTURE_FLAGS)) { - const actual = context[key]; + for (const [key, expected] of Object.entries(context)) { + const actual = cxapi.FUTURE_FLAGS[key]; expect(actual).toEqual(expected); } + + // assert that expired future flags are not part of the cdk.json + Object.keys(context).forEach(k => { + expect(cxapi.FUTURE_FLAGS_EXPIRED.includes(k)).toEqual(false); + }); }); } } diff --git a/packages/cdk-assets/package.json b/packages/cdk-assets/package.json index b2a142c523dd6..16f767306dbdc 100644 --- a/packages/cdk-assets/package.json +++ b/packages/cdk-assets/package.json @@ -35,7 +35,7 @@ "@types/jest": "^26.0.20", "@types/jszip": "^3.4.1", "@types/mock-fs": "^4.13.0", - "@types/node": "^10.17.52", + "@types/node": "^10.17.54", "@types/yargs": "^15.0.13", "cdk-build-tools": "0.0.0", "jest": "^26.6.3", @@ -47,7 +47,7 @@ "@aws-cdk/cloud-assembly-schema": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "archiver": "^5.2.0", - "aws-sdk": "^2.845.0", + "aws-sdk": "^2.848.0", "glob": "^7.1.6", "yargs": "^16.2.0" }, diff --git a/packages/decdk/test/__snapshots__/synth.test.js.snap b/packages/decdk/test/__snapshots__/synth.test.js.snap index 1e8c00e6bd957..86a1fdd32f534 100644 --- a/packages/decdk/test/__snapshots__/synth.test.js.snap +++ b/packages/decdk/test/__snapshots__/synth.test.js.snap @@ -1786,7 +1786,7 @@ Object { "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*", ], "Effect": "Allow", @@ -2458,7 +2458,7 @@ Object { "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*", ], "Effect": "Allow", @@ -2585,7 +2585,7 @@ Object { "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", - "s3:PutObject*", + "s3:PutObject", "s3:Abort*", ], "Effect": "Allow", @@ -2735,7 +2735,9 @@ exports[`pure-cfn.json: pure-cfn 1`] = ` Object { "Resources": Object { "Hello4A628BD4": Object { + "DeletionPolicy": "Delete", "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Delete", }, "MyLogGroup": Object { "Properties": Object { @@ -2753,6 +2755,7 @@ exports[`queue-kms.json: queue-kms 1`] = ` Object { "Resources": Object { "MyQueueE6CA6235": Object { + "DeletionPolicy": "Delete", "Properties": Object { "KmsMasterKeyId": Object { "Fn::GetAtt": Array [ @@ -2762,6 +2765,7 @@ Object { }, }, "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Delete", }, "MyQueueKey6C31ABF3": Object { "DeletionPolicy": "Retain", diff --git a/packages/decdk/test/fixture/tsconfig.json b/packages/decdk/test/fixture/tsconfig.json index 44dbf4775b1a7..1b7d2bae0fab0 100644 --- a/packages/decdk/test/fixture/tsconfig.json +++ b/packages/decdk/test/fixture/tsconfig.json @@ -4,6 +4,7 @@ "charset": "utf8", "declaration": true, "experimentalDecorators": true, + "incremental": true, "inlineSourceMap": true, "inlineSources": true, "lib": [ @@ -22,8 +23,10 @@ "strict": true, "strictNullChecks": true, "strictPropertyInitialization": true, - "stripInternal": true, - "target": "ES2018" + "stripInternal": false, + "target": "ES2018", + "composite": false, + "tsBuildInfoFile": "tsconfig.tsbuildinfo" }, "include": [ "**/*.ts" diff --git a/packages/decdk/test/synth.test.ts b/packages/decdk/test/synth.test.ts index 8c3a27e056d52..8952a9aa11fd8 100644 --- a/packages/decdk/test/synth.test.ts +++ b/packages/decdk/test/synth.test.ts @@ -2,6 +2,7 @@ import * as cdk from '@aws-cdk/core'; import * as fs from 'fs'; import * as reflect from 'jsii-reflect'; import * as path from 'path'; +import { FUTURE_FLAGS } from '@aws-cdk/cx-api'; import { DeclarativeStack, loadTypeSystem, readTemplate, stackNameFromFileName } from '../lib'; const VALIDATE_ASSEMBLIES = true; @@ -33,10 +34,7 @@ for (const templateFile of fs.readdirSync(dir)) { const app = new cdk.App({ context: { - '@aws-cdk/aws-ecr-assets:dockerIgnoreSupport': true, - '@aws-cdk/aws-kms:defaultKeyPolicies': true, - '@aws-cdk/core:enableStackNameDuplicates': true, - '@aws-cdk/aws-secretsmanager:parseOwnedSecretName': true, + ...FUTURE_FLAGS, } }); const stackName = stackNameFromFileName(templateFile); diff --git a/packages/monocdk/package.json b/packages/monocdk/package.json index d328a702272e3..c71d755b3c2bb 100644 --- a/packages/monocdk/package.json +++ b/packages/monocdk/package.json @@ -288,7 +288,7 @@ "@aws-cdk/region-info": "0.0.0", "@aws-cdk/yaml-cfn": "0.0.0", "@types/fs-extra": "^8.1.1", - "@types/node": "^10.17.52", + "@types/node": "^10.17.54", "cdk-build-tools": "0.0.0", "constructs": "^3.2.0", "fs-extra": "^9.1.0", diff --git a/tools/cdk-integ-tools/lib/integ-helpers.ts b/tools/cdk-integ-tools/lib/integ-helpers.ts index 7e7e4ee460e7f..bf65e8cbb8b9a 100644 --- a/tools/cdk-integ-tools/lib/integ-helpers.ts +++ b/tools/cdk-integ-tools/lib/integ-helpers.ts @@ -1,6 +1,7 @@ // Helper functions for integration tests import { spawnSync } from 'child_process'; import * as path from 'path'; +import { FUTURE_FLAGS } from '@aws-cdk/cx-api'; import * as fs from 'fs-extra'; import { AVAILABILITY_ZONE_FALLBACK_CONTEXT_KEY } from '../../../packages/@aws-cdk/cx-api/lib'; @@ -338,10 +339,7 @@ export const DEFAULT_SYNTH_OPTIONS = { ], }, // Enable feature flags for all integ tests - '@aws-cdk/aws-ecr-assets:dockerIgnoreSupport': true, - '@aws-cdk/aws-kms:defaultKeyPolicies': true, - '@aws-cdk/core:enableStackNameDuplicates': true, - '@aws-cdk/aws-secretsmanager:parseOwnedSecretName': true, + ...FUTURE_FLAGS, }, env: { CDK_INTEG_ACCOUNT: '12345678', diff --git a/tools/cfn2ts/lib/codegen.ts b/tools/cfn2ts/lib/codegen.ts index 08d0636a841f5..c06fce32e10ff 100644 --- a/tools/cfn2ts/lib/codegen.ts +++ b/tools/cfn2ts/lib/codegen.ts @@ -1,4 +1,4 @@ -import { schema } from '@aws-cdk/cfnspec'; +import { schema, cfnLintAnnotations } from '@aws-cdk/cfnspec'; import { CodeMaker } from 'codemaker'; import * as genspec from './genspec'; import { itemTypeNames, PropertyAttributeName, scalarTypeNames, SpecName } from './spec-utils'; @@ -125,7 +125,7 @@ export default class CodeGenerator { this.code.closeBlock(); this.code.line(); - this.emitValidator(resourceContext, name, spec.Properties, conversionTable); + this.emitPropertiesValidator(resourceContext, name, spec.Properties, conversionTable); this.code.line(); this.emitCloudFormationMapper(resourceContext, name, spec.Properties, conversionTable); this.emitFromCfnFactoryFunction(resourceContext, name, spec.Properties, conversionTable, false); @@ -343,6 +343,13 @@ export default class CodeGenerator { } } } + + // + // Validator + // + this.emitConstructValidator(resourceName); + + // End constructor this.code.closeBlock(); this.code.line(); @@ -385,6 +392,37 @@ export default class CodeGenerator { this.code.closeBlock(); } + /** + * Add validations for the given construct + * + * The generated code looks like this: + * + * ``` + * this.node.addValidation({ validate: () => /* validation code * / }); + * } + * ``` + */ + private emitConstructValidator(resourceType: genspec.CodeName) { + const cfnLint = cfnLintAnnotations(resourceType.specName?.fqn ?? ''); + + if (cfnLint.stateful) { + // Do a statefulness check. A deletionPolicy is required (and in normal operation an UpdateReplacePolicy + // would also be set if a user doesn't do complicated shenanigans, in which case they probably know what + // they're doing. + // + // Only do this for L1s embedded in L2s (to force L2 authors to add a way to set this policy). If we did it for all L1s: + // + // - users working at the L1 level would start getting synthesis failures when we add this feature + // - the `cloudformation-include` library that loads CFN templates to L1s would start failing when it loads + // templates that don't have DeletionPolicy set. + this.code.openBlock(`if (this.node.scope && ${CORE}.Resource.isResource(this.node.scope))`); + this.code.line('this.node.addValidation({ validate: () => this.cfnOptions.deletionPolicy === undefined'); + this.code.line(` ? [\'\\\'${resourceType.specName?.fqn}\\\' is a stateful resource type, and you must specify a Removal Policy for it. Call \\\'resource.applyRemovalPolicy()\\\'.\']`); + this.code.line(' : [] });'); + this.code.closeBlock(); + } + } + /** * Emit the function that is going to implement the IInspectable interface. * @@ -665,7 +703,7 @@ export default class CodeGenerator { * * Generated as a top-level function outside any namespace so we can hide it from library consumers. */ - private emitValidator( + private emitPropertiesValidator( resource: genspec.CodeName, typeName: genspec.CodeName, propSpecs: { [name: string]: schema.Property }, @@ -828,7 +866,7 @@ export default class CodeGenerator { this.endNamespace(typeName); this.code.line(); - this.emitValidator(resourceContext, typeName, propTypeSpec.Properties, conversionTable); + this.emitPropertiesValidator(resourceContext, typeName, propTypeSpec.Properties, conversionTable); this.code.line(); this.emitCloudFormationMapper(resourceContext, typeName, propTypeSpec.Properties, conversionTable); this.emitFromCfnFactoryFunction(resourceContext, typeName, propTypeSpec.Properties, conversionTable, true); diff --git a/tools/eslint-plugin-cdk/package.json b/tools/eslint-plugin-cdk/package.json index ac31c477d5687..2c412f30e739e 100644 --- a/tools/eslint-plugin-cdk/package.json +++ b/tools/eslint-plugin-cdk/package.json @@ -15,7 +15,7 @@ "@types/eslint": "^7.2.6", "@types/fs-extra": "^8.1.1", "@types/jest": "^26.0.20", - "@types/node": "^10.17.52", + "@types/node": "^10.17.54", "eslint-plugin-rulesdir": "^0.1.0", "jest": "^26.6.3", "typescript": "~3.9.9" diff --git a/tools/nodeunit-shim/package.json b/tools/nodeunit-shim/package.json index 44b49ce65ddff..bc18b8dafe37c 100644 --- a/tools/nodeunit-shim/package.json +++ b/tools/nodeunit-shim/package.json @@ -13,7 +13,7 @@ }, "devDependencies": { "@types/jest": "^26.0.20", - "@types/node": "^10.17.52", + "@types/node": "^10.17.54", "typescript": "~3.9.9" }, "dependencies": { diff --git a/tools/yarn-cling/package.json b/tools/yarn-cling/package.json index b1fcceb28877a..7a5f00b076fb3 100644 --- a/tools/yarn-cling/package.json +++ b/tools/yarn-cling/package.json @@ -39,7 +39,7 @@ }, "devDependencies": { "@types/jest": "^26.0.20", - "@types/node": "^10.17.52", + "@types/node": "^10.17.54", "@types/yarnpkg__lockfile": "^1.1.4", "jest": "^26.6.3", "pkglint": "0.0.0", diff --git a/version.v1.json b/version.v1.json index eca0b33c11e76..aa566c6d404ff 100644 --- a/version.v1.json +++ b/version.v1.json @@ -1,3 +1,3 @@ { - "version": "1.90.1" + "version": "1.91.0" } diff --git a/yarn.lock b/yarn.lock index bfc36ea7eb75a..0044085ed9ce5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17,18 +17,18 @@ "@babel/highlight" "^7.12.13" "@babel/core@^7.1.0", "@babel/core@^7.7.5": - version "7.12.16" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.12.16.tgz#8c6ba456b23b680a6493ddcfcd9d3c3ad51cab7c" - integrity sha512-t/hHIB504wWceOeaOoONOhu+gX+hpjfeN6YRBT209X/4sibZQfSF1I0HFRRlBe97UZZosGx5XwUg1ZgNbelmNw== + version "7.12.17" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.12.17.tgz#993c5e893333107a2815d8e0d73a2c3755e280b2" + integrity sha512-V3CuX1aBywbJvV2yzJScRxeiiw0v2KZZYYE3giywxzFJL13RiyPjaaDwhDnxmgFTTS7FgvM2ijr4QmKNIu0AtQ== dependencies: "@babel/code-frame" "^7.12.13" - "@babel/generator" "^7.12.15" - "@babel/helper-module-transforms" "^7.12.13" - "@babel/helpers" "^7.12.13" - "@babel/parser" "^7.12.16" + "@babel/generator" "^7.12.17" + "@babel/helper-module-transforms" "^7.12.17" + "@babel/helpers" "^7.12.17" + "@babel/parser" "^7.12.17" "@babel/template" "^7.12.13" - "@babel/traverse" "^7.12.13" - "@babel/types" "^7.12.13" + "@babel/traverse" "^7.12.17" + "@babel/types" "^7.12.17" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.1" @@ -37,12 +37,12 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/generator@^7.12.13", "@babel/generator@^7.12.15", "@babel/generator@^7.4.0": - version "7.12.15" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.12.15.tgz#4617b5d0b25cc572474cc1aafee1edeaf9b5368f" - integrity sha512-6F2xHxBiFXWNSGb7vyCUTBF8RCLY66rS0zEPcP8t/nQyXjha5EuK4z7H5o7fWG8B4M7y6mqVWq1J+1PuwRhecQ== +"@babel/generator@^7.12.17", "@babel/generator@^7.4.0": + version "7.12.17" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.12.17.tgz#9ef1dd792d778b32284411df63f4f668a9957287" + integrity sha512-DSA7ruZrY4WI8VxuS1jWSRezFnghEoYEFrZcw9BizQRmOZiUsiHl59+qEARGPqPikwA/GPTyRCi7isuCK/oyqg== dependencies: - "@babel/types" "^7.12.13" + "@babel/types" "^7.12.17" jsesc "^2.5.1" source-map "^0.5.0" @@ -63,11 +63,11 @@ "@babel/types" "^7.12.13" "@babel/helper-member-expression-to-functions@^7.12.13": - version "7.12.16" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.16.tgz#41e0916b99f8d5f43da4f05d85f4930fa3d62b22" - integrity sha512-zYoZC1uvebBFmj1wFAlXwt35JLEgecefATtKp20xalwEK8vHAixLBXTGxNrVGEmTT+gzOThUgr8UEdgtalc1BQ== + version "7.12.17" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.17.tgz#f82838eb06e1235307b6d71457b6670ff71ee5ac" + integrity sha512-Bzv4p3ODgS/qpBE0DiJ9qf5WxSmrQ8gVTe8ClMfwwsY2x/rhykxxy3bXzG7AGTnPB2ij37zGJ/Q/6FruxHxsxg== dependencies: - "@babel/types" "^7.12.13" + "@babel/types" "^7.12.17" "@babel/helper-module-imports@^7.12.13": version "7.12.13" @@ -76,10 +76,10 @@ dependencies: "@babel/types" "^7.12.13" -"@babel/helper-module-transforms@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.12.13.tgz#01afb052dcad2044289b7b20beb3fa8bd0265bea" - integrity sha512-acKF7EjqOR67ASIlDTupwkKM1eUisNAjaSduo5Cz+793ikfnpe7p4Q7B7EWU2PCoSTPWsQkR7hRUWEIZPiVLGA== +"@babel/helper-module-transforms@^7.12.17": + version "7.12.17" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.12.17.tgz#7c75b987d6dfd5b48e575648f81eaac891539509" + integrity sha512-sFL+p6zOCQMm9vilo06M4VHuTxUAwa6IxgL56Tq1DVtA0ziAGTH1ThmJq7xwPqdQlgAbKX3fb0oZNbtRIyA5KQ== dependencies: "@babel/helper-module-imports" "^7.12.13" "@babel/helper-replace-supers" "^7.12.13" @@ -87,8 +87,8 @@ "@babel/helper-split-export-declaration" "^7.12.13" "@babel/helper-validator-identifier" "^7.12.11" "@babel/template" "^7.12.13" - "@babel/traverse" "^7.12.13" - "@babel/types" "^7.12.13" + "@babel/traverse" "^7.12.17" + "@babel/types" "^7.12.17" lodash "^4.17.19" "@babel/helper-optimise-call-expression@^7.12.13": @@ -132,14 +132,14 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz#c9a1f021917dcb5ccf0d4e453e399022981fc9ed" integrity sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw== -"@babel/helpers@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.12.13.tgz#3c75e993632e4dadc0274eae219c73eb7645ba47" - integrity sha512-oohVzLRZ3GQEk4Cjhfs9YkJA4TdIDTObdBEZGrd6F/T0GPSnuV6l22eMcxlvcvzVIPH3VTtxbseudM1zIE+rPQ== +"@babel/helpers@^7.12.17": + version "7.12.17" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.12.17.tgz#71e03d2981a6b5ee16899964f4101dc8471d60bc" + integrity sha512-tEpjqSBGt/SFEsFikKds1sLNChKKGGR17flIgQKXH4fG6m9gTgl3gnOC1giHNyaBCSKuTfxaSzHi7UnvqiVKxg== dependencies: "@babel/template" "^7.12.13" - "@babel/traverse" "^7.12.13" - "@babel/types" "^7.12.13" + "@babel/traverse" "^7.12.17" + "@babel/types" "^7.12.17" "@babel/highlight@^7.10.4", "@babel/highlight@^7.12.13": version "7.12.13" @@ -150,10 +150,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.12.16", "@babel/parser@^7.4.3": - version "7.12.16" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.16.tgz#cc31257419d2c3189d394081635703f549fc1ed4" - integrity sha512-c/+u9cqV6F0+4Hpq01jnJO+GLp2DdT63ppz9Xa+6cHaajM9VFzK/iDXiKK65YtpeVwu+ctfS6iqlMqRgQRzeCw== +"@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.12.17", "@babel/parser@^7.4.3": + version "7.12.17" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.17.tgz#bc85d2d47db38094e5bb268fc761716e7d693848" + integrity sha512-r1yKkiUTYMQ8LiEI0UcQx5ETw5dpTLn9wijn9hk6KkTtOK95FndDN10M+8/s6k/Ymlbivw0Av9q4SlgF80PtHg== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -248,25 +248,25 @@ "@babel/parser" "^7.12.13" "@babel/types" "^7.12.13" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.12.13", "@babel/traverse@^7.4.3": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.12.13.tgz#689f0e4b4c08587ad26622832632735fb8c4e0c0" - integrity sha512-3Zb4w7eE/OslI0fTp8c7b286/cQps3+vdLW3UcwC8VSJC6GbKn55aeVVu2QJNuCDoeKyptLOFrPq8WqZZBodyA== +"@babel/traverse@^7.1.0", "@babel/traverse@^7.12.13", "@babel/traverse@^7.12.17", "@babel/traverse@^7.4.3": + version "7.12.17" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.12.17.tgz#40ec8c7ffb502c4e54c7f95492dc11b88d718619" + integrity sha512-LGkTqDqdiwC6Q7fWSwQoas/oyiEYw6Hqjve5KOSykXkmFJFqzvGMb9niaUEag3Rlve492Mkye3gLw9FTv94fdQ== dependencies: "@babel/code-frame" "^7.12.13" - "@babel/generator" "^7.12.13" + "@babel/generator" "^7.12.17" "@babel/helper-function-name" "^7.12.13" "@babel/helper-split-export-declaration" "^7.12.13" - "@babel/parser" "^7.12.13" - "@babel/types" "^7.12.13" + "@babel/parser" "^7.12.17" + "@babel/types" "^7.12.17" debug "^4.1.0" globals "^11.1.0" lodash "^4.17.19" -"@babel/types@^7.0.0", "@babel/types@^7.12.13", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.0": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.12.13.tgz#8be1aa8f2c876da11a9cf650c0ecf656913ad611" - integrity sha512-oKrdZTld2im1z8bDwTOQvUbxKwE+854zc16qWZQlcTqMN00pWxHQ4ZeOq0yDMnisOpRykH2/5Qqcrk/OlbAjiQ== +"@babel/types@^7.0.0", "@babel/types@^7.12.13", "@babel/types@^7.12.17", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.0": + version "7.12.17" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.12.17.tgz#9d711eb807e0934c90b8b1ca0eb1f7230d150963" + integrity sha512-tNMDjcv/4DIcHxErTgwB9q2ZcYyN0sUfgGKUK/mm1FJK7Wz+KstoEekxrl/tBiNDgLK1HGi+sppj1An/1DR4fQ== dependencies: "@babel/helper-validator-identifier" "^7.12.11" lodash "^4.17.19" @@ -1330,10 +1330,10 @@ "@octokit/types" "^6.0.3" universal-user-agent "^6.0.0" -"@octokit/openapi-types@^4.0.3": - version "4.0.4" - resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-4.0.4.tgz#96fcce11e929802898646205ac567e5df592f82b" - integrity sha512-31zY8JIuz3h6RAFOnyA8FbOwhILILiBu1qD81RyZZWY7oMBhIdBn6MaAmnnptLhB4jk0g50nkQkUVP4kUzppcA== +"@octokit/openapi-types@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-5.1.0.tgz#661fd03c7d55fbcb0a0937d3353d87dea012f52c" + integrity sha512-bodZvSYgycbUuuKrC/anCBUExvaSSWzMMFz0xl7pcJujxnmGxvqvcFHktjx1ZOSyeNKLfYF0QCgibaHUGsZTng== "@octokit/plugin-enterprise-rest@^6.0.1": version "6.0.1" @@ -1348,11 +1348,11 @@ "@octokit/types" "^2.0.1" "@octokit/plugin-paginate-rest@^2.6.2": - version "2.9.1" - resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.9.1.tgz#e9bb34a89b7ed5b801f1c976feeb9b0078ecd201" - integrity sha512-8wnuWGjwDIEobbBet2xAjZwgiMVTgIer5wBsnGXzV3lJ4yqphLU2FEMpkhSrDx7y+WkZDfZ+V+1cFMZ1mAaFag== + version "2.10.0" + resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.10.0.tgz#5925156d809c94b7bfc47b28e17488415548fa67" + integrity sha512-71OsKBSMcQEu/6lfVbhv5C5ikU1rn10rKot/WiV7do7fyfElQ2eCUQFogHPbj0ci5lnKAjvahOiMAr6lcvL8Qw== dependencies: - "@octokit/types" "^6.8.0" + "@octokit/types" "^6.10.0" "@octokit/plugin-request-log@^1.0.0", "@octokit/plugin-request-log@^1.0.2": version "1.0.3" @@ -1367,12 +1367,12 @@ "@octokit/types" "^2.0.1" deprecation "^2.3.1" -"@octokit/plugin-rest-endpoint-methods@4.10.3": - version "4.10.3" - resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.10.3.tgz#d78ddf926bca3b81a4d9b79a463d32b3750a4485" - integrity sha512-CsNQeVY34Vs9iea2Z9/TCPlebxv6KpjO9f1BUPz+14qundTSYT9kgf8j5wA1k37VstfBQ4xnuURYdnbGzJBJXw== +"@octokit/plugin-rest-endpoint-methods@4.12.0": + version "4.12.0" + resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.12.0.tgz#1cec405cd4eaf0bdb58cb7d2a9b3d8473b3a70e8" + integrity sha512-RgnQ1aoetdOJjZYC37LV5FNlL7GY/v1CdC5dur1Zp/UiADJlbRFbAz/xLx26ovXw67dK7EUtwCghS+6QyiI9RA== dependencies: - "@octokit/types" "^6.8.3" + "@octokit/types" "^6.10.0" deprecation "^2.3.1" "@octokit/request-error@^1.0.2": @@ -1429,15 +1429,15 @@ once "^1.4.0" universal-user-agent "^4.0.0" -"@octokit/rest@^18.1.1": - version "18.1.1" - resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.1.1.tgz#bd7053c28db3577c936029e9da6bfbd046474a2f" - integrity sha512-ZcCHMyfGT1qtJD72usigAfUQ6jU89ZUPFb2AOubR6WZ7/RRFVZUENVm1I2yvJBUicqTujezPW9cY1+o3Mb4rNA== +"@octokit/rest@^18.2.0": + version "18.2.0" + resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.2.0.tgz#b75c87870bb1f7bc9f37ae0e9acb3a411a34a25f" + integrity sha512-xsp6bIqL2sb/NmgLXTxw96caegobRw+YHnzdIi70ruquHtPPDW2cBAONhDYMUuAOeXx0JH2auOeplpk4SQJy1w== dependencies: "@octokit/core" "^3.2.3" "@octokit/plugin-paginate-rest" "^2.6.2" "@octokit/plugin-request-log" "^1.0.2" - "@octokit/plugin-rest-endpoint-methods" "4.10.3" + "@octokit/plugin-rest-endpoint-methods" "4.12.0" "@octokit/types@^2.0.0", "@octokit/types@^2.0.1": version "2.16.2" @@ -1446,12 +1446,12 @@ dependencies: "@types/node" ">= 8" -"@octokit/types@^6.0.3", "@octokit/types@^6.7.1", "@octokit/types@^6.8.0", "@octokit/types@^6.8.3": - version "6.8.5" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.8.5.tgz#797dfdad8c75718e97dc687d4c9fc49200ca8d17" - integrity sha512-ZsQawftZoi0kSF2pCsdgLURbOjtVcHnBOXiSxBKSNF56CRjARt5rb/g8WJgqB8vv4lgUEHrv06EdDKYQ22vA9Q== +"@octokit/types@^6.0.3", "@octokit/types@^6.10.0", "@octokit/types@^6.7.1": + version "6.10.0" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.10.0.tgz#243faa864b0955f574012d52e179de38ac9ebafe" + integrity sha512-aMDo10kglofejJ96edCBIgQLVuzMDyjxmhdgEcoUUD64PlHYSrNsAGqN0wZtoiX4/PCQ3JLA50IpkP1bcKD/cA== dependencies: - "@octokit/openapi-types" "^4.0.3" + "@octokit/openapi-types" "^5.1.0" "@sinonjs/commons@^1.6.0", "@sinonjs/commons@^1.7.0", "@sinonjs/commons@^1.8.1": version "1.8.2" @@ -1645,14 +1645,14 @@ integrity sha1-m6It838H43gP/4Ux0aOOYz+UV6U= "@types/node@*", "@types/node@>= 8": - version "14.14.28" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.28.tgz#cade4b64f8438f588951a6b35843ce536853f25b" - integrity sha512-lg55ArB+ZiHHbBBttLpzD07akz0QPrZgUODNakeC09i62dnrywr9mFErHuaPlB6I7z+sEbK+IYmplahvplCj2g== + version "14.14.31" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.31.tgz#72286bd33d137aa0d152d47ec7c1762563d34055" + integrity sha512-vFHy/ezP5qI0rFgJ7aQnjDXwAMrG0KqqIH7tQG5PPv3BWBayOPIQNBjVc/P6hhdZfMx51REc6tfDNXHUio893g== -"@types/node@^10.17.52": - version "10.17.52" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.52.tgz#dc960d4e256331b3c697b7a573ee98b882febee5" - integrity sha512-bKnO8Rcj03i6JTzweabq96k29uVNcXGB0bkwjVQTFagDgxxNged18281AZ0nTMHl+aFpPPWyPrk4Z3+NtW/z5w== +"@types/node@^10.17.54": + version "10.17.54" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.54.tgz#a737488631aca3ec7bd9f6229d77f1079e444793" + integrity sha512-c8Lm7+hXdSPmWH4B9z/P/xIXhFK3mCQin4yCYMd2p1qpMG5AfgyJuYZ+3q2dT7qLiMMMGMd5dnkFpdqJARlvtQ== "@types/nodeunit@^0.0.31": version "0.0.31" @@ -1938,9 +1938,9 @@ ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4: uri-js "^4.2.2" ajv@^7.0.2: - version "7.1.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-7.1.0.tgz#f982ea7933dc7f1012eae9eec5a86687d805421b" - integrity sha512-svS9uILze/cXbH0z2myCK2Brqprx/+JJYK5pHicT/GQiBfzzhUVAIT6MwqJg8y4xV/zoGsUeuPuwtoiKSGE15g== + version "7.1.1" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-7.1.1.tgz#1e6b37a454021fa9941713f38b952fc1c8d32a84" + integrity sha512-ga/aqDYnUy/o7vbsRTFhhTsNeXiYb5JWDIcRIeZfwRNCefwjNTVYCGdGSUrEmiu3yDK3vFvNbgJxvrQW4JXrYQ== dependencies: fast-deep-equal "^3.1.1" json-schema-traverse "^1.0.0" @@ -2019,6 +2019,11 @@ anymatch@^3.0.3: normalize-path "^3.0.0" picomatch "^2.0.4" +app-root-path@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-2.2.1.tgz#d0df4a682ee408273583d43f6f79e9892624bc9a" + integrity sha512-91IFKeKk7FjfmezPKkwtaRvSpnUc4gDwPAjA1YZ9Gn0q0PPeW+vbeUsZuyDwjI7+QTHhcLen2v25fi/AmhvbJA== + append-transform@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-1.0.0.tgz#046a52ae582a228bd72f58acfbe2967c678759ab" @@ -2138,14 +2143,14 @@ array-ify@^1.0.0: integrity sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4= array-includes@^3.1.1: - version "3.1.2" - resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.2.tgz#a8db03e0b88c8c6aeddc49cb132f9bcab4ebf9c8" - integrity sha512-w2GspexNQpx+PutG3QpT437/BenZBj0M/MZGn5mzv/MofYqo0xmRHzn4lFsoDlWJ+THYsGJmFlW68WlDFx7VRw== + version "3.1.3" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.3.tgz#c7f619b382ad2afaf5326cddfdc0afc61af7690a" + integrity sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A== dependencies: - call-bind "^1.0.0" + call-bind "^1.0.2" define-properties "^1.1.3" - es-abstract "^1.18.0-next.1" - get-intrinsic "^1.0.1" + es-abstract "^1.18.0-next.2" + get-intrinsic "^1.1.1" is-string "^1.0.5" array-union@^1.0.2: @@ -2259,10 +2264,10 @@ aws-sdk-mock@^5.1.0: sinon "^9.0.1" traverse "^0.6.6" -aws-sdk@^2.637.0, aws-sdk@^2.845.0: - version "2.845.0" - resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.845.0.tgz#d1f932577dc1a1dcb34a35f81af97b221b741a42" - integrity sha512-lIOsMK6X6tyIXUB8rzYimklpFHMu96+cbWlDQkbRc5hymzSjPVY7L2LGP+PyCRjQHEnJUOk2EWswUIozhZy59A== +aws-sdk@^2.596.0, aws-sdk@^2.637.0, aws-sdk@^2.848.0: + version "2.848.0" + resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.848.0.tgz#5e7706ddd30a55a2d5a5b64c29682a757607ee64" + integrity sha512-c/e5kaEFl+9aYkrYDkmu5mSZlL+EfP6DnBOMD06fH12gIsaFSMBGtbsDTHABhvSu++LxeI1dJAD148O17MuZvg== dependencies: buffer "4.9.2" events "1.1.1" @@ -2980,9 +2985,9 @@ console-control-strings@^1.0.0, console-control-strings@~1.1.0: integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= constructs@^3.2.0: - version "3.3.21" - resolved "https://registry.yarnpkg.com/constructs/-/constructs-3.3.21.tgz#1290fbebe8716e729a6ac2a47118b58b8f7c4461" - integrity sha512-FsdsSAJlmlWSiWWuKTTP/a0SpEtRMM2w0P5lsJxvP4/42AOJOSmqckDyrr9WkESiaX94WnnK9khoVWGlBzkvNA== + version "3.3.29" + resolved "https://registry.yarnpkg.com/constructs/-/constructs-3.3.29.tgz#42d2fbc0d872a47701a70583a0d4356a3f11955c" + integrity sha512-rGQzkq2M/qKZ0hMEtt4YPpsZKOwzmiyAQx3PqexXXsjdVnTqEfIwQuDpc+1jP6CtaBHl7rR6CxQcfsP5DmaERw== contains-path@^0.1.0: version "0.1.0" @@ -3159,28 +3164,28 @@ conventional-commits-filter@^2.0.2, conventional-commits-filter@^2.0.7: modify-values "^1.0.0" conventional-commits-parser@^3.0.3, conventional-commits-parser@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.2.0.tgz#9e261b139ca4b7b29bcebbc54460da36894004ca" - integrity sha512-XmJiXPxsF0JhAKyfA2Nn+rZwYKJ60nanlbSWwwkGwLQFbugsc0gv1rzc7VbbUWAzJfR1qR87/pNgv9NgmxtBMQ== + version "3.2.1" + resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.2.1.tgz#ba44f0b3b6588da2ee9fd8da508ebff50d116ce2" + integrity sha512-OG9kQtmMZBJD/32NEw5IhN5+HnBqVjy03eC+I71I0oQRFA5rOgA4OtPOYG7mz1GkCfCNxn3gKIX8EiHJYuf1cA== dependencies: JSONStream "^1.0.4" is-text-path "^1.0.1" lodash "^4.17.15" meow "^8.0.0" - split2 "^2.0.0" + split2 "^3.0.0" through2 "^4.0.0" trim-off-newlines "^1.0.0" -conventional-recommended-bump@6.0.11: - version "6.0.11" - resolved "https://registry.yarnpkg.com/conventional-recommended-bump/-/conventional-recommended-bump-6.0.11.tgz#fcc39acb51d1946b63fc478737d1e52712f36356" - integrity sha512-FciYBMwzwwBZ1K4NS8c57rsOfSc51e1V6UVSNIosrjH+A6xXkyiA4ELwoWyRKdMhJ+m3O6ru9ZJ7F2QFjjYJdQ== +conventional-recommended-bump@6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/conventional-recommended-bump/-/conventional-recommended-bump-6.1.0.tgz#cfa623285d1de554012f2ffde70d9c8a22231f55" + integrity sha512-uiApbSiNGM/kkdL9GTOLAqC4hbptObFo4wW2QRyHsKciGAfQuLU1ShZ1BIVI/+K2BE/W1AWYQMCXAsv4dyKPaw== dependencies: concat-stream "^2.0.0" conventional-changelog-preset-loader "^2.3.4" conventional-commits-filter "^2.0.7" conventional-commits-parser "^3.2.0" - git-raw-commits "2.0.0" + git-raw-commits "^2.0.8" git-semver-tags "^4.1.1" meow "^8.0.0" q "^1.5.1" @@ -3682,6 +3687,16 @@ dot-prop@^5.1.0: dependencies: is-obj "^2.0.0" +dotenv-json@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/dotenv-json/-/dotenv-json-1.0.0.tgz#fc7f672aafea04bed33818733b9f94662332815c" + integrity sha512-jAssr+6r4nKhKRudQ0HOzMskOFFi9+ubXWwmrSGJFgTvpjyPXCXsCsYbjif6mXp7uxA7xY3/LGaiTQukZzSbOQ== + +dotenv@^8.0.0: + version "8.2.0" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.2.0.tgz#97e619259ada750eea3e4ea3e26bceea5424b16a" + integrity sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw== + dotgitignore@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/dotgitignore/-/dotgitignore-2.1.0.tgz#a4b15a4e4ef3cf383598aaf1dfa4a04bcc089b7b" @@ -3853,10 +3868,10 @@ es6-promisify@^5.0.0: dependencies: es6-promise "^4.0.3" -esbuild@^0.8.46: - version "0.8.46" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.8.46.tgz#8fc7230ce3019b12e2553399f0c03875a729c26b" - integrity sha512-xck9sXNCNmjDHCCfxTCyhKTiFuEBweh+IDAhMLOJI990v1Fzii6MyIkT1LbkvjgoVgPX2SK1kpi5eZVGNrl8yg== +esbuild@^0.8.50: + version "0.8.50" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.8.50.tgz#ebf24fde0cdad1a369789dd6fd7a820b0a01e46c" + integrity sha512-oidFLXssA7IccYzkqLVZSqNJDwDq8Mh/vqvrW+3fPWM7iUiC5O2bCllhnO8+K9LlyL/2Z6n+WwRJAz9fqSIVRg== escalade@^3.1.1: version "3.1.1" @@ -3890,6 +3905,11 @@ escodegen@^1.14.1, escodegen@^1.8.1: optionalDependencies: source-map "~0.6.1" +eslint-config-standard@^14.1.1: + version "14.1.1" + resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-14.1.1.tgz#830a8e44e7aef7de67464979ad06b406026c56ea" + integrity sha512-Z9B+VR+JIXRxz21udPTL9HpFMyoMUEeX1G251EQ6e05WD9aPVtVBn09XUmZ259wCMlCDmYDSZG62Hhm+ZTJcUg== + eslint-import-resolver-node@^0.3.4: version "0.3.4" resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz#85ffa81942c25012d8231096ddf679c03042c717" @@ -3917,6 +3937,14 @@ eslint-module-utils@^2.6.0: debug "^2.6.9" pkg-dir "^2.0.0" +eslint-plugin-es@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz#75a7cdfdccddc0589934aeeb384175f221c57893" + integrity sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ== + dependencies: + eslint-utils "^2.0.0" + regexpp "^3.0.0" + eslint-plugin-import@^2.22.1: version "2.22.1" resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz#0896c7e6a0cf44109a2d97b95903c2bb689d7702" @@ -3943,11 +3971,33 @@ eslint-plugin-jest@^24.1.5: dependencies: "@typescript-eslint/experimental-utils" "^4.0.1" +eslint-plugin-node@^11.1.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz#c95544416ee4ada26740a30474eefc5402dc671d" + integrity sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g== + dependencies: + eslint-plugin-es "^3.0.0" + eslint-utils "^2.0.0" + ignore "^5.1.1" + minimatch "^3.0.4" + resolve "^1.10.1" + semver "^6.1.0" + +eslint-plugin-promise@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-4.3.1.tgz#61485df2a359e03149fdafc0a68b0e030ad2ac45" + integrity sha512-bY2sGqyptzFBDLh/GMbAxfdJC+b0f23ME63FOE4+Jao0oZ3E1LEwFtWJX/1pGMJLiTtrSSern2CRM/g+dfc0eQ== + eslint-plugin-rulesdir@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/eslint-plugin-rulesdir/-/eslint-plugin-rulesdir-0.1.0.tgz#ad144d7e98464fda82963eff3fab331aecb2bf08" integrity sha1-rRRNfphGT9qClj7/P6szGuyyvwg= +eslint-plugin-standard@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-4.1.0.tgz#0c3bf3a67e853f8bbbc580fb4945fbf16f41b7c5" + integrity sha512-ZL7+QRixjTR6/528YNGyDotyffm5OQst/sGxKDwGb9Uqs4In5Egi4+jbobhqJoyoCM6/7v/1A5fhQ7ScMtDjaQ== + eslint-scope@^5.0.0, eslint-scope@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" @@ -4297,9 +4347,9 @@ figures@^3.1.0: escape-string-regexp "^1.0.5" file-entry-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.0.tgz#7921a89c391c6d93efec2169ac6bf300c527ea0a" - integrity sha512-fqoO76jZ3ZnYrXLDRxBR1YvOvc0k844kcOg40bgsPrE25LAb/PDqTY+ho64Xh2c8ZXgIKldchCFHczG2UVRcWA== + version "6.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" + integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== dependencies: flat-cache "^3.0.4" @@ -4600,7 +4650,7 @@ get-caller-file@^2.0.1, get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.0.1, get-intrinsic@^1.0.2, get-intrinsic@^1.1.0: +get-intrinsic@^1.0.1, get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== @@ -5079,7 +5129,7 @@ ignore@^4.0.3, ignore@^4.0.6: resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== -ignore@^5.1.4, ignore@^5.1.8, ignore@~5.1.8: +ignore@^5.1.1, ignore@^5.1.4, ignore@^5.1.8, ignore@~5.1.8: version "5.1.8" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== @@ -6361,6 +6411,24 @@ kleur@^3.0.3: resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== +lambda-leak@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lambda-leak/-/lambda-leak-2.0.0.tgz#771985d3628487f6e885afae2b54510dcfb2cd7e" + integrity sha1-dxmF02KEh/boha+uK1RRDc+yzX4= + +lambda-tester@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/lambda-tester/-/lambda-tester-3.6.0.tgz#ceb7d4f4f0da768487a05cff37dcd088508b5247" + integrity sha512-F2ZTGWCLyIR95o/jWK46V/WnOCFAEUG/m/V7/CLhPJ7PCM+pror1rZ6ujP3TkItSGxUfpJi0kqwidw+M/nEqWw== + dependencies: + app-root-path "^2.2.1" + dotenv "^8.0.0" + dotenv-json "^1.0.0" + lambda-leak "^2.0.0" + semver "^6.1.1" + uuid "^3.3.2" + vandium-utils "^1.1.1" + lazystream@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lazystream/-/lazystream-1.0.0.tgz#f6995fe0f820392f61396be89462407bb77168e4" @@ -6594,10 +6662,10 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@4.x, lodash@^4.17.12, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.2.1: - version "4.17.20" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" - integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== +lodash@4.x, lodash@^4.17.12, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.2.1: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== log-driver@^1.2.7: version "1.2.7" @@ -6890,17 +6958,17 @@ micromatch@^4.0.2: braces "^3.0.1" picomatch "^2.0.5" -mime-db@1.45.0: - version "1.45.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.45.0.tgz#cceeda21ccd7c3a745eba2decd55d4b73e7879ea" - integrity sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w== +mime-db@1.46.0: + version "1.46.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.46.0.tgz#6267748a7f799594de3cbc8cde91def349661cee" + integrity sha512-svXaP8UQRZ5K7or+ZmfNhg2xX3yKDMUzqadsSqi4NCH/KomcH75MAMYAGVlvXn4+b/xOPhS3I2uHKRUzvjY7BQ== mime-types@^2.1.12, mime-types@~2.1.19: - version "2.1.28" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.28.tgz#1160c4757eab2c5363888e005273ecf79d2a0ecd" - integrity sha512-0TO2yJ5YHYr7M2zzT7gDU1tbwHxEUWBCLt0lscSNpcdAfFyJOVEpRYNS7EXVcTLNj/25QO8gulHC5JtTzSE2UQ== + version "2.1.29" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.29.tgz#1d4ab77da64b91f5f72489df29236563754bb1b2" + integrity sha512-Y/jMt/S5sR9OaqteJtslsFZKWOIIqMACsJSiHghlCAyhf7jfVYjKBmLiX8OgpWeW+fjJ2b+Az69aPFPkUOY6xQ== dependencies: - mime-db "1.45.0" + mime-db "1.46.0" mimic-fn@^1.0.0: version "1.2.0" @@ -7130,9 +7198,9 @@ nice-try@^1.0.4: integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== nise@^4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/nise/-/nise-4.0.4.tgz#d73dea3e5731e6561992b8f570be9e363c4512dd" - integrity sha512-bTTRUNlemx6deJa+ZyoCUTRvH3liK5+N6VQZ4NIw90AgDXY6iPnsqplNFf6STcj+ePk0H/xqxnP75Lr0J0Fq3A== + version "4.1.0" + resolved "https://registry.yarnpkg.com/nise/-/nise-4.1.0.tgz#8fb75a26e90b99202fa1e63f448f58efbcdedaf6" + integrity sha512-eQMEmGN/8arp0xsvGoQ+B1qvSkR73B1nWSCh7nOt5neMCtwcQVYQGdzQMhcNscktTsWB54xnlSQFzOAPJD8nXA== dependencies: "@sinonjs/commons" "^1.7.0" "@sinonjs/fake-timers" "^6.0.0" @@ -7445,11 +7513,11 @@ object-inspect@^1.9.0: integrity sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw== object-is@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.4.tgz#63d6c83c00a43f4cbc9434eb9757c8a5b8565068" - integrity sha512-1ZvAZ4wlF7IyPVOcE1Omikt7UpaFlOQq0HlSti+ZvDH3UiD2brwGMwDbyV43jao2bKJ+4+WdPJHSd7kgzKYVqg== + version "1.1.5" + resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.5.tgz#b9deeaa5fc7f1846a0faecdceec138e5778f53ac" + integrity sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw== dependencies: - call-bind "^1.0.0" + call-bind "^1.0.2" define-properties "^1.1.3" object-keys@^1.0.12, object-keys@^1.1.1: @@ -7475,13 +7543,13 @@ object.assign@^4.1.2: object-keys "^1.1.1" object.getownpropertydescriptors@^2.0.3: - version "2.1.1" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.1.tgz#0dfda8d108074d9c563e80490c883b6661091544" - integrity sha512-6DtXgZ/lIZ9hqx4GtZETobXLR/ZLaa0aqV0kzbn80Rf8Z2e/XFnhA0I7p07N2wH8bBBltr2xQPi6sbKWAY2Eng== + version "2.1.2" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.2.tgz#1bd63aeacf0d5d2d2f31b5e393b03a7c601a23f7" + integrity sha512-WtxeKSzfBjlzL+F9b7M7hewDzMwy+C8NRssHd1YrNlzHzIDrXcXiNOMrezdAEM4UXixgV+vvnyBeN7Rygl2ttQ== dependencies: - call-bind "^1.0.0" + call-bind "^1.0.2" define-properties "^1.1.3" - es-abstract "^1.18.0-next.1" + es-abstract "^1.18.0-next.2" object.pick@^1.3.0: version "1.3.0" @@ -8561,7 +8629,7 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@^1.1.6, resolve@^1.10.0, resolve@^1.11.1, resolve@^1.13.1, resolve@^1.17.0, resolve@^1.18.1: +resolve@^1.1.6, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.11.1, resolve@^1.13.1, resolve@^1.17.0, resolve@^1.18.1: version "1.20.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== @@ -8715,7 +8783,7 @@ semver@7.x, semver@^7.1.1, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4: dependencies: lru-cache "^6.0.0" -semver@^6.0.0, semver@^6.2.0, semver@^6.3.0: +semver@^6.0.0, semver@^6.1.0, semver@^6.1.1, semver@^6.2.0, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== @@ -9097,16 +9165,16 @@ stack-utils@^2.0.2: dependencies: escape-string-regexp "^2.0.0" -standard-version@^9.1.0: - version "9.1.0" - resolved "https://registry.yarnpkg.com/standard-version/-/standard-version-9.1.0.tgz#07589469324d967ffe665fa86ef612949a858a80" - integrity sha512-EJcbKUGKBuHjiDSUL5XjPhT1KGVM+UCvv/ti70fHnJwJyJqTSJWl0mWj/Wj0WwsoskyvKWURESzBsZmCCMUZzg== +standard-version@^9.1.1: + version "9.1.1" + resolved "https://registry.yarnpkg.com/standard-version/-/standard-version-9.1.1.tgz#7561df6351b075a44544ce3d3ebcffcb9582ba5a" + integrity sha512-PF9JnRauBwH7DAkmefYu1mB2Kx0MVG13udqDTFmDUiogbyikBAHBdMrVuauxtAb2YIkyZ3FMYCNv0hqUKMOPww== dependencies: chalk "^2.4.2" conventional-changelog "3.1.24" conventional-changelog-config-spec "2.1.0" conventional-changelog-conventionalcommits "4.5.0" - conventional-recommended-bump "6.0.11" + conventional-recommended-bump "6.1.0" detect-indent "^6.0.0" detect-newline "^3.1.0" dotgitignore "^2.1.0" @@ -9116,7 +9184,7 @@ standard-version@^9.1.0: git-semver-tags "^4.0.0" semver "^7.1.1" stringify-package "^1.0.1" - yargs "^15.3.1" + yargs "^16.0.0" static-extend@^0.1.1: version "0.1.2" @@ -10075,6 +10143,11 @@ validate-npm-package-name@^3.0.0: dependencies: builtins "^1.0.3" +vandium-utils@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/vandium-utils/-/vandium-utils-1.2.0.tgz#44735de4b7641a05de59ebe945f174e582db4f59" + integrity sha1-RHNd5LdkGgXeWevpRfF05YLbT1k= + verror@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" @@ -10418,9 +10491,9 @@ yapool@^1.0.0: integrity sha1-9pPymjFbUNmp2iZGp6ZkXJaYW2o= yargs-parser@20.x, yargs-parser@^20.2.2, yargs-parser@^20.2.3: - version "20.2.5" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.5.tgz#5d37729146d3f894f39fc94b6796f5b239513186" - integrity sha512-jYRGS3zWy20NtDtK2kBgo/TlAoy5YUuhD9/LZ7z7W4j1Fdw2cqD0xEEclf8fxc8xjD6X5Qr+qQQwCEsP8iRiYg== + version "20.2.6" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.6.tgz#69f920addf61aafc0b8b89002f5d66e28f2d8b20" + integrity sha512-AP1+fQIWSM/sMiET8fyayjx/J+JmTPt2Mr0FkrgqB4todtfa53sOsrSAcIrJRD5XS20bKUwaDIuMkWKCEiQLKA== yargs-parser@^13.0.0, yargs-parser@^13.1.2: version "13.1.2" @@ -10479,7 +10552,7 @@ yargs@^14.2.2: y18n "^4.0.0" yargs-parser "^15.0.1" -yargs@^15.0.2, yargs@^15.3.1, yargs@^15.4.1: +yargs@^15.0.2, yargs@^15.4.1: version "15.4.1" resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== @@ -10496,7 +10569,7 @@ yargs@^15.0.2, yargs@^15.3.1, yargs@^15.4.1: y18n "^4.0.0" yargs-parser "^18.1.2" -yargs@^16.0.3, yargs@^16.2.0: +yargs@^16.0.0, yargs@^16.0.3, yargs@^16.2.0: version "16.2.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== From 37debc0513c5174ca3d918fce94a138d5d34b586 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Wed, 24 Feb 2021 12:13:09 +0200 Subject: [PATCH 12/78] fix(lambda-python): asset hash is non-deterministic (#12984) When a Python handler uses external dependencies, the hash calculated on the output is non-determinstic due to the fact that it includes timestamps. To resolve that, change the asset hash strategy to `SOURCE` which means that the bundle will only be re-created if one of the source files changes. Additionally, the Python image hash, which is also included in the asset hash (to ensure that if the build image changes, the bundle is invalidated) included the absolute path for the `Dockerfile`. This caused the image hash itself to change every time the image was built on a different system. To fix this, we stage the dependency files & dockerfile into a temp directory and build the image from there. Fixes #12770 Fixes #12684 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../aws-lambda-python/lib/bundling.ts | 84 +++++++++++++++---- .../aws-lambda-python/lib/function.ts | 42 ++++++++++ .../aws-lambda-python/test/bundling.test.ts | 62 ++++---------- .../aws-lambda-python/test/function.test.ts | 84 +++++++++++++++++-- .../test/integ.function.expected.json | 18 ++-- .../test/integ.function.pipenv.expected.json | 54 ++++++------ .../test/integ.function.poetry.expected.json | 54 ++++++------ .../test/integ.function.project.expected.json | 36 ++++---- .../test/integ.function.py38.expected.json | 18 ++-- ...unction.requirements.removed.expected.json | 18 ++-- .../test/integ.function.vpc.expected.json | 18 ++-- .../aws-lambda-python/test/layer.test.ts | 6 +- packages/@aws-cdk/core/lib/bundling.ts | 17 ++-- packages/@aws-cdk/core/test/bundling.test.ts | 6 +- 14 files changed, 328 insertions(+), 189 deletions(-) diff --git a/packages/@aws-cdk/aws-lambda-python/lib/bundling.ts b/packages/@aws-cdk/aws-lambda-python/lib/bundling.ts index d5747e169abb2..a4446611d9a9d 100644 --- a/packages/@aws-cdk/aws-lambda-python/lib/bundling.ts +++ b/packages/@aws-cdk/aws-lambda-python/lib/bundling.ts @@ -31,15 +31,56 @@ export interface BundlingOptions { * Output path suffix ('python' for a layer, '.' otherwise) */ readonly outputPathSuffix: string; + + /** + * Determines how asset hash is calculated. Assets will get rebuild and + * uploaded only if their hash has changed. + * + * If asset hash is set to `SOURCE` (default), then only changes to the source + * directory will cause the asset to rebuild. This means, for example, that in + * order to pick up a new dependency version, a change must be made to the + * source tree. Ideally, this can be implemented by including a dependency + * lockfile in your source tree or using fixed dependencies. + * + * If the asset hash is set to `OUTPUT`, the hash is calculated after + * bundling. This means that any change in the output will cause the asset to + * be invalidated and uploaded. Bear in mind that `pip` adds timestamps to + * dependencies it installs, which implies that in this mode Python bundles + * will _always_ get rebuild and uploaded. Normally this is an anti-pattern + * since build + * + * @default AssetHashType.SOURCE By default, hash is calculated based on the + * contents of the source directory. If `assetHash` is also specified, the + * default is `CUSTOM`. This means that only updates to the source will cause + * the asset to rebuild. + */ + readonly assetHashType?: cdk.AssetHashType; + + /** + * Specify a custom hash for this asset. If `assetHashType` is set it must + * be set to `AssetHashType.CUSTOM`. For consistency, this custom hash will + * be SHA256 hashed and encoded as hex. The resulting hash will be the asset + * hash. + * + * NOTE: the hash is used in order to identify a specific revision of the asset, and + * used for optimizing and caching deployment activities related to this asset such as + * packaging, uploading to Amazon S3, etc. If you chose to customize the hash, you will + * need to make sure it is updated every time the asset changes, or otherwise it is + * possible that some deployments will not be invalidated. + * + * @default - based on `assetHashType` + */ + readonly assetHash?: string; } /** * Produce bundled Lambda asset code */ -export function bundle(options: BundlingOptions): lambda.AssetCode { +export function bundle(options: BundlingOptions): lambda.Code { const { entry, runtime, outputPathSuffix } = options; - const hasDeps = hasDependencies(entry); + const stagedir = cdk.FileSystem.mkdtemp('python-bundling-'); + const hasDeps = stageDependencies(entry, stagedir); const depsCommand = chain([ hasDeps ? `rsync -r ${BUNDLER_DEPENDENCIES_CACHE}/. ${cdk.AssetStaging.BUNDLING_OUTPUT_DIR}/${outputPathSuffix}` : '', @@ -54,15 +95,19 @@ export function bundle(options: BundlingOptions): lambda.AssetCode { ? 'Dockerfile.dependencies' : 'Dockerfile'; - const image = cdk.BundlingDockerImage.fromAsset(entry, { + // copy Dockerfile to workdir + fs.copyFileSync(path.join(__dirname, dockerfile), path.join(stagedir, dockerfile)); + + const image = cdk.BundlingDockerImage.fromAsset(stagedir, { buildArgs: { IMAGE: runtime.bundlingDockerImage.image, }, - file: path.join(__dirname, dockerfile), + file: dockerfile, }); return lambda.Code.fromAsset(entry, { - assetHashType: cdk.AssetHashType.BUNDLE, + assetHashType: options.assetHashType, + assetHash: options.assetHash, exclude: DEPENDENCY_EXCLUDES, bundling: { image, @@ -75,20 +120,25 @@ export function bundle(options: BundlingOptions): lambda.AssetCode { * Checks to see if the `entry` directory contains a type of dependency that * we know how to install. */ -export function hasDependencies(entry: string): boolean { - if (fs.existsSync(path.join(entry, 'Pipfile'))) { - return true; - } - - if (fs.existsSync(path.join(entry, 'poetry.lock'))) { - return true; - } - - if (fs.existsSync(path.join(entry, 'requirements.txt'))) { - return true; +export function stageDependencies(entry: string, stagedir: string): boolean { + const prefixes = [ + 'Pipfile', + 'pyproject', + 'poetry', + 'requirements.txt', + ]; + + let found = false; + for (const file of fs.readdirSync(entry)) { + for (const prefix of prefixes) { + if (file.startsWith(prefix)) { + fs.copyFileSync(path.join(entry, file), path.join(stagedir, file)); + found = true; + } + } } - return false; + return found; } function chain(commands: string[]): string { diff --git a/packages/@aws-cdk/aws-lambda-python/lib/function.ts b/packages/@aws-cdk/aws-lambda-python/lib/function.ts index 267245738cbe6..733c115c0383d 100644 --- a/packages/@aws-cdk/aws-lambda-python/lib/function.ts +++ b/packages/@aws-cdk/aws-lambda-python/lib/function.ts @@ -1,6 +1,7 @@ import * as fs from 'fs'; import * as path from 'path'; import * as lambda from '@aws-cdk/aws-lambda'; +import { AssetHashType } from '@aws-cdk/core'; import { bundle } from './bundling'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main @@ -37,6 +38,45 @@ export interface PythonFunctionProps extends lambda.FunctionOptions { * @default lambda.Runtime.PYTHON_3_7 */ readonly runtime?: lambda.Runtime; + + /** + * Determines how asset hash is calculated. Assets will get rebuild and + * uploaded only if their hash has changed. + * + * If asset hash is set to `SOURCE` (default), then only changes to the source + * directory will cause the asset to rebuild. This means, for example, that in + * order to pick up a new dependency version, a change must be made to the + * source tree. Ideally, this can be implemented by including a dependency + * lockfile in your source tree or using fixed dependencies. + * + * If the asset hash is set to `OUTPUT`, the hash is calculated after + * bundling. This means that any change in the output will cause the asset to + * be invalidated and uploaded. Bear in mind that `pip` adds timestamps to + * dependencies it installs, which implies that in this mode Python bundles + * will _always_ get rebuild and uploaded. Normally this is an anti-pattern + * since build + * + * @default AssetHashType.SOURCE By default, hash is calculated based on the + * contents of the source directory. This means that only updates to the + * source will cause the asset to rebuild. + */ + readonly assetHashType?: AssetHashType; + + /** + * Specify a custom hash for this asset. If `assetHashType` is set it must + * be set to `AssetHashType.CUSTOM`. For consistency, this custom hash will + * be SHA256 hashed and encoded as hex. The resulting hash will be the asset + * hash. + * + * NOTE: the hash is used in order to identify a specific revision of the asset, and + * used for optimizing and caching deployment activities related to this asset such as + * packaging, uploading to Amazon S3, etc. If you chose to customize the hash, you will + * need to make sure it is updated every time the asset changes, or otherwise it is + * possible that some deployments will not be invalidated. + * + * @default - based on `assetHashType` + */ + readonly assetHash?: string; } /** @@ -70,6 +110,8 @@ export class PythonFunction extends lambda.Function { runtime, entry, outputPathSuffix: '.', + assetHashType: props.assetHashType, + assetHash: props.assetHash, }), handler: `${index.slice(0, -3)}.${handler}`, }); diff --git a/packages/@aws-cdk/aws-lambda-python/test/bundling.test.ts b/packages/@aws-cdk/aws-lambda-python/test/bundling.test.ts index 4286d092adf8f..d6de4ee23aedd 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/bundling.test.ts +++ b/packages/@aws-cdk/aws-lambda-python/test/bundling.test.ts @@ -1,11 +1,10 @@ import * as fs from 'fs'; import * as path from 'path'; import { Code, Runtime } from '@aws-cdk/aws-lambda'; -import { hasDependencies, bundle } from '../lib/bundling'; +import { FileSystem } from '@aws-cdk/core'; +import { stageDependencies, bundle } from '../lib/bundling'; jest.mock('@aws-cdk/aws-lambda'); -const existsSyncOriginal = fs.existsSync; -const existsSyncMock = jest.spyOn(fs, 'existsSync'); jest.mock('child_process', () => ({ spawnSync: jest.fn(() => { @@ -41,9 +40,6 @@ test('Bundling a function without dependencies', () => { ], }), })); - - // Searches for requirements.txt in entry - expect(existsSyncMock).toHaveBeenCalledWith(path.join(entry, 'requirements.txt')); }); test('Bundling a function with requirements.txt installed', () => { @@ -63,9 +59,6 @@ test('Bundling a function with requirements.txt installed', () => { ], }), })); - - // Searches for requirements.txt in entry - expect(existsSyncMock).toHaveBeenCalledWith(path.join(entry, 'requirements.txt')); }); test('Bundling Python 2.7 with requirements.txt installed', () => { @@ -85,9 +78,6 @@ test('Bundling Python 2.7 with requirements.txt installed', () => { ], }), })); - - // Searches for requirements.txt in entry - expect(existsSyncMock).toHaveBeenCalledWith(path.join(entry, 'requirements.txt')); }); test('Bundling a layer with dependencies', () => { @@ -128,42 +118,24 @@ test('Bundling a python code layer', () => { })); }); -describe('Dependency detection', () => { - test('Detects pipenv', () => { - existsSyncMock.mockImplementation((p: fs.PathLike) => { - if (/Pipfile/.test(p.toString())) { - return true; - } - return existsSyncOriginal(p); - }); - - expect(hasDependencies('/asset-input')).toEqual(true); - }); - - test('Detects poetry', () => { - existsSyncMock.mockImplementation((p: fs.PathLike) => { - if (/poetry.lock/.test(p.toString())) { - return true; - } - return existsSyncOriginal(p); - }); - - expect(hasDependencies('/asset-input')).toEqual(true); - }); - test('Detects requirements.txt', () => { - existsSyncMock.mockImplementation((p: fs.PathLike) => { - if (/requirements.txt/.test(p.toString())) { - return true; - } - return existsSyncOriginal(p); - }); - - expect(hasDependencies('/asset-input')).toEqual(true); +describe('Dependency detection', () => { + test.each(['Pipfile', 'poetry.lock', 'requirements.txt'])('detect dependency %p', filename => { + // GIVEN + const sourcedir = FileSystem.mkdtemp('source-'); + const stagedir = FileSystem.mkdtemp('stage-'); + fs.writeFileSync(path.join(sourcedir, filename), 'dummy!'); + + // WHEN + const found = stageDependencies(sourcedir, stagedir); + + // THEN + expect(found).toBeTruthy(); + expect(fs.existsSync(path.join(stagedir, filename))).toBeTruthy(); }); test('No known dependencies', () => { - existsSyncMock.mockImplementation(() => false); - expect(hasDependencies('/asset-input')).toEqual(false); + const sourcedir = FileSystem.mkdtemp('source-'); + expect(stageDependencies(sourcedir, '/dummy')).toEqual(false); }); }); diff --git a/packages/@aws-cdk/aws-lambda-python/test/function.test.ts b/packages/@aws-cdk/aws-lambda-python/test/function.test.ts index 98bab1cf35be4..d1f9d64241b61 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/function.test.ts +++ b/packages/@aws-cdk/aws-lambda-python/test/function.test.ts @@ -1,16 +1,36 @@ import '@aws-cdk/assert/jest'; -import { Runtime } from '@aws-cdk/aws-lambda'; -import { Stack } from '@aws-cdk/core'; +import { Code, Runtime } from '@aws-cdk/aws-lambda'; +import { AssetHashType, AssetOptions, Stack } from '@aws-cdk/core'; import { PythonFunction } from '../lib'; import { bundle } from '../lib/bundling'; jest.mock('../lib/bundling', () => { return { - bundle: jest.fn().mockReturnValue({ - bind: () => { - return { inlineCode: 'code' }; - }, - bindToResource: () => { return; }, + bundle: jest.fn().mockImplementation((options: AssetOptions): Code => { + const mockObjectKey = (() => { + const hashType = options.assetHashType ?? (options.assetHash ? 'custom' : 'source'); + switch (hashType) { + case 'source': return 'SOURCE_MOCK'; + case 'output': return 'OUTPUT_MOCK'; + case 'custom': { + if (!options.assetHash) { throw new Error('no custom hash'); } + return options.assetHash; + } + } + + throw new Error('unexpected asset hash type'); + })(); + + return { + isInline: false, + bind: () => ({ + s3Location: { + bucketName: 'mock-bucket-name', + objectKey: mockObjectKey, + }, + }), + bindToResource: () => { return; }, + }; }), hasDependencies: jest.fn().mockReturnValue(false), }; @@ -73,3 +93,53 @@ test('throws with the wrong runtime family', () => { runtime: Runtime.NODEJS_12_X, })).toThrow(/Only `PYTHON` runtimes are supported/); }); + +test('allows specifying hash type', () => { + new PythonFunction(stack, 'source1', { + entry: 'test/lambda-handler-nodeps', + index: 'index.py', + handler: 'handler', + }); + + new PythonFunction(stack, 'source2', { + entry: 'test/lambda-handler-nodeps', + index: 'index.py', + handler: 'handler', + assetHashType: AssetHashType.SOURCE, + }); + + new PythonFunction(stack, 'output', { + entry: 'test/lambda-handler-nodeps', + index: 'index.py', + handler: 'handler', + assetHashType: AssetHashType.OUTPUT, + }); + + new PythonFunction(stack, 'custom', { + entry: 'test/lambda-handler-nodeps', + index: 'index.py', + handler: 'handler', + assetHash: 'MY_CUSTOM_HASH', + }); + + expect(stack).toHaveResource('AWS::Lambda::Function', { + Code: { + S3Bucket: 'mock-bucket-name', + S3Key: 'SOURCE_MOCK', + }, + }); + + expect(stack).toHaveResource('AWS::Lambda::Function', { + Code: { + S3Bucket: 'mock-bucket-name', + S3Key: 'OUTPUT_MOCK', + }, + }); + + expect(stack).toHaveResource('AWS::Lambda::Function', { + Code: { + S3Bucket: 'mock-bucket-name', + S3Key: 'MY_CUSTOM_HASH', + }, + }); +}); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.expected.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.expected.json index 3690005685439..45fb46b70aeb9 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.expected.json +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.expected.json @@ -36,7 +36,7 @@ "Properties": { "Code": { "S3Bucket": { - "Ref": "AssetParameters4ee6ce8b6ee4bd51743dc0c39d6e52baebaeafff9c9dfea0ff84de98d1dbf353S3Bucket414E0E30" + "Ref": "AssetParameters79d8f328899b90e2c16929e9393ebf344f098abde8981abdff0168fc9b0589acS3Bucket424FEB44" }, "S3Key": { "Fn::Join": [ @@ -49,7 +49,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters4ee6ce8b6ee4bd51743dc0c39d6e52baebaeafff9c9dfea0ff84de98d1dbf353S3VersionKey5ABC9098" + "Ref": "AssetParameters79d8f328899b90e2c16929e9393ebf344f098abde8981abdff0168fc9b0589acS3VersionKeyCEB2635C" } ] } @@ -62,7 +62,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters4ee6ce8b6ee4bd51743dc0c39d6e52baebaeafff9c9dfea0ff84de98d1dbf353S3VersionKey5ABC9098" + "Ref": "AssetParameters79d8f328899b90e2c16929e9393ebf344f098abde8981abdff0168fc9b0589acS3VersionKeyCEB2635C" } ] } @@ -87,17 +87,17 @@ } }, "Parameters": { - "AssetParameters4ee6ce8b6ee4bd51743dc0c39d6e52baebaeafff9c9dfea0ff84de98d1dbf353S3Bucket414E0E30": { + "AssetParameters79d8f328899b90e2c16929e9393ebf344f098abde8981abdff0168fc9b0589acS3Bucket424FEB44": { "Type": "String", - "Description": "S3 bucket for asset \"4ee6ce8b6ee4bd51743dc0c39d6e52baebaeafff9c9dfea0ff84de98d1dbf353\"" + "Description": "S3 bucket for asset \"79d8f328899b90e2c16929e9393ebf344f098abde8981abdff0168fc9b0589ac\"" }, - "AssetParameters4ee6ce8b6ee4bd51743dc0c39d6e52baebaeafff9c9dfea0ff84de98d1dbf353S3VersionKey5ABC9098": { + "AssetParameters79d8f328899b90e2c16929e9393ebf344f098abde8981abdff0168fc9b0589acS3VersionKeyCEB2635C": { "Type": "String", - "Description": "S3 key for asset version \"4ee6ce8b6ee4bd51743dc0c39d6e52baebaeafff9c9dfea0ff84de98d1dbf353\"" + "Description": "S3 key for asset version \"79d8f328899b90e2c16929e9393ebf344f098abde8981abdff0168fc9b0589ac\"" }, - "AssetParameters4ee6ce8b6ee4bd51743dc0c39d6e52baebaeafff9c9dfea0ff84de98d1dbf353ArtifactHashECA6C88C": { + "AssetParameters79d8f328899b90e2c16929e9393ebf344f098abde8981abdff0168fc9b0589acArtifactHashE38133D4": { "Type": "String", - "Description": "Artifact hash for asset \"4ee6ce8b6ee4bd51743dc0c39d6e52baebaeafff9c9dfea0ff84de98d1dbf353\"" + "Description": "Artifact hash for asset \"79d8f328899b90e2c16929e9393ebf344f098abde8981abdff0168fc9b0589ac\"" } }, "Outputs": { diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.expected.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.expected.json index ef1f355e528c3..aa7bc5fbbcd68 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.expected.json +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.expected.json @@ -36,7 +36,7 @@ "Properties": { "Code": { "S3Bucket": { - "Ref": "AssetParameters94972df8a01484c56b50bec3793ac6c4302bc044db29d3502007bdc0f83db45cS3BucketA501FC08" + "Ref": "AssetParameters50fe6f46cf18fb257f00fed007da5c80fbf5dee08bec37fe765c50188eecae0bS3Bucket4125B4E4" }, "S3Key": { "Fn::Join": [ @@ -49,7 +49,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters94972df8a01484c56b50bec3793ac6c4302bc044db29d3502007bdc0f83db45cS3VersionKey1C3AFB39" + "Ref": "AssetParameters50fe6f46cf18fb257f00fed007da5c80fbf5dee08bec37fe765c50188eecae0bS3VersionKey1CF28CF5" } ] } @@ -62,7 +62,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters94972df8a01484c56b50bec3793ac6c4302bc044db29d3502007bdc0f83db45cS3VersionKey1C3AFB39" + "Ref": "AssetParameters50fe6f46cf18fb257f00fed007da5c80fbf5dee08bec37fe765c50188eecae0bS3VersionKey1CF28CF5" } ] } @@ -121,7 +121,7 @@ "Properties": { "Code": { "S3Bucket": { - "Ref": "AssetParameters3b0b0f3cd46ea1490006d6cefca359385ec059bb00a0fbee4de2eecf48038e28S3Bucket7DE4D4D5" + "Ref": "AssetParameters314bcf2cee9a5b01d3be2c2815602d1d784611fac220dde672aca6cb54299076S3BucketD6F6E4F2" }, "S3Key": { "Fn::Join": [ @@ -134,7 +134,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters3b0b0f3cd46ea1490006d6cefca359385ec059bb00a0fbee4de2eecf48038e28S3VersionKeyAEB67E87" + "Ref": "AssetParameters314bcf2cee9a5b01d3be2c2815602d1d784611fac220dde672aca6cb54299076S3VersionKeyE0B47D8E" } ] } @@ -147,7 +147,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters3b0b0f3cd46ea1490006d6cefca359385ec059bb00a0fbee4de2eecf48038e28S3VersionKeyAEB67E87" + "Ref": "AssetParameters314bcf2cee9a5b01d3be2c2815602d1d784611fac220dde672aca6cb54299076S3VersionKeyE0B47D8E" } ] } @@ -206,7 +206,7 @@ "Properties": { "Code": { "S3Bucket": { - "Ref": "AssetParameters876959f777c5a23bf4408991959c55c91810329d159608feb7ede69418b35009S3BucketA66E9035" + "Ref": "AssetParameters11846740cde0308720709e44dce627bf1ceb557ee9d0dbb556a05632da565ef2S3BucketE17A9F3E" }, "S3Key": { "Fn::Join": [ @@ -219,7 +219,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters876959f777c5a23bf4408991959c55c91810329d159608feb7ede69418b35009S3VersionKeyAFEB5FDA" + "Ref": "AssetParameters11846740cde0308720709e44dce627bf1ceb557ee9d0dbb556a05632da565ef2S3VersionKey0A0F7F93" } ] } @@ -232,7 +232,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters876959f777c5a23bf4408991959c55c91810329d159608feb7ede69418b35009S3VersionKeyAFEB5FDA" + "Ref": "AssetParameters11846740cde0308720709e44dce627bf1ceb557ee9d0dbb556a05632da565ef2S3VersionKey0A0F7F93" } ] } @@ -257,41 +257,41 @@ } }, "Parameters": { - "AssetParameters94972df8a01484c56b50bec3793ac6c4302bc044db29d3502007bdc0f83db45cS3BucketA501FC08": { + "AssetParameters50fe6f46cf18fb257f00fed007da5c80fbf5dee08bec37fe765c50188eecae0bS3Bucket4125B4E4": { "Type": "String", - "Description": "S3 bucket for asset \"94972df8a01484c56b50bec3793ac6c4302bc044db29d3502007bdc0f83db45c\"" + "Description": "S3 bucket for asset \"50fe6f46cf18fb257f00fed007da5c80fbf5dee08bec37fe765c50188eecae0b\"" }, - "AssetParameters94972df8a01484c56b50bec3793ac6c4302bc044db29d3502007bdc0f83db45cS3VersionKey1C3AFB39": { + "AssetParameters50fe6f46cf18fb257f00fed007da5c80fbf5dee08bec37fe765c50188eecae0bS3VersionKey1CF28CF5": { "Type": "String", - "Description": "S3 key for asset version \"94972df8a01484c56b50bec3793ac6c4302bc044db29d3502007bdc0f83db45c\"" + "Description": "S3 key for asset version \"50fe6f46cf18fb257f00fed007da5c80fbf5dee08bec37fe765c50188eecae0b\"" }, - "AssetParameters94972df8a01484c56b50bec3793ac6c4302bc044db29d3502007bdc0f83db45cArtifactHash99DC751A": { + "AssetParameters50fe6f46cf18fb257f00fed007da5c80fbf5dee08bec37fe765c50188eecae0bArtifactHashC28E4EDF": { "Type": "String", - "Description": "Artifact hash for asset \"94972df8a01484c56b50bec3793ac6c4302bc044db29d3502007bdc0f83db45c\"" + "Description": "Artifact hash for asset \"50fe6f46cf18fb257f00fed007da5c80fbf5dee08bec37fe765c50188eecae0b\"" }, - "AssetParameters3b0b0f3cd46ea1490006d6cefca359385ec059bb00a0fbee4de2eecf48038e28S3Bucket7DE4D4D5": { + "AssetParameters314bcf2cee9a5b01d3be2c2815602d1d784611fac220dde672aca6cb54299076S3BucketD6F6E4F2": { "Type": "String", - "Description": "S3 bucket for asset \"3b0b0f3cd46ea1490006d6cefca359385ec059bb00a0fbee4de2eecf48038e28\"" + "Description": "S3 bucket for asset \"314bcf2cee9a5b01d3be2c2815602d1d784611fac220dde672aca6cb54299076\"" }, - "AssetParameters3b0b0f3cd46ea1490006d6cefca359385ec059bb00a0fbee4de2eecf48038e28S3VersionKeyAEB67E87": { + "AssetParameters314bcf2cee9a5b01d3be2c2815602d1d784611fac220dde672aca6cb54299076S3VersionKeyE0B47D8E": { "Type": "String", - "Description": "S3 key for asset version \"3b0b0f3cd46ea1490006d6cefca359385ec059bb00a0fbee4de2eecf48038e28\"" + "Description": "S3 key for asset version \"314bcf2cee9a5b01d3be2c2815602d1d784611fac220dde672aca6cb54299076\"" }, - "AssetParameters3b0b0f3cd46ea1490006d6cefca359385ec059bb00a0fbee4de2eecf48038e28ArtifactHashE51CE860": { + "AssetParameters314bcf2cee9a5b01d3be2c2815602d1d784611fac220dde672aca6cb54299076ArtifactHash45C2DF56": { "Type": "String", - "Description": "Artifact hash for asset \"3b0b0f3cd46ea1490006d6cefca359385ec059bb00a0fbee4de2eecf48038e28\"" + "Description": "Artifact hash for asset \"314bcf2cee9a5b01d3be2c2815602d1d784611fac220dde672aca6cb54299076\"" }, - "AssetParameters876959f777c5a23bf4408991959c55c91810329d159608feb7ede69418b35009S3BucketA66E9035": { + "AssetParameters11846740cde0308720709e44dce627bf1ceb557ee9d0dbb556a05632da565ef2S3BucketE17A9F3E": { "Type": "String", - "Description": "S3 bucket for asset \"876959f777c5a23bf4408991959c55c91810329d159608feb7ede69418b35009\"" + "Description": "S3 bucket for asset \"11846740cde0308720709e44dce627bf1ceb557ee9d0dbb556a05632da565ef2\"" }, - "AssetParameters876959f777c5a23bf4408991959c55c91810329d159608feb7ede69418b35009S3VersionKeyAFEB5FDA": { + "AssetParameters11846740cde0308720709e44dce627bf1ceb557ee9d0dbb556a05632da565ef2S3VersionKey0A0F7F93": { "Type": "String", - "Description": "S3 key for asset version \"876959f777c5a23bf4408991959c55c91810329d159608feb7ede69418b35009\"" + "Description": "S3 key for asset version \"11846740cde0308720709e44dce627bf1ceb557ee9d0dbb556a05632da565ef2\"" }, - "AssetParameters876959f777c5a23bf4408991959c55c91810329d159608feb7ede69418b35009ArtifactHashB9A1080D": { + "AssetParameters11846740cde0308720709e44dce627bf1ceb557ee9d0dbb556a05632da565ef2ArtifactHash743A82BD": { "Type": "String", - "Description": "Artifact hash for asset \"876959f777c5a23bf4408991959c55c91810329d159608feb7ede69418b35009\"" + "Description": "Artifact hash for asset \"11846740cde0308720709e44dce627bf1ceb557ee9d0dbb556a05632da565ef2\"" } }, "Outputs": { diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.expected.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.expected.json index 5ea17bca31920..c2ad372f25649 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.expected.json +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.expected.json @@ -36,7 +36,7 @@ "Properties": { "Code": { "S3Bucket": { - "Ref": "AssetParameters61d8d26f10d1d73dee2732bec7ed381d2c987fc2912a339f2f119f3b0ea175efS3BucketD53ED9C5" + "Ref": "AssetParameters3bc4d0e28b60c2b2468004185dabbe33a91c04563872cafb35b5b71e8a8f33d4S3Bucket68AF28A9" }, "S3Key": { "Fn::Join": [ @@ -49,7 +49,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters61d8d26f10d1d73dee2732bec7ed381d2c987fc2912a339f2f119f3b0ea175efS3VersionKey3C218A3E" + "Ref": "AssetParameters3bc4d0e28b60c2b2468004185dabbe33a91c04563872cafb35b5b71e8a8f33d4S3VersionKeyACC0084B" } ] } @@ -62,7 +62,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters61d8d26f10d1d73dee2732bec7ed381d2c987fc2912a339f2f119f3b0ea175efS3VersionKey3C218A3E" + "Ref": "AssetParameters3bc4d0e28b60c2b2468004185dabbe33a91c04563872cafb35b5b71e8a8f33d4S3VersionKeyACC0084B" } ] } @@ -121,7 +121,7 @@ "Properties": { "Code": { "S3Bucket": { - "Ref": "AssetParameters1d66b06c3b3ee86b3126fb58d7a06ff055d366d8aeeb4dfbaf28d40f0930956dS3BucketFDE171D0" + "Ref": "AssetParametersc1614067648b8b7e151e321ce82879d259a2b8f2bd10dddd61f0f2ce26287c17S3Bucket980A99E7" }, "S3Key": { "Fn::Join": [ @@ -134,7 +134,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters1d66b06c3b3ee86b3126fb58d7a06ff055d366d8aeeb4dfbaf28d40f0930956dS3VersionKey6209E240" + "Ref": "AssetParametersc1614067648b8b7e151e321ce82879d259a2b8f2bd10dddd61f0f2ce26287c17S3VersionKeyC4E1E9B5" } ] } @@ -147,7 +147,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters1d66b06c3b3ee86b3126fb58d7a06ff055d366d8aeeb4dfbaf28d40f0930956dS3VersionKey6209E240" + "Ref": "AssetParametersc1614067648b8b7e151e321ce82879d259a2b8f2bd10dddd61f0f2ce26287c17S3VersionKeyC4E1E9B5" } ] } @@ -206,7 +206,7 @@ "Properties": { "Code": { "S3Bucket": { - "Ref": "AssetParameters96a447e468bf9d3b52d13213757160cd43f28737a29b8682c281fde388762e68S3BucketA23E6312" + "Ref": "AssetParameters3610bde00ecd0013f7806e2ab0e80d7ac26232cd3ffc2934b5ca28fef120bdf6S3Bucket91AABE39" }, "S3Key": { "Fn::Join": [ @@ -219,7 +219,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters96a447e468bf9d3b52d13213757160cd43f28737a29b8682c281fde388762e68S3VersionKey1E21AF83" + "Ref": "AssetParameters3610bde00ecd0013f7806e2ab0e80d7ac26232cd3ffc2934b5ca28fef120bdf6S3VersionKeyEE0FAD90" } ] } @@ -232,7 +232,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters96a447e468bf9d3b52d13213757160cd43f28737a29b8682c281fde388762e68S3VersionKey1E21AF83" + "Ref": "AssetParameters3610bde00ecd0013f7806e2ab0e80d7ac26232cd3ffc2934b5ca28fef120bdf6S3VersionKeyEE0FAD90" } ] } @@ -257,41 +257,41 @@ } }, "Parameters": { - "AssetParameters61d8d26f10d1d73dee2732bec7ed381d2c987fc2912a339f2f119f3b0ea175efS3BucketD53ED9C5": { + "AssetParameters3bc4d0e28b60c2b2468004185dabbe33a91c04563872cafb35b5b71e8a8f33d4S3Bucket68AF28A9": { "Type": "String", - "Description": "S3 bucket for asset \"61d8d26f10d1d73dee2732bec7ed381d2c987fc2912a339f2f119f3b0ea175ef\"" + "Description": "S3 bucket for asset \"3bc4d0e28b60c2b2468004185dabbe33a91c04563872cafb35b5b71e8a8f33d4\"" }, - "AssetParameters61d8d26f10d1d73dee2732bec7ed381d2c987fc2912a339f2f119f3b0ea175efS3VersionKey3C218A3E": { + "AssetParameters3bc4d0e28b60c2b2468004185dabbe33a91c04563872cafb35b5b71e8a8f33d4S3VersionKeyACC0084B": { "Type": "String", - "Description": "S3 key for asset version \"61d8d26f10d1d73dee2732bec7ed381d2c987fc2912a339f2f119f3b0ea175ef\"" + "Description": "S3 key for asset version \"3bc4d0e28b60c2b2468004185dabbe33a91c04563872cafb35b5b71e8a8f33d4\"" }, - "AssetParameters61d8d26f10d1d73dee2732bec7ed381d2c987fc2912a339f2f119f3b0ea175efArtifactHash6A1881A8": { + "AssetParameters3bc4d0e28b60c2b2468004185dabbe33a91c04563872cafb35b5b71e8a8f33d4ArtifactHashC2D4B1C3": { "Type": "String", - "Description": "Artifact hash for asset \"61d8d26f10d1d73dee2732bec7ed381d2c987fc2912a339f2f119f3b0ea175ef\"" + "Description": "Artifact hash for asset \"3bc4d0e28b60c2b2468004185dabbe33a91c04563872cafb35b5b71e8a8f33d4\"" }, - "AssetParameters1d66b06c3b3ee86b3126fb58d7a06ff055d366d8aeeb4dfbaf28d40f0930956dS3BucketFDE171D0": { + "AssetParametersc1614067648b8b7e151e321ce82879d259a2b8f2bd10dddd61f0f2ce26287c17S3Bucket980A99E7": { "Type": "String", - "Description": "S3 bucket for asset \"1d66b06c3b3ee86b3126fb58d7a06ff055d366d8aeeb4dfbaf28d40f0930956d\"" + "Description": "S3 bucket for asset \"c1614067648b8b7e151e321ce82879d259a2b8f2bd10dddd61f0f2ce26287c17\"" }, - "AssetParameters1d66b06c3b3ee86b3126fb58d7a06ff055d366d8aeeb4dfbaf28d40f0930956dS3VersionKey6209E240": { + "AssetParametersc1614067648b8b7e151e321ce82879d259a2b8f2bd10dddd61f0f2ce26287c17S3VersionKeyC4E1E9B5": { "Type": "String", - "Description": "S3 key for asset version \"1d66b06c3b3ee86b3126fb58d7a06ff055d366d8aeeb4dfbaf28d40f0930956d\"" + "Description": "S3 key for asset version \"c1614067648b8b7e151e321ce82879d259a2b8f2bd10dddd61f0f2ce26287c17\"" }, - "AssetParameters1d66b06c3b3ee86b3126fb58d7a06ff055d366d8aeeb4dfbaf28d40f0930956dArtifactHash02B929EC": { + "AssetParametersc1614067648b8b7e151e321ce82879d259a2b8f2bd10dddd61f0f2ce26287c17ArtifactHash5B02FA4D": { "Type": "String", - "Description": "Artifact hash for asset \"1d66b06c3b3ee86b3126fb58d7a06ff055d366d8aeeb4dfbaf28d40f0930956d\"" + "Description": "Artifact hash for asset \"c1614067648b8b7e151e321ce82879d259a2b8f2bd10dddd61f0f2ce26287c17\"" }, - "AssetParameters96a447e468bf9d3b52d13213757160cd43f28737a29b8682c281fde388762e68S3BucketA23E6312": { + "AssetParameters3610bde00ecd0013f7806e2ab0e80d7ac26232cd3ffc2934b5ca28fef120bdf6S3Bucket91AABE39": { "Type": "String", - "Description": "S3 bucket for asset \"96a447e468bf9d3b52d13213757160cd43f28737a29b8682c281fde388762e68\"" + "Description": "S3 bucket for asset \"3610bde00ecd0013f7806e2ab0e80d7ac26232cd3ffc2934b5ca28fef120bdf6\"" }, - "AssetParameters96a447e468bf9d3b52d13213757160cd43f28737a29b8682c281fde388762e68S3VersionKey1E21AF83": { + "AssetParameters3610bde00ecd0013f7806e2ab0e80d7ac26232cd3ffc2934b5ca28fef120bdf6S3VersionKeyEE0FAD90": { "Type": "String", - "Description": "S3 key for asset version \"96a447e468bf9d3b52d13213757160cd43f28737a29b8682c281fde388762e68\"" + "Description": "S3 key for asset version \"3610bde00ecd0013f7806e2ab0e80d7ac26232cd3ffc2934b5ca28fef120bdf6\"" }, - "AssetParameters96a447e468bf9d3b52d13213757160cd43f28737a29b8682c281fde388762e68ArtifactHash0043D2A0": { + "AssetParameters3610bde00ecd0013f7806e2ab0e80d7ac26232cd3ffc2934b5ca28fef120bdf6ArtifactHash09CEB444": { "Type": "String", - "Description": "Artifact hash for asset \"96a447e468bf9d3b52d13213757160cd43f28737a29b8682c281fde388762e68\"" + "Description": "Artifact hash for asset \"3610bde00ecd0013f7806e2ab0e80d7ac26232cd3ffc2934b5ca28fef120bdf6\"" } }, "Outputs": { diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.project.expected.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.project.expected.json index 9a81c901d7451..aa13e73295e64 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.project.expected.json +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.project.expected.json @@ -5,7 +5,7 @@ "Properties": { "Content": { "S3Bucket": { - "Ref": "AssetParameters6a4b9ce26d3228c4effd7b46ed51ab439e79a530934ad9bde7d77d7f6b6ebd4aS3BucketCCD07444" + "Ref": "AssetParameterse174a6a88cb48eb510c29b2bf0203c181cfa059320745e6ae6429e522b36c66eS3Bucket7A00FCB4" }, "S3Key": { "Fn::Join": [ @@ -18,7 +18,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters6a4b9ce26d3228c4effd7b46ed51ab439e79a530934ad9bde7d77d7f6b6ebd4aS3VersionKeyA8B74284" + "Ref": "AssetParameterse174a6a88cb48eb510c29b2bf0203c181cfa059320745e6ae6429e522b36c66eS3VersionKey8BF2F9D6" } ] } @@ -31,7 +31,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters6a4b9ce26d3228c4effd7b46ed51ab439e79a530934ad9bde7d77d7f6b6ebd4aS3VersionKeyA8B74284" + "Ref": "AssetParameterse174a6a88cb48eb510c29b2bf0203c181cfa059320745e6ae6429e522b36c66eS3VersionKey8BF2F9D6" } ] } @@ -82,7 +82,7 @@ "Properties": { "Code": { "S3Bucket": { - "Ref": "AssetParameters71de8786d26e9f9205375b6cea9342e92d8a622a97d01d7e7d2f7661f056f218S3Bucket89C9DB12" + "Ref": "AssetParameters907ec4b12820d4b2dc64e7f0f1f1f6267c1db622bc42aa57f5361efa12b1aafbS3Bucket16F02289" }, "S3Key": { "Fn::Join": [ @@ -95,7 +95,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters71de8786d26e9f9205375b6cea9342e92d8a622a97d01d7e7d2f7661f056f218S3VersionKey435DAD55" + "Ref": "AssetParameters907ec4b12820d4b2dc64e7f0f1f1f6267c1db622bc42aa57f5361efa12b1aafbS3VersionKeyDAF0A5BD" } ] } @@ -108,7 +108,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters71de8786d26e9f9205375b6cea9342e92d8a622a97d01d7e7d2f7661f056f218S3VersionKey435DAD55" + "Ref": "AssetParameters907ec4b12820d4b2dc64e7f0f1f1f6267c1db622bc42aa57f5361efa12b1aafbS3VersionKeyDAF0A5BD" } ] } @@ -138,29 +138,29 @@ } }, "Parameters": { - "AssetParameters6a4b9ce26d3228c4effd7b46ed51ab439e79a530934ad9bde7d77d7f6b6ebd4aS3BucketCCD07444": { + "AssetParameterse174a6a88cb48eb510c29b2bf0203c181cfa059320745e6ae6429e522b36c66eS3Bucket7A00FCB4": { "Type": "String", - "Description": "S3 bucket for asset \"6a4b9ce26d3228c4effd7b46ed51ab439e79a530934ad9bde7d77d7f6b6ebd4a\"" + "Description": "S3 bucket for asset \"e174a6a88cb48eb510c29b2bf0203c181cfa059320745e6ae6429e522b36c66e\"" }, - "AssetParameters6a4b9ce26d3228c4effd7b46ed51ab439e79a530934ad9bde7d77d7f6b6ebd4aS3VersionKeyA8B74284": { + "AssetParameterse174a6a88cb48eb510c29b2bf0203c181cfa059320745e6ae6429e522b36c66eS3VersionKey8BF2F9D6": { "Type": "String", - "Description": "S3 key for asset version \"6a4b9ce26d3228c4effd7b46ed51ab439e79a530934ad9bde7d77d7f6b6ebd4a\"" + "Description": "S3 key for asset version \"e174a6a88cb48eb510c29b2bf0203c181cfa059320745e6ae6429e522b36c66e\"" }, - "AssetParameters6a4b9ce26d3228c4effd7b46ed51ab439e79a530934ad9bde7d77d7f6b6ebd4aArtifactHashB3093591": { + "AssetParameterse174a6a88cb48eb510c29b2bf0203c181cfa059320745e6ae6429e522b36c66eArtifactHash2DECF34E": { "Type": "String", - "Description": "Artifact hash for asset \"6a4b9ce26d3228c4effd7b46ed51ab439e79a530934ad9bde7d77d7f6b6ebd4a\"" + "Description": "Artifact hash for asset \"e174a6a88cb48eb510c29b2bf0203c181cfa059320745e6ae6429e522b36c66e\"" }, - "AssetParameters71de8786d26e9f9205375b6cea9342e92d8a622a97d01d7e7d2f7661f056f218S3Bucket89C9DB12": { + "AssetParameters907ec4b12820d4b2dc64e7f0f1f1f6267c1db622bc42aa57f5361efa12b1aafbS3Bucket16F02289": { "Type": "String", - "Description": "S3 bucket for asset \"71de8786d26e9f9205375b6cea9342e92d8a622a97d01d7e7d2f7661f056f218\"" + "Description": "S3 bucket for asset \"907ec4b12820d4b2dc64e7f0f1f1f6267c1db622bc42aa57f5361efa12b1aafb\"" }, - "AssetParameters71de8786d26e9f9205375b6cea9342e92d8a622a97d01d7e7d2f7661f056f218S3VersionKey435DAD55": { + "AssetParameters907ec4b12820d4b2dc64e7f0f1f1f6267c1db622bc42aa57f5361efa12b1aafbS3VersionKeyDAF0A5BD": { "Type": "String", - "Description": "S3 key for asset version \"71de8786d26e9f9205375b6cea9342e92d8a622a97d01d7e7d2f7661f056f218\"" + "Description": "S3 key for asset version \"907ec4b12820d4b2dc64e7f0f1f1f6267c1db622bc42aa57f5361efa12b1aafb\"" }, - "AssetParameters71de8786d26e9f9205375b6cea9342e92d8a622a97d01d7e7d2f7661f056f218ArtifactHash0EDF3CD0": { + "AssetParameters907ec4b12820d4b2dc64e7f0f1f1f6267c1db622bc42aa57f5361efa12b1aafbArtifactHashD7592B0F": { "Type": "String", - "Description": "Artifact hash for asset \"71de8786d26e9f9205375b6cea9342e92d8a622a97d01d7e7d2f7661f056f218\"" + "Description": "Artifact hash for asset \"907ec4b12820d4b2dc64e7f0f1f1f6267c1db622bc42aa57f5361efa12b1aafb\"" } }, "Outputs": { diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.py38.expected.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.py38.expected.json index b5b137205752f..c49f5e312d873 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.py38.expected.json +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.py38.expected.json @@ -36,7 +36,7 @@ "Properties": { "Code": { "S3Bucket": { - "Ref": "AssetParameters1482f01217b8bed41000ca172724dc762f68208d3faa315bd6e8e07bbea148adS3BucketA9379638" + "Ref": "AssetParameters6cc4994756d4085a860e734568c92826773e52c22c58894ce368b1e698da413dS3Bucket74CBB570" }, "S3Key": { "Fn::Join": [ @@ -49,7 +49,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters1482f01217b8bed41000ca172724dc762f68208d3faa315bd6e8e07bbea148adS3VersionKey4376B462" + "Ref": "AssetParameters6cc4994756d4085a860e734568c92826773e52c22c58894ce368b1e698da413dS3VersionKey3CBAF21A" } ] } @@ -62,7 +62,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters1482f01217b8bed41000ca172724dc762f68208d3faa315bd6e8e07bbea148adS3VersionKey4376B462" + "Ref": "AssetParameters6cc4994756d4085a860e734568c92826773e52c22c58894ce368b1e698da413dS3VersionKey3CBAF21A" } ] } @@ -87,17 +87,17 @@ } }, "Parameters": { - "AssetParameters1482f01217b8bed41000ca172724dc762f68208d3faa315bd6e8e07bbea148adS3BucketA9379638": { + "AssetParameters6cc4994756d4085a860e734568c92826773e52c22c58894ce368b1e698da413dS3Bucket74CBB570": { "Type": "String", - "Description": "S3 bucket for asset \"1482f01217b8bed41000ca172724dc762f68208d3faa315bd6e8e07bbea148ad\"" + "Description": "S3 bucket for asset \"6cc4994756d4085a860e734568c92826773e52c22c58894ce368b1e698da413d\"" }, - "AssetParameters1482f01217b8bed41000ca172724dc762f68208d3faa315bd6e8e07bbea148adS3VersionKey4376B462": { + "AssetParameters6cc4994756d4085a860e734568c92826773e52c22c58894ce368b1e698da413dS3VersionKey3CBAF21A": { "Type": "String", - "Description": "S3 key for asset version \"1482f01217b8bed41000ca172724dc762f68208d3faa315bd6e8e07bbea148ad\"" + "Description": "S3 key for asset version \"6cc4994756d4085a860e734568c92826773e52c22c58894ce368b1e698da413d\"" }, - "AssetParameters1482f01217b8bed41000ca172724dc762f68208d3faa315bd6e8e07bbea148adArtifactHashB9B928DC": { + "AssetParameters6cc4994756d4085a860e734568c92826773e52c22c58894ce368b1e698da413dArtifactHash750F3AF8": { "Type": "String", - "Description": "Artifact hash for asset \"1482f01217b8bed41000ca172724dc762f68208d3faa315bd6e8e07bbea148ad\"" + "Description": "Artifact hash for asset \"6cc4994756d4085a860e734568c92826773e52c22c58894ce368b1e698da413d\"" } }, "Outputs": { diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.requirements.removed.expected.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.requirements.removed.expected.json index 6b3b8230c2874..c70f4a0ca8933 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.requirements.removed.expected.json +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.requirements.removed.expected.json @@ -36,7 +36,7 @@ "Properties": { "Code": { "S3Bucket": { - "Ref": "AssetParametersaf41a5381eff9302e9acdfeb9c3bcf160b56a97091242b2d599ed5a861af966aS3BucketEE202B67" + "Ref": "AssetParameters6fa8e0c54d06a6402126a86fab5da1fa1397bcce628a0fb56f8356a2edf6280dS3Bucket2F189DB9" }, "S3Key": { "Fn::Join": [ @@ -49,7 +49,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParametersaf41a5381eff9302e9acdfeb9c3bcf160b56a97091242b2d599ed5a861af966aS3VersionKey8097C675" + "Ref": "AssetParameters6fa8e0c54d06a6402126a86fab5da1fa1397bcce628a0fb56f8356a2edf6280dS3VersionKeyDF03C812" } ] } @@ -62,7 +62,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParametersaf41a5381eff9302e9acdfeb9c3bcf160b56a97091242b2d599ed5a861af966aS3VersionKey8097C675" + "Ref": "AssetParameters6fa8e0c54d06a6402126a86fab5da1fa1397bcce628a0fb56f8356a2edf6280dS3VersionKeyDF03C812" } ] } @@ -87,17 +87,17 @@ } }, "Parameters": { - "AssetParametersaf41a5381eff9302e9acdfeb9c3bcf160b56a97091242b2d599ed5a861af966aS3BucketEE202B67": { + "AssetParameters6fa8e0c54d06a6402126a86fab5da1fa1397bcce628a0fb56f8356a2edf6280dS3Bucket2F189DB9": { "Type": "String", - "Description": "S3 bucket for asset \"af41a5381eff9302e9acdfeb9c3bcf160b56a97091242b2d599ed5a861af966a\"" + "Description": "S3 bucket for asset \"6fa8e0c54d06a6402126a86fab5da1fa1397bcce628a0fb56f8356a2edf6280d\"" }, - "AssetParametersaf41a5381eff9302e9acdfeb9c3bcf160b56a97091242b2d599ed5a861af966aS3VersionKey8097C675": { + "AssetParameters6fa8e0c54d06a6402126a86fab5da1fa1397bcce628a0fb56f8356a2edf6280dS3VersionKeyDF03C812": { "Type": "String", - "Description": "S3 key for asset version \"af41a5381eff9302e9acdfeb9c3bcf160b56a97091242b2d599ed5a861af966a\"" + "Description": "S3 key for asset version \"6fa8e0c54d06a6402126a86fab5da1fa1397bcce628a0fb56f8356a2edf6280d\"" }, - "AssetParametersaf41a5381eff9302e9acdfeb9c3bcf160b56a97091242b2d599ed5a861af966aArtifactHash3E92B1F8": { + "AssetParameters6fa8e0c54d06a6402126a86fab5da1fa1397bcce628a0fb56f8356a2edf6280dArtifactHash1F692755": { "Type": "String", - "Description": "Artifact hash for asset \"af41a5381eff9302e9acdfeb9c3bcf160b56a97091242b2d599ed5a861af966a\"" + "Description": "Artifact hash for asset \"6fa8e0c54d06a6402126a86fab5da1fa1397bcce628a0fb56f8356a2edf6280d\"" } }, "Outputs": { diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.vpc.expected.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.vpc.expected.json index 63fad4c61de14..6787327a15e40 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.vpc.expected.json +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.vpc.expected.json @@ -296,7 +296,7 @@ "Properties": { "Code": { "S3Bucket": { - "Ref": "AssetParameters4ee6ce8b6ee4bd51743dc0c39d6e52baebaeafff9c9dfea0ff84de98d1dbf353S3Bucket414E0E30" + "Ref": "AssetParameters83be407310ab5911f40fa4934091a233f92ce3be1d81c48846f30fa0a9330530S3Bucket82392CBF" }, "S3Key": { "Fn::Join": [ @@ -309,7 +309,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters4ee6ce8b6ee4bd51743dc0c39d6e52baebaeafff9c9dfea0ff84de98d1dbf353S3VersionKey5ABC9098" + "Ref": "AssetParameters83be407310ab5911f40fa4934091a233f92ce3be1d81c48846f30fa0a9330530S3VersionKey292822E7" } ] } @@ -322,7 +322,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters4ee6ce8b6ee4bd51743dc0c39d6e52baebaeafff9c9dfea0ff84de98d1dbf353S3VersionKey5ABC9098" + "Ref": "AssetParameters83be407310ab5911f40fa4934091a233f92ce3be1d81c48846f30fa0a9330530S3VersionKey292822E7" } ] } @@ -368,17 +368,17 @@ } }, "Parameters": { - "AssetParameters4ee6ce8b6ee4bd51743dc0c39d6e52baebaeafff9c9dfea0ff84de98d1dbf353S3Bucket414E0E30": { + "AssetParameters83be407310ab5911f40fa4934091a233f92ce3be1d81c48846f30fa0a9330530S3Bucket82392CBF": { "Type": "String", - "Description": "S3 bucket for asset \"4ee6ce8b6ee4bd51743dc0c39d6e52baebaeafff9c9dfea0ff84de98d1dbf353\"" + "Description": "S3 bucket for asset \"83be407310ab5911f40fa4934091a233f92ce3be1d81c48846f30fa0a9330530\"" }, - "AssetParameters4ee6ce8b6ee4bd51743dc0c39d6e52baebaeafff9c9dfea0ff84de98d1dbf353S3VersionKey5ABC9098": { + "AssetParameters83be407310ab5911f40fa4934091a233f92ce3be1d81c48846f30fa0a9330530S3VersionKey292822E7": { "Type": "String", - "Description": "S3 key for asset version \"4ee6ce8b6ee4bd51743dc0c39d6e52baebaeafff9c9dfea0ff84de98d1dbf353\"" + "Description": "S3 key for asset version \"83be407310ab5911f40fa4934091a233f92ce3be1d81c48846f30fa0a9330530\"" }, - "AssetParameters4ee6ce8b6ee4bd51743dc0c39d6e52baebaeafff9c9dfea0ff84de98d1dbf353ArtifactHashECA6C88C": { + "AssetParameters83be407310ab5911f40fa4934091a233f92ce3be1d81c48846f30fa0a9330530ArtifactHash8818CE02": { "Type": "String", - "Description": "Artifact hash for asset \"4ee6ce8b6ee4bd51743dc0c39d6e52baebaeafff9c9dfea0ff84de98d1dbf353\"" + "Description": "Artifact hash for asset \"83be407310ab5911f40fa4934091a233f92ce3be1d81c48846f30fa0a9330530\"" } }, "Outputs": { diff --git a/packages/@aws-cdk/aws-lambda-python/test/layer.test.ts b/packages/@aws-cdk/aws-lambda-python/test/layer.test.ts index 8ace2ec3f7a18..255adb0dae646 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/layer.test.ts +++ b/packages/@aws-cdk/aws-lambda-python/test/layer.test.ts @@ -2,7 +2,7 @@ import '@aws-cdk/assert/jest'; import * as path from 'path'; import { Runtime } from '@aws-cdk/aws-lambda'; import { Stack } from '@aws-cdk/core'; -import { hasDependencies, bundle } from '../lib/bundling'; +import { stageDependencies, bundle } from '../lib/bundling'; import { PythonLayerVersion } from '../lib/layer'; jest.mock('../lib/bundling', () => { @@ -18,11 +18,11 @@ jest.mock('../lib/bundling', () => { }, bindToResource: () => { return; }, }), - hasDependencies: jest.fn().mockReturnValue(true), + stageDependencies: jest.fn().mockReturnValue(true), }; }); -const hasDependenciesMock = (hasDependencies as jest.Mock); +const hasDependenciesMock = (stageDependencies as jest.Mock); let stack: Stack; beforeEach(() => { diff --git a/packages/@aws-cdk/core/lib/bundling.ts b/packages/@aws-cdk/core/lib/bundling.ts index b1247fd913ea0..0179b07d2f8f3 100644 --- a/packages/@aws-cdk/core/lib/bundling.ts +++ b/packages/@aws-cdk/core/lib/bundling.ts @@ -1,5 +1,6 @@ import { spawnSync, SpawnSyncOptions } from 'child_process'; import * as crypto from 'crypto'; +import { isAbsolute, join } from 'path'; import { FileSystem } from './fs'; /** @@ -120,16 +121,18 @@ export class BundlingDockerImage { public static fromAsset(path: string, options: DockerBuildOptions = {}) { const buildArgs = options.buildArgs || {}; + if (options.file && isAbsolute(options.file)) { + throw new Error(`"file" must be relative to the docker build directory. Got ${options.file}`); + } + // Image tag derived from path and build options - const tagHash = crypto.createHash('sha256').update(JSON.stringify({ - path, - ...options, - })).digest('hex'); + const input = JSON.stringify({ path, ...options }); + const tagHash = crypto.createHash('sha256').update(input).digest('hex'); const tag = `cdk-${tagHash}`; const dockerArgs: string[] = [ 'build', '-t', tag, - ...(options.file ? ['-f', options.file] : []), + ...(options.file ? ['-f', join(path, options.file)] : []), ...flatten(Object.entries(buildArgs).map(([k, v]) => ['--build-arg', `${k}=${v}`])), path, ]; @@ -315,9 +318,9 @@ export interface DockerBuildOptions { readonly buildArgs?: { [key: string]: string }; /** - * Name of the Dockerfile + * Name of the Dockerfile, must relative to the docker build path. * - * @default - The Dockerfile immediately within the build context path + * @default `Dockerfile` */ readonly file?: string; } diff --git a/packages/@aws-cdk/core/test/bundling.test.ts b/packages/@aws-cdk/core/test/bundling.test.ts index 258860d65585c..cac2b494eb003 100644 --- a/packages/@aws-cdk/core/test/bundling.test.ts +++ b/packages/@aws-cdk/core/test/bundling.test.ts @@ -161,12 +161,14 @@ nodeunitShim({ signal: null, }); - BundlingDockerImage.fromAsset(path.join(__dirname, 'fs/fixtures/test1'), { + const imagePath = path.join(__dirname, 'fs/fixtures/test1'); + BundlingDockerImage.fromAsset(imagePath, { file: 'my-dockerfile', }); test.ok(spawnSyncStub.calledOnce); - test.ok(/-f my-dockerfile/.test(spawnSyncStub.firstCall.args[1]?.join(' ') ?? '')); + const expected = path.join(imagePath, 'my-dockerfile'); + test.ok(new RegExp(`-f ${expected}`).test(spawnSyncStub.firstCall.args[1]?.join(' ') ?? '')); test.done(); }, From 6318e2632297783bc8b5b2609bba096dd83a1113 Mon Sep 17 00:00:00 2001 From: AWS CDK Automation <43080478+aws-cdk-automation@users.noreply.github.com> Date: Wed, 24 Feb 2021 13:22:16 +0200 Subject: [PATCH 13/78] feat(cfnspec): cloudformation spec v29.0.0 (#13249) * feat: cloudformation spec v29.0.0 * Update CHANGELOG.md Co-authored-by: AWS CDK Team Co-authored-by: Rico Huijbers Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- packages/@aws-cdk/cfnspec/CHANGELOG.md | 123 +++++++ packages/@aws-cdk/cfnspec/cfn.version | 2 +- ...0_CloudFormationResourceSpecification.json | 307 +++++++++++++----- .../cfn-lint/StatefulResources/000.json | 1 - 4 files changed, 358 insertions(+), 75 deletions(-) diff --git a/packages/@aws-cdk/cfnspec/CHANGELOG.md b/packages/@aws-cdk/cfnspec/CHANGELOG.md index abcd6fa61a9c9..a952cac779b88 100644 --- a/packages/@aws-cdk/cfnspec/CHANGELOG.md +++ b/packages/@aws-cdk/cfnspec/CHANGELOG.md @@ -1,3 +1,126 @@ +# CloudFormation Resource Specification v29.0.0 + +## New Resource Types + +## Attribute Changes + +* AWS::EC2::TransitGatewayMulticastDomainAssociation State (__added__) +* AWS::EC2::TransitGatewayMulticastGroupMember TransitGatewayAttachmentId (__added__) +* AWS::EC2::TransitGatewayMulticastGroupSource TransitGatewayAttachmentId (__added__) +* AWS::IoTWireless::ServiceProfile LoRaWANResponse (__deleted__) +* AWS::IoTWireless::ServiceProfile ChannelMask (__added__) +* AWS::IoTWireless::ServiceProfile DevStatusReqFreq (__added__) +* AWS::IoTWireless::ServiceProfile DlBucketSize (__added__) +* AWS::IoTWireless::ServiceProfile DlRate (__added__) +* AWS::IoTWireless::ServiceProfile DlRatePolicy (__added__) +* AWS::IoTWireless::ServiceProfile DrMax (__added__) +* AWS::IoTWireless::ServiceProfile DrMin (__added__) +* AWS::IoTWireless::ServiceProfile HrAllowed (__added__) +* AWS::IoTWireless::ServiceProfile MinGwDiversity (__added__) +* AWS::IoTWireless::ServiceProfile NwkGeoLoc (__added__) +* AWS::IoTWireless::ServiceProfile PrAllowed (__added__) +* AWS::IoTWireless::ServiceProfile RaAllowed (__added__) +* AWS::IoTWireless::ServiceProfile ReportDevStatusBattery (__added__) +* AWS::IoTWireless::ServiceProfile ReportDevStatusMargin (__added__) +* AWS::IoTWireless::ServiceProfile TargetPer (__added__) +* AWS::IoTWireless::ServiceProfile UlBucketSize (__added__) +* AWS::IoTWireless::ServiceProfile UlRate (__added__) +* AWS::IoTWireless::ServiceProfile UlRatePolicy (__added__) +* AWS::IoTWireless::WirelessDevice ThingArn (__deleted__) +* AWS::IoTWireless::WirelessGateway ThingArn (__deleted__) +* AWS::IoTWireless::WirelessGateway ThingName (__added__) + +## Property Changes + +* AWS::CodeBuild::Project ConcurrentBuildLimit (__added__) +* AWS::DataBrew::Job JobSample (__added__) +* AWS::DynamoDB::Table KinesisStreamSpecification (__added__) +* AWS::EC2::TransitGatewayMulticastDomain TransitGatewayId.Required (__changed__) + * Old: false + * New: true +* AWS::EC2::TransitGatewayMulticastDomainAssociation State (__deleted__) +* AWS::EC2::TransitGatewayMulticastDomainAssociation SubnetId.Required (__changed__) + * Old: false + * New: true +* AWS::EC2::TransitGatewayMulticastDomainAssociation TransitGatewayAttachmentId.Required (__changed__) + * Old: false + * New: true +* AWS::EC2::TransitGatewayMulticastDomainAssociation TransitGatewayMulticastDomainId.Required (__changed__) + * Old: false + * New: true +* AWS::EC2::TransitGatewayMulticastGroupMember TransitGatewayAttachmentId (__deleted__) +* AWS::EC2::TransitGatewayMulticastGroupMember GroupIpAddress.Required (__changed__) + * Old: false + * New: true +* AWS::EC2::TransitGatewayMulticastGroupMember NetworkInterfaceId.Required (__changed__) + * Old: false + * New: true +* AWS::EC2::TransitGatewayMulticastGroupMember TransitGatewayMulticastDomainId.Required (__changed__) + * Old: false + * New: true +* AWS::EC2::TransitGatewayMulticastGroupSource TransitGatewayAttachmentId (__deleted__) +* AWS::EC2::TransitGatewayMulticastGroupSource GroupIpAddress.Required (__changed__) + * Old: false + * New: true +* AWS::EC2::TransitGatewayMulticastGroupSource NetworkInterfaceId.Required (__changed__) + * Old: false + * New: true +* AWS::EC2::TransitGatewayMulticastGroupSource TransitGatewayMulticastDomainId.Required (__changed__) + * Old: false + * New: true +* AWS::ElastiCache::GlobalReplicationGroup CacheParameterGroupName (__added__) +* AWS::ElasticLoadBalancingV2::TargetGroup ProtocolVersion (__added__) +* AWS::ImageBuilder::Image ContainerRecipeArn (__added__) +* AWS::ImageBuilder::Image ImageRecipeArn.Required (__changed__) + * Old: true + * New: false +* AWS::ImageBuilder::ImagePipeline ContainerRecipeArn (__added__) +* AWS::ImageBuilder::ImagePipeline ImageRecipeArn.Required (__changed__) + * Old: true + * New: false +* AWS::IoTAnalytics::Dataset LateDataRules (__added__) +* AWS::IoTWireless::WirelessDevice ThingArn (__added__) +* AWS::IoTWireless::WirelessGateway ThingName (__deleted__) +* AWS::IoTWireless::WirelessGateway ThingArn (__added__) +* AWS::StepFunctions::StateMachine Definition (__added__) + +## Property Type Changes + +* AWS::IoTWireless::ServiceProfile.LoRaWANGetServiceProfileInfo (__removed__) +* AWS::DynamoDB::Table.KinesisStreamSpecification (__added__) +* AWS::IoTAnalytics::Dataset.DeltaTimeSessionWindowConfiguration (__added__) +* AWS::IoTAnalytics::Dataset.LateDataRule (__added__) +* AWS::IoTAnalytics::Dataset.LateDataRuleConfiguration (__added__) +* AWS::StepFunctions::StateMachine.Definition (__added__) +* AWS::CodeCommit::Repository.Code BranchName.UpdateType (__changed__) + * Old: Immutable + * New: Mutable +* AWS::ElasticLoadBalancingV2::TargetGroup.Matcher GrpcCode (__added__) +* AWS::FSx::FileSystem.WindowsConfiguration Aliases (__added__) +* AWS::FSx::FileSystem.WindowsConfiguration ThroughputCapacity.Required (__changed__) + * Old: false + * New: true +* AWS::IoTWireless::ServiceProfile.LoRaWANServiceProfile ChannelMask (__added__) +* AWS::IoTWireless::ServiceProfile.LoRaWANServiceProfile DevStatusReqFreq (__added__) +* AWS::IoTWireless::ServiceProfile.LoRaWANServiceProfile DlBucketSize (__added__) +* AWS::IoTWireless::ServiceProfile.LoRaWANServiceProfile DlRate (__added__) +* AWS::IoTWireless::ServiceProfile.LoRaWANServiceProfile DlRatePolicy (__added__) +* AWS::IoTWireless::ServiceProfile.LoRaWANServiceProfile DrMax (__added__) +* AWS::IoTWireless::ServiceProfile.LoRaWANServiceProfile DrMin (__added__) +* AWS::IoTWireless::ServiceProfile.LoRaWANServiceProfile HrAllowed (__added__) +* AWS::IoTWireless::ServiceProfile.LoRaWANServiceProfile MinGwDiversity (__added__) +* AWS::IoTWireless::ServiceProfile.LoRaWANServiceProfile NwkGeoLoc (__added__) +* AWS::IoTWireless::ServiceProfile.LoRaWANServiceProfile PrAllowed (__added__) +* AWS::IoTWireless::ServiceProfile.LoRaWANServiceProfile RaAllowed (__added__) +* AWS::IoTWireless::ServiceProfile.LoRaWANServiceProfile ReportDevStatusBattery (__added__) +* AWS::IoTWireless::ServiceProfile.LoRaWANServiceProfile ReportDevStatusMargin (__added__) +* AWS::IoTWireless::ServiceProfile.LoRaWANServiceProfile TargetPer (__added__) +* AWS::IoTWireless::ServiceProfile.LoRaWANServiceProfile UlBucketSize (__added__) +* AWS::IoTWireless::ServiceProfile.LoRaWANServiceProfile UlRate (__added__) +* AWS::IoTWireless::ServiceProfile.LoRaWANServiceProfile UlRatePolicy (__added__) +* AWS::Pinpoint::Campaign.CampaignSmsMessage OriginationNumber (__added__) + + # CloudFormation Resource Specification v28.0.0 ## New Resource Types diff --git a/packages/@aws-cdk/cfnspec/cfn.version b/packages/@aws-cdk/cfnspec/cfn.version index 0b4dfcf095f29..f1e4903d1d8e0 100644 --- a/packages/@aws-cdk/cfnspec/cfn.version +++ b/packages/@aws-cdk/cfnspec/cfn.version @@ -1 +1 @@ -28.0.0 +29.0.0 diff --git a/packages/@aws-cdk/cfnspec/spec-source/000_CloudFormationResourceSpecification.json b/packages/@aws-cdk/cfnspec/spec-source/000_CloudFormationResourceSpecification.json index eca5e7601bdb5..da0274f96bd19 100644 --- a/packages/@aws-cdk/cfnspec/spec-source/000_CloudFormationResourceSpecification.json +++ b/packages/@aws-cdk/cfnspec/spec-source/000_CloudFormationResourceSpecification.json @@ -11527,7 +11527,7 @@ "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codecommit-repository-code.html#cfn-codecommit-repository-code-branchname", "PrimitiveType": "String", "Required": false, - "UpdateType": "Immutable" + "UpdateType": "Mutable" }, "S3": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codecommit-repository-code.html#cfn-codecommit-repository-code-s3", @@ -15702,6 +15702,17 @@ } } }, + "AWS::DynamoDB::Table.KinesisStreamSpecification": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-kinesisstreamspecification.html", + "Properties": { + "StreamArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-kinesisstreamspecification.html#cfn-dynamodb-kinesisstreamspecification-streamarn", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + } + } + }, "AWS::DynamoDB::Table.LocalSecondaryIndex": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-lsi.html", "Properties": { @@ -23137,6 +23148,12 @@ "AWS::ElasticLoadBalancingV2::TargetGroup.Matcher": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancingv2-targetgroup-matcher.html", "Properties": { + "GrpcCode": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancingv2-targetgroup-matcher.html#cfn-elasticloadbalancingv2-targetgroup-matcher-grpccode", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, "HttpCode": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancingv2-targetgroup-matcher.html#cfn-elasticloadbalancingv2-targetgroup-matcher-httpcode", "PrimitiveType": "String", @@ -24122,6 +24139,13 @@ "Required": false, "UpdateType": "Immutable" }, + "Aliases": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-fsx-filesystem-windowsconfiguration.html#cfn-fsx-filesystem-windowsconfiguration-aliases", + "PrimitiveItemType": "String", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + }, "AutomaticBackupRetentionDays": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-fsx-filesystem-windowsconfiguration.html#cfn-fsx-filesystem-windowsconfiguration-automaticbackupretentiondays", "PrimitiveType": "Integer", @@ -24161,7 +24185,7 @@ "ThroughputCapacity": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-fsx-filesystem-windowsconfiguration.html#cfn-fsx-filesystem-windowsconfiguration-throughputcapacity", "PrimitiveType": "Integer", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "WeeklyMaintenanceStartTime": { @@ -28797,6 +28821,17 @@ } } }, + "AWS::IoTAnalytics::Dataset.DeltaTimeSessionWindowConfiguration": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotanalytics-dataset-deltatimesessionwindowconfiguration.html", + "Properties": { + "TimeoutInMinutes": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotanalytics-dataset-deltatimesessionwindowconfiguration.html#cfn-iotanalytics-dataset-deltatimesessionwindowconfiguration-timeoutinminutes", + "PrimitiveType": "Integer", + "Required": true, + "UpdateType": "Mutable" + } + } + }, "AWS::IoTAnalytics::Dataset.Filter": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotanalytics-dataset-filter.html", "Properties": { @@ -28842,6 +28877,34 @@ } } }, + "AWS::IoTAnalytics::Dataset.LateDataRule": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotanalytics-dataset-latedatarule.html", + "Properties": { + "RuleConfiguration": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotanalytics-dataset-latedatarule.html#cfn-iotanalytics-dataset-latedatarule-ruleconfiguration", + "Required": true, + "Type": "LateDataRuleConfiguration", + "UpdateType": "Mutable" + }, + "RuleName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotanalytics-dataset-latedatarule.html#cfn-iotanalytics-dataset-latedatarule-rulename", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + } + } + }, + "AWS::IoTAnalytics::Dataset.LateDataRuleConfiguration": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotanalytics-dataset-latedataruleconfiguration.html", + "Properties": { + "DeltaTimeSessionWindowConfiguration": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotanalytics-dataset-latedataruleconfiguration.html#cfn-iotanalytics-dataset-latedataruleconfiguration-deltatimesessionwindowconfiguration", + "Required": false, + "Type": "DeltaTimeSessionWindowConfiguration", + "UpdateType": "Mutable" + } + } + }, "AWS::IoTAnalytics::Dataset.OutputFileUriValue": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotanalytics-dataset-variable-outputfileurivalue.html", "Properties": { @@ -30579,136 +30642,125 @@ } } }, - "AWS::IoTWireless::ServiceProfile.LoRaWANGetServiceProfileInfo": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawangetserviceprofileinfo.html", + "AWS::IoTWireless::ServiceProfile.LoRaWANServiceProfile": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawanserviceprofile.html", "Properties": { "AddGwMetadata": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawangetserviceprofileinfo.html#cfn-iotwireless-serviceprofile-lorawangetserviceprofileinfo-addgwmetadata", + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawanserviceprofile.html#cfn-iotwireless-serviceprofile-lorawanserviceprofile-addgwmetadata", "PrimitiveType": "Boolean", "Required": false, "UpdateType": "Mutable" }, "ChannelMask": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawangetserviceprofileinfo.html#cfn-iotwireless-serviceprofile-lorawangetserviceprofileinfo-channelmask", + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawanserviceprofile.html#cfn-iotwireless-serviceprofile-lorawanserviceprofile-channelmask", "PrimitiveType": "String", "Required": false, "UpdateType": "Mutable" }, "DevStatusReqFreq": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawangetserviceprofileinfo.html#cfn-iotwireless-serviceprofile-lorawangetserviceprofileinfo-devstatusreqfreq", + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawanserviceprofile.html#cfn-iotwireless-serviceprofile-lorawanserviceprofile-devstatusreqfreq", "PrimitiveType": "Integer", "Required": false, "UpdateType": "Mutable" }, "DlBucketSize": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawangetserviceprofileinfo.html#cfn-iotwireless-serviceprofile-lorawangetserviceprofileinfo-dlbucketsize", + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawanserviceprofile.html#cfn-iotwireless-serviceprofile-lorawanserviceprofile-dlbucketsize", "PrimitiveType": "Integer", "Required": false, "UpdateType": "Mutable" }, "DlRate": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawangetserviceprofileinfo.html#cfn-iotwireless-serviceprofile-lorawangetserviceprofileinfo-dlrate", + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawanserviceprofile.html#cfn-iotwireless-serviceprofile-lorawanserviceprofile-dlrate", "PrimitiveType": "Integer", "Required": false, "UpdateType": "Mutable" }, "DlRatePolicy": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawangetserviceprofileinfo.html#cfn-iotwireless-serviceprofile-lorawangetserviceprofileinfo-dlratepolicy", + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawanserviceprofile.html#cfn-iotwireless-serviceprofile-lorawanserviceprofile-dlratepolicy", "PrimitiveType": "String", "Required": false, "UpdateType": "Mutable" }, "DrMax": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawangetserviceprofileinfo.html#cfn-iotwireless-serviceprofile-lorawangetserviceprofileinfo-drmax", + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawanserviceprofile.html#cfn-iotwireless-serviceprofile-lorawanserviceprofile-drmax", "PrimitiveType": "Integer", "Required": false, "UpdateType": "Mutable" }, "DrMin": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawangetserviceprofileinfo.html#cfn-iotwireless-serviceprofile-lorawangetserviceprofileinfo-drmin", + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawanserviceprofile.html#cfn-iotwireless-serviceprofile-lorawanserviceprofile-drmin", "PrimitiveType": "Integer", "Required": false, "UpdateType": "Mutable" }, "HrAllowed": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawangetserviceprofileinfo.html#cfn-iotwireless-serviceprofile-lorawangetserviceprofileinfo-hrallowed", + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawanserviceprofile.html#cfn-iotwireless-serviceprofile-lorawanserviceprofile-hrallowed", "PrimitiveType": "Boolean", "Required": false, "UpdateType": "Mutable" }, "MinGwDiversity": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawangetserviceprofileinfo.html#cfn-iotwireless-serviceprofile-lorawangetserviceprofileinfo-mingwdiversity", + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawanserviceprofile.html#cfn-iotwireless-serviceprofile-lorawanserviceprofile-mingwdiversity", "PrimitiveType": "Integer", "Required": false, "UpdateType": "Mutable" }, "NwkGeoLoc": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawangetserviceprofileinfo.html#cfn-iotwireless-serviceprofile-lorawangetserviceprofileinfo-nwkgeoloc", + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawanserviceprofile.html#cfn-iotwireless-serviceprofile-lorawanserviceprofile-nwkgeoloc", "PrimitiveType": "Boolean", "Required": false, "UpdateType": "Mutable" }, "PrAllowed": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawangetserviceprofileinfo.html#cfn-iotwireless-serviceprofile-lorawangetserviceprofileinfo-prallowed", + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawanserviceprofile.html#cfn-iotwireless-serviceprofile-lorawanserviceprofile-prallowed", "PrimitiveType": "Boolean", "Required": false, "UpdateType": "Mutable" }, "RaAllowed": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawangetserviceprofileinfo.html#cfn-iotwireless-serviceprofile-lorawangetserviceprofileinfo-raallowed", + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawanserviceprofile.html#cfn-iotwireless-serviceprofile-lorawanserviceprofile-raallowed", "PrimitiveType": "Boolean", "Required": false, "UpdateType": "Mutable" }, "ReportDevStatusBattery": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawangetserviceprofileinfo.html#cfn-iotwireless-serviceprofile-lorawangetserviceprofileinfo-reportdevstatusbattery", + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawanserviceprofile.html#cfn-iotwireless-serviceprofile-lorawanserviceprofile-reportdevstatusbattery", "PrimitiveType": "Boolean", "Required": false, "UpdateType": "Mutable" }, "ReportDevStatusMargin": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawangetserviceprofileinfo.html#cfn-iotwireless-serviceprofile-lorawangetserviceprofileinfo-reportdevstatusmargin", + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawanserviceprofile.html#cfn-iotwireless-serviceprofile-lorawanserviceprofile-reportdevstatusmargin", "PrimitiveType": "Boolean", "Required": false, "UpdateType": "Mutable" }, "TargetPer": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawangetserviceprofileinfo.html#cfn-iotwireless-serviceprofile-lorawangetserviceprofileinfo-targetper", + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawanserviceprofile.html#cfn-iotwireless-serviceprofile-lorawanserviceprofile-targetper", "PrimitiveType": "Integer", "Required": false, "UpdateType": "Mutable" }, "UlBucketSize": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawangetserviceprofileinfo.html#cfn-iotwireless-serviceprofile-lorawangetserviceprofileinfo-ulbucketsize", + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawanserviceprofile.html#cfn-iotwireless-serviceprofile-lorawanserviceprofile-ulbucketsize", "PrimitiveType": "Integer", "Required": false, "UpdateType": "Mutable" }, "UlRate": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawangetserviceprofileinfo.html#cfn-iotwireless-serviceprofile-lorawangetserviceprofileinfo-ulrate", + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawanserviceprofile.html#cfn-iotwireless-serviceprofile-lorawanserviceprofile-ulrate", "PrimitiveType": "Integer", "Required": false, "UpdateType": "Mutable" }, "UlRatePolicy": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawangetserviceprofileinfo.html#cfn-iotwireless-serviceprofile-lorawangetserviceprofileinfo-ulratepolicy", + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawanserviceprofile.html#cfn-iotwireless-serviceprofile-lorawanserviceprofile-ulratepolicy", "PrimitiveType": "String", "Required": false, "UpdateType": "Mutable" } } }, - "AWS::IoTWireless::ServiceProfile.LoRaWANServiceProfile": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawanserviceprofile.html", - "Properties": { - "AddGwMetadata": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-serviceprofile-lorawanserviceprofile.html#cfn-iotwireless-serviceprofile-lorawanserviceprofile-addgwmetadata", - "PrimitiveType": "Boolean", - "Required": false, - "UpdateType": "Mutable" - } - } - }, "AWS::IoTWireless::WirelessDevice.AbpV10x": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotwireless-wirelessdevice-abpv10x.html", "Properties": { @@ -42925,6 +42977,12 @@ "Required": false, "UpdateType": "Mutable" }, + "OriginationNumber": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pinpoint-campaign-campaignsmsmessage.html#cfn-pinpoint-campaign-campaignsmsmessage-originationnumber", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, "SenderId": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pinpoint-campaign-campaignsmsmessage.html#cfn-pinpoint-campaign-campaignsmsmessage-senderid", "PrimitiveType": "String", @@ -50896,6 +50954,9 @@ } } }, + "AWS::StepFunctions::StateMachine.Definition": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stepfunctions-statemachine-definition.html" + }, "AWS::StepFunctions::StateMachine.LogDestination": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stepfunctions-statemachine-logdestination.html", "Properties": { @@ -53317,7 +53378,7 @@ } } }, - "ResourceSpecificationVersion": "28.0.0", + "ResourceSpecificationVersion": "29.0.0", "ResourceTypes": { "AWS::ACMPCA::Certificate": { "Attributes": { @@ -59664,6 +59725,12 @@ "Type": "ProjectCache", "UpdateType": "Mutable" }, + "ConcurrentBuildLimit": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-concurrentbuildlimit", + "PrimitiveType": "Integer", + "Required": false, + "UpdateType": "Mutable" + }, "Description": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-description", "PrimitiveType": "String", @@ -62183,6 +62250,12 @@ "Required": false, "UpdateType": "Mutable" }, + "JobSample": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-databrew-job.html#cfn-databrew-job-jobsample", + "PrimitiveType": "Json", + "Required": false, + "UpdateType": "Mutable" + }, "LogSubscription": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-databrew-job.html#cfn-databrew-job-logsubscription", "PrimitiveType": "String", @@ -63358,6 +63431,12 @@ "Type": "List", "UpdateType": "Immutable" }, + "KinesisStreamSpecification": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-kinesisstreamspecification", + "Required": false, + "Type": "KinesisStreamSpecification", + "UpdateType": "Mutable" + }, "LocalSecondaryIndexes": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-lsi", "DuplicatesAllowed": true, @@ -65596,7 +65675,7 @@ "TransitGatewayId": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastdomain.html#cfn-ec2-transitgatewaymulticastdomain-transitgatewayid", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Immutable" } } @@ -65608,32 +65687,29 @@ }, "ResourceType": { "PrimitiveType": "String" + }, + "State": { + "PrimitiveType": "String" } }, "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastdomainassociation.html", "Properties": { - "State": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastdomainassociation.html#cfn-ec2-transitgatewaymulticastdomainassociation-state", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, "SubnetId": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastdomainassociation.html#cfn-ec2-transitgatewaymulticastdomainassociation-subnetid", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Immutable" }, "TransitGatewayAttachmentId": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastdomainassociation.html#cfn-ec2-transitgatewaymulticastdomainassociation-transitgatewayattachmentid", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Immutable" }, "TransitGatewayMulticastDomainId": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastdomainassociation.html#cfn-ec2-transitgatewaymulticastdomainassociation-transitgatewaymulticastdomainid", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Immutable" } } @@ -65660,6 +65736,9 @@ }, "SubnetId": { "PrimitiveType": "String" + }, + "TransitGatewayAttachmentId": { + "PrimitiveType": "String" } }, "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastgroupmember.html", @@ -65667,25 +65746,19 @@ "GroupIpAddress": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastgroupmember.html#cfn-ec2-transitgatewaymulticastgroupmember-groupipaddress", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Immutable" }, "NetworkInterfaceId": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastgroupmember.html#cfn-ec2-transitgatewaymulticastgroupmember-networkinterfaceid", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Immutable" }, - "TransitGatewayAttachmentId": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastgroupmember.html#cfn-ec2-transitgatewaymulticastgroupmember-transitgatewayattachmentid", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, "TransitGatewayMulticastDomainId": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastgroupmember.html#cfn-ec2-transitgatewaymulticastgroupmember-transitgatewaymulticastdomainid", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Immutable" } } @@ -65712,6 +65785,9 @@ }, "SubnetId": { "PrimitiveType": "String" + }, + "TransitGatewayAttachmentId": { + "PrimitiveType": "String" } }, "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastgroupsource.html", @@ -65719,25 +65795,19 @@ "GroupIpAddress": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastgroupsource.html#cfn-ec2-transitgatewaymulticastgroupsource-groupipaddress", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Immutable" }, "NetworkInterfaceId": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastgroupsource.html#cfn-ec2-transitgatewaymulticastgroupsource-networkinterfaceid", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Immutable" }, - "TransitGatewayAttachmentId": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastgroupsource.html#cfn-ec2-transitgatewaymulticastgroupsource-transitgatewayattachmentid", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, "TransitGatewayMulticastDomainId": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastgroupsource.html#cfn-ec2-transitgatewaymulticastgroupsource-transitgatewaymulticastdomainid", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Immutable" } } @@ -67768,6 +67838,12 @@ "Required": false, "UpdateType": "Mutable" }, + "CacheParameterGroupName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticache-globalreplicationgroup.html#cfn-elasticache-globalreplicationgroup-cacheparametergroupname", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, "EngineVersion": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticache-globalreplicationgroup.html#cfn-elasticache-globalreplicationgroup-engineversion", "PrimitiveType": "String", @@ -68825,6 +68901,12 @@ "Required": false, "UpdateType": "Immutable" }, + "ProtocolVersion": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-targetgroup.html#cfn-elasticloadbalancingv2-targetgroup-protocolversion", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + }, "Tags": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-targetgroup.html#cfn-elasticloadbalancingv2-targetgroup-tags", "DuplicatesAllowed": true, @@ -72272,6 +72354,12 @@ }, "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-imagebuilder-image.html", "Properties": { + "ContainerRecipeArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-imagebuilder-image.html#cfn-imagebuilder-image-containerrecipearn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, "DistributionConfigurationArn": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-imagebuilder-image.html#cfn-imagebuilder-image-distributionconfigurationarn", "PrimitiveType": "String", @@ -72287,7 +72375,7 @@ "ImageRecipeArn": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-imagebuilder-image.html#cfn-imagebuilder-image-imagerecipearn", "PrimitiveType": "String", - "Required": true, + "Required": false, "UpdateType": "Immutable" }, "ImageTestsConfiguration": { @@ -72319,6 +72407,12 @@ }, "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-imagebuilder-imagepipeline.html", "Properties": { + "ContainerRecipeArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-imagebuilder-imagepipeline.html#cfn-imagebuilder-imagepipeline-containerrecipearn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, "Description": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-imagebuilder-imagepipeline.html#cfn-imagebuilder-imagepipeline-description", "PrimitiveType": "String", @@ -72340,7 +72434,7 @@ "ImageRecipeArn": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-imagebuilder-imagepipeline.html#cfn-imagebuilder-imagepipeline-imagerecipearn", "PrimitiveType": "String", - "Required": true, + "Required": false, "UpdateType": "Mutable" }, "ImageTestsConfiguration": { @@ -73103,6 +73197,13 @@ "Required": false, "UpdateType": "Immutable" }, + "LateDataRules": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iotanalytics-dataset.html#cfn-iotanalytics-dataset-latedatarules", + "ItemType": "LateDataRule", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + }, "RetentionPeriod": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iotanalytics-dataset.html#cfn-iotanalytics-dataset-retentionperiod", "Required": false, @@ -73673,11 +73774,62 @@ "Arn": { "PrimitiveType": "String" }, + "ChannelMask": { + "PrimitiveType": "String" + }, + "DevStatusReqFreq": { + "PrimitiveType": "Integer" + }, + "DlBucketSize": { + "PrimitiveType": "Integer" + }, + "DlRate": { + "PrimitiveType": "Integer" + }, + "DlRatePolicy": { + "PrimitiveType": "String" + }, + "DrMax": { + "PrimitiveType": "Integer" + }, + "DrMin": { + "PrimitiveType": "Integer" + }, + "HrAllowed": { + "PrimitiveType": "Boolean" + }, "Id": { "PrimitiveType": "String" }, - "LoRaWANResponse": { - "Type": "LoRaWANGetServiceProfileInfo" + "MinGwDiversity": { + "PrimitiveType": "Integer" + }, + "NwkGeoLoc": { + "PrimitiveType": "Boolean" + }, + "PrAllowed": { + "PrimitiveType": "Boolean" + }, + "RaAllowed": { + "PrimitiveType": "Boolean" + }, + "ReportDevStatusBattery": { + "PrimitiveType": "Boolean" + }, + "ReportDevStatusMargin": { + "PrimitiveType": "Boolean" + }, + "TargetPer": { + "PrimitiveType": "Integer" + }, + "UlBucketSize": { + "PrimitiveType": "Integer" + }, + "UlRate": { + "PrimitiveType": "Integer" + }, + "UlRatePolicy": { + "PrimitiveType": "String" } }, "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iotwireless-serviceprofile.html", @@ -73712,9 +73864,6 @@ "Id": { "PrimitiveType": "String" }, - "ThingArn": { - "PrimitiveType": "String" - }, "ThingName": { "PrimitiveType": "String" } @@ -73759,6 +73908,12 @@ "Type": "List", "UpdateType": "Mutable" }, + "ThingArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iotwireless-wirelessdevice.html#cfn-iotwireless-wirelessdevice-thingarn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, "Type": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iotwireless-wirelessdevice.html#cfn-iotwireless-wirelessdevice-type", "PrimitiveType": "String", @@ -73775,7 +73930,7 @@ "Id": { "PrimitiveType": "String" }, - "ThingArn": { + "ThingName": { "PrimitiveType": "String" } }, @@ -73813,8 +73968,8 @@ "Type": "List", "UpdateType": "Mutable" }, - "ThingName": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iotwireless-wirelessgateway.html#cfn-iotwireless-wirelessgateway-thingname", + "ThingArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iotwireless-wirelessgateway.html#cfn-iotwireless-wirelessgateway-thingarn", "PrimitiveType": "String", "Required": false, "UpdateType": "Mutable" @@ -85120,6 +85275,12 @@ }, "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html", "Properties": { + "Definition": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html#cfn-stepfunctions-statemachine-definition", + "Required": false, + "Type": "Definition", + "UpdateType": "Mutable" + }, "DefinitionS3Location": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html#cfn-stepfunctions-statemachine-definitions3location", "Required": false, diff --git a/packages/@aws-cdk/cfnspec/spec-source/cfn-lint/StatefulResources/000.json b/packages/@aws-cdk/cfnspec/spec-source/cfn-lint/StatefulResources/000.json index 25c5e11c890ff..36a17855e22b7 100644 --- a/packages/@aws-cdk/cfnspec/spec-source/cfn-lint/StatefulResources/000.json +++ b/packages/@aws-cdk/cfnspec/spec-source/cfn-lint/StatefulResources/000.json @@ -27,4 +27,3 @@ } } } - From 6d6aa0c0bd1e870f72c3bea0c9b295c0a822800e Mon Sep 17 00:00:00 2001 From: Niranjan Jayakar Date: Wed, 24 Feb 2021 11:56:29 +0000 Subject: [PATCH 14/78] chore: update unit tests and assertions to support feature flag expiry in CDKv2 (#13217) In CDKv2, we will be expiring the feature flags - '@aws-cdk/aws-ecr-assets:dockerIgnoreSupport' and '@aws-cdk/aws-s3:grantWriteWithoutAcl'. Tests across the CDK code base explicitly or implicitly are verifying the behaviour of these modules that are affected by these feature flags. Update the unit tests appropriately so that they explicitly depend on one of the two behaviours, or test both. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../aws-codepipeline-actions/package.json | 1 + .../test/lambda/lambda-invoke-action.test.ts | 3 +- .../test/s3/s3-deploy-action.test.ts | 3 +- packages/@aws-cdk/aws-ec2/package.json | 1 + packages/@aws-cdk/aws-ec2/test/volume.test.ts | 3 +- .../aws-ecr-assets/test/image-asset.test.ts | 68 ++++++++++--------- .../test/integ.assets-docker.ts | 3 +- .../test/integ.nested-stacks-docker.ts | 3 +- packages/@aws-cdk/aws-ecs/package.json | 1 + .../aws-ecs/test/container-definition.test.ts | 3 +- .../test/ec2/ec2-task-definition.test.ts | 3 +- .../test/alb/load-balancer.test.ts | 16 +++-- .../test/nlb/load-balancer.test.ts | 16 +++-- packages/@aws-cdk/aws-glue/package.json | 1 + packages/@aws-cdk/aws-glue/test/table.test.ts | 16 +++-- packages/@aws-cdk/aws-kinesis/package.json | 1 + .../@aws-cdk/aws-kinesis/test/stream.test.ts | 3 +- packages/@aws-cdk/aws-kms/test/key.test.ts | 3 +- .../@aws-cdk/aws-lambda/test/code.test.ts | 8 ++- packages/@aws-cdk/aws-rds/package.json | 1 + .../@aws-cdk/aws-rds/test/cluster.test.ts | 3 +- .../@aws-cdk/aws-rds/test/instance.test.ts | 3 +- .../@aws-cdk/aws-s3-deployment/package.json | 1 + .../test/bucket-deployment.test.ts | 10 ++- packages/@aws-cdk/aws-s3/test/bucket.test.ts | 45 +++++------- 25 files changed, 124 insertions(+), 95 deletions(-) diff --git a/packages/@aws-cdk/aws-codepipeline-actions/package.json b/packages/@aws-cdk/aws-codepipeline-actions/package.json index 6087beb2745df..62a7868ece518 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/package.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/package.json @@ -68,6 +68,7 @@ "devDependencies": { "@aws-cdk/assert": "0.0.0", "@aws-cdk/aws-cloudtrail": "0.0.0", + "@aws-cdk/cx-api": "0.0.0", "@types/lodash": "^4.14.168", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/lambda/lambda-invoke-action.test.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/lambda/lambda-invoke-action.test.ts index e9674e4531695..64eecdb801b1c 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/lambda/lambda-invoke-action.test.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/lambda/lambda-invoke-action.test.ts @@ -4,12 +4,13 @@ import * as lambda from '@aws-cdk/aws-lambda'; import * as s3 from '@aws-cdk/aws-s3'; import * as sns from '@aws-cdk/aws-sns'; import { App, Aws, Lazy, SecretValue, Stack, Token } from '@aws-cdk/core'; +import * as cxapi from '@aws-cdk/cx-api'; import { testFutureBehavior } from 'cdk-build-tools/lib/feature-flag'; import * as cpactions from '../../lib'; /* eslint-disable quote-props */ -const s3GrantWriteCtx = { '@aws-cdk/aws-s3:grantWriteWithoutAcl': true }; +const s3GrantWriteCtx = { [cxapi.S3_GRANT_WRITE_WITHOUT_ACL]: true }; describe('', () => { describe('Lambda invoke Action', () => { diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/s3/s3-deploy-action.test.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/s3/s3-deploy-action.test.ts index c1e1c3c34c2c8..2e2b5cef98ace 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/s3/s3-deploy-action.test.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/s3/s3-deploy-action.test.ts @@ -2,6 +2,7 @@ import '@aws-cdk/assert/jest'; import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as s3 from '@aws-cdk/aws-s3'; import { App, Duration, SecretValue, Stack } from '@aws-cdk/core'; +import * as cxapi from '@aws-cdk/cx-api'; import { testFutureBehavior } from 'cdk-build-tools/lib/feature-flag'; import * as cpactions from '../../lib'; @@ -48,7 +49,7 @@ describe('', () => { }); - testFutureBehavior('grant the pipeline correct access to the target bucket', { '@aws-cdk/aws-s3:grantWriteWithoutAcl': true }, App, (app) => { + testFutureBehavior('grant the pipeline correct access to the target bucket', { [cxapi.S3_GRANT_WRITE_WITHOUT_ACL]: true }, App, (app) => { const stack = new Stack(app); minimalPipeline(stack); diff --git a/packages/@aws-cdk/aws-ec2/package.json b/packages/@aws-cdk/aws-ec2/package.json index 97f9edc2c3300..624577f547b62 100644 --- a/packages/@aws-cdk/aws-ec2/package.json +++ b/packages/@aws-cdk/aws-ec2/package.json @@ -72,6 +72,7 @@ "license": "Apache-2.0", "devDependencies": { "@aws-cdk/assert": "0.0.0", + "@aws-cdk/cx-api": "0.0.0", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "cfn2ts": "0.0.0", diff --git a/packages/@aws-cdk/aws-ec2/test/volume.test.ts b/packages/@aws-cdk/aws-ec2/test/volume.test.ts index edd0323bc84ef..c390821c3a37a 100644 --- a/packages/@aws-cdk/aws-ec2/test/volume.test.ts +++ b/packages/@aws-cdk/aws-ec2/test/volume.test.ts @@ -11,6 +11,7 @@ import { } from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; import * as cdk from '@aws-cdk/core'; +import * as cxapi from '@aws-cdk/cx-api'; import { testFutureBehavior, testLegacyBehavior } from 'cdk-build-tools/lib/feature-flag'; import { AmazonLinuxGeneration, @@ -575,7 +576,7 @@ describe('volume', () => { }); - testFutureBehavior('with future flag aws-kms:defaultKeyPolicies', { '@aws-cdk/aws-kms:defaultKeyPolicies': true }, cdk.App, (app) => { + testFutureBehavior('with future flag aws-kms:defaultKeyPolicies', { [cxapi.KMS_DEFAULT_KEY_POLICIES]: true }, cdk.App, (app) => { // GIVEN const stack = new cdk.Stack(app); const role = new Role(stack, 'Role', { assumedBy: new AccountRootPrincipal() }); diff --git a/packages/@aws-cdk/aws-ecr-assets/test/image-asset.test.ts b/packages/@aws-cdk/aws-ecr-assets/test/image-asset.test.ts index 83f27e16a3857..17fd37be2e234 100644 --- a/packages/@aws-cdk/aws-ecr-assets/test/image-asset.test.ts +++ b/packages/@aws-cdk/aws-ecr-assets/test/image-asset.test.ts @@ -5,27 +5,19 @@ import * as iam from '@aws-cdk/aws-iam'; import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import { App, DefaultStackSynthesizer, IgnoreMode, Lazy, LegacyStackSynthesizer, Stack, Stage } from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; +import { testFutureBehavior } from 'cdk-build-tools/lib/feature-flag'; import { DockerImageAsset } from '../lib'; /* eslint-disable quote-props */ const DEMO_IMAGE_ASSET_HASH = 'b2c69bfbfe983b634456574587443159b3b7258849856a118ad3d2772238f1a5'; - -let app: App; -let stack: Stack; -beforeEach(() => { - app = new App({ - context: { - '@aws-cdk/aws-ecr-assets:dockerIgnoreSupport': true, - }, - }); - stack = new Stack(app, 'Stack'); -}); +const flags = { [cxapi.DOCKER_IGNORE_SUPPORT]: true }; describe('image asset', () => { - test('test instantiating Asset Image', () => { + testFutureBehavior('test instantiating Asset Image', flags, App, (app) => { // WHEN + const stack = new Stack(app); new DockerImageAsset(stack, 'Image', { directory: path.join(__dirname, 'demo-image'), }); @@ -47,8 +39,9 @@ describe('image asset', () => { }); - test('with build args', () => { + testFutureBehavior('with build args', flags, App, (app) => { // WHEN + const stack = new Stack(app); new DockerImageAsset(stack, 'Image', { directory: path.join(__dirname, 'demo-image'), buildArgs: { @@ -62,8 +55,9 @@ describe('image asset', () => { }); - test('with target', () => { + testFutureBehavior('with target', flags, App, (app) => { // WHEN + const stack = new Stack(app); new DockerImageAsset(stack, 'Image', { directory: path.join(__dirname, 'demo-image'), buildArgs: { @@ -78,8 +72,9 @@ describe('image asset', () => { }); - test('with file', () => { + testFutureBehavior('with file', flags, App, (app) => { // GIVEN + const stack = new Stack(app); const directoryPath = path.join(__dirname, 'demo-image-custom-docker-file'); // WHEN new DockerImageAsset(stack, 'Image', { @@ -93,8 +88,9 @@ describe('image asset', () => { }); - test('asset.repository.grantPull can be used to grant a principal permissions to use the image', () => { + testFutureBehavior('asset.repository.grantPull can be used to grant a principal permissions to use the image', flags, App, (app) => { // GIVEN + const stack = new Stack(app); const user = new iam.User(stack, 'MyUser'); const asset = new DockerImageAsset(stack, 'Image', { directory: path.join(__dirname, 'demo-image'), @@ -155,6 +151,7 @@ describe('image asset', () => { }); test('fails if the directory does not exist', () => { + const stack = new Stack(); // THEN expect(() => { new DockerImageAsset(stack, 'MyAsset', { @@ -165,6 +162,7 @@ describe('image asset', () => { }); test('fails if the directory does not contain a Dockerfile', () => { + const stack = new Stack(); // THEN expect(() => { new DockerImageAsset(stack, 'Asset', { @@ -175,6 +173,7 @@ describe('image asset', () => { }); test('fails if the file does not exist', () => { + const stack = new Stack(); // THEN expect(() => { new DockerImageAsset(stack, 'Asset', { @@ -185,7 +184,8 @@ describe('image asset', () => { }); - test('docker directory is staged if asset staging is enabled', () => { + testFutureBehavior('docker directory is staged if asset staging is enabled', flags, App, (app) => { + const stack = new Stack(app); const image = new DockerImageAsset(stack, 'MyAsset', { directory: path.join(__dirname, 'demo-image'), }); @@ -197,15 +197,16 @@ describe('image asset', () => { }); - test('docker directory is staged without files specified in .dockerignore', () => { - testDockerDirectoryIsStagedWithoutFilesSpecifiedInDockerignore(); + testFutureBehavior('docker directory is staged without files specified in .dockerignore', flags, App, (app) => { + testDockerDirectoryIsStagedWithoutFilesSpecifiedInDockerignore(app); }); - test('docker directory is staged without files specified in .dockerignore with IgnoreMode.GLOB', () => { - testDockerDirectoryIsStagedWithoutFilesSpecifiedInDockerignore(IgnoreMode.GLOB); + testFutureBehavior('docker directory is staged without files specified in .dockerignore with IgnoreMode.GLOB', flags, App, (app) => { + testDockerDirectoryIsStagedWithoutFilesSpecifiedInDockerignore(app, IgnoreMode.GLOB); }); - test('docker directory is staged with whitelisted files specified in .dockerignore', () => { + testFutureBehavior('docker directory is staged with whitelisted files specified in .dockerignore', flags, App, (app) => { + const stack = new Stack(app); const image = new DockerImageAsset(stack, 'MyAsset', { directory: path.join(__dirname, 'whitelisted-image'), }); @@ -227,16 +228,17 @@ describe('image asset', () => { }); - test('docker directory is staged without files specified in exclude option', () => { - testDockerDirectoryIsStagedWithoutFilesSpecifiedInExcludeOption(); + testFutureBehavior('docker directory is staged without files specified in exclude option', flags, App, (app) => { + testDockerDirectoryIsStagedWithoutFilesSpecifiedInExcludeOption(app); }); - test('docker directory is staged without files specified in exclude option with IgnoreMode.GLOB', () => { - testDockerDirectoryIsStagedWithoutFilesSpecifiedInExcludeOption(IgnoreMode.GLOB); + testFutureBehavior('docker directory is staged without files specified in exclude option with IgnoreMode.GLOB', flags, App, (app) => { + testDockerDirectoryIsStagedWithoutFilesSpecifiedInExcludeOption(app, IgnoreMode.GLOB); }); test('fails if using tokens in build args keys or values', () => { // GIVEN + const stack = new Stack(); const token = Lazy.string({ produce: () => 'foo' }); const expected = /Cannot use tokens in keys or values of "buildArgs" since they are needed before deployment/; @@ -256,6 +258,7 @@ describe('image asset', () => { test('fails if using token as repositoryName', () => { // GIVEN + const stack = new Stack(); const token = Lazy.string({ produce: () => 'foo' }); // THEN @@ -267,8 +270,9 @@ describe('image asset', () => { }); - test('docker build options are included in the asset id', () => { + testFutureBehavior('docker build options are included in the asset id', flags, App, (app) => { // GIVEN + const stack = new Stack(app); const directory = path.join(__dirname, 'demo-image-custom-docker-file'); const asset1 = new DockerImageAsset(stack, 'Asset1', { directory }); @@ -290,7 +294,8 @@ describe('image asset', () => { }); }); -function testDockerDirectoryIsStagedWithoutFilesSpecifiedInDockerignore(ignoreMode?: IgnoreMode) { +function testDockerDirectoryIsStagedWithoutFilesSpecifiedInDockerignore(app: App, ignoreMode?: IgnoreMode) { + const stack = new Stack(app); const image = new DockerImageAsset(stack, 'MyAsset', { ignoreMode, directory: path.join(__dirname, 'dockerignore-image'), @@ -309,7 +314,8 @@ function testDockerDirectoryIsStagedWithoutFilesSpecifiedInDockerignore(ignoreMo } -function testDockerDirectoryIsStagedWithoutFilesSpecifiedInExcludeOption(ignoreMode?: IgnoreMode) { +function testDockerDirectoryIsStagedWithoutFilesSpecifiedInExcludeOption(app: App, ignoreMode?: IgnoreMode) { + const stack = new Stack(app); const image = new DockerImageAsset(stack, 'MyAsset', { directory: path.join(__dirname, 'dockerignore-image'), exclude: ['subdirectory'], @@ -328,7 +334,7 @@ function testDockerDirectoryIsStagedWithoutFilesSpecifiedInExcludeOption(ignoreM } -test('nested assemblies share assets: legacy synth edition', () => { +testFutureBehavior('nested assemblies share assets: legacy synth edition', flags, App, (app) => { // GIVEN const stack1 = new Stack(new Stage(app, 'Stage1'), 'Stack', { synthesizer: new LegacyStackSynthesizer() }); const stack2 = new Stack(new Stage(app, 'Stage2'), 'Stack', { synthesizer: new LegacyStackSynthesizer() }); @@ -354,7 +360,7 @@ test('nested assemblies share assets: legacy synth edition', () => { } }); -test('nested assemblies share assets: default synth edition', () => { +testFutureBehavior('nested assemblies share assets: default synth edition', flags, App, (app) => { // GIVEN const stack1 = new Stack(new Stage(app, 'Stage1'), 'Stack', { synthesizer: new DefaultStackSynthesizer() }); const stack2 = new Stack(new Stage(app, 'Stage2'), 'Stack', { synthesizer: new DefaultStackSynthesizer() }); diff --git a/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-docker.ts b/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-docker.ts index 21161938c786f..d6c4c2aac75b7 100644 --- a/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-docker.ts +++ b/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-docker.ts @@ -1,11 +1,12 @@ import * as path from 'path'; import * as iam from '@aws-cdk/aws-iam'; import * as cdk from '@aws-cdk/core'; +import * as cxapi from '@aws-cdk/cx-api'; import * as assets from '../lib'; const app = new cdk.App({ context: { - '@aws-cdk/aws-ecr-assets:dockerIgnoreSupport': true, + [cxapi.DOCKER_IGNORE_SUPPORT]: true, }, }); const stack = new cdk.Stack(app, 'integ-assets-docker'); diff --git a/packages/@aws-cdk/aws-ecr-assets/test/integ.nested-stacks-docker.ts b/packages/@aws-cdk/aws-ecr-assets/test/integ.nested-stacks-docker.ts index 9a6fe48b172e0..394fedc07ddf6 100644 --- a/packages/@aws-cdk/aws-ecr-assets/test/integ.nested-stacks-docker.ts +++ b/packages/@aws-cdk/aws-ecr-assets/test/integ.nested-stacks-docker.ts @@ -1,6 +1,7 @@ import * as path from 'path'; import * as iam from '@aws-cdk/aws-iam'; import { App, CfnOutput, NestedStack, NestedStackProps, Stack, StackProps } from '@aws-cdk/core'; +import * as cxapi from '@aws-cdk/cx-api'; import { Construct } from 'constructs'; import * as ecr_assets from '../lib'; @@ -29,7 +30,7 @@ class TheParentStack extends Stack { const app = new App({ context: { - '@aws-cdk/aws-ecr-assets:dockerIgnoreSupport': true, + [cxapi.DOCKER_IGNORE_SUPPORT]: true, }, }); new TheParentStack(app, 'nested-stacks-docker'); diff --git a/packages/@aws-cdk/aws-ecs/package.json b/packages/@aws-cdk/aws-ecs/package.json index f7408e518f2fe..ec829127f9e84 100644 --- a/packages/@aws-cdk/aws-ecs/package.json +++ b/packages/@aws-cdk/aws-ecs/package.json @@ -73,6 +73,7 @@ "devDependencies": { "@aws-cdk/assert": "0.0.0", "@aws-cdk/aws-s3-deployment": "0.0.0", + "@aws-cdk/cx-api": "0.0.0", "@types/nodeunit": "^0.0.31", "@types/proxyquire": "^1.3.28", "cdk-build-tools": "0.0.0", diff --git a/packages/@aws-cdk/aws-ecs/test/container-definition.test.ts b/packages/@aws-cdk/aws-ecs/test/container-definition.test.ts index c167720e362cf..0e42a0aecc381 100644 --- a/packages/@aws-cdk/aws-ecs/test/container-definition.test.ts +++ b/packages/@aws-cdk/aws-ecs/test/container-definition.test.ts @@ -6,6 +6,7 @@ import * as s3 from '@aws-cdk/aws-s3'; import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; import * as ssm from '@aws-cdk/aws-ssm'; import * as cdk from '@aws-cdk/core'; +import * as cxapi from '@aws-cdk/cx-api'; import { testFutureBehavior } from 'cdk-build-tools/lib/feature-flag'; import * as ecs from '../lib'; @@ -1643,7 +1644,7 @@ describe('container definition', () => { }); }); - testFutureBehavior('can use a DockerImageAsset directly for a container image', { '@aws-cdk/aws-ecr-assets:dockerIgnoreSupport': true }, cdk.App, (app) => { + testFutureBehavior('can use a DockerImageAsset directly for a container image', { [cxapi.DOCKER_IGNORE_SUPPORT]: true }, cdk.App, (app) => { // GIVEN const stack = new cdk.Stack(app, 'Stack'); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); diff --git a/packages/@aws-cdk/aws-ecs/test/ec2/ec2-task-definition.test.ts b/packages/@aws-cdk/aws-ecs/test/ec2/ec2-task-definition.test.ts index bea2e3c0733e5..60c39d2103daf 100644 --- a/packages/@aws-cdk/aws-ecs/test/ec2/ec2-task-definition.test.ts +++ b/packages/@aws-cdk/aws-ecs/test/ec2/ec2-task-definition.test.ts @@ -6,6 +6,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; import * as ssm from '@aws-cdk/aws-ssm'; import * as cdk from '@aws-cdk/core'; +import * as cxapi from '@aws-cdk/cx-api'; import { testFutureBehavior } from 'cdk-build-tools/lib/feature-flag'; import * as ecs from '../../lib'; @@ -585,7 +586,7 @@ describe('ec2 task definition', () => { }); - testFutureBehavior('correctly sets containers from asset using default props', { '@aws-cdk/aws-ecr-assets:dockerIgnoreSupport': true }, cdk.App, (app) => { + testFutureBehavior('correctly sets containers from asset using default props', { [cxapi.DOCKER_IGNORE_SUPPORT]: true }, cdk.App, (app) => { // GIVEN const stack = new cdk.Stack(app, 'Stack'); diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/load-balancer.test.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/load-balancer.test.ts index 38b328ec153a4..f017a4a67f3fa 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/load-balancer.test.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/load-balancer.test.ts @@ -4,8 +4,12 @@ import { Metric } from '@aws-cdk/aws-cloudwatch'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as s3 from '@aws-cdk/aws-s3'; import * as cdk from '@aws-cdk/core'; +import * as cxapi from '@aws-cdk/cx-api'; +import { testFutureBehavior } from 'cdk-build-tools/lib/feature-flag'; import * as elbv2 from '../../lib'; +const s3GrantWriteCtx = { [cxapi.S3_GRANT_WRITE_WITHOUT_ACL]: true }; + describe('tests', () => { test('Trivial construction: internet facing', () => { // GIVEN @@ -122,9 +126,9 @@ describe('tests', () => { }); }); - test('Access logging', () => { + testFutureBehavior('Access logging', s3GrantWriteCtx, cdk.App, (app) => { // GIVEN - const stack = new cdk.Stack(undefined, undefined, { env: { region: 'us-east-1' } }); + const stack = new cdk.Stack(app, undefined, { env: { region: 'us-east-1' } }); const vpc = new ec2.Vpc(stack, 'Stack'); const bucket = new s3.Bucket(stack, 'AccessLoggingBucket'); const lb = new elbv2.ApplicationLoadBalancer(stack, 'LB', { vpc }); @@ -154,7 +158,7 @@ describe('tests', () => { Version: '2012-10-17', Statement: [ { - Action: ['s3:PutObject*', 's3:Abort*'], + Action: ['s3:PutObject', 's3:Abort*'], Effect: 'Allow', Principal: { AWS: { 'Fn::Join': ['', ['arn:', { Ref: 'AWS::Partition' }, ':iam::127311923021:root']] } }, Resource: { @@ -172,9 +176,9 @@ describe('tests', () => { }, ResourcePart.CompleteDefinition); }); - test('access logging with prefix', () => { + testFutureBehavior('access logging with prefix', s3GrantWriteCtx, cdk.App, (app) => { // GIVEN - const stack = new cdk.Stack(undefined, undefined, { env: { region: 'us-east-1' } }); + const stack = new cdk.Stack(app, undefined, { env: { region: 'us-east-1' } }); const vpc = new ec2.Vpc(stack, 'Stack'); const bucket = new s3.Bucket(stack, 'AccessLoggingBucket'); const lb = new elbv2.ApplicationLoadBalancer(stack, 'LB', { vpc }); @@ -207,7 +211,7 @@ describe('tests', () => { Version: '2012-10-17', Statement: [ { - Action: ['s3:PutObject*', 's3:Abort*'], + Action: ['s3:PutObject', 's3:Abort*'], Effect: 'Allow', Principal: { AWS: { 'Fn::Join': ['', ['arn:', { Ref: 'AWS::Partition' }, ':iam::127311923021:root']] } }, Resource: { diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/nlb/load-balancer.test.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/nlb/load-balancer.test.ts index 88a3999ec0a6f..546b88ab7d541 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/nlb/load-balancer.test.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/nlb/load-balancer.test.ts @@ -3,8 +3,12 @@ import '@aws-cdk/assert/jest'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as s3 from '@aws-cdk/aws-s3'; import * as cdk from '@aws-cdk/core'; +import * as cxapi from '@aws-cdk/cx-api'; +import { testFutureBehavior } from 'cdk-build-tools/lib/feature-flag'; import * as elbv2 from '../../lib'; +const s3GrantWriteCtx = { [cxapi.S3_GRANT_WRITE_WITHOUT_ACL]: true }; + describe('tests', () => { test('Trivial construction: internet facing', () => { // GIVEN @@ -69,9 +73,9 @@ describe('tests', () => { }); }); - test('Access logging', () => { + testFutureBehavior('Access logging', s3GrantWriteCtx, cdk.App, (app) => { // GIVEN - const stack = new cdk.Stack(undefined, undefined, { env: { region: 'us-east-1' } }); + const stack = new cdk.Stack(app, undefined, { env: { region: 'us-east-1' } }); const vpc = new ec2.Vpc(stack, 'Stack'); const bucket = new s3.Bucket(stack, 'AccessLoggingBucket'); const lb = new elbv2.NetworkLoadBalancer(stack, 'LB', { vpc }); @@ -101,7 +105,7 @@ describe('tests', () => { Version: '2012-10-17', Statement: [ { - Action: ['s3:PutObject*', 's3:Abort*'], + Action: ['s3:PutObject', 's3:Abort*'], Effect: 'Allow', Principal: { AWS: { 'Fn::Join': ['', ['arn:', { Ref: 'AWS::Partition' }, ':iam::127311923021:root']] } }, Resource: { @@ -137,9 +141,9 @@ describe('tests', () => { }, ResourcePart.CompleteDefinition); }); - test('access logging with prefix', () => { + testFutureBehavior('access logging with prefix', s3GrantWriteCtx, cdk.App, (app) => { // GIVEN - const stack = new cdk.Stack(undefined, undefined, { env: { region: 'us-east-1' } }); + const stack = new cdk.Stack(app, undefined, { env: { region: 'us-east-1' } }); const vpc = new ec2.Vpc(stack, 'Stack'); const bucket = new s3.Bucket(stack, 'AccessLoggingBucket'); const lb = new elbv2.NetworkLoadBalancer(stack, 'LB', { vpc }); @@ -172,7 +176,7 @@ describe('tests', () => { Version: '2012-10-17', Statement: [ { - Action: ['s3:PutObject*', 's3:Abort*'], + Action: ['s3:PutObject', 's3:Abort*'], Effect: 'Allow', Principal: { AWS: { 'Fn::Join': ['', ['arn:', { Ref: 'AWS::Partition' }, ':iam::127311923021:root']] } }, Resource: { diff --git a/packages/@aws-cdk/aws-glue/package.json b/packages/@aws-cdk/aws-glue/package.json index 0eaa0ba607b63..3f6a8fa63ceba 100644 --- a/packages/@aws-cdk/aws-glue/package.json +++ b/packages/@aws-cdk/aws-glue/package.json @@ -72,6 +72,7 @@ "license": "Apache-2.0", "devDependencies": { "@aws-cdk/assert": "0.0.0", + "@aws-cdk/cx-api": "0.0.0", "@types/nodeunit": "^0.0.31", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", diff --git a/packages/@aws-cdk/aws-glue/test/table.test.ts b/packages/@aws-cdk/aws-glue/test/table.test.ts index 0969088346491..e31c879208aa2 100644 --- a/packages/@aws-cdk/aws-glue/test/table.test.ts +++ b/packages/@aws-cdk/aws-glue/test/table.test.ts @@ -5,8 +5,12 @@ import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; import * as s3 from '@aws-cdk/aws-s3'; import * as cdk from '@aws-cdk/core'; +import * as cxapi from '@aws-cdk/cx-api'; +import { testFutureBehavior } from 'cdk-build-tools/lib/feature-flag'; import * as glue from '../lib'; +const s3GrantWriteCtx = { [cxapi.S3_GRANT_WRITE_WITHOUT_ACL]: true }; + test('unpartitioned JSON table', () => { const app = new cdk.App(); const dbStack = new cdk.Stack(app, 'db'); @@ -1048,8 +1052,8 @@ test('grants: read only', () => { }); -test('grants: write only', () => { - const stack = new cdk.Stack(); +testFutureBehavior('grants: write only', s3GrantWriteCtx, cdk.App, (app) => { + const stack = new cdk.Stack(app); const user = new iam.User(stack, 'User'); const database = new glue.Database(stack, 'Database', { databaseName: 'database', @@ -1111,7 +1115,7 @@ test('grants: write only', () => { { Action: [ 's3:DeleteObject*', - 's3:PutObject*', + 's3:PutObject', 's3:Abort*', ], Effect: 'Allow', @@ -1151,8 +1155,8 @@ test('grants: write only', () => { }); -test('grants: read and write', () => { - const stack = new cdk.Stack(); +testFutureBehavior('grants: read and write', s3GrantWriteCtx, cdk.App, (app) => { + const stack = new cdk.Stack(app); const user = new iam.User(stack, 'User'); const database = new glue.Database(stack, 'Database', { databaseName: 'database', @@ -1225,7 +1229,7 @@ test('grants: read and write', () => { 's3:GetBucket*', 's3:List*', 's3:DeleteObject*', - 's3:PutObject*', + 's3:PutObject', 's3:Abort*', ], Effect: 'Allow', diff --git a/packages/@aws-cdk/aws-kinesis/package.json b/packages/@aws-cdk/aws-kinesis/package.json index e8153880812db..3c7fd281d363b 100644 --- a/packages/@aws-cdk/aws-kinesis/package.json +++ b/packages/@aws-cdk/aws-kinesis/package.json @@ -72,6 +72,7 @@ "license": "Apache-2.0", "devDependencies": { "@aws-cdk/assert": "0.0.0", + "@aws-cdk/cx-api": "0.0.0", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "cfn2ts": "0.0.0", diff --git a/packages/@aws-cdk/aws-kinesis/test/stream.test.ts b/packages/@aws-cdk/aws-kinesis/test/stream.test.ts index 9c3cdc1eb7125..b295ac73c75b5 100644 --- a/packages/@aws-cdk/aws-kinesis/test/stream.test.ts +++ b/packages/@aws-cdk/aws-kinesis/test/stream.test.ts @@ -3,6 +3,7 @@ import { arrayWith } from '@aws-cdk/assert'; import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; import { App, Duration, Stack, CfnParameter } from '@aws-cdk/core'; +import * as cxapi from '@aws-cdk/cx-api'; import { testFutureBehavior, testLegacyBehavior } from 'cdk-build-tools/lib/feature-flag'; import { Stream, StreamEncryption } from '../lib'; @@ -1255,7 +1256,7 @@ describe('Kinesis data streams', () => { }).toThrow(/'stack.' depends on 'stack.'/); }); - testFutureBehavior('cross stack permissions - with encryption', { '@aws-cdk/aws-kms:defaultKeyPolicies': true }, App, (app) => { + testFutureBehavior('cross stack permissions - with encryption', { [cxapi.KMS_DEFAULT_KEY_POLICIES]: true }, App, (app) => { const stackA = new Stack(app, 'stackA'); const streamFromStackA = new Stream(stackA, 'MyStream', { encryption: StreamEncryption.KMS, diff --git a/packages/@aws-cdk/aws-kms/test/key.test.ts b/packages/@aws-cdk/aws-kms/test/key.test.ts index b2d37496d00ec..38ae0e1e61059 100644 --- a/packages/@aws-cdk/aws-kms/test/key.test.ts +++ b/packages/@aws-cdk/aws-kms/test/key.test.ts @@ -2,6 +2,7 @@ import { arrayWith, ResourcePart } from '@aws-cdk/assert'; import '@aws-cdk/assert/jest'; import * as iam from '@aws-cdk/aws-iam'; import * as cdk from '@aws-cdk/core'; +import * as cxapi from '@aws-cdk/cx-api'; import { testFutureBehavior, testLegacyBehavior } from 'cdk-build-tools/lib/feature-flag'; import * as kms from '../lib'; @@ -40,7 +41,7 @@ const LEGACY_ADMIN_ACTIONS: string[] = [ 'kms:UntagResource', ]; -const flags = { '@aws-cdk/aws-kms:defaultKeyPolicies': true }; +const flags = { [cxapi.KMS_DEFAULT_KEY_POLICIES]: true }; testFutureBehavior('default key', flags, cdk.App, (app) => { const stack = new cdk.Stack(app); diff --git a/packages/@aws-cdk/aws-lambda/test/code.test.ts b/packages/@aws-cdk/aws-lambda/test/code.test.ts index 9b99c095c2467..abdbc0e080daa 100644 --- a/packages/@aws-cdk/aws-lambda/test/code.test.ts +++ b/packages/@aws-cdk/aws-lambda/test/code.test.ts @@ -4,6 +4,7 @@ import { ABSENT, ResourcePart } from '@aws-cdk/assert'; import * as ecr from '@aws-cdk/aws-ecr'; import * as cdk from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; +import { testFutureBehavior } from 'cdk-build-tools/lib/feature-flag'; import * as lambda from '../lib'; /* eslint-disable dot-notation */ @@ -275,9 +276,10 @@ describe('code', () => { }); describe('lambda.Code.fromImageAsset', () => { - test('repository uri is correctly identified', () => { + const flags = { [cxapi.DOCKER_IGNORE_SUPPORT]: true }; + testFutureBehavior('repository uri is correctly identified', flags, cdk.App, (app) => { // given - const stack = new cdk.Stack(); + const stack = new cdk.Stack(app); // when new lambda.Function(stack, 'Fn', { @@ -296,7 +298,7 @@ describe('code', () => { { Ref: 'AWS::Region' }, '.', { Ref: 'AWS::URLSuffix' }, - '/aws-cdk/assets:0874c7dfd254e95f5181cc7fa643e4abf010f68e5717e373b6e635b49a115b2b', + '/aws-cdk/assets:e8a944aeb0a08ba4811503d9c138e514b112dadca84daa5b4608e4a0fb80a0c9', ]], }, }, diff --git a/packages/@aws-cdk/aws-rds/package.json b/packages/@aws-cdk/aws-rds/package.json index 01ce0a8ca4a12..685b5c399b240 100644 --- a/packages/@aws-cdk/aws-rds/package.json +++ b/packages/@aws-cdk/aws-rds/package.json @@ -74,6 +74,7 @@ "@aws-cdk/assert": "0.0.0", "@aws-cdk/aws-events-targets": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/cx-api": "0.0.0", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "cfn2ts": "0.0.0", diff --git a/packages/@aws-cdk/aws-rds/test/cluster.test.ts b/packages/@aws-cdk/aws-rds/test/cluster.test.ts index 11f18100e9fbe..10b5a9f8c37e3 100644 --- a/packages/@aws-cdk/aws-rds/test/cluster.test.ts +++ b/packages/@aws-cdk/aws-rds/test/cluster.test.ts @@ -6,6 +6,7 @@ import * as kms from '@aws-cdk/aws-kms'; import * as logs from '@aws-cdk/aws-logs'; import * as s3 from '@aws-cdk/aws-s3'; import * as cdk from '@aws-cdk/core'; +import * as cxapi from '@aws-cdk/cx-api'; import { testFutureBehavior } from 'cdk-build-tools/lib/feature-flag'; import { AuroraEngineVersion, AuroraMysqlEngineVersion, AuroraPostgresEngineVersion, CfnDBCluster, Credentials, DatabaseCluster, @@ -1073,7 +1074,7 @@ describe('cluster', () => { }); - testFutureBehavior('create a cluster with s3 export buckets', { '@aws-cdk/aws-s3:grantWriteWithoutAcl': true }, cdk.App, (app) => { + testFutureBehavior('create a cluster with s3 export buckets', { [cxapi.S3_GRANT_WRITE_WITHOUT_ACL]: true }, cdk.App, (app) => { // GIVEN const stack = testStack(app); const vpc = new ec2.Vpc(stack, 'VPC'); diff --git a/packages/@aws-cdk/aws-rds/test/instance.test.ts b/packages/@aws-cdk/aws-rds/test/instance.test.ts index 67fc9fd3905ff..ede79cd19ed75 100644 --- a/packages/@aws-cdk/aws-rds/test/instance.test.ts +++ b/packages/@aws-cdk/aws-rds/test/instance.test.ts @@ -8,6 +8,7 @@ import * as lambda from '@aws-cdk/aws-lambda'; import * as logs from '@aws-cdk/aws-logs'; import * as s3 from '@aws-cdk/aws-s3'; import * as cdk from '@aws-cdk/core'; +import * as cxapi from '@aws-cdk/cx-api'; import { testFutureBehavior } from 'cdk-build-tools/lib/feature-flag'; import * as rds from '../lib'; @@ -1038,7 +1039,7 @@ describe('instance', () => { }); describe('S3 Import/Export', () => { - testFutureBehavior('instance with s3 import and export buckets', { '@aws-cdk/aws-s3:grantWriteWithoutAcl': true }, cdk.App, (app) => { + testFutureBehavior('instance with s3 import and export buckets', { [cxapi.S3_GRANT_WRITE_WITHOUT_ACL]: true }, cdk.App, (app) => { stack = new cdk.Stack(app); vpc = new ec2.Vpc(stack, 'VPC'); new rds.DatabaseInstance(stack, 'DB', { diff --git a/packages/@aws-cdk/aws-s3-deployment/package.json b/packages/@aws-cdk/aws-s3-deployment/package.json index fadd40d30149a..859b206963e0e 100644 --- a/packages/@aws-cdk/aws-s3-deployment/package.json +++ b/packages/@aws-cdk/aws-s3-deployment/package.json @@ -78,6 +78,7 @@ "license": "Apache-2.0", "devDependencies": { "@aws-cdk/assert": "0.0.0", + "@aws-cdk/cx-api": "0.0.0", "@types/jest": "^26.0.20", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", diff --git a/packages/@aws-cdk/aws-s3-deployment/test/bucket-deployment.test.ts b/packages/@aws-cdk/aws-s3-deployment/test/bucket-deployment.test.ts index 5cb7cdc1e7cdf..9639af37a2aa8 100644 --- a/packages/@aws-cdk/aws-s3-deployment/test/bucket-deployment.test.ts +++ b/packages/@aws-cdk/aws-s3-deployment/test/bucket-deployment.test.ts @@ -5,10 +5,14 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import * as s3 from '@aws-cdk/aws-s3'; import * as cdk from '@aws-cdk/core'; +import * as cxapi from '@aws-cdk/cx-api'; +import { testFutureBehavior } from 'cdk-build-tools/lib/feature-flag'; import * as s3deploy from '../lib'; /* eslint-disable max-len */ +const s3GrantWriteCtx = { [cxapi.S3_GRANT_WRITE_WITHOUT_ACL]: true }; + test('deploy from local directory asset', () => { // GIVEN const stack = new cdk.Stack(); @@ -449,9 +453,9 @@ test('fails if distribution paths provided but not distribution ID', () => { }); -test('lambda execution role gets permissions to read from the source bucket and read/write in destination', () => { +testFutureBehavior('lambda execution role gets permissions to read from the source bucket and read/write in destination', s3GrantWriteCtx, cdk.App, (app) => { // GIVEN - const stack = new cdk.Stack(); + const stack = new cdk.Stack(app); const source = new s3.Bucket(stack, 'Source'); const bucket = new s3.Bucket(stack, 'Dest'); @@ -501,7 +505,7 @@ test('lambda execution role gets permissions to read from the source bucket and 's3:GetBucket*', 's3:List*', 's3:DeleteObject*', - 's3:PutObject*', + 's3:PutObject', 's3:Abort*', ], Effect: 'Allow', diff --git a/packages/@aws-cdk/aws-s3/test/bucket.test.ts b/packages/@aws-cdk/aws-s3/test/bucket.test.ts index 5a5f89a3eba94..936c807e8da4a 100644 --- a/packages/@aws-cdk/aws-s3/test/bucket.test.ts +++ b/packages/@aws-cdk/aws-s3/test/bucket.test.ts @@ -5,12 +5,14 @@ import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; import * as cdk from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; -import { testLegacyBehavior } from 'cdk-build-tools/lib/feature-flag'; +import { testFutureBehavior, testLegacyBehavior } from 'cdk-build-tools/lib/feature-flag'; import * as s3 from '../lib'; // to make it easy to copy & paste from output: /* eslint-disable quote-props */ +const s3GrantWriteCtx = { [cxapi.S3_GRANT_WRITE_WITHOUT_ACL]: true }; + describe('bucket', () => { test('default bucket', () => { const stack = new cdk.Stack(); @@ -814,8 +816,8 @@ describe('bucket', () => { }); describe('grantReadWrite', () => { - test('can be used to grant reciprocal permissions to an identity', () => { - const stack = new cdk.Stack(); + testFutureBehavior('can be used to grant reciprocal permissions to an identity', s3GrantWriteCtx, cdk.App, (app) => { + const stack = new cdk.Stack(app); const bucket = new s3.Bucket(stack, 'MyBucket'); const user = new iam.User(stack, 'MyUser'); bucket.grantReadWrite(user); @@ -841,7 +843,7 @@ describe('bucket', () => { 's3:GetBucket*', 's3:List*', 's3:DeleteObject*', - 's3:PutObject*', + 's3:PutObject', 's3:Abort*', ], 'Effect': 'Allow', @@ -1104,12 +1106,7 @@ describe('bucket', () => { }); }); - test('does not grant PutObjectAcl when the S3_GRANT_WRITE_WITHOUT_ACL feature is enabled', () => { - const app = new cdk.App({ - context: { - [cxapi.S3_GRANT_WRITE_WITHOUT_ACL]: true, - }, - }); + testFutureBehavior('does not grant PutObjectAcl when the S3_GRANT_WRITE_WITHOUT_ACL feature is enabled', s3GrantWriteCtx, cdk.App, (app) => { const stack = new cdk.Stack(app, 'Stack'); const bucket = new s3.Bucket(stack, 'MyBucket'); const user = new iam.User(stack, 'MyUser'); @@ -1147,8 +1144,8 @@ describe('bucket', () => { }); describe('grantWrite', () => { - test('with KMS key has appropriate permissions for multipart uploads', () => { - const stack = new cdk.Stack(); + testFutureBehavior('with KMS key has appropriate permissions for multipart uploads', s3GrantWriteCtx, cdk.App, (app) => { + const stack = new cdk.Stack(app); const bucket = new s3.Bucket(stack, 'MyBucket', { encryption: s3.BucketEncryption.KMS }); const user = new iam.User(stack, 'MyUser'); bucket.grantWrite(user); @@ -1159,7 +1156,7 @@ describe('bucket', () => { { 'Action': [ 's3:DeleteObject*', - 's3:PutObject*', + 's3:PutObject', 's3:Abort*', ], 'Effect': 'Allow', @@ -1215,12 +1212,7 @@ describe('bucket', () => { }); - test('does not grant PutObjectAcl when the S3_GRANT_WRITE_WITHOUT_ACL feature is enabled', () => { - const app = new cdk.App({ - context: { - [cxapi.S3_GRANT_WRITE_WITHOUT_ACL]: true, - }, - }); + testFutureBehavior('does not grant PutObjectAcl when the S3_GRANT_WRITE_WITHOUT_ACL feature is enabled', s3GrantWriteCtx, cdk.App, (app) => { const stack = new cdk.Stack(app, 'Stack'); const bucket = new s3.Bucket(stack, 'MyBucket'); const user = new iam.User(stack, 'MyUser'); @@ -1255,12 +1247,7 @@ describe('bucket', () => { }); describe('grantPut', () => { - test('does not grant PutObjectAcl when the S3_GRANT_WRITE_WITHOUT_ACL feature is enabled', () => { - const app = new cdk.App({ - context: { - [cxapi.S3_GRANT_WRITE_WITHOUT_ACL]: true, - }, - }); + testFutureBehavior('does not grant PutObjectAcl when the S3_GRANT_WRITE_WITHOUT_ACL feature is enabled', s3GrantWriteCtx, cdk.App, (app) => { const stack = new cdk.Stack(app, 'Stack'); const bucket = new s3.Bucket(stack, 'MyBucket'); const user = new iam.User(stack, 'MyUser'); @@ -1290,8 +1277,8 @@ describe('bucket', () => { }); }); - test('more grants', () => { - const stack = new cdk.Stack(); + testFutureBehavior('more grants', s3GrantWriteCtx, cdk.App, (app) => { + const stack = new cdk.Stack(app); const bucket = new s3.Bucket(stack, 'MyBucket', { encryption: s3.BucketEncryption.KMS }); const putter = new iam.User(stack, 'Putter'); const writer = new iam.User(stack, 'Writer'); @@ -1304,8 +1291,8 @@ describe('bucket', () => { const resources = SynthUtils.synthesize(stack).template.Resources; const actions = (id: string) => resources[id].Properties.PolicyDocument.Statement[0].Action; - expect(actions('WriterDefaultPolicyDC585BCE')).toEqual(['s3:DeleteObject*', 's3:PutObject*', 's3:Abort*']); - expect(actions('PutterDefaultPolicyAB138DD3')).toEqual(['s3:PutObject*', 's3:Abort*']); + expect(actions('WriterDefaultPolicyDC585BCE')).toEqual(['s3:DeleteObject*', 's3:PutObject', 's3:Abort*']); + expect(actions('PutterDefaultPolicyAB138DD3')).toEqual(['s3:PutObject', 's3:Abort*']); expect(actions('DeleterDefaultPolicyCD33B8A0')).toEqual('s3:DeleteObject*'); }); From d9426996c07ff909993594ed91cfcf2b5761414b Mon Sep 17 00:00:00 2001 From: Otavio Macedo Date: Wed, 24 Feb 2021 12:31:32 +0000 Subject: [PATCH 15/78] feat(apigateway): integrate with aws services in a different region (#13251) This allows the user to choose a different region for the integrated service. By default, the region is the same as the stack's. Fixes #7009 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-apigateway/README.md | 11 +++++++ .../aws-apigateway/lib/integrations/aws.ts | 8 +++++ .../aws-apigateway/test/method.test.ts | 29 +++++++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/packages/@aws-cdk/aws-apigateway/README.md b/packages/@aws-cdk/aws-apigateway/README.md index 759b013272bcf..926f45daf1436 100644 --- a/packages/@aws-cdk/aws-apigateway/README.md +++ b/packages/@aws-cdk/aws-apigateway/README.md @@ -157,6 +157,17 @@ book.addMethod('GET', getBookIntegration, { }); ``` +It is possible to also integrate with AWS services in a different region. The following code integrates with Amazon SQS in the +`eu-west-1` region. + +```ts +const getMessageIntegration = new apigateway.AwsIntegration({ + service: 'sqs', + path: 'queueName', + region: 'eu-west-1' +}); +``` + ## API Keys The following example shows how to use an API Key with a usage plan: diff --git a/packages/@aws-cdk/aws-apigateway/lib/integrations/aws.ts b/packages/@aws-cdk/aws-apigateway/lib/integrations/aws.ts index 6374bb404902a..0e607e25a21cf 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/integrations/aws.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/integrations/aws.ts @@ -60,6 +60,13 @@ export interface AwsIntegrationProps { * Integration options, such as content handling, request/response mapping, etc. */ readonly options?: IntegrationOptions + + /** + * The region of the integrated AWS service. + * + * @default - same region as the stack + */ + readonly region?: string; } /** @@ -87,6 +94,7 @@ export class AwsIntegration extends Integration { resource: apiType, sep: '/', resourceName: apiValue, + region: props.region, }); }, }), diff --git a/packages/@aws-cdk/aws-apigateway/test/method.test.ts b/packages/@aws-cdk/aws-apigateway/test/method.test.ts index 36610126f3ec6..3fb5c580bc541 100644 --- a/packages/@aws-cdk/aws-apigateway/test/method.test.ts +++ b/packages/@aws-cdk/aws-apigateway/test/method.test.ts @@ -90,6 +90,35 @@ describe('method', () => { }); + test('integration can be set for a service in the provided region', () => { + // GIVEN + const stack = new cdk.Stack(); + const api = new apigw.RestApi(stack, 'test-api', { cloudWatchRole: false, deploy: false }); + + // WHEN + new apigw.Method(stack, 'my-method', { + httpMethod: 'POST', + resource: api.root, + integration: new apigw.AwsIntegration({ service: 'sqs', path: 'queueName', region: 'eu-west-1' }), + }); + + // THEN + expect(stack).toHaveResource('AWS::ApiGateway::Method', { + Integration: { + IntegrationHttpMethod: 'POST', + Type: 'AWS', + Uri: { + 'Fn::Join': [ + '', + [ + 'arn:', { Ref: 'AWS::Partition' }, ':apigateway:eu-west-1:sqs:path/queueName', + ], + ], + }, + }, + }); + }); + test('integration with a custom http method can be set via a property', () => { // GIVEN const stack = new cdk.Stack(); From 4553d4b37cc7c2062eebc36bfe7a03b0226b598d Mon Sep 17 00:00:00 2001 From: AWS CDK Automation <43080478+aws-cdk-automation@users.noreply.github.com> Date: Wed, 24 Feb 2021 16:50:08 +0200 Subject: [PATCH 16/78] chore(merge-back): 1.91.0 (#13216) See [CHANGELOG](https://github.com/aws/aws-cdk/blob/bump/1.91.0/CHANGELOG.md) --- .github/workflows/auto-approve.yml | 6 ++-- CHANGELOG.md | 28 +++++++++++++++ ...nteg.kinesis-firehose-stream.expected.json | 2 +- .../@aws-cdk/aws-rds/test/cluster.test.ts | 35 +++++++++++++++++++ .../@aws-cdk/aws-rds/test/instance.test.ts | 2 -- version.v1.json | 2 +- 6 files changed, 68 insertions(+), 7 deletions(-) diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml index 81bd372dfb3ed..cf2ed7e21ca69 100644 --- a/.github/workflows/auto-approve.yml +++ b/.github/workflows/auto-approve.yml @@ -6,9 +6,9 @@ on: pull_request jobs: auto-approve: if: > - contains(github.event.pull_request.labels.*.name, 'pr/auto-approve') && - (github.event.pull_request.user.login == 'aws-cdk-automation' - || github.event.pull_request.user.login == 'dependabot[bot]' + contains(github.event.pull_request.labels.*.name, 'pr/auto-approve') && + (github.event.pull_request.user.login == 'aws-cdk-automation' + || github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'dependabot-preview[bot]') runs-on: ubuntu-latest steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index f8f6aec305888..41d7a76abc330 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,34 @@ 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. +## [1.91.0](https://github.com/aws/aws-cdk/compare/v1.90.1...v1.91.0) (2021-02-23) + + +### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES + +* **aws-appsync:** RdsDataSource now takes a ServerlessCluster instead of a DatabaseCluster +* **aws-appsync:** graphqlapi.addRdsDataSource now takes databaseName as its fourth argument + +### Features + +* **aws-appsync:** add databaseName to rdsDataSource ([#12575](https://github.com/aws/aws-cdk/issues/12575)) ([f92b65e](https://github.com/aws/aws-cdk/commit/f92b65e2a158f918d8f05132ed12a4bb85228997)), closes [#12572](https://github.com/aws/aws-cdk/issues/12572) +* **cfnspec:** cloudformation spec v28.0.0 ([#13101](https://github.com/aws/aws-cdk/issues/13101)) ([13c9859](https://github.com/aws/aws-cdk/commit/13c9859cc62b3d472ba1be84b12d478f61f02ec9)) +* **ecs-patterns:** Add support for assignPublicIp for QueueProcessingFargateService ([#13122](https://github.com/aws/aws-cdk/issues/13122)) ([3fb4600](https://github.com/aws/aws-cdk/commit/3fb46001a7345cbefa6df70893999bcb304ed40d)), closes [#12815](https://github.com/aws/aws-cdk/issues/12815) +* **stepfunctions-tasks:** add EKS call to SFN-tasks ([#12779](https://github.com/aws/aws-cdk/issues/12779)) ([296a10d](https://github.com/aws/aws-cdk/commit/296a10d76a9f6fc2a374d1a6461c460bcc3eeb79)) +* **synthetics:** Update CloudWatch Synthetics NodeJS runtimes ([#12907](https://github.com/aws/aws-cdk/issues/12907)) ([6aac3b6](https://github.com/aws/aws-cdk/commit/6aac3b6a9bb1586ee16e7a85ca657b544d0f8304)), closes [#12906](https://github.com/aws/aws-cdk/issues/12906) + + +### Bug Fixes + +* UserPool, Volume, ElasticSearch, FSx are now RETAIN by default ([#12920](https://github.com/aws/aws-cdk/issues/12920)) ([5a54741](https://github.com/aws/aws-cdk/commit/5a54741a414d3f8b7913163f4785759b984b41d8)), closes [#12563](https://github.com/aws/aws-cdk/issues/12563) +* **appsync:** revert to allow resolver creation from data source ([#12973](https://github.com/aws/aws-cdk/issues/12973)) ([d35f032](https://github.com/aws/aws-cdk/commit/d35f03226d6d7fb5be246b4d3584ee9205b0ef2d)), closes [#12635](https://github.com/aws/aws-cdk/issues/12635) [#11522](https://github.com/aws/aws-cdk/issues/11522) +* **aws-appsync:** use serverlessCluster on rdsDataSource ([#13206](https://github.com/aws/aws-cdk/issues/13206)) ([45cf387](https://github.com/aws/aws-cdk/commit/45cf3873fb48d4043e7a22284d36695ea6bde6ef)), closes [#12567](https://github.com/aws/aws-cdk/issues/12567) +* **cfn-diff:** handle Fn::If inside policies and statements ([#12975](https://github.com/aws/aws-cdk/issues/12975)) ([daf4e47](https://github.com/aws/aws-cdk/commit/daf4e47a790ab99639e471f6792f22e3e4f8ee73)), closes [#12887](https://github.com/aws/aws-cdk/issues/12887) +* **core:** ENOTDIR invalid cwd on "cdk deploy" ([#13145](https://github.com/aws/aws-cdk/issues/13145)) ([cd7a3ed](https://github.com/aws/aws-cdk/commit/cd7a3ed333570a3b26446e1e3a054ca886cd3906)), closes [#12258](https://github.com/aws/aws-cdk/issues/12258) [#13076](https://github.com/aws/aws-cdk/issues/13076) [#13131](https://github.com/aws/aws-cdk/issues/13131) +* **eks:** `KubectlProvider` creates un-necessary security group ([#13178](https://github.com/aws/aws-cdk/issues/13178)) ([c5e8b6d](https://github.com/aws/aws-cdk/commit/c5e8b6df1e5f0359d51d025edcc68508ab5daef1)) +* **eks:** Deployment fails for the first deployment in an account ([#13103](https://github.com/aws/aws-cdk/issues/13103)) ([e042879](https://github.com/aws/aws-cdk/commit/e042879851f8ddd558d20941019c9a6692a1c2bf)), closes [/github.com/aws/aws-cdk/issues/9027#issuecomment-780482124](https://github.com/aws//github.com/aws/aws-cdk/issues/9027/issues/issuecomment-780482124) +* **lambda-nodejs:** invalid sample in documentation ([#12404](https://github.com/aws/aws-cdk/issues/12404)) ([520c263](https://github.com/aws/aws-cdk/commit/520c263ca3c6b0ea7d9c09c23e509a3373ee2b8a)) + ## [1.90.1](https://github.com/aws/aws-cdk/compare/v1.90.0...v1.90.1) (2021-02-19) ### Bug Fixes diff --git a/packages/@aws-cdk/aws-events-targets/test/kinesis-firehose/integ.kinesis-firehose-stream.expected.json b/packages/@aws-cdk/aws-events-targets/test/kinesis-firehose/integ.kinesis-firehose-stream.expected.json index 936049a947c01..6b76a3d96a32e 100644 --- a/packages/@aws-cdk/aws-events-targets/test/kinesis-firehose/integ.kinesis-firehose-stream.expected.json +++ b/packages/@aws-cdk/aws-events-targets/test/kinesis-firehose/integ.kinesis-firehose-stream.expected.json @@ -161,4 +161,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/aws-rds/test/cluster.test.ts b/packages/@aws-cdk/aws-rds/test/cluster.test.ts index 10b5a9f8c37e3..11e60d8068341 100644 --- a/packages/@aws-cdk/aws-rds/test/cluster.test.ts +++ b/packages/@aws-cdk/aws-rds/test/cluster.test.ts @@ -1838,6 +1838,40 @@ describe('cluster', () => { }); }); +test.each([ + [cdk.RemovalPolicy.RETAIN, 'Retain', 'Retain', 'Retain'], + [cdk.RemovalPolicy.SNAPSHOT, 'Snapshot', 'Delete', ABSENT], + [cdk.RemovalPolicy.DESTROY, 'Delete', 'Delete', ABSENT], +])('if Cluster RemovalPolicy is \'%s\', the DBCluster has DeletionPolicy \'%s\', the DBInstance has \'%s\' and the DBSubnetGroup has \'%s\'', (clusterRemovalPolicy, clusterValue, instanceValue, subnetValue) => { + const stack = new cdk.Stack(); + + // WHEN + new DatabaseCluster(stack, 'Cluster', { + credentials: { username: 'admin' }, + engine: DatabaseClusterEngine.AURORA, + instanceProps: { + instanceType: ec2.InstanceType.of(ec2.InstanceClass.M5, ec2.InstanceSize.LARGE), + vpc: new ec2.Vpc(stack, 'Vpc'), + }, + removalPolicy: clusterRemovalPolicy, + }); + + // THEN + expect(stack).toHaveResourceLike('AWS::RDS::DBCluster', { + DeletionPolicy: clusterValue, + UpdateReplacePolicy: clusterValue, + }, ResourcePart.CompleteDefinition); + + expect(stack).toHaveResourceLike('AWS::RDS::DBInstance', { + DeletionPolicy: instanceValue, + UpdateReplacePolicy: instanceValue, + }, ResourcePart.CompleteDefinition); + + expect(stack).toHaveResourceLike('AWS::RDS::DBSubnetGroup', { + DeletionPolicy: subnetValue, + }, ResourcePart.CompleteDefinition); +}); + test.each([ [cdk.RemovalPolicy.RETAIN, 'Retain', 'Retain', 'Retain'], [cdk.RemovalPolicy.SNAPSHOT, 'Snapshot', 'Delete', ABSENT], @@ -1873,6 +1907,7 @@ test.each([ }, ResourcePart.CompleteDefinition); }); + function testStack(app?: cdk.App) { const stack = new cdk.Stack(app, undefined, { env: { account: '12345', region: 'us-test-1' } }); stack.node.setContext('availability-zones:12345:us-test-1', ['us-test-1a', 'us-test-1b']); diff --git a/packages/@aws-cdk/aws-rds/test/instance.test.ts b/packages/@aws-cdk/aws-rds/test/instance.test.ts index ede79cd19ed75..ba14bf54bd399 100644 --- a/packages/@aws-cdk/aws-rds/test/instance.test.ts +++ b/packages/@aws-cdk/aws-rds/test/instance.test.ts @@ -1242,8 +1242,6 @@ describe('instance', () => { expect(stack).toHaveResource('AWS::RDS::DBInstance', { PubliclyAccessible: true, }); - - }); }); diff --git a/version.v1.json b/version.v1.json index eca0b33c11e76..aa566c6d404ff 100644 --- a/version.v1.json +++ b/version.v1.json @@ -1,3 +1,3 @@ { - "version": "1.90.1" + "version": "1.91.0" } From 23385ddeb0decd227a0104d7b0aff06939acaad9 Mon Sep 17 00:00:00 2001 From: Robert Djurasaj Date: Wed, 24 Feb 2021 11:02:58 -0700 Subject: [PATCH 17/78] feat(elasticloadbalancingv2): Add support for application cookies (#13142) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://aws.amazon.com/about-aws/whats-new/2021/02/application-load-balancer-supports-application-cookie-stickiness/ Maybe I shouldn't have deprecated `stickinessCookieDuration` ... which is essentially a rename to `loadBalancerStickinessCookieDuration`.... but that can be easily reverted based on the feedback I recieve. As always... feedback is much appreciated. Thanks! 👍 edit: lb_cookie Screen Shot 2021-02-18 at 5 14 31 PM app_cookie Screen Shot 2021-02-18 at 5 14 16 PM ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../aws-elasticloadbalancingv2/README.md | 27 +++++ .../lib/alb/application-listener.ts | 15 +++ .../lib/alb/application-target-group.ts | 47 ++++++-- .../test/alb/listener.test.ts | 51 +++++++-- .../test/alb/target-group.test.ts | 102 ++++++++++++++++++ .../test/integ.alb.expected.json | 32 ++++++ .../test/integ.alb.ts | 3 + 7 files changed, 263 insertions(+), 14 deletions(-) diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/README.md b/packages/@aws-cdk/aws-elasticloadbalancingv2/README.md index ac397ba62bd94..89baa6791ff2c 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/README.md +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/README.md @@ -243,6 +243,33 @@ const group = listener.addTargets('AppFleet', { group.addTarget(asg2); ``` +### Sticky sessions for your Application Load Balancer + +By default, an Application Load Balancer routes each request independently to a registered target based on the chosen load-balancing algorithm. However, you can use the sticky session feature (also known as session affinity) to enable the load balancer to bind a user's session to a specific target. This ensures that all requests from the user during the session are sent to the same target. This feature is useful for servers that maintain state information in order to provide a continuous experience to clients. To use sticky sessions, the client must support cookies. + +Application Load Balancers support both duration-based cookies (`lb_cookie`) and application-based cookies (`app_cookie`). The key to managing sticky sessions is determining how long your load balancer should consistently route the user's request to the same target. Sticky sessions are enabled at the target group level. You can use a combination of duration-based stickiness, application-based stickiness, and no stickiness across all of your target groups. + +```ts +// Target group with duration-based stickiness with load-balancer generated cookie +const tg1 = new elbv2.ApplicationTargetGroup(stack, 'TG1', { + targetType: elbv2.TargetType.INSTANCE, + port: 80, + stickinessCookieDuration: cdk.Duration.minutes(5), + vpc, +}); + +// Target group with application-based stickiness +const tg2 = new elbv2.ApplicationTargetGroup(stack, 'TG2', { + targetType: elbv2.TargetType.INSTANCE, + port: 80, + stickinessCookieDuration: cdk.Duration.minutes(5), + stickinessCookieName: 'MyDeliciousCookie', + vpc, +}); +``` + +For more information see: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/sticky-sessions.html#application-based-stickiness + ## Using Lambda Targets To use a Lambda Function as a target, use the integration class in the diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener.ts index 1cd8a91c932aa..1844314e1f560 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener.ts @@ -363,6 +363,7 @@ export class ApplicationListener extends BaseListener implements IApplicationLis protocol: props.protocol, slowStart: props.slowStart, stickinessCookieDuration: props.stickinessCookieDuration, + stickinessCookieName: props.stickinessCookieName, targetGroupName: props.targetGroupName, targets: props.targets, vpc: this.loadBalancer.vpc, @@ -813,6 +814,20 @@ export interface AddApplicationTargetsProps extends AddRuleProps { */ readonly stickinessCookieDuration?: Duration; + /** + * The name of an application-based stickiness cookie. + * + * Names that start with the following prefixes are not allowed: AWSALB, AWSALBAPP, + * and AWSALBTG; they're reserved for use by the load balancer. + * + * Note: `stickinessCookieName` parameter depends on the presence of `stickinessCookieDuration` parameter. + * If `stickinessCookieDuration` is not set, `stickinessCookieName` will be omitted. + * + * @default - If `stickinessCookieDuration` is set, a load-balancer generated cookie is used. Otherwise, no stickiness is defined. + * @see https://docs.aws.amazon.com/elasticloadbalancing/latest/application/sticky-sessions.html + */ + readonly stickinessCookieName?: string; + /** * The targets to add to this target group. * diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-target-group.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-target-group.ts index a1d3de25bf82d..4196f370cc173 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-target-group.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-target-group.ts @@ -1,6 +1,6 @@ import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; import * as ec2 from '@aws-cdk/aws-ec2'; -import { Annotations, Duration } from '@aws-cdk/core'; +import { Annotations, Duration, Token } from '@aws-cdk/core'; import { IConstruct, Construct } from 'constructs'; import { ApplicationELBMetrics } from '../elasticloadbalancingv2-canned-metrics.generated'; import { @@ -57,6 +57,20 @@ export interface ApplicationTargetGroupProps extends BaseTargetGroupProps { */ readonly stickinessCookieDuration?: Duration; + /** + * The name of an application-based stickiness cookie. + * + * Names that start with the following prefixes are not allowed: AWSALB, AWSALBAPP, + * and AWSALBTG; they're reserved for use by the load balancer. + * + * Note: `stickinessCookieName` parameter depends on the presence of `stickinessCookieDuration` parameter. + * If `stickinessCookieDuration` is not set, `stickinessCookieName` will be omitted. + * + * @default - If `stickinessCookieDuration` is set, a load-balancer generated cookie is used. Otherwise, no stickiness is defined. + * @see https://docs.aws.amazon.com/elasticloadbalancing/latest/application/sticky-sessions.html + */ + readonly stickinessCookieName?: string; + /** * The targets to add to this target group. * @@ -111,8 +125,8 @@ export class ApplicationTargetGroup extends TargetGroupBase implements IApplicat if (props.slowStart !== undefined) { this.setAttribute('slow_start.duration_seconds', props.slowStart.toSeconds().toString()); } - if (props.stickinessCookieDuration !== undefined) { - this.enableCookieStickiness(props.stickinessCookieDuration); + if (props.stickinessCookieDuration) { + this.enableCookieStickiness(props.stickinessCookieDuration, props.stickinessCookieName); } this.addTarget(...(props.targets || [])); } @@ -129,12 +143,31 @@ export class ApplicationTargetGroup extends TargetGroupBase implements IApplicat } /** - * Enable sticky routing via a cookie to members of this target group + * Enable sticky routing via a cookie to members of this target group. + * + * Note: If the `cookieName` parameter is set, application-based stickiness will be applied, + * otherwise it defaults to duration-based stickiness attributes (`lb_cookie`). + * + * @see https://docs.aws.amazon.com/elasticloadbalancing/latest/application/sticky-sessions.html */ - public enableCookieStickiness(duration: Duration) { + public enableCookieStickiness(duration: Duration, cookieName?: string) { + if (cookieName !== undefined) { + if (!Token.isUnresolved(cookieName) && (cookieName.startsWith('AWSALB') || cookieName.startsWith('AWSALBAPP') || cookieName.startsWith('AWSALBTG'))) { + throw new Error('App cookie names that start with the following prefixes are not allowed: AWSALB, AWSALBAPP, and AWSALBTG; they\'re reserved for use by the load balancer.'); + } + if (cookieName === '') { + throw new Error('App cookie name cannot be an empty string.'); + } + } this.setAttribute('stickiness.enabled', 'true'); - this.setAttribute('stickiness.type', 'lb_cookie'); - this.setAttribute('stickiness.lb_cookie.duration_seconds', duration.toSeconds().toString()); + if (cookieName) { + this.setAttribute('stickiness.type', 'app_cookie'); + this.setAttribute('stickiness.app_cookie.cookie_name', cookieName); + this.setAttribute('stickiness.app_cookie.duration_seconds', duration.toSeconds().toString()); + } else { + this.setAttribute('stickiness.type', 'lb_cookie'); + this.setAttribute('stickiness.lb_cookie.duration_seconds', duration.toSeconds().toString()); + } } /** diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/listener.test.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/listener.test.ts index b9de0961423ec..231279ffb932e 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/listener.test.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/listener.test.ts @@ -71,7 +71,7 @@ describe('tests', () => { }); }); - test('Listener default to open - IPv4 and IPv6 (dualstack)', () => { + test('Listener default to open - IPv4 and IPv6 (dual stack)', () => { // GIVEN const stack = new cdk.Stack(); const vpc = new ec2.Vpc(stack, 'Stack'); @@ -316,7 +316,7 @@ describe('tests', () => { }); }); - test('Enable stickiness for targets', () => { + test('Enable alb stickiness for targets', () => { // GIVEN const stack = new cdk.Stack(); const vpc = new ec2.Vpc(stack, 'Stack'); @@ -349,6 +349,43 @@ describe('tests', () => { }); }); + test('Enable app stickiness for targets', () => { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'Stack'); + const lb = new elbv2.ApplicationLoadBalancer(stack, 'LB', { vpc }); + const listener = lb.addListener('Listener', { port: 80 }); + + // WHEN + const group = listener.addTargets('Group', { + port: 80, + targets: [new FakeSelfRegisteringTarget(stack, 'Target', vpc)], + }); + group.enableCookieStickiness(cdk.Duration.hours(1), 'MyDeliciousCookie'); + + // THEN + expect(stack).toHaveResource('AWS::ElasticLoadBalancingV2::TargetGroup', { + TargetGroupAttributes: [ + { + Key: 'stickiness.enabled', + Value: 'true', + }, + { + Key: 'stickiness.type', + Value: 'app_cookie', + }, + { + Key: 'stickiness.app_cookie.cookie_name', + Value: 'MyDeliciousCookie', + }, + { + Key: 'stickiness.app_cookie.duration_seconds', + Value: '3600', + }, + ], + }); + }); + test('Enable health check for targets', () => { // GIVEN const stack = new cdk.Stack(); @@ -823,7 +860,7 @@ describe('tests', () => { }); }); - test('Throws when specifying both target groups and fixed reponse', () => { + test('Throws when specifying both target groups and fixed response', () => { // GIVEN const stack = new cdk.Stack(); const vpc = new ec2.Vpc(stack, 'VPC'); @@ -868,7 +905,7 @@ describe('tests', () => { })).toThrowError('Priority must have value greater than or equal to 1'); }); - test('Throws when specifying both target groups and redirect reponse', () => { + test('Throws when specifying both target groups and redirect response', () => { // GIVEN const stack = new cdk.Stack(); const vpc = new ec2.Vpc(stack, 'VPC'); @@ -970,7 +1007,7 @@ describe('tests', () => { }); }); - test('Can add additional certificates via addCertficateArns to application listener', () => { + test('Can add additional certificates via addCertificateArns to application listener', () => { // GIVEN const stack = new cdk.Stack(); const vpc = new ec2.Vpc(stack, 'Stack'); @@ -1050,7 +1087,7 @@ describe('tests', () => { })).toThrowError('Both `pathPatterns` and `pathPattern` are specified, specify only one'); }); - test('Add additonal condition to listener rule', () => { + test('Add additional condition to listener rule', () => { // GIVEN const stack = new cdk.Stack(); const vpc = new ec2.Vpc(stack, 'Stack'); @@ -1244,7 +1281,7 @@ describe('tests', () => { }); }); - test('Can exist together legacy style conditions and modan style conditions', () => { + test('Can exist together legacy style conditions and modern style conditions', () => { // GIVEN const stack = new cdk.Stack(); const vpc = new ec2.Vpc(stack, 'Stack'); diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/target-group.test.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/target-group.test.ts index 1d8df0a706d9c..f1b71756e43db 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/target-group.test.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/target-group.test.ts @@ -88,4 +88,106 @@ describe('tests', () => { UnhealthyThresholdCount: 27, }); }); + + test('Load balancer duration cookie stickiness', () => { + // GIVEN + const app = new cdk.App(); + const stack = new cdk.Stack(app, 'Stack'); + const vpc = new ec2.Vpc(stack, 'VPC', {}); + + // WHEN + new elbv2.ApplicationTargetGroup(stack, 'TargetGroup', { + stickinessCookieDuration: cdk.Duration.minutes(5), + vpc, + }); + + // THEN + expect(stack).toHaveResource('AWS::ElasticLoadBalancingV2::TargetGroup', { + TargetGroupAttributes: [ + { + Key: 'stickiness.enabled', + Value: 'true', + }, + { + Key: 'stickiness.type', + Value: 'lb_cookie', + }, + { + Key: 'stickiness.lb_cookie.duration_seconds', + Value: '300', + }, + ], + }); + }); + + test('Load balancer app cookie stickiness', () => { + // GIVEN + const app = new cdk.App(); + const stack = new cdk.Stack(app, 'Stack'); + const vpc = new ec2.Vpc(stack, 'VPC', {}); + + // WHEN + new elbv2.ApplicationTargetGroup(stack, 'TargetGroup', { + stickinessCookieDuration: cdk.Duration.minutes(5), + stickinessCookieName: 'MyDeliciousCookie', + vpc, + }); + + // THEN + expect(stack).toHaveResource('AWS::ElasticLoadBalancingV2::TargetGroup', { + TargetGroupAttributes: [ + { + Key: 'stickiness.enabled', + Value: 'true', + }, + { + Key: 'stickiness.type', + Value: 'app_cookie', + }, + { + Key: 'stickiness.app_cookie.cookie_name', + Value: 'MyDeliciousCookie', + }, + { + Key: 'stickiness.app_cookie.duration_seconds', + Value: '300', + }, + ], + }); + }); + + test('Bad stickiness cookie names', () => { + // GIVEN + const app = new cdk.App(); + const stack = new cdk.Stack(app, 'Stack'); + const vpc = new ec2.Vpc(stack, 'VPC', {}); + const errMessage = 'App cookie names that start with the following prefixes are not allowed: AWSALB, AWSALBAPP, and AWSALBTG; they\'re reserved for use by the load balancer'; + + // THEN + ['AWSALBCookieName', 'AWSALBstickinessCookieName', 'AWSALBTGCookieName'].forEach((badCookieName, i) => { + expect(() => { + new elbv2.ApplicationTargetGroup(stack, `TargetGroup${i}`, { + stickinessCookieDuration: cdk.Duration.minutes(5), + stickinessCookieName: badCookieName, + vpc, + }); + }).toThrow(errMessage); + }); + }); + + test('Empty stickiness cookie name', () => { + // GIVEN + const app = new cdk.App(); + const stack = new cdk.Stack(app, 'Stack'); + const vpc = new ec2.Vpc(stack, 'VPC', {}); + + // THEN + expect(() => { + new elbv2.ApplicationTargetGroup(stack, 'TargetGroup', { + stickinessCookieDuration: cdk.Duration.minutes(5), + stickinessCookieName: '', + vpc, + }); + }).toThrow(/App cookie name cannot be an empty string./); + }); }); diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/integ.alb.expected.json b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/integ.alb.expected.json index 8fd29b717c9d5..c1dfdcb095bec 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/integ.alb.expected.json +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/integ.alb.expected.json @@ -438,6 +438,20 @@ "Properties": { "Port": 80, "Protocol": "HTTP", + "TargetGroupAttributes": [ + { + "Key": "stickiness.enabled", + "Value": "true" + }, + { + "Key": "stickiness.type", + "Value": "lb_cookie" + }, + { + "Key": "stickiness.lb_cookie.duration_seconds", + "Value": "300" + } + ], "Targets": [ { "Id": "10.0.128.4" @@ -454,6 +468,24 @@ "Properties": { "Port": 80, "Protocol": "HTTP", + "TargetGroupAttributes": [ + { + "Key": "stickiness.enabled", + "Value": "true" + }, + { + "Key": "stickiness.type", + "Value": "app_cookie" + }, + { + "Key": "stickiness.app_cookie.cookie_name", + "Value": "MyDeliciousCookie" + }, + { + "Key": "stickiness.app_cookie.duration_seconds", + "Value": "300" + } + ], "Targets": [ { "Id": "10.0.128.5" diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/integ.alb.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/integ.alb.ts index 251c730c2fa42..df716e80e0f4f 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/integ.alb.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/integ.alb.ts @@ -22,6 +22,7 @@ const listener = lb.addListener('Listener', { const group1 = listener.addTargets('Target', { port: 80, targets: [new elbv2.IpTarget('10.0.128.4')], + stickinessCookieDuration: cdk.Duration.minutes(5), }); const group2 = listener.addTargets('ConditionalTarget', { @@ -29,6 +30,8 @@ const group2 = listener.addTargets('ConditionalTarget', { hostHeader: 'example.com', port: 80, targets: [new elbv2.IpTarget('10.0.128.5')], + stickinessCookieDuration: cdk.Duration.minutes(5), + stickinessCookieName: 'MyDeliciousCookie', }); group1.metricTargetResponseTime().createAlarm(stack, 'ResponseTimeHigh1', { From 5d71d8e815529ccde7ffe13bb72f57ae88e896dc Mon Sep 17 00:00:00 2001 From: Robert Djurasaj Date: Wed, 24 Feb 2021 11:56:54 -0700 Subject: [PATCH 18/78] chore(elasticloadbalancingv2): Add stickiness cookie duration checks (#13263) One little extra check rather than finding this out during the ALB deployment process. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../lib/alb/application-target-group.ts | 3 +++ .../test/alb/target-group.test.ts | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-target-group.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-target-group.ts index 4196f370cc173..c6556a61e2021 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-target-group.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-target-group.ts @@ -151,6 +151,9 @@ export class ApplicationTargetGroup extends TargetGroupBase implements IApplicat * @see https://docs.aws.amazon.com/elasticloadbalancing/latest/application/sticky-sessions.html */ public enableCookieStickiness(duration: Duration, cookieName?: string) { + if (duration.toSeconds() < 1 || duration.toSeconds() > 604800) { + throw new Error('Stickiness cookie duration value must be between 1 second and 7 days (604800 seconds).'); + } if (cookieName !== undefined) { if (!Token.isUnresolved(cookieName) && (cookieName.startsWith('AWSALB') || cookieName.startsWith('AWSALBAPP') || cookieName.startsWith('AWSALBTG'))) { throw new Error('App cookie names that start with the following prefixes are not allowed: AWSALB, AWSALBAPP, and AWSALBTG; they\'re reserved for use by the load balancer.'); diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/target-group.test.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/target-group.test.ts index f1b71756e43db..06b79c87d244f 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/target-group.test.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/target-group.test.ts @@ -190,4 +190,19 @@ describe('tests', () => { }); }).toThrow(/App cookie name cannot be an empty string./); }); + + test('Bad stickiness duration value', () => { + // GIVEN + const app = new cdk.App(); + const stack = new cdk.Stack(app, 'Stack'); + const vpc = new ec2.Vpc(stack, 'VPC', {}); + + // THEN + expect(() => { + new elbv2.ApplicationTargetGroup(stack, 'TargetGroup', { + stickinessCookieDuration: cdk.Duration.days(8), + vpc, + }); + }).toThrow(/Stickiness cookie duration value must be between 1 second and 7 days \(604800 seconds\)./); + }); }); From a9caa455b708e08f1cf2d366ac32892d4faa59b4 Mon Sep 17 00:00:00 2001 From: Piradeep Kandasamy <44981951+piradeepk@users.noreply.github.com> Date: Wed, 24 Feb 2021 20:21:41 -0500 Subject: [PATCH 19/78] feat(ecs-patterns): remove default desiredCount to align with cfn behaviour (under feature flag) (#13130) AWS CloudFormation previously required a desiredCount to be specified to create an Amazon ECS Service. They have recently removed that required field, and now provide the following default behaviour, if the desired count is not specified. * when creating a service, the service is created and starts up with a desired count of 1. * when updating a service, the service is updated and starts up with the same desired count as it had prior to the deployment. The AWS-CDK currently adds a default desiredCount of 1 when creating or updating an Amazon ECS service, and this could lead to issues when a service has scaled up due to autoscaling. When updating a service using the AWS-CDK, the service would then be scaled down to the original desiredCount, leading to potential outages. This change introduces a new feature flag `REMOVE_DEFAULT_DESIRED_COUNT` to flip the default behaviour of setting the desiredCount for any service created using any of the following ECS Patterns constructs. Without the feature flag set, the desiredCount of any service created is automatically defaulted to 1 (which is the current behaviour). With the feature flag set (to true), the default will be removed and the desiredCount will only be passed to the service if it is passed in as input. * ApplicationLoadBalancedEc2Service * ApplicationLoadBalancedFargateService * NetworkLoadBalancedEc2Service * NetworkLoadBalancedFargateService * QueueProcessingEc2Service * QueueProcessingFargateService **BREAKING CHANGE:** the desiredCount property stored on the above constructs will be optional, allowing them to be undefined. This is enabled through the `@aws-cdk/aws-ecs-patterns:removeDefaultDesiredCount` feature flag. We would recommend all aws-cdk users to set the `REMOVE_DEFAULT_DESIRED_COUNT` flag to true for all of their existing applications. Fixes: https://github.com/aws/aws-cdk/issues/12990 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-ecs-patterns/README.md | 38 ++++++ .../application-load-balanced-service-base.ts | 15 ++- ...ion-multiple-target-groups-service-base.ts | 16 ++- .../network-load-balanced-service-base.ts | 14 ++- ...ork-multiple-target-groups-service-base.ts | 15 ++- .../lib/base/queue-processing-service-base.ts | 39 +++++- .../application-load-balanced-ecs-service.ts | 5 +- ...tion-multiple-target-groups-ecs-service.ts | 5 +- .../ecs/network-load-balanced-ecs-service.ts | 5 +- ...work-multiple-target-groups-ecs-service.ts | 5 +- .../lib/ecs/queue-processing-ecs-service.ts | 7 +- ...plication-load-balanced-fargate-service.ts | 5 +- ...-multiple-target-groups-fargate-service.ts | 5 +- .../network-load-balanced-fargate-service.ts | 5 +- ...-multiple-target-groups-fargate-service.ts | 5 +- .../queue-processing-fargate-service.ts | 7 +- .../@aws-cdk/aws-ecs-patterns/package.json | 2 + ...on-load-balanced-ecs-service.expected.json | 5 +- ...integ.scheduled-ecs-task.lit.expected.json | 4 +- .../aws-ecs-patterns/test/ec2/test.l3s.ts | 99 ++++++++++++++- .../ec2/test.queue-processing-ecs-service.ts | 28 ++++- .../fargate/integ.asset-image.expected.json | 3 +- .../fargate/integ.executionrole.expected.json | 1 - .../fargate/integ.l3-autocreate.expected.json | 2 - .../fargate/integ.l3-vpconly.expected.json | 3 - .../test/fargate/integ.l3.expected.json | 1 - ...oad-balanced-fargate-service.expected.json | 1 - ...oad-balanced-fargate-service.expected.json | 1 - ...ing-fargate-service-isolated.expected.json | 1 - ...ssing-fargate-service-public.expected.json | 1 - ...e-processing-fargate-service.expected.json | 1 - .../integ.special-listener.expected.json | 2 - .../test.queue-processing-fargate-service.ts | 118 +++++++++++++++++- packages/@aws-cdk/cx-api/lib/features.ts | 17 +++ 34 files changed, 436 insertions(+), 45 deletions(-) diff --git a/packages/@aws-cdk/aws-ecs-patterns/README.md b/packages/@aws-cdk/aws-ecs-patterns/README.md index 12f56a2b70102..a1072d47fe700 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/README.md +++ b/packages/@aws-cdk/aws-ecs-patterns/README.md @@ -466,3 +466,41 @@ const scheduledFargateTask = new ScheduledFargateTask(stack, 'ScheduledFargateTa platformVersion: ecs.FargatePlatformVersion.VERSION1_4, }); ``` + +### Use the REMOVE_DEFAULT_DESIRED_COUNT feature flag + +The REMOVE_DEFAULT_DESIRED_COUNT feature flag is used to override the default desiredCount that is autogenerated by the CDK. This will set the desiredCount of any service created by any of the following constructs to be undefined. + +* ApplicationLoadBalancedEc2Service +* ApplicationLoadBalancedFargateService +* NetworkLoadBalancedEc2Service +* NetworkLoadBalancedFargateService +* QueueProcessingEc2Service +* QueueProcessingFargateService + +If a desiredCount is not passed in as input to the above constructs, CloudFormation will either create a new service to start up with a desiredCount of 1, or update an existing service to start up with the same desiredCount as prior to the update. + +To enable the feature flag, ensure that the REMOVE_DEFAULT_DESIRED_COUNT flag within an application stack context is set to true, like so: + +```ts +stack.node.setContext(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT, true); +``` + +The following is an example of an application with the REMOVE_DEFAULT_DESIRED_COUNT feature flag enabled: + +```ts +const app = new App(); + +const stack = new Stack(app, 'aws-ecs-patterns-queue'); +stack.node.setContext(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT, true); + +const vpc = new ec2.Vpc(stack, 'VPC', { + maxAzs: 2, +}); + +new QueueProcessingFargateService(stack, 'QueueProcessingService', { + vpc, + memoryLimitMiB: 512, + image: new ecs.AssetImage(path.join(__dirname, '..', 'sqs-reader')), +}); +``` diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/base/application-load-balanced-service-base.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/base/application-load-balanced-service-base.ts index 74411bb217558..dde07a16e114c 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/base/application-load-balanced-service-base.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/base/application-load-balanced-service-base.ts @@ -78,7 +78,9 @@ export interface ApplicationLoadBalancedServiceBaseProps { * The desired number of instantiations of the task definition to keep running on the service. * The minimum value is 1 * - * @default 1 + * @default - If the feature flag, ECS_REMOVE_DEFAULT_DESIRED_COUNT is false, the default is 1; + * if true, the default is 1 for all new services and uses the existing services desired count + * when updating an existing service. */ readonly desiredCount?: number; @@ -311,12 +313,19 @@ export interface ApplicationLoadBalancedTaskImageOptions { * The base class for ApplicationLoadBalancedEc2Service and ApplicationLoadBalancedFargateService services. */ export abstract class ApplicationLoadBalancedServiceBase extends CoreConstruct { - /** * The desired number of instantiations of the task definition to keep running on the service. + * @deprecated - Use `internalDesiredCount` instead. */ public readonly desiredCount: number; + /** + * The desired number of instantiations of the task definition to keep running on the service. + * The default is 1 for all new services and uses the existing services desired count + * when updating an existing service if one is not provided. + */ + public readonly internalDesiredCount?: number; + /** * The Application Load Balancer for the service. */ @@ -368,7 +377,9 @@ export abstract class ApplicationLoadBalancedServiceBase extends CoreConstruct { if (props.desiredCount !== undefined && props.desiredCount < 1) { throw new Error('You must specify a desiredCount greater than 0'); } + this.desiredCount = props.desiredCount || 1; + this.internalDesiredCount = props.desiredCount; const internetFacing = props.publicLoadBalancer ?? true; diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/base/application-multiple-target-groups-service-base.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/base/application-multiple-target-groups-service-base.ts index f3eb132e934ae..ff3fc675fcd69 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/base/application-multiple-target-groups-service-base.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/base/application-multiple-target-groups-service-base.ts @@ -47,7 +47,9 @@ export interface ApplicationMultipleTargetGroupsServiceBaseProps { /** * The desired number of instantiations of the task definition to keep running on the service. * - * @default 1 + * @default - If the feature flag, ECS_REMOVE_DEFAULT_DESIRED_COUNT is false, the default is 1; + * if true, the default is 1 for all new services and uses the existing services desired count + * when updating an existing service. */ readonly desiredCount?: number; @@ -329,12 +331,19 @@ export interface ApplicationListenerProps { * The base class for ApplicationMultipleTargetGroupsEc2Service and ApplicationMultipleTargetGroupsFargateService classes. */ export abstract class ApplicationMultipleTargetGroupsServiceBase extends CoreConstruct { - /** * The desired number of instantiations of the task definition to keep running on the service. + * @deprecated - Use `internalDesiredCount` instead. */ public readonly desiredCount: number; + /** + * The desired number of instantiations of the task definition to keep running on the service. + * The default is 1 for all new services and uses the existing services desired count + * when updating an existing service, if one is not provided. + */ + public readonly internalDesiredCount?: number; + /** * The default Application Load Balancer for the service (first added load balancer). */ @@ -365,7 +374,10 @@ export abstract class ApplicationMultipleTargetGroupsServiceBase extends CoreCon this.validateInput(props); this.cluster = props.cluster || this.getDefaultCluster(this, props.vpc); + this.desiredCount = props.desiredCount || 1; + this.internalDesiredCount = props.desiredCount; + if (props.taskImageOptions) { this.logDriver = this.createLogDriver(props.taskImageOptions.enableLogging, props.taskImageOptions.logDriver); } diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/base/network-load-balanced-service-base.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/base/network-load-balanced-service-base.ts index 656cc19d19d43..949b052aebbad 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/base/network-load-balanced-service-base.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/base/network-load-balanced-service-base.ts @@ -67,7 +67,9 @@ export interface NetworkLoadBalancedServiceBaseProps { * The desired number of instantiations of the task definition to keep running on the service. * The minimum value is 1 * - * @default 1 + * @default - If the feature flag, ECS_REMOVE_DEFAULT_DESIRED_COUNT is false, the default is 1; + * if true, the default is 1 for all new services and uses the existing services desired count + * when updating an existing service. */ readonly desiredCount?: number; @@ -263,9 +265,17 @@ export interface NetworkLoadBalancedTaskImageOptions { export abstract class NetworkLoadBalancedServiceBase extends CoreConstruct { /** * The desired number of instantiations of the task definition to keep running on the service. + * @deprecated - Use `internalDesiredCount` instead. */ public readonly desiredCount: number; + /** + * The desired number of instantiations of the task definition to keep running on the service. + * The default is 1 for all new services and uses the existing services desired count + * when updating an existing service, if one is not provided. + */ + public readonly internalDesiredCount?: number; + /** * The Network Load Balancer for the service. */ @@ -306,7 +316,9 @@ export abstract class NetworkLoadBalancedServiceBase extends CoreConstruct { if (props.desiredCount !== undefined && props.desiredCount < 1) { throw new Error('You must specify a desiredCount greater than 0'); } + this.desiredCount = props.desiredCount || 1; + this.internalDesiredCount = props.desiredCount; const internetFacing = props.publicLoadBalancer ?? true; diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/base/network-multiple-target-groups-service-base.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/base/network-multiple-target-groups-service-base.ts index d34a6b548076d..60fd9904b8078 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/base/network-multiple-target-groups-service-base.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/base/network-multiple-target-groups-service-base.ts @@ -45,7 +45,9 @@ export interface NetworkMultipleTargetGroupsServiceBaseProps { * The desired number of instantiations of the task definition to keep running on the service. * The minimum value is 1 * - * @default 1 + * @default - If the feature flag, ECS_REMOVE_DEFAULT_DESIRED_COUNT is false, the default is 1; + * if true, the default is 1 for all new services and uses the existing services desired count + * when updating an existing service. */ readonly desiredCount?: number; @@ -264,9 +266,17 @@ export interface NetworkTargetProps { export abstract class NetworkMultipleTargetGroupsServiceBase extends CoreConstruct { /** * The desired number of instantiations of the task definition to keep running on the service. + * @deprecated - Use `internalDesiredCount` instead. */ public readonly desiredCount: number; + /** + * The desired number of instantiations of the task definition to keep running on the service. + * The default is 1 for all new services and uses the existing services desired count + * when updating an existing service, if one is not provided. + */ + public readonly internalDesiredCount?: number; + /** * The Network Load Balancer for the service. */ @@ -297,7 +307,10 @@ export abstract class NetworkMultipleTargetGroupsServiceBase extends CoreConstru this.validateInput(props); this.cluster = props.cluster || this.getDefaultCluster(this, props.vpc); + this.desiredCount = props.desiredCount || 1; + this.internalDesiredCount = props.desiredCount; + if (props.taskImageOptions) { this.logDriver = this.createLogDriver(props.taskImageOptions.enableLogging, props.taskImageOptions.logDriver); } diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/base/queue-processing-service-base.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/base/queue-processing-service-base.ts index 3248514931f4d..2f72c6345c469 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/base/queue-processing-service-base.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/base/queue-processing-service-base.ts @@ -3,6 +3,7 @@ import { IVpc } from '@aws-cdk/aws-ec2'; import { AwsLogDriver, BaseService, Cluster, ContainerImage, DeploymentController, ICluster, LogDriver, PropagatedTagSource, Secret } from '@aws-cdk/aws-ecs'; import { IQueue, Queue } from '@aws-cdk/aws-sqs'; import { CfnOutput, Duration, Stack } from '@aws-cdk/core'; +import * as cxapi from '@aws-cdk/cx-api'; import { Construct } from 'constructs'; // v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. @@ -53,7 +54,10 @@ export interface QueueProcessingServiceBaseProps { /** * The desired number of instantiations of the task definition to keep running on the service. * - * @default 1 + * @default - If the feature flag, ECS_REMOVE_DEFAULT_DESIRED_COUNT is false, the default is 1; + * if true, the minScalingCapacity is 1 for all new services and uses the existing services desired count + * when updating an existing service. + * @deprecated - Use `minScalingCapacity` or a literal object instead. */ readonly desiredTaskCount?: number; @@ -109,10 +113,17 @@ export interface QueueProcessingServiceBaseProps { /** * Maximum capacity to scale to. * - * @default (desiredTaskCount * 2) + * @default - If the feature flag, ECS_REMOVE_DEFAULT_DESIRED_COUNT is false, the default is (desiredTaskCount * 2); if true, the default is 2. */ readonly maxScalingCapacity?: number + /** + * Minimum capacity to scale to. + * + * @default - If the feature flag, ECS_REMOVE_DEFAULT_DESIRED_COUNT is false, the default is the desiredTaskCount; if true, the default is 1. + */ + readonly minScalingCapacity?: number + /** * The intervals for scaling based on the SQS queue's ApproximateNumberOfMessagesVisible metric. * @@ -214,6 +225,7 @@ export abstract class QueueProcessingServiceBase extends CoreConstruct { /** * The minimum number of tasks to run. + * @deprecated - Use `minCapacity` instead. */ public readonly desiredCount: number; @@ -222,6 +234,11 @@ export abstract class QueueProcessingServiceBase extends CoreConstruct { */ public readonly maxCapacity: number; + /** + * The minimum number of instances for autoscaling to scale down to. + */ + public readonly minCapacity: number; + /** * The scaling interval for autoscaling based off an SQS Queue size. */ @@ -272,9 +289,21 @@ export abstract class QueueProcessingServiceBase extends CoreConstruct { this.environment = { ...(props.environment || {}), QUEUE_NAME: this.sqsQueue.queueName }; this.secrets = props.secrets; - // Determine the desired task count (minimum) and maximum scaling capacity this.desiredCount = props.desiredTaskCount ?? 1; - this.maxCapacity = props.maxScalingCapacity || (2 * this.desiredCount); + + // Determine the desired task count (minimum) and maximum scaling capacity + if (!this.node.tryGetContext(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT)) { + this.minCapacity = props.minScalingCapacity || this.desiredCount; + this.maxCapacity = props.maxScalingCapacity || (2 * this.desiredCount); + } else { + if (props.desiredTaskCount != null) { + this.minCapacity = props.minScalingCapacity || this.desiredCount; + this.maxCapacity = props.maxScalingCapacity || (2 * this.desiredCount); + } else { + this.minCapacity = props.minScalingCapacity || 1; + this.maxCapacity = props.maxScalingCapacity || 2; + } + } if (!this.desiredCount && !this.maxCapacity) { throw new Error('maxScalingCapacity must be set and greater than 0 if desiredCount is 0'); @@ -290,7 +319,7 @@ export abstract class QueueProcessingServiceBase extends CoreConstruct { * @param service the ECS/Fargate service for which to apply the autoscaling rules to */ protected configureAutoscalingForService(service: BaseService) { - const scalingTarget = service.autoScaleTaskCount({ maxCapacity: this.maxCapacity, minCapacity: this.desiredCount }); + const scalingTarget = service.autoScaleTaskCount({ maxCapacity: this.maxCapacity, minCapacity: this.minCapacity }); scalingTarget.scaleOnCpuUtilization('CpuScaling', { targetUtilizationPercent: 50, }); diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/application-load-balanced-ecs-service.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/application-load-balanced-ecs-service.ts index b9bdcf2d100ad..2915fce6a48ff 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/application-load-balanced-ecs-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/application-load-balanced-ecs-service.ts @@ -1,4 +1,5 @@ import { Ec2Service, Ec2TaskDefinition } from '@aws-cdk/aws-ecs'; +import * as cxapi from '@aws-cdk/cx-api'; import { Construct } from 'constructs'; import { ApplicationLoadBalancedServiceBase, ApplicationLoadBalancedServiceBaseProps } from '../base/application-load-balanced-service-base'; @@ -117,9 +118,11 @@ export class ApplicationLoadBalancedEc2Service extends ApplicationLoadBalancedSe throw new Error('You must specify one of: taskDefinition or image'); } + const desiredCount = this.node.tryGetContext(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT) ? this.internalDesiredCount : this.desiredCount; + this.service = new Ec2Service(this, 'Service', { cluster: this.cluster, - desiredCount: this.desiredCount, + desiredCount: desiredCount, taskDefinition: this.taskDefinition, assignPublicIp: false, serviceName: props.serviceName, diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/application-multiple-target-groups-ecs-service.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/application-multiple-target-groups-ecs-service.ts index 6ed6b6b71802f..90f4afdd5fa8f 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/application-multiple-target-groups-ecs-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/application-multiple-target-groups-ecs-service.ts @@ -1,5 +1,6 @@ import { Ec2Service, Ec2TaskDefinition } from '@aws-cdk/aws-ecs'; import { ApplicationTargetGroup } from '@aws-cdk/aws-elasticloadbalancingv2'; +import * as cxapi from '@aws-cdk/cx-api'; import { Construct } from 'constructs'; import { ApplicationMultipleTargetGroupsServiceBase, @@ -136,9 +137,11 @@ export class ApplicationMultipleTargetGroupsEc2Service extends ApplicationMultip } private createEc2Service(props: ApplicationMultipleTargetGroupsEc2ServiceProps): Ec2Service { + const desiredCount = this.node.tryGetContext(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT) ? this.internalDesiredCount : this.desiredCount; + return new Ec2Service(this, 'Service', { cluster: this.cluster, - desiredCount: this.desiredCount, + desiredCount: desiredCount, taskDefinition: this.taskDefinition, assignPublicIp: false, serviceName: props.serviceName, diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/network-load-balanced-ecs-service.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/network-load-balanced-ecs-service.ts index fae46b68e7380..881a346c74f8a 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/network-load-balanced-ecs-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/network-load-balanced-ecs-service.ts @@ -1,4 +1,5 @@ import { Ec2Service, Ec2TaskDefinition } from '@aws-cdk/aws-ecs'; +import * as cxapi from '@aws-cdk/cx-api'; import { Construct } from 'constructs'; import { NetworkLoadBalancedServiceBase, NetworkLoadBalancedServiceBaseProps } from '../base/network-load-balanced-service-base'; @@ -115,9 +116,11 @@ export class NetworkLoadBalancedEc2Service extends NetworkLoadBalancedServiceBas throw new Error('You must specify one of: taskDefinition or image'); } + const desiredCount = this.node.tryGetContext(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT) ? this.internalDesiredCount : this.desiredCount; + this.service = new Ec2Service(this, 'Service', { cluster: this.cluster, - desiredCount: this.desiredCount, + desiredCount: desiredCount, taskDefinition: this.taskDefinition, assignPublicIp: false, serviceName: props.serviceName, diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/network-multiple-target-groups-ecs-service.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/network-multiple-target-groups-ecs-service.ts index eb8392d3b2148..f0d3b0a1571ce 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/network-multiple-target-groups-ecs-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/network-multiple-target-groups-ecs-service.ts @@ -1,5 +1,6 @@ import { Ec2Service, Ec2TaskDefinition } from '@aws-cdk/aws-ecs'; import { NetworkTargetGroup } from '@aws-cdk/aws-elasticloadbalancingv2'; +import * as cxapi from '@aws-cdk/cx-api'; import { Construct } from 'constructs'; import { NetworkMultipleTargetGroupsServiceBase, @@ -136,9 +137,11 @@ export class NetworkMultipleTargetGroupsEc2Service extends NetworkMultipleTarget } private createEc2Service(props: NetworkMultipleTargetGroupsEc2ServiceProps): Ec2Service { + const desiredCount = this.node.tryGetContext(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT) ? this.internalDesiredCount : this.desiredCount; + return new Ec2Service(this, 'Service', { cluster: this.cluster, - desiredCount: this.desiredCount, + desiredCount: desiredCount, taskDefinition: this.taskDefinition, assignPublicIp: false, serviceName: props.serviceName, diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/queue-processing-ecs-service.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/queue-processing-ecs-service.ts index f9d9b98810aa0..6858813dfa9cc 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/queue-processing-ecs-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/queue-processing-ecs-service.ts @@ -1,4 +1,5 @@ import { Ec2Service, Ec2TaskDefinition } from '@aws-cdk/aws-ecs'; +import * as cxapi from '@aws-cdk/cx-api'; import { Construct } from 'constructs'; import { QueueProcessingServiceBase, QueueProcessingServiceBaseProps } from '../base/queue-processing-service-base'; @@ -98,11 +99,14 @@ export class QueueProcessingEc2Service extends QueueProcessingServiceBase { logging: this.logDriver, }); + // The desiredCount should be removed from the fargate service when the feature flag is removed. + const desiredCount = this.node.tryGetContext(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT) ? undefined : this.desiredCount; + // Create an ECS service with the previously defined Task Definition and configure // autoscaling based on cpu utilization and number of messages visible in the SQS queue. this.service = new Ec2Service(this, 'QueueProcessingService', { cluster: this.cluster, - desiredCount: this.desiredCount, + desiredCount: desiredCount, taskDefinition: this.taskDefinition, serviceName: props.serviceName, minHealthyPercent: props.minHealthyPercent, @@ -111,6 +115,7 @@ export class QueueProcessingEc2Service extends QueueProcessingServiceBase { enableECSManagedTags: props.enableECSManagedTags, deploymentController: props.deploymentController, }); + this.configureAutoscalingForService(this.service); this.grantPermissionsToService(this.service); } diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-load-balanced-fargate-service.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-load-balanced-fargate-service.ts index 2ae468bcae558..fbb68aef84b2f 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-load-balanced-fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-load-balanced-fargate-service.ts @@ -1,5 +1,6 @@ import { ISecurityGroup, SubnetSelection } from '@aws-cdk/aws-ec2'; import { FargatePlatformVersion, FargateService, FargateTaskDefinition } from '@aws-cdk/aws-ecs'; +import * as cxapi from '@aws-cdk/cx-api'; import { Construct } from 'constructs'; import { ApplicationLoadBalancedServiceBase, ApplicationLoadBalancedServiceBaseProps } from '../base/application-load-balanced-service-base'; @@ -153,9 +154,11 @@ export class ApplicationLoadBalancedFargateService extends ApplicationLoadBalanc throw new Error('You must specify one of: taskDefinition or image'); } + const desiredCount = this.node.tryGetContext(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT) ? this.internalDesiredCount : this.desiredCount; + this.service = new FargateService(this, 'Service', { cluster: this.cluster, - desiredCount: this.desiredCount, + desiredCount: desiredCount, taskDefinition: this.taskDefinition, assignPublicIp: this.assignPublicIp, serviceName: props.serviceName, diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-multiple-target-groups-fargate-service.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-multiple-target-groups-fargate-service.ts index 495049dfccfa8..6759e8e001376 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-multiple-target-groups-fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-multiple-target-groups-fargate-service.ts @@ -1,5 +1,6 @@ import { FargatePlatformVersion, FargateService, FargateTaskDefinition } from '@aws-cdk/aws-ecs'; import { ApplicationTargetGroup } from '@aws-cdk/aws-elasticloadbalancingv2'; +import * as cxapi from '@aws-cdk/cx-api'; import { Construct } from 'constructs'; import { ApplicationMultipleTargetGroupsServiceBase, @@ -168,9 +169,11 @@ export class ApplicationMultipleTargetGroupsFargateService extends ApplicationMu } private createFargateService(props: ApplicationMultipleTargetGroupsFargateServiceProps): FargateService { + const desiredCount = this.node.tryGetContext(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT) ? this.internalDesiredCount : this.desiredCount; + return new FargateService(this, 'Service', { cluster: this.cluster, - desiredCount: this.desiredCount, + desiredCount: desiredCount, taskDefinition: this.taskDefinition, assignPublicIp: this.assignPublicIp, serviceName: props.serviceName, diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/network-load-balanced-fargate-service.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/network-load-balanced-fargate-service.ts index 4aad4b31e7efe..404d5429acfed 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/network-load-balanced-fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/network-load-balanced-fargate-service.ts @@ -1,5 +1,6 @@ import { SubnetSelection } from '@aws-cdk/aws-ec2'; import { FargatePlatformVersion, FargateService, FargateTaskDefinition } from '@aws-cdk/aws-ecs'; +import * as cxapi from '@aws-cdk/cx-api'; import { Construct } from 'constructs'; import { NetworkLoadBalancedServiceBase, NetworkLoadBalancedServiceBaseProps } from '../base/network-load-balanced-service-base'; @@ -140,9 +141,11 @@ export class NetworkLoadBalancedFargateService extends NetworkLoadBalancedServic throw new Error('You must specify one of: taskDefinition or image'); } + const desiredCount = this.node.tryGetContext(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT) ? this.internalDesiredCount : this.desiredCount; + this.service = new FargateService(this, 'Service', { cluster: this.cluster, - desiredCount: this.desiredCount, + desiredCount: desiredCount, taskDefinition: this.taskDefinition, assignPublicIp: this.assignPublicIp, serviceName: props.serviceName, diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/network-multiple-target-groups-fargate-service.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/network-multiple-target-groups-fargate-service.ts index dab033b1938ce..4a4974af7cce3 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/network-multiple-target-groups-fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/network-multiple-target-groups-fargate-service.ts @@ -1,5 +1,6 @@ import { FargatePlatformVersion, FargateService, FargateTaskDefinition } from '@aws-cdk/aws-ecs'; import { NetworkTargetGroup } from '@aws-cdk/aws-elasticloadbalancingv2'; +import * as cxapi from '@aws-cdk/cx-api'; import { Construct } from 'constructs'; import { NetworkMultipleTargetGroupsServiceBase, @@ -168,9 +169,11 @@ export class NetworkMultipleTargetGroupsFargateService extends NetworkMultipleTa } private createFargateService(props: NetworkMultipleTargetGroupsFargateServiceProps): FargateService { + const desiredCount = this.node.tryGetContext(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT) ? this.internalDesiredCount : this.desiredCount; + return new FargateService(this, 'Service', { cluster: this.cluster, - desiredCount: this.desiredCount, + desiredCount: desiredCount, taskDefinition: this.taskDefinition, assignPublicIp: this.assignPublicIp, serviceName: props.serviceName, diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts index e3712b00ae4b1..6444d05f81da6 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts @@ -1,5 +1,6 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import { FargatePlatformVersion, FargateService, FargateTaskDefinition } from '@aws-cdk/aws-ecs'; +import * as cxapi from '@aws-cdk/cx-api'; import { Construct } from 'constructs'; import { QueueProcessingServiceBase, QueueProcessingServiceBaseProps } from '../base/queue-processing-service-base'; @@ -128,11 +129,14 @@ export class QueueProcessingFargateService extends QueueProcessingServiceBase { logging: this.logDriver, }); + // The desiredCount should be removed from the fargate service when the feature flag is removed. + const desiredCount = this.node.tryGetContext(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT) ? undefined : this.desiredCount; + // Create a Fargate service with the previously defined Task Definition and configure // autoscaling based on cpu utilization and number of messages visible in the SQS queue. this.service = new FargateService(this, 'QueueProcessingFargateService', { cluster: this.cluster, - desiredCount: this.desiredCount, + desiredCount: desiredCount, taskDefinition: this.taskDefinition, serviceName: props.serviceName, minHealthyPercent: props.minHealthyPercent, @@ -145,6 +149,7 @@ export class QueueProcessingFargateService extends QueueProcessingServiceBase { vpcSubnets: props.taskSubnets, assignPublicIp: props.assignPublicIp, }); + this.configureAutoscalingForService(this.service); this.grantPermissionsToService(this.service); } diff --git a/packages/@aws-cdk/aws-ecs-patterns/package.json b/packages/@aws-cdk/aws-ecs-patterns/package.json index bc2a816cd6b11..dcb4d8b436bda 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/package.json +++ b/packages/@aws-cdk/aws-ecs-patterns/package.json @@ -86,6 +86,7 @@ "@aws-cdk/aws-servicediscovery": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", + "@aws-cdk/cx-api": "0.0.0", "constructs": "^3.2.0" }, "homepage": "https://github.com/aws/aws-cdk", @@ -103,6 +104,7 @@ "@aws-cdk/aws-servicediscovery": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", + "@aws-cdk/cx-api": "0.0.0", "constructs": "^3.2.0" }, "engines": { diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/integ.multiple-application-load-balanced-ecs-service.expected.json b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/integ.multiple-application-load-balanced-ecs-service.expected.json index 147a8bc8a7bfb..ec9686e054019 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/integ.multiple-application-load-balanced-ecs-service.expected.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/integ.multiple-application-load-balanced-ecs-service.expected.json @@ -719,14 +719,12 @@ "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(event))\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(event))\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 while has_tasks(cluster, instance_arn):\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\n\ndef has_tasks(cluster, instance_arn):\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 tasks = instance['runningTasksCount'] + instance['pendingTasksCount']\n print('Instance %s has %s tasks' % (instance_arn, tasks))\n\n return tasks > 0\n\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" }, - "Handler": "index.lambda_handler", "Role": { "Fn::GetAtt": [ "ClusterDefaultAutoScalingGroupDrainECSHookFunctionServiceRole2AC250B1", "Arn" ] }, - "Runtime": "python3.6", "Environment": { "Variables": { "CLUSTER": { @@ -734,6 +732,8 @@ } } }, + "Handler": "index.lambda_handler", + "Runtime": "python3.6", "Tags": [ { "Key": "Name", @@ -1128,7 +1128,6 @@ "MaximumPercent": 200, "MinimumHealthyPercent": 50 }, - "DesiredCount": 1, "EnableECSManagedTags": false, "HealthCheckGracePeriodSeconds": 60, "LaunchType": "EC2", diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/integ.scheduled-ecs-task.lit.expected.json b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/integ.scheduled-ecs-task.lit.expected.json index 5d4345573b0c5..53c05f9aeba8e 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/integ.scheduled-ecs-task.lit.expected.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/integ.scheduled-ecs-task.lit.expected.json @@ -536,14 +536,12 @@ "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(event))\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(event))\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 while has_tasks(cluster, instance_arn):\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\n\ndef has_tasks(cluster, instance_arn):\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 tasks = instance['runningTasksCount'] + instance['pendingTasksCount']\n print('Instance %s has %s tasks' % (instance_arn, tasks))\n\n return tasks > 0\n\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" }, - "Handler": "index.lambda_handler", "Role": { "Fn::GetAtt": [ "EcsClusterDefaultAutoScalingGroupDrainECSHookFunctionServiceRole94543EDA", "Arn" ] }, - "Runtime": "python3.6", "Environment": { "Variables": { "CLUSTER": { @@ -551,6 +549,8 @@ } } }, + "Handler": "index.lambda_handler", + "Runtime": "python3.6", "Tags": [ { "Key": "Name", diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.l3s.ts b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.l3s.ts index 959a6348fde11..6f5a4aa0b3337 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.l3s.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.l3s.ts @@ -1,4 +1,4 @@ -import { arrayWith, expect, haveResource, haveResourceLike, objectLike } from '@aws-cdk/assert'; +import { ABSENT, arrayWith, expect, haveResource, haveResourceLike, objectLike } from '@aws-cdk/assert'; import { Certificate } from '@aws-cdk/aws-certificatemanager'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as ecs from '@aws-cdk/aws-ecs'; @@ -6,6 +6,7 @@ import { ApplicationLoadBalancer, ApplicationProtocol, NetworkLoadBalancer } fro import { PublicHostedZone } from '@aws-cdk/aws-route53'; import * as cloudmap from '@aws-cdk/aws-servicediscovery'; import * as cdk from '@aws-cdk/core'; +import * as cxapi from '@aws-cdk/cx-api'; import { Test } from 'nodeunit'; import * as ecsPatterns from '../../lib'; @@ -60,6 +61,102 @@ export = { test.done(); }, + 'ApplicationLoadBalancedEc2Service desiredCount can be undefined when feature flag is set'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + stack.node.setContext(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT, true); + + const vpc = new ec2.Vpc(stack, 'VPC'); + const cluster = new ecs.Cluster(stack, 'Cluster', { vpc }); + cluster.addCapacity('DefaultAutoScalingGroup', { instanceType: new ec2.InstanceType('t2.micro') }); + + // WHEN + new ecsPatterns.ApplicationLoadBalancedEc2Service(stack, 'Service', { + cluster, + memoryLimitMiB: 1024, + taskImageOptions: { + image: ecs.ContainerImage.fromRegistry('test'), + }, + }); + + expect(stack).to(haveResource('AWS::ECS::Service', { + DesiredCount: ABSENT, + })); + + test.done(); + }, + + 'ApplicationLoadBalancedFargateService desiredCount can be undefined when feature flag is set'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + stack.node.setContext(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT, true); + + const vpc = new ec2.Vpc(stack, 'VPC'); + const cluster = new ecs.Cluster(stack, 'Cluster', { vpc }); + + // WHEN + new ecsPatterns.ApplicationLoadBalancedFargateService(stack, 'Service', { + cluster, + taskImageOptions: { + image: ecs.ContainerImage.fromRegistry('test'), + }, + }); + + expect(stack).to(haveResource('AWS::ECS::Service', { + DesiredCount: ABSENT, + })); + + test.done(); + }, + + 'NetworkLoadBalancedEc2Service desiredCount can be undefined when feature flag is set'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + stack.node.setContext(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT, true); + + const vpc = new ec2.Vpc(stack, 'VPC'); + const cluster = new ecs.Cluster(stack, 'Cluster', { vpc }); + cluster.addCapacity('DefaultAutoScalingGroup', { instanceType: new ec2.InstanceType('t2.micro') }); + + // WHEN + new ecsPatterns.NetworkLoadBalancedEc2Service(stack, 'Service', { + cluster, + memoryLimitMiB: 1024, + taskImageOptions: { + image: ecs.ContainerImage.fromRegistry('test'), + }, + }); + + expect(stack).to(haveResource('AWS::ECS::Service', { + DesiredCount: ABSENT, + })); + + test.done(); + }, + + 'NetworkLoadBalancedFargateService desiredCount can be undefined when feature flag is set'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + stack.node.setContext(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT, true); + + const vpc = new ec2.Vpc(stack, 'VPC'); + const cluster = new ecs.Cluster(stack, 'Cluster', { vpc }); + + // WHEN + new ecsPatterns.NetworkLoadBalancedFargateService(stack, 'Service', { + cluster, + taskImageOptions: { + image: ecs.ContainerImage.fromRegistry('test'), + }, + }); + + expect(stack).to(haveResource('AWS::ECS::Service', { + DesiredCount: ABSENT, + })); + + test.done(); + }, + 'set vpc instead of cluster'(test: Test) { // GIVEN const stack = new cdk.Stack(); diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.queue-processing-ecs-service.ts b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.queue-processing-ecs-service.ts index d449cc27db2c4..2c410f6581b1e 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.queue-processing-ecs-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.queue-processing-ecs-service.ts @@ -1,8 +1,9 @@ -import { expect, haveResource, haveResourceLike } from '@aws-cdk/assert'; +import { ABSENT, expect, haveResource, haveResourceLike } from '@aws-cdk/assert'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as ecs from '@aws-cdk/aws-ecs'; import * as sqs from '@aws-cdk/aws-sqs'; import * as cdk from '@aws-cdk/core'; +import * as cxapi from '@aws-cdk/cx-api'; import { Test } from 'nodeunit'; import * as ecsPatterns from '../../lib'; @@ -80,6 +81,31 @@ export = { test.done(); }, + 'test ECS queue worker service construct - with remove default desiredCount feature flag'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + stack.node.setContext(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT, true); + + const vpc = new ec2.Vpc(stack, 'VPC'); + const cluster = new ecs.Cluster(stack, 'Cluster', { vpc }); + cluster.addCapacity('DefaultAutoScalingGroup', { instanceType: new ec2.InstanceType('t2.micro') }); + + // WHEN + new ecsPatterns.QueueProcessingEc2Service(stack, 'Service', { + cluster, + memoryLimitMiB: 512, + image: ecs.ContainerImage.fromRegistry('test'), + }); + + // THEN - QueueWorker is of EC2 launch type, and desiredCount is not defined on the Ec2Service. + expect(stack).to(haveResource('AWS::ECS::Service', { + DesiredCount: ABSENT, + LaunchType: 'EC2', + })); + + test.done(); + }, + 'test ECS queue worker service construct - with optional props for queues'(test: Test) { // GIVEN const stack = new cdk.Stack(); diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.asset-image.expected.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.asset-image.expected.json index 364f0a27d8b15..4fdde5753fdf6 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.asset-image.expected.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.asset-image.expected.json @@ -637,7 +637,6 @@ "MaximumPercent": 200, "MinimumHealthyPercent": 50 }, - "DesiredCount": 1, "EnableECSManagedTags": false, "HealthCheckGracePeriodSeconds": 60, "LaunchType": "FARGATE", @@ -752,4 +751,4 @@ } } } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.executionrole.expected.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.executionrole.expected.json index 2d70c2c40cae2..93c7a7307a6ee 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.executionrole.expected.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.executionrole.expected.json @@ -589,7 +589,6 @@ "MaximumPercent": 200, "MinimumHealthyPercent": 50 }, - "DesiredCount": 1, "EnableECSManagedTags": false, "HealthCheckGracePeriodSeconds": 60, "LaunchType": "FARGATE", diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.l3-autocreate.expected.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.l3-autocreate.expected.json index 84a73622ee2d8..5813cd78e41f3 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.l3-autocreate.expected.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.l3-autocreate.expected.json @@ -228,7 +228,6 @@ "MaximumPercent": 200, "MinimumHealthyPercent": 50 }, - "DesiredCount": 1, "EnableECSManagedTags": false, "HealthCheckGracePeriodSeconds": 60, "LaunchType": "FARGATE", @@ -894,7 +893,6 @@ "MaximumPercent": 200, "MinimumHealthyPercent": 50 }, - "DesiredCount": 1, "EnableECSManagedTags": false, "HealthCheckGracePeriodSeconds": 60, "LaunchType": "FARGATE", diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.l3-vpconly.expected.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.l3-vpconly.expected.json index c549746d8769e..5556df70a59b7 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.l3-vpconly.expected.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.l3-vpconly.expected.json @@ -583,7 +583,6 @@ "MaximumPercent": 200, "MinimumHealthyPercent": 50 }, - "DesiredCount": 1, "EnableECSManagedTags": false, "HealthCheckGracePeriodSeconds": 60, "LaunchType": "FARGATE", @@ -1249,7 +1248,6 @@ "MaximumPercent": 200, "MinimumHealthyPercent": 50 }, - "DesiredCount": 1, "EnableECSManagedTags": false, "HealthCheckGracePeriodSeconds": 60, "LaunchType": "FARGATE", @@ -1560,7 +1558,6 @@ "MaximumPercent": 200, "MinimumHealthyPercent": 50 }, - "DesiredCount": 1, "EnableECSManagedTags": false, "HealthCheckGracePeriodSeconds": 60, "LaunchType": "FARGATE", diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.l3.expected.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.l3.expected.json index c79a622e159a9..40d86be5d331b 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.l3.expected.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.l3.expected.json @@ -586,7 +586,6 @@ "MaximumPercent": 200, "MinimumHealthyPercent": 50 }, - "DesiredCount": 1, "EnableECSManagedTags": false, "HealthCheckGracePeriodSeconds": 60, "LaunchType": "FARGATE", diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.load-balanced-fargate-service.expected.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.load-balanced-fargate-service.expected.json index 532377e2accdd..1d670f79f58a6 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.load-balanced-fargate-service.expected.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.load-balanced-fargate-service.expected.json @@ -664,7 +664,6 @@ "MaximumPercent": 200, "MinimumHealthyPercent": 50 }, - "DesiredCount": 1, "EnableECSManagedTags": true, "HealthCheckGracePeriodSeconds": 60, "LaunchType": "FARGATE", diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.multiple-network-load-balanced-fargate-service.expected.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.multiple-network-load-balanced-fargate-service.expected.json index 815cfe99b94f6..2cdd6991792e8 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.multiple-network-load-balanced-fargate-service.expected.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.multiple-network-load-balanced-fargate-service.expected.json @@ -597,7 +597,6 @@ "MaximumPercent": 200, "MinimumHealthyPercent": 50 }, - "DesiredCount": 1, "EnableECSManagedTags": false, "HealthCheckGracePeriodSeconds": 60, "LaunchType": "FARGATE", diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.queue-processing-fargate-service-isolated.expected.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.queue-processing-fargate-service-isolated.expected.json index b1d88ed107154..6124fba473584 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.queue-processing-fargate-service-isolated.expected.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.queue-processing-fargate-service-isolated.expected.json @@ -903,7 +903,6 @@ "MaximumPercent": 200, "MinimumHealthyPercent": 50 }, - "DesiredCount": 1, "EnableECSManagedTags": false, "LaunchType": "FARGATE", "NetworkConfiguration": { diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.queue-processing-fargate-service-public.expected.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.queue-processing-fargate-service-public.expected.json index fd8f791e3a868..de873260aa209 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.queue-processing-fargate-service-public.expected.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.queue-processing-fargate-service-public.expected.json @@ -753,7 +753,6 @@ "MaximumPercent": 200, "MinimumHealthyPercent": 50 }, - "DesiredCount": 1, "EnableECSManagedTags": false, "LaunchType": "FARGATE", "NetworkConfiguration": { diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.queue-processing-fargate-service.expected.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.queue-processing-fargate-service.expected.json index 889eeefcd985e..6fbcb79ecfa00 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.queue-processing-fargate-service.expected.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.queue-processing-fargate-service.expected.json @@ -594,7 +594,6 @@ "MaximumPercent": 200, "MinimumHealthyPercent": 50 }, - "DesiredCount": 1, "EnableECSManagedTags": false, "LaunchType": "FARGATE", "NetworkConfiguration": { diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.special-listener.expected.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.special-listener.expected.json index 76e5e6a13aaf7..5075f6511573b 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.special-listener.expected.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.special-listener.expected.json @@ -539,7 +539,6 @@ "MaximumPercent": 200, "MinimumHealthyPercent": 50 }, - "DesiredCount": 1, "EnableECSManagedTags": false, "HealthCheckGracePeriodSeconds": 60, "LaunchType": "FARGATE", @@ -826,7 +825,6 @@ "MaximumPercent": 200, "MinimumHealthyPercent": 50 }, - "DesiredCount": 1, "EnableECSManagedTags": false, "HealthCheckGracePeriodSeconds": 60, "LaunchType": "FARGATE", diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.queue-processing-fargate-service.ts b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.queue-processing-fargate-service.ts index 9d2d5dd0747a6..27671ae22e70d 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.queue-processing-fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.queue-processing-fargate-service.ts @@ -1,8 +1,9 @@ -import { expect, haveResource, haveResourceLike } from '@aws-cdk/assert'; +import { ABSENT, expect, haveResource, haveResourceLike } from '@aws-cdk/assert'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as ecs from '@aws-cdk/aws-ecs'; import * as sqs from '@aws-cdk/aws-sqs'; import * as cdk from '@aws-cdk/core'; +import * as cxapi from '@aws-cdk/cx-api'; import { Test } from 'nodeunit'; import * as ecsPatterns from '../../lib'; @@ -102,6 +103,30 @@ export = { test.done(); }, + 'test fargate queue worker service construct - with remove default desiredCount feature flag'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + stack.node.setContext(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT, true); + + const vpc = new ec2.Vpc(stack, 'VPC'); + const cluster = new ecs.Cluster(stack, 'Cluster', { vpc }); + + // WHEN + new ecsPatterns.QueueProcessingFargateService(stack, 'Service', { + cluster, + memoryLimitMiB: 512, + image: ecs.ContainerImage.fromRegistry('test'), + }); + + // THEN - QueueWorker is of FARGATE launch type, and desiredCount is not defined on the FargateService. + expect(stack).to(haveResource('AWS::ECS::Service', { + DesiredCount: ABSENT, + LaunchType: 'FARGATE', + })); + + test.done(); + }, + 'test fargate queue worker service construct - with optional props for queues'(test: Test) { // GIVEN const stack = new cdk.Stack(); @@ -199,6 +224,97 @@ export = { test.done(); }, + 'test Fargate queue worker service construct - without desiredCount specified'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'VPC'); + const cluster = new ecs.Cluster(stack, 'Cluster', { vpc }); + cluster.addCapacity('DefaultAutoScalingGroup', { instanceType: new ec2.InstanceType('t2.micro') }); + const queue = new sqs.Queue(stack, 'fargate-test-queue', { + queueName: 'fargate-test-sqs-queue', + }); + + // WHEN + new ecsPatterns.QueueProcessingFargateService(stack, 'Service', { + cluster, + memoryLimitMiB: 512, + image: ecs.ContainerImage.fromRegistry('test'), + command: ['-c', '4', 'amazon.com'], + enableLogging: false, + environment: { + TEST_ENVIRONMENT_VARIABLE1: 'test environment variable 1 value', + TEST_ENVIRONMENT_VARIABLE2: 'test environment variable 2 value', + }, + queue, + maxScalingCapacity: 5, + minScalingCapacity: 2, + minHealthyPercent: 60, + maxHealthyPercent: 150, + serviceName: 'fargate-test-service', + family: 'fargate-task-family', + platformVersion: ecs.FargatePlatformVersion.VERSION1_4, + deploymentController: { + type: ecs.DeploymentControllerType.CODE_DEPLOY, + }, + }); + + // THEN - QueueWorker is of FARGATE launch type, an SQS queue is created and all optional properties are set. + expect(stack).to(haveResource('AWS::ECS::Service', { + DeploymentConfiguration: { + MinimumHealthyPercent: 60, + MaximumPercent: 150, + }, + LaunchType: 'FARGATE', + ServiceName: 'fargate-test-service', + PlatformVersion: ecs.FargatePlatformVersion.VERSION1_4, + DeploymentController: { + Type: 'CODE_DEPLOY', + }, + })); + + expect(stack).to(haveResource('AWS::ApplicationAutoScaling::ScalableTarget', { + MaxCapacity: 5, + MinCapacity: 2, + })); + + expect(stack).to(haveResource('AWS::SQS::Queue', { QueueName: 'fargate-test-sqs-queue' })); + + expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + ContainerDefinitions: [ + { + Command: [ + '-c', + '4', + 'amazon.com', + ], + Environment: [ + { + Name: 'TEST_ENVIRONMENT_VARIABLE1', + Value: 'test environment variable 1 value', + }, + { + Name: 'TEST_ENVIRONMENT_VARIABLE2', + Value: 'test environment variable 2 value', + }, + { + Name: 'QUEUE_NAME', + Value: { + 'Fn::GetAtt': [ + 'fargatetestqueue28B43841', + 'QueueName', + ], + }, + }, + ], + Image: 'test', + }, + ], + Family: 'fargate-task-family', + })); + + test.done(); + }, + 'test Fargate queue worker service construct - with optional props'(test: Test) { // GIVEN const stack = new cdk.Stack(); diff --git a/packages/@aws-cdk/cx-api/lib/features.ts b/packages/@aws-cdk/cx-api/lib/features.ts index 24ba471882644..162ec0de9d7f4 100644 --- a/packages/@aws-cdk/cx-api/lib/features.ts +++ b/packages/@aws-cdk/cx-api/lib/features.ts @@ -89,6 +89,21 @@ export const KMS_DEFAULT_KEY_POLICIES = '@aws-cdk/aws-kms:defaultKeyPolicies'; */ export const S3_GRANT_WRITE_WITHOUT_ACL = '@aws-cdk/aws-s3:grantWriteWithoutAcl'; +/** + * ApplicationLoadBalancedServiceBase, ApplicationMultipleTargetGroupServiceBase, + * NetworkLoadBalancedServiceBase, NetworkMultipleTargetGroupServiceBase, and + * QueueProcessingServiceBase currently determine a default value for the desired count of + * a CfnService if a desiredCount is not provided. + * + * If this flag is not set, the default behaviour for CfnService.desiredCount is to set a + * desiredCount of 1, if one is not provided. If true, a default will not be defined for + * CfnService.desiredCount and as such desiredCount will be undefined, if one is not provided. + * + * This is a feature flag as the old behavior was technically incorrect, but + * users may have come to depend on it. + */ +export const ECS_REMOVE_DEFAULT_DESIRED_COUNT = '@aws-cdk/aws-ecs-patterns:removeDefaultDesiredCount'; + /** * This map includes context keys and values for feature flags that enable * capabilities "from the future", which we could not introduce as the default @@ -110,6 +125,7 @@ export const FUTURE_FLAGS: { [key: string]: any } = { [SECRETS_MANAGER_PARSE_OWNED_SECRET_NAME]: true, [KMS_DEFAULT_KEY_POLICIES]: true, [S3_GRANT_WRITE_WITHOUT_ACL]: true, + [ECS_REMOVE_DEFAULT_DESIRED_COUNT]: true, // We will advertise this flag when the feature is complete // [NEW_STYLE_STACK_SYNTHESIS_CONTEXT]: 'true', @@ -135,6 +151,7 @@ const FUTURE_FLAGS_DEFAULTS: { [key: string]: boolean } = { [SECRETS_MANAGER_PARSE_OWNED_SECRET_NAME]: false, [KMS_DEFAULT_KEY_POLICIES]: false, [S3_GRANT_WRITE_WITHOUT_ACL]: false, + [ECS_REMOVE_DEFAULT_DESIRED_COUNT]: false, }; export function futureFlagDefault(flag: string): boolean { From 09723f58ed3034fc2cb46316e6d798cb8f2bf96e Mon Sep 17 00:00:00 2001 From: Jonathan Goldwasser Date: Thu, 25 Feb 2021 08:06:37 +0100 Subject: [PATCH 20/78] fix(lambda-nodejs): 'must use "outdir"' error with spaces in paths (#13268) Closes #13210 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../aws-lambda-nodejs/lib/bundling.ts | 2 +- .../aws-lambda-nodejs/test/bundling.test.ts | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-lambda-nodejs/lib/bundling.ts b/packages/@aws-cdk/aws-lambda-nodejs/lib/bundling.ts index a6dcddde7709d..5051fc9012ada 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/lib/bundling.ts +++ b/packages/@aws-cdk/aws-lambda-nodejs/lib/bundling.ts @@ -140,7 +140,7 @@ export class Bundling implements cdk.BundlingOptions { const esbuildCommand: string = [ npx, 'esbuild', - '--bundle', pathJoin(inputDir, this.relativeEntryPath), + '--bundle', pathJoin(inputDir, this.relativeEntryPath).replace(/(\s+)/g, '\\$1'), `--target=${this.props.target ?? toTarget(this.props.runtime)}`, '--platform=node', `--outfile=${pathJoin(outputDir, 'index.js')}`, diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/bundling.test.ts b/packages/@aws-cdk/aws-lambda-nodejs/test/bundling.test.ts index bd69394ae757c..2f96c10ff78ed 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/bundling.test.ts +++ b/packages/@aws-cdk/aws-lambda-nodejs/test/bundling.test.ts @@ -334,3 +334,23 @@ test('with command hooks', () => { }), }); }); + +test('escapes spaces in path', () => { + Bundling.bundle({ + entry: '/project/lib/my cool lambda/handler.ts', + depsLockFilePath, + runtime: Runtime.NODEJS_12_X, + forceDockerBundling: true, + }); + + // Correctly bundles with esbuild + expect(Code.fromAsset).toHaveBeenCalledWith(path.dirname(depsLockFilePath), { + assetHashType: AssetHashType.OUTPUT, + bundling: expect.objectContaining({ + command: [ + 'bash', '-c', + expect.stringContaining('lib/my\\ cool\\ lambda/handler.ts'), + ], + }), + }); +}); From 778ea2759a8a4504dc232eb6b1d77a38f8ee7aef Mon Sep 17 00:00:00 2001 From: Masaharu Komuro Date: Thu, 25 Feb 2021 21:51:36 +0900 Subject: [PATCH 21/78] feat(lambda): code signing config (#12656) closes #12216 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-lambda/README.md | 24 +++ .../aws-lambda/lib/code-signing-config.ts | 120 ++++++++++++ packages/@aws-cdk/aws-lambda/lib/function.ts | 9 + packages/@aws-cdk/aws-lambda/lib/index.ts | 1 + packages/@aws-cdk/aws-lambda/package.json | 5 +- .../test/code-signing-config.test.ts | 102 ++++++++++ .../@aws-cdk/aws-lambda/test/function.test.ts | 31 +++ packages/@aws-cdk/aws-signer/README.md | 47 ++++- packages/@aws-cdk/aws-signer/lib/index.ts | 1 + .../aws-signer/lib/signing-profile.ts | 178 ++++++++++++++++++ packages/@aws-cdk/aws-signer/package.json | 8 +- .../@aws-cdk/aws-signer/test/signer.test.ts | 6 - .../aws-signer/test/signing-profile.test.ts | 115 +++++++++++ 13 files changed, 635 insertions(+), 12 deletions(-) create mode 100644 packages/@aws-cdk/aws-lambda/lib/code-signing-config.ts create mode 100644 packages/@aws-cdk/aws-lambda/test/code-signing-config.test.ts create mode 100644 packages/@aws-cdk/aws-signer/lib/signing-profile.ts delete mode 100644 packages/@aws-cdk/aws-signer/test/signer.test.ts create mode 100644 packages/@aws-cdk/aws-signer/test/signing-profile.test.ts diff --git a/packages/@aws-cdk/aws-lambda/README.md b/packages/@aws-cdk/aws-lambda/README.md index b3fb466ec7253..569569f526736 100644 --- a/packages/@aws-cdk/aws-lambda/README.md +++ b/packages/@aws-cdk/aws-lambda/README.md @@ -489,3 +489,27 @@ Language-specific higher level constructs are provided in separate modules: * `@aws-cdk/aws-lambda-nodejs`: [Github](https://github.com/aws/aws-cdk/tree/master/packages/%40aws-cdk/aws-lambda-nodejs) & [CDK Docs](https://docs.aws.amazon.com/cdk/api/latest/docs/aws-lambda-nodejs-readme.html) * `@aws-cdk/aws-lambda-python`: [Github](https://github.com/aws/aws-cdk/tree/master/packages/%40aws-cdk/aws-lambda-python) & [CDK Docs](https://docs.aws.amazon.com/cdk/api/latest/docs/aws-lambda-python-readme.html) + +## Code Signing + +Code signing for AWS Lambda helps to ensure that only trusted code runs in your Lambda functions. +When enabled, AWS Lambda checks every code deployment and verifies that the code package is signed by a trusted source. +For more information, see [Configuring code signing for AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html). +The following code configures a function with code signing. + +```typescript +import * as signer from '@aws-cdk/aws-signer'; + +const signerProfile = signer.SigningProfile(this, 'SigningProfile', { + platform: Platform.AWS_LAMBDA_SHA384_ECDSA +}); + +const codeSigningConfig = new lambda.CodeSigningConfig(stack, 'CodeSigningConfig', { + signingProfiles: [signingProfile], +}); + +new lambda.Function(this, 'Function', { + codeSigningConfig, + // ... +}); +``` diff --git a/packages/@aws-cdk/aws-lambda/lib/code-signing-config.ts b/packages/@aws-cdk/aws-lambda/lib/code-signing-config.ts new file mode 100644 index 0000000000000..0472eb5d048f5 --- /dev/null +++ b/packages/@aws-cdk/aws-lambda/lib/code-signing-config.ts @@ -0,0 +1,120 @@ +import { ISigningProfile } from '@aws-cdk/aws-signer'; +import { IResource, Resource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; +import { CfnCodeSigningConfig } from './lambda.generated'; + +/** + * Code signing configuration policy for deployment validation failure. + */ +export enum UntrustedArtifactOnDeployment { + /** + * Lambda blocks the deployment request if signature validation checks fail. + */ + ENFORCE = 'enforce', + + /** + * Lambda allows the deployment of the code package, but issues a warning. + * Lambda issues a new Amazon CloudWatch metric, called a signature validation error and also stores the warning in CloudTrail. + */ + WARN = 'warn', +} + +/** + * A Code Signing Config + */ +export interface ICodeSigningConfig extends IResource { + /** + * The ARN of Code Signing Config + * @attribute + */ + readonly codeSigningConfigArn: string; + + /** + * The id of Code Signing Config + * @attribute + */ + readonly codeSigningConfigId: string; +} + +/** + * Construction properties for a Code Signing Config object + */ +export interface CodeSigningConfigProps { + /** + * List of signing profiles that defines a + * trusted user who can sign a code package. + */ + readonly signingProfiles: ISigningProfile[], + + /** + * Code signing configuration policy for deployment validation failure. + * If you set the policy to Enforce, Lambda blocks the deployment request + * if signature validation checks fail. + * If you set the policy to Warn, Lambda allows the deployment and + * creates a CloudWatch log. + * + * @default UntrustedArtifactOnDeployment.WARN + */ + readonly untrustedArtifactOnDeployment?: UntrustedArtifactOnDeployment, + + /** + * Code signing configuration description. + * + * @default - No description. + */ + readonly description?: string, +} + +/** + * Defines a Code Signing Config. + * + * @resource AWS::Lambda::CodeSigningConfig + */ +export class CodeSigningConfig extends Resource implements ICodeSigningConfig { + /** + * Creates a Signing Profile construct that represents an external Signing Profile. + * + * @param scope The parent creating construct (usually `this`). + * @param id The construct's name. + * @param codeSigningConfigArn The ARN of code signing config. + */ + public static fromCodeSigningConfigArn( scope: Construct, id: string, codeSigningConfigArn: string): ICodeSigningConfig { + const codeSigningProfileId = Stack.of(scope).parseArn(codeSigningConfigArn).resourceName; + if (!codeSigningProfileId) { + throw new Error(`Code signing config ARN must be in the format 'arn:aws:lambda:::code-signing-config:', got: '${codeSigningConfigArn}'`); + } + const assertedCodeSigningProfileId = codeSigningProfileId; + class Import extends Resource implements ICodeSigningConfig { + public readonly codeSigningConfigArn = codeSigningConfigArn; + public readonly codeSigningConfigId = assertedCodeSigningProfileId; + + constructor() { + super(scope, id); + } + } + return new Import(); + } + + public readonly codeSigningConfigArn: string; + public readonly codeSigningConfigId: string; + + constructor(scope: Construct, id: string, props: CodeSigningConfigProps) { + super(scope, id); + + const signingProfileVersionArns = props.signingProfiles.map(signingProfile => { + return signingProfile.signingProfileVersionArn; + }); + + const resource: CfnCodeSigningConfig = new CfnCodeSigningConfig(this, 'Resource', { + allowedPublishers: { + signingProfileVersionArns, + }, + codeSigningPolicies: { + untrustedArtifactOnDeployment: props.untrustedArtifactOnDeployment ?? UntrustedArtifactOnDeployment.WARN, + }, + description: props.description, + }); + this.codeSigningConfigArn = resource.attrCodeSigningConfigArn; + this.codeSigningConfigId = resource.attrCodeSigningConfigId; + } +} diff --git a/packages/@aws-cdk/aws-lambda/lib/function.ts b/packages/@aws-cdk/aws-lambda/lib/function.ts index fdcf4b4e0ec24..8d487276a6176 100644 --- a/packages/@aws-cdk/aws-lambda/lib/function.ts +++ b/packages/@aws-cdk/aws-lambda/lib/function.ts @@ -8,6 +8,7 @@ import * as sqs from '@aws-cdk/aws-sqs'; import { Annotations, CfnResource, Duration, Fn, Lazy, Names, Stack } from '@aws-cdk/core'; import { Construct } from 'constructs'; import { Code, CodeConfig } from './code'; +import { ICodeSigningConfig } from './code-signing-config'; import { EventInvokeConfigOptions } from './event-invoke-config'; import { IEventSource } from './event-source'; import { FileSystem } from './filesystem'; @@ -290,6 +291,13 @@ export interface FunctionOptions extends EventInvokeConfigOptions { * @default - AWS Lambda creates and uses an AWS managed customer master key (CMK). */ readonly environmentEncryption?: kms.IKey; + + /** + * Code signing config associated with this function + * + * @default - Not Sign the Code + */ + readonly codeSigningConfig?: ICodeSigningConfig; } export interface FunctionProps extends FunctionOptions { @@ -641,6 +649,7 @@ export class Function extends FunctionBase { }), kmsKeyArn: props.environmentEncryption?.keyArn, fileSystemConfigs, + codeSigningConfigArn: props.codeSigningConfig?.codeSigningConfigArn, }); resource.node.addDependency(this.role); diff --git a/packages/@aws-cdk/aws-lambda/lib/index.ts b/packages/@aws-cdk/aws-lambda/lib/index.ts index 1ba17427c5210..2d936755d6ad1 100644 --- a/packages/@aws-cdk/aws-lambda/lib/index.ts +++ b/packages/@aws-cdk/aws-lambda/lib/index.ts @@ -16,6 +16,7 @@ export * from './event-source-mapping'; export * from './destination'; export * from './event-invoke-config'; export * from './scalable-attribute-api'; +export * from './code-signing-config'; export * from './log-retention'; diff --git a/packages/@aws-cdk/aws-lambda/package.json b/packages/@aws-cdk/aws-lambda/package.json index de51f290aa4f5..6eab5cd11b870 100644 --- a/packages/@aws-cdk/aws-lambda/package.json +++ b/packages/@aws-cdk/aws-lambda/package.json @@ -99,6 +99,7 @@ "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-s3-assets": "0.0.0", + "@aws-cdk/aws-signer": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", @@ -119,6 +120,7 @@ "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-s3-assets": "0.0.0", + "@aws-cdk/aws-signer": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", @@ -169,7 +171,8 @@ "props-default-doc:@aws-cdk/aws-lambda.Permission.sourceArn", "docs-public-apis:@aws-cdk/aws-lambda.ResourceBindOptions", "docs-public-apis:@aws-cdk/aws-lambda.VersionAttributes", - "props-physical-name:@aws-cdk/aws-lambda.EventInvokeConfigProps" + "props-physical-name:@aws-cdk/aws-lambda.EventInvokeConfigProps", + "props-physical-name:@aws-cdk/aws-lambda.CodeSigningConfigProps" ] }, "stability": "stable", diff --git a/packages/@aws-cdk/aws-lambda/test/code-signing-config.test.ts b/packages/@aws-cdk/aws-lambda/test/code-signing-config.test.ts new file mode 100644 index 0000000000000..3e123ab5d5d89 --- /dev/null +++ b/packages/@aws-cdk/aws-lambda/test/code-signing-config.test.ts @@ -0,0 +1,102 @@ +import '@aws-cdk/assert/jest'; +import * as signer from '@aws-cdk/aws-signer'; +import * as cdk from '@aws-cdk/core'; +import * as lambda from '../lib'; + +let app: cdk.App; +let stack: cdk.Stack; +beforeEach( () => { + app = new cdk.App( {} ); + stack = new cdk.Stack( app ); +} ); + +describe('code signing config', () => { + test('default', () => { + const platform = signer.Platform.AWS_LAMBDA_SHA384_ECDSA; + const signingProfile = new signer.SigningProfile(stack, 'SigningProfile', { platform }); + new lambda.CodeSigningConfig(stack, 'CodeSigningConfig', { + signingProfiles: [signingProfile], + }); + + expect(stack).toHaveResource('AWS::Lambda::CodeSigningConfig', { + AllowedPublishers: { + SigningProfileVersionArns: [{ + 'Fn::GetAtt': [ + 'SigningProfile2139A0F9', + 'ProfileVersionArn', + ], + }], + }, + CodeSigningPolicies: { + UntrustedArtifactOnDeployment: lambda.UntrustedArtifactOnDeployment.WARN, + }, + }); + }); + + test('with multiple signing profiles', () => { + const signingProfile1 = new signer.SigningProfile(stack, 'SigningProfile1', { platform: signer.Platform.AWS_LAMBDA_SHA384_ECDSA }); + const signingProfile2 = new signer.SigningProfile(stack, 'SigningProfile2', { platform: signer.Platform.AMAZON_FREE_RTOS_DEFAULT }); + const signingProfile3 = new signer.SigningProfile(stack, 'SigningProfile3', { platform: signer.Platform.AWS_IOT_DEVICE_MANAGEMENT_SHA256_ECDSA }); + new lambda.CodeSigningConfig(stack, 'CodeSigningConfig', { + signingProfiles: [signingProfile1, signingProfile2, signingProfile3], + }); + + expect(stack).toHaveResource('AWS::Lambda::CodeSigningConfig', { + AllowedPublishers: { + SigningProfileVersionArns: [ + { + 'Fn::GetAtt': [ + 'SigningProfile1D4191686', + 'ProfileVersionArn', + ], + }, + { + 'Fn::GetAtt': [ + 'SigningProfile2E013C934', + 'ProfileVersionArn', + ], + }, + { + 'Fn::GetAtt': [ + 'SigningProfile3A38DE231', + 'ProfileVersionArn', + ], + }, + ], + }, + }); + }); + + test('with description and with untrustedArtifactOnDeployment of "ENFORCE"', () => { + const platform = signer.Platform.AWS_LAMBDA_SHA384_ECDSA; + const signingProfile = new signer.SigningProfile(stack, 'SigningProfile', { platform }); + new lambda.CodeSigningConfig(stack, 'CodeSigningConfig', { + signingProfiles: [signingProfile], + untrustedArtifactOnDeployment: lambda.UntrustedArtifactOnDeployment.ENFORCE, + description: 'test description', + }); + + expect(stack).toHaveResource('AWS::Lambda::CodeSigningConfig', { + CodeSigningPolicies: { + UntrustedArtifactOnDeployment: lambda.UntrustedArtifactOnDeployment.ENFORCE, + }, + Description: 'test description', + }); + }); + + test('import does not create any resources', () => { + const codeSigningConfigId = 'aaa-xxxxxxxxxx'; + const codeSigningConfigArn = `arn:aws:lambda:::code-signing-config:${codeSigningConfigId}`; + const codeSigningConfig = lambda.CodeSigningConfig.fromCodeSigningConfigArn(stack, 'Imported', codeSigningConfigArn ); + + expect(codeSigningConfig.codeSigningConfigArn).toBe(codeSigningConfigArn); + expect(codeSigningConfig.codeSigningConfigId).toBe(codeSigningConfigId); + expect(stack).toCountResources('AWS::Lambda::CodeSigningConfig', 0); + }); + + test('fail import with malformed code signing config arn', () => { + const codeSigningConfigArn = 'arn:aws:lambda:::code-signing-config'; + + expect(() => lambda.CodeSigningConfig.fromCodeSigningConfigArn(stack, 'Imported', codeSigningConfigArn ) ).toThrow(/ARN must be in the format/); + }); +}); diff --git a/packages/@aws-cdk/aws-lambda/test/function.test.ts b/packages/@aws-cdk/aws-lambda/test/function.test.ts index 51cfe70fd878c..50cf6b0c9b72b 100644 --- a/packages/@aws-cdk/aws-lambda/test/function.test.ts +++ b/packages/@aws-cdk/aws-lambda/test/function.test.ts @@ -9,6 +9,7 @@ import * as kms from '@aws-cdk/aws-kms'; import * as logs from '@aws-cdk/aws-logs'; import * as s3 from '@aws-cdk/aws-s3'; import * as sqs from '@aws-cdk/aws-sqs'; +import * as signer from '@aws-cdk/aws-signer'; import * as cdk from '@aws-cdk/core'; import * as constructs from 'constructs'; import * as _ from 'lodash'; @@ -2003,6 +2004,36 @@ describe('function', () => { }); }); }); + + describe('code signing config', () => { + test('default', () => { + const stack = new cdk.Stack(); + + const signingProfile = new signer.SigningProfile(stack, 'SigningProfile', { + platform: signer.Platform.AWS_LAMBDA_SHA384_ECDSA, + }); + + const codeSigningConfig = new lambda.CodeSigningConfig(stack, 'CodeSigningConfig', { + signingProfiles: [signingProfile], + }); + + new lambda.Function(stack, 'MyLambda', { + code: new lambda.InlineCode('foo'), + handler: 'index.handler', + runtime: lambda.Runtime.NODEJS_10_X, + codeSigningConfig, + }); + + expect(stack).toHaveResource('AWS::Lambda::Function', { + CodeSigningConfigArn: { + 'Fn::GetAtt': [ + 'CodeSigningConfigD8D41C10', + 'CodeSigningConfigArn', + ], + }, + }); + }); + }); }); function newTestLambda(scope: constructs.Construct) { diff --git a/packages/@aws-cdk/aws-signer/README.md b/packages/@aws-cdk/aws-signer/README.md index 5482a0b23c900..925261fd4be52 100644 --- a/packages/@aws-cdk/aws-signer/README.md +++ b/packages/@aws-cdk/aws-signer/README.md @@ -9,12 +9,55 @@ > > [CFN Resources]: https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib +![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge) + +> The APIs of higher level constructs in this module are experimental and under active development. +> They are subject to non-backward compatible changes or removal in any future version. These are +> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be +> announced in the release notes. This means that while you may use them, you may need to update +> your source code when upgrading to a newer version of this package. + --- -This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project. +AWS Signer is a fully managed code-signing service to ensure the trust and integrity of your code. Organizations validate code against +a digital signature to confirm that the code is unaltered and from a trusted publisher. For more information, see [What Is AWS +Signer?](https://docs.aws.amazon.com/signer/latest/developerguide/Welcome.html) + +## Table of Contents + +- [Signing Platform](#signing-platform) +- [Signing Profile](#signing-profile) + +## Signing Platform + +A signing platform is a predefined set of instructions that specifies the signature format and signing algorithms that AWS Signer should use +to sign a zip file. For more information go to [Signing Platforms in AWS Signer](https://docs.aws.amazon.com/signer/latest/developerguide/gs-platform.html). + +AWS Signer provides a pre-defined set of signing platforms. They are available in the CDK as - ```ts -import signer = require('@aws-cdk/aws-signer'); +Platform.AWS_IOT_DEVICE_MANAGEMENT_SHA256_ECDSA +Platform.AWS_LAMBDA_SHA384_ECDSA +Platform.AMAZON_FREE_RTOS_TI_CC3220SF +Platform.AMAZON_FREE_RTOS_DEFAULT ``` + +## Signing Profile + +A signing profile is a code-signing template that can be used to pre-define the signature specifications for a signing job. +A signing profile includes a signing platform to designate the file type to be signed, the signature format, and the signature algorithms. +For more information, visit [Signing Profiles in AWS Signer](https://docs.aws.amazon.com/signer/latest/developerguide/gs-profile.html). + +The following code sets up a signing profile for signing lambda code bundles - + +```ts +import * as signer from '@aws-cdk/aws-signer'; + +const signingProfile = new signer.SigningProfile(this, 'SigningProfile', { + platform: signer.Platform.AWS_LAMBDA_SHA384_ECDSA, +} ); +``` + +A signing profile is valid by default for 135 months. This can be modified by specifying the `signatureValidityPeriod` property. diff --git a/packages/@aws-cdk/aws-signer/lib/index.ts b/packages/@aws-cdk/aws-signer/lib/index.ts index 9c56379e86c19..090dec21fac3b 100644 --- a/packages/@aws-cdk/aws-signer/lib/index.ts +++ b/packages/@aws-cdk/aws-signer/lib/index.ts @@ -1,2 +1,3 @@ // AWS::Signer CloudFormation Resources: export * from './signer.generated'; +export * from './signing-profile'; diff --git a/packages/@aws-cdk/aws-signer/lib/signing-profile.ts b/packages/@aws-cdk/aws-signer/lib/signing-profile.ts new file mode 100644 index 0000000000000..8a0d14c3d194a --- /dev/null +++ b/packages/@aws-cdk/aws-signer/lib/signing-profile.ts @@ -0,0 +1,178 @@ +import { Duration, IResource, Resource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; +import { CfnSigningProfile } from './signer.generated'; + +/** + * Platforms that are allowed with signing config. + * @see https://docs.aws.amazon.com/signer/latest/developerguide/gs-platform.html + */ +export class Platform { + /** + * Specification of signature format and signing algorithms for AWS IoT Device. + */ + public static readonly AWS_IOT_DEVICE_MANAGEMENT_SHA256_ECDSA = new Platform('AWSIoTDeviceManagement-SHA256-ECDSA'); + + /** + * Specification of signature format and signing algorithms for AWS Lambda. + */ + public static readonly AWS_LAMBDA_SHA384_ECDSA = new Platform('AWSLambda-SHA384-ECDSA'); + + /** + * Specification of signature format and signing algorithms with + * SHA1 hash and RSA encryption for Amazon FreeRTOS. + */ + public static readonly AMAZON_FREE_RTOS_TI_CC3220SF = new Platform('AmazonFreeRTOS-TI-CC3220SF'); + + /** + * Specification of signature format and signing algorithms with + * SHA256 hash and ECDSA encryption for Amazon FreeRTOS. + */ + public static readonly AMAZON_FREE_RTOS_DEFAULT = new Platform('AmazonFreeRTOS-Default'); + + /** + * The id of signing platform. + * @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-signer-signingprofile.html#cfn-signer-signingprofile-platformid + */ + public readonly platformId: string; + + private constructor(platformId: string) { + this.platformId = platformId; + } +} + +/** + * A Signer Profile + */ +export interface ISigningProfile extends IResource { + /** + * The ARN of the signing profile. + * @attribute + */ + readonly signingProfileArn: string; + + /** + * The name of signing profile. + * @attribute ProfileName + */ + readonly signingProfileName: string; + + /** + * The version of signing profile. + * @attribute ProfileVersion + */ + readonly signingProfileVersion: string; + + /** + * The ARN of signing profile version. + * @attribute ProfileVersionArn + */ + readonly signingProfileVersionArn: string; +} + +/** + * Construction properties for a Signing Profile object + */ +export interface SigningProfileProps { + /** + * The Signing Platform available for signing profile. + * @see https://docs.aws.amazon.com/signer/latest/developerguide/gs-platform.html + */ + readonly platform: Platform; + + /** + * The validity period for signatures generated using + * this signing profile. + * + * @default - 135 months + */ + readonly signatureValidity?: Duration; + + /** + * Physical name of this Signing Profile. + * + * @default - Assigned by CloudFormation (recommended). + */ + readonly signingProfileName?: string; +} + +/** + * A reference to a Signing Profile + */ +export interface SigningProfileAttributes { + /** + * The name of signing profile. + */ + readonly signingProfileName: string; + + /** + * The version of signing profile. + */ + readonly signingProfileVersion: string; +} + +/** + * Defines a Signing Profile. + * + * @resource AWS::Signer::SigningProfile + */ +export class SigningProfile extends Resource implements ISigningProfile { + /** + * Creates a Signing Profile construct that represents an external Signing Profile. + * + * @param scope The parent creating construct (usually `this`). + * @param id The construct's name. + * @param attrs A `SigningProfileAttributes` object. + */ + public static fromSigningProfileAttributes( scope: Construct, id: string, attrs: SigningProfileAttributes): ISigningProfile { + class Import extends Resource implements ISigningProfile { + public readonly signingProfileArn: string; + public readonly signingProfileName = attrs.signingProfileName; + public readonly signingProfileVersion = attrs.signingProfileVersion; + public readonly signingProfileVersionArn: string; + + constructor(signingProfileArn: string, signingProfileProfileVersionArn: string) { + super(scope, id); + this.signingProfileArn = signingProfileArn; + this.signingProfileVersionArn = signingProfileProfileVersionArn; + } + } + const signingProfileArn = Stack.of(scope).formatArn({ + service: 'signer', + resource: '', + resourceName: `/signing-profiles/${attrs.signingProfileName}`, + }); + const SigningProfileVersionArn = Stack.of(scope).formatArn({ + service: 'signer', + resource: '', + resourceName: `/signing-profiles/${attrs.signingProfileName}/${attrs.signingProfileVersion}`, + }); + return new Import(signingProfileArn, SigningProfileVersionArn); + } + + public readonly signingProfileArn: string; + public readonly signingProfileName: string; + public readonly signingProfileVersion: string; + public readonly signingProfileVersionArn: string; + + constructor(scope: Construct, id: string, props: SigningProfileProps) { + super(scope, id, { + physicalName: props.signingProfileName, + }); + + const resource = new CfnSigningProfile( this, 'Resource', { + platformId: props.platform.platformId, + signatureValidityPeriod: props.signatureValidity ? { + type: 'DAYS', + value: props.signatureValidity?.toDays(), + } : { + type: 'MONTHS', + value: 135, + }, + } ); + + this.signingProfileArn = resource.attrArn; + this.signingProfileName = resource.attrProfileName; + this.signingProfileVersion = resource.attrProfileVersion; + this.signingProfileVersionArn = resource.attrProfileVersionArn; + } +} diff --git a/packages/@aws-cdk/aws-signer/package.json b/packages/@aws-cdk/aws-signer/package.json index 40a8f5872b5b1..f01a984dfdd28 100644 --- a/packages/@aws-cdk/aws-signer/package.json +++ b/packages/@aws-cdk/aws-signer/package.json @@ -79,16 +79,18 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "^3.2.0" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "^3.2.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" }, "stability": "experimental", - "maturity": "cfn-only", + "maturity": "experimental", "awscdkio": { "announce": false }, diff --git a/packages/@aws-cdk/aws-signer/test/signer.test.ts b/packages/@aws-cdk/aws-signer/test/signer.test.ts deleted file mode 100644 index e394ef336bfb4..0000000000000 --- a/packages/@aws-cdk/aws-signer/test/signer.test.ts +++ /dev/null @@ -1,6 +0,0 @@ -import '@aws-cdk/assert/jest'; -import {} from '../lib'; - -test('No tests are specified for this package', () => { - expect(true).toBe(true); -}); diff --git a/packages/@aws-cdk/aws-signer/test/signing-profile.test.ts b/packages/@aws-cdk/aws-signer/test/signing-profile.test.ts new file mode 100644 index 0000000000000..6148a6be70bda --- /dev/null +++ b/packages/@aws-cdk/aws-signer/test/signing-profile.test.ts @@ -0,0 +1,115 @@ +import '@aws-cdk/assert/jest'; +import * as cdk from '@aws-cdk/core'; +import * as signer from '../lib'; + +let app: cdk.App; +let stack: cdk.Stack; +beforeEach( () => { + app = new cdk.App( {} ); + stack = new cdk.Stack( app ); +} ); + +describe('signing profile', () => { + test( 'default', () => { + const platform = signer.Platform.AWS_LAMBDA_SHA384_ECDSA; + new signer.SigningProfile( stack, 'SigningProfile', { platform } ); + + expect(stack).toHaveResource('AWS::Signer::SigningProfile', { + PlatformId: platform.platformId, + SignatureValidityPeriod: { + Type: 'MONTHS', + Value: 135, + }, + }); + }); + + test( 'default with signature validity period', () => { + const platform = signer.Platform.AWS_LAMBDA_SHA384_ECDSA; + new signer.SigningProfile( stack, 'SigningProfile', { + platform, + signatureValidity: cdk.Duration.days( 7 ), + } ); + + expect(stack).toHaveResource('AWS::Signer::SigningProfile', { + PlatformId: platform.platformId, + SignatureValidityPeriod: { + Type: 'DAYS', + Value: 7, + }, + }); + }); + + test( 'default with some tags', () => { + const platform = signer.Platform.AWS_LAMBDA_SHA384_ECDSA; + const signing = new signer.SigningProfile( stack, 'SigningProfile', { platform } ); + + cdk.Tags.of(signing).add('tag1', 'value1'); + cdk.Tags.of(signing).add('tag2', 'value2'); + cdk.Tags.of(signing).add('tag3', ''); + + expect(stack).toHaveResource('AWS::Signer::SigningProfile', { + PlatformId: platform.platformId, + SignatureValidityPeriod: { + Type: 'MONTHS', + Value: 135, + }, + Tags: [ + { + Key: 'tag1', + Value: 'value1', + }, + { + Key: 'tag2', + Value: 'value2', + }, + { + Key: 'tag3', + Value: '', + }, + ], + }); + }); + + describe('import', () => { + test('from signingProfileProfileName and signingProfileProfileVersion', () => { + const signingProfileName = 'test'; + const signingProfileVersion = 'xxxxxxxx'; + const signingProfile = signer.SigningProfile.fromSigningProfileAttributes(stack, 'Imported', { + signingProfileName, + signingProfileVersion, + }); + + expect(stack.resolve(signingProfile.signingProfileArn)).toStrictEqual( + { + 'Fn::Join': [ + '', + [ + 'arn:', + { Ref: 'AWS::Partition' }, + ':signer:', + { Ref: 'AWS::Region' }, + ':', + { Ref: 'AWS::AccountId' }, + `://signing-profiles/${signingProfileName}`, + ], + ], + }, + ); + expect(stack.resolve(signingProfile.signingProfileVersionArn)).toStrictEqual({ + 'Fn::Join': [ + '', + [ + 'arn:', + { Ref: 'AWS::Partition' }, + ':signer:', + { Ref: 'AWS::Region' }, + ':', + { Ref: 'AWS::AccountId' }, + `://signing-profiles/${signingProfileName}/${signingProfileVersion}`, + ], + ], + }); + expect(stack).toMatchTemplate({}); + }); + } ); +}); From 17244af0d181a28b908fa161250c5a3285521c53 Mon Sep 17 00:00:00 2001 From: Romain Marcadier Date: Thu, 25 Feb 2021 14:24:47 +0100 Subject: [PATCH 22/78] fix: incorrect peerDependency on "constructs" (#13255) Both `@monocdk-experiment/assert` and `aws-cdk-lib` had an outdated peer dependency declaration against `construct` (at `^3.0.4` when the code actually depends on features introduced as recently as `^3.2.0`). This corrects the declaration accordingly. Additionally, fixes the pack prerequisite check for .NET to accept .NET 5.0 as a valid provider for .NET Core 3.1 (because it is). ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../@monocdk-experiment/assert/package.json | 2 +- packages/aws-cdk-lib/package.json | 2 +- scripts/check-pack-prerequisites.sh | 12 +++---- tools/pkglint/lib/rules.ts | 32 +++++++++++++++++++ 4 files changed, 40 insertions(+), 8 deletions(-) diff --git a/packages/@monocdk-experiment/assert/package.json b/packages/@monocdk-experiment/assert/package.json index 86806f041880f..dbd0d792e8a60 100644 --- a/packages/@monocdk-experiment/assert/package.json +++ b/packages/@monocdk-experiment/assert/package.json @@ -47,7 +47,7 @@ "@aws-cdk/cloudformation-diff": "0.0.0" }, "peerDependencies": { - "constructs": "^3.0.4", + "constructs": "^3.2.0", "jest": "^26.6.3", "monocdk": "^0.0.0" }, diff --git a/packages/aws-cdk-lib/package.json b/packages/aws-cdk-lib/package.json index 6eadd958185df..89dbc64979387 100644 --- a/packages/aws-cdk-lib/package.json +++ b/packages/aws-cdk-lib/package.json @@ -293,7 +293,7 @@ "ubergen": "0.0.0" }, "peerDependencies": { - "constructs": "^3.0.4" + "constructs": "^3.2.0" }, "homepage": "https://github.com/aws/aws-cdk", "engines": { diff --git a/scripts/check-pack-prerequisites.sh b/scripts/check-pack-prerequisites.sh index 8dca0902114e5..6b648054fe253 100755 --- a/scripts/check-pack-prerequisites.sh +++ b/scripts/check-pack-prerequisites.sh @@ -54,12 +54,12 @@ app_v=$(${app} -version 2>&1) echo -e "Checking javac version... \c" # 1.8 if [ $(echo $app_v | grep -c -E "1\.8\.[0-9].*") -eq 1 ] -then +then echo "Ok" else # 11 or 14 or 15 if [ $(echo $app_v | grep -c -E "1[145]\.[0-9]\.[0-9].*") -eq 1 ] - then + then echo "Ok" else wrong_version @@ -73,7 +73,7 @@ check_which $app $app_min app_v=$(${app} --version) echo -e "Checking mvn version... \c" if [ $(echo $app_v | grep -c -E "3\.[6789]\.[0-9].*") -eq 1 ] -then +then echo "Ok" else wrong_version @@ -85,8 +85,8 @@ app_min="3.1.0" check_which $app $app_min app_v=$(${app} --version) echo -e "Checking $app version... \c" -if [ $(echo $app_v | grep -c -E "3\.1\.[0-9].*") -eq 1 ] -then +if [ $(echo $app_v | grep -c -E "3\.1\.[0-9].*|[4-9]\..*") -eq 1 ] +then echo "Ok" else wrong_version @@ -99,7 +99,7 @@ check_which $app $app_min app_v=$(${app} --version) echo -e "Checking $app version... \c" if [ $(echo $app_v | grep -c -E "3\.[6789]\.[0-9].*") -eq 1 ] -then +then echo "Ok" else wrong_version diff --git a/tools/pkglint/lib/rules.ts b/tools/pkglint/lib/rules.ts index 67e26c9634712..1dd32c1c96392 100644 --- a/tools/pkglint/lib/rules.ts +++ b/tools/pkglint/lib/rules.ts @@ -617,6 +617,38 @@ export class NoPeerDependenciesMonocdk extends ValidationRule { } } +/** + * Validates that the same version of `constructs` is used wherever a dependency + * is specified, so that they must all be udpated at the same time (through an + * update to this rule). + * + * Note: v1 and v2 use different versions respectively. + */ +export class ConstructsVersion extends ValidationRule { + public readonly name = 'deps/constructs'; + private readonly expectedRange = cdkMajorVersion() === 2 + ? '10.0.0-pre.5' + : '^3.2.0'; + + public validate(pkg: PackageJson) { + const toCheck = new Array(); + + if ('constructs' in pkg.dependencies) { + toCheck.push('dependencies'); + } + if ('constructs' in pkg.devDependencies) { + toCheck.push('devDependencies'); + } + if ('constructs' in pkg.peerDependencies) { + toCheck.push('peerDependencies'); + } + + for (const cfg of toCheck) { + expectJSON(this.name, pkg, `${cfg}.constructs`, this.expectedRange); + } + } +} + /** * JSII Java package is required and must look sane */ From 78831cf9dec0407e7d827711183ac47be070f480 Mon Sep 17 00:00:00 2001 From: Robert Djurasaj Date: Thu, 25 Feb 2021 07:32:30 -0700 Subject: [PATCH 23/78] feat(core): `description` parameter in the CustomResourceProvider (#13275) Required by #13277 and #13276 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/core/README.md | 1 + .../custom-resource-provider/custom-resource-provider.ts | 8 ++++++++ .../custom-resource-provider.test.ts | 4 +++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/@aws-cdk/core/README.md b/packages/@aws-cdk/core/README.md index 0e0b38943a803..714e7139f0807 100644 --- a/packages/@aws-cdk/core/README.md +++ b/packages/@aws-cdk/core/README.md @@ -428,6 +428,7 @@ stack-unique identifier and returns the service token: const serviceToken = CustomResourceProvider.getOrCreate(this, 'Custom::MyCustomResourceType', { codeDirectory: `${__dirname}/my-handler`, runtime: CustomResourceProviderRuntime.NODEJS_12, // currently the only supported runtime + description: "Lambda function created by the custom resource provider", }); new CustomResource(this, 'MyResource', { diff --git a/packages/@aws-cdk/core/lib/custom-resource-provider/custom-resource-provider.ts b/packages/@aws-cdk/core/lib/custom-resource-provider/custom-resource-provider.ts index f7905fc51447b..8550efd7c72bd 100644 --- a/packages/@aws-cdk/core/lib/custom-resource-provider/custom-resource-provider.ts +++ b/packages/@aws-cdk/core/lib/custom-resource-provider/custom-resource-provider.ts @@ -67,6 +67,13 @@ export interface CustomResourceProviderProps { * @default - No environment variables. */ readonly environment?: { [key: string]: string }; + + /** + * A description of the function. + * + * @default - No description. + */ + readonly description?: string; } /** @@ -205,6 +212,7 @@ export class CustomResourceProvider extends CoreConstruct { Role: role.getAtt('Arn'), Runtime: 'nodejs12.x', Environment: this.renderEnvironmentVariables(props.environment), + Description: props.description ?? undefined, }, }); diff --git a/packages/@aws-cdk/core/test/custom-resource-provider/custom-resource-provider.test.ts b/packages/@aws-cdk/core/test/custom-resource-provider/custom-resource-provider.test.ts index b6c1e608e2f59..594f9c2936ff1 100644 --- a/packages/@aws-cdk/core/test/custom-resource-provider/custom-resource-provider.test.ts +++ b/packages/@aws-cdk/core/test/custom-resource-provider/custom-resource-provider.test.ts @@ -187,7 +187,7 @@ nodeunitShim({ test.done(); }, - 'memorySize and timeout'(test: Test) { + 'memorySize, timeout and description'(test: Test) { // GIVEN const stack = new Stack(); @@ -197,6 +197,7 @@ nodeunitShim({ runtime: CustomResourceProviderRuntime.NODEJS_12, memorySize: Size.gibibytes(2), timeout: Duration.minutes(5), + description: 'veni vidi vici', }); // THEN @@ -204,6 +205,7 @@ nodeunitShim({ const lambda = template.Resources.CustomMyResourceTypeCustomResourceProviderHandler29FBDD2A; test.deepEqual(lambda.Properties.MemorySize, 2048); test.deepEqual(lambda.Properties.Timeout, 300); + test.deepEqual(lambda.Properties.Description, 'veni vidi vici'); test.done(); }, From c8c1762c213aad1062c3a0bc48b22b05c3a0a185 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Thu, 25 Feb 2021 16:37:09 +0100 Subject: [PATCH 24/78] fix(events): cannot trigger multiple Lambdas from the same Rule (#13260) The permissions required to actually trigger the Lambda would only be added to the first target, not to any of the others. Fixes #13231. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../@aws-cdk/aws-events-targets/lib/util.ts | 3 ++- .../test/aws-api/integ.aws-api.expected.json | 23 +++++++++++++++-- .../test/lambda/integ.events.expected.json | 4 +-- .../test/lambda/lambda.test.ts | 25 +++++++++++++++++-- .../test/integ.lambda-chain.expected.json | 14 +++++------ .../test/integ.instance.lit.expected.json | 2 +- 6 files changed, 56 insertions(+), 15 deletions(-) diff --git a/packages/@aws-cdk/aws-events-targets/lib/util.ts b/packages/@aws-cdk/aws-events-targets/lib/util.ts index 74465558bb3f9..1026d1ae35a1a 100644 --- a/packages/@aws-cdk/aws-events-targets/lib/util.ts +++ b/packages/@aws-cdk/aws-events-targets/lib/util.ts @@ -33,13 +33,14 @@ export function singletonEventRole(scope: IConstruct, policyStatements: iam.Poli export function addLambdaPermission(rule: events.IRule, handler: lambda.IFunction): void { let scope: Construct | undefined; let node: ConstructNode = handler.permissionsNode; + let permissionId = `AllowEventRule${Names.nodeUniqueId(rule.node)}`; if (rule instanceof Construct) { // Place the Permission resource in the same stack as Rule rather than the Function // This is to reduce circular dependency when the lambda handler and the rule are across stacks. scope = rule; node = rule.node; + permissionId = `AllowEventRule${Names.nodeUniqueId(handler.node)}`; } - const permissionId = `AllowEventRule${Names.nodeUniqueId(rule.node)}`; if (!node.tryFindChild(permissionId)) { handler.addPermission(permissionId, { scope, diff --git a/packages/@aws-cdk/aws-events-targets/test/aws-api/integ.aws-api.expected.json b/packages/@aws-cdk/aws-events-targets/test/aws-api/integ.aws-api.expected.json index fe5ac3a5a17e6..f5ae531bc1a27 100644 --- a/packages/@aws-cdk/aws-events-targets/test/aws-api/integ.aws-api.expected.json +++ b/packages/@aws-cdk/aws-events-targets/test/aws-api/integ.aws-api.expected.json @@ -29,7 +29,26 @@ ] } }, - "ScheduleRuleAllowEventRuleawscdkawsapitargetintegScheduleRule51140722763E20C1": { + "ScheduleRuleAllowEventRuleawscdkawsapitargetintegScheduleRuleScheduleRuleTarget0HandlerF2C0C898874A4805": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "AWSb4cf1abd4e4f4bc699441af7ccd9ec371511E620", + "Arn" + ] + }, + "Principal": "events.amazonaws.com", + "SourceArn": { + "Fn::GetAtt": [ + "ScheduleRuleDA5BD877", + "Arn" + ] + } + } + }, + "ScheduleRuleAllowEventRuleawscdkawsapitargetintegScheduleRuleScheduleRuleTarget1Handler4688817C0179F894": { "Type": "AWS::Lambda::Permission", "Properties": { "Action": "lambda:InvokeFunction", @@ -198,7 +217,7 @@ ] } }, - "PatternRuleAllowEventRuleawscdkawsapitargetintegPatternRule3D388581AA4F776B": { + "PatternRuleAllowEventRuleawscdkawsapitargetintegPatternRulePatternRuleTarget0HandlerA0821464BB49C5D3": { "Type": "AWS::Lambda::Permission", "Properties": { "Action": "lambda:InvokeFunction", diff --git a/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.expected.json b/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.expected.json index 8e20529aa21d1..c12d92ef34810 100644 --- a/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.expected.json +++ b/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.expected.json @@ -68,7 +68,7 @@ ] } }, - "TimerAllowEventRulelambdaeventsTimer0E6AB6D890F582F4": { + "TimerAllowEventRulelambdaeventsMyFunc910E580F793D7BBB": { "Type": "AWS::Lambda::Permission", "Properties": { "Action": "lambda:InvokeFunction", @@ -105,7 +105,7 @@ ] } }, - "Timer2AllowEventRulelambdaeventsTimer27F866A1E50659689": { + "Timer2AllowEventRulelambdaeventsMyFunc910E580FCCD9CDCE": { "Type": "AWS::Lambda::Permission", "Properties": { "Action": "lambda:InvokeFunction", diff --git a/packages/@aws-cdk/aws-events-targets/test/lambda/lambda.test.ts b/packages/@aws-cdk/aws-events-targets/test/lambda/lambda.test.ts index 28df0932c9ba4..29be8973fe3c3 100644 --- a/packages/@aws-cdk/aws-events-targets/test/lambda/lambda.test.ts +++ b/packages/@aws-cdk/aws-events-targets/test/lambda/lambda.test.ts @@ -78,6 +78,27 @@ test('adding same lambda function as target mutiple times creates permission onl expect(stack).toCountResources('AWS::Lambda::Permission', 1); }); +test('adding different lambda functions as target mutiple times creates multiple permissions', () => { + // GIVEN + const stack = new cdk.Stack(); + const fn1 = newTestLambda(stack); + const fn2 = newTestLambda(stack, '2'); + const rule = new events.Rule(stack, 'Rule', { + schedule: events.Schedule.rate(cdk.Duration.minutes(1)), + }); + + // WHEN + rule.addTarget(new targets.LambdaFunction(fn1, { + event: events.RuleTargetInput.fromObject({ key: 'value1' }), + })); + rule.addTarget(new targets.LambdaFunction(fn2, { + event: events.RuleTargetInput.fromObject({ key: 'value2' }), + })); + + // THEN + expect(stack).toCountResources('AWS::Lambda::Permission', 2); +}); + test('adding same singleton lambda function as target mutiple times creates permission only once', () => { // GIVEN const stack = new cdk.Stack(); @@ -126,8 +147,8 @@ test('lambda handler and cloudwatch event across stacks', () => { expect(eventStack).toCountResources('AWS::Lambda::Permission', 1); }); -function newTestLambda(scope: constructs.Construct) { - return new lambda.Function(scope, 'MyLambda', { +function newTestLambda(scope: constructs.Construct, suffix = '') { + return new lambda.Function(scope, `MyLambda${suffix}`, { code: new lambda.InlineCode('foo'), handler: 'bar', runtime: lambda.Runtime.PYTHON_2_7, diff --git a/packages/@aws-cdk/aws-lambda-destinations/test/integ.lambda-chain.expected.json b/packages/@aws-cdk/aws-lambda-destinations/test/integ.lambda-chain.expected.json index f8f6f78713d64..5fc64df8417f3 100644 --- a/packages/@aws-cdk/aws-lambda-destinations/test/integ.lambda-chain.expected.json +++ b/packages/@aws-cdk/aws-lambda-destinations/test/integ.lambda-chain.expected.json @@ -58,13 +58,13 @@ "Code": { "ZipFile": "exports.handler = async (event) => {\n console.log('Event: %j', event);\n if (event === 'error') throw new Error('UnkownError');\n return event;\n };" }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "FirstServiceRole097DB3A5", "Arn" ] }, + "Handler": "index.handler", "Runtime": "nodejs10.x" }, "DependsOn": [ @@ -114,7 +114,7 @@ ] } }, - "FirstEventInvokeConfigFailureAllowEventRuleawscdklambdachainFirstEventInvokeConfigFailure7180F42FA8F1F1F0": { + "FirstEventInvokeConfigFailureAllowEventRuleawscdklambdachainErrorC073CD8DCAD68018": { "Type": "AWS::Lambda::Permission", "Properties": { "Action": "lambda:InvokeFunction", @@ -175,7 +175,7 @@ ] } }, - "FirstEventInvokeConfigSuccessAllowEventRuleawscdklambdachainFirstEventInvokeConfigSuccess2DCAE39FC2495AB7": { + "FirstEventInvokeConfigSuccessAllowEventRuleawscdklambdachainSecond178F48F8A8DE2790": { "Type": "AWS::Lambda::Permission", "Properties": { "Action": "lambda:InvokeFunction", @@ -308,13 +308,13 @@ "Code": { "ZipFile": "exports.handler = async (event) => {\n console.log('Event: %j', event);\n if (event === 'error') throw new Error('UnkownError');\n return event;\n };" }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "SecondServiceRole55940A31", "Arn" ] }, + "Handler": "index.handler", "Runtime": "nodejs10.x" }, "DependsOn": [ @@ -364,7 +364,7 @@ ] } }, - "SecondEventInvokeConfigSuccessAllowEventRuleawscdklambdachainSecondEventInvokeConfigSuccess2078CDC9C7FB9F61": { + "SecondEventInvokeConfigSuccessAllowEventRuleawscdklambdachainThird031C7FF6ABA1C15A": { "Type": "AWS::Lambda::Permission", "Properties": { "Action": "lambda:InvokeFunction", @@ -453,13 +453,13 @@ "Code": { "ZipFile": "exports.handler = async (event) => {\n console.log('Event: %j', event);\n if (event === 'error') throw new Error('UnkownError');\n return event;\n };" }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "ThirdServiceRole42701801", "Arn" ] }, + "Handler": "index.handler", "Runtime": "nodejs10.x" }, "DependsOn": [ @@ -503,13 +503,13 @@ "Code": { "ZipFile": "exports.handler = async (event) => {\n console.log('Event: %j', event);\n if (event === 'error') throw new Error('UnkownError');\n return event;\n };" }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "ErrorServiceRoleCE484966", "Arn" ] }, + "Handler": "index.handler", "Runtime": "nodejs10.x" }, "DependsOn": [ diff --git a/packages/@aws-cdk/aws-rds/test/integ.instance.lit.expected.json b/packages/@aws-cdk/aws-rds/test/integ.instance.lit.expected.json index 8a05969830f29..0de11e4fd5c4f 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.instance.lit.expected.json +++ b/packages/@aws-cdk/aws-rds/test/integ.instance.lit.expected.json @@ -909,7 +909,7 @@ ] } }, - "InstanceAvailabilityAllowEventRuleawscdkrdsinstanceInstanceAvailabilityCE39A6A7B066AA0D": { + "InstanceAvailabilityAllowEventRuleawscdkrdsinstanceFunctionD515EE1969208105": { "Type": "AWS::Lambda::Permission", "Properties": { "Action": "lambda:InvokeFunction", From 624a93da644b59d64778acf9defca789ef969a84 Mon Sep 17 00:00:00 2001 From: Hsing-Hui Hsu Date: Thu, 25 Feb 2021 08:09:05 -0800 Subject: [PATCH 25/78] chore(aws-logs): fix typo in error message (#13137) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-logs/test/test.log-retention-provider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-logs/test/test.log-retention-provider.ts b/packages/@aws-cdk/aws-logs/test/test.log-retention-provider.ts index b13eebe9aabe2..a08ff060dc2a4 100644 --- a/packages/@aws-cdk/aws-logs/test/test.log-retention-provider.ts +++ b/packages/@aws-cdk/aws-logs/test/test.log-retention-provider.ts @@ -208,7 +208,7 @@ export = { }, async 'responds with FAILED on error'(test: Test) { - const createLogGroupFake = sinon.fake.rejects(new Error('UnkownError')); + const createLogGroupFake = sinon.fake.rejects(new Error('UnknownError')); AWS.mock('CloudWatchLogs', 'createLogGroup', createLogGroupFake); From d9ee91432918aa113f728abdd61295096ed1512f Mon Sep 17 00:00:00 2001 From: Otavio Macedo Date: Thu, 25 Feb 2021 16:40:54 +0000 Subject: [PATCH 26/78] fix(cloudwatch): MathExpression period of <5 minutes is not respected (#13078) fixes #9156 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../aws-cloudwatch/lib/private/rendering.ts | 1 + ...teg.math-alarm-and-dashboard.expected.json | 4 ++-- .../aws-cloudwatch/test/test.metric-math.ts | 22 +++++++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/aws-cloudwatch/lib/private/rendering.ts b/packages/@aws-cdk/aws-cloudwatch/lib/private/rendering.ts index e8dcb15cabc84..8553d9ad5c486 100644 --- a/packages/@aws-cdk/aws-cloudwatch/lib/private/rendering.ts +++ b/packages/@aws-cdk/aws-cloudwatch/lib/private/rendering.ts @@ -55,6 +55,7 @@ function metricGraphJson(metric: IMetric, yAxis?: string, id?: string) { withExpression(expr) { options.expression = expr.expression; + if (expr.period && expr.period !== 300) { options.period = expr.period; } }, }); diff --git a/packages/@aws-cdk/aws-cloudwatch/test/integ.math-alarm-and-dashboard.expected.json b/packages/@aws-cdk/aws-cloudwatch/test/integ.math-alarm-and-dashboard.expected.json index 7de0e4290cd65..8e9b235bb2b65 100644 --- a/packages/@aws-cdk/aws-cloudwatch/test/integ.math-alarm-and-dashboard.expected.json +++ b/packages/@aws-cdk/aws-cloudwatch/test/integ.math-alarm-and-dashboard.expected.json @@ -88,7 +88,7 @@ { "Ref": "AWS::Region" }, - "\",\"metrics\":[[{\"label\":\"Total Messages\",\"expression\":\"m1+m2\"}],[\"AWS/SQS\",\"ApproximateNumberOfMessagesVisible\",\"QueueName\",\"", + "\",\"metrics\":[[{\"label\":\"Total Messages\",\"expression\":\"m1+m2\",\"period\":60}],[\"AWS/SQS\",\"ApproximateNumberOfMessagesVisible\",\"QueueName\",\"", { "Fn::GetAtt": [ "queue", @@ -120,7 +120,7 @@ { "Ref": "AWS::Region" }, - "\",\"metrics\":[[{\"label\":\"Total Messages\",\"expression\":\"m1+m2\"}],[\"AWS/SQS\",\"ApproximateNumberOfMessagesVisible\",\"QueueName\",\"", + "\",\"metrics\":[[{\"label\":\"Total Messages\",\"expression\":\"m1+m2\",\"period\":60}],[\"AWS/SQS\",\"ApproximateNumberOfMessagesVisible\",\"QueueName\",\"", { "Fn::GetAtt": [ "queue", diff --git a/packages/@aws-cdk/aws-cloudwatch/test/test.metric-math.ts b/packages/@aws-cdk/aws-cloudwatch/test/test.metric-math.ts index e8288ce092b27..b5eecac9ec52d 100644 --- a/packages/@aws-cdk/aws-cloudwatch/test/test.metric-math.ts +++ b/packages/@aws-cdk/aws-cloudwatch/test/test.metric-math.ts @@ -219,6 +219,28 @@ export = { test.done(); }, + 'top level period in a MathExpression is respected in its metrics'(test: Test) { + const graph = new GraphWidget({ + left: [ + a, + new MathExpression({ + expression: 'a + b', + usingMetrics: { a, b }, + period: Duration.minutes(1), + }), + ], + }); + + // THEN + graphMetricsAre(test, graph, [ + ['Test', 'ACount'], + [{ label: 'a + b', expression: 'a + b', period: 60 }], + ['Test', 'ACount', { visible: false, id: 'a', period: 60 }], + ['Test', 'BCount', { visible: false, id: 'b', period: 60 }], + ]); + test.done(); + }, + 'MathExpression controls period of metrics transitively used in it'(test: Test) { // Same as the previous test, but recursively From 88e933f4cc14d47ab1e42db3faf316b30a736120 Mon Sep 17 00:00:00 2001 From: Florian Chazal Date: Thu, 25 Feb 2021 18:12:49 +0100 Subject: [PATCH 27/78] docs(pipelines): add CI/CD account bootstrap template example (#12352) ---- This PR add details about how you can restrict the bootstrapping role permissions and especially if you have a multi-accounts structure with a de dedicated account for CI/CD pipelines. It makes reference to [a template](https://raw.githubusercontent.com/aws-samples/aws-bootstrap-kit-examples/main/source/1-SDLC-organization/lib/cdk-bootstrap-template.yml) used in an other project leveraging the CDK pipelines construct in a multi-accounts organization. This template follow the least privileges principle and restrict as much as possible permissions to enable user to only create resources needed by the cdk pipelines construct (specific roles, kms keys, buckets, codepipelines etc.). *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/pipelines/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/@aws-cdk/pipelines/README.md b/packages/@aws-cdk/pipelines/README.md index 718ba9b503690..512ee5e97c92b 100644 --- a/packages/@aws-cdk/pipelines/README.md +++ b/packages/@aws-cdk/pipelines/README.md @@ -655,6 +655,12 @@ These command lines explained: > Make sure you trust all the code and dependencies that make up your CDK app. > Check with the appropriate department within your organization to decide on the > proper policy to use. +> +> If your policy includes permissions to create on attach permission to a role, +> developers can escalate their privilege with more permissive permission. +> Thus, we recommend implementing [permissions boundary](https://aws.amazon.com/premiumsupport/knowledge-center/iam-permission-boundaries/) +> in the CDK Execution role. To do this, you can bootstrap with the `--template` option with +> [a customized template](https://github.com/aws-samples/aws-bootstrap-kit-examples/blob/ba28a97d289128281bc9483bcba12c1793f2c27a/source/1-SDLC-organization/lib/cdk-bootstrap-template.yml#L395) that contains a permission boundary. ### Migrating from old bootstrap stack From 146a97f5eabde6e8df3dde1118f000b75c8e44ef Mon Sep 17 00:00:00 2001 From: Idan Lupinsky Date: Thu, 25 Feb 2021 18:45:34 +0100 Subject: [PATCH 28/78] chore(init-templates/python): correct virtual environment typo (#12230) ---- This is a suggested fix for https://github.com/aws/aws-cdk/issues/12229, a small typo in the init templates for Python. *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../lib/init-templates/v2/app/python/.template.gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/aws-cdk/lib/init-templates/v2/app/python/.template.gitignore b/packages/aws-cdk/lib/init-templates/v2/app/python/.template.gitignore index 383cdd5040f7e..37833f8beb2a3 100644 --- a/packages/aws-cdk/lib/init-templates/v2/app/python/.template.gitignore +++ b/packages/aws-cdk/lib/init-templates/v2/app/python/.template.gitignore @@ -2,7 +2,7 @@ package-lock.json __pycache__ .pytest_cache -.env +.venv *.egg-info # CDK asset staging directory From 465cd9c434acff74070ca6d33891e1481e253128 Mon Sep 17 00:00:00 2001 From: Alban Esc Date: Thu, 25 Feb 2021 10:17:57 -0800 Subject: [PATCH 29/78] feat(events): archive events (#12060) Add the possibility to archive events from an Event Bus. It's also possible to archive specific events by passing an event patterns. See the [following blogpost](https://aws.amazon.com/blogs/aws/new-archive-and-replay-events-with-amazon-eventbridge/) for more information about event archiving and replay. Archiving should be possible from an imported EventBus. closes #11531 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-events/README.md | 23 ++++ packages/@aws-cdk/aws-events/lib/archive.ts | 77 +++++++++++ packages/@aws-cdk/aws-events/lib/event-bus.ts | 81 ++++++++--- packages/@aws-cdk/aws-events/lib/index.ts | 1 + .../@aws-cdk/aws-events/test/test.archive.ts | 45 +++++++ .../aws-events/test/test.event-bus.ts | 127 ++++++++++++++++++ 6 files changed, 338 insertions(+), 16 deletions(-) create mode 100644 packages/@aws-cdk/aws-events/lib/archive.ts create mode 100644 packages/@aws-cdk/aws-events/test/test.archive.ts diff --git a/packages/@aws-cdk/aws-events/README.md b/packages/@aws-cdk/aws-events/README.md index d19309455559d..565b0537d091d 100644 --- a/packages/@aws-cdk/aws-events/README.md +++ b/packages/@aws-cdk/aws-events/README.md @@ -163,3 +163,26 @@ In this situation, the CDK will wire the 2 accounts together: For more information, see the [AWS documentation on cross-account events](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-cross-account-event-delivery.html). + +## Archiving + +It is possible to archive all or some events sent to an event bus. It is then possible to [replay these events](https://aws.amazon.com/blogs/aws/new-archive-and-replay-events-with-amazon-eventbridge/). + +```ts +import * as cdk from '@aws-cdk/core'; + +const stack = new stack(); + +const bus = new EventBus(stack, 'bus', { + eventBusName: 'MyCustomEventBus' +}); + +bus.archive('MyArchive', { + archiveName: 'MyCustomEventBusArchive', + description: 'MyCustomerEventBus Archive', + eventPattern: { + account: [stack.account], + }, + retention: cdk.Duration.days(365), +}); +``` diff --git a/packages/@aws-cdk/aws-events/lib/archive.ts b/packages/@aws-cdk/aws-events/lib/archive.ts new file mode 100644 index 0000000000000..3da79df6682a2 --- /dev/null +++ b/packages/@aws-cdk/aws-events/lib/archive.ts @@ -0,0 +1,77 @@ +import { Duration, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; +import { IEventBus } from './event-bus'; +import { EventPattern } from './event-pattern'; +import { CfnArchive } from './events.generated'; + +/** + * The event archive base properties + */ +export interface BaseArchiveProps { + /** + * The name of the archive. + * + * @default - Automatically generated + */ + readonly archiveName?: string; + /** + * A description for the archive. + * + * @default - none + */ + readonly description?: string; + /** + * An event pattern to use to filter events sent to the archive. + */ + readonly eventPattern: EventPattern; + /** + * The number of days to retain events for. Default value is 0. If set to 0, events are retained indefinitely. + * @default - Infinite + */ + readonly retention?: Duration; +} + + +/** + * The event archive properties + */ +export interface ArchiveProps extends BaseArchiveProps { + /** + * The event source associated with the archive. + */ + readonly sourceEventBus: IEventBus; +} + +/** + * Define an EventBridge Archive + * + * @resource AWS::Events::Archive + */ +export class Archive extends Resource { + /** + * The archive name. + * @attribute + */ + public readonly archiveName: string; + + /** + * The ARN of the archive created. + * @attribute + */ + public readonly archiveArn: string; + + constructor(scope: Construct, id: string, props: ArchiveProps) { + super(scope, id, { physicalName: props.archiveName }); + + let archive = new CfnArchive(this, 'Archive', { + sourceArn: props.sourceEventBus.eventBusArn, + description: props.description, + eventPattern: props.eventPattern, + retentionDays: props.retention?.toDays({ integral: true }) || 0, + archiveName: this.physicalName, + }); + + this.archiveArn = archive.attrArn; + this.archiveName = archive.attrArchiveName; + } +} diff --git a/packages/@aws-cdk/aws-events/lib/event-bus.ts b/packages/@aws-cdk/aws-events/lib/event-bus.ts index 27c79c9c7fe3a..cd0c7f913cbf6 100644 --- a/packages/@aws-cdk/aws-events/lib/event-bus.ts +++ b/packages/@aws-cdk/aws-events/lib/event-bus.ts @@ -1,6 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; import { IResource, Lazy, Names, Resource, Stack, Token } from '@aws-cdk/core'; import { Construct } from 'constructs'; +import { Archive, BaseArchiveProps } from './archive'; import { CfnEventBus } from './events.generated'; /** @@ -37,6 +38,15 @@ export interface IEventBus extends IResource { * @link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-eventbus.html#cfn-events-eventbus-eventsourcename */ readonly eventSourceName?: string; + + /** + * Create an EventBridge archive to send events to. + * When you create an archive, incoming events might not immediately start being sent to the archive. + * Allow a short period of time for changes to take effect. + * + * @param props Properties of the archive + */ + archive(id: string, props: BaseArchiveProps): Archive; } /** @@ -96,12 +106,45 @@ export interface EventBusAttributes { readonly eventSourceName?: string; } +abstract class EventBusBase extends Resource implements IEventBus { + /** + * The physical ID of this event bus resource + */ + public abstract readonly eventBusName: string; + + /** + * The ARN of the event bus, such as: + * arn:aws:events:us-east-2:123456789012:event-bus/aws.partner/PartnerName/acct1/repo1. + */ + public abstract readonly eventBusArn: string; + + /** + * The policy for the event bus in JSON form. + */ + public abstract readonly eventBusPolicy: string; + + /** + * The name of the partner event source + */ + public abstract readonly eventSourceName?: string; + + public archive(id: string, props: BaseArchiveProps): Archive { + return new Archive(this, id, { + sourceEventBus: this, + description: props.description || `Event Archive for ${this.eventBusName} Event Bus`, + eventPattern: props.eventPattern, + retention: props.retention, + archiveName: props.archiveName, + }); + } +} + /** * Define an EventBridge EventBus * * @resource AWS::Events::EventBus */ -export class EventBus extends Resource implements IEventBus { +export class EventBus extends EventBusBase { /** * Import an existing event bus resource @@ -112,13 +155,11 @@ export class EventBus extends Resource implements IEventBus { public static fromEventBusArn(scope: Construct, id: string, eventBusArn: string): IEventBus { const parts = Stack.of(scope).parseArn(eventBusArn); - class Import extends Resource implements IEventBus { - public readonly eventBusArn = eventBusArn; - public readonly eventBusName = parts.resourceName || ''; - public readonly eventBusPolicy = ''; - } - - return new Import(scope, id); + return new ImportedEventBus(scope, id, { + eventBusArn: eventBusArn, + eventBusName: parts.resourceName || '', + eventBusPolicy: '', + }); } /** @@ -128,14 +169,7 @@ export class EventBus extends Resource implements IEventBus { * @param attrs Imported event bus properties */ public static fromEventBusAttributes(scope: Construct, id: string, attrs: EventBusAttributes): IEventBus { - class Import extends Resource implements IEventBus { - public readonly eventBusArn = attrs.eventBusArn; - public readonly eventBusName = attrs.eventBusName; - public readonly eventBusPolicy = attrs.eventBusPolicy; - public readonly eventSourceName = attrs.eventSourceName; - } - - return new Import(scope, id); + return new ImportedEventBus(scope, id, attrs); } /** @@ -241,3 +275,18 @@ export class EventBus extends Resource implements IEventBus { this.eventSourceName = eventBus.eventSourceName; } } + +class ImportedEventBus extends EventBusBase { + public readonly eventBusArn: string; + public readonly eventBusName: string; + public readonly eventBusPolicy: string; + public readonly eventSourceName?: string; + constructor(scope: Construct, id: string, attrs: EventBusAttributes) { + super(scope, id); + + this.eventBusArn = attrs.eventBusArn; + this.eventBusName = attrs.eventBusName; + this.eventBusPolicy = attrs.eventBusPolicy; + this.eventSourceName = attrs.eventSourceName; + } +} diff --git a/packages/@aws-cdk/aws-events/lib/index.ts b/packages/@aws-cdk/aws-events/lib/index.ts index e0aa655afaf72..718b236bf6e91 100644 --- a/packages/@aws-cdk/aws-events/lib/index.ts +++ b/packages/@aws-cdk/aws-events/lib/index.ts @@ -6,6 +6,7 @@ export * from './event-bus'; export * from './event-pattern'; export * from './schedule'; export * from './on-event-options'; +export * from './archive'; // AWS::Events CloudFormation Resources: export * from './events.generated'; diff --git a/packages/@aws-cdk/aws-events/test/test.archive.ts b/packages/@aws-cdk/aws-events/test/test.archive.ts new file mode 100644 index 0000000000000..fc8f38a516f2b --- /dev/null +++ b/packages/@aws-cdk/aws-events/test/test.archive.ts @@ -0,0 +1,45 @@ +import { expect, haveResource } from '@aws-cdk/assert'; +import { Duration, Stack } from '@aws-cdk/core'; +import { Test } from 'nodeunit'; +import { EventBus } from '../lib'; +import { Archive } from '../lib/archive'; + +export = { + 'creates an archive for an EventBus'(test: Test) { + // GIVEN + const stack = new Stack(); + + // WHEN + let eventBus = new EventBus(stack, 'Bus'); + + new Archive(stack, 'Archive', { + sourceEventBus: eventBus, + eventPattern: { + account: [stack.account], + }, + retention: Duration.days(10), + }); + + // THEN + expect(stack).to(haveResource('AWS::Events::EventBus', { + Name: 'Bus', + })); + + expect(stack).to(haveResource('AWS::Events::Archive', { + EventPattern: { + account: [{ + Ref: 'AWS::AccountId', + }], + }, + RetentionDays: 10, + SourceArn: { + 'Fn::GetAtt': [ + 'BusEA82B648', + 'Arn', + ], + }, + })); + + test.done(); + }, +} diff --git a/packages/@aws-cdk/aws-events/test/test.event-bus.ts b/packages/@aws-cdk/aws-events/test/test.event-bus.ts index a6c32885ec4a9..2e8434e147bb1 100644 --- a/packages/@aws-cdk/aws-events/test/test.event-bus.ts +++ b/packages/@aws-cdk/aws-events/test/test.event-bus.ts @@ -245,6 +245,133 @@ export = { ], })); + test.done(); + }, + 'can archive events'(test: Test) { + // GIVEN + const stack = new Stack(); + + // WHEN + const event = new EventBus(stack, 'Bus'); + + event.archive('MyArchive', { + eventPattern: { + account: [stack.account], + }, + archiveName: 'MyArchive', + }); + + // THEN + expect(stack).to(haveResource('AWS::Events::EventBus', { + Name: 'Bus', + })); + + expect(stack).to(haveResource('AWS::Events::Archive', { + SourceArn: { + 'Fn::GetAtt': [ + 'BusEA82B648', + 'Arn', + ], + }, + Description: { + 'Fn::Join': [ + '', + [ + 'Event Archive for ', + { + Ref: 'BusEA82B648', + }, + ' Event Bus', + ], + ], + }, + EventPattern: { + account: [ + { + Ref: 'AWS::AccountId', + }, + ], + }, + RetentionDays: 0, + ArchiveName: 'MyArchive', + })); + + test.done(); + }, + 'can archive events from an imported EventBus'(test: Test) { + // GIVEN + const stack = new Stack(); + + // WHEN + const bus = new EventBus(stack, 'Bus'); + + const importedBus = EventBus.fromEventBusArn(stack, 'ImportedBus', bus.eventBusArn); + + importedBus.archive('MyArchive', { + eventPattern: { + account: [stack.account], + }, + archiveName: 'MyArchive', + }); + + // THEN + expect(stack).to(haveResource('AWS::Events::EventBus', { + Name: 'Bus', + })); + + expect(stack).to(haveResource('AWS::Events::Archive', { + SourceArn: { + 'Fn::GetAtt': [ + 'BusEA82B648', + 'Arn', + ], + }, + Description: { + 'Fn::Join': [ + '', + [ + 'Event Archive for ', + { + 'Fn::Select': [ + 1, + { + 'Fn::Split': [ + '/', + { + 'Fn::Select': [ + 5, + { + 'Fn::Split': [ + ':', + { + 'Fn::GetAtt': [ + 'BusEA82B648', + 'Arn', + ], + }, + ], + }, + ], + }, + ], + }, + ], + }, + ' Event Bus', + ], + ], + }, + EventPattern: { + account: [ + { + Ref: 'AWS::AccountId', + }, + ], + }, + RetentionDays: 0, + ArchiveName: 'MyArchive', + })); + test.done(); }, }; From b7b441f74a07d26fd8de23df84e7ab4663c89c0c Mon Sep 17 00:00:00 2001 From: Matthew Moore Date: Thu, 25 Feb 2021 21:22:40 +0200 Subject: [PATCH 30/78] feat(elbv2): allow control of ingress rules on redirect listener (#12768) This change adds the ability to specify whether you'd like a redirect listener to be open or not. If you don't want the open ingress rule created you'll now be able to do the following: ```ts loadBalancer.addRedirect({ open: false }); ``` fixes #12766 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../aws-elasticloadbalancingv2/README.md | 3 +++ .../lib/alb/application-load-balancer.ts | 17 ++++++++++++- .../test/alb/listener.test.ts | 25 +++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/README.md b/packages/@aws-cdk/aws-elasticloadbalancingv2/README.md index 89baa6791ff2c..e0f3b1f4e5ea5 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/README.md +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/README.md @@ -182,6 +182,9 @@ lb.addRedirect({ If you do not provide any options for this method, it redirects HTTP port 80 to HTTPS port 443. +By default all ingress traffic will be allowed on the source port. If you want to be more selective with your +ingress rules then set `open: false` and use the listener's `connections` object to selectively grant access to the listener. + ## Defining a Network Load Balancer Network Load Balancers are defined in a similar way to Application Load diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-load-balancer.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-load-balancer.ts index 8f0ccf963cc5b..4ad4dcb5fa081 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-load-balancer.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-load-balancer.ts @@ -119,7 +119,7 @@ export class ApplicationLoadBalancer extends BaseLoadBalancer implements IApplic return this.addListener(`Redirect${sourcePort}To${targetPort}`, { protocol: props.sourceProtocol ?? ApplicationProtocol.HTTP, port: sourcePort, - open: true, + open: props.open ?? true, defaultAction: ListenerAction.redirect({ port: targetPort, protocol: props.targetProtocol ?? ApplicationProtocol.HTTPS, @@ -665,4 +665,19 @@ export interface ApplicationLoadBalancerRedirectConfig { */ readonly targetPort?: number; + /** + * Allow anyone to connect to this listener + * + * If this is specified, the listener will be opened up to anyone who can reach it. + * For internal load balancers this is anyone in the same VPC. For public load + * balancers, this is anyone on the internet. + * + * If you want to be more selective about who can access this load + * balancer, set this to `false` and use the listener's `connections` + * object to selectively grant access to the listener. + * + * @default true + */ + readonly open?: boolean; + } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/listener.test.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/listener.test.ts index 231279ffb932e..3e7b639cb1a8f 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/listener.test.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/listener.test.ts @@ -727,6 +727,31 @@ describe('tests', () => { }); }); + test('Can supress default ingress rules on a simple redirect response', () => { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'Stack'); + + const loadBalancer = new elbv2.ApplicationLoadBalancer(stack, 'LB', { + vpc, + }); + + // WHEN + loadBalancer.addRedirect({ open: false }); + + // THEN + expect(stack).not.toHaveResourceLike('AWS::EC2::SecurityGroup', { + SecurityGroupIngress: [ + { + CidrIp: '0.0.0.0/0', + Description: 'Allow from anyone on port 80', + IpProtocol: 'tcp', + }, + ], + }); + + }); + test('Can add simple redirect responses with custom values', () => { // GIVEN const stack = new cdk.Stack(); From 8712b408a72947276af48e4fc28ffd93c5fd1056 Mon Sep 17 00:00:00 2001 From: Robert Djurasaj Date: Thu, 25 Feb 2021 12:54:48 -0700 Subject: [PATCH 31/78] chore(elasticloadbalancingv2): Add duration checks for slow start target group attribute (#13265) One more duration check... safety first :) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../lib/alb/application-target-group.ts | 3 +++ .../test/alb/target-group.test.ts | 17 +++++++++++++++++ .../test/integ.alb.expected.json | 4 ++++ .../test/integ.alb.ts | 1 + 4 files changed, 25 insertions(+) diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-target-group.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-target-group.ts index c6556a61e2021..74938a08ee745 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-target-group.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-target-group.ts @@ -123,6 +123,9 @@ export class ApplicationTargetGroup extends TargetGroupBase implements IApplicat if (props) { if (props.slowStart !== undefined) { + if (props.slowStart.toSeconds() < 30 || props.slowStart.toSeconds() > 900) { + throw new Error('Slow start duration value must be between 30 and 900 seconds.'); + } this.setAttribute('slow_start.duration_seconds', props.slowStart.toSeconds().toString()); } if (props.stickinessCookieDuration) { diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/target-group.test.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/target-group.test.ts index 06b79c87d244f..77858e9c21af4 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/target-group.test.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/target-group.test.ts @@ -205,4 +205,21 @@ describe('tests', () => { }); }).toThrow(/Stickiness cookie duration value must be between 1 second and 7 days \(604800 seconds\)./); }); + + test('Bad slow start duration value', () => { + // GIVEN + const app = new cdk.App(); + const stack = new cdk.Stack(app, 'Stack'); + const vpc = new ec2.Vpc(stack, 'VPC', {}); + + // THEN + [cdk.Duration.minutes(16), cdk.Duration.seconds(29)].forEach((badDuration, i) => { + expect(() => { + new elbv2.ApplicationTargetGroup(stack, `TargetGroup${i}`, { + slowStart: badDuration, + vpc, + }); + }).toThrow(/Slow start duration value must be between 30 and 900 seconds./); + }); + }); }); diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/integ.alb.expected.json b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/integ.alb.expected.json index c1dfdcb095bec..56acbde9bb1f1 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/integ.alb.expected.json +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/integ.alb.expected.json @@ -469,6 +469,10 @@ "Port": 80, "Protocol": "HTTP", "TargetGroupAttributes": [ + { + "Key": "slow_start.duration_seconds", + "Value": "60" + }, { "Key": "stickiness.enabled", "Value": "true" diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/integ.alb.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/integ.alb.ts index df716e80e0f4f..8643f7b4c1f69 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/integ.alb.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/integ.alb.ts @@ -32,6 +32,7 @@ const group2 = listener.addTargets('ConditionalTarget', { targets: [new elbv2.IpTarget('10.0.128.5')], stickinessCookieDuration: cdk.Duration.minutes(5), stickinessCookieName: 'MyDeliciousCookie', + slowStart: cdk.Duration.minutes(1), }); group1.metricTargetResponseTime().createAlarm(stack, 'ResponseTimeHigh1', { From 39ab80663bacfab9a06a53d789a4f7dd893e1795 Mon Sep 17 00:00:00 2001 From: Robert Djurasaj Date: Thu, 25 Feb 2021 13:27:25 -0700 Subject: [PATCH 32/78] chore(cloudformation): update integration tests with description parameter for custom resources (#13276) Integration test in `core` module requires that any custom description parameter integration tests should be done in `cloudformation` module. https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/core/test/integration.custom-resources.readme ``` +--------------------------------------------------------------------------+ | Since cdk-integ depends on cdk which depends on @aws-cdk/core (as a "dev | | dependency"), this integration test has been added to the package | | @aws-cdk/aws-cloudformation under `test/integ.core-custom-resources.ts` | +--------------------------------------------------------------------------+ ``` Depends on #13275 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../test/integ.core-custom-resources.expected.json | 3 ++- .../aws-cloudformation/test/integ.core-custom-resources.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-cloudformation/test/integ.core-custom-resources.expected.json b/packages/@aws-cdk/aws-cloudformation/test/integ.core-custom-resources.expected.json index 23c4884db164f..e5db15d48809b 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/integ.core-custom-resources.expected.json +++ b/packages/@aws-cdk/aws-cloudformation/test/integ.core-custom-resources.expected.json @@ -72,7 +72,8 @@ "Arn" ] }, - "Runtime": "nodejs12.x" + "Runtime": "nodejs12.x", + "Description": "veni vidi vici" }, "DependsOn": [ "CustomReflectCustomResourceProviderRoleB4B29AEC" diff --git a/packages/@aws-cdk/aws-cloudformation/test/integ.core-custom-resources.ts b/packages/@aws-cdk/aws-cloudformation/test/integ.core-custom-resources.ts index 1743444c1ad57..7f5e9d49a95db 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/integ.core-custom-resources.ts +++ b/packages/@aws-cdk/aws-cloudformation/test/integ.core-custom-resources.ts @@ -24,6 +24,7 @@ class TestStack extends Stack { const serviceToken = CustomResourceProvider.getOrCreate(this, resourceType, { codeDirectory: `${__dirname}/core-custom-resource-provider-fixture`, runtime: CustomResourceProviderRuntime.NODEJS_12, + description: 'veni vidi vici', }); const cr = new CustomResource(this, 'MyResource', { From a67d85f90378cc63ad471da8d9543f7c88f94d57 Mon Sep 17 00:00:00 2001 From: Robert Djurasaj Date: Thu, 25 Feb 2021 13:59:29 -0700 Subject: [PATCH 33/78] chore(s3): add auto-generated description to custom resource provider for better recognition of the s3 auto-delete lambda functions in AWS console (#13277) When having a huge amount of lambda functions it's always nice to have a populated description for better determining the "prurpose-at-a-glance" of what this function is doing (in case you cannot deduce that information from lambda's name). Depends on #13275. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-s3/lib/bucket.ts | 1 + .../integ.bucket-auto-delete-objects.expected.json | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-s3/lib/bucket.ts b/packages/@aws-cdk/aws-s3/lib/bucket.ts index 1edbb9c7a5040..630aa9f02bfcc 100644 --- a/packages/@aws-cdk/aws-s3/lib/bucket.ts +++ b/packages/@aws-cdk/aws-s3/lib/bucket.ts @@ -1830,6 +1830,7 @@ export class Bucket extends BucketBase { const provider = CustomResourceProvider.getOrCreateProvider(this, AUTO_DELETE_OBJECTS_RESOURCE_TYPE, { codeDirectory: path.join(__dirname, 'auto-delete-objects-handler'), runtime: CustomResourceProviderRuntime.NODEJS_12, + description: `Lambda function for auto-deleting objects in ${this.bucketName} S3 bucket.`, }); // Use a bucket policy to allow the custom resource to delete diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.expected.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.expected.json index d9f263a8d840d..831d072339649 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.expected.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.expected.json @@ -148,7 +148,19 @@ "Arn" ] }, - "Runtime": "nodejs12.x" + "Runtime": "nodejs12.x", + "Description": { + "Fn::Join": [ + "", + [ + "Lambda function for auto-deleting objects in ", + { + "Ref": "Bucket83908E77" + }, + " S3 bucket." + ] + ] + } }, "DependsOn": [ "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092" From e8984e3835e0fbf003dd742d399f2ccd6f93b78a Mon Sep 17 00:00:00 2001 From: Robert Djurasaj Date: Thu, 25 Feb 2021 14:33:27 -0700 Subject: [PATCH 34/78] chore(core): remove hardcoded runtime value in favor of user provided selection (#13285) Currently Custom Resource Provider has `nodejs12.x` hardcoded. This commit will change this in favor of user selected runtime (only nodejs12 at this time). ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../lib/custom-resource-provider/custom-resource-provider.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/core/lib/custom-resource-provider/custom-resource-provider.ts b/packages/@aws-cdk/core/lib/custom-resource-provider/custom-resource-provider.ts index 8550efd7c72bd..d6b0a2db982c7 100644 --- a/packages/@aws-cdk/core/lib/custom-resource-provider/custom-resource-provider.ts +++ b/packages/@aws-cdk/core/lib/custom-resource-provider/custom-resource-provider.ts @@ -85,7 +85,7 @@ export enum CustomResourceProviderRuntime { /** * Node.js 12.x */ - NODEJS_12 = 'nodejs12' + NODEJS_12 = 'nodejs12.x' } /** @@ -210,7 +210,7 @@ export class CustomResourceProvider extends CoreConstruct { MemorySize: memory.toMebibytes(), Handler: `${ENTRYPOINT_FILENAME}.handler`, Role: role.getAtt('Arn'), - Runtime: 'nodejs12.x', + Runtime: props.runtime, Environment: this.renderEnvironmentVariables(props.environment), Description: props.description ?? undefined, }, From 430c38b0429b8a291d2facb04fe270c8677bb3d8 Mon Sep 17 00:00:00 2001 From: sullis Date: Thu, 25 Feb 2021 14:05:43 -0800 Subject: [PATCH 35/78] chore(init/java): junit 5.7.1 (#12912) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../aws-cdk/lib/init-templates/v1/app/java/pom.template.xml | 2 +- .../lib/init-templates/v1/sample-app/java/pom.template.xml | 2 +- .../aws-cdk/lib/init-templates/v2/app/java/pom.template.xml | 2 +- .../lib/init-templates/v2/sample-app/java/pom.template.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/aws-cdk/lib/init-templates/v1/app/java/pom.template.xml b/packages/aws-cdk/lib/init-templates/v1/app/java/pom.template.xml index 37be67aa2c7a5..fb0b6cf828aaf 100644 --- a/packages/aws-cdk/lib/init-templates/v1/app/java/pom.template.xml +++ b/packages/aws-cdk/lib/init-templates/v1/app/java/pom.template.xml @@ -10,7 +10,7 @@ UTF-8 %cdk-version% - 5.7.0 + 5.7.1 diff --git a/packages/aws-cdk/lib/init-templates/v1/sample-app/java/pom.template.xml b/packages/aws-cdk/lib/init-templates/v1/sample-app/java/pom.template.xml index 0355825bf0a7a..5d679d2570040 100644 --- a/packages/aws-cdk/lib/init-templates/v1/sample-app/java/pom.template.xml +++ b/packages/aws-cdk/lib/init-templates/v1/sample-app/java/pom.template.xml @@ -8,7 +8,7 @@ UTF-8 %cdk-version% - 5.7.0 + 5.7.1 diff --git a/packages/aws-cdk/lib/init-templates/v2/app/java/pom.template.xml b/packages/aws-cdk/lib/init-templates/v2/app/java/pom.template.xml index f49fe7b60e963..5defab0b3a0b6 100644 --- a/packages/aws-cdk/lib/init-templates/v2/app/java/pom.template.xml +++ b/packages/aws-cdk/lib/init-templates/v2/app/java/pom.template.xml @@ -10,7 +10,7 @@ UTF-8 %cdk-version% - 5.7.0 + 5.7.1 diff --git a/packages/aws-cdk/lib/init-templates/v2/sample-app/java/pom.template.xml b/packages/aws-cdk/lib/init-templates/v2/sample-app/java/pom.template.xml index 1236d332e9bab..7f10c89a54dd4 100644 --- a/packages/aws-cdk/lib/init-templates/v2/sample-app/java/pom.template.xml +++ b/packages/aws-cdk/lib/init-templates/v2/sample-app/java/pom.template.xml @@ -8,7 +8,7 @@ UTF-8 %cdk-version% - 5.7.0 + 5.7.1 From c4a239c856abe47022acf59b1d03c65548bb81ad Mon Sep 17 00:00:00 2001 From: Jerry Kindall <52084730+Jerry-AWS@users.noreply.github.com> Date: Thu, 25 Feb 2021 14:37:57 -0800 Subject: [PATCH 36/78] chore(init-templates): Python app template imports 'core' as 'cdk' to align sample code across languages (#12970) For consistency and to make it easier to translate TypeScript examples into Python, import the `aws_cdk.core` module as `cdk`. There are snippets in the CDK Developer Guide that assume the `core` module is imported as `core`. It is difficult to synchronize changes to the CDK with changes in the Guide, so this PR causes the `core` module to be imported under _both_ names. Once this change is released, the Guide snippets can be updated to use `cdk` rather than `core` to refer to the `core` module. At some point in the future, this template can be updated again to remove the now-redundant `core` import. This is to support this Guide issue: https://github.com/awsdocs/aws-cdk-guide/issues/268 which intends to make all code snippets in the Guide follow the guidance in the "Working with the CDK in Python" topic. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../%name.PythonModule%_stack.template.py | 10 ++++++++-- .../lib/init-templates/v1/app/python/app.template.py | 8 +++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/packages/aws-cdk/lib/init-templates/v1/app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py b/packages/aws-cdk/lib/init-templates/v1/app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py index 9d86ad16906e6..6b4ed6e8ea6ed 100644 --- a/packages/aws-cdk/lib/init-templates/v1/app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py +++ b/packages/aws-cdk/lib/init-templates/v1/app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py @@ -1,9 +1,15 @@ +from aws_cdk import core as cdk + +# For consistency with other languages, `cdk` is the preferred import name for +# the CDK's core module. The following line also imports it as `core` for use +# with examples from the CDK Developer's Guide, which are in the process of +# being updated to use `cdk`. You may delete this import if you don't need it. from aws_cdk import core -class %name.PascalCased%Stack(core.Stack): +class %name.PascalCased%Stack(cdk.Stack): - def __init__(self, scope: core.Construct, construct_id: str, **kwargs) -> None: + def __init__(self, scope: cdk.Construct, construct_id: str, **kwargs) -> None: super().__init__(scope, construct_id, **kwargs) # The code that defines your stack goes here diff --git a/packages/aws-cdk/lib/init-templates/v1/app/python/app.template.py b/packages/aws-cdk/lib/init-templates/v1/app/python/app.template.py index 808bc22af32e4..bc43099fd2026 100644 --- a/packages/aws-cdk/lib/init-templates/v1/app/python/app.template.py +++ b/packages/aws-cdk/lib/init-templates/v1/app/python/app.template.py @@ -1,11 +1,17 @@ #!/usr/bin/env python3 +from aws_cdk import core as cdk + +# For consistency with TypeScript code, `cdk` is the preferred import name for +# the CDK's core module. The following line also imports it as `core` for use +# with examples from the CDK Developer's Guide, which are in the process of +# being updated to use `cdk`. You may delete this import if you don't need it. from aws_cdk import core from %name.PythonModule%.%name.PythonModule%_stack import %name.PascalCased%Stack -app = core.App() +app = cdk.App() %name.PascalCased%Stack(app, "%name.StackName%") app.synth() From d331afea941ae502ae0ab1a11254a0b7fc14cdec Mon Sep 17 00:00:00 2001 From: Jonathan Goldwasser Date: Fri, 26 Feb 2021 08:08:17 +0100 Subject: [PATCH 37/78] chore(stepfunctions-tasks): default to NODEJS_14_X for EvaluateExpression (#13267) Closes #13224 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../aws-stepfunctions-tasks/README.md | 7 +++--- .../index.ts | 0 .../lib/evaluate-expression.ts | 9 +++---- ...er.test.ts => eval-nodejs-handler.test.ts} | 2 +- .../test/evaluate-expression.test.ts | 2 +- .../integ.evaluate-expression.expected.json | 24 +++++++++---------- 6 files changed, 22 insertions(+), 22 deletions(-) rename packages/@aws-cdk/aws-stepfunctions-tasks/lib/{eval-nodejs10.x-handler => eval-nodejs-handler}/index.ts (100%) rename packages/@aws-cdk/aws-stepfunctions-tasks/test/{eval-nodejs10.x-handler.test.ts => eval-nodejs-handler.test.ts} (96%) diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/README.md b/packages/@aws-cdk/aws-stepfunctions-tasks/README.md index 38305b270da69..d7c2d1498394d 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/README.md +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/README.md @@ -189,7 +189,7 @@ const convertToSeconds = new tasks.EvaluateExpression(this, 'Convert to seconds' const createMessage = new tasks.EvaluateExpression(this, 'Create message', { // Note: this is a string inside a string. expression: '`Now waiting ${$.waitSeconds} seconds...`', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, resultPath: '$.message', }); @@ -212,9 +212,8 @@ new sfn.StateMachine(this, 'StateMachine', { ``` The `EvaluateExpression` supports a `runtime` prop to specify the Lambda -runtime to use to evaluate the expression. Currently, the only runtime -supported is `lambda.Runtime.NODEJS_10_X`. - +runtime to use to evaluate the expression. Currently, only runtimes +of the Node.js family are supported. ## Athena diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/eval-nodejs10.x-handler/index.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/eval-nodejs-handler/index.ts similarity index 100% rename from packages/@aws-cdk/aws-stepfunctions-tasks/lib/eval-nodejs10.x-handler/index.ts rename to packages/@aws-cdk/aws-stepfunctions-tasks/lib/eval-nodejs-handler/index.ts diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/evaluate-expression.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/evaluate-expression.ts index 45457a1c377c8..64c25d5e3dd3a 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/evaluate-expression.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/evaluate-expression.ts @@ -20,7 +20,7 @@ export interface EvaluateExpressionProps extends sfn.TaskStateBaseProps { /** * The runtime language to use to evaluate the expression. * - * @default lambda.Runtime.NODEJS_10_X + * @default lambda.Runtime.NODEJS_14_X */ readonly runtime?: lambda.Runtime; } @@ -58,7 +58,7 @@ export class EvaluateExpression extends sfn.TaskStateBase { constructor(scope: Construct, id: string, private readonly props: EvaluateExpressionProps) { super(scope, id, props); - this.evalFn = createEvalFn(this.props.runtime || lambda.Runtime.NODEJS_10_X, this); + this.evalFn = createEvalFn(this.props.runtime ?? lambda.Runtime.NODEJS_14_X, this); this.taskPolicies = [ new iam.PolicyStatement({ @@ -97,17 +97,18 @@ export class EvaluateExpression extends sfn.TaskStateBase { } function createEvalFn(runtime: lambda.Runtime, scope: Construct) { - const code = lambda.Code.asset(path.join(__dirname, `eval-${runtime.name}-handler`)); const lambdaPurpose = 'Eval'; switch (runtime) { + case lambda.Runtime.NODEJS_14_X: + case lambda.Runtime.NODEJS_12_X: case lambda.Runtime.NODEJS_10_X: return new lambda.SingletonFunction(scope, 'EvalFunction', { runtime, handler: 'index.handler', uuid: 'a0d2ce44-871b-4e74-87a1-f5e63d7c3bdc', lambdaPurpose, - code, + code: lambda.Code.fromAsset(path.join(__dirname, 'eval-nodejs-handler')), }); // TODO: implement other runtimes default: diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/eval-nodejs10.x-handler.test.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/test/eval-nodejs-handler.test.ts similarity index 96% rename from packages/@aws-cdk/aws-stepfunctions-tasks/test/eval-nodejs10.x-handler.test.ts rename to packages/@aws-cdk/aws-stepfunctions-tasks/test/eval-nodejs-handler.test.ts index d42be11d7aaa4..8d69e9d3b8105 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/eval-nodejs10.x-handler.test.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/eval-nodejs-handler.test.ts @@ -1,5 +1,5 @@ import { Event } from '../lib'; -import { handler } from '../lib/eval-nodejs10.x-handler'; +import { handler } from '../lib/eval-nodejs-handler'; test('with numbers', async () => { // GIVEN diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/evaluate-expression.test.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/test/evaluate-expression.test.ts index 679e817dfbead..7a2aa196b3de2 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/evaluate-expression.test.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/evaluate-expression.test.ts @@ -34,7 +34,7 @@ test('Eval with Node.js', () => { }); expect(stack).toHaveResource('AWS::Lambda::Function', { - Runtime: 'nodejs10.x', + Runtime: 'nodejs14.x', }); }); diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/integ.evaluate-expression.expected.json b/packages/@aws-cdk/aws-stepfunctions-tasks/test/integ.evaluate-expression.expected.json index efdf3878e67e2..c48b04a826783 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/integ.evaluate-expression.expected.json +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/integ.evaluate-expression.expected.json @@ -36,7 +36,7 @@ "Properties": { "Code": { "S3Bucket": { - "Ref": "AssetParameters640b7d3e1a6ff78c1cad25c2d7396d04c74d6eee31b116f4c86d910338d480d0S3BucketA16CB30E" + "Ref": "AssetParametersbc320c7bd6a0eba90db647aa586cf65548560a54c141153fdc12f22eb3b2626bS3Bucket743A2950" }, "S3Key": { "Fn::Join": [ @@ -49,7 +49,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters640b7d3e1a6ff78c1cad25c2d7396d04c74d6eee31b116f4c86d910338d480d0S3VersionKey102DBBD9" + "Ref": "AssetParametersbc320c7bd6a0eba90db647aa586cf65548560a54c141153fdc12f22eb3b2626bS3VersionKey2DBCB833" } ] } @@ -62,7 +62,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters640b7d3e1a6ff78c1cad25c2d7396d04c74d6eee31b116f4c86d910338d480d0S3VersionKey102DBBD9" + "Ref": "AssetParametersbc320c7bd6a0eba90db647aa586cf65548560a54c141153fdc12f22eb3b2626bS3VersionKey2DBCB833" } ] } @@ -72,14 +72,14 @@ ] } }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "Evala0d2ce44871b4e7487a1f5e63d7c3bdcServiceRoleDC85DDD3", "Arn" ] }, - "Runtime": "nodejs10.x" + "Handler": "index.handler", + "Runtime": "nodejs14.x" }, "DependsOn": [ "Evala0d2ce44871b4e7487a1f5e63d7c3bdcServiceRoleDC85DDD3" @@ -185,17 +185,17 @@ } }, "Parameters": { - "AssetParameters640b7d3e1a6ff78c1cad25c2d7396d04c74d6eee31b116f4c86d910338d480d0S3BucketA16CB30E": { + "AssetParametersbc320c7bd6a0eba90db647aa586cf65548560a54c141153fdc12f22eb3b2626bS3Bucket743A2950": { "Type": "String", - "Description": "S3 bucket for asset \"640b7d3e1a6ff78c1cad25c2d7396d04c74d6eee31b116f4c86d910338d480d0\"" + "Description": "S3 bucket for asset \"bc320c7bd6a0eba90db647aa586cf65548560a54c141153fdc12f22eb3b2626b\"" }, - "AssetParameters640b7d3e1a6ff78c1cad25c2d7396d04c74d6eee31b116f4c86d910338d480d0S3VersionKey102DBBD9": { + "AssetParametersbc320c7bd6a0eba90db647aa586cf65548560a54c141153fdc12f22eb3b2626bS3VersionKey2DBCB833": { "Type": "String", - "Description": "S3 key for asset version \"640b7d3e1a6ff78c1cad25c2d7396d04c74d6eee31b116f4c86d910338d480d0\"" + "Description": "S3 key for asset version \"bc320c7bd6a0eba90db647aa586cf65548560a54c141153fdc12f22eb3b2626b\"" }, - "AssetParameters640b7d3e1a6ff78c1cad25c2d7396d04c74d6eee31b116f4c86d910338d480d0ArtifactHash43D553D7": { + "AssetParametersbc320c7bd6a0eba90db647aa586cf65548560a54c141153fdc12f22eb3b2626bArtifactHashAD6C554B": { "Type": "String", - "Description": "Artifact hash for asset \"640b7d3e1a6ff78c1cad25c2d7396d04c74d6eee31b116f4c86d910338d480d0\"" + "Description": "Artifact hash for asset \"bc320c7bd6a0eba90db647aa586cf65548560a54c141153fdc12f22eb3b2626b\"" } }, "Outputs": { @@ -205,4 +205,4 @@ } } } -} +} \ No newline at end of file From c174f6c2f4dd909e07be34b66bd6b3a92d5e8484 Mon Sep 17 00:00:00 2001 From: Josh Kellendonk Date: Fri, 26 Feb 2021 06:31:27 -0700 Subject: [PATCH 38/78] fix(ecs): services essential container exceptions thrown too soon (#13240) This PR defers the `A TaskDefinition must have at least one essential container` error to the validate phase. Closes #13239 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts | 6 +-- .../aws-ecs/lib/fargate/fargate-service.ts | 6 +-- .../aws-ecs/test/ec2/ec2-service.test.ts | 44 ++++++++++++++++--- .../test/fargate/fargate-service.test.ts | 40 +++++++++++++++-- 4 files changed, 81 insertions(+), 15 deletions(-) diff --git a/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts b/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts index 18c6df350fb4e..ec0122df390ac 100644 --- a/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts +++ b/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts @@ -229,9 +229,9 @@ export class Ec2Service extends BaseService implements IEc2Service { this.addPlacementConstraints(...props.placementConstraints || []); this.addPlacementStrategies(...props.placementStrategies || []); - if (!this.taskDefinition.defaultContainer) { - throw new Error('A TaskDefinition must have at least one essential container'); - } + this.node.addValidation({ + validate: () => !this.taskDefinition.defaultContainer ? ['A TaskDefinition must have at least one essential container'] : [], + }); } /** diff --git a/packages/@aws-cdk/aws-ecs/lib/fargate/fargate-service.ts b/packages/@aws-cdk/aws-ecs/lib/fargate/fargate-service.ts index 1db94fc5286e0..793fb633e83d0 100644 --- a/packages/@aws-cdk/aws-ecs/lib/fargate/fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs/lib/fargate/fargate-service.ts @@ -172,9 +172,9 @@ export class FargateService extends BaseService implements IFargateService { this.configureAwsVpcNetworkingWithSecurityGroups(props.cluster.vpc, props.assignPublicIp, props.vpcSubnets, securityGroups); - if (!props.taskDefinition.defaultContainer) { - throw new Error('A TaskDefinition must have at least one essential container'); - } + this.node.addValidation({ + validate: () => !this.taskDefinition.defaultContainer ? ['A TaskDefinition must have at least one essential container'] : [], + }); } } diff --git a/packages/@aws-cdk/aws-ecs/test/ec2/ec2-service.test.ts b/packages/@aws-cdk/aws-ecs/test/ec2/ec2-service.test.ts index 2279245aebaa4..d88c5ecafd1d7 100644 --- a/packages/@aws-cdk/aws-ecs/test/ec2/ec2-service.test.ts +++ b/packages/@aws-cdk/aws-ecs/test/ec2/ec2-service.test.ts @@ -1,4 +1,4 @@ -import { expect, haveResource } from '@aws-cdk/assert'; +import { expect, haveResource, haveResourceLike } from '@aws-cdk/assert'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as elb from '@aws-cdk/aws-elasticloadbalancing'; import * as elbv2 from '@aws-cdk/aws-elasticloadbalancingv2'; @@ -541,14 +541,48 @@ nodeunitShim({ const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc }); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef'); + // Errors on validation, not on construction. + new ecs.Ec2Service(stack, 'Ec2Service', { + cluster, + taskDefinition, + }); + // THEN test.throws(() => { - new ecs.Ec2Service(stack, 'Ec2Service', { - cluster, - taskDefinition, - }); + expect(stack); + }, /one essential container/); + + test.done(); + }, + + 'allows adding the default container after creating the service'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'MyVpc', {}); + const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc }); + cluster.addCapacity('DefaultAutoScalingGroup', { instanceType: new ec2.InstanceType('t2.micro') }); + const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef'); + + new ecs.Ec2Service(stack, 'FargateService', { + cluster, + taskDefinition, }); + // Add the container *after* creating the service + taskDefinition.addContainer('main', { + image: ecs.ContainerImage.fromRegistry('somecontainer'), + memoryReservationMiB: 10, + }); + + // THEN + expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + ContainerDefinitions: [ + { + Name: 'main', + }, + ], + })); + test.done(); }, diff --git a/packages/@aws-cdk/aws-ecs/test/fargate/fargate-service.test.ts b/packages/@aws-cdk/aws-ecs/test/fargate/fargate-service.test.ts index acddf713d6d0a..c7aa1fc633a1d 100644 --- a/packages/@aws-cdk/aws-ecs/test/fargate/fargate-service.test.ts +++ b/packages/@aws-cdk/aws-ecs/test/fargate/fargate-service.test.ts @@ -482,14 +482,46 @@ nodeunitShim({ const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc }); const taskDefinition = new ecs.FargateTaskDefinition(stack, 'FargateTaskDef'); + // Errors on validation, not on construction. + new ecs.FargateService(stack, 'FargateService', { + cluster, + taskDefinition, + }); + // THEN test.throws(() => { - new ecs.FargateService(stack, 'FargateService', { - cluster, - taskDefinition, - }); + expect(stack); + }, /one essential container/); + + test.done(); + }, + + 'allows adding the default container after creating the service'(test: Test) { + // 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'); + + new ecs.FargateService(stack, 'FargateService', { + cluster, + taskDefinition, }); + // Add the container *after* creating the service + taskDefinition.addContainer('main', { + image: ecs.ContainerImage.fromRegistry('somecontainer'), + }); + + // THEN + expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { + ContainerDefinitions: [ + { + Name: 'main', + }, + ], + })); + test.done(); }, From 81a78a31408276ebb020e45b15ddca7a2c57ae50 Mon Sep 17 00:00:00 2001 From: Massimo Prencipe Date: Fri, 26 Feb 2021 16:04:34 +0200 Subject: [PATCH 39/78] fix(ec2): Throw error on empty InitFile content (#13009) (#13119) Validate InitFile content to catch error during synth instead of deploy. Fixes issue #13009 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-ec2/lib/cfn-init-elements.ts | 3 +++ packages/@aws-cdk/aws-ec2/test/cfn-init-element.test.ts | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/packages/@aws-cdk/aws-ec2/lib/cfn-init-elements.ts b/packages/@aws-cdk/aws-ec2/lib/cfn-init-elements.ts index a190c17d7aa20..646d6b2dcbfa4 100644 --- a/packages/@aws-cdk/aws-ec2/lib/cfn-init-elements.ts +++ b/packages/@aws-cdk/aws-ec2/lib/cfn-init-elements.ts @@ -327,6 +327,9 @@ export abstract class InitFile extends InitElement { * Use a literal string as the file content */ public static fromString(fileName: string, content: string, options: InitFileOptions = {}): InitFile { + if (!content) { + throw new Error(`InitFile ${fileName}: cannot create empty file. Please supply at least one character of content.`); + } return new class extends InitFile { protected _doBind(bindOptions: InitBindOptions) { return { diff --git a/packages/@aws-cdk/aws-ec2/test/cfn-init-element.test.ts b/packages/@aws-cdk/aws-ec2/test/cfn-init-element.test.ts index e794021c46b8f..75896912f3661 100644 --- a/packages/@aws-cdk/aws-ec2/test/cfn-init-element.test.ts +++ b/packages/@aws-cdk/aws-ec2/test/cfn-init-element.test.ts @@ -206,6 +206,12 @@ describe('InitFile', () => { }); }); + test('empty content string throws error', () => { + expect(() => { + ec2.InitFile.fromString('/tmp/foo', ''); + }).toThrow('InitFile /tmp/foo: cannot create empty file. Please supply at least one character of content.'); + }); + test('symlink throws an error if mode is set incorrectly', () => { expect(() => { ec2.InitFile.symlink('/tmp/foo', '/tmp/bar', { From fc8757437c37a0947cced720ff363b8858850f72 Mon Sep 17 00:00:00 2001 From: Brian Celenza Date: Fri, 26 Feb 2021 06:37:19 -0800 Subject: [PATCH 40/78] feat(ec2): Add VPC endpoint for RDS (#12497) Adds VPC endpoint support for RDS. Fixes #12402 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-ec2/lib/vpc-endpoint.ts | 1 + packages/@aws-cdk/aws-ec2/package.json | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/@aws-cdk/aws-ec2/lib/vpc-endpoint.ts b/packages/@aws-cdk/aws-ec2/lib/vpc-endpoint.ts index 197946716f969..2250bdd37c6c3 100644 --- a/packages/@aws-cdk/aws-ec2/lib/vpc-endpoint.ts +++ b/packages/@aws-cdk/aws-ec2/lib/vpc-endpoint.ts @@ -287,6 +287,7 @@ export class InterfaceVpcEndpointAwsService implements IInterfaceVpcEndpointServ public static readonly KMS = new InterfaceVpcEndpointAwsService('kms'); public static readonly CLOUDWATCH_LOGS = new InterfaceVpcEndpointAwsService('logs'); public static readonly CLOUDWATCH = new InterfaceVpcEndpointAwsService('monitoring'); + public static readonly RDS = new InterfaceVpcEndpointAwsService('rds'); public static readonly SAGEMAKER_API = new InterfaceVpcEndpointAwsService('sagemaker.api'); public static readonly SAGEMAKER_RUNTIME = new InterfaceVpcEndpointAwsService('sagemaker.runtime'); public static readonly SAGEMAKER_RUNTIME_FIPS = new InterfaceVpcEndpointAwsService('sagemaker.runtime-fips'); diff --git a/packages/@aws-cdk/aws-ec2/package.json b/packages/@aws-cdk/aws-ec2/package.json index 624577f547b62..801040d4c7385 100644 --- a/packages/@aws-cdk/aws-ec2/package.json +++ b/packages/@aws-cdk/aws-ec2/package.json @@ -233,6 +233,7 @@ "docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.KINESIS_STREAMS", "docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.KINESIS_FIREHOSE", "docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.KMS", + "docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.RDS", "docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.SAGEMAKER_API", "docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.SAGEMAKER_NOTEBOOK", "docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.SAGEMAKER_RUNTIME", From ea91aa31db9e2f31c734ad6d7e1f64d5d432dfd4 Mon Sep 17 00:00:00 2001 From: Alan Raison Date: Fri, 26 Feb 2021 15:09:50 +0000 Subject: [PATCH 41/78] feat(aws-events): Event Bus target (#12926) Closes #9473 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../@aws-cdk/aws-events-targets/README.md | 1 + .../aws-events-targets/lib/event-bus.ts | 45 +++++++++ .../@aws-cdk/aws-events-targets/lib/index.ts | 1 + .../test/event-bus/event-rule-target.test.ts | 93 +++++++++++++++++++ .../event-bus/integ.event-bus.expected.json | 83 +++++++++++++++++ .../test/event-bus/integ.event-bus.ts | 26 ++++++ 6 files changed, 249 insertions(+) create mode 100644 packages/@aws-cdk/aws-events-targets/lib/event-bus.ts create mode 100644 packages/@aws-cdk/aws-events-targets/test/event-bus/event-rule-target.test.ts create mode 100644 packages/@aws-cdk/aws-events-targets/test/event-bus/integ.event-bus.expected.json create mode 100644 packages/@aws-cdk/aws-events-targets/test/event-bus/integ.event-bus.ts diff --git a/packages/@aws-cdk/aws-events-targets/README.md b/packages/@aws-cdk/aws-events-targets/README.md index 787bfcc433d30..ba0e83c2a82ba 100644 --- a/packages/@aws-cdk/aws-events-targets/README.md +++ b/packages/@aws-cdk/aws-events-targets/README.md @@ -27,6 +27,7 @@ Currently supported are: * Put a record to a Kinesis stream * Log an event into a LogGroup * Put a record to a Kinesis Data Firehose stream +* Put an event on an EventBridge bus See the README of the `@aws-cdk/aws-events` library for more information on EventBridge. diff --git a/packages/@aws-cdk/aws-events-targets/lib/event-bus.ts b/packages/@aws-cdk/aws-events-targets/lib/event-bus.ts new file mode 100644 index 0000000000000..1d07261a8eace --- /dev/null +++ b/packages/@aws-cdk/aws-events-targets/lib/event-bus.ts @@ -0,0 +1,45 @@ +import * as events from '@aws-cdk/aws-events'; +import * as iam from '@aws-cdk/aws-iam'; +import { singletonEventRole } from './util'; + +/** + * Configuration properties of an Event Bus event + */ +export interface EventBusProps { + /** + * Role to be used to publish the event + * + * @default a new role is created. + */ + readonly role?: iam.IRole; +} + +/** + * Notify an existing Event Bus of an event + */ +export class EventBus implements events.IRuleTarget { + private readonly role?: iam.IRole; + + constructor(private readonly eventBus: events.IEventBus, props: EventBusProps = {}) { + this.role = props.role; + } + + bind(rule: events.IRule, id?: string): events.RuleTargetConfig { + if (this.role) { + this.role.addToPrincipalPolicy(this.putEventStatement()); + } + const role = this.role ?? singletonEventRole(rule, [this.putEventStatement()]); + return { + id: id ?? '', + arn: this.eventBus.eventBusArn, + role, + }; + } + + private putEventStatement() { + return new iam.PolicyStatement({ + actions: ['events:PutEvents'], + resources: [this.eventBus.eventBusArn], + }); + } +} diff --git a/packages/@aws-cdk/aws-events-targets/lib/index.ts b/packages/@aws-cdk/aws-events-targets/lib/index.ts index bef8ce2463ffa..155791c195d1e 100644 --- a/packages/@aws-cdk/aws-events-targets/lib/index.ts +++ b/packages/@aws-cdk/aws-events-targets/lib/index.ts @@ -7,6 +7,7 @@ export * from './aws-api'; export * from './lambda'; export * from './ecs-task-properties'; export * from './ecs-task'; +export * from './event-bus'; export * from './state-machine'; export * from './kinesis-stream'; export * from './log-group'; diff --git a/packages/@aws-cdk/aws-events-targets/test/event-bus/event-rule-target.test.ts b/packages/@aws-cdk/aws-events-targets/test/event-bus/event-rule-target.test.ts new file mode 100644 index 0000000000000..4c39a907210d7 --- /dev/null +++ b/packages/@aws-cdk/aws-events-targets/test/event-bus/event-rule-target.test.ts @@ -0,0 +1,93 @@ +import '@aws-cdk/assert/jest'; +import * as events from '@aws-cdk/aws-events'; +import * as iam from '@aws-cdk/aws-iam'; +import { Stack } from '@aws-cdk/core'; +import * as targets from '../../lib'; + +test('Use EventBus as an event rule target', () => { + const stack = new Stack(); + const rule = new events.Rule(stack, 'Rule', { + schedule: events.Schedule.expression('rate(1 min)'), + }); + + rule.addTarget(new targets.EventBus(events.EventBus.fromEventBusArn( + stack, + 'External', + 'arn:aws:events:us-east-1:111111111111:default', + ), + )); + + expect(stack).toHaveResource('AWS::Events::Rule', { + Targets: [ + { + Arn: 'arn:aws:events:us-east-1:111111111111:default', + Id: 'Target0', + RoleArn: { + 'Fn::GetAtt': [ + 'RuleEventsRoleC51A4248', + 'Arn', + ], + }, + }, + ], + }); + expect(stack).toHaveResource('AWS::IAM::Policy', { + PolicyDocument: { + Statement: [{ + Effect: 'Allow', + Action: 'events:PutEvents', + Resource: 'arn:aws:events:us-east-1:111111111111:default', + }], + Version: '2012-10-17', + }, + Roles: [{ + Ref: 'RuleEventsRoleC51A4248', + }], + }); +}); + +test('with supplied role', () => { + const stack = new Stack(); + const rule = new events.Rule(stack, 'Rule', { + schedule: events.Schedule.expression('rate(1 min)'), + }); + const role = new iam.Role(stack, 'Role', { + assumedBy: new iam.ServicePrincipal('events.amazonaws.com'), + roleName: 'GivenRole', + }); + + rule.addTarget(new targets.EventBus( + events.EventBus.fromEventBusArn( + stack, + 'External', + 'arn:aws:events:us-east-1:123456789012:default', + ), + { role }, + )); + + expect(stack).toHaveResource('AWS::Events::Rule', { + Targets: [{ + Arn: 'arn:aws:events:us-east-1:123456789012:default', + Id: 'Target0', + RoleArn: { + 'Fn::GetAtt': [ + 'Role1ABCC5F0', + 'Arn', + ], + }, + }], + }); + expect(stack).toHaveResource('AWS::IAM::Policy', { + PolicyDocument: { + Statement: [{ + Effect: 'Allow', + Action: 'events:PutEvents', + Resource: 'arn:aws:events:us-east-1:123456789012:default', + }], + Version: '2012-10-17', + }, + Roles: [{ + Ref: 'Role1ABCC5F0', + }], + }); +}); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-events-targets/test/event-bus/integ.event-bus.expected.json b/packages/@aws-cdk/aws-events-targets/test/event-bus/integ.event-bus.expected.json new file mode 100644 index 0000000000000..632ddf1767598 --- /dev/null +++ b/packages/@aws-cdk/aws-events-targets/test/event-bus/integ.event-bus.expected.json @@ -0,0 +1,83 @@ +{ + "Resources": { + "Rule4C995B7F": { + "Type": "AWS::Events::Rule", + "Properties": { + "ScheduleExpression": "rate(1 minute)", + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Fn::Join": [ + "", + [ + "arn:aws:events:", + { + "Ref": "AWS::Region" + }, + ":999999999999:event-bus/test-bus" + ] + ] + }, + "Id": "Target0", + "RoleArn": { + "Fn::GetAtt": [ + "RuleEventsRoleC51A4248", + "Arn" + ] + } + } + ] + } + }, + "RuleEventsRoleC51A4248": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "events.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "RuleEventsRoleDefaultPolicy0510525D": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "events:PutEvents", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:aws:events:", + { + "Ref": "AWS::Region" + }, + ":999999999999:event-bus/test-bus" + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "RuleEventsRoleDefaultPolicy0510525D", + "Roles": [ + { + "Ref": "RuleEventsRoleC51A4248" + } + ] + } + } + } +} diff --git a/packages/@aws-cdk/aws-events-targets/test/event-bus/integ.event-bus.ts b/packages/@aws-cdk/aws-events-targets/test/event-bus/integ.event-bus.ts new file mode 100644 index 0000000000000..c0ec2ea421b85 --- /dev/null +++ b/packages/@aws-cdk/aws-events-targets/test/event-bus/integ.event-bus.ts @@ -0,0 +1,26 @@ +/// !cdk-integ pragma:ignore-assets +import * as events from '@aws-cdk/aws-events'; +import * as cdk from '@aws-cdk/core'; +import * as targets from '../../lib'; + +const app = new cdk.App(); + +class EventSourceStack extends cdk.Stack { + constructor(scope: cdk.App, id: string, props?: cdk.StackProps) { + super(scope, id, props); + + const rule = new events.Rule(this, 'Rule', { + schedule: events.Schedule.expression('rate(1 minute)'), + }); + rule.addTarget(new targets.EventBus( + events.EventBus.fromEventBusArn( + this, + 'External', + `arn:aws:events:${this.region}:999999999999:event-bus/test-bus`, + ), + )); + } +} + +new EventSourceStack(app, 'event-source-stack'); +app.synth(); From f511639bba156f6edd15896a4dd8e27b07671ea1 Mon Sep 17 00:00:00 2001 From: Josh Kellendonk Date: Fri, 26 Feb 2021 11:32:13 -0700 Subject: [PATCH 42/78] feat(ecs): add port mappings to containers with props (#13262) This PR adds an optional `portMappings` property to `ContainerDefinitionOptions` so that users can add port mappings when they add a container to a `TaskDefinition`. Closes #13261 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-ecs/README.md | 14 +++++- .../aws-ecs/lib/container-definition.ts | 10 ++++ .../aws-ecs/test/container-definition.test.ts | 49 +++++++++++++++++++ .../test/fargate/integ.lb-awsvpc-nw.ts | 11 ++--- 4 files changed, 77 insertions(+), 7 deletions(-) diff --git a/packages/@aws-cdk/aws-ecs/README.md b/packages/@aws-cdk/aws-ecs/README.md index 438f63e14e009..94bdfa5dc17d2 100644 --- a/packages/@aws-cdk/aws-ecs/README.md +++ b/packages/@aws-cdk/aws-ecs/README.md @@ -237,10 +237,22 @@ const container = ec2TaskDefinition.addContainer("WebContainer", { You can specify container properties when you add them to the task definition, or with various methods, e.g.: +To add a port mapping when adding a container to the task definition, specify the `portMappings` option: + +```ts +taskDefinition.addContainer("WebContainer", { + image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"), + memoryLimitMiB: 1024, + portMappings: [{ containerPort: 3000 }] +}); +``` + +To add port mappings directly to a container definition, call `addPortMappings()`: + ```ts container.addPortMappings({ containerPort: 3000 -}) +}); ``` To add data volumes to a task definition, call `addVolume()`: diff --git a/packages/@aws-cdk/aws-ecs/lib/container-definition.ts b/packages/@aws-cdk/aws-ecs/lib/container-definition.ts index 983489743482f..9911a49a039cf 100644 --- a/packages/@aws-cdk/aws-ecs/lib/container-definition.ts +++ b/packages/@aws-cdk/aws-ecs/lib/container-definition.ts @@ -288,6 +288,12 @@ export interface ContainerDefinitionOptions { * @default - No GPUs assigned. */ readonly gpuCount?: number; + + /** + * The port mappings to add to the container definition. + * @default - No ports are mapped. + */ + readonly portMappings?: PortMapping[]; } /** @@ -433,6 +439,10 @@ export class ContainerDefinition extends CoreConstruct { } props.taskDefinition._linkContainer(this); + + if (props.portMappings) { + this.addPortMappings(...props.portMappings); + } } /** diff --git a/packages/@aws-cdk/aws-ecs/test/container-definition.test.ts b/packages/@aws-cdk/aws-ecs/test/container-definition.test.ts index 0e42a0aecc381..81e9f274160b7 100644 --- a/packages/@aws-cdk/aws-ecs/test/container-definition.test.ts +++ b/packages/@aws-cdk/aws-ecs/test/container-definition.test.ts @@ -703,6 +703,55 @@ describe('container definition', () => { }); + test('can add port mappings to the container definition by props', () => { + // GIVEN + const stack = new cdk.Stack(); + const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); + + // WHEN + taskDefinition.addContainer('cont', { + image: ecs.ContainerImage.fromRegistry('test'), + memoryLimitMiB: 1024, + portMappings: [{ containerPort: 80 }], + }); + + // THEN + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { + ContainerDefinitions: [ + { + PortMappings: [{ ContainerPort: 80 }], + }, + ], + }); + }); + + test('can add port mappings using props and addPortMappings and both are included', () => { + // GIVEN + const stack = new cdk.Stack(); + const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); + + // WHEN + const containerDefinition = taskDefinition.addContainer('cont', { + image: ecs.ContainerImage.fromRegistry('test'), + memoryLimitMiB: 1024, + portMappings: [{ containerPort: 80 }], + }); + + containerDefinition.addPortMappings({ containerPort: 443 }); + + // THEN + expect(stack).toHaveResourceLike('AWS::ECS::TaskDefinition', { + ContainerDefinitions: [ + { + PortMappings: [ + { ContainerPort: 80 }, + { ContainerPort: 443 }, + ], + }, + ], + }); + }); + describe('Environment Files', () => { describe('with EC2 task definitions', () => { test('can add asset environment file to the container definition', () => { diff --git a/packages/@aws-cdk/aws-ecs/test/fargate/integ.lb-awsvpc-nw.ts b/packages/@aws-cdk/aws-ecs/test/fargate/integ.lb-awsvpc-nw.ts index d333fd9df89e2..e2d40e4ef52f6 100644 --- a/packages/@aws-cdk/aws-ecs/test/fargate/integ.lb-awsvpc-nw.ts +++ b/packages/@aws-cdk/aws-ecs/test/fargate/integ.lb-awsvpc-nw.ts @@ -15,13 +15,12 @@ const taskDefinition = new ecs.FargateTaskDefinition(stack, 'TaskDef', { cpu: 512, }); -const container = taskDefinition.addContainer('web', { +taskDefinition.addContainer('web', { image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'), -}); - -container.addPortMappings({ - containerPort: 80, - protocol: ecs.Protocol.TCP, + portMappings: [{ + containerPort: 80, + protocol: ecs.Protocol.TCP, + }], }); const service = new ecs.FargateService(stack, 'Service', { From 266a621abfc34c62ff1e26de9cb8cf0687588f89 Mon Sep 17 00:00:00 2001 From: Otavio Macedo Date: Fri, 26 Feb 2021 19:39:12 +0000 Subject: [PATCH 43/78] fix(ecr): Allow referencing an EcrImage by digest instead of tag (#13299) Fixes #5082 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-ecr/lib/repository.ts | 32 +++- packages/@aws-cdk/aws-ecs/lib/images/ecr.ts | 8 +- .../test/ec2/ec2-task-definition.test.ts | 140 ++++++++++++++++++ 3 files changed, 177 insertions(+), 3 deletions(-) diff --git a/packages/@aws-cdk/aws-ecr/lib/repository.ts b/packages/@aws-cdk/aws-ecr/lib/repository.ts index 83c05ba1ed308..3787903dedc3e 100644 --- a/packages/@aws-cdk/aws-ecr/lib/repository.ts +++ b/packages/@aws-cdk/aws-ecr/lib/repository.ts @@ -39,6 +39,15 @@ export interface IRepository extends IResource { */ repositoryUriForTag(tag?: string): string; + /** + * Returns the URI of the repository for a certain tag. Can be used in `docker push/pull`. + * + * ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST] + * + * @param digest Image digest to use (tools usually default to the image with the "latest" tag if omitted) + */ + repositoryUriForDigest(digest?: string): string; + /** * Add a policy statement to the repository's resource policy */ @@ -136,8 +145,29 @@ export abstract class RepositoryBase extends Resource implements IRepository { */ public repositoryUriForTag(tag?: string): string { const tagSuffix = tag ? `:${tag}` : ''; + return this.repositoryUriWithSuffix(tagSuffix); + } + + /** + * Returns the URL of the repository. Can be used in `docker push/pull`. + * + * ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST] + * + * @param digest Optional image digest + */ + public repositoryUriForDigest(digest?: string): string { + const digestSuffix = digest ? `@${digest}` : ''; + return this.repositoryUriWithSuffix(digestSuffix); + } + + /** + * Returns the repository URI, with an appended suffix, if provided. + * @param suffix An image tag or an image digest. + * @private + */ + private repositoryUriWithSuffix(suffix?: string): string { const parts = this.stack.parseArn(this.repositoryArn); - return `${parts.account}.dkr.ecr.${parts.region}.${this.stack.urlSuffix}/${this.repositoryName}${tagSuffix}`; + return `${parts.account}.dkr.ecr.${parts.region}.${this.stack.urlSuffix}/${this.repositoryName}${suffix}`; } /** diff --git a/packages/@aws-cdk/aws-ecs/lib/images/ecr.ts b/packages/@aws-cdk/aws-ecs/lib/images/ecr.ts index e8dc339bf9e82..b9786f13e2816 100644 --- a/packages/@aws-cdk/aws-ecs/lib/images/ecr.ts +++ b/packages/@aws-cdk/aws-ecs/lib/images/ecr.ts @@ -22,10 +22,14 @@ export class EcrImage extends ContainerImage { /** * Constructs a new instance of the EcrImage class. */ - constructor(private readonly repository: ecr.IRepository, private readonly tag: string) { + constructor(private readonly repository: ecr.IRepository, private readonly tagOrDigest: string) { super(); - this.imageName = this.repository.repositoryUriForTag(this.tag); + if (tagOrDigest?.startsWith('sha256:')) { + this.imageName = this.repository.repositoryUriForDigest(this.tagOrDigest); + } else { + this.imageName = this.repository.repositoryUriForTag(this.tagOrDigest); + } } public bind(_scope: CoreConstruct, containerDefinition: ContainerDefinition): ContainerImageConfig { diff --git a/packages/@aws-cdk/aws-ecs/test/ec2/ec2-task-definition.test.ts b/packages/@aws-cdk/aws-ecs/test/ec2/ec2-task-definition.test.ts index 60c39d2103daf..bd13e8b83b524 100644 --- a/packages/@aws-cdk/aws-ecs/test/ec2/ec2-task-definition.test.ts +++ b/packages/@aws-cdk/aws-ecs/test/ec2/ec2-task-definition.test.ts @@ -531,6 +531,146 @@ describe('ec2 task definition', () => { }); + test('correctly sets containers from ECR repository using an image tag', () => { + // GIVEN + const stack = new cdk.Stack(); + + const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef'); + + taskDefinition.addContainer('web', { + image: ecs.ContainerImage.fromEcrRepository(new Repository(stack, 'myECRImage'), 'myTag'), + memoryLimitMiB: 512, + }); + + // THEN + expect(stack).toHaveResource('AWS::ECS::TaskDefinition', { + ContainerDefinitions: [{ + Essential: true, + Memory: 512, + Image: { + 'Fn::Join': [ + '', + [ + { + 'Fn::Select': [ + 4, + { + 'Fn::Split': [ + ':', + { + 'Fn::GetAtt': [ + 'myECRImage7DEAE474', + 'Arn', + ], + }, + ], + }, + ], + }, + '.dkr.ecr.', + { + 'Fn::Select': [ + 3, + { + 'Fn::Split': [ + ':', + { + 'Fn::GetAtt': [ + 'myECRImage7DEAE474', + 'Arn', + ], + }, + ], + }, + ], + }, + '.', + { + Ref: 'AWS::URLSuffix', + }, + '/', + { + Ref: 'myECRImage7DEAE474', + }, + ':myTag', + ], + ], + }, + Name: 'web', + }], + }); + }); + + test('correctly sets containers from ECR repository using an image digest', () => { + // GIVEN + const stack = new cdk.Stack(); + + const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef'); + + taskDefinition.addContainer('web', { + image: ecs.ContainerImage.fromEcrRepository(new Repository(stack, 'myECRImage'), 'sha256:94afd1f2e64d908bc90dbca0035a5b567EXAMPLE'), + memoryLimitMiB: 512, + }); + + // THEN + expect(stack).toHaveResource('AWS::ECS::TaskDefinition', { + ContainerDefinitions: [{ + Essential: true, + Memory: 512, + Image: { + 'Fn::Join': [ + '', + [ + { + 'Fn::Select': [ + 4, + { + 'Fn::Split': [ + ':', + { + 'Fn::GetAtt': [ + 'myECRImage7DEAE474', + 'Arn', + ], + }, + ], + }, + ], + }, + '.dkr.ecr.', + { + 'Fn::Select': [ + 3, + { + 'Fn::Split': [ + ':', + { + 'Fn::GetAtt': [ + 'myECRImage7DEAE474', + 'Arn', + ], + }, + ], + }, + ], + }, + '.', + { + Ref: 'AWS::URLSuffix', + }, + '/', + { + Ref: 'myECRImage7DEAE474', + }, + '@sha256:94afd1f2e64d908bc90dbca0035a5b567EXAMPLE', + ], + ], + }, + Name: 'web', + }], + }); + }); + test('correctly sets containers from ECR repository using default props', () => { // GIVEN const stack = new cdk.Stack(); From 34897c133c5bcb5c1ac53f0e5819dc2be3524ed3 Mon Sep 17 00:00:00 2001 From: Christopher Rybicki Date: Fri, 26 Feb 2021 15:46:29 -0500 Subject: [PATCH 44/78] docs(aws-ecs): typo in docstring (#12672) Corrects a typo in #12621 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts b/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts index ec0122df390ac..4cf4de8a83292 100644 --- a/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts +++ b/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts @@ -249,7 +249,7 @@ export class Ec2Service extends BaseService implements IEc2Service { } /** - * Adds one or more placement contstraints to use for tasks in the service. For more information, see + * Adds one or more placement constraints to use for tasks in the service. For more information, see * [Amazon ECS Task Placement Constraints](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html). */ public addPlacementConstraints(...constraints: PlacementConstraint[]) { From 4f464acf3bbb3f7b9cb5e2e5ac5b6820dda6e3e8 Mon Sep 17 00:00:00 2001 From: Mitchell Valine Date: Fri, 26 Feb 2021 16:42:01 -0800 Subject: [PATCH 45/78] chore(ecs): fix incorrect volume interface docs (#13302) fix: #13282 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-ecs/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/aws-ecs/README.md b/packages/@aws-cdk/aws-ecs/README.md index 94bdfa5dc17d2..efe5126caf004 100644 --- a/packages/@aws-cdk/aws-ecs/README.md +++ b/packages/@aws-cdk/aws-ecs/README.md @@ -258,14 +258,14 @@ container.addPortMappings({ To add data volumes to a task definition, call `addVolume()`: ```ts -const volume = ecs.Volume("Volume", { +const volume = { // Use an Elastic FileSystem name: "mydatavolume", efsVolumeConfiguration: ecs.EfsVolumeConfiguration({ fileSystemId: "EFS" // ... other options here ... }) -}); +}; const container = fargateTaskDefinition.addVolume("mydatavolume"); ``` From 1fcdb6daf931147b8f33facb8ab9c9f80e5c9eee Mon Sep 17 00:00:00 2001 From: Robert Djurasaj Date: Sun, 28 Feb 2021 00:40:07 -0700 Subject: [PATCH 46/78] chore(lambda-destinations): fix typo in docs (#13305) Fix minor typo in lambda-destination docs. cc @nija-at ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-lambda-destinations/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-lambda-destinations/README.md b/packages/@aws-cdk/aws-lambda-destinations/README.md index 8459820e9686e..404b0b3157adb 100644 --- a/packages/@aws-cdk/aws-lambda-destinations/README.md +++ b/packages/@aws-cdk/aws-lambda-destinations/README.md @@ -21,7 +21,7 @@ The following destinations are supported * SNS topic * EventBridge event bus -Example with a SNS topic for sucessful invocations: +Example with a SNS topic for successful invocations: ```ts import * as lambda from '@aws-cdk/aws-lambda'; From f983fbb474ecd6727b0c5a35333718cc55d78bf1 Mon Sep 17 00:00:00 2001 From: Gerald McAlister Date: Sun, 28 Feb 2021 00:48:37 -0800 Subject: [PATCH 47/78] fix(lambda-nodejs): paths with spaces break esbuild (#13312) Problem: Paths with spaces break ESBuild on Windows. Solution: Add double quotes around the input paths for the ESBuild command. Testing: Updated unit tests and confirmed in my own package this fix works. Closes #13311 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../aws-lambda-nodejs/lib/bundling.ts | 4 +-- .../aws-lambda-nodejs/test/bundling.test.ts | 32 ++++--------------- 2 files changed, 8 insertions(+), 28 deletions(-) diff --git a/packages/@aws-cdk/aws-lambda-nodejs/lib/bundling.ts b/packages/@aws-cdk/aws-lambda-nodejs/lib/bundling.ts index 5051fc9012ada..536ca1ea7646a 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/lib/bundling.ts +++ b/packages/@aws-cdk/aws-lambda-nodejs/lib/bundling.ts @@ -140,10 +140,10 @@ export class Bundling implements cdk.BundlingOptions { const esbuildCommand: string = [ npx, 'esbuild', - '--bundle', pathJoin(inputDir, this.relativeEntryPath).replace(/(\s+)/g, '\\$1'), + '--bundle', `"${pathJoin(inputDir, this.relativeEntryPath)}"`, `--target=${this.props.target ?? toTarget(this.props.runtime)}`, '--platform=node', - `--outfile=${pathJoin(outputDir, 'index.js')}`, + `--outfile="${pathJoin(outputDir, 'index.js')}"`, ...this.props.minify ? ['--minify'] : [], ...this.props.sourceMap ? ['--sourcemap'] : [], ...this.externals.map(external => `--external:${external}`), diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/bundling.test.ts b/packages/@aws-cdk/aws-lambda-nodejs/test/bundling.test.ts index 2f96c10ff78ed..382baafee54a0 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/bundling.test.ts +++ b/packages/@aws-cdk/aws-lambda-nodejs/test/bundling.test.ts @@ -53,7 +53,7 @@ test('esbuild bundling in Docker', () => { }, command: [ 'bash', '-c', - 'npx esbuild --bundle /asset-input/lib/handler.ts --target=node12 --platform=node --outfile=/asset-output/index.js --external:aws-sdk --loader:.png=dataurl', + 'npx esbuild --bundle "/asset-input/lib/handler.ts" --target=node12 --platform=node --outfile="/asset-output/index.js" --external:aws-sdk --loader:.png=dataurl', ], workingDirectory: '/', }), @@ -74,7 +74,7 @@ test('esbuild bundling with handler named index.ts', () => { bundling: expect.objectContaining({ command: [ 'bash', '-c', - 'npx esbuild --bundle /asset-input/lib/index.ts --target=node12 --platform=node --outfile=/asset-output/index.js --external:aws-sdk', + 'npx esbuild --bundle "/asset-input/lib/index.ts" --target=node12 --platform=node --outfile="/asset-output/index.js" --external:aws-sdk', ], }), }); @@ -94,7 +94,7 @@ test('esbuild bundling with tsx handler', () => { bundling: expect.objectContaining({ command: [ 'bash', '-c', - 'npx esbuild --bundle /asset-input/lib/handler.tsx --target=node12 --platform=node --outfile=/asset-output/index.js --external:aws-sdk', + 'npx esbuild --bundle "/asset-input/lib/handler.tsx" --target=node12 --platform=node --outfile="/asset-output/index.js" --external:aws-sdk', ], }), }); @@ -139,7 +139,7 @@ test('esbuild bundling with externals and dependencies', () => { command: [ 'bash', '-c', [ - 'npx esbuild --bundle /asset-input/test/bundling.test.js --target=node12 --platform=node --outfile=/asset-output/index.js --external:abc --external:delay', + 'npx esbuild --bundle "/asset-input/test/bundling.test.js" --target=node12 --platform=node --outfile="/asset-output/index.js" --external:abc --external:delay', `echo \'{\"dependencies\":{\"delay\":\"${delayVersion}\"}}\' > /asset-output/package.json`, 'cp /asset-input/package-lock.json /asset-output/package-lock.json', 'cd /asset-output', @@ -181,8 +181,8 @@ test('esbuild bundling with esbuild options', () => { command: [ 'bash', '-c', [ - 'npx esbuild --bundle /asset-input/lib/handler.ts', - '--target=es2020 --platform=node --outfile=/asset-output/index.js', + 'npx esbuild --bundle "/asset-input/lib/handler.ts"', + '--target=es2020 --platform=node --outfile="/asset-output/index.js"', '--minify --sourcemap --external:aws-sdk --loader:.png=dataurl', '--define:DEBUG=true --define:process.env.KEY="VALUE"', '--log-level=silent --keep-names --tsconfig=/asset-input/lib/custom-tsconfig.ts', @@ -334,23 +334,3 @@ test('with command hooks', () => { }), }); }); - -test('escapes spaces in path', () => { - Bundling.bundle({ - entry: '/project/lib/my cool lambda/handler.ts', - depsLockFilePath, - runtime: Runtime.NODEJS_12_X, - forceDockerBundling: true, - }); - - // Correctly bundles with esbuild - expect(Code.fromAsset).toHaveBeenCalledWith(path.dirname(depsLockFilePath), { - assetHashType: AssetHashType.OUTPUT, - bundling: expect.objectContaining({ - command: [ - 'bash', '-c', - expect.stringContaining('lib/my\\ cool\\ lambda/handler.ts'), - ], - }), - }); -}); From 6de533faa9290b3b87e4a779eb6589efce300ed3 Mon Sep 17 00:00:00 2001 From: Shonn Lyga Date: Sun, 28 Feb 2021 01:22:31 -0800 Subject: [PATCH 48/78] chore: minor tweaks to DESIGN_GUIDELINES.md (#13073) Was reading the Design Guidelines before contributing, and figured I'd improve it as I read through it ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- DESIGN_GUIDELINES.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/DESIGN_GUIDELINES.md b/DESIGN_GUIDELINES.md index e6cebe9f434c6..20fd5be016870 100644 --- a/DESIGN_GUIDELINES.md +++ b/DESIGN_GUIDELINES.md @@ -14,7 +14,7 @@ APIs and verifies that the APIs adhere to the guidelines. When a guideline is backed by a linter rule, the rule name will be referenced like this: _[awslint:resource-class-is-construct]_. -For the purpose of this document we will use "Foo" to denote the official name +For the purpose of this document, we will use "Foo" to denote the official name of the resource as defined in the AWS CloudFormation resource specification (i.e. "Bucket", "Queue", "Topic", etc). This notation allows deriving names from the official name. For example, `FooProps` would be `BucketProps`, `TopicProps`, @@ -98,8 +98,8 @@ or abstractions. However, you will notice that some sections explicitly call out guidelines that apply only to AWS resources (and in many cases enforced/implemented by the **Resource** base class). -AWS services are modeled around the concept of *resources*. Service normally -expose through their APIs one or more resources, which can be provisioned +AWS services are modeled around the concept of *resources*. Services normally +expose one or more resources through their APIs, which can be provisioned through the APIs control plane or through AWS CloudFormation. Every resource available in the AWS platform will have a corresponding resource @@ -397,12 +397,12 @@ For example, prefer “readCapacity” versus “readCapacityUnits”. We prefer the terminology used by the official AWS service documentation over new terminology, even if you think it's not ideal. It helps users diagnose issues and map the mental model of the construct to the service APIs, -documentation and examples. For example don't be tempted to change SQS's +documentation and examples. For example, don't be tempted to change SQS's **dataKeyReusePeriod** with **keyRotation** because it will be hard for people to diagnose problems. They won't be able to just search for “sqs dataKeyReuse” and find topics on it. -> We can relax this guidelines when this is about generic terms (like +> We can relax this guideline when this is about generic terms (like `httpStatus` instead of `statusCode`). The important semantics to preserve are for *service features*: I wouldn't want to rename "lambda layers" to "lambda dependencies" just because it makes more sense because then users won't be @@ -697,8 +697,8 @@ _[awslint:from-signature]_: #### “from” Methods Resource constructs should export static “from” methods for importing unowned -resources given one more of its physical attributes such as ARN, name, etc. All -constructs should have at least one "fromXxx" method _[awslint:from-method]_: +resources given one or more of its physical attributes such as ARN, name, etc. All +constructs should have at least one `fromXxx` method _[awslint:from-method]_: ```ts static fromFooArn(scope: Construct, id: string, bucketArn: string): IFoo; @@ -870,7 +870,7 @@ vpcSubnetSelection?: ec2.SubnetSelection; ### Grants -Grants are one of the most powerful concept in the AWS Construct Library. They +Grants are one of the most powerful concepts in the AWS Construct Library. They offer a higher level, intent-based, API for managing IAM permissions for AWS resources. @@ -974,7 +974,7 @@ class Function extends Resource implements IFunction { ### Events -Many AWS resource emit events to the CloudWatch event bus. Such resources should +Many AWS resources emit events to the CloudWatch event bus. Such resources should have a set of “onXxx” methods available on their construct interface _[awslint:events-in-interface]_. From 6eca979f65542f3e44461588d8220e8c0bf76a6e Mon Sep 17 00:00:00 2001 From: Jonathan Goldwasser Date: Sun, 28 Feb 2021 10:56:25 +0100 Subject: [PATCH 49/78] feat(core): customize bundling output packaging (#13152) Redo of #13076 after #13131. The fix is [`7b3d829` (#13152)](https://github.com/aws/aws-cdk/pull/13152/commits/7b3d829b3db6aacbc0372855128c3e5a8187d78d). If the bundling output contains a single archive file (zip or jar), upload it as-is to S3 without zipping it. Allow to customize this behavior with `bundling.outputType`: * `NOT_ARCHIVED`: The bundling output will always be zipped and uploaded to S3. * `ARCHIVED`: The bundling output will not be zipped. Bundling will fail if the bundling output doesn't contain a single archive file. * `AUTO_DISCOVER`: If the bundling output contains a single archive file (zip or jar) it will not be zipped. Otherwise it will be zipped. This is the default. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- allowed-breaking-changes.txt | 7 - packages/@aws-cdk/aws-s3-assets/README.md | 21 +++ packages/@aws-cdk/aws-s3-assets/lib/asset.ts | 30 +--- packages/@aws-cdk/core/lib/asset-staging.ts | 132 ++++++++++++-- packages/@aws-cdk/core/lib/bundling.ts | 35 ++++ .../@aws-cdk/core/test/archive/archive.zip | 0 packages/@aws-cdk/core/test/docker-stub.sh | 15 +- packages/@aws-cdk/core/test/staging.test.ts | 168 +++++++++++++++++- 8 files changed, 360 insertions(+), 48 deletions(-) create mode 100644 packages/@aws-cdk/core/test/archive/archive.zip diff --git a/allowed-breaking-changes.txt b/allowed-breaking-changes.txt index 964bb4d5c7712..2ca2ca5b6067f 100644 --- a/allowed-breaking-changes.txt +++ b/allowed-breaking-changes.txt @@ -56,10 +56,3 @@ incompatible-argument:@aws-cdk/aws-ecs.TaskDefinition.addVolume # We made properties optional and it's really fine but our differ doesn't think so. weakened:@aws-cdk/cloud-assembly-schema.DockerImageSource weakened:@aws-cdk/cloud-assembly-schema.FileSource - -# https://github.com/aws/aws-cdk/pull/13145 -removed:@aws-cdk/core.AssetStaging.isArchive -removed:@aws-cdk/core.AssetStaging.packaging -removed:@aws-cdk/core.BundlingOutput -removed:@aws-cdk/core.BundlingOptions.outputType - diff --git a/packages/@aws-cdk/aws-s3-assets/README.md b/packages/@aws-cdk/aws-s3-assets/README.md index aab4c46d9c44d..f2583b7c10a24 100644 --- a/packages/@aws-cdk/aws-s3-assets/README.md +++ b/packages/@aws-cdk/aws-s3-assets/README.md @@ -124,6 +124,27 @@ new assets.Asset(this, 'BundledAsset', { Although optional, it's recommended to provide a local bundling method which can greatly improve performance. +If the bundling output contains a single archive file (zip or jar) it will be +uploaded to S3 as-is and will not be zipped. Otherwise the contents of the +output directory will be zipped and the zip file will be uploaded to S3. This +is the default behavior for `bundling.outputType` (`BundlingOutput.AUTO_DISCOVER`). + +Use `BundlingOutput.NOT_ARCHIVED` if the bundling output must always be zipped: + +```ts +const asset = new assets.Asset(this, 'BundledAsset', { + path: '/path/to/asset', + bundling: { + image: BundlingDockerImage.fromRegistry('alpine'), + command: ['command-that-produces-an-archive.sh'], + outputType: BundlingOutput.NOT_ARCHIVED, // Bundling output will be zipped even though it produces a single archive file. + }, +}); +``` + +Use `BundlingOutput.ARCHIVED` if the bundling output contains a single archive file and +you don't want it to be zippped. + ## CloudFormation Resource Metadata > NOTE: This section is relevant for authors of AWS Resource Constructs. diff --git a/packages/@aws-cdk/aws-s3-assets/lib/asset.ts b/packages/@aws-cdk/aws-s3-assets/lib/asset.ts index 938778d1381f4..510834a61c634 100644 --- a/packages/@aws-cdk/aws-s3-assets/lib/asset.ts +++ b/packages/@aws-cdk/aws-s3-assets/lib/asset.ts @@ -1,4 +1,3 @@ -import * as fs from 'fs'; import * as path from 'path'; import * as assets from '@aws-cdk/assets'; import * as iam from '@aws-cdk/aws-iam'; @@ -13,8 +12,6 @@ import { toSymlinkFollow } from './compat'; // eslint-disable-next-line no-duplicate-imports, import/order import { Construct as CoreConstruct } from '@aws-cdk/core'; -const ARCHIVE_EXTENSIONS = ['.zip', '.jar']; - export interface AssetOptions extends assets.CopyOptions, cdk.AssetOptions { /** * A list of principals that should be able to read this asset from S3. @@ -139,17 +136,12 @@ export class Asset extends CoreConstruct implements cdk.IAsset { this.assetPath = staging.relativeStagedPath(stack); - const packaging = determinePackaging(staging.sourcePath); - - this.isFile = packaging === cdk.FileAssetPackaging.FILE; + this.isFile = staging.packaging === cdk.FileAssetPackaging.FILE; - // sets isZipArchive based on the type of packaging and file extension - this.isZipArchive = packaging === cdk.FileAssetPackaging.ZIP_DIRECTORY - ? true - : ARCHIVE_EXTENSIONS.some(ext => staging.sourcePath.toLowerCase().endsWith(ext)); + this.isZipArchive = staging.isArchive; const location = stack.synthesizer.addFileAsset({ - packaging, + packaging: staging.packaging, sourceHash: this.sourceHash, fileName: this.assetPath, }); @@ -210,19 +202,3 @@ export class Asset extends CoreConstruct implements cdk.IAsset { this.bucket.grantRead(grantee); } } - -function determinePackaging(assetPath: string): cdk.FileAssetPackaging { - if (!fs.existsSync(assetPath)) { - throw new Error(`Cannot find asset at ${assetPath}`); - } - - if (fs.statSync(assetPath).isDirectory()) { - return cdk.FileAssetPackaging.ZIP_DIRECTORY; - } - - if (fs.statSync(assetPath).isFile()) { - return cdk.FileAssetPackaging.FILE; - } - - throw new Error(`Asset ${assetPath} is expected to be either a directory or a regular file`); -} diff --git a/packages/@aws-cdk/core/lib/asset-staging.ts b/packages/@aws-cdk/core/lib/asset-staging.ts index 66c65e3d14864..6a34bd9b4b1ac 100644 --- a/packages/@aws-cdk/core/lib/asset-staging.ts +++ b/packages/@aws-cdk/core/lib/asset-staging.ts @@ -5,8 +5,8 @@ import * as cxapi from '@aws-cdk/cx-api'; import { Construct } from 'constructs'; import * as fs from 'fs-extra'; import * as minimatch from 'minimatch'; -import { AssetHashType, AssetOptions } from './assets'; -import { BundlingOptions } from './bundling'; +import { AssetHashType, AssetOptions, FileAssetPackaging } from './assets'; +import { BundlingOptions, BundlingOutput } from './bundling'; import { FileSystem, FingerprintOptions } from './fs'; import { Names } from './names'; import { Cache } from './private/cache'; @@ -17,6 +17,8 @@ import { Stage } from './stage'; // eslint-disable-next-line import { Construct as CoreConstruct } from './construct-compat'; +const ARCHIVE_EXTENSIONS = ['.zip', '.jar']; + /** * A previously staged asset */ @@ -30,6 +32,16 @@ interface StagedAsset { * The hash we used previously */ readonly assetHash: string; + + /** + * The packaging of the asset + */ + readonly packaging: FileAssetPackaging, + + /** + * Whether this asset is an archive + */ + readonly isArchive: boolean; } /** @@ -124,6 +136,16 @@ export class AssetStaging extends CoreConstruct { */ public readonly assetHash: string; + /** + * How this asset should be packaged. + */ + public readonly packaging: FileAssetPackaging; + + /** + * Whether this asset is an archive (zip or jar). + */ + public readonly isArchive: boolean; + private readonly fingerprintOptions: FingerprintOptions; private readonly hashType: AssetHashType; @@ -138,12 +160,20 @@ export class AssetStaging extends CoreConstruct { private readonly cacheKey: string; + private readonly sourceStats: fs.Stats; + constructor(scope: Construct, id: string, props: AssetStagingProps) { super(scope, id); this.sourcePath = path.resolve(props.sourcePath); this.fingerprintOptions = props; + if (!fs.existsSync(this.sourcePath)) { + throw new Error(`Cannot find asset at ${this.sourcePath}`); + } + + this.sourceStats = fs.statSync(this.sourcePath); + const outdir = Stage.of(this)?.assetOutdir; if (!outdir) { throw new Error('unable to determine cloud assembly asset output directory. Assets must be defined indirectly within a "Stage" or an "App" scope'); @@ -192,6 +222,8 @@ export class AssetStaging extends CoreConstruct { this.stagedPath = staged.stagedPath; this.absoluteStagedPath = staged.stagedPath; this.assetHash = staged.assetHash; + this.packaging = staged.packaging; + this.isArchive = staged.isArchive; } /** @@ -248,8 +280,18 @@ export class AssetStaging extends CoreConstruct { ? this.sourcePath : path.resolve(this.assetOutdir, renderAssetFilename(assetHash, path.extname(this.sourcePath))); + if (!this.sourceStats.isDirectory() && !this.sourceStats.isFile()) { + throw new Error(`Asset ${this.sourcePath} is expected to be either a directory or a regular file`); + } + this.stageAsset(this.sourcePath, stagedPath, 'copy'); - return { assetHash, stagedPath }; + + return { + assetHash, + stagedPath, + packaging: this.sourceStats.isDirectory() ? FileAssetPackaging.ZIP_DIRECTORY : FileAssetPackaging.FILE, + isArchive: this.sourceStats.isDirectory() || ARCHIVE_EXTENSIONS.includes(path.extname(this.sourcePath).toLowerCase()), + }; } /** @@ -258,6 +300,10 @@ export class AssetStaging extends CoreConstruct { * Optionally skip, in which case we pretend we did something but we don't really. */ private stageByBundling(bundling: BundlingOptions, skip: boolean): StagedAsset { + if (!this.sourceStats.isDirectory()) { + throw new Error(`Asset ${this.sourcePath} is expected to be a directory when bundling`); + } + if (skip) { // We should have bundled, but didn't to save time. Still pretend to have a hash. // If the asset uses OUTPUT or BUNDLE, we use a CUSTOM hash to avoid fingerprinting @@ -270,6 +316,8 @@ export class AssetStaging extends CoreConstruct { return { assetHash: this.calculateHash(hashType, bundling), stagedPath: this.sourcePath, + packaging: FileAssetPackaging.ZIP_DIRECTORY, + isArchive: true, }; } @@ -281,12 +329,21 @@ export class AssetStaging extends CoreConstruct { const bundleDir = this.determineBundleDir(this.assetOutdir, assetHash); this.bundle(bundling, bundleDir); - // Calculate assetHash afterwards if we still must - assetHash = assetHash ?? this.calculateHash(this.hashType, bundling, bundleDir); - const stagedPath = path.resolve(this.assetOutdir, renderAssetFilename(assetHash)); + // Check bundling output content and determine if we will need to archive + const bundlingOutputType = bundling.outputType ?? BundlingOutput.AUTO_DISCOVER; + const bundledAsset = determineBundledAsset(bundleDir, bundlingOutputType); - this.stageAsset(bundleDir, stagedPath, 'move'); - return { assetHash, stagedPath }; + // Calculate assetHash afterwards if we still must + assetHash = assetHash ?? this.calculateHash(this.hashType, bundling, bundledAsset.path); + const stagedPath = path.resolve(this.assetOutdir, renderAssetFilename(assetHash, bundledAsset.extension)); + + this.stageAsset(bundledAsset.path, stagedPath, 'move'); + return { + assetHash, + stagedPath, + packaging: bundledAsset.packaging, + isArchive: true, // bundling always produces an archive + }; } /** @@ -320,10 +377,9 @@ export class AssetStaging extends CoreConstruct { } // Copy file/directory to staging directory - const stat = fs.statSync(sourcePath); - if (stat.isFile()) { + if (this.sourceStats.isFile()) { fs.copyFileSync(sourcePath, targetPath); - } else if (stat.isDirectory()) { + } else if (this.sourceStats.isDirectory()) { fs.mkdirSync(targetPath); FileSystem.copyDirectory(sourcePath, targetPath, this.fingerprintOptions); } else { @@ -502,3 +558,57 @@ function sortObject(object: { [key: string]: any }): { [key: string]: any } { } return ret; } + +/** + * Returns the single archive file of a directory or undefined + */ +function singleArchiveFile(directory: string): string | undefined { + if (!fs.existsSync(directory)) { + throw new Error(`Directory ${directory} does not exist.`); + } + + if (!fs.statSync(directory).isDirectory()) { + throw new Error(`${directory} is not a directory.`); + } + + const content = fs.readdirSync(directory); + if (content.length === 1) { + const file = path.join(directory, content[0]); + const extension = path.extname(content[0]).toLowerCase(); + if (fs.statSync(file).isFile() && ARCHIVE_EXTENSIONS.includes(extension)) { + return file; + } + } + + return undefined; +} + +interface BundledAsset { + path: string, + packaging: FileAssetPackaging, + extension?: string +} + +/** + * Returns the bundled asset to use based on the content of the bundle directory + * and the type of output. + */ +function determineBundledAsset(bundleDir: string, outputType: BundlingOutput): BundledAsset { + const archiveFile = singleArchiveFile(bundleDir); + + // auto-discover means that if there is an archive file, we take it as the + // bundle, otherwise, we will archive here. + if (outputType === BundlingOutput.AUTO_DISCOVER) { + outputType = archiveFile ? BundlingOutput.ARCHIVED : BundlingOutput.NOT_ARCHIVED; + } + + switch (outputType) { + case BundlingOutput.NOT_ARCHIVED: + return { path: bundleDir, packaging: FileAssetPackaging.ZIP_DIRECTORY }; + case BundlingOutput.ARCHIVED: + if (!archiveFile) { + throw new Error('Bundling output directory is expected to include only a single .zip or .jar file when `output` is set to `ARCHIVED`'); + } + return { path: archiveFile, packaging: FileAssetPackaging.FILE, extension: path.extname(archiveFile) }; + } +} diff --git a/packages/@aws-cdk/core/lib/bundling.ts b/packages/@aws-cdk/core/lib/bundling.ts index 0179b07d2f8f3..213b6bbaba281 100644 --- a/packages/@aws-cdk/core/lib/bundling.ts +++ b/packages/@aws-cdk/core/lib/bundling.ts @@ -80,6 +80,41 @@ export interface BundlingOptions { * @experimental */ readonly local?: ILocalBundling; + + /** + * The type of output that this bundling operation is producing. + * + * @default BundlingOutput.AUTO_DISCOVER + * + * @experimental + */ + readonly outputType?: BundlingOutput; +} + +/** + * The type of output that a bundling operation is producing. + * + * @experimental + */ +export enum BundlingOutput { + /** + * The bundling output directory includes a single .zip or .jar file which + * will be used as the final bundle. If the output directory does not + * include exactly a single archive, bundling will fail. + */ + ARCHIVED = 'archived', + + /** + * The bundling output directory contains one or more files which will be + * archived and uploaded as a .zip file to S3. + */ + NOT_ARCHIVED = 'not-archived', + + /** + * If the bundling output directory contains a single archive file (zip or jar) + * it will be used as the bundle output as-is. Otherwise all the files in the bundling output directory will be zipped. + */ + AUTO_DISCOVER = 'auto-discover', } /** diff --git a/packages/@aws-cdk/core/test/archive/archive.zip b/packages/@aws-cdk/core/test/archive/archive.zip new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/packages/@aws-cdk/core/test/docker-stub.sh b/packages/@aws-cdk/core/test/docker-stub.sh index fe48e93d4a207..94f806f69a120 100755 --- a/packages/@aws-cdk/core/test/docker-stub.sh +++ b/packages/@aws-cdk/core/test/docker-stub.sh @@ -24,5 +24,18 @@ if echo "$@" | grep "DOCKER_STUB_SUCCESS"; then exit 0 fi -echo "Docker mock only supports one of the following commands: DOCKER_STUB_SUCCESS_NO_OUTPUT,DOCKER_STUB_FAIL,DOCKER_STUB_SUCCESS" +if echo "$@" | grep "DOCKER_STUB_MULTIPLE_FILES"; then + outdir=$(echo "$@" | xargs -n1 | grep "/asset-output" | head -n1 | cut -d":" -f1) + touch ${outdir}/test1.txt + touch ${outdir}/test2.txt + exit 0 +fi + +if echo "$@" | grep "DOCKER_STUB_SINGLE_ARCHIVE"; then + outdir=$(echo "$@" | xargs -n1 | grep "/asset-output" | head -n1 | cut -d":" -f1) + touch ${outdir}/test.zip + exit 0 +fi + +echo "Docker mock only supports one of the following commands: DOCKER_STUB_SUCCESS_NO_OUTPUT,DOCKER_STUB_FAIL,DOCKER_STUB_SUCCESS,DOCKER_STUB_MULTIPLE_FILES,DOCKER_SINGLE_ARCHIVE" exit 1 diff --git a/packages/@aws-cdk/core/test/staging.test.ts b/packages/@aws-cdk/core/test/staging.test.ts index 347c5fcea3b63..ee87780a0957e 100644 --- a/packages/@aws-cdk/core/test/staging.test.ts +++ b/packages/@aws-cdk/core/test/staging.test.ts @@ -1,10 +1,11 @@ import * as os from 'os'; import * as path from 'path'; +import { FileAssetPackaging } from '@aws-cdk/cloud-assembly-schema'; import * as cxapi from '@aws-cdk/cx-api'; import * as fs from 'fs-extra'; import { nodeunitShim, Test } from 'nodeunit-shim'; import * as sinon from 'sinon'; -import { App, AssetHashType, AssetStaging, BundlingDockerImage, BundlingOptions, FileSystem, Stack, Stage } from '../lib'; +import { App, AssetHashType, AssetStaging, BundlingDockerImage, BundlingOptions, BundlingOutput, FileSystem, Stack, Stage } from '../lib'; const STUB_INPUT_FILE = '/tmp/docker-stub.input'; const STUB_INPUT_CONCAT_FILE = '/tmp/docker-stub.input.concat'; @@ -12,7 +13,9 @@ const STUB_INPUT_CONCAT_FILE = '/tmp/docker-stub.input.concat'; enum DockerStubCommand { SUCCESS = 'DOCKER_STUB_SUCCESS', FAIL = 'DOCKER_STUB_FAIL', - SUCCESS_NO_OUTPUT = 'DOCKER_STUB_SUCCESS_NO_OUTPUT' + SUCCESS_NO_OUTPUT = 'DOCKER_STUB_SUCCESS_NO_OUTPUT', + MULTIPLE_FILES = 'DOCKER_STUB_MULTIPLE_FILES', + SINGLE_ARCHIVE = 'DOCKER_STUB_SINGLE_ARCHIVE', } const FIXTURE_TEST1_DIR = path.join(__dirname, 'fs', 'fixtures', 'test1'); @@ -50,6 +53,84 @@ nodeunitShim({ test.deepEqual(staging.sourcePath, sourcePath); test.deepEqual(path.basename(staging.stagedPath), 'asset.2f37f937c51e2c191af66acf9b09f548926008ec68c575bd2ee54b6e997c0e00'); test.deepEqual(path.basename(staging.relativeStagedPath(stack)), 'asset.2f37f937c51e2c191af66acf9b09f548926008ec68c575bd2ee54b6e997c0e00'); + test.deepEqual(staging.packaging, FileAssetPackaging.ZIP_DIRECTORY); + test.deepEqual(staging.isArchive, true); + test.done(); + }, + + 'staging of an archive file correctly sets packaging and isArchive'(test: Test) { + // GIVEN + const stack = new Stack(); + const sourcePath = path.join(__dirname, 'archive', 'archive.zip'); + + // WHEN + const staging = new AssetStaging(stack, 's1', { sourcePath }); + + test.deepEqual(staging.packaging, FileAssetPackaging.FILE); + test.deepEqual(staging.isArchive, true); + test.done(); + }, + + 'asset packaging type is correct when staging is skipped because of memory cache'(test: Test) { + // GIVEN + const stack = new Stack(); + const sourcePath = path.join(__dirname, 'archive', 'archive.zip'); + + // WHEN + const staging1 = new AssetStaging(stack, 's1', { sourcePath }); + const staging2 = new AssetStaging(stack, 's2', { sourcePath }); + + test.deepEqual(staging1.packaging, FileAssetPackaging.FILE); + test.deepEqual(staging1.isArchive, true); + test.deepEqual(staging2.packaging, staging1.packaging); + test.deepEqual(staging2.isArchive, staging1.isArchive); + test.done(); + }, + + 'asset packaging type is correct when staging is skipped because of disk cache'(test: Test) { + // GIVEN + const TEST_OUTDIR = path.join(__dirname, 'cdk.out'); + if (fs.existsSync(TEST_OUTDIR)) { + fs.removeSync(TEST_OUTDIR); + } + + const sourcePath = path.join(__dirname, 'archive', 'archive.zip'); + + const app1 = new App({ outdir: TEST_OUTDIR }); + const stack1 = new Stack(app1, 'Stack'); + + const app2 = new App({ outdir: TEST_OUTDIR }); // same OUTDIR + const stack2 = new Stack(app2, 'stack'); + + // WHEN + const staging1 = new AssetStaging(stack1, 'Asset', { sourcePath }); + + // Now clear asset hash cache to show that during the second staging + // even though the asset is already available on disk it will correctly + // be considered as a FileAssetPackaging.FILE. + AssetStaging.clearAssetHashCache(); + + const staging2 = new AssetStaging(stack2, 'Asset', { sourcePath }); + + // THEN + test.deepEqual(staging1.packaging, FileAssetPackaging.FILE); + test.deepEqual(staging1.isArchive, true); + test.deepEqual(staging2.packaging, staging1.packaging); + test.deepEqual(staging2.isArchive, staging1.isArchive); + + test.done(); + }, + + 'staging of a non-archive file correctly sets packaging and isArchive'(test: Test) { + // GIVEN + const stack = new Stack(); + const sourcePath = __filename; + + // WHEN + const staging = new AssetStaging(stack, 's1', { sourcePath }); + + test.deepEqual(staging.packaging, FileAssetPackaging.FILE); + test.deepEqual(staging.isArchive, false); test.done(); }, @@ -785,6 +866,89 @@ nodeunitShim({ ); test.equal(asset.assetHash, '33cbf2cae5432438e0f046bc45ba8c3cef7b6afcf47b59d1c183775c1918fb1f'); // hash of MyStack/Asset + test.done(); + }, + + 'bundling that produces a single archive file is autodiscovered'(test: Test) { + // GIVEN + const app = new App(); + const stack = new Stack(app, 'stack'); + const directory = path.join(__dirname, 'fs', 'fixtures', 'test1'); + + // WHEN + const staging = new AssetStaging(stack, 'Asset', { + sourcePath: directory, + bundling: { + image: BundlingDockerImage.fromRegistry('alpine'), + command: [DockerStubCommand.SINGLE_ARCHIVE], + }, + }); + + // THEN + const assembly = app.synth(); + test.deepEqual(fs.readdirSync(assembly.directory), [ + 'asset.f43148c61174f444925231b5849b468f21e93b5d1469cd07c53625ffd039ef48', // this is the bundle dir but it's empty + 'asset.f43148c61174f444925231b5849b468f21e93b5d1469cd07c53625ffd039ef48.zip', + 'cdk.out', + 'manifest.json', + 'stack.template.json', + 'tree.json', + ]); + test.equal(fs.readdirSync(path.join(assembly.directory, 'asset.f43148c61174f444925231b5849b468f21e93b5d1469cd07c53625ffd039ef48')).length, 0); // empty bundle dir + test.deepEqual(staging.packaging, FileAssetPackaging.FILE); + test.deepEqual(staging.isArchive, true); + + test.done(); + }, + + 'bundling that produces a single archive file with NOT_ARCHIVED'(test: Test) { + // GIVEN + const app = new App(); + const stack = new Stack(app, 'stack'); + const directory = path.join(__dirname, 'fs', 'fixtures', 'test1'); + + // WHEN + const staging = new AssetStaging(stack, 'Asset', { + sourcePath: directory, + bundling: { + image: BundlingDockerImage.fromRegistry('alpine'), + command: [DockerStubCommand.SINGLE_ARCHIVE], + outputType: BundlingOutput.NOT_ARCHIVED, + }, + }); + + // THEN + const assembly = app.synth(); + test.deepEqual(fs.readdirSync(assembly.directory), [ + 'asset.86ec07746e1d859290cfd8b9c648e581555649c75f51f741f11e22cab6775abc', + 'cdk.out', + 'manifest.json', + 'stack.template.json', + 'tree.json', + ]); + test.deepEqual(staging.packaging, FileAssetPackaging.ZIP_DIRECTORY); + test.deepEqual(staging.isArchive, true); + + test.done(); + }, + + 'throws with ARCHIVED and bundling that does not produce a single archive file'(test: Test) { + // GIVEN + const app = new App(); + const stack = new Stack(app, 'stack'); + const directory = path.join(__dirname, 'fs', 'fixtures', 'test1'); + + // WHEN + test.throws(() => new AssetStaging(stack, 'Asset', { + sourcePath: directory, + bundling: { + image: BundlingDockerImage.fromRegistry('alpine'), + command: [DockerStubCommand.MULTIPLE_FILES], + outputType: BundlingOutput.ARCHIVED, + }, + }), /Bundling output directory is expected to include only a single .zip or .jar file when `output` is set to `ARCHIVED`/); + + test.done(); }, }); From fe4f05678c06d634d3fe9e1b608e444a57f67b9c Mon Sep 17 00:00:00 2001 From: openwebsolns Date: Sun, 28 Feb 2021 05:29:38 -0500 Subject: [PATCH 50/78] fix(ec2): readme grammar (#13180) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-ec2/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-ec2/README.md b/packages/@aws-cdk/aws-ec2/README.md index 3b902e5cb8c75..49fff4b5c4f63 100644 --- a/packages/@aws-cdk/aws-ec2/README.md +++ b/packages/@aws-cdk/aws-ec2/README.md @@ -275,7 +275,7 @@ DatabaseSubnet3 |`ISOLATED`|`10.0.6.32/28`|#3|Only routes within the VPC ### Accessing the Internet Gateway -If you need access to the internet gateway, you can get it's ID like so: +If you need access to the internet gateway, you can get its ID like so: ```ts const igwId = vpc.internetGatewayId; From ad01099d5b8f835c3b87d7d20fd2dc1a5df2fd6f Mon Sep 17 00:00:00 2001 From: Jonathan Goldwasser Date: Sun, 28 Feb 2021 12:08:35 +0100 Subject: [PATCH 51/78] feat(lambda): Code.fromDockerBuild (#13318) Use the result of a Docker build as code. The runtime code is expected to be located at `/asset` in the image. Also deprecate `BundlingDockerImage` in favor of `DockerImage`. Closes #13273 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-lambda-nodejs/README.md | 4 +- .../aws-lambda-nodejs/test/bundling.test.ts | 2 +- packages/@aws-cdk/aws-lambda/README.md | 11 ++++-- packages/@aws-cdk/aws-lambda/lib/code.ts | 37 ++++++++++++++++++ .../@aws-cdk/aws-lambda/test/code.test.ts | 23 +++++++++++ .../test/docker-build-lambda/Dockerfile | 3 ++ .../test/docker-build-lambda/index.ts | 5 +++ packages/@aws-cdk/aws-s3-assets/README.md | 8 ++-- packages/@aws-cdk/core/lib/bundling.ts | 39 ++++++++++++++++--- packages/@aws-cdk/core/test/bundling.test.ts | 23 ++++++++++- 10 files changed, 137 insertions(+), 18 deletions(-) create mode 100644 packages/@aws-cdk/aws-lambda/test/docker-build-lambda/Dockerfile create mode 100644 packages/@aws-cdk/aws-lambda/test/docker-build-lambda/index.ts diff --git a/packages/@aws-cdk/aws-lambda-nodejs/README.md b/packages/@aws-cdk/aws-lambda-nodejs/README.md index f35062120fb9d..d11602c5e656e 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/README.md +++ b/packages/@aws-cdk/aws-lambda-nodejs/README.md @@ -148,7 +148,7 @@ new lambda.NodejsFunction(this, 'my-handler', { }, logLevel: LogLevel.SILENT, // defaults to LogLevel.WARNING keepNames: true, // defaults to false - tsconfig: 'custom-tsconfig.json' // use custom-tsconfig.json instead of default, + tsconfig: 'custom-tsconfig.json' // use custom-tsconfig.json instead of default, metafile: true, // include meta file, defaults to false banner : '/* comments */', // by default no comments are passed footer : '/* comments */', // by default no comments are passed @@ -220,7 +220,7 @@ Use `bundling.dockerImage` to use a custom Docker bundling image: ```ts new lambda.NodejsFunction(this, 'my-handler', { bundling: { - dockerImage: cdk.BundlingDockerImage.fromAsset('/path/to/Dockerfile'), + dockerImage: cdk.DockerImage.fromBuild('/path/to/Dockerfile'), }, }); ``` diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/bundling.test.ts b/packages/@aws-cdk/aws-lambda-nodejs/test/bundling.test.ts index 382baafee54a0..e6c32c496b2ff 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/bundling.test.ts +++ b/packages/@aws-cdk/aws-lambda-nodejs/test/bundling.test.ts @@ -20,7 +20,7 @@ beforeEach(() => { getEsBuildVersionMock.mockReturnValue('0.8.8'); fromAssetMock.mockReturnValue({ image: 'built-image', - cp: () => {}, + cp: () => 'dest-path', run: () => {}, toJSON: () => 'built-image', }); diff --git a/packages/@aws-cdk/aws-lambda/README.md b/packages/@aws-cdk/aws-lambda/README.md index 569569f526736..ae21d6ea9216e 100644 --- a/packages/@aws-cdk/aws-lambda/README.md +++ b/packages/@aws-cdk/aws-lambda/README.md @@ -36,6 +36,9 @@ runtime code. * `lambda.Code.fromAsset(path)` - specify a directory or a .zip file in the local filesystem which will be zipped and uploaded to S3 before deployment. See also [bundling asset code](#bundling-asset-code). + * `lambda.Code.fromDockerBuild(path, options)` - use the result of a Docker + build as code. The runtime code is expected to be located at `/asset` in the + image and will be zipped and uploaded to S3 as an asset. The following example shows how to define a Python function and deploy the code from the local directory `my-lambda-handler` to it: @@ -450,7 +453,7 @@ new lambda.Function(this, 'Function', { bundling: { image: lambda.Runtime.PYTHON_3_6.bundlingDockerImage, command: [ - 'bash', '-c', + 'bash', '-c', 'pip install -r requirements.txt -t /asset-output && cp -au . /asset-output' ], }, @@ -462,8 +465,8 @@ new lambda.Function(this, 'Function', { Runtimes expose a `bundlingDockerImage` property that points to the [AWS SAM](https://github.com/awslabs/aws-sam-cli) build image. -Use `cdk.BundlingDockerImage.fromRegistry(image)` to use an existing image or -`cdk.BundlingDockerImage.fromAsset(path)` to build a specific image: +Use `cdk.DockerImage.fromRegistry(image)` to use an existing image or +`cdk.DockerImage.fromBuild(path)` to build a specific image: ```ts import * as cdk from '@aws-cdk/core'; @@ -471,7 +474,7 @@ import * as cdk from '@aws-cdk/core'; new lambda.Function(this, 'Function', { code: lambda.Code.fromAsset('/path/to/handler', { bundling: { - image: cdk.BundlingDockerImage.fromAsset('/path/to/dir/with/DockerFile', { + image: cdk.DockerImage.fromBuild('/path/to/dir/with/DockerFile', { buildArgs: { ARG1: 'value1', }, diff --git a/packages/@aws-cdk/aws-lambda/lib/code.ts b/packages/@aws-cdk/aws-lambda/lib/code.ts index 29cd3d02ae4de..b4f41b2804257 100644 --- a/packages/@aws-cdk/aws-lambda/lib/code.ts +++ b/packages/@aws-cdk/aws-lambda/lib/code.ts @@ -57,6 +57,22 @@ export abstract class Code { return new AssetCode(path, options); } + /** + * Loads the function code from an asset created by a Docker build. + * + * By defaut, the asset is expected to be located at `/asset` in the + * image. + * + * @param path The path to the directory containing the Docker file + * @param options Docker build options + */ + public static fromDockerBuild(path: string, options: DockerBuildAssetOptions = {}): AssetCode { + const assetPath = cdk.DockerImage + .fromBuild(path, options) + .cp(options.imagePath ?? '/asset', options.outputPath); + return new AssetCode(assetPath); + } + /** * DEPRECATED * @deprecated use `fromAsset` @@ -488,3 +504,24 @@ export class AssetImageCode extends Code { }; } } + +/** + * Options when creating an asset from a Docker build. + */ +export interface DockerBuildAssetOptions extends cdk.DockerBuildOptions { + /** + * The path in the Docker image where the asset is located after the build + * operation. + * + * @default /asset + */ + readonly imagePath?: string; + + /** + * The path on the local filesystem where the asset will be copied + * using `docker cp`. + * + * @default - a unique temporary directory in the system temp directory + */ + readonly outputPath?: string; +} diff --git a/packages/@aws-cdk/aws-lambda/test/code.test.ts b/packages/@aws-cdk/aws-lambda/test/code.test.ts index abdbc0e080daa..91de07a17c5a6 100644 --- a/packages/@aws-cdk/aws-lambda/test/code.test.ts +++ b/packages/@aws-cdk/aws-lambda/test/code.test.ts @@ -329,6 +329,29 @@ describe('code', () => { }); }); }); + + describe('lambda.Code.fromDockerBuild', () => { + test('can use the result of a Docker build as an asset', () => { + // given + const stack = new cdk.Stack(); + stack.node.setContext(cxapi.ASSET_RESOURCE_METADATA_ENABLED_CONTEXT, true); + + // when + new lambda.Function(stack, 'Fn', { + code: lambda.Code.fromDockerBuild(path.join(__dirname, 'docker-build-lambda')), + handler: 'index.handler', + runtime: lambda.Runtime.NODEJS_12_X, + }); + + // then + expect(stack).toHaveResource('AWS::Lambda::Function', { + Metadata: { + [cxapi.ASSET_RESOURCE_METADATA_PATH_KEY]: 'asset.38cd320fa97b348accac88e48d9cede4923f7cab270ce794c95a665be83681a8', + [cxapi.ASSET_RESOURCE_METADATA_PROPERTY_KEY]: 'Code', + }, + }, ResourcePart.CompleteDefinition); + }); + }); }); function defineFunction(code: lambda.Code, runtime: lambda.Runtime = lambda.Runtime.NODEJS_10_X) { diff --git a/packages/@aws-cdk/aws-lambda/test/docker-build-lambda/Dockerfile b/packages/@aws-cdk/aws-lambda/test/docker-build-lambda/Dockerfile new file mode 100644 index 0000000000000..4643fde141850 --- /dev/null +++ b/packages/@aws-cdk/aws-lambda/test/docker-build-lambda/Dockerfile @@ -0,0 +1,3 @@ +FROM public.ecr.aws/amazonlinux/amazonlinux:latest + +COPY index.js /asset diff --git a/packages/@aws-cdk/aws-lambda/test/docker-build-lambda/index.ts b/packages/@aws-cdk/aws-lambda/test/docker-build-lambda/index.ts new file mode 100644 index 0000000000000..cc867895b4efc --- /dev/null +++ b/packages/@aws-cdk/aws-lambda/test/docker-build-lambda/index.ts @@ -0,0 +1,5 @@ +/* eslint-disable no-console */ +export async function handler(event: any) { + console.log('Event: %j', event); + return event; +} diff --git a/packages/@aws-cdk/aws-s3-assets/README.md b/packages/@aws-cdk/aws-s3-assets/README.md index f2583b7c10a24..7a751410a2b22 100644 --- a/packages/@aws-cdk/aws-s3-assets/README.md +++ b/packages/@aws-cdk/aws-s3-assets/README.md @@ -88,8 +88,8 @@ The following example uses custom asset bundling to convert a markdown file to h [Example of using asset bundling](./test/integ.assets.bundling.lit.ts). -The bundling docker image (`image`) can either come from a registry (`BundlingDockerImage.fromRegistry`) -or it can be built from a `Dockerfile` located inside your project (`BundlingDockerImage.fromAsset`). +The bundling docker image (`image`) can either come from a registry (`DockerImage.fromRegistry`) +or it can be built from a `Dockerfile` located inside your project (`DockerImage.fromBuild`). You can set the `CDK_DOCKER` environment variable in order to provide a custom docker program to execute. This may sometime be needed when building in @@ -114,7 +114,7 @@ new assets.Asset(this, 'BundledAsset', { }, }, // Docker bundling fallback - image: BundlingDockerImage.fromRegistry('alpine'), + image: DockerImage.fromRegistry('alpine'), entrypoint: ['/bin/sh', '-c'], command: ['bundle'], }, @@ -135,7 +135,7 @@ Use `BundlingOutput.NOT_ARCHIVED` if the bundling output must always be zipped: const asset = new assets.Asset(this, 'BundledAsset', { path: '/path/to/asset', bundling: { - image: BundlingDockerImage.fromRegistry('alpine'), + image: DockerImage.fromRegistry('alpine'), command: ['command-that-produces-an-archive.sh'], outputType: BundlingOutput.NOT_ARCHIVED, // Bundling output will be zipped even though it produces a single archive file. }, diff --git a/packages/@aws-cdk/core/lib/bundling.ts b/packages/@aws-cdk/core/lib/bundling.ts index 213b6bbaba281..e3c1458aa0ab9 100644 --- a/packages/@aws-cdk/core/lib/bundling.ts +++ b/packages/@aws-cdk/core/lib/bundling.ts @@ -136,6 +136,8 @@ export interface ILocalBundling { /** * A Docker image used for asset bundling + * + * @deprecated use DockerImage */ export class BundlingDockerImage { /** @@ -152,6 +154,8 @@ export class BundlingDockerImage { * * @param path The path to the directory containing the Docker file * @param options Docker build options + * + * @deprecated use DockerImage.fromBuild() */ public static fromAsset(path: string, options: DockerBuildOptions = {}) { const buildArgs = options.buildArgs || {}; @@ -184,7 +188,7 @@ export class BundlingDockerImage { } /** @param image The Docker image */ - private constructor(public readonly image: string, private readonly _imageHash?: string) {} + protected constructor(public readonly image: string, private readonly _imageHash?: string) {} /** * Provides a stable representation of this image for JSON serialization. @@ -232,10 +236,16 @@ export class BundlingDockerImage { } /** - * Copies a file or directory out of the Docker image to the local filesystem + * Copies a file or directory out of the Docker image to the local filesystem. + * + * If `outputPath` is omitted the destination path is a temporary directory. + * + * @param imagePath the path in the Docker image + * @param outputPath the destination path for the copy operation + * @returns the destination path */ - public cp(imagePath: string, outputPath: string) { - const { stdout } = dockerExec(['create', this.image]); + public cp(imagePath: string, outputPath?: string): string { + const { stdout } = dockerExec(['create', this.image], {}); // Empty options to avoid stdout redirect here const match = stdout.toString().match(/([0-9a-f]{16,})/); if (!match) { throw new Error('Failed to extract container ID from Docker create output'); @@ -243,16 +253,33 @@ export class BundlingDockerImage { const containerId = match[1]; const containerPath = `${containerId}:${imagePath}`; + const destPath = outputPath ?? FileSystem.mkdtemp('cdk-docker-cp-'); try { - dockerExec(['cp', containerPath, outputPath]); + dockerExec(['cp', containerPath, destPath]); + return destPath; } catch (err) { - throw new Error(`Failed to copy files from ${containerPath} to ${outputPath}: ${err}`); + throw new Error(`Failed to copy files from ${containerPath} to ${destPath}: ${err}`); } finally { dockerExec(['rm', '-v', containerId]); } } } +/** + * A Docker image + */ +export class DockerImage extends BundlingDockerImage { + /** + * Builds a Docker image + * + * @param path The path to the directory containing the Docker file + * @param options Docker build options + */ + public static fromBuild(path: string, options: DockerBuildOptions = {}) { + return BundlingDockerImage.fromAsset(path, options); + } +} + /** * A Docker volume */ diff --git a/packages/@aws-cdk/core/test/bundling.test.ts b/packages/@aws-cdk/core/test/bundling.test.ts index cac2b494eb003..99548030c011a 100644 --- a/packages/@aws-cdk/core/test/bundling.test.ts +++ b/packages/@aws-cdk/core/test/bundling.test.ts @@ -3,7 +3,7 @@ import * as crypto from 'crypto'; import * as path from 'path'; import { nodeunitShim, Test } from 'nodeunit-shim'; import * as sinon from 'sinon'; -import { BundlingDockerImage, FileSystem } from '../lib'; +import { BundlingDockerImage, DockerImage, FileSystem } from '../lib'; nodeunitShim({ 'tearDown'(callback: any) { @@ -265,4 +265,25 @@ nodeunitShim({ test.ok(spawnSyncStub.calledWith(sinon.match.any, ['rm', '-v', containerId])); test.done(); }, + + 'cp utility copies to a temp dir of outputPath is omitted'(test: Test) { + // GIVEN + const containerId = '1234567890abcdef1234567890abcdef'; + sinon.stub(child_process, 'spawnSync').returns({ + status: 0, + stderr: Buffer.from('stderr'), + stdout: Buffer.from(`${containerId}\n`), + pid: 123, + output: ['stdout', 'stderr'], + signal: null, + }); + + // WHEN + const tempPath = DockerImage.fromRegistry('alpine').cp('/foo/bar'); + + // THEN + test.ok(/cdk-docker-cp-/.test(tempPath)); + + test.done(); + }, }); From 96630934942b437f2cad1371c8a01bdb2e92cf38 Mon Sep 17 00:00:00 2001 From: Jonathan Goldwasser Date: Mon, 1 Mar 2021 12:53:07 +0100 Subject: [PATCH 52/78] chore(ses): use NodeJS 14 in DropSpamReceiptRule (#13266) Closes #13223 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../test/integ.actions.expected.json | 59 +++++++++++++++++-- .../aws-ses/lib/drop-spam-handler/index.ts | 22 +++++++ packages/@aws-cdk/aws-ses/lib/receipt-rule.ts | 27 +-------- .../aws-ses/test/integ.receipt.expected.json | 55 ++++++++++++++++- 4 files changed, 131 insertions(+), 32 deletions(-) create mode 100644 packages/@aws-cdk/aws-ses/lib/drop-spam-handler/index.ts diff --git a/packages/@aws-cdk/aws-ses-actions/test/integ.actions.expected.json b/packages/@aws-cdk/aws-ses-actions/test/integ.actions.expected.json index b58b770bcd426..4379649e02d69 100644 --- a/packages/@aws-cdk/aws-ses-actions/test/integ.actions.expected.json +++ b/packages/@aws-cdk/aws-ses-actions/test/integ.actions.expected.json @@ -40,13 +40,13 @@ "Code": { "ZipFile": "exports.handler = async (event) => event;" }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "FunctionServiceRole675BB04A", "Arn" ] }, + "Handler": "index.handler", "Runtime": "nodejs10.x" }, "DependsOn": [ @@ -341,16 +341,51 @@ "Type": "AWS::Lambda::Function", "Properties": { "Code": { - "ZipFile": "exports.handler = function dropSpamCode(event, _, callback) {\n console.log('Spam filter');\n const sesNotification = event.Records[0].ses;\n console.log('SES Notification:\\n', JSON.stringify(sesNotification, null, 2));\n // Check if any spam check failed\n if (sesNotification.receipt.spfVerdict.status === 'FAIL'\n || sesNotification.receipt.dkimVerdict.status === 'FAIL'\n || sesNotification.receipt.spamVerdict.status === 'FAIL'\n || sesNotification.receipt.virusVerdict.status === 'FAIL') {\n console.log('Dropping spam');\n // Stop processing rule set, dropping message\n callback(null, { disposition: 'STOP_RULE_SET' });\n }\n else {\n callback(null, null);\n }\n}" + "S3Bucket": { + "Ref": "AssetParameters96d0b6be9a64ae309bf89a86f5515453f0fa1d07b4f6b37198051cc98e251f34S3Bucket6AFCBA5F" + }, + "S3Key": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "||", + { + "Ref": "AssetParameters96d0b6be9a64ae309bf89a86f5515453f0fa1d07b4f6b37198051cc98e251f34S3VersionKey02BA9086" + } + ] + } + ] + }, + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "||", + { + "Ref": "AssetParameters96d0b6be9a64ae309bf89a86f5515453f0fa1d07b4f6b37198051cc98e251f34S3VersionKey02BA9086" + } + ] + } + ] + } + ] + ] + } }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "SingletonLambda224e77f9a32e4b4dac32983477abba16ServiceRole3037F5B4", "Arn" ] }, - "Runtime": "nodejs10.x" + "Handler": "index.handler", + "Runtime": "nodejs14.x" }, "DependsOn": [ "SingletonLambda224e77f9a32e4b4dac32983477abba16ServiceRole3037F5B4" @@ -372,5 +407,19 @@ } } } + }, + "Parameters": { + "AssetParameters96d0b6be9a64ae309bf89a86f5515453f0fa1d07b4f6b37198051cc98e251f34S3Bucket6AFCBA5F": { + "Type": "String", + "Description": "S3 bucket for asset \"96d0b6be9a64ae309bf89a86f5515453f0fa1d07b4f6b37198051cc98e251f34\"" + }, + "AssetParameters96d0b6be9a64ae309bf89a86f5515453f0fa1d07b4f6b37198051cc98e251f34S3VersionKey02BA9086": { + "Type": "String", + "Description": "S3 key for asset version \"96d0b6be9a64ae309bf89a86f5515453f0fa1d07b4f6b37198051cc98e251f34\"" + }, + "AssetParameters96d0b6be9a64ae309bf89a86f5515453f0fa1d07b4f6b37198051cc98e251f34ArtifactHash6BE57680": { + "Type": "String", + "Description": "Artifact hash for asset \"96d0b6be9a64ae309bf89a86f5515453f0fa1d07b4f6b37198051cc98e251f34\"" + } } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ses/lib/drop-spam-handler/index.ts b/packages/@aws-cdk/aws-ses/lib/drop-spam-handler/index.ts new file mode 100644 index 0000000000000..76a639acdf50e --- /dev/null +++ b/packages/@aws-cdk/aws-ses/lib/drop-spam-handler/index.ts @@ -0,0 +1,22 @@ +/* eslint-disable no-console */ + +// Adapted from https://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-action-lambda-example-functions.html +export async function handler(event: AWSLambda.SESEvent): Promise<{ disposition: string } | null> { + console.log('Spam filter'); + + const sesNotification = event.Records[0].ses; + console.log('SES Notification: %j', sesNotification); + + // Check if any spam check failed + if (sesNotification.receipt.spfVerdict.status === 'FAIL' + || sesNotification.receipt.dkimVerdict.status === 'FAIL' + || sesNotification.receipt.spamVerdict.status === 'FAIL' + || sesNotification.receipt.virusVerdict.status === 'FAIL') { + console.log('Dropping spam'); + + // Stop processing rule set, dropping message + return { disposition: 'STOP_RULE_SET' }; + } + + return null; +} diff --git a/packages/@aws-cdk/aws-ses/lib/receipt-rule.ts b/packages/@aws-cdk/aws-ses/lib/receipt-rule.ts index 5b6a276929c8e..7f6f1fe914a6b 100644 --- a/packages/@aws-cdk/aws-ses/lib/receipt-rule.ts +++ b/packages/@aws-cdk/aws-ses/lib/receipt-rule.ts @@ -1,3 +1,4 @@ +import * as path from 'path'; import * as iam from '@aws-cdk/aws-iam'; import * as lambda from '@aws-cdk/aws-lambda'; import { Aws, IResource, Lazy, Resource } from '@aws-cdk/core'; @@ -175,9 +176,9 @@ export class DropSpamReceiptRule extends CoreConstruct { super(scope, id); const fn = new lambda.SingletonFunction(this, 'Function', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', - code: lambda.Code.fromInline(`exports.handler = ${dropSpamCode}`), + code: lambda.Code.fromAsset(path.join(__dirname, 'drop-spam-handler')), uuid: '224e77f9-a32e-4b4d-ac32-983477abba16', }); @@ -203,25 +204,3 @@ export class DropSpamReceiptRule extends CoreConstruct { }); } } - -// Adapted from https://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-action-lambda-example-functions.html -/* eslint-disable no-console */ -function dropSpamCode(event: any, _: any, callback: any) { - console.log('Spam filter'); - - const sesNotification = event.Records[0].ses; - console.log('SES Notification:\n', JSON.stringify(sesNotification, null, 2)); - - // Check if any spam check failed - if (sesNotification.receipt.spfVerdict.status === 'FAIL' - || sesNotification.receipt.dkimVerdict.status === 'FAIL' - || sesNotification.receipt.spamVerdict.status === 'FAIL' - || sesNotification.receipt.virusVerdict.status === 'FAIL') { - console.log('Dropping spam'); - - // Stop processing rule set, dropping message - callback(null, { disposition: 'STOP_RULE_SET' }); - } else { - callback(null, null); - } -} diff --git a/packages/@aws-cdk/aws-ses/test/integ.receipt.expected.json b/packages/@aws-cdk/aws-ses/test/integ.receipt.expected.json index b4cdf79e60d44..2bb22f110b951 100644 --- a/packages/@aws-cdk/aws-ses/test/integ.receipt.expected.json +++ b/packages/@aws-cdk/aws-ses/test/integ.receipt.expected.json @@ -97,16 +97,51 @@ "Type": "AWS::Lambda::Function", "Properties": { "Code": { - "ZipFile": "exports.handler = function dropSpamCode(event, _, callback) {\n console.log('Spam filter');\n const sesNotification = event.Records[0].ses;\n console.log('SES Notification:\\n', JSON.stringify(sesNotification, null, 2));\n // Check if any spam check failed\n if (sesNotification.receipt.spfVerdict.status === 'FAIL'\n || sesNotification.receipt.dkimVerdict.status === 'FAIL'\n || sesNotification.receipt.spamVerdict.status === 'FAIL'\n || sesNotification.receipt.virusVerdict.status === 'FAIL') {\n console.log('Dropping spam');\n // Stop processing rule set, dropping message\n callback(null, { disposition: 'STOP_RULE_SET' });\n }\n else {\n callback(null, null);\n }\n}" + "S3Bucket": { + "Ref": "AssetParameters96d0b6be9a64ae309bf89a86f5515453f0fa1d07b4f6b37198051cc98e251f34S3Bucket6AFCBA5F" + }, + "S3Key": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "||", + { + "Ref": "AssetParameters96d0b6be9a64ae309bf89a86f5515453f0fa1d07b4f6b37198051cc98e251f34S3VersionKey02BA9086" + } + ] + } + ] + }, + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "||", + { + "Ref": "AssetParameters96d0b6be9a64ae309bf89a86f5515453f0fa1d07b4f6b37198051cc98e251f34S3VersionKey02BA9086" + } + ] + } + ] + } + ] + ] + } }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "SingletonLambda224e77f9a32e4b4dac32983477abba16ServiceRole3037F5B4", "Arn" ] }, - "Runtime": "nodejs10.x" + "Handler": "index.handler", + "Runtime": "nodejs14.x" }, "DependsOn": [ "SingletonLambda224e77f9a32e4b4dac32983477abba16ServiceRole3037F5B4" @@ -150,5 +185,19 @@ } } } + }, + "Parameters": { + "AssetParameters96d0b6be9a64ae309bf89a86f5515453f0fa1d07b4f6b37198051cc98e251f34S3Bucket6AFCBA5F": { + "Type": "String", + "Description": "S3 bucket for asset \"96d0b6be9a64ae309bf89a86f5515453f0fa1d07b4f6b37198051cc98e251f34\"" + }, + "AssetParameters96d0b6be9a64ae309bf89a86f5515453f0fa1d07b4f6b37198051cc98e251f34S3VersionKey02BA9086": { + "Type": "String", + "Description": "S3 key for asset version \"96d0b6be9a64ae309bf89a86f5515453f0fa1d07b4f6b37198051cc98e251f34\"" + }, + "AssetParameters96d0b6be9a64ae309bf89a86f5515453f0fa1d07b4f6b37198051cc98e251f34ArtifactHash6BE57680": { + "Type": "String", + "Description": "Artifact hash for asset \"96d0b6be9a64ae309bf89a86f5515453f0fa1d07b4f6b37198051cc98e251f34\"" + } } } \ No newline at end of file From 4420ac3116597d7d862b4621df0663d3cd77905d Mon Sep 17 00:00:00 2001 From: Meng Xin Zhu Date: Mon, 1 Mar 2021 21:36:27 +0800 Subject: [PATCH 53/78] docs(docdb): make sample snippet deployable (#13295) see below error when creating cluster with master username 'admin' > MasterUsername admin cannot be used as it is a reserved word used by the engine ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-docdb/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-docdb/README.md b/packages/@aws-cdk/aws-docdb/README.md index 826033de4c134..530942578a090 100644 --- a/packages/@aws-cdk/aws-docdb/README.md +++ b/packages/@aws-cdk/aws-docdb/README.md @@ -30,7 +30,7 @@ your instances will be launched privately or publicly: ```ts const cluster = new DatabaseCluster(this, 'Database', { masterUser: { - username: 'admin' + username: 'myuser' // NOTE: 'admin' is reserved by DocumentDB }, instanceProps: { instanceType: ec2.InstanceType.of(ec2.InstanceClass.R5, ec2.InstanceSize.LARGE), From c36683701d88eb0c53fdd2add66b10c47c05f56b Mon Sep 17 00:00:00 2001 From: Sainath Mallidi Date: Mon, 1 Mar 2021 07:32:26 -0800 Subject: [PATCH 54/78] feat(neptune): high level constructs for db clusters and instances (#12763) - This change adds higher level constructs for Neptune clusters - Adds higher-level constructs for - AWS::Neptune::DBCluster - AWS::Neptune::DBInstance - AWS::Neptune::DBClusterParameterGroup - AWS::Neptune::DBParameterGroup - AWS::Neptune::DBSubnetGroup fixes aws#12762 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-neptune/README.md | 93 +++- packages/@aws-cdk/aws-neptune/lib/cluster.ts | 457 ++++++++++++++++ packages/@aws-cdk/aws-neptune/lib/endpoint.ts | 31 ++ packages/@aws-cdk/aws-neptune/lib/index.ts | 6 + packages/@aws-cdk/aws-neptune/lib/instance.ts | 234 ++++++++ .../aws-neptune/lib/parameter-group.ts | 135 +++++ .../@aws-cdk/aws-neptune/lib/subnet-group.ts | 91 ++++ packages/@aws-cdk/aws-neptune/package.json | 16 +- .../aws-neptune/rosetta/default.ts-fixture | 14 + .../rosetta/with-cluster.ts-fixture | 19 + .../@aws-cdk/aws-neptune/test/cluster.test.ts | 439 +++++++++++++++ .../aws-neptune/test/endpoint.test.ts | 15 + .../aws-neptune/test/instance.test.ts | 131 +++++ .../test/integ.cluster.expected.json | 504 ++++++++++++++++++ .../aws-neptune/test/integ.cluster.ts | 48 ++ .../@aws-cdk/aws-neptune/test/neptune.test.ts | 6 - .../aws-neptune/test/parameter-group.test.ts | 50 ++ .../aws-neptune/test/subnet-group.test.ts | 83 +++ 18 files changed, 2364 insertions(+), 8 deletions(-) create mode 100644 packages/@aws-cdk/aws-neptune/lib/cluster.ts create mode 100644 packages/@aws-cdk/aws-neptune/lib/endpoint.ts create mode 100644 packages/@aws-cdk/aws-neptune/lib/instance.ts create mode 100644 packages/@aws-cdk/aws-neptune/lib/parameter-group.ts create mode 100644 packages/@aws-cdk/aws-neptune/lib/subnet-group.ts create mode 100644 packages/@aws-cdk/aws-neptune/rosetta/default.ts-fixture create mode 100644 packages/@aws-cdk/aws-neptune/rosetta/with-cluster.ts-fixture create mode 100644 packages/@aws-cdk/aws-neptune/test/cluster.test.ts create mode 100644 packages/@aws-cdk/aws-neptune/test/endpoint.test.ts create mode 100644 packages/@aws-cdk/aws-neptune/test/instance.test.ts create mode 100644 packages/@aws-cdk/aws-neptune/test/integ.cluster.expected.json create mode 100644 packages/@aws-cdk/aws-neptune/test/integ.cluster.ts delete mode 100644 packages/@aws-cdk/aws-neptune/test/neptune.test.ts create mode 100644 packages/@aws-cdk/aws-neptune/test/parameter-group.test.ts create mode 100644 packages/@aws-cdk/aws-neptune/test/subnet-group.test.ts diff --git a/packages/@aws-cdk/aws-neptune/README.md b/packages/@aws-cdk/aws-neptune/README.md index 6b2eddde67362..fc542acf1b3da 100644 --- a/packages/@aws-cdk/aws-neptune/README.md +++ b/packages/@aws-cdk/aws-neptune/README.md @@ -9,10 +9,101 @@ > > [CFN Resources]: https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib +![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge) + +> The APIs of higher level constructs in this module are experimental and under active development. +> They are subject to non-backward compatible changes or removal in any future version. These are +> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be +> announced in the release notes. This means that while you may use them, you may need to update +> your source code when upgrading to a newer version of this package. + --- -```ts +Amazon Neptune is a fast, reliable, fully managed graph database service that makes it easy to build and run applications that work with highly connected datasets. The core of Neptune is a purpose-built, high-performance graph database engine. This engine is optimized for storing billions of relationships and querying the graph with milliseconds latency. Neptune supports the popular graph query languages Apache TinkerPop Gremlin and W3C’s SPARQL, enabling you to build queries that efficiently navigate highly connected datasets. + +The `@aws-cdk/aws-neptune` package contains primitives for setting up Neptune database clusters and instances. + +```ts nofixture import * as neptune from '@aws-cdk/aws-neptune'; ``` + +## Starting a Neptune Database + +To set up a Neptune database, define a `DatabaseCluster`. You must always launch a database in a VPC. + +```ts +const cluster = new neptune.DatabaseCluster(this, 'Database', { + vpc, + instanceType: neptune.InstanceType.R5_LARGE +}); +``` + +By default only writer instance is provisioned with this construct. + +## Connecting + +To control who can access the cluster, use the `.connections` attribute. Neptune databases have a default port, so +you don't need to specify the port: + +```ts fixture=with-cluster +cluster.connections.allowDefaultPortFromAnyIpv4('Open to the world'); +``` + +The endpoints to access your database cluster will be available as the `.clusterEndpoint` and `.clusterReadEndpoint` +attributes: + +```ts fixture=with-cluster +const writeAddress = cluster.clusterEndpoint.socketAddress; // "HOSTNAME:PORT" +``` + +## Customizing parameters + +Neptune allows configuring database behavior by supplying custom parameter groups. For more details, refer to the +following link: + +```ts +const clusterParams = new neptune.ClusterParameterGroup(this, 'ClusterParams', { + description: 'Cluster parameter group', + parameters: { + neptune_enable_audit_log: '1' + }, +}); + +const dbParams = new neptune.ParameterGroup(this, 'DbParams', { + description: 'Db parameter group', + parameters: { + neptune_query_timeout: '120000' + }, +}); + +const cluster = new neptune.DatabaseCluster(this, 'Database', { + vpc, + instanceType: neptune.InstanceType.R5_LARGE, + clusterParameterGroup: clusterParams, + parameterGroup: dbParams, +}); +``` + +## Adding replicas + +`DatabaseCluster` allows launching replicas along with the writer instance. This can be specified using the `instanceCount` +attribute. + +```ts +const cluster = new neptune.DatabaseCluster(this, 'Database', { + vpc, + instanceType: neptune.InstanceType.R5_LARGE, + instances: 2 +}); +``` + +Additionally it is also possible to add replicas using `DatabaseInstance` for an existing cluster. + +```ts fixture=with-cluster +const replica1 = new neptune.DatabaseInstance(this, 'Instance', { + cluster, + instanceType: neptune.InstanceType.R5_LARGE +}); +``` diff --git a/packages/@aws-cdk/aws-neptune/lib/cluster.ts b/packages/@aws-cdk/aws-neptune/lib/cluster.ts new file mode 100644 index 0000000000000..4adbe2ce8ea04 --- /dev/null +++ b/packages/@aws-cdk/aws-neptune/lib/cluster.ts @@ -0,0 +1,457 @@ +import * as ec2 from '@aws-cdk/aws-ec2'; +import * as iam from '@aws-cdk/aws-iam'; +import * as kms from '@aws-cdk/aws-kms'; +import { Duration, IResource, RemovalPolicy, Resource, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; +import { Endpoint } from './endpoint'; +import { InstanceType } from './instance'; +import { CfnDBCluster, CfnDBInstance } from './neptune.generated'; +import { IClusterParameterGroup, IParameterGroup } from './parameter-group'; +import { ISubnetGroup, SubnetGroup } from './subnet-group'; + +/** + * Possible Instances Types to use in Neptune cluster + * used for defining {@link DatabaseClusterProps.engineVersion}. + */ +export class EngineVersion { + /** + * Neptune engine version 1.0.1.0 + */ + public static readonly V1_0_1_0 = new EngineVersion('1.0.1.0'); + /** + * Neptune engine version 1.0.1.1 + */ + public static readonly V1_0_1_1 = new EngineVersion('1.0.1.1'); + /** + * Neptune engine version 1.0.1.2 + */ + public static readonly V1_0_1_2 = new EngineVersion('1.0.1.2'); + /** + * Neptune engine version 1.0.2.1 + */ + public static readonly V1_0_2_1 = new EngineVersion('1.0.2.1'); + /** + * Neptune engine version 1.0.2.2 + */ + public static readonly V1_0_2_2 = new EngineVersion('1.0.2.2'); + /** + * Neptune engine version 1.0.3.0 + */ + public static readonly V1_0_3_0 = new EngineVersion('1.0.3.0'); + /** + * Neptune engine version 1.0.4.0 + */ + public static readonly V1_0_4_0 = new EngineVersion('1.0.4.0'); + /** + * Neptune engine version 1.0.4.1 + */ + public static readonly V1_0_4_1 = new EngineVersion('1.0.4.1'); + + /** + * Constructor for specifying a custom engine version + * @param version the engine version of Neptune + */ + public constructor(public readonly version: string) {} +} + +/** + * Properties for a new database cluster + */ +export interface DatabaseClusterProps { + /** + * What version of the database to start + * + * @default - The default engine version. + */ + readonly engineVersion?: EngineVersion; + + /** + * The port the Neptune cluster will listen on + * + * @default - The default engine port + */ + readonly port?: number; + + /** + * How many days to retain the backup + * + * @default - cdk.Duration.days(1) + */ + readonly backupRetention?: Duration; + + /** + * A daily time range in 24-hours UTC format in which backups preferably execute. + * + * Must be at least 30 minutes long. + * + * Example: '01:00-02:00' + * + * @default - a 30-minute window selected at random from an 8-hour block of + * time for each AWS Region. To see the time blocks available, see + */ + readonly preferredBackupWindow?: string; + + /** + * The KMS key for storage encryption. + * + * @default - default master key. + */ + readonly kmsKey?: kms.IKey; + + /** + * Whether to enable storage encryption + * + * @default true + */ + readonly storageEncrypted?: boolean; + + /** + * Number of Neptune compute instances + * + * @default 1 + */ + readonly instances?: number; + + /** + * An optional identifier for the cluster + * + * @default - A name is automatically generated. + */ + readonly dbClusterName?: string; + + /** + * Base identifier for instances + * + * Every replica is named by appending the replica number to this string, 1-based. + * + * @default - `dbClusterName` is used with the word "Instance" appended. If `dbClusterName` is not provided, the + * identifier is automatically generated. + */ + readonly instanceIdentifierBase?: string; + + /** + * What type of instance to start for the replicas + */ + readonly instanceType: InstanceType; + + /** + * A list of AWS Identity and Access Management (IAM) role that can be used by the cluster to access other AWS services. + * + * @default - No role is attached to the cluster. + */ + readonly associatedRoles?: iam.IRole[]; + + /** + * Indicates whether the DB cluster should have deletion protection enabled. + * + * @default - true if ``removalPolicy`` is RETAIN, false otherwise + */ + readonly deletionProtection?: boolean; + + /** + * A weekly time range in which maintenance should preferably execute. + * + * Must be at least 30 minutes long. + * + * Example: 'tue:04:17-tue:04:47' + * + * @default - 30-minute window selected at random from an 8-hour block of time for + * each AWS Region, occurring on a random day of the week. + */ + readonly preferredMaintenanceWindow?: string; + + /** + * Additional parameters to pass to the database engine + * + * @default - No parameter group. + */ + readonly clusterParameterGroup?: IClusterParameterGroup; + + /** + * The DB parameter group to associate with the instance. + * + * @default no parameter group + */ + readonly parameterGroup?: IParameterGroup; + + /** + * Existing subnet group for the cluster. + * + * @default - a new subnet group will be created. + */ + readonly subnetGroup?: ISubnetGroup; + + /** + * What subnets to run the Neptune instances in. + * + * Must be at least 2 subnets in two different AZs. + */ + readonly vpc: ec2.IVpc; + + /** + * Where to place the instances within the VPC + * + * @default private subnets + */ + readonly vpcSubnets?: ec2.SubnetSelection; + + /** + * Security group. + * + * @default a new security group is created. + */ + readonly securityGroups?: ec2.ISecurityGroup[]; + + /** + * The removal policy to apply when the cluster and its instances are removed + * or replaced during a stack update, or when the stack is deleted. This + * removal policy also applies to the implicit security group created for the + * cluster if one is not supplied as a parameter. + * + * @default - Retain cluster. + */ + readonly removalPolicy?: RemovalPolicy +} + +/** + * Create a clustered database with a given number of instances. + */ +export interface IDatabaseCluster extends IResource, ec2.IConnectable { + /** + * Identifier of the cluster + */ + readonly clusterIdentifier: string; + + /** + * The endpoint to use for read/write operations + * @attribute Endpoint,Port + */ + readonly clusterEndpoint: Endpoint; + + /** + * Endpoint to use for load-balanced read-only operations. + * @attribute ReadEndpoint + */ + readonly clusterReadEndpoint: Endpoint; +} + +/** + * Properties that describe an existing cluster instance + */ +export interface DatabaseClusterAttributes { + /** + * The database port + */ + readonly port: number; + + /** + * The security group of the database cluster + */ + readonly securityGroup: ec2.ISecurityGroup; + + /** + * Identifier for the cluster + */ + readonly clusterIdentifier: string; + + /** + * Cluster endpoint address + */ + readonly clusterEndpointAddress: string; + + /** + * Reader endpoint address + */ + readonly readerEndpointAddress: string; +} + +/** + * Create a clustered database with a given number of instances. + * + * @resource AWS::Neptune::DBCluster + */ +export class DatabaseCluster extends Resource implements IDatabaseCluster { + + /** + * The default number of instances in the Neptune cluster if none are + * specified + */ + public static readonly DEFAULT_NUM_INSTANCES = 1; + + /** + * Import an existing DatabaseCluster from properties + */ + public static fromDatabaseClusterAttributes(scope: Construct, id: string, attrs: DatabaseClusterAttributes): IDatabaseCluster { + class Import extends Resource implements IDatabaseCluster { + public readonly defaultPort = ec2.Port.tcp(attrs.port); + public readonly connections = new ec2.Connections({ + securityGroups: [attrs.securityGroup], + defaultPort: this.defaultPort, + }); + public readonly clusterIdentifier = attrs.clusterIdentifier; + public readonly clusterEndpoint = new Endpoint(attrs.clusterEndpointAddress, attrs.port); + public readonly clusterReadEndpoint = new Endpoint(attrs.readerEndpointAddress, attrs.port); + } + + return new Import(scope, id); + } + + /** + * Identifier of the cluster + */ + public readonly clusterIdentifier: string; + + /** + * The endpoint to use for read/write operations + */ + public readonly clusterEndpoint: Endpoint; + + /** + * Endpoint to use for load-balanced read-only operations. + */ + public readonly clusterReadEndpoint: Endpoint; + + /** + * The resource id for the cluster; for example: cluster-ABCD1234EFGH5678IJKL90MNOP. The cluster ID uniquely + * identifies the cluster and is used in things like IAM authentication policies. + * @attribute ClusterResourceId + */ + public readonly clusterResourceIdentifier: string; + + /** + * The connections object to implement IConectable + */ + public readonly connections: ec2.Connections; + + /** + * The VPC where the DB subnet group is created. + */ + public readonly vpc: ec2.IVpc; + + /** + * The subnets used by the DB subnet group. + */ + public readonly vpcSubnets: ec2.SubnetSelection; + + /** + * Subnet group used by the DB + */ + public readonly subnetGroup: ISubnetGroup; + + /** + * Identifiers of the instance + */ + public readonly instanceIdentifiers: string[] = []; + + /** + * Endpoints which address each individual instance. + */ + public readonly instanceEndpoints: Endpoint[] = []; + + constructor(scope: Construct, id: string, props: DatabaseClusterProps) { + super(scope, id); + + this.vpc = props.vpc; + this.vpcSubnets = props.vpcSubnets ?? { subnetType: ec2.SubnetType.PRIVATE }; + + // Determine the subnet(s) to deploy the Neptune cluster to + const { subnetIds, internetConnectivityEstablished } = this.vpc.selectSubnets(this.vpcSubnets); + + // Cannot test whether the subnets are in different AZs, but at least we can test the amount. + if (subnetIds.length < 2) { + throw new Error(`Cluster requires at least 2 subnets, got ${subnetIds.length}`); + } + + this.subnetGroup = props.subnetGroup ?? new SubnetGroup(this, 'Subnets', { + description: `Subnets for ${id} database`, + vpc: this.vpc, + vpcSubnets: this.vpcSubnets, + removalPolicy: props.removalPolicy === RemovalPolicy.RETAIN ? props.removalPolicy : undefined, + }); + + const securityGroups = props.securityGroups ?? [ + new ec2.SecurityGroup(this, 'SecurityGroup', { + description: 'Neptune security group', + vpc: this.vpc, + }), + ]; + + // Default to encrypted storage + const storageEncrypted = props.storageEncrypted ?? true; + + if (props.kmsKey && !storageEncrypted) { + throw new Error('KMS key supplied but storageEncrypted is false'); + } + + const deletionProtection = props.deletionProtection ?? (props.removalPolicy === RemovalPolicy.RETAIN ? true : undefined); + + // Create the Neptune cluster + const cluster = new CfnDBCluster(this, 'Resource', { + // Basic + engineVersion: props.engineVersion?.version, + dbClusterIdentifier: props.dbClusterName, + dbSubnetGroupName: this.subnetGroup.subnetGroupName, + port: props.port, + vpcSecurityGroupIds: securityGroups.map(sg => sg.securityGroupId), + dbClusterParameterGroupName: props.clusterParameterGroup?.clusterParameterGroupName, + deletionProtection: deletionProtection, + associatedRoles: props.associatedRoles ? props.associatedRoles.map(role => ({ roleArn: role.roleArn })) : undefined, + // Backup + backupRetentionPeriod: props.backupRetention?.toDays(), + preferredBackupWindow: props.preferredBackupWindow, + preferredMaintenanceWindow: props.preferredMaintenanceWindow, + // Encryption + kmsKeyId: props.kmsKey?.keyArn, + storageEncrypted, + }); + + cluster.applyRemovalPolicy(props.removalPolicy, { + applyToUpdateReplacePolicy: true, + }); + + this.clusterIdentifier = cluster.ref; + this.clusterResourceIdentifier = cluster.attrClusterResourceId; + + const port = Token.asNumber(cluster.attrPort); + this.clusterEndpoint = new Endpoint(cluster.attrEndpoint, port); + this.clusterReadEndpoint = new Endpoint(cluster.attrReadEndpoint, port); + + // Create the instances + const instanceCount = props.instances ?? DatabaseCluster.DEFAULT_NUM_INSTANCES; + if (instanceCount < 1) { + throw new Error('At least one instance is required'); + } + + for (let i = 0; i < instanceCount; i++) { + const instanceIndex = i + 1; + + const instanceIdentifier = props.instanceIdentifierBase != null ? `${props.instanceIdentifierBase}${instanceIndex}` + : props.dbClusterName != null ? `${props.dbClusterName}instance${instanceIndex}` : undefined; + + const instance = new CfnDBInstance(this, `Instance${instanceIndex}`, { + // Link to cluster + dbClusterIdentifier: cluster.ref, + dbInstanceIdentifier: instanceIdentifier, + // Instance properties + dbInstanceClass: props.instanceType, + dbParameterGroupName: props.parameterGroup?.parameterGroupName, + }); + + // We must have a dependency on the NAT gateway provider here to create + // things in the right order. + instance.node.addDependency(internetConnectivityEstablished); + + instance.applyRemovalPolicy(props.removalPolicy, { + applyToUpdateReplacePolicy: true, + }); + + this.instanceIdentifiers.push(instance.ref); + this.instanceEndpoints.push(new Endpoint(instance.attrEndpoint, port)); + } + + this.connections = new ec2.Connections({ + defaultPort: ec2.Port.tcp(port), + securityGroups: securityGroups, + }); + } +} diff --git a/packages/@aws-cdk/aws-neptune/lib/endpoint.ts b/packages/@aws-cdk/aws-neptune/lib/endpoint.ts new file mode 100644 index 0000000000000..fc92942416b7d --- /dev/null +++ b/packages/@aws-cdk/aws-neptune/lib/endpoint.ts @@ -0,0 +1,31 @@ +import { Token } from '@aws-cdk/core'; + +/** + * Connection endpoint of a neptune cluster or instance + * + * Consists of a combination of hostname and port. + */ +export class Endpoint { + /** + * The hostname of the endpoint + */ + public readonly hostname: string; + + /** + * The port of the endpoint + */ + public readonly port: number; + + /** + * The combination of "HOSTNAME:PORT" for this endpoint + */ + public readonly socketAddress: string; + + constructor(address: string, port: number) { + this.hostname = address; + this.port = port; + + const portDesc = Token.isUnresolved(port) ? Token.asString(port) : port; + this.socketAddress = `${address}:${portDesc}`; + } +} diff --git a/packages/@aws-cdk/aws-neptune/lib/index.ts b/packages/@aws-cdk/aws-neptune/lib/index.ts index 67cdd432ee7d2..35257958b20aa 100644 --- a/packages/@aws-cdk/aws-neptune/lib/index.ts +++ b/packages/@aws-cdk/aws-neptune/lib/index.ts @@ -1,2 +1,8 @@ +export * from './cluster'; +export * from './instance'; +export * from './endpoint'; +export * from './parameter-group'; +export * from './subnet-group'; + // AWS::Neptune CloudFormation Resources: export * from './neptune.generated'; diff --git a/packages/@aws-cdk/aws-neptune/lib/instance.ts b/packages/@aws-cdk/aws-neptune/lib/instance.ts new file mode 100644 index 0000000000000..8459c710577c8 --- /dev/null +++ b/packages/@aws-cdk/aws-neptune/lib/instance.ts @@ -0,0 +1,234 @@ +import * as ec2 from '@aws-cdk/aws-ec2'; +import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; +import { IDatabaseCluster } from './cluster'; +import { Endpoint } from './endpoint'; +import { CfnDBInstance } from './neptune.generated'; +import { IParameterGroup } from './parameter-group'; + +/** + * Possible Instances Types to use in Neptune cluster + * used for defining {@link DatabaseInstanceProps.instanceType}. + */ +export enum InstanceType { + /** + * db.r5.large + */ + R5_LARGE = 'db.r5.large', + /** + * db.r5.xlarge + */ + R5_XLARGE = 'db.r5.xlarge', + /** + * db.r5.2xlarge + */ + R5_2XLARGE = 'db.r5.2xlarge', + /** + * db.r5.4xlarge + */ + R5_4XLARGE = 'db.r5.4xlarge', + /** + * db.r5.8xlarge + */ + R5_8XLARGE = 'db.r5.8xlarge', + /** + * db.r5.12xlarge + */ + R5_12XLARGE = 'db.r5.12xlarge', + /** + * db.r5.24xlarge + */ + R5_24XLARGE = 'db.r5.24xlarge', + /** + * db.r4.large + */ + R4_LARGE = 'db.r4.large', + /** + * db.r4.xlarge + */ + R4_XLARGE = 'db.r4.xlarge', + /** + * db.r4.2xlarge + */ + R4_2XLARGE = 'db.r4.2xlarge', + /** + * db.r4.4xlarge + */ + R4_4XLARGE = 'db.r4.4xlarge', + /** + * db.r4.8xlarge + */ + R4_8XLARGE = 'db.r4.8xlarge', + /** + * db.t3.medium + */ + T3_MEDIUM = 'db.t3.medium' +} + +/** + * A database instance + */ +export interface IDatabaseInstance extends cdk.IResource { + /** + * The instance identifier. + */ + readonly instanceIdentifier: string; + + /** + * The instance endpoint. + */ + readonly instanceEndpoint: Endpoint; + + /** + * The instance endpoint address. + * + * @attribute Endpoint + */ + readonly dbInstanceEndpointAddress: string; + + /** + * The instance endpoint port. + * + * @attribute Port + */ + readonly dbInstanceEndpointPort: string; +} + +/** + * Properties that describe an existing instance + */ +export interface DatabaseInstanceAttributes { + /** + * The instance identifier. + */ + readonly instanceIdentifier: string; + + /** + * The endpoint address. + */ + readonly instanceEndpointAddress: string; + + /** + * The database port. + */ + readonly port: number; +} + +/** + * Construction properties for a DatabaseInstanceNew + */ +export interface DatabaseInstanceProps { + /** + * The Neptune database cluster the instance should launch into. + */ + readonly cluster: IDatabaseCluster; + + /** + * What type of instance to start for the replicas + */ + readonly instanceType: InstanceType; + + /** + * The name of the Availability Zone where the DB instance will be located. + * + * @default - no preference + */ + readonly availabilityZone?: string; + + /** + * A name for the DB instance. If you specify a name, AWS CloudFormation + * converts it to lowercase. + * + * @default - a CloudFormation generated name + */ + readonly dbInstanceName?: string; + + /** + * The DB parameter group to associate with the instance. + * + * @default no parameter group + */ + readonly parameterGroup?: IParameterGroup; + + /** + * The CloudFormation policy to apply when the instance is removed from the + * stack or replaced during an update. + * + * @default RemovalPolicy.Retain + */ + readonly removalPolicy?: cdk.RemovalPolicy +} + +/** + * A database instance + * + * @resource AWS::Neptune::DBInstance + */ +export class DatabaseInstance extends cdk.Resource implements IDatabaseInstance { + + /** + * Import an existing database instance. + */ + public static fromDatabaseInstanceAttributes(scope: Construct, id: string, attrs: DatabaseInstanceAttributes): IDatabaseInstance { + class Import extends cdk.Resource implements IDatabaseInstance { + public readonly defaultPort = ec2.Port.tcp(attrs.port); + public readonly instanceIdentifier = attrs.instanceIdentifier; + public readonly dbInstanceEndpointAddress = attrs.instanceEndpointAddress; + public readonly dbInstanceEndpointPort = attrs.port.toString(); + public readonly instanceEndpoint = new Endpoint(attrs.instanceEndpointAddress, attrs.port); + } + + return new Import(scope, id); + } + + + /** + * The instance's database cluster + */ + public readonly cluster: IDatabaseCluster; + + /** + * @inheritdoc + */ + public readonly instanceIdentifier: string; + + /** + * @inheritdoc + */ + public readonly instanceEndpoint: Endpoint; + + /** + * @inheritdoc + */ + public readonly dbInstanceEndpointAddress: string; + + /** + * @inheritdoc + */ + public readonly dbInstanceEndpointPort: string; + + constructor(scope: Construct, id: string, props: DatabaseInstanceProps) { + super(scope, id); + + const instance = new CfnDBInstance(this, 'Resource', { + dbClusterIdentifier: props.cluster.clusterIdentifier, + dbInstanceClass: props.instanceType, + availabilityZone: props.availabilityZone, + dbInstanceIdentifier: props.dbInstanceName, + dbParameterGroupName: props.parameterGroup?.parameterGroupName, + }); + + this.cluster = props.cluster; + this.instanceIdentifier = instance.ref; + this.dbInstanceEndpointAddress = instance.attrEndpoint; + this.dbInstanceEndpointPort = instance.attrPort; + + // create a number token that represents the port of the instance + const portAttribute = cdk.Token.asNumber(instance.attrPort); + this.instanceEndpoint = new Endpoint(instance.attrEndpoint, portAttribute); + + instance.applyRemovalPolicy(props.removalPolicy, { + applyToUpdateReplacePolicy: true, + }); + } +} diff --git a/packages/@aws-cdk/aws-neptune/lib/parameter-group.ts b/packages/@aws-cdk/aws-neptune/lib/parameter-group.ts new file mode 100644 index 0000000000000..3cfacf061f19c --- /dev/null +++ b/packages/@aws-cdk/aws-neptune/lib/parameter-group.ts @@ -0,0 +1,135 @@ +import { IResource, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; +import { CfnDBClusterParameterGroup } from './neptune.generated'; + +/** + * Properties for a parameter group + */ +interface ParameterGroupPropsBase { + /** + * Description for this parameter group + * + * @default a CDK generated description + */ + readonly description?: string; + + /** + * The parameters in this parameter group + */ + readonly parameters: { [key: string]: string }; +} + +/** + * Marker class for cluster parameter group + */ +export interface ClusterParameterGroupProps extends ParameterGroupPropsBase { + /** + * The name of the parameter group + * + * @default A CDK generated name for the parameter group + */ + readonly clusterParameterGroupName?: string; +} + +/** + * Marker class for cluster parameter group + */ +export interface ParameterGroupProps extends ParameterGroupPropsBase { + /** + * The name of the parameter group + * + * @default A CDK generated name for the parameter group + */ + readonly parameterGroupName?: string; +} + +/** + * A parameter group + */ +export interface IClusterParameterGroup extends IResource { + /** + * The name of this parameter group + */ + readonly clusterParameterGroupName: string; +} + + +/** + * A cluster parameter group + * + * @resource AWS::Neptune::DBClusterParameterGroup + */ +export class ClusterParameterGroup extends Resource implements IClusterParameterGroup { + /** + * Imports a parameter group + */ + public static fromClusterParameterGroupName(scope: Construct, id: string, clusterParameterGroupName: string): IClusterParameterGroup { + class Import extends Resource implements IClusterParameterGroup { + public readonly clusterParameterGroupName = clusterParameterGroupName; + } + return new Import(scope, id); + } + + /** + * The name of the parameter group + */ + public readonly clusterParameterGroupName: string; + + constructor(scope: Construct, id: string, props: ClusterParameterGroupProps) { + super(scope, id); + + const resource = new CfnDBClusterParameterGroup(this, 'Resource', { + name: props.clusterParameterGroupName, + description: props.description || 'Cluster parameter group for neptune db cluster', + family: 'neptune1', + parameters: props.parameters, + }); + + this.clusterParameterGroupName = resource.ref; + } +} + +/** + * A parameter group + */ +export interface IParameterGroup extends IResource { + /** + * The name of this parameter group + */ + readonly parameterGroupName: string; +} + +/** + * DB parameter group + * + * @resource AWS::Neptune::DBParameterGroup + */ +export class ParameterGroup extends Resource implements IParameterGroup { + /** + * Imports a parameter group + */ + public static fromParameterGroupName(scope: Construct, id: string, parameterGroupName: string): IParameterGroup { + class Import extends Resource implements IParameterGroup { + public readonly parameterGroupName = parameterGroupName; + } + return new Import(scope, id); + } + + /** + * The name of the parameter group + */ + public readonly parameterGroupName: string; + + constructor(scope: Construct, id: string, props: ParameterGroupProps) { + super(scope, id); + + const resource = new CfnDBClusterParameterGroup(this, 'Resource', { + name: props.parameterGroupName, + description: props.description || 'Instance parameter group for neptune db instances', + family: 'neptune1', + parameters: props.parameters, + }); + + this.parameterGroupName = resource.ref; + } +} diff --git a/packages/@aws-cdk/aws-neptune/lib/subnet-group.ts b/packages/@aws-cdk/aws-neptune/lib/subnet-group.ts new file mode 100644 index 0000000000000..383435b7a0b38 --- /dev/null +++ b/packages/@aws-cdk/aws-neptune/lib/subnet-group.ts @@ -0,0 +1,91 @@ +import * as ec2 from '@aws-cdk/aws-ec2'; +import { IResource, RemovalPolicy, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; +import { CfnDBSubnetGroup } from './neptune.generated'; + +/** + * Interface for a subnet group. + */ +export interface ISubnetGroup extends IResource { + /** + * The name of the subnet group. + * @attribute + */ + readonly subnetGroupName: string; +} + +/** + * Properties for creating a SubnetGroup. + */ +export interface SubnetGroupProps { + /** + * Description of the subnet group. + * + * @default - a name is generated + */ + readonly description?: string; + + /** + * The VPC to place the subnet group in. + */ + readonly vpc: ec2.IVpc; + + /** + * The name of the subnet group. + * + * @default - a name is generated + */ + readonly subnetGroupName?: string; + + /** + * Which subnets within the VPC to associate with this group. + * + * @default - private subnets + */ + readonly vpcSubnets?: ec2.SubnetSelection; + + /** + * The removal policy to apply when the subnet group are removed + * from the stack or replaced during an update. + * + * @default RemovalPolicy.DESTROY + */ + readonly removalPolicy?: RemovalPolicy +} + +/** + * Class for creating a RDS DB subnet group + * + * @resource AWS::Neptune::DBSubnetGroup + */ +export class SubnetGroup extends Resource implements ISubnetGroup { + + /** + * Imports an existing subnet group by name. + */ + public static fromSubnetGroupName(scope: Construct, id: string, subnetGroupName: string): ISubnetGroup { + return new class extends Resource implements ISubnetGroup { + public readonly subnetGroupName = subnetGroupName; + }(scope, id); + } + + public readonly subnetGroupName: string; + + constructor(scope: Construct, id: string, props: SubnetGroupProps) { + super(scope, id); + + const { subnetIds } = props.vpc.selectSubnets(props.vpcSubnets ?? { subnetType: ec2.SubnetType.PRIVATE }); + + const subnetGroup = new CfnDBSubnetGroup(this, 'Resource', { + dbSubnetGroupDescription: props.description || 'Subnet group for Neptune', + dbSubnetGroupName: props.subnetGroupName, + subnetIds, + }); + + if (props.removalPolicy) { + subnetGroup.applyRemovalPolicy(props.removalPolicy); + } + + this.subnetGroupName = subnetGroup.ref; + } +} diff --git a/packages/@aws-cdk/aws-neptune/package.json b/packages/@aws-cdk/aws-neptune/package.json index f4ae26436389b..5afe6d91322a2 100644 --- a/packages/@aws-cdk/aws-neptune/package.json +++ b/packages/@aws-cdk/aws-neptune/package.json @@ -74,22 +74,36 @@ "devDependencies": { "@aws-cdk/assert": "0.0.0", "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0" }, "dependencies": { + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", "constructs": "^3.2.0" }, "peerDependencies": { + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", "constructs": "^3.2.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" }, + "awslint": { + "exclude": [ + "props-physical-name:@aws-cdk/aws-neptune.ParameterGroupProps", + "props-physical-name:@aws-cdk/aws-neptune.ClusterParameterGroupProps", + "props-physical-name:@aws-cdk/aws-neptune.SubnetGroupProps" + ] + }, "stability": "experimental", - "maturity": "cfn-only", + "maturity": "experimental", "awscdkio": { "announce": false }, diff --git a/packages/@aws-cdk/aws-neptune/rosetta/default.ts-fixture b/packages/@aws-cdk/aws-neptune/rosetta/default.ts-fixture new file mode 100644 index 0000000000000..2e687290371fa --- /dev/null +++ b/packages/@aws-cdk/aws-neptune/rosetta/default.ts-fixture @@ -0,0 +1,14 @@ +import { Duration, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; +import * as ec2 from '@aws-cdk/aws-ec2'; +import * as neptune from '@aws-cdk/aws-neptune'; + +class Fixture extends Stack { + constructor(scope: Construct, id: string) { + super(scope, id); + + const vpc = new ec2.Vpc(this, 'VPC', { maxAzs: 2 }); + + /// here + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-neptune/rosetta/with-cluster.ts-fixture b/packages/@aws-cdk/aws-neptune/rosetta/with-cluster.ts-fixture new file mode 100644 index 0000000000000..c638d8b4d04fa --- /dev/null +++ b/packages/@aws-cdk/aws-neptune/rosetta/with-cluster.ts-fixture @@ -0,0 +1,19 @@ +import { Duration, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; +import * as ec2 from '@aws-cdk/aws-ec2'; +import * as neptune from '@aws-cdk/aws-neptune'; + +class Fixture extends Stack { + constructor(scope: Construct, id: string) { + super(scope, id); + + const vpc = new ec2.Vpc(this, 'VPC', { maxAzs: 2 }); + + const cluster = new neptune.DatabaseCluster(this, 'Database', { + vpc, + instanceType: neptune.InstanceType.R5_LARGE, + }); + + /// here + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-neptune/test/cluster.test.ts b/packages/@aws-cdk/aws-neptune/test/cluster.test.ts new file mode 100644 index 0000000000000..d2c5ff4b6c1ef --- /dev/null +++ b/packages/@aws-cdk/aws-neptune/test/cluster.test.ts @@ -0,0 +1,439 @@ +import { expect as expectCDK, haveResource, ResourcePart } from '@aws-cdk/assert'; +import * as ec2 from '@aws-cdk/aws-ec2'; +import * as iam from '@aws-cdk/aws-iam'; +import * as kms from '@aws-cdk/aws-kms'; +import * as cdk from '@aws-cdk/core'; + +import { ClusterParameterGroup, DatabaseCluster, EngineVersion, InstanceType } from '../lib'; + +describe('DatabaseCluster', () => { + + test('check that instantiation works', () => { + // GIVEN + const stack = testStack(); + const vpc = new ec2.Vpc(stack, 'VPC'); + + // WHEN + new DatabaseCluster(stack, 'Database', { + vpc, + instanceType: InstanceType.R5_LARGE, + }); + + // THEN + expectCDK(stack).to(haveResource('AWS::Neptune::DBCluster', { + Properties: { + DBSubnetGroupName: { Ref: 'DatabaseSubnets3C9252C9' }, + VpcSecurityGroupIds: [{ 'Fn::GetAtt': ['DatabaseSecurityGroup5C91FDCB', 'GroupId'] }], + StorageEncrypted: true, + }, + DeletionPolicy: 'Retain', + UpdateReplacePolicy: 'Retain', + }, ResourcePart.CompleteDefinition)); + + expectCDK(stack).to(haveResource('AWS::Neptune::DBInstance', { + DeletionPolicy: 'Retain', + UpdateReplacePolicy: 'Retain', + }, ResourcePart.CompleteDefinition)); + + expectCDK(stack).to(haveResource('AWS::Neptune::DBSubnetGroup', { + SubnetIds: [ + { Ref: 'VPCPrivateSubnet1Subnet8BCA10E0' }, + { Ref: 'VPCPrivateSubnet2SubnetCFCDAA7A' }, + { Ref: 'VPCPrivateSubnet3Subnet3EDCD457' }, + ], + })); + }); + + test('can create a cluster with a single instance', () => { + // GIVEN + const stack = testStack(); + const vpc = new ec2.Vpc(stack, 'VPC'); + + // WHEN + new DatabaseCluster(stack, 'Database', { + instances: 1, + vpc, + instanceType: InstanceType.R5_LARGE, + }); + + // THEN + expectCDK(stack).to(haveResource('AWS::Neptune::DBCluster', { + DBSubnetGroupName: { Ref: 'DatabaseSubnets3C9252C9' }, + VpcSecurityGroupIds: [{ 'Fn::GetAtt': ['DatabaseSecurityGroup5C91FDCB', 'GroupId'] }], + })); + }); + + test('errors when less than one instance is specified', () => { + // GIVEN + const stack = testStack(); + const vpc = new ec2.Vpc(stack, 'VPC'); + + // WHEN + expect(() => { + new DatabaseCluster(stack, 'Database', { + instances: 0, + vpc, + instanceType: InstanceType.R5_LARGE, + }); + }).toThrowError('At least one instance is required'); + }); + + test('errors when only one subnet is specified', () => { + // GIVEN + const stack = testStack(); + const vpc = new ec2.Vpc(stack, 'VPC', { + maxAzs: 1, + }); + + // WHEN + expect(() => { + new DatabaseCluster(stack, 'Database', { + instances: 1, + vpc, + vpcSubnets: { + subnetType: ec2.SubnetType.PRIVATE, + }, + instanceType: InstanceType.R5_LARGE, + }); + }).toThrowError('Cluster requires at least 2 subnets, got 1'); + }); + + test('can create a cluster with custom engine version', () => { + // GIVEN + const stack = testStack(); + const vpc = new ec2.Vpc(stack, 'VPC'); + + // WHEN + new DatabaseCluster(stack, 'Database', { + vpc, + instanceType: InstanceType.R5_LARGE, + engineVersion: EngineVersion.V1_0_4_1, + }); + + // THEN + expectCDK(stack).to(haveResource('AWS::Neptune::DBCluster', { + EngineVersion: '1.0.4.1', + DBSubnetGroupName: { Ref: 'DatabaseSubnets3C9252C9' }, + VpcSecurityGroupIds: [{ 'Fn::GetAtt': ['DatabaseSecurityGroup5C91FDCB', 'GroupId'] }], + })); + }); + + test('can create a cluster with imported vpc and security group', () => { + // GIVEN + const stack = testStack(); + const vpc = ec2.Vpc.fromLookup(stack, 'VPC', { + vpcId: 'VPC12345', + }); + const sg = ec2.SecurityGroup.fromSecurityGroupId(stack, 'SG', 'SecurityGroupId12345'); + + // WHEN + new DatabaseCluster(stack, 'Database', { + instances: 1, + vpc, + securityGroups: [sg], + instanceType: InstanceType.R5_LARGE, + }); + + // THEN + expectCDK(stack).to(haveResource('AWS::Neptune::DBCluster', { + DBSubnetGroupName: { Ref: 'DatabaseSubnets3C9252C9' }, + VpcSecurityGroupIds: ['SecurityGroupId12345'], + })); + }); + + test('cluster with parameter group', () => { + // GIVEN + const stack = testStack(); + const vpc = new ec2.Vpc(stack, 'VPC'); + + // WHEN + const group = new ClusterParameterGroup(stack, 'Params', { + description: 'bye', + parameters: { + param: 'value', + }, + }); + new DatabaseCluster(stack, 'Database', { + vpc, + instanceType: InstanceType.R5_LARGE, + clusterParameterGroup: group, + }); + + // THEN + expectCDK(stack).to(haveResource('AWS::Neptune::DBCluster', { + DBClusterParameterGroupName: { Ref: 'ParamsA8366201' }, + })); + }); + + test('cluster with associated role', () => { + // GIVEN + const stack = testStack(); + const vpc = new ec2.Vpc(stack, 'VPC'); + + // WHEN + const role = new iam.Role(stack, 'Role', { + assumedBy: new iam.ServicePrincipal('rds.amazonaws.com'), + }); + role.addManagedPolicy(iam.ManagedPolicy.fromAwsManagedPolicyName('AmazonS3ReadOnlyAccess')); + + new DatabaseCluster(stack, 'Database', { + vpc, + associatedRoles: [role], + instanceType: InstanceType.R5_LARGE, + }); + + // THEN + expectCDK(stack).to(haveResource('AWS::Neptune::DBCluster', { + AssociatedRoles: [ + { + RoleArn: { + 'Fn::GetAtt': [ + 'Role1ABCC5F0', + 'Arn', + ], + }, + }, + ], + })); + }); + + test('cluster with imported parameter group', () => { + // GIVEN + const stack = testStack(); + const vpc = new ec2.Vpc(stack, 'VPC'); + + // WHEN + const group = ClusterParameterGroup.fromClusterParameterGroupName(stack, 'Params', 'ParamGroupName'); + + new DatabaseCluster(stack, 'Database', { + vpc, + instanceType: InstanceType.R5_LARGE, + clusterParameterGroup: group, + }); + + // THEN + expectCDK(stack).to(haveResource('AWS::Neptune::DBCluster', { + DBClusterParameterGroupName: 'ParamGroupName', + })); + }); + + test('create an encrypted cluster with custom KMS key', () => { + // GIVEN + const stack = testStack(); + const vpc = new ec2.Vpc(stack, 'VPC'); + + // WHEN + new DatabaseCluster(stack, 'Database', { + vpc, + instanceType: InstanceType.R5_LARGE, + kmsKey: new kms.Key(stack, 'Key'), + }); + + // THEN + expectCDK(stack).to(haveResource('AWS::Neptune::DBCluster', { + KmsKeyId: { + 'Fn::GetAtt': [ + 'Key961B73FD', + 'Arn', + ], + }, + StorageEncrypted: true, + })); + }); + + test('creating a cluster defaults to using encryption', () => { + // GIVEN + const stack = testStack(); + const vpc = new ec2.Vpc(stack, 'VPC'); + + // WHEN + new DatabaseCluster(stack, 'Database', { + vpc, + instanceType: InstanceType.R5_LARGE, + }); + + // THEN + expectCDK(stack).to(haveResource('AWS::Neptune::DBCluster', { + StorageEncrypted: true, + })); + }); + + test('supplying a KMS key with storageEncryption false throws an error', () => { + // GIVEN + const stack = testStack(); + const vpc = new ec2.Vpc(stack, 'VPC'); + + // WHEN + function action() { + new DatabaseCluster(stack, 'Database', { + vpc, + instanceType: InstanceType.R5_LARGE, + kmsKey: new kms.Key(stack, 'Key'), + storageEncrypted: false, + }); + } + + // THEN + expect(action).toThrow(); + }); + + test('cluster exposes different read and write endpoints', () => { + // GIVEN + const stack = testStack(); + const vpc = new ec2.Vpc(stack, 'VPC'); + + // WHEN + const cluster = new DatabaseCluster(stack, 'Database', { + vpc, + instanceType: InstanceType.R5_LARGE, + }); + + // THEN + expect(stack.resolve(cluster.clusterEndpoint)).not.toBe(stack.resolve(cluster.clusterReadEndpoint)); + }); + + test('instance identifier used when present', () => { + // GIVEN + const stack = testStack(); + const vpc = new ec2.Vpc(stack, 'VPC'); + + // WHEN + const instanceIdentifierBase = 'instanceidentifierbase-'; + new DatabaseCluster(stack, 'Database', { + vpc, + instanceType: InstanceType.R5_LARGE, + instanceIdentifierBase, + }); + + // THEN + expectCDK(stack).to(haveResource('AWS::Neptune::DBInstance', { + DBInstanceIdentifier: `${instanceIdentifierBase}1`, + })); + }); + + test('cluster identifier used', () => { + // GIVEN + const stack = testStack(); + const vpc = new ec2.Vpc(stack, 'VPC'); + + // WHEN + const clusterIdentifier = 'clusteridentifier-'; + new DatabaseCluster(stack, 'Database', { + vpc, + instanceType: InstanceType.R5_LARGE, + dbClusterName: clusterIdentifier, + }); + + // THEN + expectCDK(stack).to(haveResource('AWS::Neptune::DBInstance', { + DBInstanceIdentifier: `${clusterIdentifier}instance1`, + })); + }); + + test('imported cluster has supplied attributes', () => { + // GIVEN + const stack = testStack(); + + // WHEN + const cluster = DatabaseCluster.fromDatabaseClusterAttributes(stack, 'Database', { + clusterEndpointAddress: 'addr', + clusterIdentifier: 'identifier', + port: 3306, + readerEndpointAddress: 'reader-address', + securityGroup: ec2.SecurityGroup.fromSecurityGroupId(stack, 'SG', 'sg-123456789', { + allowAllOutbound: false, + }), + }); + + // THEN + expect(cluster.clusterEndpoint.hostname).toEqual('addr'); + expect(cluster.clusterEndpoint.port).toEqual(3306); + expect(cluster.clusterIdentifier).toEqual('identifier'); + expect(cluster.clusterReadEndpoint.hostname).toEqual('reader-address'); + }); + + test('imported cluster with imported security group honors allowAllOutbound', () => { + // GIVEN + const stack = testStack(); + + const cluster = DatabaseCluster.fromDatabaseClusterAttributes(stack, 'Database', { + clusterEndpointAddress: 'addr', + clusterIdentifier: 'identifier', + port: 3306, + readerEndpointAddress: 'reader-address', + securityGroup: ec2.SecurityGroup.fromSecurityGroupId(stack, 'SG', 'sg-123456789', { + allowAllOutbound: false, + }), + }); + + // WHEN + cluster.connections.allowToAnyIpv4(ec2.Port.tcp(443)); + + // THEN + expectCDK(stack).to(haveResource('AWS::EC2::SecurityGroupEgress', { + GroupId: 'sg-123456789', + })); + }); + + test('backup retention period respected', () => { + // GIVEN + const stack = testStack(); + const vpc = new ec2.Vpc(stack, 'VPC'); + + // WHEN + new DatabaseCluster(stack, 'Database', { + vpc, + instanceType: InstanceType.R5_LARGE, + backupRetention: cdk.Duration.days(20), + }); + + // THEN + expectCDK(stack).to(haveResource('AWS::Neptune::DBCluster', { + BackupRetentionPeriod: 20, + })); + }); + + test('backup maintenance window respected', () => { + // GIVEN + const stack = testStack(); + const vpc = new ec2.Vpc(stack, 'VPC'); + + // WHEN + new DatabaseCluster(stack, 'Database', { + vpc, + instanceType: InstanceType.R5_LARGE, + backupRetention: cdk.Duration.days(20), + preferredBackupWindow: '07:34-08:04', + }); + + // THEN + expectCDK(stack).to(haveResource('AWS::Neptune::DBCluster', { + BackupRetentionPeriod: 20, + PreferredBackupWindow: '07:34-08:04', + })); + }); + + test('regular maintenance window respected', () => { + // GIVEN + const stack = testStack(); + const vpc = new ec2.Vpc(stack, 'VPC'); + + // WHEN + new DatabaseCluster(stack, 'Database', { + vpc, + instanceType: InstanceType.R5_LARGE, + preferredMaintenanceWindow: '07:34-08:04', + }); + + // THEN + expectCDK(stack).to(haveResource('AWS::Neptune::DBCluster', { + PreferredMaintenanceWindow: '07:34-08:04', + })); + }); +}); + +function testStack() { + const stack = new cdk.Stack(undefined, undefined, { env: { account: '12345', region: 'us-test-1' } }); + stack.node.setContext('availability-zones:12345:us-test-1', ['us-test-1a', 'us-test-1b']); + return stack; +} diff --git a/packages/@aws-cdk/aws-neptune/test/endpoint.test.ts b/packages/@aws-cdk/aws-neptune/test/endpoint.test.ts new file mode 100644 index 0000000000000..cd5bd17bd3af2 --- /dev/null +++ b/packages/@aws-cdk/aws-neptune/test/endpoint.test.ts @@ -0,0 +1,15 @@ +import { Endpoint } from '../lib'; + +describe('Endpoint', () => { + test('accepts valid port string numbers', () => { + // GIVEN + for (const port of [1, 50, 65535]) { + // WHEN + const endpoint = new Endpoint('127.0.0.1', port); + + // THEN + expect(endpoint.port).toBe(port); + } + }); + +}); diff --git a/packages/@aws-cdk/aws-neptune/test/instance.test.ts b/packages/@aws-cdk/aws-neptune/test/instance.test.ts new file mode 100644 index 0000000000000..4dcfc75e243ac --- /dev/null +++ b/packages/@aws-cdk/aws-neptune/test/instance.test.ts @@ -0,0 +1,131 @@ +import { expect as expectCDK, haveOutput, haveResource, ResourcePart } from '@aws-cdk/assert'; +import * as ec2 from '@aws-cdk/aws-ec2'; +import * as cdk from '@aws-cdk/core'; +import * as constructs from 'constructs'; + +import { DatabaseCluster, DatabaseInstance, InstanceType, ParameterGroup } from '../lib'; + +describe('DatabaseInstance', () => { + test('check that instantiation works', () => { + // GIVEN + const stack = testStack(); + + // WHEN + new DatabaseInstance(stack, 'Instance', { + cluster: stack.cluster, + instanceType: InstanceType.R5_LARGE, + }); + + // THEN + expectCDK(stack).to(haveResource('AWS::Neptune::DBInstance', { + Properties: { + DBClusterIdentifier: { Ref: 'DatabaseB269D8BB' }, + DBInstanceClass: 'db.r5.large', + }, + DeletionPolicy: 'Retain', + UpdateReplacePolicy: 'Retain', + }, ResourcePart.CompleteDefinition)); + }); + + test('check that the endpoint works', () => { + // GIVEN + const stack = testStack(); + const instance = new DatabaseInstance(stack, 'Instance', { + cluster: stack.cluster, + instanceType: InstanceType.R5_LARGE, + }); + const exportName = 'DbInstanceEndpoint'; + + // WHEN + new cdk.CfnOutput(stack, exportName, { + exportName, + value: instance.instanceEndpoint.socketAddress, + }); + + // THEN + expectCDK(stack).to(haveOutput({ + exportName, + outputValue: { + 'Fn::Join': [ + '', + [ + { 'Fn::GetAtt': ['InstanceC1063A87', 'Endpoint'] }, + ':', + { 'Fn::GetAtt': ['InstanceC1063A87', 'Port'] }, + ], + ], + }, + })); + }); + + test('check importing works as expected', () => { + // GIVEN + const stack = testStack(); + const endpointExportName = 'DbInstanceEndpoint'; + const instanceEndpointAddress = '127.0.0.1'; + const instanceIdentifier = 'InstanceID'; + const port = 8888; + + // WHEN + const instance = DatabaseInstance.fromDatabaseInstanceAttributes(stack, 'Instance', { + instanceEndpointAddress, + instanceIdentifier, + port, + }); + new cdk.CfnOutput(stack, 'EndpointOutput', { + exportName: endpointExportName, + value: instance.instanceEndpoint.socketAddress, + }); + + // THEN + expectCDK(stack).to(haveOutput({ + exportName: endpointExportName, + outputValue: `${instanceEndpointAddress}:${port}`, + })); + }); + + test('instance with parameter group', () => { + // GIVEN + const stack = testStack(); + + // WHEN + const group = new ParameterGroup(stack, 'Params', { + description: 'bye', + parameters: { + param: 'value', + }, + }); + new DatabaseInstance(stack, 'Instance', { + cluster: stack.cluster, + instanceType: InstanceType.R5_LARGE, + parameterGroup: group, + }); + + // THEN + expectCDK(stack).to(haveResource('AWS::Neptune::DBInstance', { + DBParameterGroupName: { Ref: 'ParamsA8366201' }, + })); + }); +}); + +class TestStack extends cdk.Stack { + public readonly vpc: ec2.Vpc; + public readonly cluster: DatabaseCluster; + + constructor(scope?: constructs.Construct, id?: string, props: cdk.StackProps = {}) { + super(scope, id, props); + + this.node.setContext('availability-zones:12345:us-test-1', ['us-test-1a', 'us-test-1b']); + + this.vpc = new ec2.Vpc(this, 'VPC'); + this.cluster = new DatabaseCluster(this, 'Database', { + instanceType: InstanceType.R5_LARGE, + vpc: this.vpc, + }); + } +} + +function testStack() { + const stack = new TestStack(undefined, undefined, { env: { account: '12345', region: 'us-test-1' } }); + return stack; +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-neptune/test/integ.cluster.expected.json b/packages/@aws-cdk/aws-neptune/test/integ.cluster.expected.json new file mode 100644 index 0000000000000..823f7af2a5b45 --- /dev/null +++ b/packages/@aws-cdk/aws-neptune/test/integ.cluster.expected.json @@ -0,0 +1,504 @@ +{ + "Resources": { + "VPCB9E5F0B4": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-neptune-integ/VPC" + } + ] + } + }, + "VPCPublicSubnet1SubnetB4246D30": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "CidrBlock": "10.0.0.0/18", + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "AvailabilityZone": "test-region-1a", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "aws-cdk-neptune-integ/VPC/PublicSubnet1" + } + ] + } + }, + "VPCPublicSubnet1RouteTableFEE4B781": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-neptune-integ/VPC/PublicSubnet1" + } + ] + } + }, + "VPCPublicSubnet1RouteTableAssociation0B0896DC": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + }, + "SubnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + } + } + }, + "VPCPublicSubnet1DefaultRoute91CEF279": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VPCIGWB7E252D3" + } + }, + "DependsOn": [ + "VPCVPCGW99B986DC" + ] + }, + "VPCPublicSubnet1EIP6AD938E8": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-neptune-integ/VPC/PublicSubnet1" + } + ] + } + }, + "VPCPublicSubnet1NATGatewayE0556630": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet1EIP6AD938E8", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-neptune-integ/VPC/PublicSubnet1" + } + ] + } + }, + "VPCPublicSubnet2Subnet74179F39": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "CidrBlock": "10.0.64.0/18", + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "AvailabilityZone": "test-region-1b", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "aws-cdk-neptune-integ/VPC/PublicSubnet2" + } + ] + } + }, + "VPCPublicSubnet2RouteTable6F1A15F1": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-neptune-integ/VPC/PublicSubnet2" + } + ] + } + }, + "VPCPublicSubnet2RouteTableAssociation5A808732": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + }, + "SubnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + } + } + }, + "VPCPublicSubnet2DefaultRouteB7481BBA": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VPCIGWB7E252D3" + } + }, + "DependsOn": [ + "VPCVPCGW99B986DC" + ] + }, + "VPCPublicSubnet2EIP4947BC00": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-neptune-integ/VPC/PublicSubnet2" + } + ] + } + }, + "VPCPublicSubnet2NATGateway3C070193": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet2EIP4947BC00", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-neptune-integ/VPC/PublicSubnet2" + } + ] + } + }, + "VPCPrivateSubnet1Subnet8BCA10E0": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "CidrBlock": "10.0.128.0/18", + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "AvailabilityZone": "test-region-1a", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "aws-cdk-neptune-integ/VPC/PrivateSubnet1" + } + ] + } + }, + "VPCPrivateSubnet1RouteTableBE8A6027": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-neptune-integ/VPC/PrivateSubnet1" + } + ] + } + }, + "VPCPrivateSubnet1RouteTableAssociation347902D1": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + }, + "SubnetId": { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + } + } + }, + "VPCPrivateSubnet1DefaultRouteAE1D6490": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "VPCPublicSubnet1NATGatewayE0556630" + } + } + }, + "VPCPrivateSubnet2SubnetCFCDAA7A": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "CidrBlock": "10.0.192.0/18", + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "AvailabilityZone": "test-region-1b", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "aws-cdk-neptune-integ/VPC/PrivateSubnet2" + } + ] + } + }, + "VPCPrivateSubnet2RouteTable0A19E10E": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-neptune-integ/VPC/PrivateSubnet2" + } + ] + } + }, + "VPCPrivateSubnet2RouteTableAssociation0C73D413": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + }, + "SubnetId": { + "Ref": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + } + }, + "VPCPrivateSubnet2DefaultRouteF4F5CFD2": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "VPCPublicSubnet2NATGateway3C070193" + } + } + }, + "VPCIGWB7E252D3": { + "Type": "AWS::EC2::InternetGateway", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-neptune-integ/VPC" + } + ] + } + }, + "VPCVPCGW99B986DC": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "VpcId": { + "Ref": "VPCB9E5F0B4" + }, + "InternetGatewayId": { + "Ref": "VPCIGWB7E252D3" + } + } + }, + "ParamsA8366201": { + "Type": "AWS::Neptune::DBClusterParameterGroup", + "Properties": { + "Description": "A nice parameter group", + "Family": "neptune1", + "Parameters": { + "neptune_enable_audit_log": "1", + "neptune_query_timeout": "100000" + } + } + }, + "DbSecurity381C2C15": { + "Type": "AWS::KMS::Key", + "Properties": { + "KeyPolicy": { + "Statement": [ + { + "Action": "kms:*", + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] + } + }, + "Resource": "*" + } + ], + "Version": "2012-10-17" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "DatabaseSubnets3C9252C9": { + "Type": "AWS::Neptune::DBSubnetGroup", + "Properties": { + "DBSubnetGroupDescription": "Subnets for Database database", + "SubnetIds": [ + { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + }, + { + "Ref": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + ] + } + }, + "DatabaseSecurityGroup5C91FDCB": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "Neptune security group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "DatabaseSecurityGroupfrom00000IndirectPortF24F2E03": { + "Type": "AWS::EC2::SecurityGroupIngress", + "Properties": { + "IpProtocol": "tcp", + "CidrIp": "0.0.0.0/0", + "Description": "Open to the world", + "FromPort": { + "Fn::GetAtt": [ + "DatabaseB269D8BB", + "Port" + ] + }, + "GroupId": { + "Fn::GetAtt": [ + "DatabaseSecurityGroup5C91FDCB", + "GroupId" + ] + }, + "ToPort": { + "Fn::GetAtt": [ + "DatabaseB269D8BB", + "Port" + ] + } + } + }, + "DatabaseB269D8BB": { + "Type": "AWS::Neptune::DBCluster", + "Properties": { + "DBClusterParameterGroupName": { + "Ref": "ParamsA8366201" + }, + "DBSubnetGroupName": { + "Ref": "DatabaseSubnets3C9252C9" + }, + "KmsKeyId": { + "Fn::GetAtt": [ + "DbSecurity381C2C15", + "Arn" + ] + }, + "StorageEncrypted": true, + "VpcSecurityGroupIds": [ + { + "Fn::GetAtt": [ + "DatabaseSecurityGroup5C91FDCB", + "GroupId" + ] + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "DatabaseInstance1844F58FD": { + "Type": "AWS::Neptune::DBInstance", + "Properties": { + "DBInstanceClass": "db.r5.large", + "DBClusterIdentifier": { + "Ref": "DatabaseB269D8BB" + } + }, + "DependsOn": [ + "VPCPrivateSubnet1DefaultRouteAE1D6490", + "VPCPrivateSubnet2DefaultRouteF4F5CFD2" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-neptune/test/integ.cluster.ts b/packages/@aws-cdk/aws-neptune/test/integ.cluster.ts new file mode 100644 index 0000000000000..b62c0d054a624 --- /dev/null +++ b/packages/@aws-cdk/aws-neptune/test/integ.cluster.ts @@ -0,0 +1,48 @@ +import * as ec2 from '@aws-cdk/aws-ec2'; +import * as kms from '@aws-cdk/aws-kms'; +import * as cdk from '@aws-cdk/core'; +import * as constructs from 'constructs'; +import { DatabaseCluster, InstanceType } from '../lib'; +import { ClusterParameterGroup } from '../lib/parameter-group'; + +/* + * Stack verification steps: + * * aws docdb describe-db-clusters --db-cluster-identifier + */ + +class TestStack extends cdk.Stack { + constructor(scope: constructs.Construct, id: string, props?: cdk.StackProps) { + super(scope, id, props); + + const vpc = new ec2.Vpc(this, 'VPC', { maxAzs: 2 }); + + const params = new ClusterParameterGroup(this, 'Params', { + description: 'A nice parameter group', + parameters: { + neptune_enable_audit_log: '1', + neptune_query_timeout: '100000', + }, + }); + + const kmsKey = new kms.Key(this, 'DbSecurity', { + removalPolicy: cdk.RemovalPolicy.DESTROY, + }); + + const cluster = new DatabaseCluster(this, 'Database', { + vpc, + vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE }, + instanceType: InstanceType.R5_LARGE, + clusterParameterGroup: params, + kmsKey, + removalPolicy: cdk.RemovalPolicy.DESTROY, + }); + + cluster.connections.allowDefaultPortFromAnyIpv4('Open to the world'); + } +} + +const app = new cdk.App(); + +new TestStack(app, 'aws-cdk-neptune-integ'); + +app.synth(); diff --git a/packages/@aws-cdk/aws-neptune/test/neptune.test.ts b/packages/@aws-cdk/aws-neptune/test/neptune.test.ts deleted file mode 100644 index e394ef336bfb4..0000000000000 --- a/packages/@aws-cdk/aws-neptune/test/neptune.test.ts +++ /dev/null @@ -1,6 +0,0 @@ -import '@aws-cdk/assert/jest'; -import {} from '../lib'; - -test('No tests are specified for this package', () => { - expect(true).toBe(true); -}); diff --git a/packages/@aws-cdk/aws-neptune/test/parameter-group.test.ts b/packages/@aws-cdk/aws-neptune/test/parameter-group.test.ts new file mode 100644 index 0000000000000..6ba6ff6562d76 --- /dev/null +++ b/packages/@aws-cdk/aws-neptune/test/parameter-group.test.ts @@ -0,0 +1,50 @@ +import { expect, haveResource } from '@aws-cdk/assert'; +import { Stack } from '@aws-cdk/core'; +import { ClusterParameterGroup, ParameterGroup } from '../lib'; + +describe('ClusterParameterGroup', () => { + + test('create a cluster parameter group', () => { + // GIVEN + const stack = new Stack(); + + // WHEN + new ClusterParameterGroup(stack, 'Params', { + description: 'desc', + parameters: { + key: 'value', + }, + }); + + // THEN + expect(stack).to(haveResource('AWS::Neptune::DBClusterParameterGroup', { + Description: 'desc', + Parameters: { + key: 'value', + }, + })); + + }); + + test('create a instance/db parameter group', () => { + // GIVEN + const stack = new Stack(); + + // WHEN + new ParameterGroup(stack, 'Params', { + description: 'desc', + parameters: { + key: 'value', + }, + }); + + // THEN + expect(stack).to(haveResource('AWS::Neptune::DBClusterParameterGroup', { + Description: 'desc', + Parameters: { + key: 'value', + }, + })); + + }); +}); diff --git a/packages/@aws-cdk/aws-neptune/test/subnet-group.test.ts b/packages/@aws-cdk/aws-neptune/test/subnet-group.test.ts new file mode 100644 index 0000000000000..e6c75013716c8 --- /dev/null +++ b/packages/@aws-cdk/aws-neptune/test/subnet-group.test.ts @@ -0,0 +1,83 @@ +import '@aws-cdk/assert/jest'; +import * as ec2 from '@aws-cdk/aws-ec2'; +import { Stack } from '@aws-cdk/core'; +import { SubnetGroup } from '../lib'; + +let stack: Stack; +let vpc: ec2.IVpc; + +beforeEach(() => { + stack = new Stack(); + vpc = new ec2.Vpc(stack, 'VPC'); +}); + +test('creates a subnet group from minimal properties', () => { + new SubnetGroup(stack, 'Group', { + description: 'MyGroup', + vpc, + }); + + expect(stack).toHaveResource('AWS::Neptune::DBSubnetGroup', { + DBSubnetGroupDescription: 'MyGroup', + SubnetIds: [ + { Ref: 'VPCPrivateSubnet1Subnet8BCA10E0' }, + { Ref: 'VPCPrivateSubnet2SubnetCFCDAA7A' }, + ], + }); +}); + +test('creates a subnet group from all properties', () => { + new SubnetGroup(stack, 'Group', { + description: 'My Shared Group', + subnetGroupName: 'SharedGroup', + vpc, + vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE }, + }); + + expect(stack).toHaveResource('AWS::Neptune::DBSubnetGroup', { + DBSubnetGroupDescription: 'My Shared Group', + DBSubnetGroupName: 'SharedGroup', + SubnetIds: [ + { Ref: 'VPCPrivateSubnet1Subnet8BCA10E0' }, + { Ref: 'VPCPrivateSubnet2SubnetCFCDAA7A' }, + ], + }); +}); + +describe('subnet selection', () => { + test('defaults to private subnets', () => { + new SubnetGroup(stack, 'Group', { + description: 'MyGroup', + vpc, + }); + + expect(stack).toHaveResource('AWS::Neptune::DBSubnetGroup', { + DBSubnetGroupDescription: 'MyGroup', + SubnetIds: [ + { Ref: 'VPCPrivateSubnet1Subnet8BCA10E0' }, + { Ref: 'VPCPrivateSubnet2SubnetCFCDAA7A' }, + ], + }); + }); + + test('can specify subnet type', () => { + new SubnetGroup(stack, 'Group', { + description: 'MyGroup', + vpc, + vpcSubnets: { subnetType: ec2.SubnetType.PUBLIC }, + }); + + expect(stack).toHaveResource('AWS::Neptune::DBSubnetGroup', { + DBSubnetGroupDescription: 'MyGroup', + SubnetIds: [ + { Ref: 'VPCPublicSubnet1SubnetB4246D30' }, + { Ref: 'VPCPublicSubnet2Subnet74179F39' }, + ], + }); + }); +}); + +test('import group by name', () => { + const subnetGroup = SubnetGroup.fromSubnetGroupName(stack, 'Group', 'my-subnet-group'); + expect(subnetGroup.subnetGroupName).toBe('my-subnet-group'); +}); From 1f3535145d22b2b13ebbcbfe31a3bfd73519352d Mon Sep 17 00:00:00 2001 From: Nick Lynch Date: Mon, 1 Mar 2021 17:44:01 +0000 Subject: [PATCH 55/78] fix(cloudfront): cannot add two EdgeFunctions with same aliases (#13324) Attempting to add two EdgeFunctions to the same stack, and then giving both the same alias (e.g., 'prod', 'live') results in an ID conflict. This is because the aliases are being added to the scope of the shared EdgeFunction stack, rather than the scope of the Function itself. Note - Also took the opportunity to simplify one of the integ tests to deploy to a single distribution. fixes #13237 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../lib/experimental/edge-function.ts | 12 ++-- .../test/experimental/edge-function.test.ts | 11 +++ ...ribution-lambda-cross-region.expected.json | 69 ++++++++++--------- .../integ.distribution-lambda-cross-region.ts | 28 ++++---- 4 files changed, 64 insertions(+), 56 deletions(-) diff --git a/packages/@aws-cdk/aws-cloudfront/lib/experimental/edge-function.ts b/packages/@aws-cdk/aws-cloudfront/lib/experimental/edge-function.ts index 33b0e070d144e..69913aa07a2a1 100644 --- a/packages/@aws-cdk/aws-cloudfront/lib/experimental/edge-function.ts +++ b/packages/@aws-cdk/aws-cloudfront/lib/experimental/edge-function.ts @@ -51,8 +51,6 @@ export class EdgeFunction extends Resource implements lambda.IVersion { public readonly role?: iam.IRole; public readonly version: string; - // functionStack needed for `addAlias`. - private readonly functionStack: Stack; private readonly _edgeFunction: lambda.Function; constructor(scope: Construct, id: string, props: EdgeFunctionProps) { @@ -60,11 +58,10 @@ export class EdgeFunction extends Resource implements lambda.IVersion { // Create a simple Function if we're already in us-east-1; otherwise create a cross-region stack. const regionIsUsEast1 = !Token.isUnresolved(this.stack.region) && this.stack.region === 'us-east-1'; - const { functionStack, edgeFunction, edgeArn } = regionIsUsEast1 + const { edgeFunction, edgeArn } = regionIsUsEast1 ? this.createInRegionFunction(props) : this.createCrossRegionFunction(id, props); - this.functionStack = functionStack; this.edgeArn = edgeArn; this.functionArn = edgeArn; @@ -89,7 +86,7 @@ export class EdgeFunction extends Resource implements lambda.IVersion { } public addAlias(aliasName: string, options: lambda.AliasOptions = {}): lambda.Alias { - return new lambda.Alias(this.functionStack, `Alias${aliasName}`, { + return new lambda.Alias(this._edgeFunction, `Alias${aliasName}`, { aliasName, version: this._edgeFunction.currentVersion, ...options, @@ -146,7 +143,7 @@ export class EdgeFunction extends Resource implements lambda.IVersion { const edgeFunction = new lambda.Function(this, 'Fn', props); addEdgeLambdaToRoleTrustStatement(edgeFunction.role!); - return { edgeFunction, edgeArn: edgeFunction.currentVersion.edgeArn, functionStack: this.stack }; + return { edgeFunction, edgeArn: edgeFunction.currentVersion.edgeArn }; } /** Create a support stack and function in us-east-1, and a SSM reader in-region */ @@ -166,7 +163,7 @@ export class EdgeFunction extends Resource implements lambda.IVersion { const edgeArn = this.createCrossRegionArnReader(parameterNamePrefix, parameterName, edgeFunction); - return { edgeFunction, edgeArn, functionStack }; + return { edgeFunction, edgeArn }; } private createCrossRegionArnReader(parameterNamePrefix: string, parameterName: string, edgeFunction: lambda.Function): string { @@ -233,7 +230,6 @@ export class EdgeFunction extends Resource implements lambda.IVersion { interface FunctionConfig { readonly edgeFunction: lambda.Function; readonly edgeArn: string; - readonly functionStack: Stack; } function addEdgeLambdaToRoleTrustStatement(role: iam.IRole) { diff --git a/packages/@aws-cdk/aws-cloudfront/test/experimental/edge-function.test.ts b/packages/@aws-cdk/aws-cloudfront/test/experimental/edge-function.test.ts index 7a743056dfcb7..55b0c2f4aeaac 100644 --- a/packages/@aws-cdk/aws-cloudfront/test/experimental/edge-function.test.ts +++ b/packages/@aws-cdk/aws-cloudfront/test/experimental/edge-function.test.ts @@ -217,6 +217,17 @@ test('addAlias() creates alias in function stack', () => { }); }); +test('mutliple aliases with the same name can be added to the same stack', () => { + const fn1 = new cloudfront.experimental.EdgeFunction(stack, 'MyFn1', defaultEdgeFunctionProps()); + const fn2 = new cloudfront.experimental.EdgeFunction(stack, 'MyFn2', defaultEdgeFunctionProps()); + fn1.addAlias('live'); + fn2.addAlias('live'); + + const fnStack = getFnStack(); + expect(fnStack).toCountResources('AWS::Lambda::Function', 2); + expect(fnStack).toCountResources('AWS::Lambda::Alias', 2); +}); + test('addPermission() creates permissions in function stack', () => { const fn = new cloudfront.experimental.EdgeFunction(stack, 'MyFn', defaultEdgeFunctionProps()); diff --git a/packages/@aws-cdk/aws-cloudfront/test/integ.distribution-lambda-cross-region.expected.json b/packages/@aws-cdk/aws-cloudfront/test/integ.distribution-lambda-cross-region.expected.json index 412498ec96a3f..c251765b20980 100644 --- a/packages/@aws-cdk/aws-cloudfront/test/integ.distribution-lambda-cross-region.expected.json +++ b/packages/@aws-cdk/aws-cloudfront/test/integ.distribution-lambda-cross-region.expected.json @@ -159,36 +159,9 @@ "FunctionArn" ] } - } - ], - "TargetOriginId": "integdistributionlambdacrossregionDistOrigin167A054D5", - "ViewerProtocolPolicy": "allow-all" - }, - "Enabled": true, - "HttpVersion": "http2", - "IPV6Enabled": true, - "Origins": [ - { - "CustomOriginConfig": { - "OriginProtocolPolicy": "https-only" }, - "DomainName": "www.example.com", - "Id": "integdistributionlambdacrossregionDistOrigin167A054D5" - } - ] - } - } - }, - "Dist286EC08DF": { - "Type": "AWS::CloudFront::Distribution", - "Properties": { - "DistributionConfig": { - "DefaultCacheBehavior": { - "CachePolicyId": "4135ea2d-6df8-44a3-9df3-4b5a84be39ad", - "Compress": true, - "LambdaFunctionAssociations": [ { - "EventType": "origin-request", + "EventType": "origin-response", "LambdaFunctionARN": { "Fn::GetAtt": [ "Lambda2ArnReader5ACFBE1F", @@ -197,7 +170,7 @@ } } ], - "TargetOriginId": "integdistributionlambdacrossregionDist2Origin14F08376D", + "TargetOriginId": "integdistributionlambdacrossregionDistOrigin167A054D5", "ViewerProtocolPolicy": "allow-all" }, "Enabled": true, @@ -208,8 +181,8 @@ "CustomOriginConfig": { "OriginProtocolPolicy": "https-only" }, - "DomainName": "www.example2.com", - "Id": "integdistributionlambdacrossregionDist2Origin14F08376D" + "DomainName": "www.example.com", + "Id": "integdistributionlambdacrossregionDistOrigin167A054D5" } ] } @@ -277,13 +250,13 @@ "Code": { "ZipFile": "foo" }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "LambdaServiceRoleA8ED4D3B", "Arn" ] }, + "Handler": "index.handler", "Runtime": "nodejs10.x" }, "DependsOn": [ @@ -307,6 +280,21 @@ }, "Name": "EdgeFunctionArnLambda" } + }, + "LambdaAliaslive79C8A712": { + "Type": "AWS::Lambda::Alias", + "Properties": { + "FunctionName": { + "Ref": "LambdaD247545B" + }, + "FunctionVersion": { + "Fn::GetAtt": [ + "LambdaCurrentVersionDF706F6A97fb843e9bd06fcd2bb15eeace80e13e", + "Version" + ] + }, + "Name": "live" + } } } }, @@ -356,13 +344,13 @@ "Code": { "ZipFile": "foo" }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "Lambda2ServiceRole31A072E1", "Arn" ] }, + "Handler": "index.handler", "Runtime": "nodejs10.x" }, "DependsOn": [ @@ -386,6 +374,21 @@ }, "Name": "EdgeFunctionArnLambda2" } + }, + "Lambda2Aliaslive77F6085F": { + "Type": "AWS::Lambda::Alias", + "Properties": { + "FunctionName": { + "Ref": "Lambda217CFB423" + }, + "FunctionVersion": { + "Fn::GetAtt": [ + "Lambda2CurrentVersion72012B74b9eef8becb98501bc795baca3c6169c4", + "Version" + ] + }, + "Name": "live" + } } } } diff --git a/packages/@aws-cdk/aws-cloudfront/test/integ.distribution-lambda-cross-region.ts b/packages/@aws-cdk/aws-cloudfront/test/integ.distribution-lambda-cross-region.ts index df2c26aecfd26..b1aed3d79da21 100644 --- a/packages/@aws-cdk/aws-cloudfront/test/integ.distribution-lambda-cross-region.ts +++ b/packages/@aws-cdk/aws-cloudfront/test/integ.distribution-lambda-cross-region.ts @@ -22,25 +22,23 @@ const lambdaFunction2 = new cloudfront.experimental.EdgeFunction(stack, 'Lambda2 stackId: `edge-lambda-stack-${region}-2`, }); +lambdaFunction.addAlias('live'); +lambdaFunction2.addAlias('live'); + new cloudfront.Distribution(stack, 'Dist', { defaultBehavior: { origin: new TestOrigin('www.example.com'), cachePolicy: cloudfront.CachePolicy.CACHING_DISABLED, - edgeLambdas: [{ - functionVersion: lambdaFunction.currentVersion, - eventType: cloudfront.LambdaEdgeEventType.ORIGIN_REQUEST, - }], - }, -}); - -new cloudfront.Distribution(stack, 'Dist2', { - defaultBehavior: { - origin: new TestOrigin('www.example2.com'), - cachePolicy: cloudfront.CachePolicy.CACHING_DISABLED, - edgeLambdas: [{ - functionVersion: lambdaFunction2.currentVersion, - eventType: cloudfront.LambdaEdgeEventType.ORIGIN_REQUEST, - }], + edgeLambdas: [ + { + functionVersion: lambdaFunction.currentVersion, + eventType: cloudfront.LambdaEdgeEventType.ORIGIN_REQUEST, + }, + { + functionVersion: lambdaFunction2.currentVersion, + eventType: cloudfront.LambdaEdgeEventType.ORIGIN_RESPONSE, + }, + ], }, }); From 2d0c7667c1d8d565d25d91084a3dacf74f43e988 Mon Sep 17 00:00:00 2001 From: AWS CDK Automation <43080478+aws-cdk-automation@users.noreply.github.com> Date: Tue, 2 Mar 2021 10:14:33 +0200 Subject: [PATCH 56/78] chore: npm-check-updates && yarn upgrade (#13254) Ran npm-check-updates and yarn upgrade to keep the `yarn.lock` file up-to-date. --- package.json | 6 +- packages/@aws-cdk/assert/package.json | 2 +- .../package.json | 6 +- .../aws-global-table-coordinator/package.json | 4 +- packages/@aws-cdk/aws-dynamodb/package.json | 2 +- .../@aws-cdk/aws-lambda-nodejs/package.json | 2 +- packages/@aws-cdk/aws-logs/package.json | 2 +- packages/@aws-cdk/aws-sam/package.json | 2 +- .../@aws-cdk/cloudformation-diff/package.json | 4 +- .../cloudformation-include/package.json | 2 +- .../@aws-cdk/custom-resources/package.json | 2 +- .../@monocdk-experiment/assert/package.json | 2 +- packages/aws-cdk/package.json | 6 +- packages/awslint/package.json | 4 +- packages/cdk-dasm/package.json | 2 +- packages/decdk/package.json | 4 +- tools/cdk-build-tools/package.json | 14 +- tools/cfn2ts/package.json | 2 +- tools/eslint-plugin-cdk/package.json | 4 +- yarn.lock | 642 ++++++++++-------- 20 files changed, 397 insertions(+), 317 deletions(-) diff --git a/package.json b/package.json index a986d658240f5..84eeb77a0016c 100644 --- a/package.json +++ b/package.json @@ -18,9 +18,9 @@ "fs-extra": "^9.1.0", "graceful-fs": "^4.2.6", "jest-junit": "^12.0.0", - "jsii-diff": "^1.21.0", - "jsii-pacmak": "^1.21.0", - "jsii-rosetta": "^1.21.0", + "jsii-diff": "^1.23.0", + "jsii-pacmak": "^1.23.0", + "jsii-rosetta": "^1.23.0", "lerna": "^3.22.1", "standard-version": "^9.1.1", "typescript": "~3.9.9" diff --git a/packages/@aws-cdk/assert/package.json b/packages/@aws-cdk/assert/package.json index 1416fd7f4673c..17a2d01fae5c9 100644 --- a/packages/@aws-cdk/assert/package.json +++ b/packages/@aws-cdk/assert/package.json @@ -25,7 +25,7 @@ "cdk-build-tools": "0.0.0", "jest": "^26.6.3", "pkglint": "0.0.0", - "ts-jest": "^26.5.1" + "ts-jest": "^26.5.2" }, "dependencies": { "@aws-cdk/cloud-assembly-schema": "0.0.0", diff --git a/packages/@aws-cdk/aws-certificatemanager/lambda-packages/dns_validated_certificate_handler/package.json b/packages/@aws-cdk/aws-certificatemanager/lambda-packages/dns_validated_certificate_handler/package.json index 1e220d75e96a9..d0f82b65a940e 100644 --- a/packages/@aws-cdk/aws-certificatemanager/lambda-packages/dns_validated_certificate_handler/package.json +++ b/packages/@aws-cdk/aws-certificatemanager/lambda-packages/dns_validated_certificate_handler/package.json @@ -29,7 +29,7 @@ "devDependencies": { "aws-sdk": "^2.596.0", "aws-sdk-mock": "^5.1.0", - "eslint": "^7.20.0", + "eslint": "^7.21.0", "eslint-config-standard": "^14.1.1", "eslint-plugin-import": "^2.22.1", "eslint-plugin-node": "^11.1.0", @@ -37,7 +37,7 @@ "eslint-plugin-standard": "^4.1.0", "jest": "^26.6.3", "lambda-tester": "^3.6.0", - "nock": "^13.0.7", - "ts-jest": "^26.5.1" + "nock": "^13.0.9", + "ts-jest": "^26.5.2" } } diff --git a/packages/@aws-cdk/aws-dynamodb-global/lambda-packages/aws-global-table-coordinator/package.json b/packages/@aws-cdk/aws-dynamodb-global/lambda-packages/aws-global-table-coordinator/package.json index 8d1e45ac66b83..001e9b369ea83 100644 --- a/packages/@aws-cdk/aws-dynamodb-global/lambda-packages/aws-global-table-coordinator/package.json +++ b/packages/@aws-cdk/aws-dynamodb-global/lambda-packages/aws-global-table-coordinator/package.json @@ -29,7 +29,7 @@ "devDependencies": { "aws-sdk": "^2.596.0", "aws-sdk-mock": "^5.1.0", - "eslint": "^7.20.0", + "eslint": "^7.21.0", "eslint-config-standard": "^14.1.1", "eslint-plugin-import": "^2.22.1", "eslint-plugin-node": "^11.1.0", @@ -37,6 +37,6 @@ "eslint-plugin-standard": "^4.1.0", "jest": "^26.6.3", "lambda-tester": "^3.6.0", - "nock": "^13.0.7" + "nock": "^13.0.9" } } diff --git a/packages/@aws-cdk/aws-dynamodb/package.json b/packages/@aws-cdk/aws-dynamodb/package.json index 6ca3616c33ac8..5737a58a67816 100644 --- a/packages/@aws-cdk/aws-dynamodb/package.json +++ b/packages/@aws-cdk/aws-dynamodb/package.json @@ -81,7 +81,7 @@ "jest": "^26.6.3", "pkglint": "0.0.0", "sinon": "^9.2.4", - "ts-jest": "^26.5.1" + "ts-jest": "^26.5.2" }, "dependencies": { "@aws-cdk/aws-applicationautoscaling": "0.0.0", diff --git a/packages/@aws-cdk/aws-lambda-nodejs/package.json b/packages/@aws-cdk/aws-lambda-nodejs/package.json index c2e2f658febac..7ae4a7822c113 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/package.json +++ b/packages/@aws-cdk/aws-lambda-nodejs/package.json @@ -67,7 +67,7 @@ "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "delay": "5.0.0", - "esbuild": "^0.8.50", + "esbuild": "^0.8.54", "pkglint": "0.0.0" }, "dependencies": { diff --git a/packages/@aws-cdk/aws-logs/package.json b/packages/@aws-cdk/aws-logs/package.json index f5a004e27bb1f..c1b3eef36c73b 100644 --- a/packages/@aws-cdk/aws-logs/package.json +++ b/packages/@aws-cdk/aws-logs/package.json @@ -77,7 +77,7 @@ "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "cfn2ts": "0.0.0", - "nock": "^13.0.7", + "nock": "^13.0.9", "nodeunit": "^0.11.3", "pkglint": "0.0.0", "sinon": "^9.2.4" diff --git a/packages/@aws-cdk/aws-sam/package.json b/packages/@aws-cdk/aws-sam/package.json index 6e76bd0098faf..6643799114182 100644 --- a/packages/@aws-cdk/aws-sam/package.json +++ b/packages/@aws-cdk/aws-sam/package.json @@ -78,7 +78,7 @@ "cfn2ts": "0.0.0", "jest": "^26.6.3", "pkglint": "0.0.0", - "ts-jest": "^26.5.1" + "ts-jest": "^26.5.2" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/cloudformation-diff/package.json b/packages/@aws-cdk/cloudformation-diff/package.json index 2a1705ab876fd..d717c69b9db96 100644 --- a/packages/@aws-cdk/cloudformation-diff/package.json +++ b/packages/@aws-cdk/cloudformation-diff/package.json @@ -25,7 +25,7 @@ "colors": "^1.4.0", "diff": "^5.0.0", "fast-deep-equal": "^3.1.3", - "string-width": "^4.2.0", + "string-width": "^4.2.2", "table": "^6.0.7" }, "devDependencies": { @@ -36,7 +36,7 @@ "fast-check": "^2.13.0", "jest": "^26.6.3", "pkglint": "0.0.0", - "ts-jest": "^26.5.1" + "ts-jest": "^26.5.2" }, "repository": { "url": "https://github.com/aws/aws-cdk.git", diff --git a/packages/@aws-cdk/cloudformation-include/package.json b/packages/@aws-cdk/cloudformation-include/package.json index 457f11834e88a..ce9716626baee 100644 --- a/packages/@aws-cdk/cloudformation-include/package.json +++ b/packages/@aws-cdk/cloudformation-include/package.json @@ -367,7 +367,7 @@ "cdk-integ-tools": "0.0.0", "jest": "^26.6.3", "pkglint": "0.0.0", - "ts-jest": "^26.5.1" + "ts-jest": "^26.5.2" }, "keywords": [ "aws", diff --git a/packages/@aws-cdk/custom-resources/package.json b/packages/@aws-cdk/custom-resources/package.json index aed86e63bdb0f..0044f79eda383 100644 --- a/packages/@aws-cdk/custom-resources/package.json +++ b/packages/@aws-cdk/custom-resources/package.json @@ -84,7 +84,7 @@ "cdk-integ-tools": "0.0.0", "cfn2ts": "0.0.0", "fs-extra": "^9.1.0", - "nock": "^13.0.7", + "nock": "^13.0.9", "pkglint": "0.0.0", "sinon": "^9.2.4" }, diff --git a/packages/@monocdk-experiment/assert/package.json b/packages/@monocdk-experiment/assert/package.json index dbd0d792e8a60..a4d825852a613 100644 --- a/packages/@monocdk-experiment/assert/package.json +++ b/packages/@monocdk-experiment/assert/package.json @@ -41,7 +41,7 @@ "jest": "^26.6.3", "monocdk": "0.0.0", "pkglint": "0.0.0", - "ts-jest": "^26.5.1" + "ts-jest": "^26.5.2" }, "dependencies": { "@aws-cdk/cloudformation-diff": "0.0.0" diff --git a/packages/aws-cdk/package.json b/packages/aws-cdk/package.json index a3f34cdacf9d4..785087c8fb196 100644 --- a/packages/aws-cdk/package.json +++ b/packages/aws-cdk/package.json @@ -39,7 +39,7 @@ "license": "Apache-2.0", "devDependencies": { "@aws-cdk/core": "0.0.0", - "@octokit/rest": "^18.2.0", + "@octokit/rest": "^18.3.1", "@types/archiver": "^5.1.0", "@types/fs-extra": "^8.1.1", "@types/glob": "^7.1.3", @@ -59,10 +59,10 @@ "jest": "^26.6.3", "make-runnable": "^1.3.8", "mockery": "^2.1.0", - "nock": "^13.0.7", + "nock": "^13.0.9", "pkglint": "0.0.0", "sinon": "^9.2.4", - "ts-jest": "^26.5.1", + "ts-jest": "^26.5.2", "ts-mock-imports": "^1.3.3", "xml-js": "^1.6.11" }, diff --git a/packages/awslint/package.json b/packages/awslint/package.json index f0a74898f0148..3a5e17066742b 100644 --- a/packages/awslint/package.json +++ b/packages/awslint/package.json @@ -16,11 +16,11 @@ "awslint": "bin/awslint" }, "dependencies": { - "@jsii/spec": "^1.21.0", + "@jsii/spec": "^1.23.0", "camelcase": "^6.2.0", "colors": "^1.4.0", "fs-extra": "^9.1.0", - "jsii-reflect": "^1.21.0", + "jsii-reflect": "^1.23.0", "yargs": "^16.2.0" }, "devDependencies": { diff --git a/packages/cdk-dasm/package.json b/packages/cdk-dasm/package.json index 917a0b25715aa..a60843d4454b7 100644 --- a/packages/cdk-dasm/package.json +++ b/packages/cdk-dasm/package.json @@ -26,7 +26,7 @@ }, "license": "Apache-2.0", "dependencies": { - "codemaker": "^1.21.0", + "codemaker": "^1.23.0", "yaml": "1.10.0" }, "devDependencies": { diff --git a/packages/decdk/package.json b/packages/decdk/package.json index ec918d8d77feb..2fa2feeaabae7 100644 --- a/packages/decdk/package.json +++ b/packages/decdk/package.json @@ -210,7 +210,7 @@ "@aws-cdk/yaml-cfn": "0.0.0", "constructs": "^3.2.0", "fs-extra": "^9.1.0", - "jsii-reflect": "^1.21.0", + "jsii-reflect": "^1.23.0", "jsonschema": "^1.4.0", "yaml": "1.10.0", "yargs": "^16.2.0" @@ -221,7 +221,7 @@ "@types/yaml": "1.9.7", "@types/yargs": "^15.0.13", "jest": "^26.6.3", - "jsii": "^1.21.0" + "jsii": "^1.23.0" }, "keywords": [ "aws", diff --git a/tools/cdk-build-tools/package.json b/tools/cdk-build-tools/package.json index 8b2a6236620e9..c9bd2823410f3 100644 --- a/tools/cdk-build-tools/package.json +++ b/tools/cdk-build-tools/package.json @@ -39,11 +39,11 @@ "pkglint": "0.0.0" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "^4.15.1", - "@typescript-eslint/parser": "^4.15.1", + "@typescript-eslint/eslint-plugin": "^4.16.1", + "@typescript-eslint/parser": "^4.16.1", "awslint": "0.0.0", "colors": "^1.4.0", - "eslint": "^7.20.0", + "eslint": "^7.21.0", "eslint-import-resolver-node": "^0.3.4", "eslint-import-resolver-typescript": "^2.4.0", "eslint-plugin-cdk": "0.0.0", @@ -51,13 +51,13 @@ "eslint-plugin-jest": "^24.1.5", "fs-extra": "^9.1.0", "jest": "^26.6.3", - "jsii": "^1.21.0", - "jsii-pacmak": "^1.21.0", - "markdownlint-cli": "^0.26.0", + "jsii": "^1.23.0", + "jsii-pacmak": "^1.23.0", + "markdownlint-cli": "^0.27.0", "nodeunit": "^0.11.3", "nyc": "^15.1.0", "semver": "^7.3.4", - "ts-jest": "^26.5.1", + "ts-jest": "^26.5.2", "typescript": "~3.9.9", "yargs": "^16.2.0", "yarn-cling": "0.0.0" diff --git a/tools/cfn2ts/package.json b/tools/cfn2ts/package.json index 7a62104df3ea9..bcee4f73d7020 100644 --- a/tools/cfn2ts/package.json +++ b/tools/cfn2ts/package.json @@ -30,7 +30,7 @@ "license": "Apache-2.0", "dependencies": { "@aws-cdk/cfnspec": "0.0.0", - "codemaker": "^1.21.0", + "codemaker": "^1.23.0", "fast-json-patch": "^3.0.0-1", "fs-extra": "^9.1.0", "yargs": "^16.2.0" diff --git a/tools/eslint-plugin-cdk/package.json b/tools/eslint-plugin-cdk/package.json index 2c412f30e739e..f21cb470ca5f5 100644 --- a/tools/eslint-plugin-cdk/package.json +++ b/tools/eslint-plugin-cdk/package.json @@ -21,8 +21,8 @@ "typescript": "~3.9.9" }, "dependencies": { - "@typescript-eslint/parser": "^4.15.1", - "eslint": "^7.20.0", + "@typescript-eslint/parser": "^4.16.1", + "eslint": "^7.21.0", "fs-extra": "^9.1.0" }, "jest": { diff --git a/yarn.lock b/yarn.lock index 0044085ed9ce5..a882be99918c4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16,36 +16,52 @@ dependencies: "@babel/highlight" "^7.12.13" +"@babel/compat-data@^7.13.8": + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.13.8.tgz#5b783b9808f15cef71547f1b691f34f8ff6003a6" + integrity sha512-EaI33z19T4qN3xLXsGf48M2cDqa6ei9tPZlfLdb2HC+e/cFtREiRd8hdSqDbwdLB0/+gLwqJmCYASH0z2bUdog== + "@babel/core@^7.1.0", "@babel/core@^7.7.5": - version "7.12.17" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.12.17.tgz#993c5e893333107a2815d8e0d73a2c3755e280b2" - integrity sha512-V3CuX1aBywbJvV2yzJScRxeiiw0v2KZZYYE3giywxzFJL13RiyPjaaDwhDnxmgFTTS7FgvM2ijr4QmKNIu0AtQ== + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.13.8.tgz#c191d9c5871788a591d69ea1dc03e5843a3680fb" + integrity sha512-oYapIySGw1zGhEFRd6lzWNLWFX2s5dA/jm+Pw/+59ZdXtjyIuwlXbrId22Md0rgZVop+aVoqow2riXhBLNyuQg== dependencies: "@babel/code-frame" "^7.12.13" - "@babel/generator" "^7.12.17" - "@babel/helper-module-transforms" "^7.12.17" - "@babel/helpers" "^7.12.17" - "@babel/parser" "^7.12.17" + "@babel/generator" "^7.13.0" + "@babel/helper-compilation-targets" "^7.13.8" + "@babel/helper-module-transforms" "^7.13.0" + "@babel/helpers" "^7.13.0" + "@babel/parser" "^7.13.4" "@babel/template" "^7.12.13" - "@babel/traverse" "^7.12.17" - "@babel/types" "^7.12.17" + "@babel/traverse" "^7.13.0" + "@babel/types" "^7.13.0" convert-source-map "^1.7.0" debug "^4.1.0" - gensync "^1.0.0-beta.1" + gensync "^1.0.0-beta.2" json5 "^2.1.2" lodash "^4.17.19" - semver "^5.4.1" + semver "^6.3.0" source-map "^0.5.0" -"@babel/generator@^7.12.17", "@babel/generator@^7.4.0": - version "7.12.17" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.12.17.tgz#9ef1dd792d778b32284411df63f4f668a9957287" - integrity sha512-DSA7ruZrY4WI8VxuS1jWSRezFnghEoYEFrZcw9BizQRmOZiUsiHl59+qEARGPqPikwA/GPTyRCi7isuCK/oyqg== +"@babel/generator@^7.13.0", "@babel/generator@^7.4.0": + version "7.13.9" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.13.9.tgz#3a7aa96f9efb8e2be42d38d80e2ceb4c64d8de39" + integrity sha512-mHOOmY0Axl/JCTkxTU6Lf5sWOg/v8nUa+Xkt4zMTftX0wqmb6Sh7J8gvcehBw7q0AhrhAR+FDacKjCZ2X8K+Sw== dependencies: - "@babel/types" "^7.12.17" + "@babel/types" "^7.13.0" jsesc "^2.5.1" source-map "^0.5.0" +"@babel/helper-compilation-targets@^7.13.8": + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.8.tgz#02bdb22783439afb11b2f009814bdd88384bd468" + integrity sha512-pBljUGC1y3xKLn1nrx2eAhurLMA8OqBtBP/JwG4U8skN7kf8/aqwwxpV1N6T0e7r6+7uNitIa/fUxPFagSXp3A== + dependencies: + "@babel/compat-data" "^7.13.8" + "@babel/helper-validator-option" "^7.12.17" + browserslist "^4.14.5" + semver "^6.3.0" + "@babel/helper-function-name@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz#93ad656db3c3c2232559fd7b2c3dbdcbe0eb377a" @@ -62,12 +78,12 @@ dependencies: "@babel/types" "^7.12.13" -"@babel/helper-member-expression-to-functions@^7.12.13": - version "7.12.17" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.17.tgz#f82838eb06e1235307b6d71457b6670ff71ee5ac" - integrity sha512-Bzv4p3ODgS/qpBE0DiJ9qf5WxSmrQ8gVTe8ClMfwwsY2x/rhykxxy3bXzG7AGTnPB2ij37zGJ/Q/6FruxHxsxg== +"@babel/helper-member-expression-to-functions@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.0.tgz#6aa4bb678e0f8c22f58cdb79451d30494461b091" + integrity sha512-yvRf8Ivk62JwisqV1rFRMxiSMDGnN6KH1/mDMmIrij4jztpQNRoHqqMG3U6apYbGRPJpgPalhva9Yd06HlUxJQ== dependencies: - "@babel/types" "^7.12.17" + "@babel/types" "^7.13.0" "@babel/helper-module-imports@^7.12.13": version "7.12.13" @@ -76,19 +92,19 @@ dependencies: "@babel/types" "^7.12.13" -"@babel/helper-module-transforms@^7.12.17": - version "7.12.17" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.12.17.tgz#7c75b987d6dfd5b48e575648f81eaac891539509" - integrity sha512-sFL+p6zOCQMm9vilo06M4VHuTxUAwa6IxgL56Tq1DVtA0ziAGTH1ThmJq7xwPqdQlgAbKX3fb0oZNbtRIyA5KQ== +"@babel/helper-module-transforms@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.13.0.tgz#42eb4bd8eea68bab46751212c357bfed8b40f6f1" + integrity sha512-Ls8/VBwH577+pw7Ku1QkUWIyRRNHpYlts7+qSqBBFCW3I8QteB9DxfcZ5YJpOwH6Ihe/wn8ch7fMGOP1OhEIvw== dependencies: "@babel/helper-module-imports" "^7.12.13" - "@babel/helper-replace-supers" "^7.12.13" + "@babel/helper-replace-supers" "^7.13.0" "@babel/helper-simple-access" "^7.12.13" "@babel/helper-split-export-declaration" "^7.12.13" "@babel/helper-validator-identifier" "^7.12.11" "@babel/template" "^7.12.13" - "@babel/traverse" "^7.12.17" - "@babel/types" "^7.12.17" + "@babel/traverse" "^7.13.0" + "@babel/types" "^7.13.0" lodash "^4.17.19" "@babel/helper-optimise-call-expression@^7.12.13": @@ -99,19 +115,19 @@ "@babel/types" "^7.12.13" "@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.8.0": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.12.13.tgz#174254d0f2424d8aefb4dd48057511247b0a9eeb" - integrity sha512-C+10MXCXJLiR6IeG9+Wiejt9jmtFpxUc3MQqCmPY8hfCjyUGl9kT+B2okzEZrtykiwrc4dbCPdDoz0A/HQbDaA== + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz#806526ce125aed03373bc416a828321e3a6a33af" + integrity sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ== -"@babel/helper-replace-supers@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.12.13.tgz#00ec4fb6862546bd3d0aff9aac56074277173121" - integrity sha512-pctAOIAMVStI2TMLhozPKbf5yTEXc0OJa0eENheb4w09SrgOWEs+P4nTOZYJQCqs8JlErGLDPDJTiGIp3ygbLg== +"@babel/helper-replace-supers@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.13.0.tgz#6034b7b51943094cb41627848cb219cb02be1d24" + integrity sha512-Segd5me1+Pz+rmN/NFBOplMbZG3SqRJOBlY+mA0SxAv6rjj7zJqr1AVr3SfzUVTLCv7ZLU5FycOM/SBGuLPbZw== dependencies: - "@babel/helper-member-expression-to-functions" "^7.12.13" + "@babel/helper-member-expression-to-functions" "^7.13.0" "@babel/helper-optimise-call-expression" "^7.12.13" - "@babel/traverse" "^7.12.13" - "@babel/types" "^7.12.13" + "@babel/traverse" "^7.13.0" + "@babel/types" "^7.13.0" "@babel/helper-simple-access@^7.12.13": version "7.12.13" @@ -132,28 +148,33 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz#c9a1f021917dcb5ccf0d4e453e399022981fc9ed" integrity sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw== -"@babel/helpers@^7.12.17": +"@babel/helper-validator-option@^7.12.17": version "7.12.17" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.12.17.tgz#71e03d2981a6b5ee16899964f4101dc8471d60bc" - integrity sha512-tEpjqSBGt/SFEsFikKds1sLNChKKGGR17flIgQKXH4fG6m9gTgl3gnOC1giHNyaBCSKuTfxaSzHi7UnvqiVKxg== + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.12.17.tgz#d1fbf012e1a79b7eebbfdc6d270baaf8d9eb9831" + integrity sha512-TopkMDmLzq8ngChwRlyjR6raKD6gMSae4JdYDB8bByKreQgG0RBTuKe9LRxW3wFtUnjxOPRKBDwEH6Mg5KeDfw== + +"@babel/helpers@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.13.0.tgz#7647ae57377b4f0408bf4f8a7af01c42e41badc0" + integrity sha512-aan1MeFPxFacZeSz6Ld7YZo5aPuqnKlD7+HZY75xQsueczFccP9A7V05+oe0XpLwHK3oLorPe9eaAUljL7WEaQ== dependencies: "@babel/template" "^7.12.13" - "@babel/traverse" "^7.12.17" - "@babel/types" "^7.12.17" + "@babel/traverse" "^7.13.0" + "@babel/types" "^7.13.0" "@babel/highlight@^7.10.4", "@babel/highlight@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.12.13.tgz#8ab538393e00370b26271b01fa08f7f27f2e795c" - integrity sha512-kocDQvIbgMKlWxXe9fof3TQ+gkIPOUSEYhJjqUjvKMez3krV7vbzYCDq39Oj11UAVK7JqPVGQPlgE85dPNlQww== + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.13.8.tgz#10b2dac78526424dfc1f47650d0e415dfd9dc481" + integrity sha512-4vrIhfJyfNf+lCtXC2ck1rKSzDwciqF7IWFhXXrSOUC2O5DrVp+w4c6ed4AllTxhTkUP5x2tYj41VaxdVMMRDw== dependencies: "@babel/helper-validator-identifier" "^7.12.11" chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.12.17", "@babel/parser@^7.4.3": - version "7.12.17" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.17.tgz#bc85d2d47db38094e5bb268fc761716e7d693848" - integrity sha512-r1yKkiUTYMQ8LiEI0UcQx5ETw5dpTLn9wijn9hk6KkTtOK95FndDN10M+8/s6k/Ymlbivw0Av9q4SlgF80PtHg== +"@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.13.0", "@babel/parser@^7.13.4", "@babel/parser@^7.4.3": + version "7.13.9" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.9.tgz#ca34cb95e1c2dd126863a84465ae8ef66114be99" + integrity sha512-nEUfRiARCcaVo3ny3ZQjURjHQZUo/JkEw7rLlSZy/psWGnvwXFtPcr6jb7Yb41DVW5LTe6KRq9LGleRNsg1Frw== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -248,25 +269,25 @@ "@babel/parser" "^7.12.13" "@babel/types" "^7.12.13" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.12.13", "@babel/traverse@^7.12.17", "@babel/traverse@^7.4.3": - version "7.12.17" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.12.17.tgz#40ec8c7ffb502c4e54c7f95492dc11b88d718619" - integrity sha512-LGkTqDqdiwC6Q7fWSwQoas/oyiEYw6Hqjve5KOSykXkmFJFqzvGMb9niaUEag3Rlve492Mkye3gLw9FTv94fdQ== +"@babel/traverse@^7.1.0", "@babel/traverse@^7.13.0", "@babel/traverse@^7.4.3": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.13.0.tgz#6d95752475f86ee7ded06536de309a65fc8966cc" + integrity sha512-xys5xi5JEhzC3RzEmSGrs/b3pJW/o87SypZ+G/PhaE7uqVQNv/jlmVIBXuoh5atqQ434LfXV+sf23Oxj0bchJQ== dependencies: "@babel/code-frame" "^7.12.13" - "@babel/generator" "^7.12.17" + "@babel/generator" "^7.13.0" "@babel/helper-function-name" "^7.12.13" "@babel/helper-split-export-declaration" "^7.12.13" - "@babel/parser" "^7.12.17" - "@babel/types" "^7.12.17" + "@babel/parser" "^7.13.0" + "@babel/types" "^7.13.0" debug "^4.1.0" globals "^11.1.0" lodash "^4.17.19" -"@babel/types@^7.0.0", "@babel/types@^7.12.13", "@babel/types@^7.12.17", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.0": - version "7.12.17" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.12.17.tgz#9d711eb807e0934c90b8b1ca0eb1f7230d150963" - integrity sha512-tNMDjcv/4DIcHxErTgwB9q2ZcYyN0sUfgGKUK/mm1FJK7Wz+KstoEekxrl/tBiNDgLK1HGi+sppj1An/1DR4fQ== +"@babel/types@^7.0.0", "@babel/types@^7.12.13", "@babel/types@^7.13.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.13.0.tgz#74424d2816f0171b4100f0ab34e9a374efdf7f80" + integrity sha512-hE+HE8rnG1Z6Wzo+MhaKE5lM5eMx71T4EHJgku2E3xIfaULhDcxiiRxUYgwX8qwP1BBSlag+TdGOt6JAidIZTA== dependencies: "@babel/helper-validator-identifier" "^7.12.11" lodash "^4.17.19" @@ -290,10 +311,10 @@ exec-sh "^0.3.2" minimist "^1.2.0" -"@eslint/eslintrc@^0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.3.0.tgz#d736d6963d7003b6514e6324bec9c602ac340318" - integrity sha512-1JTKgrOKAHVivSvOYw+sJOunkBjUOvjqWk1DPja7ZFhIS2mX/4EgTT8M7eTK9jrKhL/FvXXEbQwIs3pg1xp3dg== +"@eslint/eslintrc@^0.4.0": + version "0.4.0" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.0.tgz#99cc0a0584d72f1df38b900fb062ba995f395547" + integrity sha512-2ZPCc+uNbjV5ERJr+aKSPRwZgKd2z11x0EgLvb1PURmUrn9QNRXFqje0Ldq454PfAVyaJYyrDvvIKSFP4NnBog== dependencies: ajv "^6.12.4" debug "^4.1.1" @@ -302,7 +323,6 @@ ignore "^4.0.6" import-fresh "^3.2.1" js-yaml "^3.13.1" - lodash "^4.17.20" minimatch "^3.0.4" strip-json-comments "^3.1.1" @@ -567,10 +587,10 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" -"@jsii/spec@^1.21.0": - version "1.21.0" - resolved "https://registry.yarnpkg.com/@jsii/spec/-/spec-1.21.0.tgz#363c740567747aa03083d2f7bf9ef14e55d8ae9d" - integrity sha512-MWQpJKciYytEmYzuwsT+4UM1JPiQyCAqr3PfkZxuosoPUaF7vBrWSs2+TXDb5dcCwpSnSim9iKZrM/Uc2ppUzA== +"@jsii/spec@^1.23.0": + version "1.23.0" + resolved "https://registry.yarnpkg.com/@jsii/spec/-/spec-1.23.0.tgz#c554cc77d0206f00ba4c101e96cb89d4ecec2985" + integrity sha512-+8Df/m/SRnThSAARlfxknwq1iWnCc2I1kThopuGQiz+peTRMoDVXaH7ZKT+54iZFIrbSf9Pjetho8g0/AZwrKg== dependencies: jsonschema "^1.4.0" @@ -1330,10 +1350,10 @@ "@octokit/types" "^6.0.3" universal-user-agent "^6.0.0" -"@octokit/openapi-types@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-5.1.0.tgz#661fd03c7d55fbcb0a0937d3353d87dea012f52c" - integrity sha512-bodZvSYgycbUuuKrC/anCBUExvaSSWzMMFz0xl7pcJujxnmGxvqvcFHktjx1ZOSyeNKLfYF0QCgibaHUGsZTng== +"@octokit/openapi-types@^5.2.1": + version "5.2.1" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-5.2.1.tgz#5e846f86104aef96ace20091d8afb6be27979d8a" + integrity sha512-Bf7MBvQ1nMpv15ANaQtRBsC7YnwQFPM0eUztp3luQs9L6sBEiQ6ArM1Wx5CG+N7tXETtd0oE0DMcU4wbLlCZIw== "@octokit/plugin-enterprise-rest@^6.0.1": version "6.0.1" @@ -1348,11 +1368,11 @@ "@octokit/types" "^2.0.1" "@octokit/plugin-paginate-rest@^2.6.2": - version "2.10.0" - resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.10.0.tgz#5925156d809c94b7bfc47b28e17488415548fa67" - integrity sha512-71OsKBSMcQEu/6lfVbhv5C5ikU1rn10rKot/WiV7do7fyfElQ2eCUQFogHPbj0ci5lnKAjvahOiMAr6lcvL8Qw== + version "2.11.0" + resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.11.0.tgz#3568c43896a3355f4a0bbb3a64f443b2abdc760d" + integrity sha512-7L9xQank2G3r1dGqrVPo1z62V5utbykOUzlmNHPz87Pww/JpZQ9KyG5CHtUzgmB4n5iDRKYNK/86A8D98HP0yA== dependencies: - "@octokit/types" "^6.10.0" + "@octokit/types" "^6.11.0" "@octokit/plugin-request-log@^1.0.0", "@octokit/plugin-request-log@^1.0.2": version "1.0.3" @@ -1367,12 +1387,12 @@ "@octokit/types" "^2.0.1" deprecation "^2.3.1" -"@octokit/plugin-rest-endpoint-methods@4.12.0": - version "4.12.0" - resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.12.0.tgz#1cec405cd4eaf0bdb58cb7d2a9b3d8473b3a70e8" - integrity sha512-RgnQ1aoetdOJjZYC37LV5FNlL7GY/v1CdC5dur1Zp/UiADJlbRFbAz/xLx26ovXw67dK7EUtwCghS+6QyiI9RA== +"@octokit/plugin-rest-endpoint-methods@4.13.1": + version "4.13.1" + resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.13.1.tgz#d8c807bbd0e187ac903620f53321e2634818bb30" + integrity sha512-T9YhQqpbO9Onmg+FYk09uci9pfChg8CZR9GBaPJWj+bDSzictW1xnU0NtCSSKKyrwvpW/opu7CtuDSs/HF1Syg== dependencies: - "@octokit/types" "^6.10.0" + "@octokit/types" "^6.11.1" deprecation "^2.3.1" "@octokit/request-error@^1.0.2": @@ -1429,15 +1449,15 @@ once "^1.4.0" universal-user-agent "^4.0.0" -"@octokit/rest@^18.2.0": - version "18.2.0" - resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.2.0.tgz#b75c87870bb1f7bc9f37ae0e9acb3a411a34a25f" - integrity sha512-xsp6bIqL2sb/NmgLXTxw96caegobRw+YHnzdIi70ruquHtPPDW2cBAONhDYMUuAOeXx0JH2auOeplpk4SQJy1w== +"@octokit/rest@^18.3.1": + version "18.3.1" + resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.3.1.tgz#6680331e941c422dbff0e758a9bd3dc4edcbd2db" + integrity sha512-g57ebsk7dtbLjiPBgEYDAiDTsyQM9kvlIt0J5UN6OSjG82K6fQQck6HXPpwcyNIDqbN7lIaWr3nsz56jBfI6qg== dependencies: "@octokit/core" "^3.2.3" "@octokit/plugin-paginate-rest" "^2.6.2" "@octokit/plugin-request-log" "^1.0.2" - "@octokit/plugin-rest-endpoint-methods" "4.12.0" + "@octokit/plugin-rest-endpoint-methods" "4.13.1" "@octokit/types@^2.0.0", "@octokit/types@^2.0.1": version "2.16.2" @@ -1446,12 +1466,12 @@ dependencies: "@types/node" ">= 8" -"@octokit/types@^6.0.3", "@octokit/types@^6.10.0", "@octokit/types@^6.7.1": - version "6.10.0" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.10.0.tgz#243faa864b0955f574012d52e179de38ac9ebafe" - integrity sha512-aMDo10kglofejJ96edCBIgQLVuzMDyjxmhdgEcoUUD64PlHYSrNsAGqN0wZtoiX4/PCQ3JLA50IpkP1bcKD/cA== +"@octokit/types@^6.0.3", "@octokit/types@^6.11.0", "@octokit/types@^6.11.1", "@octokit/types@^6.7.1": + version "6.11.1" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.11.1.tgz#54ece128029526fa99bd71e757b9e35478403d95" + integrity sha512-UiSRTG2lrFbMUMwhKNR0uSV33Fzv4bNu1n5iFuuNOg80XCh0VYNhR4TQWgrkLhVxdDuej6s61aP3eQvVm6K6uA== dependencies: - "@octokit/openapi-types" "^5.1.0" + "@octokit/openapi-types" "^5.2.1" "@sinonjs/commons@^1.6.0", "@sinonjs/commons@^1.7.0", "@sinonjs/commons@^1.8.1": version "1.8.2" @@ -1761,13 +1781,13 @@ resolved "https://registry.yarnpkg.com/@types/yarnpkg__lockfile/-/yarnpkg__lockfile-1.1.4.tgz#445251eb00bd9c1e751f82c7c6bf4f714edfd464" integrity sha512-/emrKCfQMQmFCqRqqBJ0JueHBT06jBRM3e8OgnvDUcvuExONujIk2hFA5dNsN9Nt41ljGVDdChvCydATZ+KOZw== -"@typescript-eslint/eslint-plugin@^4.15.1": - version "4.15.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.15.1.tgz#835f64aa0a403e5e9e64c10ceaf8d05c3f015180" - integrity sha512-yW2epMYZSpNJXZy22Biu+fLdTG8Mn6b22kR3TqblVk50HGNV8Zya15WAXuQCr8tKw4Qf1BL4QtI6kv6PCkLoJw== +"@typescript-eslint/eslint-plugin@^4.16.1": + version "4.16.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.16.1.tgz#2caf6a79dd19c3853b8d39769a27fccb24e4e651" + integrity sha512-SK777klBdlkUZpZLC1mPvyOWk9yAFCWmug13eAjVQ4/Q1LATE/NbcQL1xDHkptQkZOLnPmLUA1Y54m8dqYwnoQ== dependencies: - "@typescript-eslint/experimental-utils" "4.15.1" - "@typescript-eslint/scope-manager" "4.15.1" + "@typescript-eslint/experimental-utils" "4.16.1" + "@typescript-eslint/scope-manager" "4.16.1" debug "^4.1.1" functional-red-black-tree "^1.0.1" lodash "^4.17.15" @@ -1775,60 +1795,60 @@ semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/experimental-utils@4.15.1", "@typescript-eslint/experimental-utils@^4.0.1": - version "4.15.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.15.1.tgz#d744d1ac40570a84b447f7aa1b526368afd17eec" - integrity sha512-9LQRmOzBRI1iOdJorr4jEnQhadxK4c9R2aEAsm7WE/7dq8wkKD1suaV0S/JucTL8QlYUPU1y2yjqg+aGC0IQBQ== +"@typescript-eslint/experimental-utils@4.16.1", "@typescript-eslint/experimental-utils@^4.0.1": + version "4.16.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.16.1.tgz#da7a396dc7d0e01922acf102b76efff17320b328" + integrity sha512-0Hm3LSlMYFK17jO4iY3un1Ve9x1zLNn4EM50Lia+0EV99NdbK+cn0er7HC7IvBA23mBg3P+8dUkMXy4leL33UQ== dependencies: "@types/json-schema" "^7.0.3" - "@typescript-eslint/scope-manager" "4.15.1" - "@typescript-eslint/types" "4.15.1" - "@typescript-eslint/typescript-estree" "4.15.1" + "@typescript-eslint/scope-manager" "4.16.1" + "@typescript-eslint/types" "4.16.1" + "@typescript-eslint/typescript-estree" "4.16.1" eslint-scope "^5.0.0" eslint-utils "^2.0.0" -"@typescript-eslint/parser@^4.15.1": - version "4.15.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.15.1.tgz#4c91a0602733db63507e1dbf13187d6c71a153c4" - integrity sha512-V8eXYxNJ9QmXi5ETDguB7O9diAXlIyS+e3xzLoP/oVE4WCAjssxLIa0mqCLsCGXulYJUfT+GV70Jv1vHsdKwtA== +"@typescript-eslint/parser@^4.16.1": + version "4.16.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.16.1.tgz#3bbd3234dd3c5b882b2bcd9899bc30e1e1586d2a" + integrity sha512-/c0LEZcDL5y8RyI1zLcmZMvJrsR6SM1uetskFkoh3dvqDKVXPsXI+wFB/CbVw7WkEyyTKobC1mUNp/5y6gRvXg== dependencies: - "@typescript-eslint/scope-manager" "4.15.1" - "@typescript-eslint/types" "4.15.1" - "@typescript-eslint/typescript-estree" "4.15.1" + "@typescript-eslint/scope-manager" "4.16.1" + "@typescript-eslint/types" "4.16.1" + "@typescript-eslint/typescript-estree" "4.16.1" debug "^4.1.1" -"@typescript-eslint/scope-manager@4.15.1": - version "4.15.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.15.1.tgz#f6511eb38def2a8a6be600c530c243bbb56ac135" - integrity sha512-ibQrTFcAm7yG4C1iwpIYK7vDnFg+fKaZVfvyOm3sNsGAerKfwPVFtYft5EbjzByDJ4dj1WD8/34REJfw/9wdVA== +"@typescript-eslint/scope-manager@4.16.1": + version "4.16.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.16.1.tgz#244e2006bc60cfe46987e9987f4ff49c9e3f00d5" + integrity sha512-6IlZv9JaurqV0jkEg923cV49aAn8V6+1H1DRfhRcvZUrptQ+UtSKHb5kwTayzOYTJJ/RsYZdcvhOEKiBLyc0Cw== dependencies: - "@typescript-eslint/types" "4.15.1" - "@typescript-eslint/visitor-keys" "4.15.1" + "@typescript-eslint/types" "4.16.1" + "@typescript-eslint/visitor-keys" "4.16.1" -"@typescript-eslint/types@4.15.1": - version "4.15.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.15.1.tgz#da702f544ef1afae4bc98da699eaecd49cf31c8c" - integrity sha512-iGsaUyWFyLz0mHfXhX4zO6P7O3sExQpBJ2dgXB0G5g/8PRVfBBsmQIc3r83ranEQTALLR3Vko/fnCIVqmH+mPw== +"@typescript-eslint/types@4.16.1": + version "4.16.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.16.1.tgz#5ba2d3e38b1a67420d2487519e193163054d9c15" + integrity sha512-nnKqBwMgRlhzmJQF8tnFDZWfunXmJyuXj55xc8Kbfup4PbkzdoDXZvzN8//EiKR27J6vUSU8j4t37yUuYPiLqA== -"@typescript-eslint/typescript-estree@4.15.1": - version "4.15.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.15.1.tgz#fa9a9ff88b4a04d901ddbe5b248bc0a00cd610be" - integrity sha512-z8MN3CicTEumrWAEB2e2CcoZa3KP9+SMYLIA2aM49XW3cWIaiVSOAGq30ffR5XHxRirqE90fgLw3e6WmNx5uNw== +"@typescript-eslint/typescript-estree@4.16.1": + version "4.16.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.16.1.tgz#c2fc46b05a48fbf8bbe8b66a63f0a9ba04b356f1" + integrity sha512-m8I/DKHa8YbeHt31T+UGd/l8Kwr0XCTCZL3H4HMvvLCT7HU9V7yYdinTOv1gf/zfqNeDcCgaFH2BMsS8x6NvJg== dependencies: - "@typescript-eslint/types" "4.15.1" - "@typescript-eslint/visitor-keys" "4.15.1" + "@typescript-eslint/types" "4.16.1" + "@typescript-eslint/visitor-keys" "4.16.1" debug "^4.1.1" globby "^11.0.1" is-glob "^4.0.1" semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/visitor-keys@4.15.1": - version "4.15.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.15.1.tgz#c76abbf2a3be8a70ed760f0e5756bf62de5865dd" - integrity sha512-tYzaTP9plooRJY8eNlpAewTOqtWW/4ff/5wBjNVaJ0S0wC4Gpq/zDVRTJa5bq2v1pCNQ08xxMCndcvR+h7lMww== +"@typescript-eslint/visitor-keys@4.16.1": + version "4.16.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.16.1.tgz#d7571fb580749fae621520deeb134370bbfc7293" + integrity sha512-s/aIP1XcMkEqCNcPQtl60ogUYjSM8FU2mq1O7y5cFf3Xcob1z1iXWNB6cC43Op+NGRTFgGolri6s8z/efA9i1w== dependencies: - "@typescript-eslint/types" "4.15.1" + "@typescript-eslint/types" "4.16.1" eslint-visitor-keys "^2.0.0" "@yarnpkg/lockfile@^1.1.0": @@ -2265,9 +2285,9 @@ aws-sdk-mock@^5.1.0: traverse "^0.6.6" aws-sdk@^2.596.0, aws-sdk@^2.637.0, aws-sdk@^2.848.0: - version "2.848.0" - resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.848.0.tgz#5e7706ddd30a55a2d5a5b64c29682a757607ee64" - integrity sha512-c/e5kaEFl+9aYkrYDkmu5mSZlL+EfP6DnBOMD06fH12gIsaFSMBGtbsDTHABhvSu++LxeI1dJAD148O17MuZvg== + version "2.854.0" + resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.854.0.tgz#531525cdfdfc774232d86619d2c2c2ae3e1a71a8" + integrity sha512-Ex/YJcRB4avEW64UZ7uJ7aBxN8qFPuoSaG7YpLWUGJv+p9Vsqm0v0IqmMo7O5/s2LpIXRG8mLi3UbNZYz2iGhg== dependencies: buffer "4.9.2" events "1.1.1" @@ -2393,9 +2413,9 @@ before-after-hook@^2.0.0, before-after-hook@^2.1.0: integrity sha512-5ekuQOvO04MDj7kYZJaMab2S8SPjGJbotVNyv7QYFCOAwrGZs/YnoDNlh1U+m5hl7H2D/+n0taaAV/tfyd3KMA== bind-obj-methods@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/bind-obj-methods/-/bind-obj-methods-2.0.0.tgz#0178140dbe7b7bb67dc74892ace59bc0247f06f0" - integrity sha512-3/qRXczDi2Cdbz6jE+W3IflJOutRVica8frpBn14de1mBOkzDo+6tY33kNhvkw54Kn3PzRRD2VnGbGPcTAk4sw== + version "2.0.1" + resolved "https://registry.yarnpkg.com/bind-obj-methods/-/bind-obj-methods-2.0.1.tgz#1c1295d6741c07b78d15f42080fe4a60a27f91f5" + integrity sha512-kKzUyCuc+jsWH4C2nW5KB2nh+rQRbQcdphfo9UN3j1uwIFGZ3JB8njtRZOiUAQCkxazH0nDQPN6x/zhvFcbZIw== bl@^4.0.3: version "4.1.0" @@ -2447,6 +2467,17 @@ browser-process-hrtime@^1.0.0: resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== +browserslist@^4.14.5: + version "4.16.3" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.3.tgz#340aa46940d7db878748567c5dea24a48ddf3717" + integrity sha512-vIyhWmIkULaq04Gt93txdh+j02yX/JzlyhLYbV3YQCn/zvES3JnY7TifHHvvr1w5hTDluNKMkV05cs4vy8Q7sw== + dependencies: + caniuse-lite "^1.0.30001181" + colorette "^1.2.1" + electron-to-chromium "^1.3.649" + escalade "^3.1.1" + node-releases "^1.1.70" + bs-logger@0.x: version "0.2.6" resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" @@ -2652,6 +2683,11 @@ camelcase@^6.0.0, camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== +caniuse-lite@^1.0.30001181: + version "1.0.30001194" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001194.tgz#3d16ff3d734a5a7d9818402c28b1f636c5be5bed" + integrity sha512-iDUOH+oFeBYk5XawYsPtsx/8fFpndAPUQJC7gBTfxHM8xw5nOZv7ceAD4frS1MKCLUac7QL5wdAJiFQlDRjXlA== + capture-exit@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4" @@ -2832,10 +2868,10 @@ code-point-at@^1.0.0: resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= -codemaker@^1.21.0: - version "1.21.0" - resolved "https://registry.yarnpkg.com/codemaker/-/codemaker-1.21.0.tgz#3dd1c236b6af3d8ac90f99e300e56e80c799ea76" - integrity sha512-YxTt3lWcR6PC/3fByU7FGjIoUDOcTs1KmqRJcK14xN9X7wxBOWO129WuSTm/4XfKlz/3iSo9CtRX/5HYkE1oCQ== +codemaker@^1.23.0: + version "1.23.0" + resolved "https://registry.yarnpkg.com/codemaker/-/codemaker-1.23.0.tgz#2d2168e70829496cff0549983b6ea7b7f843c1a3" + integrity sha512-VpHeRuvibqJbayWj9xHb15yKRLBOJUrZuhsmH868m6xGz5FXwLD1aUdSY9rqaNI0df8FfFyCYhk5f/A+bi0/wg== dependencies: camelcase "^6.2.0" decamelize "^5.0.0" @@ -2883,6 +2919,11 @@ color-support@^1.1.0: resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== +colorette@^1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94" + integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w== + colors@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" @@ -2903,10 +2944,10 @@ combined-stream@^1.0.6, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" -commander@~6.2.1: - version "6.2.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" - integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== +commander@~7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-7.1.0.tgz#f2eaecf131f10e36e07d894698226e36ae0eb5ff" + integrity sha512-pRxBna3MJe6HKnBGsDyMv8ETbptw3axEdYHoqNh7gu5oDcew8fs0xnivZGm06Ogk8zGAJ9VX+OPEr2GXEQK4dg== commondir@^1.0.1: version "1.0.1" @@ -2985,9 +3026,9 @@ console-control-strings@^1.0.0, console-control-strings@~1.1.0: integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= constructs@^3.2.0: - version "3.3.29" - resolved "https://registry.yarnpkg.com/constructs/-/constructs-3.3.29.tgz#42d2fbc0d872a47701a70583a0d4356a3f11955c" - integrity sha512-rGQzkq2M/qKZ0hMEtt4YPpsZKOwzmiyAQx3PqexXXsjdVnTqEfIwQuDpc+1jP6CtaBHl7rR6CxQcfsP5DmaERw== + version "3.3.48" + resolved "https://registry.yarnpkg.com/constructs/-/constructs-3.3.48.tgz#56446b7bd8da8023f33a2e4c1bc7d2df3971e6eb" + integrity sha512-5AKrTtmiioQWloJ3WRFZb0/uR1lrRboaVE9go++XZltvRnZkN2/kQjaZ0gtFxynU5u5k9mWVtk8mNcgJ9yoRbQ== contains-path@^0.1.0: version "0.1.0" @@ -3740,6 +3781,11 @@ ejs@^2.5.2: resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.7.4.tgz#48661287573dcc53e366c7a1ae52c3a120eec9ba" integrity sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA== +electron-to-chromium@^1.3.649: + version "1.3.677" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.677.tgz#b5d586b0d1976c97cc7e95262677ac5944199513" + integrity sha512-Tcmk+oKQgpjcM+KYanlkd76ZtpzalkpUULnlJDP6vjHtR7UU564IM9Qv5DxqHZNBQjzXm6mkn7Y8bw2OoE3FmQ== + emittery@^0.7.1: version "0.7.2" resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.7.2.tgz#25595908e13af0f5674ab419396e2fb394cdfa82" @@ -3776,11 +3822,16 @@ enquirer@^2.3.5: dependencies: ansi-colors "^4.1.1" -entities@~2.0, entities@~2.0.0: +entities@~2.0: version "2.0.3" resolved "https://registry.yarnpkg.com/entities/-/entities-2.0.3.tgz#5c487e5742ab93c15abb5da22759b8590ec03b7f" integrity sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ== +entities@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5" + integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w== + env-paths@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.0.tgz#cdca557dc009152917d6166e2febe1f039685e43" @@ -3804,24 +3855,26 @@ error-ex@^1.2.0, error-ex@^1.3.1: is-arrayish "^0.2.1" es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2: - version "1.18.0-next.2" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0-next.2.tgz#088101a55f0541f595e7e057199e27ddc8f3a5c2" - integrity sha512-Ih4ZMFHEtZupnUh6497zEL4y2+w8+1ljnCyaTa+adcoafI1GOvMwFlDjBLfWR7y9VLfrjRJe9ocuHY1PSR9jjw== + version "1.18.0-next.3" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0-next.3.tgz#56bc8b5cc36b2cca25a13be07f3c02c2343db6b7" + integrity sha512-VMzHx/Bczjg59E6jZOQjHeN3DEoptdhejpARgflAViidlqSpjdq9zA6lKwlhRRs/lOw1gHJv2xkkSFRgvEwbQg== dependencies: call-bind "^1.0.2" es-to-primitive "^1.2.1" function-bind "^1.1.1" - get-intrinsic "^1.0.2" + get-intrinsic "^1.1.1" has "^1.0.3" - has-symbols "^1.0.1" - is-callable "^1.2.2" + has-symbols "^1.0.2" + is-callable "^1.2.3" is-negative-zero "^2.0.1" - is-regex "^1.1.1" + is-regex "^1.1.2" + is-string "^1.0.5" object-inspect "^1.9.0" object-keys "^1.1.1" object.assign "^4.1.2" - string.prototype.trimend "^1.0.3" - string.prototype.trimstart "^1.0.3" + string.prototype.trimend "^1.0.4" + string.prototype.trimstart "^1.0.4" + unbox-primitive "^1.0.0" es-get-iterator@^1.1.1: version "1.1.2" @@ -3868,10 +3921,10 @@ es6-promisify@^5.0.0: dependencies: es6-promise "^4.0.3" -esbuild@^0.8.50: - version "0.8.50" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.8.50.tgz#ebf24fde0cdad1a369789dd6fd7a820b0a01e46c" - integrity sha512-oidFLXssA7IccYzkqLVZSqNJDwDq8Mh/vqvrW+3fPWM7iUiC5O2bCllhnO8+K9LlyL/2Z6n+WwRJAz9fqSIVRg== +esbuild@^0.8.54: + version "0.8.54" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.8.54.tgz#2f32ff80e95c69a0f25b799d76a27c05e2857cdf" + integrity sha512-DJH38OiTgXJxFb/EhHrCrY8eGmtdkTtWymHpN9IYN9AF+4jykT0dQArr7wzFejpVbaB0TMIq2+vfNRWr3LXpvw== escalade@^3.1.1: version "3.1.1" @@ -4023,13 +4076,13 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8" integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== -eslint@^7.20.0: - version "7.20.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.20.0.tgz#db07c4ca4eda2e2316e7aa57ac7fc91ec550bdc7" - integrity sha512-qGi0CTcOGP2OtCQBgWZlQjcTuP0XkIpYFj25XtRTQSHC+umNnp7UMshr2G8SLsRFYDdAPFeHOsiteadmMH02Yw== +eslint@^7.21.0: + version "7.21.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.21.0.tgz#4ecd5b8c5b44f5dedc9b8a110b01bbfeb15d1c83" + integrity sha512-W2aJbXpMNofUp0ztQaF40fveSsJBjlSCSWpy//gzfTvwC+USs/nceBrKmlJOiM8r1bLwP2EuYkCqArn/6QTIgg== dependencies: "@babel/code-frame" "7.12.11" - "@eslint/eslintrc" "^0.3.0" + "@eslint/eslintrc" "^0.4.0" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" @@ -4042,7 +4095,7 @@ eslint@^7.20.0: espree "^7.3.1" esquery "^1.4.0" esutils "^2.0.2" - file-entry-cache "^6.0.0" + file-entry-cache "^6.0.1" functional-red-black-tree "^1.0.1" glob-parent "^5.0.0" globals "^12.1.0" @@ -4314,9 +4367,9 @@ fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= fastq@^1.6.0: - version "1.10.1" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.10.1.tgz#8b8f2ac8bf3632d67afcd65dac248d5fdc45385e" - integrity sha512-AWuv6Ery3pM+dY7LYS8YIaCiQvUaos9OB1RyNgaOWnaX+Tik7Onvcsf8x8c+YtDeT0maYLniBip2hox5KtEXXA== + version "1.11.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.11.0.tgz#bb9fb955a07130a918eb63c1f5161cc32a5d0858" + integrity sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g== dependencies: reusify "^1.0.4" @@ -4346,7 +4399,7 @@ figures@^3.1.0: dependencies: escape-string-regexp "^1.0.5" -file-entry-cache@^6.0.0: +file-entry-cache@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== @@ -4471,9 +4524,9 @@ flush-write-stream@^1.0.0: readable-stream "^2.3.6" follow-redirects@^1.10.0, follow-redirects@^1.11.0: - version "1.13.2" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.2.tgz#dd73c8effc12728ba5cf4259d760ea5fb83e3147" - integrity sha512-6mPTgLxYm3r6Bkkg0vNM0HTjfGrOEtsfbhagQvbxDEsEkpNhw582upBaoRZylzen6krEmxXJgt9Ju6HiI4O7BA== + version "1.13.3" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.3.tgz#e5598ad50174c1bc4e872301e82ac2cd97f90267" + integrity sha512-DUgl6+HDzB0iEptNQEXLx/KhTmDb8tZUHSeLqpnjpknR70H0nC2t9N73BK6fN4hOvJ84pKlIQVQ4k5FFlBedKA== for-in@^1.0.2: version "1.0.2" @@ -4640,7 +4693,7 @@ genfun@^5.0.0: resolved "https://registry.yarnpkg.com/genfun/-/genfun-5.0.0.tgz#9dd9710a06900a5c4a5bf57aca5da4e52fe76537" integrity sha512-KGDOARWVga7+rnB3z9Sd2Letx515owfk0hSxHGuqjANb1M+x2bGZGqHLiozPsYMdM2OubeMni/Hpwmjq6qIUhA== -gensync@^1.0.0-beta.1: +gensync@^1.0.0-beta.2: version "1.0.0-beta.2" resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== @@ -4916,6 +4969,11 @@ hard-rejection@^2.1.0: resolved "https://registry.yarnpkg.com/hard-rejection/-/hard-rejection-2.1.0.tgz#1c6eda5c1685c63942766d79bb40ae773cecd883" integrity sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA== +has-bigints@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" + integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA== + has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" @@ -4926,10 +4984,10 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has-symbols@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" - integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== +has-symbols@^1.0.0, has-symbols@^1.0.1, has-symbols@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" + integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== has-unicode@^2.0.0, has-unicode@^2.0.1: version "2.0.1" @@ -5307,7 +5365,7 @@ is-buffer@^1.1.5, is-buffer@~1.1.6: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== -is-callable@^1.1.4, is-callable@^1.2.2: +is-callable@^1.1.4, is-callable@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.3.tgz#8b1e0500b73a1d76c70487636f368e519de8db8e" integrity sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ== @@ -5495,7 +5553,7 @@ is-potential-custom-element-name@^1.0.0: resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.0.tgz#0c52e54bcca391bb2c494b21e8626d7336c6e397" integrity sha1-DFLlS8yjkbssSUsh6GJtczbG45c= -is-regex@^1.1.1: +is-regex@^1.1.1, is-regex@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.2.tgz#81c8ebde4db142f2cf1c53fc86d6a45788266251" integrity sha512-axvdhb5pdhEVThqJzYXwMlVuZwC+FF2DpcOhTS+y/8jVq4trxyPgfcwIxIKiyeuLlSQYKkmUaPQJ8ZE4yNKXDg== @@ -6135,7 +6193,7 @@ js-tokens@^4.0.0: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-yaml@^3.13.1, js-yaml@^3.2.7, js-yaml@~3.14.1: +js-yaml@^3.13.1, js-yaml@^3.2.7: version "3.14.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== @@ -6143,6 +6201,13 @@ js-yaml@^3.13.1, js-yaml@^3.2.7, js-yaml@~3.14.1: argparse "^1.0.7" esprima "^4.0.0" +js-yaml@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.0.0.tgz#f426bc0ff4b4051926cd588c71113183409a121f" + integrity sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q== + dependencies: + argparse "^2.0.1" + jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" @@ -6185,65 +6250,65 @@ jsesc@^2.5.1: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== -jsii-diff@^1.21.0: - version "1.21.0" - resolved "https://registry.yarnpkg.com/jsii-diff/-/jsii-diff-1.21.0.tgz#4e7f5b38fa42b4ee109592686ec5d5b168491c0b" - integrity sha512-88YUb9FO2jb6We9fTowR2k1+YhnFJ1LYDOOw7ThyyNyjsgEAheOV5vB4u43HTduZncVmncUNjcMirrUDm2JDzA== +jsii-diff@^1.23.0: + version "1.23.0" + resolved "https://registry.yarnpkg.com/jsii-diff/-/jsii-diff-1.23.0.tgz#57fc832155e4739fbfc7a235b177c305e9cb6f67" + integrity sha512-1g41UE2yJK8E50eDo4JSJQZRlfmUzWDw0D7DF40Z6upbay3jQKWjerXbJmD9RvJkD6I8khAoEnI77daw1AgQTw== dependencies: - "@jsii/spec" "^1.21.0" + "@jsii/spec" "^1.23.0" fs-extra "^9.1.0" - jsii-reflect "^1.21.0" + jsii-reflect "^1.23.0" log4js "^6.3.0" typescript "~3.9.9" yargs "^16.2.0" -jsii-pacmak@^1.21.0: - version "1.21.0" - resolved "https://registry.yarnpkg.com/jsii-pacmak/-/jsii-pacmak-1.21.0.tgz#b9da4b5d2e980bc75ec37336175a2b99752d677f" - integrity sha512-04/fIZqM31cfTf48v7ni7MGeAwBEREP1WhvGkf4TSAZmAdMx1FUWQxuKiDK1/YeEvIUhNHIy/Ng9GcoSf+Rwfg== +jsii-pacmak@^1.23.0: + version "1.23.0" + resolved "https://registry.yarnpkg.com/jsii-pacmak/-/jsii-pacmak-1.23.0.tgz#aedc0f17dc420da5be9446189eae5096fe170bd3" + integrity sha512-LchV8amHqWHjypbPLDZqdLkmp0rVYJYhFbS88sApvO4TaDdh0C3KnbEjNf3Jn/JpPXxd2PUNtCw8D9fDy7zwVw== dependencies: - "@jsii/spec" "^1.21.0" + "@jsii/spec" "^1.23.0" clone "^2.1.2" - codemaker "^1.21.0" + codemaker "^1.23.0" commonmark "^0.29.3" escape-string-regexp "^4.0.0" fs-extra "^9.1.0" - jsii-reflect "^1.21.0" - jsii-rosetta "^1.21.0" + jsii-reflect "^1.23.0" + jsii-rosetta "^1.23.0" semver "^7.3.4" spdx-license-list "^6.4.0" xmlbuilder "^15.1.1" yargs "^16.2.0" -jsii-reflect@^1.21.0: - version "1.21.0" - resolved "https://registry.yarnpkg.com/jsii-reflect/-/jsii-reflect-1.21.0.tgz#2f6f7835d7428c5cc9d2c81f1c881e613710bc78" - integrity sha512-OwXhVhe+NRv/e6jaGBdIpm3S1KQcEXTZN+USiBd+c4kROLqxw+ubpMBsEVSKEZ7t+4WksLTWWNot31VZkJrZ5g== +jsii-reflect@^1.23.0: + version "1.23.0" + resolved "https://registry.yarnpkg.com/jsii-reflect/-/jsii-reflect-1.23.0.tgz#fd046e25e4d89887bc0ea7416d68e42568c6689e" + integrity sha512-jxQnz5hm5tk7l85iWgfyuxnB+mpzmj/y96AIkSbbOfHDeHpLG7h+yOROZoe2K8tUcHKamA70p+gNcZOETZP3OA== dependencies: - "@jsii/spec" "^1.21.0" + "@jsii/spec" "^1.23.0" colors "^1.4.0" fs-extra "^9.1.0" - oo-ascii-tree "^1.21.0" + oo-ascii-tree "^1.23.0" yargs "^16.2.0" -jsii-rosetta@^1.21.0: - version "1.21.0" - resolved "https://registry.yarnpkg.com/jsii-rosetta/-/jsii-rosetta-1.21.0.tgz#591ebb2ce390b81f269a66d906446f8bebe9e23b" - integrity sha512-8W0vcWTr28q+1NWhVAY4lOwOlPHdGdg8b/gPHFccRi9ZM4uwRjW7YjmqD9FmX74dEg1Qmvd8nujW4Opow6PFtQ== +jsii-rosetta@^1.23.0: + version "1.23.0" + resolved "https://registry.yarnpkg.com/jsii-rosetta/-/jsii-rosetta-1.23.0.tgz#fd62dbf84b16cb119c80aca4397ab5d6ee02f071" + integrity sha512-LBFq1LBrq97MUU5T9sgrIPq0wMWUCsUt3tnZEpjIDXPHYptVVn7HmKbu5PjG47GbNTOcsY/nP2r7N3RFrG881g== dependencies: - "@jsii/spec" "^1.21.0" + "@jsii/spec" "^1.23.0" commonmark "^0.29.3" fs-extra "^9.1.0" typescript "~3.9.9" xmldom "^0.4.0" yargs "^16.2.0" -jsii@^1.21.0: - version "1.21.0" - resolved "https://registry.yarnpkg.com/jsii/-/jsii-1.21.0.tgz#6fd5dd9a18bb820a127ab51f55b2081cf14b2181" - integrity sha512-6siaRt1OyrQxC9pzLaFGj6bDkHMTsofcu8ODM0NCcukq2P4PlF1O39H0DV8Z40QF3KWbawJ/Utl7GtaSrdG2Ww== +jsii@^1.23.0: + version "1.23.0" + resolved "https://registry.yarnpkg.com/jsii/-/jsii-1.23.0.tgz#12e04a565114024bc6721f6482e9a362bbf50926" + integrity sha512-vwwFEt+7wXtex8G1ztWIuOPDhahZA/a+XvtiucZYnIO7VwkmeqAxrgwdBIrQoH2GJKYs55kMnDa4+yfnTGcOgw== dependencies: - "@jsii/spec" "^1.21.0" + "@jsii/spec" "^1.23.0" case "^1.6.3" colors "^1.4.0" deep-equal "^2.0.5" @@ -6804,48 +6869,48 @@ map-visit@^1.0.0: dependencies: object-visit "^1.0.0" -markdown-it@12.0.2: - version "12.0.2" - resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-12.0.2.tgz#4401beae8df8aa2221fc6565a7188e60a06ef0ed" - integrity sha512-4Lkvjbv2kK+moL9TbeV+6/NHx+1Q+R/NIdUlFlkqkkzUcTod4uiyTJRiBidKR9qXSdkNFkgv+AELY8KN9vSgVA== +markdown-it@12.0.4: + version "12.0.4" + resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-12.0.4.tgz#eec8247d296327eac3ba9746bdeec9cfcc751e33" + integrity sha512-34RwOXZT8kyuOJy25oJNJoulO8L0bTHYWXcdZBYZqFnjIy3NgjeoM3FmPXIOFQ26/lSHYMr8oc62B6adxXcb3Q== dependencies: argparse "^2.0.1" - entities "~2.0.0" + entities "~2.1.0" linkify-it "^3.0.1" mdurl "^1.0.1" uc.micro "^1.0.5" -markdownlint-cli@^0.26.0: - version "0.26.0" - resolved "https://registry.yarnpkg.com/markdownlint-cli/-/markdownlint-cli-0.26.0.tgz#cd89e3e39a049303ec125c8aa291da4f3325df29" - integrity sha512-biLfeGNZG9nw0yJbtFBzRlew2/P5w7JSseKwolSox3zejs7dLpGvPgqbC+iqJnqqGWcWLtXaXh8bBEKWmfl10A== +markdownlint-cli@^0.27.0: + version "0.27.0" + resolved "https://registry.yarnpkg.com/markdownlint-cli/-/markdownlint-cli-0.27.0.tgz#d89264319ef7ae6a02e0b2fd472fbbb11bde47f7" + integrity sha512-lci/GD1V2aysJOpJFXfIt5KlpF62Rw+7hUfGg3ZwkLBBeNuUwLZj/IomQ924m00Ido/tPGbFObelKlZaUlETpQ== dependencies: - commander "~6.2.1" + commander "~7.1.0" deep-extend "~0.6.0" get-stdin "~8.0.0" glob "~7.1.6" ignore "~5.1.8" - js-yaml "~3.14.1" + js-yaml "^4.0.0" jsonc-parser "~3.0.0" lodash.differencewith "~4.5.0" lodash.flatten "~4.4.0" - markdownlint "~0.22.0" - markdownlint-rule-helpers "~0.13.0" + markdownlint "~0.23.1" + markdownlint-rule-helpers "~0.14.0" minimatch "~3.0.4" minimist "~1.2.5" rc "~1.2.8" -markdownlint-rule-helpers@~0.13.0: - version "0.13.0" - resolved "https://registry.yarnpkg.com/markdownlint-rule-helpers/-/markdownlint-rule-helpers-0.13.0.tgz#7cc6553bc7f8c4c8a43cf66fb2a3a652124f46f9" - integrity sha512-rRY0itbcHG4e+ntz0bbY3AIceSJMKS0TafEMgEtKVHRZ54/JUSy6/4ypCL618RlJvYRej+xMLxX5nkJqIeTZaQ== +markdownlint-rule-helpers@~0.14.0: + version "0.14.0" + resolved "https://registry.yarnpkg.com/markdownlint-rule-helpers/-/markdownlint-rule-helpers-0.14.0.tgz#4d0e1ae320e85559d8cbed1490934855791627bb" + integrity sha512-vRTPqSU4JK8vVXmjICHSBhwXUvbfh/VJo+j7hvxqe15tLJyomv3FLgFdFgb8kpj0Fe8SsJa/TZUAXv7/sN+N7A== -markdownlint@~0.22.0: - version "0.22.0" - resolved "https://registry.yarnpkg.com/markdownlint/-/markdownlint-0.22.0.tgz#4ed95b61c17ae9f4dfca6a01f038c744846c0a72" - integrity sha512-J4B+iMc12pOdp/wfYi03W2qfAfEyiZzq3qvQh/8vOMNU8vXYY6Jg440EY7dWTBCqROhb1i4nAn3BTByJ5kdx1w== +markdownlint@~0.23.1: + version "0.23.1" + resolved "https://registry.yarnpkg.com/markdownlint/-/markdownlint-0.23.1.tgz#98292b5d340d01e9c113f3d7fb3b2ccf89628dc2" + integrity sha512-iOEwhDfNmq2IJlaA8mzEkHYUi/Hwoa6Ss+HO5jkwUR6wQ4quFr0WzSx+Z9rsWZKUaPbyirIdL1zGmJRkWawr4Q== dependencies: - markdown-it "12.0.2" + markdown-it "12.0.4" md5@^2.3.0: version "2.3.0" @@ -7208,10 +7273,10 @@ nise@^4.0.4: just-extend "^4.0.2" path-to-regexp "^1.7.0" -nock@^13.0.7: - version "13.0.7" - resolved "https://registry.yarnpkg.com/nock/-/nock-13.0.7.tgz#9bc718c66bd0862dfa14601a9ba678a406127910" - integrity sha512-WBz73VYIjdbO6BwmXODRQLtn7B5tldA9pNpWJe5QTtTEscQlY5KXU4srnGzBOK2fWakkXj69gfTnXGzmrsaRWw== +nock@^13.0.9: + version "13.0.9" + resolved "https://registry.yarnpkg.com/nock/-/nock-13.0.9.tgz#32b9f6408a71991b25f044109cac92ee556c8539" + integrity sha512-SoGx/J0SsZPOdBFrBC9PP6NwaEgOBQIRPbsOsO9q+OwOPWc5eT6wALSxn3ZNE4Fv2ImIUXM4Hv/07rjq/uWDew== dependencies: debug "^4.1.0" json-stringify-safe "^5.0.1" @@ -7278,6 +7343,11 @@ node-preload@^0.2.1: dependencies: process-on-spawn "^1.0.0" +node-releases@^1.1.70: + version "1.1.71" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.71.tgz#cb1334b179896b1c89ecfdd4b725fb7bbdfc7dbb" + integrity sha512-zR6HoT6LrLCRBwukmrVbHv0EpEQjksO6GmFcZQQuCAy139BEsoVKPYnf3jongYW83fAa1torLGYwxxky/p28sg== + nodeunit@^0.11.3: version "0.11.3" resolved "https://registry.yarnpkg.com/nodeunit/-/nodeunit-0.11.3.tgz#313afae26cd11b407b731ff774b8e35e5d6f9568" @@ -7559,13 +7629,13 @@ object.pick@^1.3.0: isobject "^3.0.1" object.values@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.2.tgz#7a2015e06fcb0f546bd652486ce8583a4731c731" - integrity sha512-MYC0jvJopr8EK6dPBiO8Nb9mvjdypOachO5REGk6MXzujbBrAisKo3HmdEI6kZDL6fC31Mwee/5YbtMebixeag== + version "1.1.3" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.3.tgz#eaa8b1e17589f02f698db093f7c62ee1699742ee" + integrity sha512-nkF6PfDB9alkOUxpf1HNm/QlkeW3SReqL5WXeBLpEJJnlPSvRaDQpW3gQTksTN3fgJX4hL42RzKyOin6ff3tyw== dependencies: - call-bind "^1.0.0" + call-bind "^1.0.2" define-properties "^1.1.3" - es-abstract "^1.18.0-next.1" + es-abstract "^1.18.0-next.2" has "^1.0.3" octokit-pagination-methods@^1.1.0: @@ -7594,10 +7664,10 @@ onetime@^5.1.0: dependencies: mimic-fn "^2.1.0" -oo-ascii-tree@^1.21.0: - version "1.21.0" - resolved "https://registry.yarnpkg.com/oo-ascii-tree/-/oo-ascii-tree-1.21.0.tgz#8408fceb90799c7af769b7ab709ec35ea9868b8b" - integrity sha512-N91VyM/R9K8axskaVYSg+IJiSDJVKFQ2IfQyBp5Rv7t2YETjJDMgA6Ew9MGv82fhpz95qKLlZmgrQsb7scb2Eg== +oo-ascii-tree@^1.23.0: + version "1.23.0" + resolved "https://registry.yarnpkg.com/oo-ascii-tree/-/oo-ascii-tree-1.23.0.tgz#b7a8ece5d313a420689a6a9d728a2696e8991e40" + integrity sha512-+T0rUcBAvJaEXbdCe3p8A7qjJ82CRGSgfUSvkGscH2F0lFqrELN1ey0UGDf0UV7C/ivIFzct5DYJAhrVvFbeUw== opener@^1.5.1: version "1.5.2" @@ -8243,9 +8313,9 @@ qs@~6.5.2: integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== query-string@^6.13.8: - version "6.14.0" - resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.14.0.tgz#0b7b7ca326f5facf10dd2d45d26645cd287f8c92" - integrity sha512-In3o+lUxlgejoVJgwEdYtdxrmlL0cQWJXj0+kkI7RWVo7hg5AhFtybeKlC9Dpgbr8eOC4ydpEh8017WwyfzqVQ== + version "6.14.1" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.14.1.tgz#7ac2dca46da7f309449ba0f86b1fd28255b0c86a" + integrity sha512-XDxAeVmpfu1/6IjyT/gXHOl+S0vQ9owggJ30hhWKdHAsNPOcasn5o9BW0eejZqL2e4vMjhAxoW3jVHcD6mbcYw== dependencies: decode-uri-component "^0.2.0" filter-obj "^1.1.0" @@ -8704,9 +8774,9 @@ run-queue@^1.0.0, run-queue@^1.0.3: aproba "^1.1.1" rxjs@^6.4.0: - version "6.6.3" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.3.tgz#8ca84635c4daa900c0d3967a6ee7ac60271ee552" - integrity sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ== + version "6.6.6" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.6.tgz#14d8417aa5a07c5e633995b525e1e3c0dec03b70" + integrity sha512-/oTwee4N4iWzAMAL9xdGKjkEHmIwupR3oXbQjCKywF1BeFohswF3vZdogbmEF6pZkOsXTzWkrZszrWpQTByYVg== dependencies: tslib "^1.9.0" @@ -9239,10 +9309,10 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -string-width@*, string-width@^4.1.0, string-width@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" - integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== +string-width@*, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5" + integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA== dependencies: emoji-regex "^8.0.0" is-fullwidth-code-point "^3.0.0" @@ -9279,20 +9349,20 @@ string.prototype.repeat@^0.2.0: resolved "https://registry.yarnpkg.com/string.prototype.repeat/-/string.prototype.repeat-0.2.0.tgz#aba36de08dcee6a5a337d49b2ea1da1b28fc0ecf" integrity sha1-q6Nt4I3O5qWjN9SbLqHaGyj8Ds8= -string.prototype.trimend@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.3.tgz#a22bd53cca5c7cf44d7c9d5c732118873d6cd18b" - integrity sha512-ayH0pB+uf0U28CtjlLvL7NaohvR1amUvVZk+y3DYb0Ey2PUV5zPkkKy9+U1ndVEIXO8hNg18eIv9Jntbii+dKw== +string.prototype.trimend@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" + integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A== dependencies: - call-bind "^1.0.0" + call-bind "^1.0.2" define-properties "^1.1.3" -string.prototype.trimstart@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.3.tgz#9b4cb590e123bb36564401d59824298de50fd5aa" - integrity sha512-oBIBUy5lea5tt0ovtOFiEQaBkoBBkyJhZXzJYrSmDo5IUUqbOPvVezuRs/agBIdZ2p2Eo1FD6bD9USyBLfl3xg== +string.prototype.trimstart@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed" + integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw== dependencies: - call-bind "^1.0.0" + call-bind "^1.0.2" define-properties "^1.1.3" string_decoder@^1.1.1: @@ -9793,10 +9863,10 @@ trivial-deferred@^1.0.1: resolved "https://registry.yarnpkg.com/trivial-deferred/-/trivial-deferred-1.0.1.tgz#376d4d29d951d6368a6f7a0ae85c2f4d5e0658f3" integrity sha1-N21NKdlR1jaKb3oK6FwvTV4GWPM= -ts-jest@^26.5.1: - version "26.5.1" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.5.1.tgz#4d53ee4481552f57c1624f0bd3425c8b17996150" - integrity sha512-G7Rmo3OJMvlqE79amJX8VJKDiRcd7/r61wh9fnvvG8cAjhA9edklGw/dCxRSQmfZ/z8NDums5srSVgwZos1qfg== +ts-jest@^26.5.2: + version "26.5.2" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.5.2.tgz#5281d6b44c2f94f71205728a389edc3d7995b0c4" + integrity sha512-bwyJ2zJieSugf7RB+o8fgkMeoMVMM2KPDE0UklRLuACxjwJsOrZNo6chrcScmK33YavPSwhARffy8dZx5LJdUQ== dependencies: "@types/jest" "26.x" bs-logger "0.x" @@ -9956,9 +10026,9 @@ typescript@^3.3.3, typescript@~3.9.9: integrity sha512-kdMjTiekY+z/ubJCATUPlRDl39vXYiMV9iyeMuEuXZh2we6zz80uovNN2WlAxmmdE/Z/YQe+EbOEXB5RHEED3w== typescript@^4.1.3: - version "4.1.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.5.tgz#123a3b214aaff3be32926f0d8f1f6e704eb89a72" - integrity sha512-6OSu9PTIzmn9TCDiovULTnET6BgXtDYL4Gg4szY+cGsc3JP1dQL8qvE8kShTRx1NIw4Q9IBHlwODjkjWEtMUyA== + version "4.2.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.2.tgz#1450f020618f872db0ea17317d16d8da8ddb8c4c" + integrity sha512-tbb+NVrLfnsJy3M59lsDgrzWIflR4d4TIUjz+heUnHZwdF7YsrMTKoRERiIvI2lvBG95dfpLxB21WZhys1bgaQ== typescript@~3.8.3: version "3.8.3" @@ -9971,9 +10041,9 @@ uc.micro@^1.0.1, uc.micro@^1.0.5: integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA== uglify-js@^3.1.4: - version "3.12.8" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.12.8.tgz#a82e6e53c9be14f7382de3d068ef1e26e7d4aaf8" - integrity sha512-fvBeuXOsvqjecUtF/l1dwsrrf5y2BCUk9AOJGzGcm6tE7vegku5u/YvqjyDaAGr422PLoLnrxg3EnRvTqsdC1w== + version "3.13.0" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.13.0.tgz#66ed69f7241f33f13531d3d51d5bcebf00df7f69" + integrity sha512-TWYSWa9T2pPN4DIJYbU9oAjQx+5qdV5RUDxwARg8fmJZrD/V27Zj0JngW5xg1DFz42G0uDYl2XhzF6alSzD62w== uid-number@0.0.6: version "0.0.6" @@ -9985,6 +10055,16 @@ umask@^1.1.0: resolved "https://registry.yarnpkg.com/umask/-/umask-1.1.0.tgz#f29cebf01df517912bb58ff9c4e50fde8e33320d" integrity sha1-8pzr8B31F5ErtY/5xOUP3o4zMg0= +unbox-primitive@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.0.tgz#eeacbc4affa28e9b3d36b5eaeccc50b3251b1d3f" + integrity sha512-P/51NX+JXyxK/aigg1/ZgyccdAxm5K1+n8+tvqSntjOivPt19gvm1VC49RWYetsiub8WViUchdxl/KWHHB0kzA== + dependencies: + function-bind "^1.1.1" + has-bigints "^1.0.0" + has-symbols "^1.0.0" + which-boxed-primitive "^1.0.1" + unicode-length@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/unicode-length/-/unicode-length-2.0.2.tgz#e5eb4c0d523fdf7bebb59ca261c9ca1cf732da96" From e8f0c3c0b2baf9d8ef8fe220f701e596f8a04373 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Tue, 2 Mar 2021 13:49:54 +0200 Subject: [PATCH 57/78] chore: produce go bindings (#13317) Adds a `go.moduleName` entry to all package.json files which will cause jsii-pacmak to produce go bindings for the AWS CDK and place them under the `dist/go` directory during packaging. Resolves https://github.com/aws/jsii/issues/2611 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/alexa-ask/package.json | 3 +++ packages/@aws-cdk/app-delivery/package.json | 3 +++ packages/@aws-cdk/assets/package.json | 3 +++ packages/@aws-cdk/aws-accessanalyzer/package.json | 3 +++ packages/@aws-cdk/aws-acmpca/package.json | 3 +++ packages/@aws-cdk/aws-amazonmq/package.json | 3 +++ packages/@aws-cdk/aws-amplify/package.json | 3 +++ packages/@aws-cdk/aws-apigateway/package.json | 3 +++ .../aws-apigatewayv2-authorizers/package.json | 3 +++ .../aws-apigatewayv2-integrations/package.json | 3 +++ packages/@aws-cdk/aws-apigatewayv2/package.json | 3 +++ packages/@aws-cdk/aws-appconfig/package.json | 3 +++ packages/@aws-cdk/aws-appflow/package.json | 3 +++ .../aws-applicationautoscaling/package.json | 3 +++ .../@aws-cdk/aws-applicationinsights/package.json | 3 +++ packages/@aws-cdk/aws-appmesh/package.json | 3 +++ packages/@aws-cdk/aws-appstream/package.json | 3 +++ packages/@aws-cdk/aws-appsync/package.json | 3 +++ packages/@aws-cdk/aws-athena/package.json | 3 +++ packages/@aws-cdk/aws-auditmanager/package.json | 3 +++ .../@aws-cdk/aws-autoscaling-common/package.json | 3 +++ .../aws-autoscaling-hooktargets/package.json | 3 +++ packages/@aws-cdk/aws-autoscaling/package.json | 3 +++ .../@aws-cdk/aws-autoscalingplans/package.json | 3 +++ packages/@aws-cdk/aws-backup/package.json | 3 +++ packages/@aws-cdk/aws-batch/package.json | 3 +++ packages/@aws-cdk/aws-budgets/package.json | 3 +++ packages/@aws-cdk/aws-cassandra/package.json | 3 +++ packages/@aws-cdk/aws-ce/package.json | 3 +++ .../@aws-cdk/aws-certificatemanager/package.json | 3 +++ packages/@aws-cdk/aws-chatbot/package.json | 3 +++ packages/@aws-cdk/aws-cloud9/package.json | 3 +++ packages/@aws-cdk/aws-cloudformation/package.json | 3 +++ .../@aws-cdk/aws-cloudfront-origins/package.json | 3 +++ packages/@aws-cdk/aws-cloudfront/package.json | 3 +++ packages/@aws-cdk/aws-cloudtrail/package.json | 3 +++ .../@aws-cdk/aws-cloudwatch-actions/package.json | 3 +++ packages/@aws-cdk/aws-cloudwatch/package.json | 3 +++ packages/@aws-cdk/aws-codeartifact/package.json | 3 +++ packages/@aws-cdk/aws-codebuild/package.json | 3 +++ packages/@aws-cdk/aws-codecommit/package.json | 3 +++ packages/@aws-cdk/aws-codedeploy/package.json | 3 +++ .../@aws-cdk/aws-codeguruprofiler/package.json | 3 +++ .../@aws-cdk/aws-codegurureviewer/package.json | 3 +++ .../aws-codepipeline-actions/package.json | 3 +++ packages/@aws-cdk/aws-codepipeline/package.json | 3 +++ packages/@aws-cdk/aws-codestar/package.json | 3 +++ .../@aws-cdk/aws-codestarconnections/package.json | 3 +++ .../aws-codestarnotifications/package.json | 3 +++ packages/@aws-cdk/aws-cognito/package.json | 3 +++ packages/@aws-cdk/aws-config/package.json | 3 +++ packages/@aws-cdk/aws-databrew/package.json | 3 +++ packages/@aws-cdk/aws-datapipeline/package.json | 3 +++ packages/@aws-cdk/aws-datasync/package.json | 3 +++ packages/@aws-cdk/aws-dax/package.json | 3 +++ packages/@aws-cdk/aws-detective/package.json | 3 +++ packages/@aws-cdk/aws-devopsguru/package.json | 3 +++ .../@aws-cdk/aws-directoryservice/package.json | 3 +++ packages/@aws-cdk/aws-dlm/package.json | 3 +++ packages/@aws-cdk/aws-dms/package.json | 3 +++ packages/@aws-cdk/aws-docdb/package.json | 3 +++ .../@aws-cdk/aws-dynamodb-global/package.json | 3 +++ packages/@aws-cdk/aws-dynamodb/package.json | 3 +++ packages/@aws-cdk/aws-ec2/package.json | 3 +++ packages/@aws-cdk/aws-ecr-assets/package.json | 3 +++ packages/@aws-cdk/aws-ecr/package.json | 3 +++ packages/@aws-cdk/aws-ecs-patterns/package.json | 3 +++ packages/@aws-cdk/aws-ecs/package.json | 3 +++ packages/@aws-cdk/aws-efs/package.json | 3 +++ packages/@aws-cdk/aws-eks-legacy/package.json | 3 +++ packages/@aws-cdk/aws-eks/package.json | 3 +++ packages/@aws-cdk/aws-elasticache/package.json | 3 +++ .../@aws-cdk/aws-elasticbeanstalk/package.json | 3 +++ .../aws-elasticloadbalancing/package.json | 3 +++ .../package.json | 3 +++ .../package.json | 3 +++ .../aws-elasticloadbalancingv2/package.json | 3 +++ packages/@aws-cdk/aws-elasticsearch/package.json | 3 +++ packages/@aws-cdk/aws-emr/package.json | 3 +++ packages/@aws-cdk/aws-emrcontainers/package.json | 3 +++ packages/@aws-cdk/aws-events-targets/package.json | 3 +++ packages/@aws-cdk/aws-events/package.json | 3 +++ packages/@aws-cdk/aws-eventschemas/package.json | 3 +++ packages/@aws-cdk/aws-fms/package.json | 3 +++ packages/@aws-cdk/aws-fsx/package.json | 3 +++ packages/@aws-cdk/aws-gamelift/package.json | 3 +++ .../@aws-cdk/aws-globalaccelerator/package.json | 3 +++ packages/@aws-cdk/aws-glue/package.json | 3 +++ packages/@aws-cdk/aws-greengrass/package.json | 3 +++ packages/@aws-cdk/aws-greengrassv2/package.json | 3 +++ packages/@aws-cdk/aws-guardduty/package.json | 3 +++ packages/@aws-cdk/aws-iam/package.json | 3 +++ packages/@aws-cdk/aws-imagebuilder/package.json | 3 +++ packages/@aws-cdk/aws-inspector/package.json | 3 +++ packages/@aws-cdk/aws-iot/package.json | 3 +++ packages/@aws-cdk/aws-iot1click/package.json | 3 +++ packages/@aws-cdk/aws-iotanalytics/package.json | 3 +++ packages/@aws-cdk/aws-iotevents/package.json | 3 +++ packages/@aws-cdk/aws-iotsitewise/package.json | 3 +++ packages/@aws-cdk/aws-iotthingsgraph/package.json | 3 +++ packages/@aws-cdk/aws-iotwireless/package.json | 3 +++ packages/@aws-cdk/aws-ivs/package.json | 3 +++ packages/@aws-cdk/aws-kendra/package.json | 3 +++ packages/@aws-cdk/aws-kinesis/package.json | 3 +++ .../aws-kinesisanalytics-flink/package.json | 3 +++ .../@aws-cdk/aws-kinesisanalytics/package.json | 3 +++ .../@aws-cdk/aws-kinesisfirehose/package.json | 3 +++ packages/@aws-cdk/aws-kms/package.json | 3 +++ packages/@aws-cdk/aws-lakeformation/package.json | 3 +++ .../@aws-cdk/aws-lambda-destinations/package.json | 3 +++ .../aws-lambda-event-sources/package.json | 3 +++ packages/@aws-cdk/aws-lambda-nodejs/package.json | 3 +++ packages/@aws-cdk/aws-lambda-python/package.json | 3 +++ packages/@aws-cdk/aws-lambda/package.json | 3 +++ packages/@aws-cdk/aws-licensemanager/package.json | 3 +++ .../@aws-cdk/aws-logs-destinations/package.json | 3 +++ packages/@aws-cdk/aws-logs/package.json | 3 +++ packages/@aws-cdk/aws-lookoutvision/package.json | 3 +++ packages/@aws-cdk/aws-macie/package.json | 3 +++ .../@aws-cdk/aws-managedblockchain/package.json | 3 +++ packages/@aws-cdk/aws-mediaconnect/package.json | 3 +++ packages/@aws-cdk/aws-mediaconvert/package.json | 3 +++ packages/@aws-cdk/aws-medialive/package.json | 3 +++ packages/@aws-cdk/aws-mediapackage/package.json | 3 +++ packages/@aws-cdk/aws-mediastore/package.json | 3 +++ packages/@aws-cdk/aws-msk/package.json | 3 +++ packages/@aws-cdk/aws-mwaa/package.json | 3 +++ packages/@aws-cdk/aws-neptune/package.json | 3 +++ .../@aws-cdk/aws-networkfirewall/package.json | 3 +++ packages/@aws-cdk/aws-networkmanager/package.json | 3 +++ packages/@aws-cdk/aws-opsworks/package.json | 3 +++ packages/@aws-cdk/aws-opsworkscm/package.json | 3 +++ packages/@aws-cdk/aws-pinpoint/package.json | 3 +++ packages/@aws-cdk/aws-pinpointemail/package.json | 3 +++ packages/@aws-cdk/aws-qldb/package.json | 3 +++ packages/@aws-cdk/aws-quicksight/package.json | 3 +++ packages/@aws-cdk/aws-ram/package.json | 3 +++ packages/@aws-cdk/aws-rds/package.json | 3 +++ packages/@aws-cdk/aws-redshift/package.json | 3 +++ packages/@aws-cdk/aws-resourcegroups/package.json | 3 +++ packages/@aws-cdk/aws-robomaker/package.json | 3 +++ .../@aws-cdk/aws-route53-patterns/package.json | 3 +++ .../@aws-cdk/aws-route53-targets/package.json | 3 +++ packages/@aws-cdk/aws-route53/package.json | 3 +++ .../@aws-cdk/aws-route53resolver/package.json | 3 +++ packages/@aws-cdk/aws-s3-assets/package.json | 3 +++ packages/@aws-cdk/aws-s3-deployment/package.json | 3 +++ .../@aws-cdk/aws-s3-notifications/package.json | 3 +++ packages/@aws-cdk/aws-s3/package.json | 3 +++ packages/@aws-cdk/aws-sagemaker/package.json | 3 +++ packages/@aws-cdk/aws-sam/package.json | 3 +++ packages/@aws-cdk/aws-sdb/package.json | 3 +++ packages/@aws-cdk/aws-secretsmanager/package.json | 3 +++ packages/@aws-cdk/aws-securityhub/package.json | 3 +++ packages/@aws-cdk/aws-servicecatalog/package.json | 3 +++ .../aws-servicecatalogappregistry/package.json | 3 +++ .../@aws-cdk/aws-servicediscovery/package.json | 3 +++ packages/@aws-cdk/aws-ses-actions/package.json | 3 +++ packages/@aws-cdk/aws-ses/package.json | 3 +++ packages/@aws-cdk/aws-signer/package.json | 3 +++ .../@aws-cdk/aws-sns-subscriptions/package.json | 3 +++ packages/@aws-cdk/aws-sns/package.json | 3 +++ packages/@aws-cdk/aws-sqs/package.json | 3 +++ packages/@aws-cdk/aws-ssm/package.json | 3 +++ packages/@aws-cdk/aws-sso/package.json | 3 +++ .../@aws-cdk/aws-stepfunctions-tasks/package.json | 3 +++ packages/@aws-cdk/aws-stepfunctions/package.json | 3 +++ packages/@aws-cdk/aws-synthetics/package.json | 3 +++ packages/@aws-cdk/aws-timestream/package.json | 3 +++ packages/@aws-cdk/aws-transfer/package.json | 3 +++ packages/@aws-cdk/aws-waf/package.json | 3 +++ packages/@aws-cdk/aws-wafregional/package.json | 3 +++ packages/@aws-cdk/aws-wafv2/package.json | 3 +++ packages/@aws-cdk/aws-workspaces/package.json | 3 +++ packages/@aws-cdk/cdk-assets-schema/package.json | 3 +++ .../@aws-cdk/cloud-assembly-schema/package.json | 3 +++ .../@aws-cdk/cloudformation-include/package.json | 3 +++ packages/@aws-cdk/core/package.json | 3 +++ packages/@aws-cdk/custom-resources/package.json | 3 +++ packages/@aws-cdk/cx-api/package.json | 3 +++ .../example-construct-library/package.json | 3 +++ .../@aws-cdk/lambda-layer-awscli/package.json | 3 +++ .../@aws-cdk/lambda-layer-kubectl/package.json | 3 +++ packages/@aws-cdk/pipelines/package.json | 3 +++ packages/@aws-cdk/region-info/package.json | 3 +++ packages/@aws-cdk/yaml-cfn/package.json | 3 +++ packages/aws-cdk-lib/package.json | 3 +++ packages/monocdk/package.json | 3 +++ tools/pkglint/lib/rules.ts | 15 +++++++++++++++ tools/ubergen/bin/ubergen.ts | 8 ++++++++ 190 files changed, 587 insertions(+) diff --git a/packages/@aws-cdk/alexa-ask/package.json b/packages/@aws-cdk/alexa-ask/package.json index 48b5fa2b1e003..3a909a1ee956e 100644 --- a/packages/@aws-cdk/alexa-ask/package.json +++ b/packages/@aws-cdk/alexa-ask/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/app-delivery/package.json b/packages/@aws-cdk/app-delivery/package.json index 8ac9e9cae6a12..3fc2590cbdbca 100644 --- a/packages/@aws-cdk/app-delivery/package.json +++ b/packages/@aws-cdk/app-delivery/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "outdir": "dist", diff --git a/packages/@aws-cdk/assets/package.json b/packages/@aws-cdk/assets/package.json index 45735a4da140f..2b8fc80b52e33 100644 --- a/packages/@aws-cdk/assets/package.json +++ b/packages/@aws-cdk/assets/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-accessanalyzer/package.json b/packages/@aws-cdk/aws-accessanalyzer/package.json index 85c2a0d682662..40e4d5401c38c 100644 --- a/packages/@aws-cdk/aws-accessanalyzer/package.json +++ b/packages/@aws-cdk/aws-accessanalyzer/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-acmpca/package.json b/packages/@aws-cdk/aws-acmpca/package.json index e0956bffbf2c6..2d19a03f9908e 100644 --- a/packages/@aws-cdk/aws-acmpca/package.json +++ b/packages/@aws-cdk/aws-acmpca/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-amazonmq/package.json b/packages/@aws-cdk/aws-amazonmq/package.json index c9d6412f5effa..e1e36ddbfbbd4 100644 --- a/packages/@aws-cdk/aws-amazonmq/package.json +++ b/packages/@aws-cdk/aws-amazonmq/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-amplify/package.json b/packages/@aws-cdk/aws-amplify/package.json index ea1abbde2ba37..66788a81af49b 100644 --- a/packages/@aws-cdk/aws-amplify/package.json +++ b/packages/@aws-cdk/aws-amplify/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-apigateway/package.json b/packages/@aws-cdk/aws-apigateway/package.json index 7465b7d45a6bd..da2d702ebf166 100644 --- a/packages/@aws-cdk/aws-apigateway/package.json +++ b/packages/@aws-cdk/aws-apigateway/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-apigatewayv2-authorizers/package.json b/packages/@aws-cdk/aws-apigatewayv2-authorizers/package.json index f21b19c75f329..6307d4826ad57 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-authorizers/package.json +++ b/packages/@aws-cdk/aws-apigatewayv2-authorizers/package.json @@ -28,6 +28,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations/package.json b/packages/@aws-cdk/aws-apigatewayv2-integrations/package.json index c4a3e3039b9a3..cb528349ce7a9 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-integrations/package.json +++ b/packages/@aws-cdk/aws-apigatewayv2-integrations/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-apigatewayv2/package.json b/packages/@aws-cdk/aws-apigatewayv2/package.json index 19abb0ca10b3f..2f4d7d06fb95a 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/package.json +++ b/packages/@aws-cdk/aws-apigatewayv2/package.json @@ -30,6 +30,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-appconfig/package.json b/packages/@aws-cdk/aws-appconfig/package.json index 0836a936f672c..381afb7857101 100644 --- a/packages/@aws-cdk/aws-appconfig/package.json +++ b/packages/@aws-cdk/aws-appconfig/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-appflow/package.json b/packages/@aws-cdk/aws-appflow/package.json index 6d047b697b394..77e328433aab9 100644 --- a/packages/@aws-cdk/aws-appflow/package.json +++ b/packages/@aws-cdk/aws-appflow/package.json @@ -27,6 +27,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-applicationautoscaling/package.json b/packages/@aws-cdk/aws-applicationautoscaling/package.json index 71036cd220e5f..62882f605d1e0 100644 --- a/packages/@aws-cdk/aws-applicationautoscaling/package.json +++ b/packages/@aws-cdk/aws-applicationautoscaling/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-applicationinsights/package.json b/packages/@aws-cdk/aws-applicationinsights/package.json index edef6de6de7f0..e0ca501a8ffaf 100644 --- a/packages/@aws-cdk/aws-applicationinsights/package.json +++ b/packages/@aws-cdk/aws-applicationinsights/package.json @@ -27,6 +27,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-appmesh/package.json b/packages/@aws-cdk/aws-appmesh/package.json index 32176758bd410..7cb52f62a9419 100644 --- a/packages/@aws-cdk/aws-appmesh/package.json +++ b/packages/@aws-cdk/aws-appmesh/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-appstream/package.json b/packages/@aws-cdk/aws-appstream/package.json index e9655519ab834..0a83be29c807b 100644 --- a/packages/@aws-cdk/aws-appstream/package.json +++ b/packages/@aws-cdk/aws-appstream/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-appsync/package.json b/packages/@aws-cdk/aws-appsync/package.json index f6bfb64813364..89cc21242f08f 100644 --- a/packages/@aws-cdk/aws-appsync/package.json +++ b/packages/@aws-cdk/aws-appsync/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-athena/package.json b/packages/@aws-cdk/aws-athena/package.json index 2a3cd7207b97f..b91cec17dd785 100644 --- a/packages/@aws-cdk/aws-athena/package.json +++ b/packages/@aws-cdk/aws-athena/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-auditmanager/package.json b/packages/@aws-cdk/aws-auditmanager/package.json index b263be5fd8c92..e56c4bf456efa 100644 --- a/packages/@aws-cdk/aws-auditmanager/package.json +++ b/packages/@aws-cdk/aws-auditmanager/package.json @@ -27,6 +27,9 @@ ], "distName": "aws-cdk.aws-auditmanager", "module": "aws_cdk.aws_auditmanager" + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-autoscaling-common/package.json b/packages/@aws-cdk/aws-autoscaling-common/package.json index 644801e0dbc71..bc6577aaf40ce 100644 --- a/packages/@aws-cdk/aws-autoscaling-common/package.json +++ b/packages/@aws-cdk/aws-autoscaling-common/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-autoscaling-hooktargets/package.json b/packages/@aws-cdk/aws-autoscaling-hooktargets/package.json index b15364996c1f3..ff64d09ecc12d 100644 --- a/packages/@aws-cdk/aws-autoscaling-hooktargets/package.json +++ b/packages/@aws-cdk/aws-autoscaling-hooktargets/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-autoscaling/package.json b/packages/@aws-cdk/aws-autoscaling/package.json index 79a8b3e02b967..b69f4806808d5 100644 --- a/packages/@aws-cdk/aws-autoscaling/package.json +++ b/packages/@aws-cdk/aws-autoscaling/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-autoscalingplans/package.json b/packages/@aws-cdk/aws-autoscalingplans/package.json index 5674f715e2b80..34b0c422e75c8 100644 --- a/packages/@aws-cdk/aws-autoscalingplans/package.json +++ b/packages/@aws-cdk/aws-autoscalingplans/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-backup/package.json b/packages/@aws-cdk/aws-backup/package.json index 841f29f929f36..4e082b94418d0 100644 --- a/packages/@aws-cdk/aws-backup/package.json +++ b/packages/@aws-cdk/aws-backup/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-batch/package.json b/packages/@aws-cdk/aws-batch/package.json index 0b8f4666ab077..36396cdba598d 100644 --- a/packages/@aws-cdk/aws-batch/package.json +++ b/packages/@aws-cdk/aws-batch/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-budgets/package.json b/packages/@aws-cdk/aws-budgets/package.json index 3d8297269395f..399ea38d1eff6 100644 --- a/packages/@aws-cdk/aws-budgets/package.json +++ b/packages/@aws-cdk/aws-budgets/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-cassandra/package.json b/packages/@aws-cdk/aws-cassandra/package.json index 5b0a317a627d8..505e7ded93585 100644 --- a/packages/@aws-cdk/aws-cassandra/package.json +++ b/packages/@aws-cdk/aws-cassandra/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-ce/package.json b/packages/@aws-cdk/aws-ce/package.json index 07c5e186da907..abe21ac65f7fa 100644 --- a/packages/@aws-cdk/aws-ce/package.json +++ b/packages/@aws-cdk/aws-ce/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-certificatemanager/package.json b/packages/@aws-cdk/aws-certificatemanager/package.json index 96e0787fb06ec..e153019fb9c2d 100644 --- a/packages/@aws-cdk/aws-certificatemanager/package.json +++ b/packages/@aws-cdk/aws-certificatemanager/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-chatbot/package.json b/packages/@aws-cdk/aws-chatbot/package.json index ab267bf8f1c0c..8c3ded8e04e46 100644 --- a/packages/@aws-cdk/aws-chatbot/package.json +++ b/packages/@aws-cdk/aws-chatbot/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-cloud9/package.json b/packages/@aws-cdk/aws-cloud9/package.json index e71b8c60f3bc0..268fd30187bec 100644 --- a/packages/@aws-cdk/aws-cloud9/package.json +++ b/packages/@aws-cdk/aws-cloud9/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-cloudformation/package.json b/packages/@aws-cdk/aws-cloudformation/package.json index 550bc780b750d..7aaa445c5a2b1 100644 --- a/packages/@aws-cdk/aws-cloudformation/package.json +++ b/packages/@aws-cdk/aws-cloudformation/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-cloudfront-origins/package.json b/packages/@aws-cdk/aws-cloudfront-origins/package.json index d90ce2d097315..16501e2570b72 100644 --- a/packages/@aws-cdk/aws-cloudfront-origins/package.json +++ b/packages/@aws-cdk/aws-cloudfront-origins/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-cloudfront/package.json b/packages/@aws-cdk/aws-cloudfront/package.json index 75b18c5b95444..6bb5b3c809b2d 100644 --- a/packages/@aws-cdk/aws-cloudfront/package.json +++ b/packages/@aws-cdk/aws-cloudfront/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-cloudtrail/package.json b/packages/@aws-cdk/aws-cloudtrail/package.json index ce2c1f2e647ed..c7ed13060cefa 100644 --- a/packages/@aws-cdk/aws-cloudtrail/package.json +++ b/packages/@aws-cdk/aws-cloudtrail/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-cloudwatch-actions/package.json b/packages/@aws-cdk/aws-cloudwatch-actions/package.json index 04ed6918384c1..26692ec087e2e 100644 --- a/packages/@aws-cdk/aws-cloudwatch-actions/package.json +++ b/packages/@aws-cdk/aws-cloudwatch-actions/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-cloudwatch/package.json b/packages/@aws-cdk/aws-cloudwatch/package.json index c974f8fe0199a..b565003e1686e 100644 --- a/packages/@aws-cdk/aws-cloudwatch/package.json +++ b/packages/@aws-cdk/aws-cloudwatch/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-codeartifact/package.json b/packages/@aws-cdk/aws-codeartifact/package.json index e4b8ef3ffaad6..79138a67407be 100644 --- a/packages/@aws-cdk/aws-codeartifact/package.json +++ b/packages/@aws-cdk/aws-codeartifact/package.json @@ -27,6 +27,9 @@ ], "distName": "aws-cdk.aws-codeartifact", "module": "aws_cdk.aws_codeartifact" + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-codebuild/package.json b/packages/@aws-cdk/aws-codebuild/package.json index 7b268062d474f..65ce29c998065 100644 --- a/packages/@aws-cdk/aws-codebuild/package.json +++ b/packages/@aws-cdk/aws-codebuild/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-codecommit/package.json b/packages/@aws-cdk/aws-codecommit/package.json index 0580fab198c85..0855460794c24 100644 --- a/packages/@aws-cdk/aws-codecommit/package.json +++ b/packages/@aws-cdk/aws-codecommit/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-codedeploy/package.json b/packages/@aws-cdk/aws-codedeploy/package.json index 257e001f0fdbe..9d106edccbe88 100644 --- a/packages/@aws-cdk/aws-codedeploy/package.json +++ b/packages/@aws-cdk/aws-codedeploy/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-codeguruprofiler/package.json b/packages/@aws-cdk/aws-codeguruprofiler/package.json index dd7c44d1a3527..c7f23bd383c45 100644 --- a/packages/@aws-cdk/aws-codeguruprofiler/package.json +++ b/packages/@aws-cdk/aws-codeguruprofiler/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-codegurureviewer/package.json b/packages/@aws-cdk/aws-codegurureviewer/package.json index 1b75ae00b4682..4ef6ef289ba6a 100644 --- a/packages/@aws-cdk/aws-codegurureviewer/package.json +++ b/packages/@aws-cdk/aws-codegurureviewer/package.json @@ -27,6 +27,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-codepipeline-actions/package.json b/packages/@aws-cdk/aws-codepipeline-actions/package.json index 62a7868ece518..a0788fab0981c 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/package.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-codepipeline/package.json b/packages/@aws-cdk/aws-codepipeline/package.json index 1cc830be83ec6..5b94a3fd80015 100644 --- a/packages/@aws-cdk/aws-codepipeline/package.json +++ b/packages/@aws-cdk/aws-codepipeline/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-codestar/package.json b/packages/@aws-cdk/aws-codestar/package.json index 01024a24b1248..706c0960c34cb 100644 --- a/packages/@aws-cdk/aws-codestar/package.json +++ b/packages/@aws-cdk/aws-codestar/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-codestarconnections/package.json b/packages/@aws-cdk/aws-codestarconnections/package.json index 66ab2aab76ea6..3d1fe00297421 100644 --- a/packages/@aws-cdk/aws-codestarconnections/package.json +++ b/packages/@aws-cdk/aws-codestarconnections/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-codestarnotifications/package.json b/packages/@aws-cdk/aws-codestarnotifications/package.json index 18667b45db8b1..97a0d6950ab74 100644 --- a/packages/@aws-cdk/aws-codestarnotifications/package.json +++ b/packages/@aws-cdk/aws-codestarnotifications/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-cognito/package.json b/packages/@aws-cdk/aws-cognito/package.json index c9bae0f953907..39d3f69986888 100644 --- a/packages/@aws-cdk/aws-cognito/package.json +++ b/packages/@aws-cdk/aws-cognito/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-config/package.json b/packages/@aws-cdk/aws-config/package.json index 59055c7030216..87b85e69f03b5 100644 --- a/packages/@aws-cdk/aws-config/package.json +++ b/packages/@aws-cdk/aws-config/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-databrew/package.json b/packages/@aws-cdk/aws-databrew/package.json index be8bdfacf71db..3acfb720bb672 100644 --- a/packages/@aws-cdk/aws-databrew/package.json +++ b/packages/@aws-cdk/aws-databrew/package.json @@ -27,6 +27,9 @@ ], "distName": "aws-cdk.aws-databrew", "module": "aws_cdk.aws_databrew" + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-datapipeline/package.json b/packages/@aws-cdk/aws-datapipeline/package.json index 2e1f552ef864a..fc3c6bad7274e 100644 --- a/packages/@aws-cdk/aws-datapipeline/package.json +++ b/packages/@aws-cdk/aws-datapipeline/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-datasync/package.json b/packages/@aws-cdk/aws-datasync/package.json index 124d3871ae0c3..854167eb58e72 100644 --- a/packages/@aws-cdk/aws-datasync/package.json +++ b/packages/@aws-cdk/aws-datasync/package.json @@ -27,6 +27,9 @@ ], "distName": "aws-cdk.aws-datasync", "module": "aws_cdk.aws_datasync" + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-dax/package.json b/packages/@aws-cdk/aws-dax/package.json index 83fecea8535ee..8ee1f1d08c1ae 100644 --- a/packages/@aws-cdk/aws-dax/package.json +++ b/packages/@aws-cdk/aws-dax/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-detective/package.json b/packages/@aws-cdk/aws-detective/package.json index 741eade5dc9e2..87b9bf0fbc3cd 100644 --- a/packages/@aws-cdk/aws-detective/package.json +++ b/packages/@aws-cdk/aws-detective/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-devopsguru/package.json b/packages/@aws-cdk/aws-devopsguru/package.json index 7632ba1d35cea..57e49f91bdbe6 100644 --- a/packages/@aws-cdk/aws-devopsguru/package.json +++ b/packages/@aws-cdk/aws-devopsguru/package.json @@ -27,6 +27,9 @@ ], "distName": "aws-cdk.aws-devopsguru", "module": "aws_cdk.aws_devopsguru" + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-directoryservice/package.json b/packages/@aws-cdk/aws-directoryservice/package.json index 9be65b5324fff..cb7cb485d2a1b 100644 --- a/packages/@aws-cdk/aws-directoryservice/package.json +++ b/packages/@aws-cdk/aws-directoryservice/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-dlm/package.json b/packages/@aws-cdk/aws-dlm/package.json index 5829ed6a34e11..8fceb31c016ac 100644 --- a/packages/@aws-cdk/aws-dlm/package.json +++ b/packages/@aws-cdk/aws-dlm/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-dms/package.json b/packages/@aws-cdk/aws-dms/package.json index 1c6f0a473b7b3..3942ffcfdb539 100644 --- a/packages/@aws-cdk/aws-dms/package.json +++ b/packages/@aws-cdk/aws-dms/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-docdb/package.json b/packages/@aws-cdk/aws-docdb/package.json index 658583ff0d644..349953aa08523 100644 --- a/packages/@aws-cdk/aws-docdb/package.json +++ b/packages/@aws-cdk/aws-docdb/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-dynamodb-global/package.json b/packages/@aws-cdk/aws-dynamodb-global/package.json index 2a3a41bc29fbb..cf1072e375ca4 100644 --- a/packages/@aws-cdk/aws-dynamodb-global/package.json +++ b/packages/@aws-cdk/aws-dynamodb-global/package.json @@ -37,6 +37,9 @@ "namespace": "Amazon.CDK.AWS.DynamoDB.Global", "packageId": "Amazon.CDK.AWS.DynamoDB.Global", "iconUrl": "https://raw.githubusercontent.com/aws/aws-cdk/master/logo/default-256-dark.png" + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-dynamodb/package.json b/packages/@aws-cdk/aws-dynamodb/package.json index 5737a58a67816..68b2c5d09aa2b 100644 --- a/packages/@aws-cdk/aws-dynamodb/package.json +++ b/packages/@aws-cdk/aws-dynamodb/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-ec2/package.json b/packages/@aws-cdk/aws-ec2/package.json index 801040d4c7385..9be0595fb3dcb 100644 --- a/packages/@aws-cdk/aws-ec2/package.json +++ b/packages/@aws-cdk/aws-ec2/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-ecr-assets/package.json b/packages/@aws-cdk/aws-ecr-assets/package.json index 3d8b54ee08122..38eb5186ff75d 100644 --- a/packages/@aws-cdk/aws-ecr-assets/package.json +++ b/packages/@aws-cdk/aws-ecr-assets/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-ecr/package.json b/packages/@aws-cdk/aws-ecr/package.json index 95a78ae04c522..0f83ba1e0f2c6 100644 --- a/packages/@aws-cdk/aws-ecr/package.json +++ b/packages/@aws-cdk/aws-ecr/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-ecs-patterns/package.json b/packages/@aws-cdk/aws-ecs-patterns/package.json index dcb4d8b436bda..c887907b8b759 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/package.json +++ b/packages/@aws-cdk/aws-ecs-patterns/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-ecs/package.json b/packages/@aws-cdk/aws-ecs/package.json index ec829127f9e84..8facfd0ff7618 100644 --- a/packages/@aws-cdk/aws-ecs/package.json +++ b/packages/@aws-cdk/aws-ecs/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-efs/package.json b/packages/@aws-cdk/aws-efs/package.json index 6a7cef054b6a2..4a33202117802 100644 --- a/packages/@aws-cdk/aws-efs/package.json +++ b/packages/@aws-cdk/aws-efs/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-eks-legacy/package.json b/packages/@aws-cdk/aws-eks-legacy/package.json index 67078e5830dcf..86c0c1b0f8e1d 100644 --- a/packages/@aws-cdk/aws-eks-legacy/package.json +++ b/packages/@aws-cdk/aws-eks-legacy/package.json @@ -27,6 +27,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-eks/package.json b/packages/@aws-cdk/aws-eks/package.json index 4d27cbfaac281..fa8bcd66b51a7 100644 --- a/packages/@aws-cdk/aws-eks/package.json +++ b/packages/@aws-cdk/aws-eks/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-elasticache/package.json b/packages/@aws-cdk/aws-elasticache/package.json index f0b728276adda..ecc3e12df777a 100644 --- a/packages/@aws-cdk/aws-elasticache/package.json +++ b/packages/@aws-cdk/aws-elasticache/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-elasticbeanstalk/package.json b/packages/@aws-cdk/aws-elasticbeanstalk/package.json index 31472f9e21d51..e82a623313b76 100644 --- a/packages/@aws-cdk/aws-elasticbeanstalk/package.json +++ b/packages/@aws-cdk/aws-elasticbeanstalk/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-elasticloadbalancing/package.json b/packages/@aws-cdk/aws-elasticloadbalancing/package.json index 24f25fb2470f8..c36d51c3bf855 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancing/package.json +++ b/packages/@aws-cdk/aws-elasticloadbalancing/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2-actions/package.json b/packages/@aws-cdk/aws-elasticloadbalancingv2-actions/package.json index dc606985d7c17..74b76e86a5795 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2-actions/package.json +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2-actions/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2-targets/package.json b/packages/@aws-cdk/aws-elasticloadbalancingv2-targets/package.json index 51ae07a4caaa7..56b2899f53d28 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2-targets/package.json +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2-targets/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json b/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json index 745b87fb4453f..f29682e106cb2 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-elasticsearch/package.json b/packages/@aws-cdk/aws-elasticsearch/package.json index df7d8934559ea..5fec56dc4dbcd 100644 --- a/packages/@aws-cdk/aws-elasticsearch/package.json +++ b/packages/@aws-cdk/aws-elasticsearch/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-emr/package.json b/packages/@aws-cdk/aws-emr/package.json index 0865f9a31783d..314954fcf0fc1 100644 --- a/packages/@aws-cdk/aws-emr/package.json +++ b/packages/@aws-cdk/aws-emr/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-emrcontainers/package.json b/packages/@aws-cdk/aws-emrcontainers/package.json index c1e102c6a81e6..fd4631e556912 100644 --- a/packages/@aws-cdk/aws-emrcontainers/package.json +++ b/packages/@aws-cdk/aws-emrcontainers/package.json @@ -29,6 +29,9 @@ ], "distName": "aws-cdk.aws-emrcontainers", "module": "aws_cdk.aws_emrcontainers" + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-events-targets/package.json b/packages/@aws-cdk/aws-events-targets/package.json index a4eee23c9a028..c85f8fd6901fc 100644 --- a/packages/@aws-cdk/aws-events-targets/package.json +++ b/packages/@aws-cdk/aws-events-targets/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-events/package.json b/packages/@aws-cdk/aws-events/package.json index 4c8d4fe304598..6bcf475c4d781 100644 --- a/packages/@aws-cdk/aws-events/package.json +++ b/packages/@aws-cdk/aws-events/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-eventschemas/package.json b/packages/@aws-cdk/aws-eventschemas/package.json index c141a1a389382..49a6131577541 100644 --- a/packages/@aws-cdk/aws-eventschemas/package.json +++ b/packages/@aws-cdk/aws-eventschemas/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-fms/package.json b/packages/@aws-cdk/aws-fms/package.json index 352a762f1e877..3d13833e4e281 100644 --- a/packages/@aws-cdk/aws-fms/package.json +++ b/packages/@aws-cdk/aws-fms/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-fsx/package.json b/packages/@aws-cdk/aws-fsx/package.json index f004ef50dc8b4..660bc935fc541 100644 --- a/packages/@aws-cdk/aws-fsx/package.json +++ b/packages/@aws-cdk/aws-fsx/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-gamelift/package.json b/packages/@aws-cdk/aws-gamelift/package.json index 9ce7dd38156cb..98d4075f6676d 100644 --- a/packages/@aws-cdk/aws-gamelift/package.json +++ b/packages/@aws-cdk/aws-gamelift/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-globalaccelerator/package.json b/packages/@aws-cdk/aws-globalaccelerator/package.json index 44d8895ed30a3..d9459d5614b87 100644 --- a/packages/@aws-cdk/aws-globalaccelerator/package.json +++ b/packages/@aws-cdk/aws-globalaccelerator/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-glue/package.json b/packages/@aws-cdk/aws-glue/package.json index 3f6a8fa63ceba..c9d77d17800a9 100644 --- a/packages/@aws-cdk/aws-glue/package.json +++ b/packages/@aws-cdk/aws-glue/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-greengrass/package.json b/packages/@aws-cdk/aws-greengrass/package.json index 666c2f02b99f3..25c696938bf4b 100644 --- a/packages/@aws-cdk/aws-greengrass/package.json +++ b/packages/@aws-cdk/aws-greengrass/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-greengrassv2/package.json b/packages/@aws-cdk/aws-greengrassv2/package.json index 68d9557122c34..8276cbfb9089b 100644 --- a/packages/@aws-cdk/aws-greengrassv2/package.json +++ b/packages/@aws-cdk/aws-greengrassv2/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-guardduty/package.json b/packages/@aws-cdk/aws-guardduty/package.json index 2d772252718cb..8f2b0ed528d3e 100644 --- a/packages/@aws-cdk/aws-guardduty/package.json +++ b/packages/@aws-cdk/aws-guardduty/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-iam/package.json b/packages/@aws-cdk/aws-iam/package.json index 6455688b5c006..2966d569a3cf0 100644 --- a/packages/@aws-cdk/aws-iam/package.json +++ b/packages/@aws-cdk/aws-iam/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true, diff --git a/packages/@aws-cdk/aws-imagebuilder/package.json b/packages/@aws-cdk/aws-imagebuilder/package.json index 25cf2f2c92657..fb93985365240 100644 --- a/packages/@aws-cdk/aws-imagebuilder/package.json +++ b/packages/@aws-cdk/aws-imagebuilder/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-inspector/package.json b/packages/@aws-cdk/aws-inspector/package.json index a94beb9c3ab2e..0e7194581c9e0 100644 --- a/packages/@aws-cdk/aws-inspector/package.json +++ b/packages/@aws-cdk/aws-inspector/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-iot/package.json b/packages/@aws-cdk/aws-iot/package.json index baec64baf8142..11e64173f1773 100644 --- a/packages/@aws-cdk/aws-iot/package.json +++ b/packages/@aws-cdk/aws-iot/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-iot1click/package.json b/packages/@aws-cdk/aws-iot1click/package.json index 4000a6cd6721d..c0e4d9fb42052 100644 --- a/packages/@aws-cdk/aws-iot1click/package.json +++ b/packages/@aws-cdk/aws-iot1click/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-iotanalytics/package.json b/packages/@aws-cdk/aws-iotanalytics/package.json index e3b33ffa331b8..7a3dcf21e839d 100644 --- a/packages/@aws-cdk/aws-iotanalytics/package.json +++ b/packages/@aws-cdk/aws-iotanalytics/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-iotevents/package.json b/packages/@aws-cdk/aws-iotevents/package.json index d0ecd71421f76..81b381d4cc213 100644 --- a/packages/@aws-cdk/aws-iotevents/package.json +++ b/packages/@aws-cdk/aws-iotevents/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-iotsitewise/package.json b/packages/@aws-cdk/aws-iotsitewise/package.json index e7301a75e3f49..d6c4203fa9eb8 100644 --- a/packages/@aws-cdk/aws-iotsitewise/package.json +++ b/packages/@aws-cdk/aws-iotsitewise/package.json @@ -27,6 +27,9 @@ ], "distName": "aws-cdk.aws-iotsitewise", "module": "aws_cdk.aws_iotsitewise" + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-iotthingsgraph/package.json b/packages/@aws-cdk/aws-iotthingsgraph/package.json index 59c5396d37c79..c1aaffe85130e 100644 --- a/packages/@aws-cdk/aws-iotthingsgraph/package.json +++ b/packages/@aws-cdk/aws-iotthingsgraph/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-iotwireless/package.json b/packages/@aws-cdk/aws-iotwireless/package.json index df0a35c2bd8fe..16b78b9a153cf 100644 --- a/packages/@aws-cdk/aws-iotwireless/package.json +++ b/packages/@aws-cdk/aws-iotwireless/package.json @@ -27,6 +27,9 @@ ], "distName": "aws-cdk.aws-iotwireless", "module": "aws_cdk.aws_iotwireless" + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-ivs/package.json b/packages/@aws-cdk/aws-ivs/package.json index ce179233a9efa..d5483238d7799 100644 --- a/packages/@aws-cdk/aws-ivs/package.json +++ b/packages/@aws-cdk/aws-ivs/package.json @@ -27,6 +27,9 @@ ], "distName": "aws-cdk.aws-ivs", "module": "aws_cdk.aws_ivs" + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-kendra/package.json b/packages/@aws-cdk/aws-kendra/package.json index 0ce7d188ea30f..72915b7826bfd 100644 --- a/packages/@aws-cdk/aws-kendra/package.json +++ b/packages/@aws-cdk/aws-kendra/package.json @@ -27,6 +27,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-kinesis/package.json b/packages/@aws-cdk/aws-kinesis/package.json index 3c7fd281d363b..b727a777140b5 100644 --- a/packages/@aws-cdk/aws-kinesis/package.json +++ b/packages/@aws-cdk/aws-kinesis/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-kinesisanalytics-flink/package.json b/packages/@aws-cdk/aws-kinesisanalytics-flink/package.json index 2d28b8fd4df7e..5f3de69220d2c 100644 --- a/packages/@aws-cdk/aws-kinesisanalytics-flink/package.json +++ b/packages/@aws-cdk/aws-kinesisanalytics-flink/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-kinesisanalytics/package.json b/packages/@aws-cdk/aws-kinesisanalytics/package.json index c6b67502056e0..da5370be23c82 100644 --- a/packages/@aws-cdk/aws-kinesisanalytics/package.json +++ b/packages/@aws-cdk/aws-kinesisanalytics/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-kinesisfirehose/package.json b/packages/@aws-cdk/aws-kinesisfirehose/package.json index ae2d309ed8e24..b865a8a275724 100644 --- a/packages/@aws-cdk/aws-kinesisfirehose/package.json +++ b/packages/@aws-cdk/aws-kinesisfirehose/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-kms/package.json b/packages/@aws-cdk/aws-kms/package.json index 272c610530357..ab1904340e3b9 100644 --- a/packages/@aws-cdk/aws-kms/package.json +++ b/packages/@aws-cdk/aws-kms/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-lakeformation/package.json b/packages/@aws-cdk/aws-lakeformation/package.json index 8c3f72401111d..6692d0b8b9d9b 100644 --- a/packages/@aws-cdk/aws-lakeformation/package.json +++ b/packages/@aws-cdk/aws-lakeformation/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-lambda-destinations/package.json b/packages/@aws-cdk/aws-lambda-destinations/package.json index 096ee2f6fc12f..3fb8c155fdbb9 100644 --- a/packages/@aws-cdk/aws-lambda-destinations/package.json +++ b/packages/@aws-cdk/aws-lambda-destinations/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-lambda-event-sources/package.json b/packages/@aws-cdk/aws-lambda-event-sources/package.json index 20112e1029cbf..fe63484cc8489 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/package.json +++ b/packages/@aws-cdk/aws-lambda-event-sources/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-lambda-nodejs/package.json b/packages/@aws-cdk/aws-lambda-nodejs/package.json index 7ae4a7822c113..c66d7d6f80028 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/package.json +++ b/packages/@aws-cdk/aws-lambda-nodejs/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-lambda-python/package.json b/packages/@aws-cdk/aws-lambda-python/package.json index f22b2076ee43f..2a4ba1fc506c5 100644 --- a/packages/@aws-cdk/aws-lambda-python/package.json +++ b/packages/@aws-cdk/aws-lambda-python/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-lambda/package.json b/packages/@aws-cdk/aws-lambda/package.json index 6eab5cd11b870..b182382373ed5 100644 --- a/packages/@aws-cdk/aws-lambda/package.json +++ b/packages/@aws-cdk/aws-lambda/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-licensemanager/package.json b/packages/@aws-cdk/aws-licensemanager/package.json index 951f8982392ab..55041a8fa451b 100644 --- a/packages/@aws-cdk/aws-licensemanager/package.json +++ b/packages/@aws-cdk/aws-licensemanager/package.json @@ -27,6 +27,9 @@ ], "distName": "aws-cdk.aws-licensemanager", "module": "aws_cdk.aws_licensemanager" + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-logs-destinations/package.json b/packages/@aws-cdk/aws-logs-destinations/package.json index a4edf4ce3473b..cccc418850e3d 100644 --- a/packages/@aws-cdk/aws-logs-destinations/package.json +++ b/packages/@aws-cdk/aws-logs-destinations/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-logs/package.json b/packages/@aws-cdk/aws-logs/package.json index c1b3eef36c73b..c28abaf4527b8 100644 --- a/packages/@aws-cdk/aws-logs/package.json +++ b/packages/@aws-cdk/aws-logs/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-lookoutvision/package.json b/packages/@aws-cdk/aws-lookoutvision/package.json index 0a812168e8241..bd44ea2f440d5 100644 --- a/packages/@aws-cdk/aws-lookoutvision/package.json +++ b/packages/@aws-cdk/aws-lookoutvision/package.json @@ -29,6 +29,9 @@ ], "distName": "aws-cdk.aws-lookoutvision", "module": "aws_cdk.aws_lookoutvision" + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-macie/package.json b/packages/@aws-cdk/aws-macie/package.json index 7e2851d383765..5f291ffd74f6d 100644 --- a/packages/@aws-cdk/aws-macie/package.json +++ b/packages/@aws-cdk/aws-macie/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-managedblockchain/package.json b/packages/@aws-cdk/aws-managedblockchain/package.json index c94f2391242fb..85b5289a24cae 100644 --- a/packages/@aws-cdk/aws-managedblockchain/package.json +++ b/packages/@aws-cdk/aws-managedblockchain/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-mediaconnect/package.json b/packages/@aws-cdk/aws-mediaconnect/package.json index dbfd544d52dd2..26ff94e4d3368 100644 --- a/packages/@aws-cdk/aws-mediaconnect/package.json +++ b/packages/@aws-cdk/aws-mediaconnect/package.json @@ -27,6 +27,9 @@ ], "distName": "aws-cdk.aws-mediaconnect", "module": "aws_cdk.aws_mediaconnect" + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-mediaconvert/package.json b/packages/@aws-cdk/aws-mediaconvert/package.json index 938a726f92183..7258732c9d3f3 100644 --- a/packages/@aws-cdk/aws-mediaconvert/package.json +++ b/packages/@aws-cdk/aws-mediaconvert/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-medialive/package.json b/packages/@aws-cdk/aws-medialive/package.json index 16ecfadc7c1bb..a3a2af2dbb0a5 100644 --- a/packages/@aws-cdk/aws-medialive/package.json +++ b/packages/@aws-cdk/aws-medialive/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-mediapackage/package.json b/packages/@aws-cdk/aws-mediapackage/package.json index 40913de5b816e..412cb86ae8c34 100644 --- a/packages/@aws-cdk/aws-mediapackage/package.json +++ b/packages/@aws-cdk/aws-mediapackage/package.json @@ -27,6 +27,9 @@ ], "distName": "aws-cdk.aws-mediapackage", "module": "aws_cdk.aws_mediapackage" + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-mediastore/package.json b/packages/@aws-cdk/aws-mediastore/package.json index 46878264355f9..e6cc1f7678e9d 100644 --- a/packages/@aws-cdk/aws-mediastore/package.json +++ b/packages/@aws-cdk/aws-mediastore/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-msk/package.json b/packages/@aws-cdk/aws-msk/package.json index 939b66619cda7..600f4ac08b66a 100644 --- a/packages/@aws-cdk/aws-msk/package.json +++ b/packages/@aws-cdk/aws-msk/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-mwaa/package.json b/packages/@aws-cdk/aws-mwaa/package.json index 17a5ba80b55f1..6dbdbe857015c 100644 --- a/packages/@aws-cdk/aws-mwaa/package.json +++ b/packages/@aws-cdk/aws-mwaa/package.json @@ -27,6 +27,9 @@ ], "distName": "aws-cdk.aws-mwaa", "module": "aws_cdk.aws_mwaa" + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-neptune/package.json b/packages/@aws-cdk/aws-neptune/package.json index 5afe6d91322a2..3ff5733205c14 100644 --- a/packages/@aws-cdk/aws-neptune/package.json +++ b/packages/@aws-cdk/aws-neptune/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-networkfirewall/package.json b/packages/@aws-cdk/aws-networkfirewall/package.json index 8c218072fe92b..c299212b47fed 100644 --- a/packages/@aws-cdk/aws-networkfirewall/package.json +++ b/packages/@aws-cdk/aws-networkfirewall/package.json @@ -27,6 +27,9 @@ ], "distName": "aws-cdk.aws-networkfirewall", "module": "aws_cdk.aws_networkfirewall" + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-networkmanager/package.json b/packages/@aws-cdk/aws-networkmanager/package.json index 9c38f74d32916..1c4e3aa8bf121 100644 --- a/packages/@aws-cdk/aws-networkmanager/package.json +++ b/packages/@aws-cdk/aws-networkmanager/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-opsworks/package.json b/packages/@aws-cdk/aws-opsworks/package.json index b00cff3b7056e..511c65a9de1e1 100644 --- a/packages/@aws-cdk/aws-opsworks/package.json +++ b/packages/@aws-cdk/aws-opsworks/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-opsworkscm/package.json b/packages/@aws-cdk/aws-opsworkscm/package.json index 3c102533e89dc..81f7723ae1980 100644 --- a/packages/@aws-cdk/aws-opsworkscm/package.json +++ b/packages/@aws-cdk/aws-opsworkscm/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-pinpoint/package.json b/packages/@aws-cdk/aws-pinpoint/package.json index ed7fe94c40090..cd2583693e4ad 100644 --- a/packages/@aws-cdk/aws-pinpoint/package.json +++ b/packages/@aws-cdk/aws-pinpoint/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-pinpointemail/package.json b/packages/@aws-cdk/aws-pinpointemail/package.json index 5f98fa3d04e24..8402543499fa4 100644 --- a/packages/@aws-cdk/aws-pinpointemail/package.json +++ b/packages/@aws-cdk/aws-pinpointemail/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-qldb/package.json b/packages/@aws-cdk/aws-qldb/package.json index 257716f07faea..28f16bf1d9aeb 100644 --- a/packages/@aws-cdk/aws-qldb/package.json +++ b/packages/@aws-cdk/aws-qldb/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-quicksight/package.json b/packages/@aws-cdk/aws-quicksight/package.json index 14526eb10a35a..42dd88878dda4 100644 --- a/packages/@aws-cdk/aws-quicksight/package.json +++ b/packages/@aws-cdk/aws-quicksight/package.json @@ -29,6 +29,9 @@ ], "distName": "aws-cdk.aws-quicksight", "module": "aws_cdk.aws_quicksight" + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-ram/package.json b/packages/@aws-cdk/aws-ram/package.json index 2ca7d27497147..fea7575d2545a 100644 --- a/packages/@aws-cdk/aws-ram/package.json +++ b/packages/@aws-cdk/aws-ram/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-rds/package.json b/packages/@aws-cdk/aws-rds/package.json index 685b5c399b240..acb7935bbf831 100644 --- a/packages/@aws-cdk/aws-rds/package.json +++ b/packages/@aws-cdk/aws-rds/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-redshift/package.json b/packages/@aws-cdk/aws-redshift/package.json index cede50f836f54..90c1f1ef24ca5 100644 --- a/packages/@aws-cdk/aws-redshift/package.json +++ b/packages/@aws-cdk/aws-redshift/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-resourcegroups/package.json b/packages/@aws-cdk/aws-resourcegroups/package.json index bd1848d6681e9..08790196f20da 100644 --- a/packages/@aws-cdk/aws-resourcegroups/package.json +++ b/packages/@aws-cdk/aws-resourcegroups/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-robomaker/package.json b/packages/@aws-cdk/aws-robomaker/package.json index be52d60f6a739..62ad6399b966e 100644 --- a/packages/@aws-cdk/aws-robomaker/package.json +++ b/packages/@aws-cdk/aws-robomaker/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-route53-patterns/package.json b/packages/@aws-cdk/aws-route53-patterns/package.json index b10d3e4ceb714..3c134672acd29 100644 --- a/packages/@aws-cdk/aws-route53-patterns/package.json +++ b/packages/@aws-cdk/aws-route53-patterns/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-route53-targets/package.json b/packages/@aws-cdk/aws-route53-targets/package.json index 08ea2cb9e91f4..6a5c21b1dc50c 100644 --- a/packages/@aws-cdk/aws-route53-targets/package.json +++ b/packages/@aws-cdk/aws-route53-targets/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-route53/package.json b/packages/@aws-cdk/aws-route53/package.json index 9a22737d55347..630a548edf9f3 100644 --- a/packages/@aws-cdk/aws-route53/package.json +++ b/packages/@aws-cdk/aws-route53/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-route53resolver/package.json b/packages/@aws-cdk/aws-route53resolver/package.json index 79142ad18b7ef..ee1b80e364b46 100644 --- a/packages/@aws-cdk/aws-route53resolver/package.json +++ b/packages/@aws-cdk/aws-route53resolver/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-s3-assets/package.json b/packages/@aws-cdk/aws-s3-assets/package.json index 6d03905f64f85..2512ceba1a2d1 100644 --- a/packages/@aws-cdk/aws-s3-assets/package.json +++ b/packages/@aws-cdk/aws-s3-assets/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-s3-deployment/package.json b/packages/@aws-cdk/aws-s3-deployment/package.json index 859b206963e0e..764a47d271fa8 100644 --- a/packages/@aws-cdk/aws-s3-deployment/package.json +++ b/packages/@aws-cdk/aws-s3-deployment/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-s3-notifications/package.json b/packages/@aws-cdk/aws-s3-notifications/package.json index 00d38a536ca6a..eaf5a03583f87 100644 --- a/packages/@aws-cdk/aws-s3-notifications/package.json +++ b/packages/@aws-cdk/aws-s3-notifications/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-s3/package.json b/packages/@aws-cdk/aws-s3/package.json index 23d3345e1bfd5..b9512f5d13d08 100644 --- a/packages/@aws-cdk/aws-s3/package.json +++ b/packages/@aws-cdk/aws-s3/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-sagemaker/package.json b/packages/@aws-cdk/aws-sagemaker/package.json index 532be18efa37d..f486e66e732e8 100644 --- a/packages/@aws-cdk/aws-sagemaker/package.json +++ b/packages/@aws-cdk/aws-sagemaker/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-sam/package.json b/packages/@aws-cdk/aws-sam/package.json index 6643799114182..36629206ad3d4 100644 --- a/packages/@aws-cdk/aws-sam/package.json +++ b/packages/@aws-cdk/aws-sam/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-sdb/package.json b/packages/@aws-cdk/aws-sdb/package.json index 9c1660f111f4b..4f656abde7396 100644 --- a/packages/@aws-cdk/aws-sdb/package.json +++ b/packages/@aws-cdk/aws-sdb/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-secretsmanager/package.json b/packages/@aws-cdk/aws-secretsmanager/package.json index fbd131bf94e89..76524ff14f8be 100644 --- a/packages/@aws-cdk/aws-secretsmanager/package.json +++ b/packages/@aws-cdk/aws-secretsmanager/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-securityhub/package.json b/packages/@aws-cdk/aws-securityhub/package.json index 32dc742b38c9c..af14197f9c5c7 100644 --- a/packages/@aws-cdk/aws-securityhub/package.json +++ b/packages/@aws-cdk/aws-securityhub/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-servicecatalog/package.json b/packages/@aws-cdk/aws-servicecatalog/package.json index 546f615a66693..19979eb682b09 100644 --- a/packages/@aws-cdk/aws-servicecatalog/package.json +++ b/packages/@aws-cdk/aws-servicecatalog/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-servicecatalogappregistry/package.json b/packages/@aws-cdk/aws-servicecatalogappregistry/package.json index 8887c8c0682d6..35ca9be6888e7 100644 --- a/packages/@aws-cdk/aws-servicecatalogappregistry/package.json +++ b/packages/@aws-cdk/aws-servicecatalogappregistry/package.json @@ -29,6 +29,9 @@ ], "distName": "aws-cdk.aws-servicecatalogappregistry", "module": "aws_cdk.aws_servicecatalogappregistry" + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-servicediscovery/package.json b/packages/@aws-cdk/aws-servicediscovery/package.json index 4af44ea9879e1..defd23541af86 100644 --- a/packages/@aws-cdk/aws-servicediscovery/package.json +++ b/packages/@aws-cdk/aws-servicediscovery/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-ses-actions/package.json b/packages/@aws-cdk/aws-ses-actions/package.json index ea141e0c8d37f..76bb6834b8831 100644 --- a/packages/@aws-cdk/aws-ses-actions/package.json +++ b/packages/@aws-cdk/aws-ses-actions/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-ses/package.json b/packages/@aws-cdk/aws-ses/package.json index c4fac8762a988..9ab46b8e509cf 100644 --- a/packages/@aws-cdk/aws-ses/package.json +++ b/packages/@aws-cdk/aws-ses/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-signer/package.json b/packages/@aws-cdk/aws-signer/package.json index f01a984dfdd28..9eb340c641507 100644 --- a/packages/@aws-cdk/aws-signer/package.json +++ b/packages/@aws-cdk/aws-signer/package.json @@ -27,6 +27,9 @@ ], "distName": "aws-cdk.aws-signer", "module": "aws_cdk.aws_signer" + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-sns-subscriptions/package.json b/packages/@aws-cdk/aws-sns-subscriptions/package.json index 354b1c386b44e..f904faebb9abc 100644 --- a/packages/@aws-cdk/aws-sns-subscriptions/package.json +++ b/packages/@aws-cdk/aws-sns-subscriptions/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-sns/package.json b/packages/@aws-cdk/aws-sns/package.json index 4b60a53f24c35..8a8ab0725a4cd 100644 --- a/packages/@aws-cdk/aws-sns/package.json +++ b/packages/@aws-cdk/aws-sns/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "excludeTypescript": [ diff --git a/packages/@aws-cdk/aws-sqs/package.json b/packages/@aws-cdk/aws-sqs/package.json index 7b610c64bb71c..3c74b90fa8e8a 100644 --- a/packages/@aws-cdk/aws-sqs/package.json +++ b/packages/@aws-cdk/aws-sqs/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-ssm/package.json b/packages/@aws-cdk/aws-ssm/package.json index 234d166c9152f..3e59cd6388a8d 100644 --- a/packages/@aws-cdk/aws-ssm/package.json +++ b/packages/@aws-cdk/aws-ssm/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-sso/package.json b/packages/@aws-cdk/aws-sso/package.json index af088e448aff9..3ffd22f0ecc4c 100644 --- a/packages/@aws-cdk/aws-sso/package.json +++ b/packages/@aws-cdk/aws-sso/package.json @@ -27,6 +27,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/package.json b/packages/@aws-cdk/aws-stepfunctions-tasks/package.json index a6137f570b1a3..8f9b3971ac39c 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/package.json +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-stepfunctions/package.json b/packages/@aws-cdk/aws-stepfunctions/package.json index 80035201f8b36..2b1e3423ccc03 100644 --- a/packages/@aws-cdk/aws-stepfunctions/package.json +++ b/packages/@aws-cdk/aws-stepfunctions/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-synthetics/package.json b/packages/@aws-cdk/aws-synthetics/package.json index 3b15e2a0b8ffb..d0a0c5c048744 100644 --- a/packages/@aws-cdk/aws-synthetics/package.json +++ b/packages/@aws-cdk/aws-synthetics/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-timestream/package.json b/packages/@aws-cdk/aws-timestream/package.json index c432583d5cbdb..2df4a88e8a1d4 100644 --- a/packages/@aws-cdk/aws-timestream/package.json +++ b/packages/@aws-cdk/aws-timestream/package.json @@ -27,6 +27,9 @@ ], "distName": "aws-cdk.aws-timestream", "module": "aws_cdk.aws_timestream" + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-transfer/package.json b/packages/@aws-cdk/aws-transfer/package.json index b70fc5929c4c0..e51bfde1aacfc 100644 --- a/packages/@aws-cdk/aws-transfer/package.json +++ b/packages/@aws-cdk/aws-transfer/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-waf/package.json b/packages/@aws-cdk/aws-waf/package.json index ced3ca7dc741b..e51bd568d8486 100644 --- a/packages/@aws-cdk/aws-waf/package.json +++ b/packages/@aws-cdk/aws-waf/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-wafregional/package.json b/packages/@aws-cdk/aws-wafregional/package.json index 8e165fd4169f8..30d570fa37640 100644 --- a/packages/@aws-cdk/aws-wafregional/package.json +++ b/packages/@aws-cdk/aws-wafregional/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-wafv2/package.json b/packages/@aws-cdk/aws-wafv2/package.json index 7bae0807f8209..7d22725e035ec 100644 --- a/packages/@aws-cdk/aws-wafv2/package.json +++ b/packages/@aws-cdk/aws-wafv2/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-workspaces/package.json b/packages/@aws-cdk/aws-workspaces/package.json index d2a3313f491dd..3a06cd07d72e8 100644 --- a/packages/@aws-cdk/aws-workspaces/package.json +++ b/packages/@aws-cdk/aws-workspaces/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/cdk-assets-schema/package.json b/packages/@aws-cdk/cdk-assets-schema/package.json index 272b962c836ad..b756cd7b51f87 100644 --- a/packages/@aws-cdk/cdk-assets-schema/package.json +++ b/packages/@aws-cdk/cdk-assets-schema/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/cloud-assembly-schema/package.json b/packages/@aws-cdk/cloud-assembly-schema/package.json index 724512a094826..c539665e4755e 100644 --- a/packages/@aws-cdk/cloud-assembly-schema/package.json +++ b/packages/@aws-cdk/cloud-assembly-schema/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true, diff --git a/packages/@aws-cdk/cloudformation-include/package.json b/packages/@aws-cdk/cloudformation-include/package.json index ce9716626baee..1998024871a1b 100644 --- a/packages/@aws-cdk/cloudformation-include/package.json +++ b/packages/@aws-cdk/cloudformation-include/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/core/package.json b/packages/@aws-cdk/core/package.json index 643f809bca142..0055887229014 100644 --- a/packages/@aws-cdk/core/package.json +++ b/packages/@aws-cdk/core/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true, diff --git a/packages/@aws-cdk/custom-resources/package.json b/packages/@aws-cdk/custom-resources/package.json index 0044f79eda383..c8b0665031aaa 100644 --- a/packages/@aws-cdk/custom-resources/package.json +++ b/packages/@aws-cdk/custom-resources/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/cx-api/package.json b/packages/@aws-cdk/cx-api/package.json index 9b5c09a9a999d..8d4d98823d63b 100644 --- a/packages/@aws-cdk/cx-api/package.json +++ b/packages/@aws-cdk/cx-api/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true, diff --git a/packages/@aws-cdk/example-construct-library/package.json b/packages/@aws-cdk/example-construct-library/package.json index 762b080eff94a..c4127715431c9 100644 --- a/packages/@aws-cdk/example-construct-library/package.json +++ b/packages/@aws-cdk/example-construct-library/package.json @@ -27,6 +27,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/lambda-layer-awscli/package.json b/packages/@aws-cdk/lambda-layer-awscli/package.json index 115f686f9e414..2c8618c68b821 100644 --- a/packages/@aws-cdk/lambda-layer-awscli/package.json +++ b/packages/@aws-cdk/lambda-layer-awscli/package.json @@ -27,6 +27,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/lambda-layer-kubectl/package.json b/packages/@aws-cdk/lambda-layer-kubectl/package.json index 9ba2b10e89d47..98661b1c8ea56 100644 --- a/packages/@aws-cdk/lambda-layer-kubectl/package.json +++ b/packages/@aws-cdk/lambda-layer-kubectl/package.json @@ -27,6 +27,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/pipelines/package.json b/packages/@aws-cdk/pipelines/package.json index 8717570fc8f1d..dd498c7e3b633 100644 --- a/packages/@aws-cdk/pipelines/package.json +++ b/packages/@aws-cdk/pipelines/package.json @@ -109,6 +109,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/region-info/package.json b/packages/@aws-cdk/region-info/package.json index fe5a7e1acf1ec..bb53f8e1608dd 100644 --- a/packages/@aws-cdk/region-info/package.json +++ b/packages/@aws-cdk/region-info/package.json @@ -26,6 +26,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/yaml-cfn/package.json b/packages/@aws-cdk/yaml-cfn/package.json index 45e121a4cb7f5..e8f6f1c5f629a 100644 --- a/packages/@aws-cdk/yaml-cfn/package.json +++ b/packages/@aws-cdk/yaml-cfn/package.json @@ -45,6 +45,9 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/aws-cdk-lib/package.json b/packages/aws-cdk-lib/package.json index 89dbc64979387..8b55795cf2e66 100644 --- a/packages/aws-cdk-lib/package.json +++ b/packages/aws-cdk-lib/package.json @@ -66,6 +66,9 @@ "python": { "distName": "aws-cdk.lib", "module": "aws_cdk.lib" + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": false diff --git a/packages/monocdk/package.json b/packages/monocdk/package.json index c71d755b3c2bb..b6cdc048a091c 100644 --- a/packages/monocdk/package.json +++ b/packages/monocdk/package.json @@ -71,6 +71,9 @@ "python": { "distName": "monocdk", "module": "monocdk" + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": false diff --git a/tools/pkglint/lib/rules.ts b/tools/pkglint/lib/rules.ts index 1dd32c1c96392..2e0403eb292bd 100644 --- a/tools/pkglint/lib/rules.ts +++ b/tools/pkglint/lib/rules.ts @@ -695,6 +695,20 @@ export class JSIIPythonTarget extends ValidationRule { } } + +export class JSIIGolangTarget extends ValidationRule { + public readonly name = 'jsii/go'; + + public validate(pkg: PackageJson): void { + if (!isJSII(pkg)) { return; } + + const moduleName = cdkModuleName(pkg.json.name); + + // See: https://aws.github.io/jsii/user-guides/lib-author/configuration/targets/go + expectJSON(this.name, pkg, 'jsii.targets.go.moduleName', moduleName.goRepositoryName); + } +} + export class CDKPackage extends ValidationRule { public readonly name = 'package-info/scripts/package'; @@ -869,6 +883,7 @@ function cdkModuleName(name: string) { distName: `aws-cdk.${pythonName}`, module: `aws_cdk.${pythonName.replace(/-/g, '_')}`, }, + goRepositoryName: 'github.com/aws/aws-cdk-go', }; } diff --git a/tools/ubergen/bin/ubergen.ts b/tools/ubergen/bin/ubergen.ts index 9047fc28c371a..110f9261d83b6 100644 --- a/tools/ubergen/bin/ubergen.ts +++ b/tools/ubergen/bin/ubergen.ts @@ -52,6 +52,9 @@ interface PackageJson { readonly module: string; readonly [key: string]: unknown; }, + readonly go?: { + readonly moduleName: string; + }, readonly [language: string]: unknown, }, }; @@ -293,6 +296,11 @@ function transformTargets(monoConfig: PackageJson['jsii']['targets'], targets: P }; } break; + case 'go': + if (monoConfig?.go != null) { + result[language] = monoConfig?.go; + } + break; default: throw new Error(`Unsupported language for submodule configuration translation: ${language}`); } From d3155e97fd9331a4732396941ce4ad20613fe81c Mon Sep 17 00:00:00 2001 From: Andrei Alecu Date: Tue, 2 Mar 2021 14:33:21 +0200 Subject: [PATCH 58/78] fix(elasticloadbalancingv2): should allow more than 2 certificates (#13332) Fixes #13150 > Interestingly, even though the Certificates field is of type Array, the documentation says: You can specify one certificate per resource. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../lib/alb/application-listener.ts | 10 +++-- .../test/alb/listener.test.ts | 37 +++++++++++++++++++ 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener.ts index 1844314e1f560..b72151f81f2f8 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener.ts @@ -263,10 +263,14 @@ export class ApplicationListener extends BaseListener implements IApplicationLis this.certificateArns.push(first.certificateArn); } - if (additionalCerts.length > 0) { - new ApplicationListenerCertificate(this, id, { + // Only one certificate can be specified per resource, even though + // `certificates` is of type Array + for (let i = 0; i < additionalCerts.length; i++) { + // ids should look like: `id`, `id2`, `id3` (for backwards-compatibility) + const certId = (i > 0) ? `${id}${i + 1}` : id; + new ApplicationListenerCertificate(this, certId, { listener: this, - certificates: additionalCerts, + certificates: [additionalCerts[i]], }); } } diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/listener.test.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/listener.test.ts index 3e7b639cb1a8f..b6e379a17e463 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/listener.test.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/listener.test.ts @@ -143,6 +143,43 @@ describe('tests', () => { }); }); + test('HTTPS listener can add more than two certificates', () => { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'Stack'); + const lb = new elbv2.ApplicationLoadBalancer(stack, 'LB', { vpc }); + + // WHEN + const listener = lb.addListener('Listener', { + port: 443, + defaultTargetGroups: [ + new elbv2.ApplicationTargetGroup(stack, 'Group', { vpc, port: 80 }), + ], + certificates: [ + elbv2.ListenerCertificate.fromArn('cert1'), + elbv2.ListenerCertificate.fromArn('cert2'), + elbv2.ListenerCertificate.fromArn('cert3'), + ], + }); + + expect(listener.node.tryFindChild('DefaultCertificates')).toBeDefined(); + expect(listener.node.tryFindChild('DefaultCertificates2')).toBeDefined(); + expect(listener.node.tryFindChild('DefaultCertificates3')).not.toBeDefined(); + + // THEN + expect(stack).toHaveResource('AWS::ElasticLoadBalancingV2::Listener', { + Certificates: [{ CertificateArn: 'cert1' }], + }); + + expect(stack).toHaveResource('AWS::ElasticLoadBalancingV2::ListenerCertificate', { + Certificates: [{ CertificateArn: 'cert2' }], + }); + + expect(stack).toHaveResource('AWS::ElasticLoadBalancingV2::ListenerCertificate', { + Certificates: [{ CertificateArn: 'cert3' }], + }); + }); + test('Can configure targetType on TargetGroups', () => { // GIVEN const stack = new cdk.Stack(); From b3492ccc3e71f375a4dd3462ffff817bd8debcf6 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Tue, 2 Mar 2021 15:09:38 +0100 Subject: [PATCH 59/78] chore(guidelines): add some guidelines around @defaults (#13341) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Explicitly call out against some antipatterns I see being made regularly in contributions. Start adding ✅ positive and ❌ negative examples. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- DESIGN_GUIDELINES.md | 55 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 50 insertions(+), 5 deletions(-) diff --git a/DESIGN_GUIDELINES.md b/DESIGN_GUIDELINES.md index 20fd5be016870..d00f63e453515 100644 --- a/DESIGN_GUIDELINES.md +++ b/DESIGN_GUIDELINES.md @@ -8,6 +8,8 @@ The purpose of this document is to provide guidelines for designing the APIs in the AWS Construct Library in order to ensure a consistent and integrated experience across the entire AWS surface area. +## Preface + As much as possible, the guidelines in this document are enforced using the [**awslint** tool](https://www.npmjs.com/package/awslint) which reflects on the APIs and verifies that the APIs adhere to the guidelines. When a guideline is @@ -333,14 +335,31 @@ from harnessing the full power of the resource, and customizing its behavior. alignment. The **@default** documentation tag must be included on all optional properties -of interfaces. Since there are cases where the default behavior is not a -specific value but rather depends on circumstances/context, the default -documentation tag must always begin with a “**-**" and then include a -description of the default behavior _[awslint:props-default-doc]_. +of interfaces. + +In cases where the default behavior can be described by a value (typically the +case for booleans and enums, sometimes for strings and numbers), the value immediately +follows the **@default** tag and should be a valid JavaScript value (as in: +`@default false`, or `@default "stringValue"`). + +In the majority of cases, the default behavior is not a specific value but +rather depends on circumstances/context. The default documentation tag must +begin with a “**-**" and then include a description of the default behavior +_[awslint:props-default-doc]_. This is specially true if the property +is a complex value or a reference to an object: don't write `@default +undefined`, describe the behavior that happens if the property is not +supplied. -For example: +Describe the default value or default behavior, even if it's not CDK that +controls the default. For example, if an absent value does not get rendered +into the template and it's ultimately the AWS *service* that determines the +default behavior, we still describe it in our documentation. + +Examples: ```ts +// ✅ DO - uses a '-' and describes the behavior + /** * External KMS key to use for bucket encryption. * @@ -350,6 +369,32 @@ For example: encryptionKey?: kms.IEncryptionKey; ``` +```ts +/** + * External KMS key to use for bucket encryption. + * + * @default undefined + * ❌ DO NOT - that the value is 'undefined' by default is implied. However, + * what will the *behavior* be if the value is left out? + */ +encryptionKey?: kms.IEncryptionKey; +``` + +```ts +/** + * Minimum capacity of the AutoScaling resource + * + * @default - no minimum capacity + * ❌ DO NOT - there most certainly is. It's probably 0 or 1. + * + * // OR + * @default - the minimum capacity is the default minimum capacity + * ❌ DO NOT - this is circular and useless to the reader. + * Describe what will actually happen. + */ +minCapacity?: number; +``` + #### Flat Do not introduce artificial nesting for props. It hinders discoverability and From 7b966885a4ced9c1d1404eb60bf47070034ad5d5 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Tue, 2 Mar 2021 16:59:22 +0100 Subject: [PATCH 60/78] chore(guidelines): update the section on error messages (#13345) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- DESIGN_GUIDELINES.md | 127 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 107 insertions(+), 20 deletions(-) diff --git a/DESIGN_GUIDELINES.md b/DESIGN_GUIDELINES.md index d00f63e453515..7fc635960da86 100644 --- a/DESIGN_GUIDELINES.md +++ b/DESIGN_GUIDELINES.md @@ -1261,19 +1261,6 @@ for (const az of availabilityZones) { ### Errors -#### Input Validation - -Prefer to validate input as early as it is passed into your code (ctor, methods, -etc) and bail out by throwing an **Error** (no need to create subclasses of -Error since all errors in the CDK are unrecoverable): - -* All lowercase sentences (usually they are printed after “Error: \”) -* Include a descriptive message -* Include the value provided -* Include the expected/allowed values -* No need to include information that can be obtained from the stack trace -* No need to add a period at the end of error messages - #### Avoid Errors If Possible Always prefer to do the right thing for the user instead of raising an @@ -1282,18 +1269,79 @@ example, VPC has **enableDnsHostnames** and **enableDnsSupport**. DNS hostnames *require* DNS support, so only fail if the user enabled DNS hostnames but explicitly disabled DNS support. Otherwise, auto-enable DNS support for them. +#### Error reporting mechanism + +There are three mechanism you can use to report errors: + +* Eagerly throw an exception (fails synthesis) +* Attach a (lazy) validator to a construct (fails synthesis) +* Attach errors to a construct (succeeds synthesis, fails deployment) + +Between these, the first two fail synthesis, while the latter doesn't. Failing synthesis +means that no Cloud Assembly will be produced. + +The distinction becomes apparent when you consider multiple stacks in the same Cloud +Assembly: + +* If synthesis fails due to an error in *one* stack (either by throwing an exception + or by failing validation), the other stack can also not be deployed. +* In contrast, if you attach an error to a construct in one stack, that stack cannot + be deployed but the other one still can. + +Choose one of the first two methods if the failure is caused by a misuse of the API, +which the user should be alerted to and fix as quickly as possible. Choose attaching +an error to a construct if the failure is due to environmental factors outside the +direct use of the API surface (for example, lack of context provider lookup values). + +#### Throwing exceptions + +This should be the preferred error reporting method. + +Validate input as early as it is passed into your code (ctor, methods, +etc) and bail out by throwing an `Error`. No need to create subclasses of +Error since all errors in the CDK are unrecoverable. + +When validating inputs, don't forget to account for the fact that these +values may be `Token`s and not available for inspection at synthesis time. + +Example: + +```ts +if (!Token.isUnresolved(props.minCapacity) && props.minCapacity < 1) { + throw new Error(`'minCapacity' should be at least 1, got '${props.minCapacity}'`); +} +``` + #### Never Catch Exceptions -All CDK errors are unrecoverable. If a method wishes to signal a recoverable +All CDK errors are unrecoverable. If a method wishes to signal a recoverable error, this should be modeled in a return value and not through exceptions. -#### Post Validation +#### Attaching (lazy) Validators -In the rare case where the integrity of your construct can only be checked right -before synthesis, override the **Construct.validate()** method and return -meaningful errors. Always prefer early input validation over post-validation. +In the rare case where the integrity of your construct can only be checked +after the app has completed its initialization, call the +**this.node.addValidation()** method to add a validation object. This will +generally only be necessary if you want to produce an error when a certain +interaction with your construct did *not* happen (for example, a property +that should have been configured over the lifetime of the construct, wasn't): -#### Attached Errors/Warnings +Always prefer early input validation over post-validation, as the necessity +of these should be rare. + +Example: + +```ts +this.node.addValidation({ + // 'validate' should return a string[] list of errors + validate: () => this.rules.length === 0 + ? ['At least one Rule must be added. Call \'addRule()\' to add Rules.'] + : [] + } +}); +``` + +#### Attaching Errors/Warnings You can also “attach” an error or a warning to a construct via the **Annotations** class. These methods (e.g., `Annotations.of(construct).addWarning`) @@ -1301,7 +1349,46 @@ will attach CDK metadata to your construct, which will be displayed to the user by the toolchain when the stack is deployed. Errors will not allow deployment and warnings will only be displayed in -highlight (unless **--strict** mode is used). +highlight (unless `--strict` mode is used). + +```ts +if (!Token.isUnresolved(subnetIds) && subnetIds.length < 2) { + Annotations.of(this).addError(`Need at least 2 subnet ids, got: ${JSON.stringify(subnetIds)}`); +} +``` + +#### Error messages + +Think about error messages from the point of view of the end user of the CDK. +This is not necessarily someone who knows about the internals of your +construct library, so try to phrase the message in a way that would make +sense to them. + +For example, if a value the user supplied gets handed off between a number of +functions before finally being validated, phrase the message in terms of the +API the user interacted with, not in terms of the internal APIs. + +A good error message should include the following components: + +* What went wrong, in a way that makes sense to a top-level user +* An example of the incorrect value provided (if applicable) +* An example of the expected/allowed values (if applicable) +* The message should explain the (most likely) cause and change the user can + make to rectify the situation + +The message should be all lowercase and not end in a period, or contain +information that can be obtained from the stack trace. + +```ts +// ✅ DO - show the value you got and be specific about what the user should do +`supply at least one of minCapacity or maxCapacity, got ${JSON.stringify(action)}` + +// ❌ DO NOT - this tells the user nothing about what's wrong or what they should do +`required values are missing` + +// ❌ DO NOT - this error only makes sense if you know the implementation +`'undefined' is not a number` +``` ### Tokens From d884a34323915b3f60800d3b4add609974c1a3ca Mon Sep 17 00:00:00 2001 From: Nick Lynch Date: Tue, 2 Mar 2021 16:49:49 +0000 Subject: [PATCH 61/78] chore(guidelines): guidance on which constructs are included in the CDK (#13218) Adding a section of general guidance in the DESIGN_GUIDELINES to explain the L1, L2, and beyond constructs, and what types of behaviors L2s should include versus what types likely belong in separate repositories. This guidance is by no means complete or without controversy. I expect pushback and hope for both more supporting examples as well as counter examples. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- DESIGN_GUIDELINES.md | 127 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) diff --git a/DESIGN_GUIDELINES.md b/DESIGN_GUIDELINES.md index 7fc635960da86..5924ec0321293 100644 --- a/DESIGN_GUIDELINES.md +++ b/DESIGN_GUIDELINES.md @@ -1,5 +1,65 @@ # AWS Construct Library Design Guidelines +- [AWS Construct Library Design Guidelines](#aws-construct-library-design-guidelines) + - [What's Included](#what-s-included) + - [API Design](#api-design) + - [Modules](#modules) + - [Construct Class](#construct-class) + - [Construct Interface](#construct-interface) + - [Owned vs. Unowned Constructs](#owned-vs-unowned-constructs) + - [Abstract Base](#abstract-base) + - [Props](#props) + - [Types](#types) + - [Defaults](#defaults) + - [Flat](#flat) + - [Concise](#concise) + - [Naming](#naming) + - [Property Documentation](#property-documentation) + - [Enums](#enums) + - [Unions](#unions) + - [Attributes](#attributes) + - [Configuration](#configuration) + - [Prefer Additions](#prefer-additions) + - [Dropped Mutations](#dropped-mutations) + - [Factories](#factories) + - [Imports](#imports) + - [“from” Methods](#-from--methods) + - [From-attributes](#from-attributes) + - [Roles](#roles) + - [Resource Policies](#resource-policies) + - [VPC](#vpc) + - [Grants](#grants) + - [Metrics](#metrics) + - [Events](#events) + - [Connections](#connections) + - [Integrations](#integrations) + - [State](#state) + - [Physical Names - TODO](#physical-names---todo) + - [Tags](#tags) + - [Secrets](#secrets) + - [Project Structure](#project-structure) + - [Code Organization](#code-organization) + - [Implementation](#implementation) + - [General Principles](#general-principles) + - [Construct IDs](#construct-ids) + - [Errors](#errors) + - [Input Validation](#input-validation) + - [Avoid Errors If Possible](#avoid-errors-if-possible) + - [Never Catch Exceptions](#never-catch-exceptions) + - [Post Validation](#post-validation) + - [Attached Errors/Warnings](#attached-errors-warnings) + - [Tokens](#tokens) + - [Documentation](#documentation) + - [Inline Documentation](#inline-documentation) + - [Readme](#readme) + - [Testing](#testing) + - [Unit tests](#unit-tests) + - [Integration tests](#integration-tests) + - [Versioning](#versioning) + - [Naming & Style](#naming---style) + - [Naming Conventions](#naming-conventions) + - [Coding Style](#coding-style) + The AWS Construct Library is a rich class library of CDK constructs which represent all resources offered by the AWS Cloud and higher-level constructs for achieving common tasks. @@ -58,6 +118,73 @@ allows the library to be used from all supported programming languages. jsii poses restrictions on language features that cannot be idiomatically represented in target languages. +## What's Included + +The AWS Construct Library, which is shipped as part of the AWS CDK constructs +representing AWS resources. + +The AWS Construct Library has multiple layers of constructs, beginning +with low-level constructs, which we call _CFN Resources_ (or L1, short for +"level 1") or CFN Resources (short for CloudFormation). These constructs +directly represent all resources available in AWS CloudFormation. CFN Resources +are periodically generated from the AWS CloudFormation Resource +Specification. They are named **Cfn**_Xyz_, where _Xyz_ is name of the +resource. For example, CfnBucket represents the AWS::S3::Bucket AWS +CloudFormation resource. When you use Cfn resources, you must explicitly +configure all resource properties, which requires a complete understanding of +the details of the underlying AWS CloudFormation resource model. + +The next level of constructs, L2, also represent AWS resources, but with a +higher-level, intent-based API. They provide similar functionality, but provide +the defaults, boilerplate, and glue logic you'd be writing yourself with a CFN +Resource construct. L2 constructs offer convenient defaults and reduce the need +to know all the details about the AWS resources they represent, while providing +convenience methods that make it simpler to work with the resource. For example, +the `s3.Bucket` class represents an Amazon S3 bucket with additional properties +and methods, such as `bucket.addLifeCycleRule()`, which adds a lifecycle rule to +the bucket. + +Examples of behaviors that an L2 commonly include: + +- Strongly-typed modeling of the underlying L1 properties +- Methods for integrating other AWS resources (e.g., adding an event notification to + an S3 bucket). +- Modeling of permissions and resource policies +- Modeling of metrics + +In addition to the above, some L2s may introduce more complex and +helpful functionality, either part of the original L2 itself, or as part of a +separate construct. The most common form of these L2s are integration constructs +that model interactions between different services (e.g., SNS publishing to SQS, +CodePipeline actions that trigger Lambda functions). + +The next level of abstraction present within the CDK are what we designate as +"L2.5s": a step above the L2s in terms of abstraction, but not quite at the +level of complete patterns or applications. These constructs still largely +focus on a single logical resource -- in constrast to "patterns" which combine +multiple resources -- but are customized for a specific common usage scenario of +an L2. Examples of L2.5s in the CDK are `aws-apigateway.LambdaRestApi`, +`aws-lambda-nodejs.NodeJsFunction`, `aws-rds.ServerlessCluster` and `eks.FargateCluster`. + +L2.5 constructs will be considered for inclusion in the CDK if they... + +- cover a common usage scenario that can be used by a significant portion of + the community; +- provide significant ease of use over the base L2 (via usage-specific defaults + convenience methods or improved strong-typing); +- simplify or enable another L2 within the CDK + +The CDK also currently includes some even higher-level constructs, which we call +patterns. These constructs often involve multiple kinds of resources and are +designed to help you complete common tasks in AWS or represent entire +applications. For example, the +`aws-ecs-patterns.ApplicationLoadBalancedFargateService` construct represents an +architecture that includes an AWS Fargate container cluster employing an +Application Load Balancer (ALB). These patterns are typically difficult to +design to be one-size-fits-all and are best suited to be published as separate +libraries, rather than included directly in the CDK. The patterns that currently +exist in the CDK will be removed in the next CDK major version (CDKv2). + ## API Design ### Modules From ba99ad086e309fe5d11c75351e4b5dbb1f199478 Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Wed, 3 Mar 2021 03:46:28 +0530 Subject: [PATCH 62/78] chore(documentation): Update README.md (#12892) Fix typos in documentation ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-ecs/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/@aws-cdk/aws-ecs/README.md b/packages/@aws-cdk/aws-ecs/README.md index efe5126caf004..09a5ad13c14cd 100644 --- a/packages/@aws-cdk/aws-ecs/README.md +++ b/packages/@aws-cdk/aws-ecs/README.md @@ -67,7 +67,7 @@ one to run tasks on AWS Fargate. Here are the main differences: - **Amazon EC2**: instances are under your control. Complete control of task to host - allocation. Required to specify at least a memory reseration or limit for + allocation. Required to specify at least a memory reservation or limit for every container. Can use Host, Bridge and AwsVpc networking modes. Can attach Classic Load Balancer. Can share volumes between container and host. - **AWS Fargate**: tasks run on AWS-managed instances, AWS manages task to host @@ -175,7 +175,7 @@ cluster.addCapacity('AsgSpot', { When the `ecs.AddCapacityOptions` that you provide has a non-zero `taskDrainTime` (the default) then an SNS topic and Lambda are created to ensure that the cluster's instances have been properly drained of tasks before terminating. The SNS Topic is sent the instance-terminating lifecycle event from the AutoScalingGroup, and the Lambda acts on that event. If you wish to engage [server-side encryption](https://docs.aws.amazon.com/sns/latest/dg/sns-data-encryption.html) for this SNS Topic -then you may do so by providing a KMS key for the `topicEncryptionKey` propery of `ecs.AddCapacityOptions`. +then you may do so by providing a KMS key for the `topicEncryptionKey` property of `ecs.AddCapacityOptions`. ```ts // Given @@ -190,7 +190,7 @@ cluster.addCapacity('ASGEncryptedSNS', { ## Task definitions -A task Definition describes what a single copy of a **task** should look like. +A task definition describes what a single copy of a **task** should look like. A task definition has one or more containers; typically, it has one main container (the *default container* is the first one that's added to the task definition, and it is marked *essential*) and optionally From 84c9960b56b98d365b45399e1f230355c1e87014 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Wed, 3 Mar 2021 10:53:24 +0200 Subject: [PATCH 63/78] chore: revert "produce go bindings (#13317)" (#13362) This reverts commit e8f0c3c0b2baf9d8ef8fe220f701e596f8a04373 due to some issue in go code generation (namely https://github.com/aws/jsii/issues/2638 and https://github.com/aws/jsii/issues/2637) and unacceptable build performance for producing bindings for all CDK modules. Our plan is to fix the relevant issues and only produce go bindings for monocdk instead of all modules. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/alexa-ask/package.json | 3 --- packages/@aws-cdk/app-delivery/package.json | 3 --- packages/@aws-cdk/assets/package.json | 3 --- packages/@aws-cdk/aws-accessanalyzer/package.json | 3 --- packages/@aws-cdk/aws-acmpca/package.json | 3 --- packages/@aws-cdk/aws-amazonmq/package.json | 3 --- packages/@aws-cdk/aws-amplify/package.json | 3 --- packages/@aws-cdk/aws-apigateway/package.json | 3 --- .../aws-apigatewayv2-authorizers/package.json | 3 --- .../aws-apigatewayv2-integrations/package.json | 3 --- packages/@aws-cdk/aws-apigatewayv2/package.json | 3 --- packages/@aws-cdk/aws-appconfig/package.json | 3 --- packages/@aws-cdk/aws-appflow/package.json | 3 --- .../aws-applicationautoscaling/package.json | 3 --- .../@aws-cdk/aws-applicationinsights/package.json | 3 --- packages/@aws-cdk/aws-appmesh/package.json | 3 --- packages/@aws-cdk/aws-appstream/package.json | 3 --- packages/@aws-cdk/aws-appsync/package.json | 3 --- packages/@aws-cdk/aws-athena/package.json | 3 --- packages/@aws-cdk/aws-auditmanager/package.json | 3 --- .../@aws-cdk/aws-autoscaling-common/package.json | 3 --- .../aws-autoscaling-hooktargets/package.json | 3 --- packages/@aws-cdk/aws-autoscaling/package.json | 3 --- .../@aws-cdk/aws-autoscalingplans/package.json | 3 --- packages/@aws-cdk/aws-backup/package.json | 3 --- packages/@aws-cdk/aws-batch/package.json | 3 --- packages/@aws-cdk/aws-budgets/package.json | 3 --- packages/@aws-cdk/aws-cassandra/package.json | 3 --- packages/@aws-cdk/aws-ce/package.json | 3 --- .../@aws-cdk/aws-certificatemanager/package.json | 3 --- packages/@aws-cdk/aws-chatbot/package.json | 3 --- packages/@aws-cdk/aws-cloud9/package.json | 3 --- packages/@aws-cdk/aws-cloudformation/package.json | 3 --- .../@aws-cdk/aws-cloudfront-origins/package.json | 3 --- packages/@aws-cdk/aws-cloudfront/package.json | 3 --- packages/@aws-cdk/aws-cloudtrail/package.json | 3 --- .../@aws-cdk/aws-cloudwatch-actions/package.json | 3 --- packages/@aws-cdk/aws-cloudwatch/package.json | 3 --- packages/@aws-cdk/aws-codeartifact/package.json | 3 --- packages/@aws-cdk/aws-codebuild/package.json | 3 --- packages/@aws-cdk/aws-codecommit/package.json | 3 --- packages/@aws-cdk/aws-codedeploy/package.json | 3 --- .../@aws-cdk/aws-codeguruprofiler/package.json | 3 --- .../@aws-cdk/aws-codegurureviewer/package.json | 3 --- .../aws-codepipeline-actions/package.json | 3 --- packages/@aws-cdk/aws-codepipeline/package.json | 3 --- packages/@aws-cdk/aws-codestar/package.json | 3 --- .../@aws-cdk/aws-codestarconnections/package.json | 3 --- .../aws-codestarnotifications/package.json | 3 --- packages/@aws-cdk/aws-cognito/package.json | 3 --- packages/@aws-cdk/aws-config/package.json | 3 --- packages/@aws-cdk/aws-databrew/package.json | 3 --- packages/@aws-cdk/aws-datapipeline/package.json | 3 --- packages/@aws-cdk/aws-datasync/package.json | 3 --- packages/@aws-cdk/aws-dax/package.json | 3 --- packages/@aws-cdk/aws-detective/package.json | 3 --- packages/@aws-cdk/aws-devopsguru/package.json | 3 --- .../@aws-cdk/aws-directoryservice/package.json | 3 --- packages/@aws-cdk/aws-dlm/package.json | 3 --- packages/@aws-cdk/aws-dms/package.json | 3 --- packages/@aws-cdk/aws-docdb/package.json | 3 --- .../@aws-cdk/aws-dynamodb-global/package.json | 3 --- packages/@aws-cdk/aws-dynamodb/package.json | 3 --- packages/@aws-cdk/aws-ec2/package.json | 3 --- packages/@aws-cdk/aws-ecr-assets/package.json | 3 --- packages/@aws-cdk/aws-ecr/package.json | 3 --- packages/@aws-cdk/aws-ecs-patterns/package.json | 3 --- packages/@aws-cdk/aws-ecs/package.json | 3 --- packages/@aws-cdk/aws-efs/package.json | 3 --- packages/@aws-cdk/aws-eks-legacy/package.json | 3 --- packages/@aws-cdk/aws-eks/package.json | 3 --- packages/@aws-cdk/aws-elasticache/package.json | 3 --- .../@aws-cdk/aws-elasticbeanstalk/package.json | 3 --- .../aws-elasticloadbalancing/package.json | 3 --- .../package.json | 3 --- .../package.json | 3 --- .../aws-elasticloadbalancingv2/package.json | 3 --- packages/@aws-cdk/aws-elasticsearch/package.json | 3 --- packages/@aws-cdk/aws-emr/package.json | 3 --- packages/@aws-cdk/aws-emrcontainers/package.json | 3 --- packages/@aws-cdk/aws-events-targets/package.json | 3 --- packages/@aws-cdk/aws-events/package.json | 3 --- packages/@aws-cdk/aws-eventschemas/package.json | 3 --- packages/@aws-cdk/aws-fms/package.json | 3 --- packages/@aws-cdk/aws-fsx/package.json | 3 --- packages/@aws-cdk/aws-gamelift/package.json | 3 --- .../@aws-cdk/aws-globalaccelerator/package.json | 3 --- packages/@aws-cdk/aws-glue/package.json | 3 --- packages/@aws-cdk/aws-greengrass/package.json | 3 --- packages/@aws-cdk/aws-greengrassv2/package.json | 3 --- packages/@aws-cdk/aws-guardduty/package.json | 3 --- packages/@aws-cdk/aws-iam/package.json | 3 --- packages/@aws-cdk/aws-imagebuilder/package.json | 3 --- packages/@aws-cdk/aws-inspector/package.json | 3 --- packages/@aws-cdk/aws-iot/package.json | 3 --- packages/@aws-cdk/aws-iot1click/package.json | 3 --- packages/@aws-cdk/aws-iotanalytics/package.json | 3 --- packages/@aws-cdk/aws-iotevents/package.json | 3 --- packages/@aws-cdk/aws-iotsitewise/package.json | 3 --- packages/@aws-cdk/aws-iotthingsgraph/package.json | 3 --- packages/@aws-cdk/aws-iotwireless/package.json | 3 --- packages/@aws-cdk/aws-ivs/package.json | 3 --- packages/@aws-cdk/aws-kendra/package.json | 3 --- packages/@aws-cdk/aws-kinesis/package.json | 3 --- .../aws-kinesisanalytics-flink/package.json | 3 --- .../@aws-cdk/aws-kinesisanalytics/package.json | 3 --- .../@aws-cdk/aws-kinesisfirehose/package.json | 3 --- packages/@aws-cdk/aws-kms/package.json | 3 --- packages/@aws-cdk/aws-lakeformation/package.json | 3 --- .../@aws-cdk/aws-lambda-destinations/package.json | 3 --- .../aws-lambda-event-sources/package.json | 3 --- packages/@aws-cdk/aws-lambda-nodejs/package.json | 3 --- packages/@aws-cdk/aws-lambda-python/package.json | 3 --- packages/@aws-cdk/aws-lambda/package.json | 3 --- packages/@aws-cdk/aws-licensemanager/package.json | 3 --- .../@aws-cdk/aws-logs-destinations/package.json | 3 --- packages/@aws-cdk/aws-logs/package.json | 3 --- packages/@aws-cdk/aws-lookoutvision/package.json | 3 --- packages/@aws-cdk/aws-macie/package.json | 3 --- .../@aws-cdk/aws-managedblockchain/package.json | 3 --- packages/@aws-cdk/aws-mediaconnect/package.json | 3 --- packages/@aws-cdk/aws-mediaconvert/package.json | 3 --- packages/@aws-cdk/aws-medialive/package.json | 3 --- packages/@aws-cdk/aws-mediapackage/package.json | 3 --- packages/@aws-cdk/aws-mediastore/package.json | 3 --- packages/@aws-cdk/aws-msk/package.json | 3 --- packages/@aws-cdk/aws-mwaa/package.json | 3 --- packages/@aws-cdk/aws-neptune/package.json | 3 --- .../@aws-cdk/aws-networkfirewall/package.json | 3 --- packages/@aws-cdk/aws-networkmanager/package.json | 3 --- packages/@aws-cdk/aws-opsworks/package.json | 3 --- packages/@aws-cdk/aws-opsworkscm/package.json | 3 --- packages/@aws-cdk/aws-pinpoint/package.json | 3 --- packages/@aws-cdk/aws-pinpointemail/package.json | 3 --- packages/@aws-cdk/aws-qldb/package.json | 3 --- packages/@aws-cdk/aws-quicksight/package.json | 3 --- packages/@aws-cdk/aws-ram/package.json | 3 --- packages/@aws-cdk/aws-rds/package.json | 3 --- packages/@aws-cdk/aws-redshift/package.json | 3 --- packages/@aws-cdk/aws-resourcegroups/package.json | 3 --- packages/@aws-cdk/aws-robomaker/package.json | 3 --- .../@aws-cdk/aws-route53-patterns/package.json | 3 --- .../@aws-cdk/aws-route53-targets/package.json | 3 --- packages/@aws-cdk/aws-route53/package.json | 3 --- .../@aws-cdk/aws-route53resolver/package.json | 3 --- packages/@aws-cdk/aws-s3-assets/package.json | 3 --- packages/@aws-cdk/aws-s3-deployment/package.json | 3 --- .../@aws-cdk/aws-s3-notifications/package.json | 3 --- packages/@aws-cdk/aws-s3/package.json | 3 --- packages/@aws-cdk/aws-sagemaker/package.json | 3 --- packages/@aws-cdk/aws-sam/package.json | 3 --- packages/@aws-cdk/aws-sdb/package.json | 3 --- packages/@aws-cdk/aws-secretsmanager/package.json | 3 --- packages/@aws-cdk/aws-securityhub/package.json | 3 --- packages/@aws-cdk/aws-servicecatalog/package.json | 3 --- .../aws-servicecatalogappregistry/package.json | 3 --- .../@aws-cdk/aws-servicediscovery/package.json | 3 --- packages/@aws-cdk/aws-ses-actions/package.json | 3 --- packages/@aws-cdk/aws-ses/package.json | 3 --- packages/@aws-cdk/aws-signer/package.json | 3 --- .../@aws-cdk/aws-sns-subscriptions/package.json | 3 --- packages/@aws-cdk/aws-sns/package.json | 3 --- packages/@aws-cdk/aws-sqs/package.json | 3 --- packages/@aws-cdk/aws-ssm/package.json | 3 --- packages/@aws-cdk/aws-sso/package.json | 3 --- .../@aws-cdk/aws-stepfunctions-tasks/package.json | 3 --- packages/@aws-cdk/aws-stepfunctions/package.json | 3 --- packages/@aws-cdk/aws-synthetics/package.json | 3 --- packages/@aws-cdk/aws-timestream/package.json | 3 --- packages/@aws-cdk/aws-transfer/package.json | 3 --- packages/@aws-cdk/aws-waf/package.json | 3 --- packages/@aws-cdk/aws-wafregional/package.json | 3 --- packages/@aws-cdk/aws-wafv2/package.json | 3 --- packages/@aws-cdk/aws-workspaces/package.json | 3 --- packages/@aws-cdk/cdk-assets-schema/package.json | 3 --- .../@aws-cdk/cloud-assembly-schema/package.json | 3 --- .../@aws-cdk/cloudformation-include/package.json | 3 --- packages/@aws-cdk/core/package.json | 3 --- packages/@aws-cdk/custom-resources/package.json | 3 --- packages/@aws-cdk/cx-api/package.json | 3 --- .../example-construct-library/package.json | 3 --- .../@aws-cdk/lambda-layer-awscli/package.json | 3 --- .../@aws-cdk/lambda-layer-kubectl/package.json | 3 --- packages/@aws-cdk/pipelines/package.json | 3 --- packages/@aws-cdk/region-info/package.json | 3 --- packages/@aws-cdk/yaml-cfn/package.json | 3 --- packages/aws-cdk-lib/package.json | 3 --- packages/monocdk/package.json | 3 --- tools/pkglint/lib/rules.ts | 15 --------------- tools/ubergen/bin/ubergen.ts | 8 -------- 190 files changed, 587 deletions(-) diff --git a/packages/@aws-cdk/alexa-ask/package.json b/packages/@aws-cdk/alexa-ask/package.json index 3a909a1ee956e..48b5fa2b1e003 100644 --- a/packages/@aws-cdk/alexa-ask/package.json +++ b/packages/@aws-cdk/alexa-ask/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/app-delivery/package.json b/packages/@aws-cdk/app-delivery/package.json index 3fc2590cbdbca..8ac9e9cae6a12 100644 --- a/packages/@aws-cdk/app-delivery/package.json +++ b/packages/@aws-cdk/app-delivery/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "outdir": "dist", diff --git a/packages/@aws-cdk/assets/package.json b/packages/@aws-cdk/assets/package.json index 2b8fc80b52e33..45735a4da140f 100644 --- a/packages/@aws-cdk/assets/package.json +++ b/packages/@aws-cdk/assets/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-accessanalyzer/package.json b/packages/@aws-cdk/aws-accessanalyzer/package.json index 40e4d5401c38c..85c2a0d682662 100644 --- a/packages/@aws-cdk/aws-accessanalyzer/package.json +++ b/packages/@aws-cdk/aws-accessanalyzer/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-acmpca/package.json b/packages/@aws-cdk/aws-acmpca/package.json index 2d19a03f9908e..e0956bffbf2c6 100644 --- a/packages/@aws-cdk/aws-acmpca/package.json +++ b/packages/@aws-cdk/aws-acmpca/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-amazonmq/package.json b/packages/@aws-cdk/aws-amazonmq/package.json index e1e36ddbfbbd4..c9d6412f5effa 100644 --- a/packages/@aws-cdk/aws-amazonmq/package.json +++ b/packages/@aws-cdk/aws-amazonmq/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-amplify/package.json b/packages/@aws-cdk/aws-amplify/package.json index 66788a81af49b..ea1abbde2ba37 100644 --- a/packages/@aws-cdk/aws-amplify/package.json +++ b/packages/@aws-cdk/aws-amplify/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-apigateway/package.json b/packages/@aws-cdk/aws-apigateway/package.json index da2d702ebf166..7465b7d45a6bd 100644 --- a/packages/@aws-cdk/aws-apigateway/package.json +++ b/packages/@aws-cdk/aws-apigateway/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-apigatewayv2-authorizers/package.json b/packages/@aws-cdk/aws-apigatewayv2-authorizers/package.json index 6307d4826ad57..f21b19c75f329 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-authorizers/package.json +++ b/packages/@aws-cdk/aws-apigatewayv2-authorizers/package.json @@ -28,9 +28,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations/package.json b/packages/@aws-cdk/aws-apigatewayv2-integrations/package.json index cb528349ce7a9..c4a3e3039b9a3 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-integrations/package.json +++ b/packages/@aws-cdk/aws-apigatewayv2-integrations/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-apigatewayv2/package.json b/packages/@aws-cdk/aws-apigatewayv2/package.json index 2f4d7d06fb95a..19abb0ca10b3f 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/package.json +++ b/packages/@aws-cdk/aws-apigatewayv2/package.json @@ -30,9 +30,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-appconfig/package.json b/packages/@aws-cdk/aws-appconfig/package.json index 381afb7857101..0836a936f672c 100644 --- a/packages/@aws-cdk/aws-appconfig/package.json +++ b/packages/@aws-cdk/aws-appconfig/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-appflow/package.json b/packages/@aws-cdk/aws-appflow/package.json index 77e328433aab9..6d047b697b394 100644 --- a/packages/@aws-cdk/aws-appflow/package.json +++ b/packages/@aws-cdk/aws-appflow/package.json @@ -27,9 +27,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-applicationautoscaling/package.json b/packages/@aws-cdk/aws-applicationautoscaling/package.json index 62882f605d1e0..71036cd220e5f 100644 --- a/packages/@aws-cdk/aws-applicationautoscaling/package.json +++ b/packages/@aws-cdk/aws-applicationautoscaling/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-applicationinsights/package.json b/packages/@aws-cdk/aws-applicationinsights/package.json index e0ca501a8ffaf..edef6de6de7f0 100644 --- a/packages/@aws-cdk/aws-applicationinsights/package.json +++ b/packages/@aws-cdk/aws-applicationinsights/package.json @@ -27,9 +27,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-appmesh/package.json b/packages/@aws-cdk/aws-appmesh/package.json index 7cb52f62a9419..32176758bd410 100644 --- a/packages/@aws-cdk/aws-appmesh/package.json +++ b/packages/@aws-cdk/aws-appmesh/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-appstream/package.json b/packages/@aws-cdk/aws-appstream/package.json index 0a83be29c807b..e9655519ab834 100644 --- a/packages/@aws-cdk/aws-appstream/package.json +++ b/packages/@aws-cdk/aws-appstream/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-appsync/package.json b/packages/@aws-cdk/aws-appsync/package.json index 89cc21242f08f..f6bfb64813364 100644 --- a/packages/@aws-cdk/aws-appsync/package.json +++ b/packages/@aws-cdk/aws-appsync/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-athena/package.json b/packages/@aws-cdk/aws-athena/package.json index b91cec17dd785..2a3cd7207b97f 100644 --- a/packages/@aws-cdk/aws-athena/package.json +++ b/packages/@aws-cdk/aws-athena/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-auditmanager/package.json b/packages/@aws-cdk/aws-auditmanager/package.json index e56c4bf456efa..b263be5fd8c92 100644 --- a/packages/@aws-cdk/aws-auditmanager/package.json +++ b/packages/@aws-cdk/aws-auditmanager/package.json @@ -27,9 +27,6 @@ ], "distName": "aws-cdk.aws-auditmanager", "module": "aws_cdk.aws_auditmanager" - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-autoscaling-common/package.json b/packages/@aws-cdk/aws-autoscaling-common/package.json index bc6577aaf40ce..644801e0dbc71 100644 --- a/packages/@aws-cdk/aws-autoscaling-common/package.json +++ b/packages/@aws-cdk/aws-autoscaling-common/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-autoscaling-hooktargets/package.json b/packages/@aws-cdk/aws-autoscaling-hooktargets/package.json index ff64d09ecc12d..b15364996c1f3 100644 --- a/packages/@aws-cdk/aws-autoscaling-hooktargets/package.json +++ b/packages/@aws-cdk/aws-autoscaling-hooktargets/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-autoscaling/package.json b/packages/@aws-cdk/aws-autoscaling/package.json index b69f4806808d5..79a8b3e02b967 100644 --- a/packages/@aws-cdk/aws-autoscaling/package.json +++ b/packages/@aws-cdk/aws-autoscaling/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-autoscalingplans/package.json b/packages/@aws-cdk/aws-autoscalingplans/package.json index 34b0c422e75c8..5674f715e2b80 100644 --- a/packages/@aws-cdk/aws-autoscalingplans/package.json +++ b/packages/@aws-cdk/aws-autoscalingplans/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-backup/package.json b/packages/@aws-cdk/aws-backup/package.json index 4e082b94418d0..841f29f929f36 100644 --- a/packages/@aws-cdk/aws-backup/package.json +++ b/packages/@aws-cdk/aws-backup/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-batch/package.json b/packages/@aws-cdk/aws-batch/package.json index 36396cdba598d..0b8f4666ab077 100644 --- a/packages/@aws-cdk/aws-batch/package.json +++ b/packages/@aws-cdk/aws-batch/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-budgets/package.json b/packages/@aws-cdk/aws-budgets/package.json index 399ea38d1eff6..3d8297269395f 100644 --- a/packages/@aws-cdk/aws-budgets/package.json +++ b/packages/@aws-cdk/aws-budgets/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-cassandra/package.json b/packages/@aws-cdk/aws-cassandra/package.json index 505e7ded93585..5b0a317a627d8 100644 --- a/packages/@aws-cdk/aws-cassandra/package.json +++ b/packages/@aws-cdk/aws-cassandra/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-ce/package.json b/packages/@aws-cdk/aws-ce/package.json index abe21ac65f7fa..07c5e186da907 100644 --- a/packages/@aws-cdk/aws-ce/package.json +++ b/packages/@aws-cdk/aws-ce/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-certificatemanager/package.json b/packages/@aws-cdk/aws-certificatemanager/package.json index e153019fb9c2d..96e0787fb06ec 100644 --- a/packages/@aws-cdk/aws-certificatemanager/package.json +++ b/packages/@aws-cdk/aws-certificatemanager/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-chatbot/package.json b/packages/@aws-cdk/aws-chatbot/package.json index 8c3ded8e04e46..ab267bf8f1c0c 100644 --- a/packages/@aws-cdk/aws-chatbot/package.json +++ b/packages/@aws-cdk/aws-chatbot/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-cloud9/package.json b/packages/@aws-cdk/aws-cloud9/package.json index 268fd30187bec..e71b8c60f3bc0 100644 --- a/packages/@aws-cdk/aws-cloud9/package.json +++ b/packages/@aws-cdk/aws-cloud9/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-cloudformation/package.json b/packages/@aws-cdk/aws-cloudformation/package.json index 7aaa445c5a2b1..550bc780b750d 100644 --- a/packages/@aws-cdk/aws-cloudformation/package.json +++ b/packages/@aws-cdk/aws-cloudformation/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-cloudfront-origins/package.json b/packages/@aws-cdk/aws-cloudfront-origins/package.json index 16501e2570b72..d90ce2d097315 100644 --- a/packages/@aws-cdk/aws-cloudfront-origins/package.json +++ b/packages/@aws-cdk/aws-cloudfront-origins/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-cloudfront/package.json b/packages/@aws-cdk/aws-cloudfront/package.json index 6bb5b3c809b2d..75b18c5b95444 100644 --- a/packages/@aws-cdk/aws-cloudfront/package.json +++ b/packages/@aws-cdk/aws-cloudfront/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-cloudtrail/package.json b/packages/@aws-cdk/aws-cloudtrail/package.json index c7ed13060cefa..ce2c1f2e647ed 100644 --- a/packages/@aws-cdk/aws-cloudtrail/package.json +++ b/packages/@aws-cdk/aws-cloudtrail/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-cloudwatch-actions/package.json b/packages/@aws-cdk/aws-cloudwatch-actions/package.json index 26692ec087e2e..04ed6918384c1 100644 --- a/packages/@aws-cdk/aws-cloudwatch-actions/package.json +++ b/packages/@aws-cdk/aws-cloudwatch-actions/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-cloudwatch/package.json b/packages/@aws-cdk/aws-cloudwatch/package.json index b565003e1686e..c974f8fe0199a 100644 --- a/packages/@aws-cdk/aws-cloudwatch/package.json +++ b/packages/@aws-cdk/aws-cloudwatch/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-codeartifact/package.json b/packages/@aws-cdk/aws-codeartifact/package.json index 79138a67407be..e4b8ef3ffaad6 100644 --- a/packages/@aws-cdk/aws-codeartifact/package.json +++ b/packages/@aws-cdk/aws-codeartifact/package.json @@ -27,9 +27,6 @@ ], "distName": "aws-cdk.aws-codeartifact", "module": "aws_cdk.aws_codeartifact" - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-codebuild/package.json b/packages/@aws-cdk/aws-codebuild/package.json index 65ce29c998065..7b268062d474f 100644 --- a/packages/@aws-cdk/aws-codebuild/package.json +++ b/packages/@aws-cdk/aws-codebuild/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-codecommit/package.json b/packages/@aws-cdk/aws-codecommit/package.json index 0855460794c24..0580fab198c85 100644 --- a/packages/@aws-cdk/aws-codecommit/package.json +++ b/packages/@aws-cdk/aws-codecommit/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-codedeploy/package.json b/packages/@aws-cdk/aws-codedeploy/package.json index 9d106edccbe88..257e001f0fdbe 100644 --- a/packages/@aws-cdk/aws-codedeploy/package.json +++ b/packages/@aws-cdk/aws-codedeploy/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-codeguruprofiler/package.json b/packages/@aws-cdk/aws-codeguruprofiler/package.json index c7f23bd383c45..dd7c44d1a3527 100644 --- a/packages/@aws-cdk/aws-codeguruprofiler/package.json +++ b/packages/@aws-cdk/aws-codeguruprofiler/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-codegurureviewer/package.json b/packages/@aws-cdk/aws-codegurureviewer/package.json index 4ef6ef289ba6a..1b75ae00b4682 100644 --- a/packages/@aws-cdk/aws-codegurureviewer/package.json +++ b/packages/@aws-cdk/aws-codegurureviewer/package.json @@ -27,9 +27,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-codepipeline-actions/package.json b/packages/@aws-cdk/aws-codepipeline-actions/package.json index a0788fab0981c..62a7868ece518 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/package.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-codepipeline/package.json b/packages/@aws-cdk/aws-codepipeline/package.json index 5b94a3fd80015..1cc830be83ec6 100644 --- a/packages/@aws-cdk/aws-codepipeline/package.json +++ b/packages/@aws-cdk/aws-codepipeline/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-codestar/package.json b/packages/@aws-cdk/aws-codestar/package.json index 706c0960c34cb..01024a24b1248 100644 --- a/packages/@aws-cdk/aws-codestar/package.json +++ b/packages/@aws-cdk/aws-codestar/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-codestarconnections/package.json b/packages/@aws-cdk/aws-codestarconnections/package.json index 3d1fe00297421..66ab2aab76ea6 100644 --- a/packages/@aws-cdk/aws-codestarconnections/package.json +++ b/packages/@aws-cdk/aws-codestarconnections/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-codestarnotifications/package.json b/packages/@aws-cdk/aws-codestarnotifications/package.json index 97a0d6950ab74..18667b45db8b1 100644 --- a/packages/@aws-cdk/aws-codestarnotifications/package.json +++ b/packages/@aws-cdk/aws-codestarnotifications/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-cognito/package.json b/packages/@aws-cdk/aws-cognito/package.json index 39d3f69986888..c9bae0f953907 100644 --- a/packages/@aws-cdk/aws-cognito/package.json +++ b/packages/@aws-cdk/aws-cognito/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-config/package.json b/packages/@aws-cdk/aws-config/package.json index 87b85e69f03b5..59055c7030216 100644 --- a/packages/@aws-cdk/aws-config/package.json +++ b/packages/@aws-cdk/aws-config/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-databrew/package.json b/packages/@aws-cdk/aws-databrew/package.json index 3acfb720bb672..be8bdfacf71db 100644 --- a/packages/@aws-cdk/aws-databrew/package.json +++ b/packages/@aws-cdk/aws-databrew/package.json @@ -27,9 +27,6 @@ ], "distName": "aws-cdk.aws-databrew", "module": "aws_cdk.aws_databrew" - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-datapipeline/package.json b/packages/@aws-cdk/aws-datapipeline/package.json index fc3c6bad7274e..2e1f552ef864a 100644 --- a/packages/@aws-cdk/aws-datapipeline/package.json +++ b/packages/@aws-cdk/aws-datapipeline/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-datasync/package.json b/packages/@aws-cdk/aws-datasync/package.json index 854167eb58e72..124d3871ae0c3 100644 --- a/packages/@aws-cdk/aws-datasync/package.json +++ b/packages/@aws-cdk/aws-datasync/package.json @@ -27,9 +27,6 @@ ], "distName": "aws-cdk.aws-datasync", "module": "aws_cdk.aws_datasync" - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-dax/package.json b/packages/@aws-cdk/aws-dax/package.json index 8ee1f1d08c1ae..83fecea8535ee 100644 --- a/packages/@aws-cdk/aws-dax/package.json +++ b/packages/@aws-cdk/aws-dax/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-detective/package.json b/packages/@aws-cdk/aws-detective/package.json index 87b9bf0fbc3cd..741eade5dc9e2 100644 --- a/packages/@aws-cdk/aws-detective/package.json +++ b/packages/@aws-cdk/aws-detective/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-devopsguru/package.json b/packages/@aws-cdk/aws-devopsguru/package.json index 57e49f91bdbe6..7632ba1d35cea 100644 --- a/packages/@aws-cdk/aws-devopsguru/package.json +++ b/packages/@aws-cdk/aws-devopsguru/package.json @@ -27,9 +27,6 @@ ], "distName": "aws-cdk.aws-devopsguru", "module": "aws_cdk.aws_devopsguru" - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-directoryservice/package.json b/packages/@aws-cdk/aws-directoryservice/package.json index cb7cb485d2a1b..9be65b5324fff 100644 --- a/packages/@aws-cdk/aws-directoryservice/package.json +++ b/packages/@aws-cdk/aws-directoryservice/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-dlm/package.json b/packages/@aws-cdk/aws-dlm/package.json index 8fceb31c016ac..5829ed6a34e11 100644 --- a/packages/@aws-cdk/aws-dlm/package.json +++ b/packages/@aws-cdk/aws-dlm/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-dms/package.json b/packages/@aws-cdk/aws-dms/package.json index 3942ffcfdb539..1c6f0a473b7b3 100644 --- a/packages/@aws-cdk/aws-dms/package.json +++ b/packages/@aws-cdk/aws-dms/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-docdb/package.json b/packages/@aws-cdk/aws-docdb/package.json index 349953aa08523..658583ff0d644 100644 --- a/packages/@aws-cdk/aws-docdb/package.json +++ b/packages/@aws-cdk/aws-docdb/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-dynamodb-global/package.json b/packages/@aws-cdk/aws-dynamodb-global/package.json index cf1072e375ca4..2a3a41bc29fbb 100644 --- a/packages/@aws-cdk/aws-dynamodb-global/package.json +++ b/packages/@aws-cdk/aws-dynamodb-global/package.json @@ -37,9 +37,6 @@ "namespace": "Amazon.CDK.AWS.DynamoDB.Global", "packageId": "Amazon.CDK.AWS.DynamoDB.Global", "iconUrl": "https://raw.githubusercontent.com/aws/aws-cdk/master/logo/default-256-dark.png" - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-dynamodb/package.json b/packages/@aws-cdk/aws-dynamodb/package.json index 68b2c5d09aa2b..5737a58a67816 100644 --- a/packages/@aws-cdk/aws-dynamodb/package.json +++ b/packages/@aws-cdk/aws-dynamodb/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-ec2/package.json b/packages/@aws-cdk/aws-ec2/package.json index 9be0595fb3dcb..801040d4c7385 100644 --- a/packages/@aws-cdk/aws-ec2/package.json +++ b/packages/@aws-cdk/aws-ec2/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-ecr-assets/package.json b/packages/@aws-cdk/aws-ecr-assets/package.json index 38eb5186ff75d..3d8b54ee08122 100644 --- a/packages/@aws-cdk/aws-ecr-assets/package.json +++ b/packages/@aws-cdk/aws-ecr-assets/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-ecr/package.json b/packages/@aws-cdk/aws-ecr/package.json index 0f83ba1e0f2c6..95a78ae04c522 100644 --- a/packages/@aws-cdk/aws-ecr/package.json +++ b/packages/@aws-cdk/aws-ecr/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-ecs-patterns/package.json b/packages/@aws-cdk/aws-ecs-patterns/package.json index c887907b8b759..dcb4d8b436bda 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/package.json +++ b/packages/@aws-cdk/aws-ecs-patterns/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-ecs/package.json b/packages/@aws-cdk/aws-ecs/package.json index 8facfd0ff7618..ec829127f9e84 100644 --- a/packages/@aws-cdk/aws-ecs/package.json +++ b/packages/@aws-cdk/aws-ecs/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-efs/package.json b/packages/@aws-cdk/aws-efs/package.json index 4a33202117802..6a7cef054b6a2 100644 --- a/packages/@aws-cdk/aws-efs/package.json +++ b/packages/@aws-cdk/aws-efs/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-eks-legacy/package.json b/packages/@aws-cdk/aws-eks-legacy/package.json index 86c0c1b0f8e1d..67078e5830dcf 100644 --- a/packages/@aws-cdk/aws-eks-legacy/package.json +++ b/packages/@aws-cdk/aws-eks-legacy/package.json @@ -27,9 +27,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-eks/package.json b/packages/@aws-cdk/aws-eks/package.json index fa8bcd66b51a7..4d27cbfaac281 100644 --- a/packages/@aws-cdk/aws-eks/package.json +++ b/packages/@aws-cdk/aws-eks/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-elasticache/package.json b/packages/@aws-cdk/aws-elasticache/package.json index ecc3e12df777a..f0b728276adda 100644 --- a/packages/@aws-cdk/aws-elasticache/package.json +++ b/packages/@aws-cdk/aws-elasticache/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-elasticbeanstalk/package.json b/packages/@aws-cdk/aws-elasticbeanstalk/package.json index e82a623313b76..31472f9e21d51 100644 --- a/packages/@aws-cdk/aws-elasticbeanstalk/package.json +++ b/packages/@aws-cdk/aws-elasticbeanstalk/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-elasticloadbalancing/package.json b/packages/@aws-cdk/aws-elasticloadbalancing/package.json index c36d51c3bf855..24f25fb2470f8 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancing/package.json +++ b/packages/@aws-cdk/aws-elasticloadbalancing/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2-actions/package.json b/packages/@aws-cdk/aws-elasticloadbalancingv2-actions/package.json index 74b76e86a5795..dc606985d7c17 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2-actions/package.json +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2-actions/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2-targets/package.json b/packages/@aws-cdk/aws-elasticloadbalancingv2-targets/package.json index 56b2899f53d28..51ae07a4caaa7 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2-targets/package.json +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2-targets/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json b/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json index f29682e106cb2..745b87fb4453f 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-elasticsearch/package.json b/packages/@aws-cdk/aws-elasticsearch/package.json index 5fec56dc4dbcd..df7d8934559ea 100644 --- a/packages/@aws-cdk/aws-elasticsearch/package.json +++ b/packages/@aws-cdk/aws-elasticsearch/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-emr/package.json b/packages/@aws-cdk/aws-emr/package.json index 314954fcf0fc1..0865f9a31783d 100644 --- a/packages/@aws-cdk/aws-emr/package.json +++ b/packages/@aws-cdk/aws-emr/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-emrcontainers/package.json b/packages/@aws-cdk/aws-emrcontainers/package.json index fd4631e556912..c1e102c6a81e6 100644 --- a/packages/@aws-cdk/aws-emrcontainers/package.json +++ b/packages/@aws-cdk/aws-emrcontainers/package.json @@ -29,9 +29,6 @@ ], "distName": "aws-cdk.aws-emrcontainers", "module": "aws_cdk.aws_emrcontainers" - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-events-targets/package.json b/packages/@aws-cdk/aws-events-targets/package.json index c85f8fd6901fc..a4eee23c9a028 100644 --- a/packages/@aws-cdk/aws-events-targets/package.json +++ b/packages/@aws-cdk/aws-events-targets/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-events/package.json b/packages/@aws-cdk/aws-events/package.json index 6bcf475c4d781..4c8d4fe304598 100644 --- a/packages/@aws-cdk/aws-events/package.json +++ b/packages/@aws-cdk/aws-events/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-eventschemas/package.json b/packages/@aws-cdk/aws-eventschemas/package.json index 49a6131577541..c141a1a389382 100644 --- a/packages/@aws-cdk/aws-eventschemas/package.json +++ b/packages/@aws-cdk/aws-eventschemas/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-fms/package.json b/packages/@aws-cdk/aws-fms/package.json index 3d13833e4e281..352a762f1e877 100644 --- a/packages/@aws-cdk/aws-fms/package.json +++ b/packages/@aws-cdk/aws-fms/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-fsx/package.json b/packages/@aws-cdk/aws-fsx/package.json index 660bc935fc541..f004ef50dc8b4 100644 --- a/packages/@aws-cdk/aws-fsx/package.json +++ b/packages/@aws-cdk/aws-fsx/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-gamelift/package.json b/packages/@aws-cdk/aws-gamelift/package.json index 98d4075f6676d..9ce7dd38156cb 100644 --- a/packages/@aws-cdk/aws-gamelift/package.json +++ b/packages/@aws-cdk/aws-gamelift/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-globalaccelerator/package.json b/packages/@aws-cdk/aws-globalaccelerator/package.json index d9459d5614b87..44d8895ed30a3 100644 --- a/packages/@aws-cdk/aws-globalaccelerator/package.json +++ b/packages/@aws-cdk/aws-globalaccelerator/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-glue/package.json b/packages/@aws-cdk/aws-glue/package.json index c9d77d17800a9..3f6a8fa63ceba 100644 --- a/packages/@aws-cdk/aws-glue/package.json +++ b/packages/@aws-cdk/aws-glue/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-greengrass/package.json b/packages/@aws-cdk/aws-greengrass/package.json index 25c696938bf4b..666c2f02b99f3 100644 --- a/packages/@aws-cdk/aws-greengrass/package.json +++ b/packages/@aws-cdk/aws-greengrass/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-greengrassv2/package.json b/packages/@aws-cdk/aws-greengrassv2/package.json index 8276cbfb9089b..68d9557122c34 100644 --- a/packages/@aws-cdk/aws-greengrassv2/package.json +++ b/packages/@aws-cdk/aws-greengrassv2/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-guardduty/package.json b/packages/@aws-cdk/aws-guardduty/package.json index 8f2b0ed528d3e..2d772252718cb 100644 --- a/packages/@aws-cdk/aws-guardduty/package.json +++ b/packages/@aws-cdk/aws-guardduty/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-iam/package.json b/packages/@aws-cdk/aws-iam/package.json index 2966d569a3cf0..6455688b5c006 100644 --- a/packages/@aws-cdk/aws-iam/package.json +++ b/packages/@aws-cdk/aws-iam/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true, diff --git a/packages/@aws-cdk/aws-imagebuilder/package.json b/packages/@aws-cdk/aws-imagebuilder/package.json index fb93985365240..25cf2f2c92657 100644 --- a/packages/@aws-cdk/aws-imagebuilder/package.json +++ b/packages/@aws-cdk/aws-imagebuilder/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-inspector/package.json b/packages/@aws-cdk/aws-inspector/package.json index 0e7194581c9e0..a94beb9c3ab2e 100644 --- a/packages/@aws-cdk/aws-inspector/package.json +++ b/packages/@aws-cdk/aws-inspector/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-iot/package.json b/packages/@aws-cdk/aws-iot/package.json index 11e64173f1773..baec64baf8142 100644 --- a/packages/@aws-cdk/aws-iot/package.json +++ b/packages/@aws-cdk/aws-iot/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-iot1click/package.json b/packages/@aws-cdk/aws-iot1click/package.json index c0e4d9fb42052..4000a6cd6721d 100644 --- a/packages/@aws-cdk/aws-iot1click/package.json +++ b/packages/@aws-cdk/aws-iot1click/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-iotanalytics/package.json b/packages/@aws-cdk/aws-iotanalytics/package.json index 7a3dcf21e839d..e3b33ffa331b8 100644 --- a/packages/@aws-cdk/aws-iotanalytics/package.json +++ b/packages/@aws-cdk/aws-iotanalytics/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-iotevents/package.json b/packages/@aws-cdk/aws-iotevents/package.json index 81b381d4cc213..d0ecd71421f76 100644 --- a/packages/@aws-cdk/aws-iotevents/package.json +++ b/packages/@aws-cdk/aws-iotevents/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-iotsitewise/package.json b/packages/@aws-cdk/aws-iotsitewise/package.json index d6c4203fa9eb8..e7301a75e3f49 100644 --- a/packages/@aws-cdk/aws-iotsitewise/package.json +++ b/packages/@aws-cdk/aws-iotsitewise/package.json @@ -27,9 +27,6 @@ ], "distName": "aws-cdk.aws-iotsitewise", "module": "aws_cdk.aws_iotsitewise" - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-iotthingsgraph/package.json b/packages/@aws-cdk/aws-iotthingsgraph/package.json index c1aaffe85130e..59c5396d37c79 100644 --- a/packages/@aws-cdk/aws-iotthingsgraph/package.json +++ b/packages/@aws-cdk/aws-iotthingsgraph/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-iotwireless/package.json b/packages/@aws-cdk/aws-iotwireless/package.json index 16b78b9a153cf..df0a35c2bd8fe 100644 --- a/packages/@aws-cdk/aws-iotwireless/package.json +++ b/packages/@aws-cdk/aws-iotwireless/package.json @@ -27,9 +27,6 @@ ], "distName": "aws-cdk.aws-iotwireless", "module": "aws_cdk.aws_iotwireless" - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-ivs/package.json b/packages/@aws-cdk/aws-ivs/package.json index d5483238d7799..ce179233a9efa 100644 --- a/packages/@aws-cdk/aws-ivs/package.json +++ b/packages/@aws-cdk/aws-ivs/package.json @@ -27,9 +27,6 @@ ], "distName": "aws-cdk.aws-ivs", "module": "aws_cdk.aws_ivs" - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-kendra/package.json b/packages/@aws-cdk/aws-kendra/package.json index 72915b7826bfd..0ce7d188ea30f 100644 --- a/packages/@aws-cdk/aws-kendra/package.json +++ b/packages/@aws-cdk/aws-kendra/package.json @@ -27,9 +27,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-kinesis/package.json b/packages/@aws-cdk/aws-kinesis/package.json index b727a777140b5..3c7fd281d363b 100644 --- a/packages/@aws-cdk/aws-kinesis/package.json +++ b/packages/@aws-cdk/aws-kinesis/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-kinesisanalytics-flink/package.json b/packages/@aws-cdk/aws-kinesisanalytics-flink/package.json index 5f3de69220d2c..2d28b8fd4df7e 100644 --- a/packages/@aws-cdk/aws-kinesisanalytics-flink/package.json +++ b/packages/@aws-cdk/aws-kinesisanalytics-flink/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-kinesisanalytics/package.json b/packages/@aws-cdk/aws-kinesisanalytics/package.json index da5370be23c82..c6b67502056e0 100644 --- a/packages/@aws-cdk/aws-kinesisanalytics/package.json +++ b/packages/@aws-cdk/aws-kinesisanalytics/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-kinesisfirehose/package.json b/packages/@aws-cdk/aws-kinesisfirehose/package.json index b865a8a275724..ae2d309ed8e24 100644 --- a/packages/@aws-cdk/aws-kinesisfirehose/package.json +++ b/packages/@aws-cdk/aws-kinesisfirehose/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-kms/package.json b/packages/@aws-cdk/aws-kms/package.json index ab1904340e3b9..272c610530357 100644 --- a/packages/@aws-cdk/aws-kms/package.json +++ b/packages/@aws-cdk/aws-kms/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-lakeformation/package.json b/packages/@aws-cdk/aws-lakeformation/package.json index 6692d0b8b9d9b..8c3f72401111d 100644 --- a/packages/@aws-cdk/aws-lakeformation/package.json +++ b/packages/@aws-cdk/aws-lakeformation/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-lambda-destinations/package.json b/packages/@aws-cdk/aws-lambda-destinations/package.json index 3fb8c155fdbb9..096ee2f6fc12f 100644 --- a/packages/@aws-cdk/aws-lambda-destinations/package.json +++ b/packages/@aws-cdk/aws-lambda-destinations/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-lambda-event-sources/package.json b/packages/@aws-cdk/aws-lambda-event-sources/package.json index fe63484cc8489..20112e1029cbf 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/package.json +++ b/packages/@aws-cdk/aws-lambda-event-sources/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-lambda-nodejs/package.json b/packages/@aws-cdk/aws-lambda-nodejs/package.json index c66d7d6f80028..7ae4a7822c113 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/package.json +++ b/packages/@aws-cdk/aws-lambda-nodejs/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-lambda-python/package.json b/packages/@aws-cdk/aws-lambda-python/package.json index 2a4ba1fc506c5..f22b2076ee43f 100644 --- a/packages/@aws-cdk/aws-lambda-python/package.json +++ b/packages/@aws-cdk/aws-lambda-python/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-lambda/package.json b/packages/@aws-cdk/aws-lambda/package.json index b182382373ed5..6eab5cd11b870 100644 --- a/packages/@aws-cdk/aws-lambda/package.json +++ b/packages/@aws-cdk/aws-lambda/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-licensemanager/package.json b/packages/@aws-cdk/aws-licensemanager/package.json index 55041a8fa451b..951f8982392ab 100644 --- a/packages/@aws-cdk/aws-licensemanager/package.json +++ b/packages/@aws-cdk/aws-licensemanager/package.json @@ -27,9 +27,6 @@ ], "distName": "aws-cdk.aws-licensemanager", "module": "aws_cdk.aws_licensemanager" - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-logs-destinations/package.json b/packages/@aws-cdk/aws-logs-destinations/package.json index cccc418850e3d..a4edf4ce3473b 100644 --- a/packages/@aws-cdk/aws-logs-destinations/package.json +++ b/packages/@aws-cdk/aws-logs-destinations/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-logs/package.json b/packages/@aws-cdk/aws-logs/package.json index c28abaf4527b8..c1b3eef36c73b 100644 --- a/packages/@aws-cdk/aws-logs/package.json +++ b/packages/@aws-cdk/aws-logs/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-lookoutvision/package.json b/packages/@aws-cdk/aws-lookoutvision/package.json index bd44ea2f440d5..0a812168e8241 100644 --- a/packages/@aws-cdk/aws-lookoutvision/package.json +++ b/packages/@aws-cdk/aws-lookoutvision/package.json @@ -29,9 +29,6 @@ ], "distName": "aws-cdk.aws-lookoutvision", "module": "aws_cdk.aws_lookoutvision" - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-macie/package.json b/packages/@aws-cdk/aws-macie/package.json index 5f291ffd74f6d..7e2851d383765 100644 --- a/packages/@aws-cdk/aws-macie/package.json +++ b/packages/@aws-cdk/aws-macie/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-managedblockchain/package.json b/packages/@aws-cdk/aws-managedblockchain/package.json index 85b5289a24cae..c94f2391242fb 100644 --- a/packages/@aws-cdk/aws-managedblockchain/package.json +++ b/packages/@aws-cdk/aws-managedblockchain/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-mediaconnect/package.json b/packages/@aws-cdk/aws-mediaconnect/package.json index 26ff94e4d3368..dbfd544d52dd2 100644 --- a/packages/@aws-cdk/aws-mediaconnect/package.json +++ b/packages/@aws-cdk/aws-mediaconnect/package.json @@ -27,9 +27,6 @@ ], "distName": "aws-cdk.aws-mediaconnect", "module": "aws_cdk.aws_mediaconnect" - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-mediaconvert/package.json b/packages/@aws-cdk/aws-mediaconvert/package.json index 7258732c9d3f3..938a726f92183 100644 --- a/packages/@aws-cdk/aws-mediaconvert/package.json +++ b/packages/@aws-cdk/aws-mediaconvert/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-medialive/package.json b/packages/@aws-cdk/aws-medialive/package.json index a3a2af2dbb0a5..16ecfadc7c1bb 100644 --- a/packages/@aws-cdk/aws-medialive/package.json +++ b/packages/@aws-cdk/aws-medialive/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-mediapackage/package.json b/packages/@aws-cdk/aws-mediapackage/package.json index 412cb86ae8c34..40913de5b816e 100644 --- a/packages/@aws-cdk/aws-mediapackage/package.json +++ b/packages/@aws-cdk/aws-mediapackage/package.json @@ -27,9 +27,6 @@ ], "distName": "aws-cdk.aws-mediapackage", "module": "aws_cdk.aws_mediapackage" - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-mediastore/package.json b/packages/@aws-cdk/aws-mediastore/package.json index e6cc1f7678e9d..46878264355f9 100644 --- a/packages/@aws-cdk/aws-mediastore/package.json +++ b/packages/@aws-cdk/aws-mediastore/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-msk/package.json b/packages/@aws-cdk/aws-msk/package.json index 600f4ac08b66a..939b66619cda7 100644 --- a/packages/@aws-cdk/aws-msk/package.json +++ b/packages/@aws-cdk/aws-msk/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-mwaa/package.json b/packages/@aws-cdk/aws-mwaa/package.json index 6dbdbe857015c..17a5ba80b55f1 100644 --- a/packages/@aws-cdk/aws-mwaa/package.json +++ b/packages/@aws-cdk/aws-mwaa/package.json @@ -27,9 +27,6 @@ ], "distName": "aws-cdk.aws-mwaa", "module": "aws_cdk.aws_mwaa" - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-neptune/package.json b/packages/@aws-cdk/aws-neptune/package.json index 3ff5733205c14..5afe6d91322a2 100644 --- a/packages/@aws-cdk/aws-neptune/package.json +++ b/packages/@aws-cdk/aws-neptune/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-networkfirewall/package.json b/packages/@aws-cdk/aws-networkfirewall/package.json index c299212b47fed..8c218072fe92b 100644 --- a/packages/@aws-cdk/aws-networkfirewall/package.json +++ b/packages/@aws-cdk/aws-networkfirewall/package.json @@ -27,9 +27,6 @@ ], "distName": "aws-cdk.aws-networkfirewall", "module": "aws_cdk.aws_networkfirewall" - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-networkmanager/package.json b/packages/@aws-cdk/aws-networkmanager/package.json index 1c4e3aa8bf121..9c38f74d32916 100644 --- a/packages/@aws-cdk/aws-networkmanager/package.json +++ b/packages/@aws-cdk/aws-networkmanager/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-opsworks/package.json b/packages/@aws-cdk/aws-opsworks/package.json index 511c65a9de1e1..b00cff3b7056e 100644 --- a/packages/@aws-cdk/aws-opsworks/package.json +++ b/packages/@aws-cdk/aws-opsworks/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-opsworkscm/package.json b/packages/@aws-cdk/aws-opsworkscm/package.json index 81f7723ae1980..3c102533e89dc 100644 --- a/packages/@aws-cdk/aws-opsworkscm/package.json +++ b/packages/@aws-cdk/aws-opsworkscm/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-pinpoint/package.json b/packages/@aws-cdk/aws-pinpoint/package.json index cd2583693e4ad..ed7fe94c40090 100644 --- a/packages/@aws-cdk/aws-pinpoint/package.json +++ b/packages/@aws-cdk/aws-pinpoint/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-pinpointemail/package.json b/packages/@aws-cdk/aws-pinpointemail/package.json index 8402543499fa4..5f98fa3d04e24 100644 --- a/packages/@aws-cdk/aws-pinpointemail/package.json +++ b/packages/@aws-cdk/aws-pinpointemail/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-qldb/package.json b/packages/@aws-cdk/aws-qldb/package.json index 28f16bf1d9aeb..257716f07faea 100644 --- a/packages/@aws-cdk/aws-qldb/package.json +++ b/packages/@aws-cdk/aws-qldb/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-quicksight/package.json b/packages/@aws-cdk/aws-quicksight/package.json index 42dd88878dda4..14526eb10a35a 100644 --- a/packages/@aws-cdk/aws-quicksight/package.json +++ b/packages/@aws-cdk/aws-quicksight/package.json @@ -29,9 +29,6 @@ ], "distName": "aws-cdk.aws-quicksight", "module": "aws_cdk.aws_quicksight" - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-ram/package.json b/packages/@aws-cdk/aws-ram/package.json index fea7575d2545a..2ca7d27497147 100644 --- a/packages/@aws-cdk/aws-ram/package.json +++ b/packages/@aws-cdk/aws-ram/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-rds/package.json b/packages/@aws-cdk/aws-rds/package.json index acb7935bbf831..685b5c399b240 100644 --- a/packages/@aws-cdk/aws-rds/package.json +++ b/packages/@aws-cdk/aws-rds/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-redshift/package.json b/packages/@aws-cdk/aws-redshift/package.json index 90c1f1ef24ca5..cede50f836f54 100644 --- a/packages/@aws-cdk/aws-redshift/package.json +++ b/packages/@aws-cdk/aws-redshift/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-resourcegroups/package.json b/packages/@aws-cdk/aws-resourcegroups/package.json index 08790196f20da..bd1848d6681e9 100644 --- a/packages/@aws-cdk/aws-resourcegroups/package.json +++ b/packages/@aws-cdk/aws-resourcegroups/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-robomaker/package.json b/packages/@aws-cdk/aws-robomaker/package.json index 62ad6399b966e..be52d60f6a739 100644 --- a/packages/@aws-cdk/aws-robomaker/package.json +++ b/packages/@aws-cdk/aws-robomaker/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-route53-patterns/package.json b/packages/@aws-cdk/aws-route53-patterns/package.json index 3c134672acd29..b10d3e4ceb714 100644 --- a/packages/@aws-cdk/aws-route53-patterns/package.json +++ b/packages/@aws-cdk/aws-route53-patterns/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-route53-targets/package.json b/packages/@aws-cdk/aws-route53-targets/package.json index 6a5c21b1dc50c..08ea2cb9e91f4 100644 --- a/packages/@aws-cdk/aws-route53-targets/package.json +++ b/packages/@aws-cdk/aws-route53-targets/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-route53/package.json b/packages/@aws-cdk/aws-route53/package.json index 630a548edf9f3..9a22737d55347 100644 --- a/packages/@aws-cdk/aws-route53/package.json +++ b/packages/@aws-cdk/aws-route53/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-route53resolver/package.json b/packages/@aws-cdk/aws-route53resolver/package.json index ee1b80e364b46..79142ad18b7ef 100644 --- a/packages/@aws-cdk/aws-route53resolver/package.json +++ b/packages/@aws-cdk/aws-route53resolver/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-s3-assets/package.json b/packages/@aws-cdk/aws-s3-assets/package.json index 2512ceba1a2d1..6d03905f64f85 100644 --- a/packages/@aws-cdk/aws-s3-assets/package.json +++ b/packages/@aws-cdk/aws-s3-assets/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-s3-deployment/package.json b/packages/@aws-cdk/aws-s3-deployment/package.json index 764a47d271fa8..859b206963e0e 100644 --- a/packages/@aws-cdk/aws-s3-deployment/package.json +++ b/packages/@aws-cdk/aws-s3-deployment/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-s3-notifications/package.json b/packages/@aws-cdk/aws-s3-notifications/package.json index eaf5a03583f87..00d38a536ca6a 100644 --- a/packages/@aws-cdk/aws-s3-notifications/package.json +++ b/packages/@aws-cdk/aws-s3-notifications/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-s3/package.json b/packages/@aws-cdk/aws-s3/package.json index b9512f5d13d08..23d3345e1bfd5 100644 --- a/packages/@aws-cdk/aws-s3/package.json +++ b/packages/@aws-cdk/aws-s3/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-sagemaker/package.json b/packages/@aws-cdk/aws-sagemaker/package.json index f486e66e732e8..532be18efa37d 100644 --- a/packages/@aws-cdk/aws-sagemaker/package.json +++ b/packages/@aws-cdk/aws-sagemaker/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-sam/package.json b/packages/@aws-cdk/aws-sam/package.json index 36629206ad3d4..6643799114182 100644 --- a/packages/@aws-cdk/aws-sam/package.json +++ b/packages/@aws-cdk/aws-sam/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-sdb/package.json b/packages/@aws-cdk/aws-sdb/package.json index 4f656abde7396..9c1660f111f4b 100644 --- a/packages/@aws-cdk/aws-sdb/package.json +++ b/packages/@aws-cdk/aws-sdb/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-secretsmanager/package.json b/packages/@aws-cdk/aws-secretsmanager/package.json index 76524ff14f8be..fbd131bf94e89 100644 --- a/packages/@aws-cdk/aws-secretsmanager/package.json +++ b/packages/@aws-cdk/aws-secretsmanager/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-securityhub/package.json b/packages/@aws-cdk/aws-securityhub/package.json index af14197f9c5c7..32dc742b38c9c 100644 --- a/packages/@aws-cdk/aws-securityhub/package.json +++ b/packages/@aws-cdk/aws-securityhub/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-servicecatalog/package.json b/packages/@aws-cdk/aws-servicecatalog/package.json index 19979eb682b09..546f615a66693 100644 --- a/packages/@aws-cdk/aws-servicecatalog/package.json +++ b/packages/@aws-cdk/aws-servicecatalog/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-servicecatalogappregistry/package.json b/packages/@aws-cdk/aws-servicecatalogappregistry/package.json index 35ca9be6888e7..8887c8c0682d6 100644 --- a/packages/@aws-cdk/aws-servicecatalogappregistry/package.json +++ b/packages/@aws-cdk/aws-servicecatalogappregistry/package.json @@ -29,9 +29,6 @@ ], "distName": "aws-cdk.aws-servicecatalogappregistry", "module": "aws_cdk.aws_servicecatalogappregistry" - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-servicediscovery/package.json b/packages/@aws-cdk/aws-servicediscovery/package.json index defd23541af86..4af44ea9879e1 100644 --- a/packages/@aws-cdk/aws-servicediscovery/package.json +++ b/packages/@aws-cdk/aws-servicediscovery/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-ses-actions/package.json b/packages/@aws-cdk/aws-ses-actions/package.json index 76bb6834b8831..ea141e0c8d37f 100644 --- a/packages/@aws-cdk/aws-ses-actions/package.json +++ b/packages/@aws-cdk/aws-ses-actions/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-ses/package.json b/packages/@aws-cdk/aws-ses/package.json index 9ab46b8e509cf..c4fac8762a988 100644 --- a/packages/@aws-cdk/aws-ses/package.json +++ b/packages/@aws-cdk/aws-ses/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-signer/package.json b/packages/@aws-cdk/aws-signer/package.json index 9eb340c641507..f01a984dfdd28 100644 --- a/packages/@aws-cdk/aws-signer/package.json +++ b/packages/@aws-cdk/aws-signer/package.json @@ -27,9 +27,6 @@ ], "distName": "aws-cdk.aws-signer", "module": "aws_cdk.aws_signer" - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-sns-subscriptions/package.json b/packages/@aws-cdk/aws-sns-subscriptions/package.json index f904faebb9abc..354b1c386b44e 100644 --- a/packages/@aws-cdk/aws-sns-subscriptions/package.json +++ b/packages/@aws-cdk/aws-sns-subscriptions/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-sns/package.json b/packages/@aws-cdk/aws-sns/package.json index 8a8ab0725a4cd..4b60a53f24c35 100644 --- a/packages/@aws-cdk/aws-sns/package.json +++ b/packages/@aws-cdk/aws-sns/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "excludeTypescript": [ diff --git a/packages/@aws-cdk/aws-sqs/package.json b/packages/@aws-cdk/aws-sqs/package.json index 3c74b90fa8e8a..7b610c64bb71c 100644 --- a/packages/@aws-cdk/aws-sqs/package.json +++ b/packages/@aws-cdk/aws-sqs/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-ssm/package.json b/packages/@aws-cdk/aws-ssm/package.json index 3e59cd6388a8d..234d166c9152f 100644 --- a/packages/@aws-cdk/aws-ssm/package.json +++ b/packages/@aws-cdk/aws-ssm/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-sso/package.json b/packages/@aws-cdk/aws-sso/package.json index 3ffd22f0ecc4c..af088e448aff9 100644 --- a/packages/@aws-cdk/aws-sso/package.json +++ b/packages/@aws-cdk/aws-sso/package.json @@ -27,9 +27,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/package.json b/packages/@aws-cdk/aws-stepfunctions-tasks/package.json index 8f9b3971ac39c..a6137f570b1a3 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/package.json +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-stepfunctions/package.json b/packages/@aws-cdk/aws-stepfunctions/package.json index 2b1e3423ccc03..80035201f8b36 100644 --- a/packages/@aws-cdk/aws-stepfunctions/package.json +++ b/packages/@aws-cdk/aws-stepfunctions/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-synthetics/package.json b/packages/@aws-cdk/aws-synthetics/package.json index d0a0c5c048744..3b15e2a0b8ffb 100644 --- a/packages/@aws-cdk/aws-synthetics/package.json +++ b/packages/@aws-cdk/aws-synthetics/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-timestream/package.json b/packages/@aws-cdk/aws-timestream/package.json index 2df4a88e8a1d4..c432583d5cbdb 100644 --- a/packages/@aws-cdk/aws-timestream/package.json +++ b/packages/@aws-cdk/aws-timestream/package.json @@ -27,9 +27,6 @@ ], "distName": "aws-cdk.aws-timestream", "module": "aws_cdk.aws_timestream" - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } } }, diff --git a/packages/@aws-cdk/aws-transfer/package.json b/packages/@aws-cdk/aws-transfer/package.json index e51bfde1aacfc..b70fc5929c4c0 100644 --- a/packages/@aws-cdk/aws-transfer/package.json +++ b/packages/@aws-cdk/aws-transfer/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-waf/package.json b/packages/@aws-cdk/aws-waf/package.json index e51bd568d8486..ced3ca7dc741b 100644 --- a/packages/@aws-cdk/aws-waf/package.json +++ b/packages/@aws-cdk/aws-waf/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-wafregional/package.json b/packages/@aws-cdk/aws-wafregional/package.json index 30d570fa37640..8e165fd4169f8 100644 --- a/packages/@aws-cdk/aws-wafregional/package.json +++ b/packages/@aws-cdk/aws-wafregional/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-wafv2/package.json b/packages/@aws-cdk/aws-wafv2/package.json index 7d22725e035ec..7bae0807f8209 100644 --- a/packages/@aws-cdk/aws-wafv2/package.json +++ b/packages/@aws-cdk/aws-wafv2/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/aws-workspaces/package.json b/packages/@aws-cdk/aws-workspaces/package.json index 3a06cd07d72e8..d2a3313f491dd 100644 --- a/packages/@aws-cdk/aws-workspaces/package.json +++ b/packages/@aws-cdk/aws-workspaces/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/cdk-assets-schema/package.json b/packages/@aws-cdk/cdk-assets-schema/package.json index b756cd7b51f87..272b962c836ad 100644 --- a/packages/@aws-cdk/cdk-assets-schema/package.json +++ b/packages/@aws-cdk/cdk-assets-schema/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/cloud-assembly-schema/package.json b/packages/@aws-cdk/cloud-assembly-schema/package.json index c539665e4755e..724512a094826 100644 --- a/packages/@aws-cdk/cloud-assembly-schema/package.json +++ b/packages/@aws-cdk/cloud-assembly-schema/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true, diff --git a/packages/@aws-cdk/cloudformation-include/package.json b/packages/@aws-cdk/cloudformation-include/package.json index 1998024871a1b..ce9716626baee 100644 --- a/packages/@aws-cdk/cloudformation-include/package.json +++ b/packages/@aws-cdk/cloudformation-include/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/core/package.json b/packages/@aws-cdk/core/package.json index 0055887229014..643f809bca142 100644 --- a/packages/@aws-cdk/core/package.json +++ b/packages/@aws-cdk/core/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true, diff --git a/packages/@aws-cdk/custom-resources/package.json b/packages/@aws-cdk/custom-resources/package.json index c8b0665031aaa..0044f79eda383 100644 --- a/packages/@aws-cdk/custom-resources/package.json +++ b/packages/@aws-cdk/custom-resources/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/cx-api/package.json b/packages/@aws-cdk/cx-api/package.json index 8d4d98823d63b..9b5c09a9a999d 100644 --- a/packages/@aws-cdk/cx-api/package.json +++ b/packages/@aws-cdk/cx-api/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true, diff --git a/packages/@aws-cdk/example-construct-library/package.json b/packages/@aws-cdk/example-construct-library/package.json index c4127715431c9..762b080eff94a 100644 --- a/packages/@aws-cdk/example-construct-library/package.json +++ b/packages/@aws-cdk/example-construct-library/package.json @@ -27,9 +27,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/lambda-layer-awscli/package.json b/packages/@aws-cdk/lambda-layer-awscli/package.json index 2c8618c68b821..115f686f9e414 100644 --- a/packages/@aws-cdk/lambda-layer-awscli/package.json +++ b/packages/@aws-cdk/lambda-layer-awscli/package.json @@ -27,9 +27,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/lambda-layer-kubectl/package.json b/packages/@aws-cdk/lambda-layer-kubectl/package.json index 98661b1c8ea56..9ba2b10e89d47 100644 --- a/packages/@aws-cdk/lambda-layer-kubectl/package.json +++ b/packages/@aws-cdk/lambda-layer-kubectl/package.json @@ -27,9 +27,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/pipelines/package.json b/packages/@aws-cdk/pipelines/package.json index dd498c7e3b633..8717570fc8f1d 100644 --- a/packages/@aws-cdk/pipelines/package.json +++ b/packages/@aws-cdk/pipelines/package.json @@ -109,9 +109,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/region-info/package.json b/packages/@aws-cdk/region-info/package.json index bb53f8e1608dd..fe5a7e1acf1ec 100644 --- a/packages/@aws-cdk/region-info/package.json +++ b/packages/@aws-cdk/region-info/package.json @@ -26,9 +26,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/@aws-cdk/yaml-cfn/package.json b/packages/@aws-cdk/yaml-cfn/package.json index e8f6f1c5f629a..45e121a4cb7f5 100644 --- a/packages/@aws-cdk/yaml-cfn/package.json +++ b/packages/@aws-cdk/yaml-cfn/package.json @@ -45,9 +45,6 @@ "Framework :: AWS CDK", "Framework :: AWS CDK :: 1" ] - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": true diff --git a/packages/aws-cdk-lib/package.json b/packages/aws-cdk-lib/package.json index 8b55795cf2e66..89dbc64979387 100644 --- a/packages/aws-cdk-lib/package.json +++ b/packages/aws-cdk-lib/package.json @@ -66,9 +66,6 @@ "python": { "distName": "aws-cdk.lib", "module": "aws_cdk.lib" - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": false diff --git a/packages/monocdk/package.json b/packages/monocdk/package.json index b6cdc048a091c..c71d755b3c2bb 100644 --- a/packages/monocdk/package.json +++ b/packages/monocdk/package.json @@ -71,9 +71,6 @@ "python": { "distName": "monocdk", "module": "monocdk" - }, - "go": { - "moduleName": "github.com/aws/aws-cdk-go" } }, "projectReferences": false diff --git a/tools/pkglint/lib/rules.ts b/tools/pkglint/lib/rules.ts index 2e0403eb292bd..1dd32c1c96392 100644 --- a/tools/pkglint/lib/rules.ts +++ b/tools/pkglint/lib/rules.ts @@ -695,20 +695,6 @@ export class JSIIPythonTarget extends ValidationRule { } } - -export class JSIIGolangTarget extends ValidationRule { - public readonly name = 'jsii/go'; - - public validate(pkg: PackageJson): void { - if (!isJSII(pkg)) { return; } - - const moduleName = cdkModuleName(pkg.json.name); - - // See: https://aws.github.io/jsii/user-guides/lib-author/configuration/targets/go - expectJSON(this.name, pkg, 'jsii.targets.go.moduleName', moduleName.goRepositoryName); - } -} - export class CDKPackage extends ValidationRule { public readonly name = 'package-info/scripts/package'; @@ -883,7 +869,6 @@ function cdkModuleName(name: string) { distName: `aws-cdk.${pythonName}`, module: `aws_cdk.${pythonName.replace(/-/g, '_')}`, }, - goRepositoryName: 'github.com/aws/aws-cdk-go', }; } diff --git a/tools/ubergen/bin/ubergen.ts b/tools/ubergen/bin/ubergen.ts index 110f9261d83b6..9047fc28c371a 100644 --- a/tools/ubergen/bin/ubergen.ts +++ b/tools/ubergen/bin/ubergen.ts @@ -52,9 +52,6 @@ interface PackageJson { readonly module: string; readonly [key: string]: unknown; }, - readonly go?: { - readonly moduleName: string; - }, readonly [language: string]: unknown, }, }; @@ -296,11 +293,6 @@ function transformTargets(monoConfig: PackageJson['jsii']['targets'], targets: P }; } break; - case 'go': - if (monoConfig?.go != null) { - result[language] = monoConfig?.go; - } - break; default: throw new Error(`Unsupported language for submodule configuration translation: ${language}`); } From 9e6dc6b00d4de6e892be3356ea6d24dd0d45bb2a Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Wed, 3 Mar 2021 11:31:31 +0100 Subject: [PATCH 64/78] chore(contrib-guide): add guidance around breaking changes (#13347) At the request of the ECS team, describe the two kinds of breaking changes separately and describe some tips for dealing with them. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- CONTRIBUTING.md | 138 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2b1a950a551fe..7615d7b10db4e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,6 +14,7 @@ and let us know if it's not up-to-date (even better, submit a PR with your corr - [Step 4: Commit](#step-4-commit) - [Step 5: Pull Request](#step-5-pull-request) - [Step 6: Merge](#step-6-merge) +- [Breaking Changes](#breaking-changes) - [Tools](#tools) - [Main build scripts](#main-build-scripts) - [Partial build tools](#partial-build-tools) @@ -266,6 +267,143 @@ BREAKING CHANGE: Description of what broke and how to achieve this behavior now * Once approved and tested, a maintainer will squash-merge to master and will use your PR title/description as the commit message. +## Breaking Changes + +Whenever you are making changes, there is a chance for those changes to be +*breaking* existing users of the library. A change is breaking if there are +programs that customers could have been writing against the current version +of the CDK, that will no longer "work correctly" with the proposed new +version of the CDK. + +Breaking changes are not allowed in *stable* libraries¹. They are permissible +but still *highly discouraged* in experimental libraries, and require explicit +callouts in the bodies of Pull Requests that introduce them. + +> ¹) Note that starting in version 2 of the CDK, the majority of library code will be +> bundled into a single main CDK library which will be considered stable, and so +> no code in there can undergo breaking changes. + +Breaking changes come in two flavors: + +* API surface changes +* Behavior changes + +### API surface changes + +This encompasses any changes that affect the shape of the API. Changes that +will make existing programs fail to compile are not allowed. Typical examples +of that are: + +* Renaming classes or methods +* Adding required properties to a struct that is used as an input to a constructor + or method. This also includes changing a type from nullable to non-nullable. +* Removing properties from a struct that is returned from a method, or removing + properties from a class. This also includes changing a type from non-nullable + to nullable. + +To see why the latter is a problem, consider the following class: + +```ts +class SomeClass { + public readonly count: number; + // ❓ let's say I want to change this to 'count?: number', + // i.e. make it optional. +} + +// Someone could have written the following code: +const obj = new SomeClass(); +console.log(obj.count + 1); + +// After the proposed change, this code that used to compile fine will now throw: +console.log(obj.count + 1); +// ~~~~~~~~~ Error: Object is possibly 'undefined'. +``` + +CDK comes with build tooling to check whether changes you made introduce breaking +changes to the API surface. In a package directory, run: + +```shell +$ yarn build +$ yarn compat +``` + +To figure out if the changes you made were breaking. See the section [API Compatibility +Checks](#api-compatibility-checks) for more information. + +#### Dealing with breaking API surface changes + +If you need to change the type of some API element, introduce a new API +element and mark the old API element as `@deprecated`. + +If you need to pretend to have a value for the purposes of implementing an API +and you don't actually have a useful value to return, it is acceptable to make +the property a `getter` and throw an exception (keeping in mind to write error +messages that will be useful to a user of your construct): + +```ts +class SomeClass implements ICountable { + constructor(private readonly _count?: number) { + } + + public get count(): number { + if (this._count === undefined) { + // ✅ DO: throw a descriptive error that tells the user what to do + throw new Error('This operation requires that a \'count\' is specified when SomeClass is created.'); + // ❌ DO NOT: just throw an error like 'count is missing' + } + return this._count; + } +} +``` + +### Behavior changes + +These are changes that do not directly affect the compilation of programs +written against the previous API, but may change their meaning. In practice, +even though the user didn't change their code, the CloudFormation template +that gets synthesized is now different. + +**Not all template changes are breaking changes!** Consider a user that has +created a Stack using the previous version of the library, has updated their +version of the CDK library and is now deploying an update. A behavior change +is breaking if: + +* The update cannot be applied at all +* The update can be applied but causes service interruption or data loss. + +Data loss happens when the [Logical +ID](https://docs.aws.amazon.com/cdk/latest/guide/identifiers.html#identifiers_logical_ids) +of a stateful resource changes, or one of the [resource properties that requires +replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html) +is modified. In both of these cases, CloudFormation will delete the +resource, and if it was a stateful resource like a database the data in it is now gone. + +If a change applies cleanly and does not cause any service interruption, it +is not breaking. Nevertheless, it might still be wise to avoid those kinds of +changes as users are understandably wary of unexpected template changes, will +scrutinize them heavily, and we don't want to cause unnecessary panic and churn +in our use base. + +Determining whether or not behavioral changes are breaking requires expertise +and judgement on the part of the library owner, and testing. + +#### Dealing with breaking behavior changes + +Most of the time, behavioral changes will arise because we want to change the +default value or default behavior of some property (i.e., we want to change the +interpretation of what it means if the value is missing). + +If the new behavior is going to be breaking, the user must opt in to it, either by: + +* Adding a new API element (class, property, method, ...) to have users + explicitly opt in to the new behavior at the source code level (potentially + `@deprecate`ing the old API element); or +* Use the [feature flag](#feature-flags) mechanism to have the user opt in to the new + behavior without changing the source code. + +Of these two, the first one is preferred if possible (as feature flags have +non-local effects which can cause unintended effects). + ## Tools The CDK is a big project, and at the moment, all of the CDK modules are mastered in a single monolithic repository From b965589358f4c281aea36404276f08128e6ff3db Mon Sep 17 00:00:00 2001 From: Piotr Moszkowicz Date: Wed, 3 Mar 2021 15:30:59 +0100 Subject: [PATCH 65/78] feat(cognito): user pools - sign in with apple (#13160) Added Sign In With Apple provider to `@aws-cdk/aws-cognito`. That's my first PR here, so bear with me, I hope I haven't made any mistakes, I've been following the docs carefully :) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-cognito/README.md | 1 + .../aws-cognito/lib/user-pool-client.ts | 6 + .../aws-cognito/lib/user-pool-idps/apple.ts | 63 ++++++++++ .../aws-cognito/lib/user-pool-idps/base.ts | 9 ++ .../aws-cognito/lib/user-pool-idps/index.ts | 1 + packages/@aws-cdk/aws-cognito/package.json | 3 +- .../integ.user-pool-idp.apple.expected.json | 118 ++++++++++++++++++ .../test/integ.user-pool-idp.apple.ts | 41 ++++++ .../aws-cognito/test/user-pool-client.test.ts | 3 +- .../aws-cognito/test/user-pool-idps/apple.ts | 113 +++++++++++++++++ 10 files changed, 356 insertions(+), 2 deletions(-) create mode 100644 packages/@aws-cdk/aws-cognito/lib/user-pool-idps/apple.ts create mode 100644 packages/@aws-cdk/aws-cognito/test/integ.user-pool-idp.apple.expected.json create mode 100644 packages/@aws-cdk/aws-cognito/test/integ.user-pool-idp.apple.ts create mode 100644 packages/@aws-cdk/aws-cognito/test/user-pool-idps/apple.ts diff --git a/packages/@aws-cdk/aws-cognito/README.md b/packages/@aws-cdk/aws-cognito/README.md index 4a9a8f5b250cb..d3f90ff026b36 100644 --- a/packages/@aws-cdk/aws-cognito/README.md +++ b/packages/@aws-cdk/aws-cognito/README.md @@ -418,6 +418,7 @@ The following third-party identity providers are currently supported in the CDK - [Login With Amazon](https://developer.amazon.com/apps-and-games/login-with-amazon) - [Facebook Login](https://developers.facebook.com/docs/facebook-login/) - [Google Login](https://developers.google.com/identity/sign-in/web/sign-in) +- [Sign In With Apple](https://developer.apple.com/sign-in-with-apple/get-started/) The following code configures a user pool to federate with the third party provider, 'Login with Amazon'. The identity provider needs to be configured with a set of credentials that the Cognito backend can use to federate with the diff --git a/packages/@aws-cdk/aws-cognito/lib/user-pool-client.ts b/packages/@aws-cdk/aws-cognito/lib/user-pool-client.ts index ea5693f45d1c4..866c11015ecfd 100644 --- a/packages/@aws-cdk/aws-cognito/lib/user-pool-client.ts +++ b/packages/@aws-cdk/aws-cognito/lib/user-pool-client.ts @@ -157,6 +157,12 @@ export class OAuthScope { * Identity providers supported by the UserPoolClient */ export class UserPoolClientIdentityProvider { + /** + * Allow users to sign in using 'Sign In With Apple'. + * A `UserPoolIdentityProviderApple` must be attached to the user pool. + */ + public static readonly APPLE = new UserPoolClientIdentityProvider('SignInWithApple'); + /** * Allow users to sign in using 'Facebook Login'. * A `UserPoolIdentityProviderFacebook` must be attached to the user pool. diff --git a/packages/@aws-cdk/aws-cognito/lib/user-pool-idps/apple.ts b/packages/@aws-cdk/aws-cognito/lib/user-pool-idps/apple.ts new file mode 100644 index 0000000000000..c1fbd6d4ca9fa --- /dev/null +++ b/packages/@aws-cdk/aws-cognito/lib/user-pool-idps/apple.ts @@ -0,0 +1,63 @@ +import { Construct } from 'constructs'; +import { CfnUserPoolIdentityProvider } from '../cognito.generated'; +import { UserPoolIdentityProviderProps } from './base'; +import { UserPoolIdentityProviderBase } from './private/user-pool-idp-base'; + +/** + * Properties to initialize UserPoolAppleIdentityProvider + */ +export interface UserPoolIdentityProviderAppleProps extends UserPoolIdentityProviderProps { + /** + * The client id recognized by Apple APIs. + * @see https://developer.apple.com/documentation/sign_in_with_apple/clientconfigi/3230948-clientid + */ + readonly clientId: string; + /** + * The teamId for Apple APIs to authenticate the client. + */ + readonly teamId: string; + /** + * The keyId (of the same key, which content has to be later supplied as `privateKey`) for Apple APIs to authenticate the client. + */ + readonly keyId: string; + /** + * The privateKey content for Apple APIs to authenticate the client. + */ + readonly privateKey: string; + /** + * The list of apple permissions to obtain for getting access to the apple profile + * @see https://developer.apple.com/documentation/sign_in_with_apple/clientconfigi/3230955-scope + * @default [ name ] + */ + readonly scopes?: string[]; +} + +/** + * Represents a identity provider that integrates with 'Apple' + * @resource AWS::Cognito::UserPoolIdentityProvider + */ +export class UserPoolIdentityProviderApple extends UserPoolIdentityProviderBase { + public readonly providerName: string; + + constructor(scope: Construct, id: string, props: UserPoolIdentityProviderAppleProps) { + super(scope, id, props); + + const scopes = props.scopes ?? ['name']; + + const resource = new CfnUserPoolIdentityProvider(this, 'Resource', { + userPoolId: props.userPool.userPoolId, + providerName: 'SignInWithApple', // must be 'SignInWithApple' when the type is 'SignInWithApple' + providerType: 'SignInWithApple', + providerDetails: { + client_id: props.clientId, + team_id: props.teamId, + key_id: props.keyId, + private_key: props.privateKey, + authorize_scopes: scopes.join(' '), + }, + attributeMapping: super.configureAttributeMapping(), + }); + + this.providerName = super.getResourceNameAttribute(resource.ref); + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cognito/lib/user-pool-idps/base.ts b/packages/@aws-cdk/aws-cognito/lib/user-pool-idps/base.ts index be155fca69a6d..08278947b9e04 100644 --- a/packages/@aws-cdk/aws-cognito/lib/user-pool-idps/base.ts +++ b/packages/@aws-cdk/aws-cognito/lib/user-pool-idps/base.ts @@ -4,6 +4,15 @@ import { IUserPool } from '../user-pool'; * An attribute available from a third party identity provider. */ export class ProviderAttribute { + /** The email attribute provided by Apple */ + public static readonly APPLE_EMAIL = new ProviderAttribute('email'); + /** The name attribute provided by Apple */ + public static readonly APPLE_NAME = new ProviderAttribute('name'); + /** The first name attribute provided by Apple */ + public static readonly APPLE_FIRST_NAME = new ProviderAttribute('firstName'); + /** The last name attribute provided by Apple */ + public static readonly APPLE_LAST_NAME = new ProviderAttribute('lastName'); + /** The user id attribute provided by Amazon */ public static readonly AMAZON_USER_ID = new ProviderAttribute('user_id'); /** The email attribute provided by Amazon */ diff --git a/packages/@aws-cdk/aws-cognito/lib/user-pool-idps/index.ts b/packages/@aws-cdk/aws-cognito/lib/user-pool-idps/index.ts index dbc63a9854f37..321ee0ecad5d9 100644 --- a/packages/@aws-cdk/aws-cognito/lib/user-pool-idps/index.ts +++ b/packages/@aws-cdk/aws-cognito/lib/user-pool-idps/index.ts @@ -1,4 +1,5 @@ export * from './base'; +export * from './apple'; export * from './amazon'; export * from './facebook'; export * from './google'; \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cognito/package.json b/packages/@aws-cdk/aws-cognito/package.json index c9bae0f953907..3a981167956a3 100644 --- a/packages/@aws-cdk/aws-cognito/package.json +++ b/packages/@aws-cdk/aws-cognito/package.json @@ -110,7 +110,8 @@ "props-physical-name:@aws-cdk/aws-cognito.UserPoolDomainProps", "props-physical-name:@aws-cdk/aws-cognito.UserPoolIdentityProviderFacebookProps", "props-physical-name:@aws-cdk/aws-cognito.UserPoolIdentityProviderAmazonProps", - "props-physical-name:@aws-cdk/aws-cognito.UserPoolIdentityProviderGoogleProps" + "props-physical-name:@aws-cdk/aws-cognito.UserPoolIdentityProviderGoogleProps", + "props-physical-name:@aws-cdk/aws-cognito.UserPoolIdentityProviderAppleProps" ] }, "stability": "stable", diff --git a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-idp.apple.expected.json b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-idp.apple.expected.json new file mode 100644 index 0000000000000..64baf88ef6807 --- /dev/null +++ b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-idp.apple.expected.json @@ -0,0 +1,118 @@ +{ + "Resources": { + "pool056F3F7E": { + "Type": "AWS::Cognito::UserPool", + "Properties": { + "AccountRecoverySetting": { + "RecoveryMechanisms": [ + { + "Name": "verified_phone_number", + "Priority": 1 + }, + { + "Name": "verified_email", + "Priority": 2 + } + ] + }, + "AdminCreateUserConfig": { + "AllowAdminCreateUserOnly": true + }, + "EmailVerificationMessage": "The verification code to your new account is {####}", + "EmailVerificationSubject": "Verify your new account", + "SmsVerificationMessage": "The verification code to your new account is {####}", + "VerificationMessageTemplate": { + "DefaultEmailOption": "CONFIRM_WITH_CODE", + "EmailMessage": "The verification code to your new account is {####}", + "EmailSubject": "Verify your new account", + "SmsMessage": "The verification code to your new account is {####}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "poolclient2623294C": { + "Type": "AWS::Cognito::UserPoolClient", + "Properties": { + "UserPoolId": { + "Ref": "pool056F3F7E" + }, + "AllowedOAuthFlows": [ + "implicit", + "code" + ], + "AllowedOAuthFlowsUserPoolClient": true, + "AllowedOAuthScopes": [ + "profile", + "phone", + "email", + "openid", + "aws.cognito.signin.user.admin" + ], + "CallbackURLs": [ + "https://example.com" + ], + "SupportedIdentityProviders": [ + { + "Ref": "apple9B5408AC" + }, + "COGNITO" + ] + } + }, + "pooldomain430FA744": { + "Type": "AWS::Cognito::UserPoolDomain", + "Properties": { + "Domain": "nija-test-pool", + "UserPoolId": { + "Ref": "pool056F3F7E" + } + } + }, + "apple9B5408AC": { + "Type": "AWS::Cognito::UserPoolIdentityProvider", + "Properties": { + "ProviderName": "SignInWithApple", + "ProviderType": "SignInWithApple", + "UserPoolId": { + "Ref": "pool056F3F7E" + }, + "AttributeMapping": { + "family_name": "lastName", + "given_name": "firstName" + }, + "ProviderDetails": { + "client_id": "com.amzn.cdk", + "team_id": "CDKTEAMCDK", + "key_id": "CDKKEYCDK1", + "private_key": "PRIV_KEY_CDK", + "authorize_scopes": "email name" + } + } + } + }, + "Outputs": { + "SignInLink": { + "Value": { + "Fn::Join": [ + "", + [ + "https://", + { + "Ref": "pooldomain430FA744" + }, + ".auth.", + { + "Ref": "AWS::Region" + }, + ".amazoncognito.com/login?client_id=", + { + "Ref": "poolclient2623294C" + }, + "&response_type=code&redirect_uri=https://example.com" + ] + ] + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-idp.apple.ts b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-idp.apple.ts new file mode 100644 index 0000000000000..fb8e15f26e308 --- /dev/null +++ b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-idp.apple.ts @@ -0,0 +1,41 @@ +import { App, CfnOutput, RemovalPolicy, Stack } from '@aws-cdk/core'; +import { ProviderAttribute, UserPool, UserPoolIdentityProviderApple } from '../lib'; + +/* + * Stack verification steps + * * Visit the URL provided by stack output 'SignInLink' in a browser, and verify the 'Sign In With Apple' link shows up. + * * If you plug in valid 'Sign In With Apple' credentials, the federated log in should work. + */ +const app = new App(); +const stack = new Stack(app, 'integ-user-pool-idp-apple'); + +const userpool = new UserPool(stack, 'pool', { + removalPolicy: RemovalPolicy.DESTROY, +}); + +new UserPoolIdentityProviderApple(stack, 'apple', { + userPool: userpool, + clientId: 'com.amzn.cdk', + teamId: 'CDKTEAMCDK', + keyId: 'CDKKEYCDK1', + privateKey: 'PRIV_KEY_CDK', + scopes: ['email', 'name'], + attributeMapping: { + familyName: ProviderAttribute.APPLE_LAST_NAME, + givenName: ProviderAttribute.APPLE_FIRST_NAME, + }, +}); + +const client = userpool.addClient('client'); + +const domain = userpool.addDomain('domain', { + cognitoDomain: { + domainPrefix: 'nija-test-pool', + }, +}); + +new CfnOutput(stack, 'SignInLink', { + value: domain.signInUrl(client, { + redirectUri: 'https://example.com', + }), +}); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cognito/test/user-pool-client.test.ts b/packages/@aws-cdk/aws-cognito/test/user-pool-client.test.ts index 3a056cd02dda7..02420721df344 100644 --- a/packages/@aws-cdk/aws-cognito/test/user-pool-client.test.ts +++ b/packages/@aws-cdk/aws-cognito/test/user-pool-client.test.ts @@ -487,13 +487,14 @@ describe('User Pool Client', () => { UserPoolClientIdentityProvider.FACEBOOK, UserPoolClientIdentityProvider.AMAZON, UserPoolClientIdentityProvider.GOOGLE, + UserPoolClientIdentityProvider.APPLE, ], }); // THEN expect(stack).toHaveResource('AWS::Cognito::UserPoolClient', { ClientName: 'AllEnabled', - SupportedIdentityProviders: ['COGNITO', 'Facebook', 'LoginWithAmazon', 'Google'], + SupportedIdentityProviders: ['COGNITO', 'Facebook', 'LoginWithAmazon', 'Google', 'SignInWithApple'], }); }); diff --git a/packages/@aws-cdk/aws-cognito/test/user-pool-idps/apple.ts b/packages/@aws-cdk/aws-cognito/test/user-pool-idps/apple.ts new file mode 100644 index 0000000000000..5f4180bce5682 --- /dev/null +++ b/packages/@aws-cdk/aws-cognito/test/user-pool-idps/apple.ts @@ -0,0 +1,113 @@ +import '@aws-cdk/assert/jest'; +import { Stack } from '@aws-cdk/core'; +import { ProviderAttribute, UserPool, UserPoolIdentityProviderApple } from '../../lib'; + +describe('UserPoolIdentityProvider', () => { + describe('apple', () => { + test('defaults', () => { + // GIVEN + const stack = new Stack(); + const pool = new UserPool(stack, 'userpool'); + + // WHEN + new UserPoolIdentityProviderApple(stack, 'userpoolidp', { + userPool: pool, + clientId: 'com.amzn.cdk', + teamId: 'CDKTEAMCDK', + keyId: 'CDKKEYCDK1', + privateKey: 'PRIV_KEY_CDK', + }); + + expect(stack).toHaveResource('AWS::Cognito::UserPoolIdentityProvider', { + ProviderName: 'SignInWithApple', + ProviderType: 'SignInWithApple', + ProviderDetails: { + client_id: 'com.amzn.cdk', + team_id: 'CDKTEAMCDK', + key_id: 'CDKKEYCDK1', + private_key: 'PRIV_KEY_CDK', + authorize_scopes: 'name', + }, + }); + }); + + test('scopes', () => { + // GIVEN + const stack = new Stack(); + const pool = new UserPool(stack, 'userpool'); + + // WHEN + new UserPoolIdentityProviderApple(stack, 'userpoolidp', { + userPool: pool, + clientId: 'com.amzn.cdk', + teamId: 'CDKTEAMCDK', + keyId: 'CDKKEYCDK1', + privateKey: 'PRIV_KEY_CDK', + scopes: ['scope1', 'scope2'], + }); + + expect(stack).toHaveResource('AWS::Cognito::UserPoolIdentityProvider', { + ProviderName: 'SignInWithApple', + ProviderType: 'SignInWithApple', + ProviderDetails: { + client_id: 'com.amzn.cdk', + team_id: 'CDKTEAMCDK', + key_id: 'CDKKEYCDK1', + private_key: 'PRIV_KEY_CDK', + authorize_scopes: 'scope1 scope2', + }, + }); + }); + + test('registered with user pool', () => { + // GIVEN + const stack = new Stack(); + const pool = new UserPool(stack, 'userpool'); + + // WHEN + const provider = new UserPoolIdentityProviderApple(stack, 'userpoolidp', { + userPool: pool, + clientId: 'com.amzn.cdk', + teamId: 'CDKTEAMCDK', + keyId: 'CDKKEYCDK1', + privateKey: 'PRIV_KEY_CDK', + }); + + // THEN + expect(pool.identityProviders).toContain(provider); + }); + + test('attribute mapping', () => { + // GIVEN + const stack = new Stack(); + const pool = new UserPool(stack, 'userpool'); + + // WHEN + new UserPoolIdentityProviderApple(stack, 'userpoolidp', { + userPool: pool, + clientId: 'com.amzn.cdk', + teamId: 'CDKTEAMCDK', + keyId: 'CDKKEYCDK1', + privateKey: 'PRIV_KEY_CDK', + attributeMapping: { + familyName: ProviderAttribute.APPLE_LAST_NAME, + givenName: ProviderAttribute.APPLE_FIRST_NAME, + custom: { + customAttr1: ProviderAttribute.APPLE_EMAIL, + customAttr2: ProviderAttribute.other('sub'), + }, + }, + }); + + // THEN + expect(stack).toHaveResource('AWS::Cognito::UserPoolIdentityProvider', { + AttributeMapping: { + family_name: 'firstName', + given_name: 'lastName', + customAttr1: 'email', + customAttr2: 'sub', + }, + }); + }); + }); +}); \ No newline at end of file From 3413b2f887596d11dfb53c0e99c2a1788095a2ad Mon Sep 17 00:00:00 2001 From: Robert Djurasaj Date: Wed, 3 Mar 2021 08:30:21 -0700 Subject: [PATCH 66/78] fix(core): custom resource provider NODEJS_12 now looks like Lambda's NODEJS_12_X, add Node 14 (#13301) Purpose of this PR is to align `runtime` options for custom resource providers with `aws-lambda` runtime options. New selections include `NODEJS_12_X` and `NODE_JS_14_X`. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../test/integ.core-custom-resources.ts | 2 +- .../lib/experimental/edge-function.ts | 2 +- packages/@aws-cdk/aws-iam/lib/oidc-provider.ts | 2 +- packages/@aws-cdk/aws-route53/lib/record-set.ts | 2 +- .../test/integ.bucket-auto-delete-objects.ts | 2 +- .../test/integ.secret-name-parsed.ts | 2 +- packages/@aws-cdk/core/README.md | 6 +++--- .../custom-resource-provider.ts | 14 +++++++++++++- .../core/lib/private/cfn-utils-provider.ts | 2 +- .../custom-resource-provider.test.ts | 12 ++++++------ 10 files changed, 29 insertions(+), 17 deletions(-) diff --git a/packages/@aws-cdk/aws-cloudformation/test/integ.core-custom-resources.ts b/packages/@aws-cdk/aws-cloudformation/test/integ.core-custom-resources.ts index 7f5e9d49a95db..bdd4ae31af241 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/integ.core-custom-resources.ts +++ b/packages/@aws-cdk/aws-cloudformation/test/integ.core-custom-resources.ts @@ -23,7 +23,7 @@ class TestStack extends Stack { const serviceToken = CustomResourceProvider.getOrCreate(this, resourceType, { codeDirectory: `${__dirname}/core-custom-resource-provider-fixture`, - runtime: CustomResourceProviderRuntime.NODEJS_12, + runtime: CustomResourceProviderRuntime.NODEJS_12_X, description: 'veni vidi vici', }); diff --git a/packages/@aws-cdk/aws-cloudfront/lib/experimental/edge-function.ts b/packages/@aws-cdk/aws-cloudfront/lib/experimental/edge-function.ts index 69913aa07a2a1..b12a56fe67e80 100644 --- a/packages/@aws-cdk/aws-cloudfront/lib/experimental/edge-function.ts +++ b/packages/@aws-cdk/aws-cloudfront/lib/experimental/edge-function.ts @@ -180,7 +180,7 @@ export class EdgeFunction extends Resource implements lambda.IVersion { const resourceType = 'Custom::CrossRegionStringParameterReader'; const serviceToken = CustomResourceProvider.getOrCreate(this, resourceType, { codeDirectory: path.join(__dirname, 'edge-function'), - runtime: CustomResourceProviderRuntime.NODEJS_12, + runtime: CustomResourceProviderRuntime.NODEJS_12_X, policyStatements: [{ Effect: 'Allow', Resource: parameterArnPrefix, diff --git a/packages/@aws-cdk/aws-iam/lib/oidc-provider.ts b/packages/@aws-cdk/aws-iam/lib/oidc-provider.ts index 91c221ec55652..ec70c6d152cbe 100644 --- a/packages/@aws-cdk/aws-iam/lib/oidc-provider.ts +++ b/packages/@aws-cdk/aws-iam/lib/oidc-provider.ts @@ -155,7 +155,7 @@ export class OpenIdConnectProvider extends Resource implements IOpenIdConnectPro private getOrCreateProvider() { return CustomResourceProvider.getOrCreate(this, RESOURCE_TYPE, { codeDirectory: path.join(__dirname, 'oidc-provider'), - runtime: CustomResourceProviderRuntime.NODEJS_12, + runtime: CustomResourceProviderRuntime.NODEJS_12_X, policyStatements: [ { Effect: 'Allow', diff --git a/packages/@aws-cdk/aws-route53/lib/record-set.ts b/packages/@aws-cdk/aws-route53/lib/record-set.ts index 577af5c1a3a57..a86195f1d0055 100644 --- a/packages/@aws-cdk/aws-route53/lib/record-set.ts +++ b/packages/@aws-cdk/aws-route53/lib/record-set.ts @@ -604,7 +604,7 @@ export class CrossAccountZoneDelegationRecord extends CoreConstruct { const serviceToken = CustomResourceProvider.getOrCreate(this, CROSS_ACCOUNT_ZONE_DELEGATION_RESOURCE_TYPE, { codeDirectory: path.join(__dirname, 'cross-account-zone-delegation-handler'), - runtime: CustomResourceProviderRuntime.NODEJS_12, + runtime: CustomResourceProviderRuntime.NODEJS_12_X, policyStatements: [{ Effect: 'Allow', Action: 'sts:AssumeRole', Resource: props.delegationRole.roleArn }], }); diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.ts b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.ts index 83243212409d7..8052dd340d888 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.ts +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.ts @@ -17,7 +17,7 @@ class TestStack extends Stack { // Put objects in the bucket to ensure auto delete works as expected const serviceToken = CustomResourceProvider.getOrCreate(this, PUT_OBJECTS_RESOURCE_TYPE, { codeDirectory: path.join(__dirname, 'put-objects-handler'), - runtime: CustomResourceProviderRuntime.NODEJS_12, + runtime: CustomResourceProviderRuntime.NODEJS_12_X, policyStatements: [{ Effect: 'Allow', Action: 's3:PutObject', diff --git a/packages/@aws-cdk/aws-secretsmanager/test/integ.secret-name-parsed.ts b/packages/@aws-cdk/aws-secretsmanager/test/integ.secret-name-parsed.ts index 2d245cc6e3e01..801077c5c8494 100644 --- a/packages/@aws-cdk/aws-secretsmanager/test/integ.secret-name-parsed.ts +++ b/packages/@aws-cdk/aws-secretsmanager/test/integ.secret-name-parsed.ts @@ -21,7 +21,7 @@ class SecretsManagerStack extends cdk.Stack { const resourceType = 'Custom::IntegVerificationSecretNameMatches'; const serviceToken = cdk.CustomResourceProvider.getOrCreate(this, resourceType, { codeDirectory: path.join(__dirname, 'integ.secret-name-parsed.handler'), - runtime: cdk.CustomResourceProviderRuntime.NODEJS_12, + runtime: cdk.CustomResourceProviderRuntime.NODEJS_12_X, policyStatements: [{ Effect: 'Allow', Resource: secrets.map(s => s.secretArn), diff --git a/packages/@aws-cdk/core/README.md b/packages/@aws-cdk/core/README.md index 714e7139f0807..bb519f066af55 100644 --- a/packages/@aws-cdk/core/README.md +++ b/packages/@aws-cdk/core/README.md @@ -427,7 +427,7 @@ stack-unique identifier and returns the service token: ```ts const serviceToken = CustomResourceProvider.getOrCreate(this, 'Custom::MyCustomResourceType', { codeDirectory: `${__dirname}/my-handler`, - runtime: CustomResourceProviderRuntime.NODEJS_12, // currently the only supported runtime + runtime: CustomResourceProviderRuntime.NODEJS_12_X, description: "Lambda function created by the custom resource provider", }); @@ -522,7 +522,7 @@ export class Sum extends Construct { const resourceType = 'Custom::Sum'; const serviceToken = CustomResourceProvider.getOrCreate(this, resourceType, { codeDirectory: `${__dirname}/sum-handler`, - runtime: CustomResourceProviderRuntime.NODEJS_12, + runtime: CustomResourceProviderRuntime.NODEJS_12_X, }); const resource = new CustomResource(this, 'Resource', { @@ -552,7 +552,7 @@ built-in singleton method: ```ts const provider = CustomResourceProvider.getOrCreateProvider(this, 'Custom::MyCustomResourceType', { codeDirectory: `${__dirname}/my-handler`, - runtime: CustomResourceProviderRuntime.NODEJS_12, // currently the only supported runtime + runtime: CustomResourceProviderRuntime.NODEJS_12_X, }); const roleArn = provider.roleArn; diff --git a/packages/@aws-cdk/core/lib/custom-resource-provider/custom-resource-provider.ts b/packages/@aws-cdk/core/lib/custom-resource-provider/custom-resource-provider.ts index d6b0a2db982c7..c7f3776339907 100644 --- a/packages/@aws-cdk/core/lib/custom-resource-provider/custom-resource-provider.ts +++ b/packages/@aws-cdk/core/lib/custom-resource-provider/custom-resource-provider.ts @@ -84,8 +84,20 @@ export interface CustomResourceProviderProps { export enum CustomResourceProviderRuntime { /** * Node.js 12.x + * + * @deprecated Use {@link NODEJS_12_X} + */ + NODEJS_12 = 'nodejs12.x', + + /** + * Node.js 12.x + */ + NODEJS_12_X = 'nodejs12.x', + + /** + * Node.js 14.x */ - NODEJS_12 = 'nodejs12.x' + NODEJS_14_X = 'nodejs14.x', } /** diff --git a/packages/@aws-cdk/core/lib/private/cfn-utils-provider.ts b/packages/@aws-cdk/core/lib/private/cfn-utils-provider.ts index dae7253720041..8200165fbfe34 100644 --- a/packages/@aws-cdk/core/lib/private/cfn-utils-provider.ts +++ b/packages/@aws-cdk/core/lib/private/cfn-utils-provider.ts @@ -7,7 +7,7 @@ import { CustomResourceProvider, CustomResourceProviderRuntime } from '../custom export class CfnUtilsProvider extends Construct { public static getOrCreate(scope: Construct) { return CustomResourceProvider.getOrCreate(scope, 'AWSCDKCfnUtilsProvider', { - runtime: CustomResourceProviderRuntime.NODEJS_12, + runtime: CustomResourceProviderRuntime.NODEJS_12_X, codeDirectory: `${__dirname}/cfn-utils-provider`, }); } diff --git a/packages/@aws-cdk/core/test/custom-resource-provider/custom-resource-provider.test.ts b/packages/@aws-cdk/core/test/custom-resource-provider/custom-resource-provider.test.ts index 594f9c2936ff1..5fc12ecc17c2f 100644 --- a/packages/@aws-cdk/core/test/custom-resource-provider/custom-resource-provider.test.ts +++ b/packages/@aws-cdk/core/test/custom-resource-provider/custom-resource-provider.test.ts @@ -14,7 +14,7 @@ nodeunitShim({ // WHEN CustomResourceProvider.getOrCreate(stack, 'Custom:MyResourceType', { codeDirectory: TEST_HANDLER, - runtime: CustomResourceProviderRuntime.NODEJS_12, + runtime: CustomResourceProviderRuntime.NODEJS_12_X, }); // THEN @@ -149,7 +149,7 @@ nodeunitShim({ // WHEN CustomResourceProvider.getOrCreate(stack, 'Custom:MyResourceType', { codeDirectory: TEST_HANDLER, - runtime: CustomResourceProviderRuntime.NODEJS_12, + runtime: CustomResourceProviderRuntime.NODEJS_12_X, }); // THEN -- no exception @@ -167,7 +167,7 @@ nodeunitShim({ // WHEN CustomResourceProvider.getOrCreate(stack, 'Custom:MyResourceType', { codeDirectory: TEST_HANDLER, - runtime: CustomResourceProviderRuntime.NODEJS_12, + runtime: CustomResourceProviderRuntime.NODEJS_12_X, policyStatements: [ { statement1: 123 }, { statement2: { foo: 111 } }, @@ -194,7 +194,7 @@ nodeunitShim({ // WHEN CustomResourceProvider.getOrCreate(stack, 'Custom:MyResourceType', { codeDirectory: TEST_HANDLER, - runtime: CustomResourceProviderRuntime.NODEJS_12, + runtime: CustomResourceProviderRuntime.NODEJS_12_X, memorySize: Size.gibibytes(2), timeout: Duration.minutes(5), description: 'veni vidi vici', @@ -216,7 +216,7 @@ nodeunitShim({ // WHEN CustomResourceProvider.getOrCreate(stack, 'Custom:MyResourceType', { codeDirectory: TEST_HANDLER, - runtime: CustomResourceProviderRuntime.NODEJS_12, + runtime: CustomResourceProviderRuntime.NODEJS_12_X, environment: { B: 'b', A: 'a', @@ -242,7 +242,7 @@ nodeunitShim({ // WHEN const cr = CustomResourceProvider.getOrCreateProvider(stack, 'Custom:MyResourceType', { codeDirectory: TEST_HANDLER, - runtime: CustomResourceProviderRuntime.NODEJS_12, + runtime: CustomResourceProviderRuntime.NODEJS_12_X, }); // THEN From 1bb3650c5dd2087b05793a5e903cdfb80fc5c1ad Mon Sep 17 00:00:00 2001 From: Alban Esc Date: Wed, 3 Mar 2021 08:03:08 -0800 Subject: [PATCH 67/78] feat(events): dead letter queue for Lambda Targets (#11617) Add DLQ Configuration to Rule targets. Using a DLQ on a rule prevents the application to loose events after all retry attempts are exhausted. Resolves #11612 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../@aws-cdk/aws-events-targets/README.md | 35 +++- .../@aws-cdk/aws-events-targets/lib/lambda.ts | 20 +- .../@aws-cdk/aws-events-targets/lib/util.ts | 45 ++++- .../test/lambda/integ.events.expected.json | 89 +++++++++ .../test/lambda/integ.events.ts | 12 ++ .../test/lambda/lambda.test.ts | 178 ++++++++++++++++++ packages/@aws-cdk/aws-events/lib/rule.ts | 1 + packages/@aws-cdk/aws-events/lib/target.ts | 6 + 8 files changed, 383 insertions(+), 3 deletions(-) diff --git a/packages/@aws-cdk/aws-events-targets/README.md b/packages/@aws-cdk/aws-events-targets/README.md index ba0e83c2a82ba..cd843ef130a3a 100644 --- a/packages/@aws-cdk/aws-events-targets/README.md +++ b/packages/@aws-cdk/aws-events-targets/README.md @@ -32,7 +32,40 @@ Currently supported are: See the README of the `@aws-cdk/aws-events` library for more information on EventBridge. -## LogGroup +## Invoke a Lambda function + +Use the `LambdaFunction` target to invoke a lambda function. + +The code snippet below creates an event rule with a Lambda function as a target +triggered for every events from `aws.ec2` source. You can optionally attach a +[dead letter queue](https://docs.aws.amazon.com/eventbridge/latest/userguide/rule-dlq.html). + +```ts +import * as lambda from "@aws-cdk/aws-lambda"; +import * as events from "@aws-cdk/aws-events"; +import * as sqs from "@aws-cdk/aws-sqs"; +import * as targets from "@aws-cdk/aws-events-targets"; + +const fn = new lambda.Function(this, 'MyFunc', { + runtime: lambda.Runtime.NODEJS_12_X, + handler: 'index.handler', + code: lambda.Code.fromInline(`exports.handler = ${handler.toString()}`), +}); + +const rule = new events.Rule(this, 'rule', { + eventPattern: { + source: ["aws.ec2"], + }, +}); + +const queue = new sqs.Queue(this, 'Queue'); + +rule.addTarget(new targets.LambdaFunction(fn, { + deadLetterQueue: queue, // Optional: add a dead letter queue +})); +``` + +## Log an event into a LogGroup Use the `LogGroup` target to log your events in a CloudWatch LogGroup. diff --git a/packages/@aws-cdk/aws-events-targets/lib/lambda.ts b/packages/@aws-cdk/aws-events-targets/lib/lambda.ts index 780cd6d57162c..44315579a1300 100644 --- a/packages/@aws-cdk/aws-events-targets/lib/lambda.ts +++ b/packages/@aws-cdk/aws-events-targets/lib/lambda.ts @@ -1,6 +1,7 @@ import * as events from '@aws-cdk/aws-events'; import * as lambda from '@aws-cdk/aws-lambda'; -import { addLambdaPermission } from './util'; +import * as sqs from '@aws-cdk/aws-sqs'; +import { addLambdaPermission, addToDeadLetterQueueResourcePolicy } from './util'; /** * Customize the Lambda Event Target @@ -14,6 +15,18 @@ export interface LambdaFunctionProps { * @default the entire EventBridge event */ readonly event?: events.RuleTargetInput; + + /** + * The SQS queue to be used as deadLetterQueue. + * Check out the [considerations for using a dead-letter queue](https://docs.aws.amazon.com/eventbridge/latest/userguide/rule-dlq.html#dlq-considerations). + * + * The events not successfully delivered are automatically retried for a specified period of time, + * depending on the retry policy of the target. + * If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue. + * + * @default - no dead-letter queue + */ + readonly deadLetterQueue?: sqs.IQueue; } /** @@ -32,9 +45,14 @@ export class LambdaFunction implements events.IRuleTarget { // Allow handler to be called from rule addLambdaPermission(rule, this.handler); + if (this.props.deadLetterQueue) { + addToDeadLetterQueueResourcePolicy(rule, this.props.deadLetterQueue); + } + return { id: '', arn: this.handler.functionArn, + deadLetterConfig: this.props.deadLetterQueue ? { arn: this.props.deadLetterQueue?.queueArn } : undefined, input: this.props.event, targetResource: this.handler, }; diff --git a/packages/@aws-cdk/aws-events-targets/lib/util.ts b/packages/@aws-cdk/aws-events-targets/lib/util.ts index 1026d1ae35a1a..069b04a8c5131 100644 --- a/packages/@aws-cdk/aws-events-targets/lib/util.ts +++ b/packages/@aws-cdk/aws-events-targets/lib/util.ts @@ -1,7 +1,8 @@ import * as events from '@aws-cdk/aws-events'; import * as iam from '@aws-cdk/aws-iam'; import * as lambda from '@aws-cdk/aws-lambda'; -import { ConstructNode, IConstruct, Names } from '@aws-cdk/core'; +import * as sqs from '@aws-cdk/aws-sqs'; +import { Annotations, ConstructNode, IConstruct, Names, Token, TokenComparison } from '@aws-cdk/core'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order @@ -50,3 +51,45 @@ export function addLambdaPermission(rule: events.IRule, handler: lambda.IFunctio }); } } + +/** + * Allow a rule to send events with failed invocation to an Amazon SQS queue. + */ +export function addToDeadLetterQueueResourcePolicy(rule: events.IRule, queue: sqs.IQueue) { + if (!sameEnvDimension(rule.env.region, queue.env.region)) { + throw new Error(`Cannot assign Dead Letter Queue in region ${queue.env.region} to the rule ${Names.nodeUniqueId(rule.node)} in region ${rule.env.region}. Both the queue and the rule must be in the same region.`); + } + + // Skip Resource Policy creation if the Queue is not in the same account. + // There is no way to add a target onto an imported rule, so we can assume we will run the following code only + // in the account where the rule is created. + if (sameEnvDimension(rule.env.account, queue.env.account)) { + const policyStatementId = `AllowEventRule${Names.nodeUniqueId(rule.node)}`; + + queue.addToResourcePolicy(new iam.PolicyStatement({ + sid: policyStatementId, + principals: [new iam.ServicePrincipal('events.amazonaws.com')], + effect: iam.Effect.ALLOW, + actions: ['sqs:SendMessage'], + resources: [queue.queueArn], + conditions: { + ArnEquals: { + 'aws:SourceArn': rule.ruleArn, + }, + }, + })); + } else { + Annotations.of(rule).addWarning(`Cannot add a resource policy to your dead letter queue associated with rule ${rule.ruleName} because the queue is in a different account. You must add the resource policy manually to the dead letter queue in account ${queue.env.account}.`); + } +} + + +/** + * Whether two string probably contain the same environment dimension (region or account) + * + * Used to compare either accounts or regions, and also returns true if both + * are unresolved (in which case both are expted to be "current region" or "current account"). + */ +function sameEnvDimension(dim1: string, dim2: string) { + return [TokenComparison.SAME, TokenComparison.BOTH_UNRESOLVED].includes(Token.compareStrings(dim1, dim2)); +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.expected.json b/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.expected.json index c12d92ef34810..7df2a4becf021 100644 --- a/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.expected.json +++ b/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.expected.json @@ -123,6 +123,95 @@ ] } } + }, + "Timer30894E3BB": { + "Type": "AWS::Events::Rule", + "Properties": { + "ScheduleExpression": "rate(2 minutes)", + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Fn::GetAtt": [ + "MyFunc8A243A2C", + "Arn" + ] + }, + "DeadLetterConfig": { + "Arn": { + "Fn::GetAtt": [ + "Queue4A7E3555", + "Arn" + ] + } + }, + "Id": "Target0" + } + ] + } + }, + "Timer3AllowEventRulelambdaeventsMyFunc910E580F79317F73": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "MyFunc8A243A2C", + "Arn" + ] + }, + "Principal": "events.amazonaws.com", + "SourceArn": { + "Fn::GetAtt": [ + "Timer30894E3BB", + "Arn" + ] + } + } + }, + "Queue4A7E3555": { + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "QueuePolicy25439813": { + "Type": "AWS::SQS::QueuePolicy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "sqs:SendMessage", + "Condition": { + "ArnEquals": { + "aws:SourceArn": { + "Fn::GetAtt": [ + "Timer30894E3BB", + "Arn" + ] + } + } + }, + "Effect": "Allow", + "Principal": { + "Service": "events.amazonaws.com" + }, + "Resource": { + "Fn::GetAtt": [ + "Queue4A7E3555", + "Arn" + ] + }, + "Sid": "AllowEventRulelambdaeventsTimer3107B9373" + } + ], + "Version": "2012-10-17" + }, + "Queues": [ + { + "Ref": "Queue4A7E3555" + } + ] + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.ts b/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.ts index 17d17a291e244..c37c632d803ae 100644 --- a/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.ts +++ b/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.ts @@ -1,5 +1,6 @@ import * as events from '@aws-cdk/aws-events'; import * as lambda from '@aws-cdk/aws-lambda'; +import * as sqs from '@aws-cdk/aws-sqs'; import * as cdk from '@aws-cdk/core'; import * as targets from '../../lib'; @@ -23,6 +24,17 @@ const timer2 = new events.Rule(stack, 'Timer2', { }); timer2.addTarget(new targets.LambdaFunction(fn)); + +const timer3 = new events.Rule(stack, 'Timer3', { + schedule: events.Schedule.rate(cdk.Duration.minutes(2)), +}); + +const queue = new sqs.Queue(stack, 'Queue'); + +timer3.addTarget(new targets.LambdaFunction(fn, { + deadLetterQueue: queue, +})); + app.synth(); /* eslint-disable no-console */ diff --git a/packages/@aws-cdk/aws-events-targets/test/lambda/lambda.test.ts b/packages/@aws-cdk/aws-events-targets/test/lambda/lambda.test.ts index 29be8973fe3c3..c5fd260715293 100644 --- a/packages/@aws-cdk/aws-events-targets/test/lambda/lambda.test.ts +++ b/packages/@aws-cdk/aws-events-targets/test/lambda/lambda.test.ts @@ -1,6 +1,7 @@ import '@aws-cdk/assert/jest'; import * as events from '@aws-cdk/aws-events'; import * as lambda from '@aws-cdk/aws-lambda'; +import * as sqs from '@aws-cdk/aws-sqs'; import * as cdk from '@aws-cdk/core'; import * as constructs from 'constructs'; import * as targets from '../../lib'; @@ -147,6 +148,183 @@ test('lambda handler and cloudwatch event across stacks', () => { expect(eventStack).toCountResources('AWS::Lambda::Permission', 1); }); +test('use a Dead Letter Queue for the rule target', () => { + // GIVEN + const app = new cdk.App(); + const stack = new cdk.Stack(app, 'Stack'); + + const fn = new lambda.Function(stack, 'MyLambda', { + code: new lambda.InlineCode('foo'), + handler: 'bar', + runtime: lambda.Runtime.PYTHON_2_7, + }); + + const queue = new sqs.Queue(stack, 'Queue'); + + new events.Rule(stack, 'Rule', { + schedule: events.Schedule.rate(cdk.Duration.minutes(1)), + targets: [new targets.LambdaFunction(fn, { + deadLetterQueue: queue, + })], + }); + + expect(() => app.synth()).not.toThrow(); + + // the Permission resource should be in the event stack + expect(stack).toHaveResource('AWS::Events::Rule', { + Targets: [ + { + Arn: { + 'Fn::GetAtt': [ + 'MyLambdaCCE802FB', + 'Arn', + ], + }, + DeadLetterConfig: { + Arn: { + 'Fn::GetAtt': [ + 'Queue4A7E3555', + 'Arn', + ], + }, + }, + Id: 'Target0', + }, + ], + }); + + expect(stack).toHaveResource('AWS::SQS::QueuePolicy', { + PolicyDocument: { + Statement: [ + { + Action: 'sqs:SendMessage', + Condition: { + ArnEquals: { + 'aws:SourceArn': { + 'Fn::GetAtt': [ + 'Rule4C995B7F', + 'Arn', + ], + }, + }, + }, + Effect: 'Allow', + Principal: { + Service: 'events.amazonaws.com', + }, + Resource: { + 'Fn::GetAtt': [ + 'Queue4A7E3555', + 'Arn', + ], + }, + Sid: 'AllowEventRuleStackRuleF6E31DD0', + }, + ], + Version: '2012-10-17', + }, + Queues: [ + { + Ref: 'Queue4A7E3555', + }, + ], + }); +}); + +test('throw an error when using a Dead Letter Queue for the rule target in a different region', () => { + // GIVEN + const app = new cdk.App(); + const stack1 = new cdk.Stack(app, 'Stack1', { + env: { + region: 'eu-west-1', + }, + }); + const stack2 = new cdk.Stack(app, 'Stack2', { + env: { + region: 'eu-west-2', + }, + }); + + const fn = new lambda.Function(stack1, 'MyLambda', { + code: new lambda.InlineCode('foo'), + handler: 'bar', + runtime: lambda.Runtime.PYTHON_2_7, + }); + + const queue = new sqs.Queue(stack2, 'Queue'); + + let rule = new events.Rule(stack1, 'Rule', { + schedule: events.Schedule.rate(cdk.Duration.minutes(1)), + }); + + + expect(() => { + rule.addTarget(new targets.LambdaFunction(fn, { + deadLetterQueue: queue, + })); + }).toThrow(/Cannot assign Dead Letter Queue in region eu-west-2 to the rule Stack1Rule92BA1111 in region eu-west-1. Both the queue and the rule must be in the same region./); +}); + +test('must display a warning when using a Dead Letter Queue from another account', () => { + // GIVEN + const app = new cdk.App(); + const stack1 = new cdk.Stack(app, 'Stack1', { + env: { + region: 'eu-west-1', + account: '111111111111', + }, + }); + + const stack2 = new cdk.Stack(app, 'Stack2', { + env: { + region: 'eu-west-1', + account: '222222222222', + }, + }); + + const fn = new lambda.Function(stack1, 'MyLambda', { + code: new lambda.InlineCode('foo'), + handler: 'bar', + runtime: lambda.Runtime.PYTHON_2_7, + }); + + const queue = sqs.Queue.fromQueueArn(stack2, 'Queue', 'arn:aws:sqs:eu-west-1:444455556666:queue1'); + + new events.Rule(stack1, 'Rule', { + schedule: events.Schedule.rate(cdk.Duration.minutes(1)), + targets: [new targets.LambdaFunction(fn, { + deadLetterQueue: queue, + })], + }); + + expect(() => app.synth()).not.toThrow(); + + // the Permission resource should be in the event stack + expect(stack1).toHaveResource('AWS::Events::Rule', { + ScheduleExpression: 'rate(1 minute)', + State: 'ENABLED', + Targets: [ + { + Arn: { + 'Fn::GetAtt': [ + 'MyLambdaCCE802FB', + 'Arn', + ], + }, + DeadLetterConfig: { + Arn: 'arn:aws:sqs:eu-west-1:444455556666:queue1', + }, + Id: 'Target0', + }, + ], + }); + + expect(stack1).not.toHaveResource('AWS::SQS::QueuePolicy'); + + let rule = stack1.node.children.find(child => child instanceof events.Rule); + expect(rule?.node.metadata[0].data).toMatch(/Cannot add a resource policy to your dead letter queue associated with rule .* because the queue is in a different account\. You must add the resource policy manually to the dead letter queue in account 222222222222\./); +}); + function newTestLambda(scope: constructs.Construct, suffix = '') { return new lambda.Function(scope, `MyLambda${suffix}`, { code: new lambda.InlineCode('foo'), diff --git a/packages/@aws-cdk/aws-events/lib/rule.ts b/packages/@aws-cdk/aws-events/lib/rule.ts index 969965021f75d..2c71054b60828 100644 --- a/packages/@aws-cdk/aws-events/lib/rule.ts +++ b/packages/@aws-cdk/aws-events/lib/rule.ts @@ -295,6 +295,7 @@ export class Rule extends Resource implements IRule { kinesisParameters: targetProps.kinesisParameters, runCommandParameters: targetProps.runCommandParameters, batchParameters: targetProps.batchParameters, + deadLetterConfig: targetProps.deadLetterConfig, sqsParameters: targetProps.sqsParameters, input: inputProps && inputProps.input, inputPath: inputProps && inputProps.inputPath, diff --git a/packages/@aws-cdk/aws-events/lib/target.ts b/packages/@aws-cdk/aws-events/lib/target.ts index 319cf3d4f14da..da2ac9a1c7fb1 100644 --- a/packages/@aws-cdk/aws-events/lib/target.ts +++ b/packages/@aws-cdk/aws-events/lib/target.ts @@ -47,6 +47,12 @@ export interface RuleTargetConfig { */ readonly batchParameters?: CfnRule.BatchParametersProperty; + /** + * Contains information about a dead-letter queue configuration. + * @default no dead-letter queue set + */ + readonly deadLetterConfig?: CfnRule.DeadLetterConfigProperty; + /** * The Amazon ECS task definition and task count to use, if the event target * is an Amazon ECS task. From 75008bc4076a9fc9a0e9b74821c9205276e5fe84 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Wed, 3 Mar 2021 17:35:44 +0100 Subject: [PATCH 68/78] chore(guidelines): update ToC (#13372) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- DESIGN_GUIDELINES.md | 122 ++++++++++++++++++++++--------------------- 1 file changed, 62 insertions(+), 60 deletions(-) diff --git a/DESIGN_GUIDELINES.md b/DESIGN_GUIDELINES.md index 5924ec0321293..0a8566ab9d90c 100644 --- a/DESIGN_GUIDELINES.md +++ b/DESIGN_GUIDELINES.md @@ -1,65 +1,5 @@ # AWS Construct Library Design Guidelines -- [AWS Construct Library Design Guidelines](#aws-construct-library-design-guidelines) - - [What's Included](#what-s-included) - - [API Design](#api-design) - - [Modules](#modules) - - [Construct Class](#construct-class) - - [Construct Interface](#construct-interface) - - [Owned vs. Unowned Constructs](#owned-vs-unowned-constructs) - - [Abstract Base](#abstract-base) - - [Props](#props) - - [Types](#types) - - [Defaults](#defaults) - - [Flat](#flat) - - [Concise](#concise) - - [Naming](#naming) - - [Property Documentation](#property-documentation) - - [Enums](#enums) - - [Unions](#unions) - - [Attributes](#attributes) - - [Configuration](#configuration) - - [Prefer Additions](#prefer-additions) - - [Dropped Mutations](#dropped-mutations) - - [Factories](#factories) - - [Imports](#imports) - - [“from” Methods](#-from--methods) - - [From-attributes](#from-attributes) - - [Roles](#roles) - - [Resource Policies](#resource-policies) - - [VPC](#vpc) - - [Grants](#grants) - - [Metrics](#metrics) - - [Events](#events) - - [Connections](#connections) - - [Integrations](#integrations) - - [State](#state) - - [Physical Names - TODO](#physical-names---todo) - - [Tags](#tags) - - [Secrets](#secrets) - - [Project Structure](#project-structure) - - [Code Organization](#code-organization) - - [Implementation](#implementation) - - [General Principles](#general-principles) - - [Construct IDs](#construct-ids) - - [Errors](#errors) - - [Input Validation](#input-validation) - - [Avoid Errors If Possible](#avoid-errors-if-possible) - - [Never Catch Exceptions](#never-catch-exceptions) - - [Post Validation](#post-validation) - - [Attached Errors/Warnings](#attached-errors-warnings) - - [Tokens](#tokens) - - [Documentation](#documentation) - - [Inline Documentation](#inline-documentation) - - [Readme](#readme) - - [Testing](#testing) - - [Unit tests](#unit-tests) - - [Integration tests](#integration-tests) - - [Versioning](#versioning) - - [Naming & Style](#naming---style) - - [Naming Conventions](#naming-conventions) - - [Coding Style](#coding-style) - The AWS Construct Library is a rich class library of CDK constructs which represent all resources offered by the AWS Cloud and higher-level constructs for achieving common tasks. @@ -68,6 +8,68 @@ The purpose of this document is to provide guidelines for designing the APIs in the AWS Construct Library in order to ensure a consistent and integrated experience across the entire AWS surface area. +* [Preface](#preface) +* [What's Included](#what-s-included) +* [API Design](#api-design) + * [Modules](#modules) + * [Construct Class](#construct-class) + * [Construct Interface](#construct-interface) + * [Owned vs. Unowned Constructs](#owned-vs-unowned-constructs) + * [Abstract Base](#abstract-base) + * [Props](#props) + * [Types](#types) + * [Defaults](#defaults) + * [Flat](#flat) + * [Concise](#concise) + * [Naming](#naming) + * [Property Documentation](#property-documentation) + * [Enums](#enums) + * [Unions](#unions) + * [Attributes](#attributes) + * [Configuration](#configuration) + * [Prefer Additions](#prefer-additions) + * [Dropped Mutations](#dropped-mutations) + * [Factories](#factories) + * [Imports](#imports) + * [“from” Methods](#-from--methods) + * [From-attributes](#from-attributes) + * [Roles](#roles) + * [Resource Policies](#resource-policies) + * [VPC](#vpc) + * [Grants](#grants) + * [Metrics](#metrics) + * [Events](#events) + * [Connections](#connections) + * [Integrations](#integrations) + * [State](#state) + * [Physical Names - TODO](#physical-names---todo) + * [Tags](#tags) + * [Secrets](#secrets) +* [Project Structure](#project-structure) + * [Code Organization](#code-organization) +* [Implementation](#implementation) + * [General Principles](#general-principles) + * [Construct IDs](#construct-ids) + * [Errors](#errors) + * [Avoid Errors If Possible](#avoid-errors-if-possible) + * [Error reporting mechanism](#error-reporting-mechanism) + * [Throwing exceptions](#throwing-exceptions) + * [Never Catch Exceptions](#never-catch-exceptions) + * [Attaching (lazy) Validators](#attaching--lazy--validators) + * [Attaching Errors/Warnings](#attaching-errors-warnings) + * [Error messages](#error-messages) + * [Tokens](#tokens) +* [Documentation](#documentation) + * [Inline Documentation](#inline-documentation) + * [Readme](#readme) +* [Testing](#testing) + * [Unit tests](#unit-tests) + * [Integration tests](#integration-tests) + * [Versioning](#versioning) +* [Naming & Style](#naming---style) + * [Naming Conventions](#naming-conventions) + * [Coding Style](#coding-style) + ## Preface As much as possible, the guidelines in this document are enforced using the From 6126e499e5ca22b5f751af4f4f05d74f696829f1 Mon Sep 17 00:00:00 2001 From: Meng Xin Zhu Date: Thu, 4 Mar 2021 01:08:59 +0800 Subject: [PATCH 69/78] fix(stepfunctions): `SageMakeUpdateEndpoint` adds insufficient permissions (#13170) closes #11594 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../lib/sagemaker/update-endpoint.ts | 7 +++ .../integ.call-sagemaker.expected.json | 60 ++++++++++++------ .../test/sagemaker/update-endpoint.test.ts | 63 +++++++++++++++++++ 3 files changed, 111 insertions(+), 19 deletions(-) diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker/update-endpoint.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker/update-endpoint.ts index 4a4e068d816d0..4ff5bf4d19bb3 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker/update-endpoint.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker/update-endpoint.ts @@ -73,6 +73,13 @@ export class SageMakerUpdateEndpoint extends sfn.TaskStateBase { // SageMaker uses lowercase for resource name in the arn resourceName: sfn.JsonPath.isEncodedJsonPath(this.props.endpointName) ? '*' : `${this.props.endpointName.toLowerCase()}`, }), + stack.formatArn({ + service: 'sagemaker', + resource: 'endpoint-config', + // If the endpointConfig name comes from input, we cannot target the policy to a particular ARN prefix reliably. + // SageMaker uses lowercase for resource name in the arn + resourceName: sfn.JsonPath.isEncodedJsonPath(this.props.endpointConfigName) ? '*' : `${this.props.endpointConfigName.toLowerCase()}`, + }), ], }), ]; diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/sagemaker/integ.call-sagemaker.expected.json b/packages/@aws-cdk/aws-stepfunctions-tasks/test/sagemaker/integ.call-sagemaker.expected.json index 1e8f55ca57056..c163ebd11cf77 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/sagemaker/integ.call-sagemaker.expected.json +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/sagemaker/integ.call-sagemaker.expected.json @@ -465,26 +465,48 @@ { "Action": "sagemaker:updateEndpoint", "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":sagemaker:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":endpoint/*" + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":sagemaker:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":endpoint/*" + ] ] - ] - } + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":sagemaker:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":endpoint-config/*" + ] + ] + } + ] } ], "Version": "2012-10-17" diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/sagemaker/update-endpoint.test.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/test/sagemaker/update-endpoint.test.ts index f628ddbe9ed14..edd90392970b5 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/sagemaker/update-endpoint.test.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/sagemaker/update-endpoint.test.ts @@ -1,4 +1,5 @@ import '@aws-cdk/assert/jest'; +import * as iam from '@aws-cdk/aws-iam'; import * as sfn from '@aws-cdk/aws-stepfunctions'; import * as cdk from '@aws-cdk/core'; import * as tasks from '../../lib'; @@ -80,3 +81,65 @@ test('Task throws if WAIT_FOR_TASK_TOKEN is supplied as service integration patt }); }).toThrow(/Unsupported service integration pattern. Supported Patterns: REQUEST_RESPONSE. Received: WAIT_FOR_TASK_TOKEN/i); }); + +test('PolicyStatement has sufficient permissions', () => { + // WHEN + const props = { + endpointName: 'MyEndpoint', + endpointConfigName: 'MyEndpointConfig', + }; + const task = new tasks.SageMakerUpdateEndpoint(stack, 'SagemakerEndpoint', props); + + const graph = new sfn.StateGraph(task, 'test'); + + // THEN + expect(graph.policyStatements).toEqual( + [ + new iam.PolicyStatement({ + actions: ['sagemaker:updateEndpoint'], + resources: [ + stack.formatArn({ + service: 'sagemaker', + resource: 'endpoint', + resourceName: props.endpointName.toLowerCase(), + }), + stack.formatArn({ + service: 'sagemaker', + resource: 'endpoint-config', + resourceName: props.endpointConfigName.toLowerCase(), + }), + ], + }), + ], + ); + + // WHEN + const props2 = { + endpointName: sfn.JsonPath.stringAt('$.Endpoint.Name'), + endpointConfigName: sfn.JsonPath.stringAt('$.Endpoint.Config'), + }; + const task2 = new tasks.SageMakerUpdateEndpoint(stack, 'SagemakerEndpoint2', props2); + + const graph2 = new sfn.StateGraph(task2, 'test'); + + // THEN + expect(graph2.policyStatements).toEqual( + [ + new iam.PolicyStatement({ + actions: ['sagemaker:updateEndpoint'], + resources: [ + stack.formatArn({ + service: 'sagemaker', + resource: 'endpoint', + resourceName: '*', + }), + stack.formatArn({ + service: 'sagemaker', + resource: 'endpoint-config', + resourceName: '*', + }), + ], + }), + ], + ); +}); \ No newline at end of file From 6f7cebdf61073cc1fb358fcac5f5b2156389cb81 Mon Sep 17 00:00:00 2001 From: rli1994hi Date: Wed, 3 Mar 2021 09:42:58 -0800 Subject: [PATCH 70/78] fix(events): imported ECS Task Definition cannot be used as target (#13293) ### Note Fixes #12811 This change allows creating `EcsTask` from an imported task definition. It does so by changing the `taskDefinition` type in `EcsTaskProps` from concrete class `TaskDefinition` to interface `ITaskDefinition`. ### Testing `buildup` aws-events-targets ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../lib/base/_imported-task-definition.ts | 108 ++++++++ .../aws-ecs/lib/base/task-definition.ts | 73 +++++- .../aws-ecs/lib/ec2/ec2-task-definition.ts | 46 +++- .../lib/fargate/fargate-task-definition.ts | 42 ++- .../test/ec2/ec2-task-definition.test.ts | 81 +++++- .../fargate/fargate-task-definition.test.ts | 88 ++++++- .../aws-ecs/test/task-definition.test.ts | 131 ++++++++-- .../aws-events-targets/lib/ecs-task.ts | 11 +- .../test/ecs/event-rule-target.test.ts | 243 ++++++++++++++++++ 9 files changed, 774 insertions(+), 49 deletions(-) create mode 100644 packages/@aws-cdk/aws-ecs/lib/base/_imported-task-definition.ts diff --git a/packages/@aws-cdk/aws-ecs/lib/base/_imported-task-definition.ts b/packages/@aws-cdk/aws-ecs/lib/base/_imported-task-definition.ts new file mode 100644 index 0000000000000..3c9c583b96de0 --- /dev/null +++ b/packages/@aws-cdk/aws-ecs/lib/base/_imported-task-definition.ts @@ -0,0 +1,108 @@ +import { IRole } from '@aws-cdk/aws-iam'; +import { Construct } from 'constructs'; +import { IEc2TaskDefinition } from '../ec2/ec2-task-definition'; +import { IFargateTaskDefinition } from '../fargate/fargate-task-definition'; +import { Compatibility, NetworkMode, isEc2Compatible, isFargateCompatible } from './task-definition'; +import { Resource } from '@aws-cdk/core'; + +/** + * The properties of ImportedTaskDefinition + */ +export interface ImportedTaskDefinitionProps { + /** + * The arn of the task definition + */ + readonly taskDefinitionArn: string; + + /** + * What launch types this task definition should be compatible with. + * + * @default Compatibility.EC2_AND_FARGATE + */ + readonly compatibility?: Compatibility; + + /** + * The networking mode to use for the containers in the task. + * + * @default Network mode cannot be provided to the imported task. + */ + readonly networkMode?: NetworkMode; + + /** + * The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. + * + * @default Permissions cannot be granted to the imported task. + */ + readonly taskRole?: IRole; +} + +/** + * Task definition reference of an imported task + */ +export class ImportedTaskDefinition extends Resource implements IEc2TaskDefinition, IFargateTaskDefinition { + /** + * What launch types this task definition should be compatible with. + */ + readonly compatibility: Compatibility; + + /** + * ARN of this task definition + */ + readonly taskDefinitionArn: string; + + /** + * Execution role for this task definition + */ + readonly executionRole?: IRole = undefined; + + /** + * The networking mode to use for the containers in the task. + */ + readonly _networkMode?: NetworkMode; + + /** + * The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. + */ + readonly _taskRole?: IRole; + + constructor(scope: Construct, id: string, props: ImportedTaskDefinitionProps) { + super(scope, id); + + this.compatibility = props.compatibility ?? Compatibility.EC2_AND_FARGATE; + this.taskDefinitionArn = props.taskDefinitionArn; + this._taskRole = props.taskRole; + this._networkMode = props.networkMode; + } + + public get networkMode(): NetworkMode { + if (this._networkMode == undefined) { + throw new Error('This operation requires the networkMode in ImportedTaskDefinition to be defined. ' + + 'Add the \'networkMode\' in ImportedTaskDefinitionProps to instantiate ImportedTaskDefinition'); + } else { + return this._networkMode; + } + } + + public get taskRole(): IRole { + if (this._taskRole == undefined) { + throw new Error('This operation requires the taskRole in ImportedTaskDefinition to be defined. ' + + 'Add the \'taskRole\' in ImportedTaskDefinitionProps to instantiate ImportedTaskDefinition'); + } else { + return this._taskRole; + } + } + + /** + * Return true if the task definition can be run on an EC2 cluster + */ + public get isEc2Compatible(): boolean { + return isEc2Compatible(this.compatibility); + } + + /** + * Return true if the task definition can be run on a Fargate cluster + */ + public get isFargateCompatible(): boolean { + return isFargateCompatible(this.compatibility); + } +} diff --git a/packages/@aws-cdk/aws-ecs/lib/base/task-definition.ts b/packages/@aws-cdk/aws-ecs/lib/base/task-definition.ts index f7b0f05c92800..338fd59b39ea7 100644 --- a/packages/@aws-cdk/aws-ecs/lib/base/task-definition.ts +++ b/packages/@aws-cdk/aws-ecs/lib/base/task-definition.ts @@ -8,6 +8,7 @@ import { FirelensLogRouter, FirelensLogRouterDefinitionOptions, FirelensLogRoute import { AwsLogDriver } from '../log-drivers/aws-log-driver'; import { PlacementConstraint } from '../placement'; import { ProxyConfiguration } from '../proxy-configuration/proxy-configuration'; +import { ImportedTaskDefinition } from './_imported-task-definition'; /** * The interface for all task definitions. @@ -38,6 +39,16 @@ export interface ITaskDefinition extends IResource { * Return true if the task definition can be run on a Fargate cluster */ readonly isFargateCompatible: boolean; + + /** + * The networking mode to use for the containers in the task. + */ + readonly networkMode: NetworkMode; + + /** + * The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. + */ + readonly taskRole: iam.IRole; } /** @@ -175,10 +186,48 @@ export interface TaskDefinitionProps extends CommonTaskDefinitionProps { readonly pidMode?: PidMode; } +/** + * The common task definition attributes used across all types of task definitions. + */ +export interface CommonTaskDefinitionAttributes { + /** + * The arn of the task definition + */ + readonly taskDefinitionArn: string; + + /** + * The networking mode to use for the containers in the task. + * + * @default Network mode cannot be provided to the imported task. + */ + readonly networkMode?: NetworkMode; + + /** + * The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. + * + * @default Permissions cannot be granted to the imported task. + */ + readonly taskRole?: iam.IRole; +} + +/** + * A reference to an existing task definition + */ +export interface TaskDefinitionAttributes extends CommonTaskDefinitionAttributes { + /** + * What launch types this task definition should be compatible with. + * + * @default Compatibility.EC2_AND_FARGATE + */ + readonly compatibility?: Compatibility; +} + abstract class TaskDefinitionBase extends Resource implements ITaskDefinition { public abstract readonly compatibility: Compatibility; + public abstract readonly networkMode: NetworkMode; public abstract readonly taskDefinitionArn: string; + public abstract readonly taskRole: iam.IRole; public abstract readonly executionRole?: iam.IRole; /** @@ -207,13 +256,19 @@ export class TaskDefinition extends TaskDefinitionBase { * The task will have a compatibility of EC2+Fargate. */ public static fromTaskDefinitionArn(scope: Construct, id: string, taskDefinitionArn: string): ITaskDefinition { - class Import extends TaskDefinitionBase { - public readonly taskDefinitionArn = taskDefinitionArn; - public readonly compatibility = Compatibility.EC2_AND_FARGATE; - public readonly executionRole?: iam.IRole = undefined; - } + return new ImportedTaskDefinition(scope, id, { taskDefinitionArn: taskDefinitionArn }); + } - return new Import(scope, id); + /** + * Create a task definition from a task definition reference + */ + public static fromTaskDefinitionAttributes(scope: Construct, id: string, attrs: TaskDefinitionAttributes): ITaskDefinition { + return new ImportedTaskDefinition(scope, id, { + taskDefinitionArn: attrs.taskDefinitionArn, + compatibility: attrs.compatibility, + networkMode: attrs.networkMode, + taskRole: attrs.taskRole, + }); } /** @@ -248,7 +303,7 @@ export class TaskDefinition extends TaskDefinitionBase { public defaultContainer?: ContainerDefinition; /** - * The task launch type compatiblity requirement. + * The task launch type compatibility requirement. */ public readonly compatibility: Compatibility; @@ -890,13 +945,13 @@ export interface ITaskDefinitionExtension { /** * Return true if the given task definition can be run on an EC2 cluster */ -function isEc2Compatible(compatibility: Compatibility): boolean { +export function isEc2Compatible(compatibility: Compatibility): boolean { return [Compatibility.EC2, Compatibility.EC2_AND_FARGATE].includes(compatibility); } /** * Return true if the given task definition can be run on a Fargate cluster */ -function isFargateCompatible(compatibility: Compatibility): boolean { +export function isFargateCompatible(compatibility: Compatibility): boolean { return [Compatibility.FARGATE, Compatibility.EC2_AND_FARGATE].includes(compatibility); } diff --git a/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-task-definition.ts b/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-task-definition.ts index 67d096830b9c7..ff571c884b73e 100644 --- a/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-task-definition.ts +++ b/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-task-definition.ts @@ -1,7 +1,16 @@ -import { Resource } from '@aws-cdk/core'; import { Construct } from 'constructs'; -import { CommonTaskDefinitionProps, Compatibility, IpcMode, ITaskDefinition, NetworkMode, PidMode, TaskDefinition } from '../base/task-definition'; +import { + CommonTaskDefinitionAttributes, + CommonTaskDefinitionProps, + Compatibility, + IpcMode, + ITaskDefinition, + NetworkMode, + PidMode, + TaskDefinition, +} from '../base/task-definition'; import { PlacementConstraint } from '../placement'; +import { ImportedTaskDefinition } from '../base/_imported-task-definition'; /** * The properties for a task definition run on an EC2 cluster. @@ -51,6 +60,13 @@ export interface IEc2TaskDefinition extends ITaskDefinition { } +/** + * Attributes used to import an existing EC2 task definition + */ +export interface Ec2TaskDefinitionAttributes extends CommonTaskDefinitionAttributes { + +} + /** * The details of a task definition run on an EC2 cluster. * @@ -62,13 +78,25 @@ export class Ec2TaskDefinition extends TaskDefinition implements IEc2TaskDefinit * Imports a task definition from the specified task definition ARN. */ public static fromEc2TaskDefinitionArn(scope: Construct, id: string, ec2TaskDefinitionArn: string): IEc2TaskDefinition { - class Import extends Resource implements IEc2TaskDefinition { - public readonly taskDefinitionArn = ec2TaskDefinitionArn; - public readonly compatibility = Compatibility.EC2; - public readonly isEc2Compatible = true; - public readonly isFargateCompatible = false; - } - return new Import(scope, id); + return new ImportedTaskDefinition(scope, id, { + taskDefinitionArn: ec2TaskDefinitionArn, + }); + } + + /** + * Imports an existing Ec2 task definition from its attributes + */ + public static fromEc2TaskDefinitionAttributes( + scope: Construct, + id: string, + attrs: Ec2TaskDefinitionAttributes, + ): IEc2TaskDefinition { + return new ImportedTaskDefinition(scope, id, { + taskDefinitionArn: attrs.taskDefinitionArn, + compatibility: Compatibility.EC2, + networkMode: attrs.networkMode, + taskRole: attrs.taskRole, + }); } /** diff --git a/packages/@aws-cdk/aws-ecs/lib/fargate/fargate-task-definition.ts b/packages/@aws-cdk/aws-ecs/lib/fargate/fargate-task-definition.ts index eba4ac4371ee8..3d8d113886709 100644 --- a/packages/@aws-cdk/aws-ecs/lib/fargate/fargate-task-definition.ts +++ b/packages/@aws-cdk/aws-ecs/lib/fargate/fargate-task-definition.ts @@ -1,6 +1,14 @@ -import { Resource, Tokenization } from '@aws-cdk/core'; +import { Tokenization } from '@aws-cdk/core'; import { Construct } from 'constructs'; -import { CommonTaskDefinitionProps, Compatibility, ITaskDefinition, NetworkMode, TaskDefinition } from '../base/task-definition'; +import { + CommonTaskDefinitionAttributes, + CommonTaskDefinitionProps, + Compatibility, + ITaskDefinition, + NetworkMode, + TaskDefinition, +} from '../base/task-definition'; +import { ImportedTaskDefinition } from '../base/_imported-task-definition'; /** * The properties for a task definition. @@ -51,6 +59,13 @@ export interface IFargateTaskDefinition extends ITaskDefinition { } +/** + * Attributes used to import an existing Fargate task definition + */ +export interface FargateTaskDefinitionAttributes extends CommonTaskDefinitionAttributes { + +} + /** * The details of a task definition run on a Fargate cluster. * @@ -62,14 +77,23 @@ export class FargateTaskDefinition extends TaskDefinition implements IFargateTas * Imports a task definition from the specified task definition ARN. */ public static fromFargateTaskDefinitionArn(scope: Construct, id: string, fargateTaskDefinitionArn: string): IFargateTaskDefinition { - class Import extends Resource implements IFargateTaskDefinition { - public readonly taskDefinitionArn = fargateTaskDefinitionArn; - public readonly compatibility = Compatibility.FARGATE; - public readonly isEc2Compatible = false; - public readonly isFargateCompatible = true; - } + return new ImportedTaskDefinition(scope, id, { taskDefinitionArn: fargateTaskDefinitionArn }); + } - return new Import(scope, id); + /** + * Import an existing Fargate task definition from its attributes + */ + public static fromFargateTaskDefinitionAttributes( + scope: Construct, + id: string, + attrs: FargateTaskDefinitionAttributes, + ): IFargateTaskDefinition { + return new ImportedTaskDefinition(scope, id, { + taskDefinitionArn: attrs.taskDefinitionArn, + compatibility: Compatibility.FARGATE, + networkMode: attrs.networkMode, + taskRole: attrs.taskRole, + }); } /** diff --git a/packages/@aws-cdk/aws-ecs/test/ec2/ec2-task-definition.test.ts b/packages/@aws-cdk/aws-ecs/test/ec2/ec2-task-definition.test.ts index bd13e8b83b524..4f713b06d2d71 100644 --- a/packages/@aws-cdk/aws-ecs/test/ec2/ec2-task-definition.test.ts +++ b/packages/@aws-cdk/aws-ecs/test/ec2/ec2-task-definition.test.ts @@ -1199,6 +1199,85 @@ describe('ec2 task definition', () => { }); }); + describe('When importing from an existing Ec2 TaskDefinition', () => { + test('can succeed using TaskDefinition Arn', () => { + // GIVEN + const stack = new cdk.Stack(); + const expectTaskDefinitionArn = 'TD_ARN'; + + // WHEN + const taskDefinition = ecs.Ec2TaskDefinition.fromEc2TaskDefinitionArn(stack, 'EC2_TD_ID', expectTaskDefinitionArn); + + // THEN + expect(taskDefinition.taskDefinitionArn).toBe(expectTaskDefinitionArn); + }); + }); + + describe('When importing from an existing Ec2 TaskDefinition using attributes', () => { + test('can set the imported task attribuets successfully', () => { + // GIVEN + const stack = new cdk.Stack(); + const expectTaskDefinitionArn = 'TD_ARN'; + const expectNetworkMode = ecs.NetworkMode.AWS_VPC; + const expectTaskRole = new iam.Role(stack, 'TaskRole', { + assumedBy: new iam.ServicePrincipal('ecs-tasks.amazonaws.com'), + }); + + // WHEN + const taskDefinition = ecs.Ec2TaskDefinition.fromEc2TaskDefinitionAttributes(stack, 'TD_ID', { + taskDefinitionArn: expectTaskDefinitionArn, + networkMode: expectNetworkMode, + taskRole: expectTaskRole, + }); + + // THEN + expect(taskDefinition.taskDefinitionArn).toBe(expectTaskDefinitionArn); + expect(taskDefinition.compatibility).toBe(ecs.Compatibility.EC2); + expect(taskDefinition.isEc2Compatible).toBeTruthy(); + expect(taskDefinition.isFargateCompatible).toBeFalsy(); + expect(taskDefinition.networkMode).toBe(expectNetworkMode); + expect(taskDefinition.taskRole).toBe(expectTaskRole); + }); + + test('returns an Ec2 TaskDefinition that will throw an error when trying to access its yet to defined networkMode', () => { + // GIVEN + const stack = new cdk.Stack(); + const expectTaskDefinitionArn = 'TD_ARN'; + const expectTaskRole = new iam.Role(stack, 'TaskRole', { + assumedBy: new iam.ServicePrincipal('ecs-tasks.amazonaws.com'), + }); + + // WHEN + const taskDefinition = ecs.Ec2TaskDefinition.fromEc2TaskDefinitionAttributes(stack, 'TD_ID', { + taskDefinitionArn: expectTaskDefinitionArn, + taskRole: expectTaskRole, + }); + + // THEN + expect(() => taskDefinition.networkMode).toThrow( + 'This operation requires the networkMode in ImportedTaskDefinition to be defined. ' + + 'Add the \'networkMode\' in ImportedTaskDefinitionProps to instantiate ImportedTaskDefinition'); + }); + + test('returns an Ec2 TaskDefinition that will throw an error when trying to access its yet to defined taskRole', () => { + // GIVEN + const stack = new cdk.Stack(); + const expectTaskDefinitionArn = 'TD_ARN'; + const expectNetworkMode = ecs.NetworkMode.AWS_VPC; + + // WHEN + const taskDefinition = ecs.Ec2TaskDefinition.fromEc2TaskDefinitionAttributes(stack, 'TD_ID', { + taskDefinitionArn: expectTaskDefinitionArn, + networkMode: expectNetworkMode, + }); + + // THEN + expect(() => { taskDefinition.taskRole; }).toThrow( + 'This operation requires the taskRole in ImportedTaskDefinition to be defined. ' + + 'Add the \'taskRole\' in ImportedTaskDefinitionProps to instantiate ImportedTaskDefinition'); + }); + }); + test('throws when setting proxyConfiguration without networkMode AWS_VPC', () => { // GIVEN const stack = new cdk.Stack(); @@ -1218,7 +1297,5 @@ describe('ec2 task definition', () => { expect(() => { new ecs.Ec2TaskDefinition(stack, 'TaskDef', { networkMode: ecs.NetworkMode.BRIDGE, proxyConfiguration }); }).toThrow(/ProxyConfiguration can only be used with AwsVpc network mode, got: bridge/); - - }); }); diff --git a/packages/@aws-cdk/aws-ecs/test/fargate/fargate-task-definition.test.ts b/packages/@aws-cdk/aws-ecs/test/fargate/fargate-task-definition.test.ts index 00ec0028ef1a3..b8fad1bc9316f 100644 --- a/packages/@aws-cdk/aws-ecs/test/fargate/fargate-task-definition.test.ts +++ b/packages/@aws-cdk/aws-ecs/test/fargate/fargate-task-definition.test.ts @@ -5,7 +5,7 @@ import { nodeunitShim, Test } from 'nodeunit-shim'; import * as ecs from '../../lib'; nodeunitShim({ - 'When creating an Fargate TaskDefinition': { + 'When creating a Fargate TaskDefinition': { 'with only required properties set, it correctly sets default properties'(test: Test) { // GIVEN const stack = new cdk.Stack(); @@ -114,4 +114,90 @@ nodeunitShim({ test.done(); }, }, + + 'When importing from an existing Fargate TaskDefinition': { + 'can succeed using TaskDefinition Arn'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + const expectTaskDefinitionArn = 'TD_ARN'; + + // WHEN + const taskDefinition = ecs.FargateTaskDefinition.fromFargateTaskDefinitionArn(stack, 'FARGATE_TD_ID', expectTaskDefinitionArn); + + // THEN + test.equal(taskDefinition.taskDefinitionArn, expectTaskDefinitionArn); + test.done(); + }, + + 'can succeed using attributes'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + const expectTaskDefinitionArn = 'TD_ARN'; + const expectNetworkMode = ecs.NetworkMode.AWS_VPC; + const expectTaskRole = new iam.Role(stack, 'TaskRole', { + assumedBy: new iam.ServicePrincipal('ecs-tasks.amazonaws.com'), + }); + + // WHEN + const taskDefinition = ecs.FargateTaskDefinition.fromFargateTaskDefinitionAttributes(stack, 'TD_ID', { + taskDefinitionArn: expectTaskDefinitionArn, + networkMode: expectNetworkMode, + taskRole: expectTaskRole, + }); + + // THEN + test.equal(taskDefinition.taskDefinitionArn, expectTaskDefinitionArn); + test.equal(taskDefinition.compatibility, ecs.Compatibility.FARGATE); + test.ok(taskDefinition.isFargateCompatible); + test.equal(taskDefinition.isEc2Compatible, false); + test.equal(taskDefinition.networkMode, expectNetworkMode); + test.equal(taskDefinition.taskRole, expectTaskRole); + + test.done(); + }, + + 'returns a Fargate TaskDefinition that will throw an error when trying to access its networkMode but its networkMode is undefined'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + const expectTaskDefinitionArn = 'TD_ARN'; + const expectTaskRole = new iam.Role(stack, 'TaskRole', { + assumedBy: new iam.ServicePrincipal('ecs-tasks.amazonaws.com'), + }); + + // WHEN + const taskDefinition = ecs.FargateTaskDefinition.fromFargateTaskDefinitionAttributes(stack, 'TD_ID', { + taskDefinitionArn: expectTaskDefinitionArn, + taskRole: expectTaskRole, + }); + + // THEN + test.throws(() => { + taskDefinition.networkMode; + }, 'This operation requires the networkMode in ImportedTaskDefinition to be defined. ' + + 'Add the \'networkMode\' in ImportedTaskDefinitionProps to instantiate ImportedTaskDefinition'); + + test.done(); + }, + + 'returns a Fargate TaskDefinition that will throw an error when trying to access its taskRole but its taskRole is undefined'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + const expectTaskDefinitionArn = 'TD_ARN'; + const expectNetworkMode = ecs.NetworkMode.AWS_VPC; + + // WHEN + const taskDefinition = ecs.FargateTaskDefinition.fromFargateTaskDefinitionAttributes(stack, 'TD_ID', { + taskDefinitionArn: expectTaskDefinitionArn, + networkMode: expectNetworkMode, + }); + + // THEN + test.throws(() => { + taskDefinition.taskRole; + }, 'This operation requires the taskRole in ImportedTaskDefinition to be defined. ' + + 'Add the \'taskRole\' in ImportedTaskDefinitionProps to instantiate ImportedTaskDefinition'); + + test.done(); + }, + }, }); diff --git a/packages/@aws-cdk/aws-ecs/test/task-definition.test.ts b/packages/@aws-cdk/aws-ecs/test/task-definition.test.ts index 34a7306106d66..709d3abd86026 100644 --- a/packages/@aws-cdk/aws-ecs/test/task-definition.test.ts +++ b/packages/@aws-cdk/aws-ecs/test/task-definition.test.ts @@ -2,24 +2,121 @@ import { expect, haveResource } from '@aws-cdk/assert'; import * as cdk from '@aws-cdk/core'; import { nodeunitShim, Test } from 'nodeunit-shim'; import * as ecs from '../lib'; +import * as iam from '@aws-cdk/aws-iam'; nodeunitShim({ - 'A task definition with both compatibilities defaults to networkmode AwsVpc'(test: Test) { - // GIVEN - const stack = new cdk.Stack(); - - // WHEN - new ecs.TaskDefinition(stack, 'TD', { - cpu: '512', - memoryMiB: '512', - compatibility: ecs.Compatibility.EC2_AND_FARGATE, - }); - - // THEN - expect(stack).to(haveResource('AWS::ECS::TaskDefinition', { - NetworkMode: 'awsvpc', - })); - - test.done(); + 'When creating a new TaskDefinition': { + 'A task definition with both compatibilities defaults to networkmode AwsVpc'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + + // WHEN + new ecs.TaskDefinition(stack, 'TD', { + cpu: '512', + memoryMiB: '512', + compatibility: ecs.Compatibility.EC2_AND_FARGATE, + }); + + // THEN + expect(stack).to(haveResource('AWS::ECS::TaskDefinition', { + NetworkMode: 'awsvpc', + })); + + test.done(); + }, + }, + + 'When importing from an existing Task definition': { + 'can import using a task definition arn'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + const taskDefinitionArn = 'TDArn'; + + // WHEN + const taskDefinition = ecs.TaskDefinition.fromTaskDefinitionArn(stack, 'TD_ID', taskDefinitionArn); + + // THEN + test.equal(taskDefinition.taskDefinitionArn, taskDefinitionArn); + test.equal(taskDefinition.compatibility, ecs.Compatibility.EC2_AND_FARGATE); + test.equal(taskDefinition.executionRole, undefined); + + test.done(); + }, + + 'can import a Task Definition using attributes'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + const expectTaskDefinitionArn = 'TD_ARN'; + const expectCompatibility = ecs.Compatibility.EC2; + const expectNetworkMode = ecs.NetworkMode.AWS_VPC; + const expectTaskRole = new iam.Role(stack, 'TaskRole', { + assumedBy: new iam.ServicePrincipal('ecs-tasks.amazonaws.com'), + }); + + // WHEN + const taskDefinition = ecs.TaskDefinition.fromTaskDefinitionAttributes(stack, 'TD_ID', { + taskDefinitionArn: expectTaskDefinitionArn, + compatibility: expectCompatibility, + networkMode: expectNetworkMode, + taskRole: expectTaskRole, + }); + + // THEN + test.equal(taskDefinition.taskDefinitionArn, expectTaskDefinitionArn); + test.equal(taskDefinition.compatibility, expectCompatibility); + test.equal(taskDefinition.executionRole, undefined); + test.equal(taskDefinition.networkMode, expectNetworkMode); + test.equal(taskDefinition.taskRole, expectTaskRole); + + test.done(); + }, + + 'returns an imported TaskDefinition that will throw an error when trying to access its yet to defined networkMode'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + const expectTaskDefinitionArn = 'TD_ARN'; + const expectCompatibility = ecs.Compatibility.EC2; + const expectTaskRole = new iam.Role(stack, 'TaskRole', { + assumedBy: new iam.ServicePrincipal('ecs-tasks.amazonaws.com'), + }); + + // WHEN + const taskDefinition = ecs.TaskDefinition.fromTaskDefinitionAttributes(stack, 'TD_ID', { + taskDefinitionArn: expectTaskDefinitionArn, + compatibility: expectCompatibility, + taskRole: expectTaskRole, + }); + + // THEN + test.throws(() => { + taskDefinition.networkMode; + }, 'This operation requires the networkMode in ImportedTaskDefinition to be defined. ' + + 'Add the \'networkMode\' in ImportedTaskDefinitionProps to instantiate ImportedTaskDefinition'); + + test.done(); + }, + + 'returns an imported TaskDefinition that will throw an error when trying to access its yet to defined taskRole'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + const expectTaskDefinitionArn = 'TD_ARN'; + const expectCompatibility = ecs.Compatibility.EC2; + const expectNetworkMode = ecs.NetworkMode.AWS_VPC; + + // WHEN + const taskDefinition = ecs.TaskDefinition.fromTaskDefinitionAttributes(stack, 'TD_ID', { + taskDefinitionArn: expectTaskDefinitionArn, + compatibility: expectCompatibility, + networkMode: expectNetworkMode, + }); + + // THEN + test.throws(() => { + taskDefinition.taskRole; + }, 'This operation requires the taskRole in ImportedTaskDefinition to be defined. ' + + 'Add the \'taskRole\' in ImportedTaskDefinitionProps to instantiate ImportedTaskDefinition'); + + test.done(); + }, }, }); diff --git a/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts b/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts index baff4c76cde66..a31fc0b68ca5c 100644 --- a/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts +++ b/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts @@ -18,7 +18,7 @@ export interface EcsTaskProps { /** * Task Definition of the task that should be started */ - readonly taskDefinition: ecs.TaskDefinition; + readonly taskDefinition: ecs.ITaskDefinition; /** * How many tasks should be started when this event is triggered @@ -103,7 +103,7 @@ export class EcsTask implements events.IRuleTarget { */ public readonly securityGroups?: ec2.ISecurityGroup[]; private readonly cluster: ecs.ICluster; - private readonly taskDefinition: ecs.TaskDefinition; + private readonly taskDefinition: ecs.ITaskDefinition; private readonly taskCount: number; private readonly role: iam.IRole; private readonly platformVersion?: ecs.FargatePlatformVersion; @@ -137,6 +137,13 @@ export class EcsTask implements events.IRuleTarget { this.securityGroups = props.securityGroups; return; } + + if (!cdk.Construct.isConstruct(this.taskDefinition)) { + throw new Error('Cannot create a security group for ECS task. ' + + 'The task definition in ECS task is not a Construct. ' + + 'Please pass a taskDefinition as a Construct in EcsTaskProps.'); + } + let securityGroup = props.securityGroup || this.taskDefinition.node.tryFindChild('SecurityGroup') as ec2.ISecurityGroup; securityGroup = securityGroup || new ec2.SecurityGroup(this.taskDefinition, 'SecurityGroup', { vpc: this.props.cluster.vpc }); this.securityGroup = securityGroup; // Maintain backwards-compatibility for customers that read the generated security group. diff --git a/packages/@aws-cdk/aws-events-targets/test/ecs/event-rule-target.test.ts b/packages/@aws-cdk/aws-events-targets/test/ecs/event-rule-target.test.ts index 4ac8347d02ec3..f0ab7770fadbd 100644 --- a/packages/@aws-cdk/aws-events-targets/test/ecs/event-rule-target.test.ts +++ b/packages/@aws-cdk/aws-events-targets/test/ecs/event-rule-target.test.ts @@ -58,6 +58,249 @@ test('Can use EC2 taskdef as EventRule target', () => { }); }); +test('Throws error for lacking of taskRole ' + + 'when importing from an EC2 task definition just from a task definition arn as EventRule target', () => { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 1 }); + const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc }); + cluster.addCapacity('DefaultAutoScalingGroup', { + instanceType: new ec2.InstanceType('t2.micro'), + }); + + const taskDefinition = ecs.Ec2TaskDefinition.fromEc2TaskDefinitionArn(stack, 'TaskDef', 'importedTaskDefArn'); + + const rule = new events.Rule(stack, 'Rule', { + schedule: events.Schedule.expression('rate(1 min)'), + }); + + // THEN + expect(() => { + rule.addTarget(new targets.EcsTask({ + cluster, + taskDefinition, + taskCount: 1, + containerOverrides: [{ + containerName: 'TheContainer', + command: ['echo', events.EventField.fromPath('$.detail.event')], + }], + })); + }).toThrow('This operation requires the taskRole in ImportedTaskDefinition to be defined. ' + + 'Add the \'taskRole\' in ImportedTaskDefinitionProps to instantiate ImportedTaskDefinition'); +}); + +test('Can import an EC2 task definition from task definition attributes as EventRule target', () => { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 1 }); + const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc }); + cluster.addCapacity('DefaultAutoScalingGroup', { + instanceType: new ec2.InstanceType('t2.micro'), + }); + + const taskDefinition = ecs.Ec2TaskDefinition.fromEc2TaskDefinitionAttributes(stack, 'TaskDef', { + taskDefinitionArn: 'importedTaskDefArn', + networkMode: ecs.NetworkMode.BRIDGE, + taskRole: new iam.Role(stack, 'TaskRole', { + assumedBy: new iam.ServicePrincipal('ecs-tasks.amazonaws.com'), + }), + }); + + const rule = new events.Rule(stack, 'Rule', { + schedule: events.Schedule.expression('rate(1 min)'), + }); + + // WHEN + rule.addTarget(new targets.EcsTask({ + cluster, + taskDefinition, + taskCount: 1, + containerOverrides: [{ + containerName: 'TheContainer', + command: ['echo', events.EventField.fromPath('$.detail.event')], + }], + })); + + // THEN + expect(stack).toHaveResourceLike('AWS::Events::Rule', { + Targets: [ + { + Arn: { 'Fn::GetAtt': ['EcsCluster97242B84', 'Arn'] }, + EcsParameters: { + TaskCount: 1, + TaskDefinitionArn: 'importedTaskDefArn', + }, + InputTransformer: { + InputPathsMap: { + 'detail-event': '$.detail.event', + }, + InputTemplate: '{"containerOverrides":[{"name":"TheContainer","command":["echo",]}]}', + }, + RoleArn: { 'Fn::GetAtt': ['TaskDefEventsRoleFB3B67B8', 'Arn'] }, + Id: 'Target0', + }, + ], + }); +}); + +test('Throws error for lacking of taskRole ' + + 'when importing from a Fargate task definition just from a task definition arn as EventRule target', () => { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 1 }); + const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc }); + + const taskDefinition = ecs.FargateTaskDefinition.fromFargateTaskDefinitionArn(stack, 'TaskDef', 'ImportedTaskDefArn'); + + const rule = new events.Rule(stack, 'Rule', { + schedule: events.Schedule.expression('rate(1 min)'), + }); + + // THEN + expect(() => { + rule.addTarget(new targets.EcsTask({ + cluster, + taskDefinition, + taskCount: 1, + containerOverrides: [{ + containerName: 'TheContainer', + command: ['echo', events.EventField.fromPath('$.detail.event')], + }], + })); + }).toThrow('This operation requires the taskRole in ImportedTaskDefinition to be defined. ' + + 'Add the \'taskRole\' in ImportedTaskDefinitionProps to instantiate ImportedTaskDefinition'); +}); + +test('Can import a Fargate task definition from task definition attributes as EventRule target', () => { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 1 }); + const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc }); + + const taskDefinition = ecs.FargateTaskDefinition.fromFargateTaskDefinitionAttributes(stack, 'TaskDef', { + taskDefinitionArn: 'importedTaskDefArn', + networkMode: ecs.NetworkMode.AWS_VPC, + taskRole: new iam.Role(stack, 'TaskRole', { + assumedBy: new iam.ServicePrincipal('ecs-tasks.amazonaws.com'), + }), + }); + + const rule = new events.Rule(stack, 'Rule', { + schedule: events.Schedule.expression('rate(1 min)'), + }); + + // WHEN + rule.addTarget(new targets.EcsTask({ + cluster, + taskDefinition, + taskCount: 1, + containerOverrides: [{ + containerName: 'TheContainer', + command: ['echo', events.EventField.fromPath('$.detail.event')], + }], + })); + + // THEN + expect(stack).toHaveResourceLike('AWS::Events::Rule', { + Targets: [ + { + Arn: { 'Fn::GetAtt': ['EcsCluster97242B84', 'Arn'] }, + EcsParameters: { + TaskCount: 1, + TaskDefinitionArn: 'importedTaskDefArn', + }, + InputTransformer: { + InputPathsMap: { + 'detail-event': '$.detail.event', + }, + InputTemplate: '{"containerOverrides":[{"name":"TheContainer","command":["echo",]}]}', + }, + RoleArn: { 'Fn::GetAtt': ['TaskDefEventsRoleFB3B67B8', 'Arn'] }, + Id: 'Target0', + }, + ], + }); +}); + +test('Throws error for lacking of taskRole ' + + 'when importing from a task definition just from a task definition arn as EventRule target', () => { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 1 }); + const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc }); + + const taskDefinition = ecs.TaskDefinition.fromTaskDefinitionArn(stack, 'TaskDef', 'ImportedTaskDefArn'); + + const rule = new events.Rule(stack, 'Rule', { + schedule: events.Schedule.expression('rate(1 min)'), + }); + + // THEN + expect(() => { + rule.addTarget(new targets.EcsTask({ + cluster, + taskDefinition, + taskCount: 1, + containerOverrides: [{ + containerName: 'TheContainer', + command: ['echo', events.EventField.fromPath('$.detail.event')], + }], + })); + }).toThrow('This operation requires the taskRole in ImportedTaskDefinition to be defined. ' + + 'Add the \'taskRole\' in ImportedTaskDefinitionProps to instantiate ImportedTaskDefinition'); +}); + +test('Can import a Task definition from task definition attributes as EventRule target', () => { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 1 }); + const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc }); + + const taskDefinition = ecs.FargateTaskDefinition.fromFargateTaskDefinitionAttributes(stack, 'TaskDef', { + taskDefinitionArn: 'importedTaskDefArn', + networkMode: ecs.NetworkMode.AWS_VPC, + taskRole: new iam.Role(stack, 'TaskRole', { + assumedBy: new iam.ServicePrincipal('ecs-tasks.amazonaws.com'), + }), + }); + + const rule = new events.Rule(stack, 'Rule', { + schedule: events.Schedule.expression('rate(1 min)'), + }); + + // WHEN + rule.addTarget(new targets.EcsTask({ + cluster, + taskDefinition, + taskCount: 1, + containerOverrides: [{ + containerName: 'TheContainer', + command: ['echo', events.EventField.fromPath('$.detail.event')], + }], + })); + + // THEN + expect(stack).toHaveResourceLike('AWS::Events::Rule', { + Targets: [ + { + Arn: { 'Fn::GetAtt': ['EcsCluster97242B84', 'Arn'] }, + EcsParameters: { + TaskCount: 1, + TaskDefinitionArn: 'importedTaskDefArn', + }, + InputTransformer: { + InputPathsMap: { + 'detail-event': '$.detail.event', + }, + InputTemplate: '{"containerOverrides":[{"name":"TheContainer","command":["echo",]}]}', + }, + RoleArn: { 'Fn::GetAtt': ['TaskDefEventsRoleFB3B67B8', 'Arn'] }, + Id: 'Target0', + }, + ], + }); +}); + test('Can use Fargate taskdef as EventRule target', () => { // GIVEN const stack = new cdk.Stack(); From cbcc712e0c4c44c83c7f4d1e8a544bccfa26bb56 Mon Sep 17 00:00:00 2001 From: Jonne Kaunisto Date: Wed, 3 Mar 2021 10:15:59 -0800 Subject: [PATCH 71/78] fix(cloudwatch): metric `label` not rendered into Alarms (#13070) Cloudwatch allows adding labels to metrics. These can be seen when viewing alarms. Currently labels only work for math expression metrics. This change will fix it to work for single alarm metrics too. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-cloudwatch/lib/alarm.ts | 46 ++++++++++++----- .../test/integ.alarm-with-label.expected.json | 50 +++++++++++++++++++ .../test/integ.alarm-with-label.ts | 32 ++++++++++++ 3 files changed, 116 insertions(+), 12 deletions(-) create mode 100644 packages/@aws-cdk/aws-cloudwatch/test/integ.alarm-with-label.expected.json create mode 100644 packages/@aws-cdk/aws-cloudwatch/test/integ.alarm-with-label.ts diff --git a/packages/@aws-cdk/aws-cloudwatch/lib/alarm.ts b/packages/@aws-cdk/aws-cloudwatch/lib/alarm.ts index 5c1daacb54dd3..73c1209733b5f 100644 --- a/packages/@aws-cdk/aws-cloudwatch/lib/alarm.ts +++ b/packages/@aws-cdk/aws-cloudwatch/lib/alarm.ts @@ -227,18 +227,40 @@ export class Alarm extends AlarmBase { private renderMetric(metric: IMetric) { const self = this; return dispatchMetric(metric, { - withStat(st) { - self.validateMetricStat(st, metric); - - return dropUndefined({ - dimensions: st.dimensions, - namespace: st.namespace, - metricName: st.metricName, - period: st.period?.toSeconds(), - statistic: renderIfSimpleStatistic(st.statistic), - extendedStatistic: renderIfExtendedStatistic(st.statistic), - unit: st.unitFilter, - }); + withStat(stat, conf) { + self.validateMetricStat(stat, metric); + + if (conf.renderingProperties?.label == undefined) { + return dropUndefined({ + dimensions: stat.dimensions, + namespace: stat.namespace, + metricName: stat.metricName, + period: stat.period?.toSeconds(), + statistic: renderIfSimpleStatistic(stat.statistic), + extendedStatistic: renderIfExtendedStatistic(stat.statistic), + unit: stat.unitFilter, + }); + } + + return { + metrics: [ + { + metricStat: { + metric: { + metricName: stat.metricName, + namespace: stat.namespace, + dimensions: stat.dimensions, + }, + period: stat.period.toSeconds(), + stat: stat.statistic, + unit: stat.unitFilter, + }, + id: stat.metricName, + label: conf.renderingProperties?.label, + returnData: true, + } as CfnAlarm.MetricDataQueryProperty, + ], + }; }, withExpression() { diff --git a/packages/@aws-cdk/aws-cloudwatch/test/integ.alarm-with-label.expected.json b/packages/@aws-cdk/aws-cloudwatch/test/integ.alarm-with-label.expected.json new file mode 100644 index 0000000000000..9ab6e14f29a6e --- /dev/null +++ b/packages/@aws-cdk/aws-cloudwatch/test/integ.alarm-with-label.expected.json @@ -0,0 +1,50 @@ +{ + "Resources": { + "Alarm1F9009D71": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "Metrics": [ + { + "Id": "Metric", + "Label": "Metric [AVG: ${AVG}]", + "MetricStat": { + "Metric": { + "MetricName": "Metric", + "Namespace": "CDK/Test" + }, + "Period": 300, + "Stat": "Average" + }, + "ReturnData": true + } + ], + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "EvaluationPeriods": 3, + "Threshold": 100 + } + }, + "Alarm2A7122E13": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "Metrics": [ + { + "Id": "Metric", + "Label": "Metric [AVG: ${AVG}]", + "MetricStat": { + "Metric": { + "MetricName": "Metric", + "Namespace": "CDK/Test" + }, + "Period": 300, + "Stat": "Average" + }, + "ReturnData": true + } + ], + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "EvaluationPeriods": 3, + "Threshold": 100 + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloudwatch/test/integ.alarm-with-label.ts b/packages/@aws-cdk/aws-cloudwatch/test/integ.alarm-with-label.ts new file mode 100644 index 0000000000000..85aa1976b51aa --- /dev/null +++ b/packages/@aws-cdk/aws-cloudwatch/test/integ.alarm-with-label.ts @@ -0,0 +1,32 @@ +import { App, Stack, StackProps } from '@aws-cdk/core'; +import { Alarm, Metric } from '../lib'; + +class AlarmWithLabelIntegrationTest extends Stack { + + constructor(scope: App, id: string, props?: StackProps) { + super(scope, id, props); + + const testMetric = new Metric({ + namespace: 'CDK/Test', + metricName: 'Metric', + label: 'Metric [AVG: ${AVG}]', + }); + + new Alarm(this, 'Alarm1', { + metric: testMetric, + threshold: 100, + evaluationPeriods: 3, + }); + + testMetric.createAlarm(this, 'Alarm2', { + threshold: 100, + evaluationPeriods: 3, + }); + } +} + +const app = new App(); + +new AlarmWithLabelIntegrationTest(app, 'AlarmWithLabelIntegrationTest'); + +app.synth(); From e244c5d7409980267d1fa48afbfea38c42e88a28 Mon Sep 17 00:00:00 2001 From: proxy-hatch <26352422+proxy-hatch@users.noreply.github.com> Date: Wed, 3 Mar 2021 10:48:54 -0800 Subject: [PATCH 72/78] chore(certificatemanager): update README.md (#12408) typo ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-certificatemanager/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-certificatemanager/README.md b/packages/@aws-cdk/aws-certificatemanager/README.md index 5c27597f6701b..320f22c91663d 100644 --- a/packages/@aws-cdk/aws-certificatemanager/README.md +++ b/packages/@aws-cdk/aws-certificatemanager/README.md @@ -76,7 +76,7 @@ const cert = new acm.Certificate(this, 'Certificate', { domainName: 'test.example.com', subjectAlternativeNames: ['cool.example.com', 'test.example.net'], validation: acm.CertificateValidation.fromDnsMultiZone({ - 'text.example.com': exampleCom, + 'test.example.com': exampleCom, 'cool.example.com': exampleCom, 'test.example.net': exampleNet, }), From 2c074de3e8948e9ce007603cb8f0eaae36a3afcd Mon Sep 17 00:00:00 2001 From: Robert Djurasaj Date: Wed, 3 Mar 2021 12:34:14 -0700 Subject: [PATCH 73/78] chore(apigateway): cleanup DomainName TLS docstring and tests (#13309) Cleanup of apigateway module (docs & tests). ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../aws-apigateway/lib/domain-name.ts | 18 +++++++-------- .../aws-apigateway/test/domains.test.ts | 22 ++----------------- 2 files changed, 11 insertions(+), 29 deletions(-) diff --git a/packages/@aws-cdk/aws-apigateway/lib/domain-name.ts b/packages/@aws-cdk/aws-apigateway/lib/domain-name.ts index 0437b986fdc74..c9f082121bff6 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/domain-name.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/domain-name.ts @@ -12,8 +12,9 @@ import { EndpointType, IRestApi } from './restapi'; export enum SecurityPolicy { /** Cipher suite TLS 1.0 */ TLS_1_0 = 'TLS_1_0', + /** Cipher suite TLS 1.2 */ - TLS_1_2 = 'TLS_1_2' + TLS_1_2 = 'TLS_1_2', } export interface DomainNameOptions { @@ -40,13 +41,13 @@ export interface DomainNameOptions { * @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainname.html * @default SecurityPolicy.TLS_1_0 */ - readonly securityPolicy?: SecurityPolicy + readonly securityPolicy?: SecurityPolicy; /** * The mutual TLS authentication configuration for a custom domain name. * @default - mTLS is not configured. */ - readonly mtls?: MTLSConfig + readonly mtls?: MTLSConfig; } export interface DomainNameProps extends DomainNameOptions { @@ -83,7 +84,6 @@ export interface IDomainName extends IResource { * @attribute DistributionHostedZoneId,RegionalHostedZoneId */ readonly domainNameAliasHostedZoneId: string; - } export class DomainName extends Resource implements IDomainName { @@ -112,9 +112,9 @@ export class DomainName extends Resource implements IDomainName { const edge = endpointType === EndpointType.EDGE; if (!Token.isUnresolved(props.domainName) && /[A-Z]/.test(props.domainName)) { - throw new Error('domainName does not support uppercase letters. ' + - `got: '${props.domainName}'`); + throw new Error(`Domain name does not support uppercase letters. Got: ${props.domainName}`); } + const mtlsConfig = this.configureMTLS(props.mtls); const resource = new CfnDomainName(this, 'Resource', { domainName: props.domainName, @@ -176,10 +176,9 @@ export interface DomainNameAttributes { readonly domainNameAliasTarget: string; /** - * Thje Route53 hosted zone ID to use in order to connect a record set to this domain through an alias. + * The Route53 hosted zone ID to use in order to connect a record set to this domain through an alias. */ readonly domainNameAliasHostedZoneId: string; - } /** @@ -190,8 +189,9 @@ export interface MTLSConfig { * The bucket that the trust store is hosted in. */ readonly bucket: IBucket; + /** - * The key in S3 to look at for the trust store + * The key in S3 to look at for the trust store. */ readonly key: string; diff --git a/packages/@aws-cdk/aws-apigateway/test/domains.test.ts b/packages/@aws-cdk/aws-apigateway/test/domains.test.ts index ee70b4e9cb98e..2b7f49f9a3977 100644 --- a/packages/@aws-cdk/aws-apigateway/test/domains.test.ts +++ b/packages/@aws-cdk/aws-apigateway/test/domains.test.ts @@ -1,5 +1,5 @@ -import '@aws-cdk/assert/jest'; import { ABSENT } from '@aws-cdk/assert'; +import '@aws-cdk/assert/jest'; import * as acm from '@aws-cdk/aws-certificatemanager'; import { Bucket } from '@aws-cdk/aws-s3'; import { Stack } from '@aws-cdk/core'; @@ -43,8 +43,6 @@ describe('domains', () => { expect(stack.resolve(regionalDomain.domainNameAliasHostedZoneId)).toEqual({ 'Fn::GetAtt': ['mydomain592C948B', 'RegionalHostedZoneId'] }); expect(stack.resolve(edgeDomain.domainNameAliasDomainName)).toEqual({ 'Fn::GetAtt': ['yourdomain5FE30C81', 'DistributionDomainName'] }); expect(stack.resolve(edgeDomain.domainNameAliasHostedZoneId)).toEqual({ 'Fn::GetAtt': ['yourdomain5FE30C81', 'DistributionHostedZoneId'] }); - - }); test('default endpoint type is REGIONAL', () => { @@ -64,7 +62,6 @@ describe('domains', () => { 'EndpointConfiguration': { 'Types': ['REGIONAL'] }, 'RegionalCertificateArn': { 'Ref': 'Cert5C9FAEC1' }, }); - }); test('accepts different security policies', () => { @@ -111,7 +108,6 @@ describe('domains', () => { 'RegionalCertificateArn': { 'Ref': 'Cert5C9FAEC1' }, 'SecurityPolicy': ABSENT, }); - }); test('"mapping" can be used to automatically map this domain to the deployment stage of an API', () => { @@ -140,7 +136,6 @@ describe('domains', () => { 'Ref': 'apiDeploymentStageprod896C8101', }, }); - }); test('"addBasePathMapping" can be used to add base path mapping to the domain', () => { @@ -186,7 +181,6 @@ describe('domains', () => { 'Ref': 'api2DeploymentStageprod4120D74E', }, }); - }); test('a domain name can be defined with the API', () => { @@ -225,8 +219,6 @@ describe('domains', () => { 'Ref': 'apiDeploymentStageprod896C8101', }, }); - - }); test('a domain name can be added later', () => { @@ -265,8 +257,6 @@ describe('domains', () => { 'Ref': 'apiDeploymentStageprod896C8101', }, }); - - }); test('domain name cannot contain uppercase letters', () => { @@ -274,13 +264,10 @@ describe('domains', () => { const stack = new Stack(); const certificate = new acm.Certificate(stack, 'cert', { domainName: 'someDomainWithUpercase.domain.com' }); - // WHEN + // WHEN & THEN expect(() => { new apigw.DomainName(stack, 'someDomain', { domainName: 'someDomainWithUpercase.domain.com', certificate }); }).toThrow(/uppercase/); - - // THEN - }); test('multiple domain names can be added', () => { @@ -345,8 +332,6 @@ describe('domains', () => { 'Ref': 'apiDeploymentStageprod896C8101', }, }); - - }); test('"addBasePathMapping" can be used to add base path mapping to the domain with specific stage', () => { @@ -440,7 +425,6 @@ describe('domains', () => { 'RegionalCertificateArn': 'arn:aws:acm:us-east-1:1111111:certificate/11-3336f1-44483d-adc7-9cd375c5169d', 'MutualTlsAuthentication': { 'TruststoreUri': 's3://exampleBucket/someca.pem', 'TruststoreVersion': 'version' }, }); - }); test('base path mapping configures stage for RestApi creation', () => { @@ -466,8 +450,6 @@ describe('domains', () => { 'Ref': 'restApiWithStageDeploymentStageprodC82A6648', }, }); - - }); test('base path mapping configures stage for SpecRestApi creation', () => { From ae0185dd089e3bb7c5639ebc1bce3f95e126f71c Mon Sep 17 00:00:00 2001 From: AWS CDK Automation <43080478+aws-cdk-automation@users.noreply.github.com> Date: Wed, 3 Mar 2021 22:13:36 +0200 Subject: [PATCH 74/78] feat(cfnspec): cloudformation spec v30.0.0 (#13365) Co-authored-by: AWS CDK Team Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- packages/@aws-cdk/cfnspec/CHANGELOG.md | 74 ++ packages/@aws-cdk/cfnspec/cfn.version | 2 +- ...0_CloudFormationResourceSpecification.json | 1034 +++++++++-------- 3 files changed, 648 insertions(+), 462 deletions(-) diff --git a/packages/@aws-cdk/cfnspec/CHANGELOG.md b/packages/@aws-cdk/cfnspec/CHANGELOG.md index a952cac779b88..9485ec700294e 100644 --- a/packages/@aws-cdk/cfnspec/CHANGELOG.md +++ b/packages/@aws-cdk/cfnspec/CHANGELOG.md @@ -1,3 +1,77 @@ +# CloudFormation Resource Specification v30.0.0 + +## New Resource Types + +* AWS::EC2::TransitGatewayConnect +* AWS::EKS::Addon +* AWS::EMR::Studio +* AWS::EMR::StudioSessionMapping +* AWS::IAM::OIDCProvider +* AWS::IAM::SAMLProvider +* AWS::IAM::ServerCertificate +* AWS::IAM::VirtualMFADevice +* AWS::SageMaker::Image +* AWS::SageMaker::ImageVersion + +## Attribute Changes + +* AWS::IoTSiteWise::Portal PortalStatus (__deleted__) +* AWS::MediaPackage::Channel HlsIngest (__deleted__) +* AWS::QuickSight::Dashboard Version (__deleted__) +* AWS::QuickSight::Template Version (__deleted__) +* AWS::QuickSight::Theme Version (__deleted__) +* AWS::S3::AccessPoint PolicyStatus (__deleted__) +* AWS::SageMaker::Project ServiceCatalogProvisionedProductDetails (__deleted__) +* AWS::ServiceCatalog::CloudFormationProvisionedProduct Outputs (__deleted__) + +## Property Changes + +* AWS::ECR::PublicRepository Tags (__added__) +* AWS::IVS::Channel RecordingConfigurationArn (__added__) +* AWS::IoTSiteWise::AssetModel AssetModelCompositeModels (__added__) +* AWS::IoTSiteWise::Portal PortalAuthMode (__added__) +* AWS::SageMaker::Model InferenceExecutionConfig (__added__) + +## Property Type Changes + +* AWS::IoTSiteWise::Portal.MonitorErrorDetails (__removed__) +* AWS::IoTSiteWise::Portal.PortalStatus (__removed__) +* AWS::MediaPackage::Channel.HlsIngest (__removed__) +* AWS::MediaPackage::Channel.IngestEndpoint (__removed__) +* AWS::QuickSight::Dashboard.DashboardError (__removed__) +* AWS::QuickSight::Dashboard.DashboardVersion (__removed__) +* AWS::QuickSight::Dashboard.Sheet (__removed__) +* AWS::QuickSight::Template.ColumnGroupColumnSchema (__removed__) +* AWS::QuickSight::Template.ColumnGroupSchema (__removed__) +* AWS::QuickSight::Template.ColumnSchema (__removed__) +* AWS::QuickSight::Template.DataSetConfiguration (__removed__) +* AWS::QuickSight::Template.DataSetSchema (__removed__) +* AWS::QuickSight::Template.Sheet (__removed__) +* AWS::QuickSight::Template.TemplateError (__removed__) +* AWS::QuickSight::Template.TemplateVersion (__removed__) +* AWS::QuickSight::Theme.ThemeError (__removed__) +* AWS::QuickSight::Theme.ThemeVersion (__removed__) +* AWS::IoTSiteWise::AccessPolicy.IamRole (__added__) +* AWS::IoTSiteWise::AccessPolicy.IamUser (__added__) +* AWS::IoTSiteWise::AssetModel.AssetModelCompositeModel (__added__) +* AWS::SageMaker::Model.InferenceExecutionConfig (__added__) +* AWS::ACMPCA::Certificate.Validity Value.PrimitiveType (__changed__) + * Old: Integer + * New: Double +* AWS::CodeBuild::ReportGroup.S3ReportExportConfig BucketOwner (__added__) +* AWS::IoTSiteWise::AccessPolicy.AccessPolicyIdentity IamRole (__added__) +* AWS::IoTSiteWise::AccessPolicy.AccessPolicyIdentity IamUser (__added__) +* AWS::IoTSiteWise::AssetModel.AssetModelProperty DataTypeSpec (__added__) +* AWS::Pinpoint::Campaign.CampaignSmsMessage EntityId (__added__) +* AWS::Pinpoint::Campaign.CampaignSmsMessage TemplateId (__added__) +* AWS::Synthetics::Canary.Code Handler.Required (__changed__) + * Old: false + * New: true +* AWS::Synthetics::Canary.RunConfig TimeoutInSeconds.Required (__changed__) + * Old: true + * New: false + + # CloudFormation Resource Specification v29.0.0 ## New Resource Types diff --git a/packages/@aws-cdk/cfnspec/cfn.version b/packages/@aws-cdk/cfnspec/cfn.version index f1e4903d1d8e0..8dd5c17a1b5cd 100644 --- a/packages/@aws-cdk/cfnspec/cfn.version +++ b/packages/@aws-cdk/cfnspec/cfn.version @@ -1 +1 @@ -29.0.0 +30.0.0 diff --git a/packages/@aws-cdk/cfnspec/spec-source/000_CloudFormationResourceSpecification.json b/packages/@aws-cdk/cfnspec/spec-source/000_CloudFormationResourceSpecification.json index da0274f96bd19..75da81b0c270b 100644 --- a/packages/@aws-cdk/cfnspec/spec-source/000_CloudFormationResourceSpecification.json +++ b/packages/@aws-cdk/cfnspec/spec-source/000_CloudFormationResourceSpecification.json @@ -402,7 +402,7 @@ }, "Value": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-acmpca-certificate-validity.html#cfn-acmpca-certificate-validity-value", - "PrimitiveType": "Integer", + "PrimitiveType": "Double", "Required": true, "UpdateType": "Immutable" } @@ -11494,6 +11494,12 @@ "Required": true, "UpdateType": "Mutable" }, + "BucketOwner": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-reportgroup-s3reportexportconfig.html#cfn-codebuild-reportgroup-s3reportexportconfig-bucketowner", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, "EncryptionDisabled": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-reportgroup-s3reportexportconfig.html#cfn-codebuild-reportgroup-s3reportexportconfig-encryptiondisabled", "PrimitiveType": "Boolean", @@ -18819,6 +18825,17 @@ } } }, + "AWS::EC2::TransitGatewayConnect.TransitGatewayConnectOptions": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-transitgatewayconnect-transitgatewayconnectoptions.html", + "Properties": { + "Protocol": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-transitgatewayconnect-transitgatewayconnectoptions.html#cfn-ec2-transitgatewayconnect-transitgatewayconnectoptions-protocol", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + } + } + }, "AWS::EC2::VPNConnection.VpnTunnelOptionsSpecification": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-vpnconnection-vpntunneloptionsspecification.html", "Properties": { @@ -30169,6 +30186,18 @@ "AWS::IoTSiteWise::AccessPolicy.AccessPolicyIdentity": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotsitewise-accesspolicy-accesspolicyidentity.html", "Properties": { + "IamRole": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotsitewise-accesspolicy-accesspolicyidentity.html#cfn-iotsitewise-accesspolicy-accesspolicyidentity-iamrole", + "Required": false, + "Type": "IamRole", + "UpdateType": "Mutable" + }, + "IamUser": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotsitewise-accesspolicy-accesspolicyidentity.html#cfn-iotsitewise-accesspolicy-accesspolicyidentity-iamuser", + "Required": false, + "Type": "IamUser", + "UpdateType": "Mutable" + }, "User": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotsitewise-accesspolicy-accesspolicyidentity.html#cfn-iotsitewise-accesspolicy-accesspolicyidentity-user", "Required": false, @@ -30194,6 +30223,28 @@ } } }, + "AWS::IoTSiteWise::AccessPolicy.IamRole": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotsitewise-accesspolicy-iamrole.html", + "Properties": { + "arn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotsitewise-accesspolicy-iamrole.html#cfn-iotsitewise-accesspolicy-iamrole-arn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + } + } + }, + "AWS::IoTSiteWise::AccessPolicy.IamUser": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotsitewise-accesspolicy-iamuser.html", + "Properties": { + "arn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotsitewise-accesspolicy-iamuser.html#cfn-iotsitewise-accesspolicy-iamuser-arn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + } + } + }, "AWS::IoTSiteWise::AccessPolicy.Portal": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotsitewise-accesspolicy-portal.html", "Properties": { @@ -30267,6 +30318,36 @@ } } }, + "AWS::IoTSiteWise::AssetModel.AssetModelCompositeModel": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotsitewise-assetmodel-assetmodelcompositemodel.html", + "Properties": { + "CompositeModelProperties": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotsitewise-assetmodel-assetmodelcompositemodel.html#cfn-iotsitewise-assetmodel-assetmodelcompositemodel-compositemodelproperties", + "ItemType": "AssetModelProperty", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + }, + "Description": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotsitewise-assetmodel-assetmodelcompositemodel.html#cfn-iotsitewise-assetmodel-assetmodelcompositemodel-description", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "Name": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotsitewise-assetmodel-assetmodelcompositemodel.html#cfn-iotsitewise-assetmodel-assetmodelcompositemodel-name", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + }, + "Type": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotsitewise-assetmodel-assetmodelcompositemodel.html#cfn-iotsitewise-assetmodel-assetmodelcompositemodel-type", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + } + } + }, "AWS::IoTSiteWise::AssetModel.AssetModelHierarchy": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotsitewise-assetmodel-assetmodelhierarchy.html", "Properties": { @@ -30299,6 +30380,12 @@ "Required": true, "UpdateType": "Mutable" }, + "DataTypeSpec": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotsitewise-assetmodel-assetmodelproperty.html#cfn-iotsitewise-assetmodel-assetmodelproperty-datatypespec", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, "LogicalId": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotsitewise-assetmodel-assetmodelproperty.html#cfn-iotsitewise-assetmodel-assetmodelproperty-logicalid", "PrimitiveType": "String", @@ -30502,40 +30589,6 @@ } } }, - "AWS::IoTSiteWise::Portal.MonitorErrorDetails": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotsitewise-portal-monitorerrordetails.html", - "Properties": { - "code": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotsitewise-portal-monitorerrordetails.html#cfn-iotsitewise-portal-monitorerrordetails-code", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "message": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotsitewise-portal-monitorerrordetails.html#cfn-iotsitewise-portal-monitorerrordetails-message", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - } - } - }, - "AWS::IoTSiteWise::Portal.PortalStatus": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotsitewise-portal-portalstatus.html", - "Properties": { - "error": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotsitewise-portal-portalstatus.html#cfn-iotsitewise-portal-portalstatus-error", - "Required": false, - "Type": "MonitorErrorDetails", - "UpdateType": "Mutable" - }, - "state": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotsitewise-portal-portalstatus.html#cfn-iotsitewise-portal-portalstatus-state", - "PrimitiveType": "String", - "Required": true, - "UpdateType": "Mutable" - } - } - }, "AWS::IoTThingsGraph::FlowTemplate.DefinitionDocument": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotthingsgraph-flowtemplate-definitiondocument.html", "Properties": { @@ -40700,47 +40753,6 @@ } } }, - "AWS::MediaPackage::Channel.HlsIngest": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediapackage-channel-hlsingest.html", - "Properties": { - "ingestEndpoints": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediapackage-channel-hlsingest.html#cfn-mediapackage-channel-hlsingest-ingestendpoints", - "ItemType": "IngestEndpoint", - "Required": false, - "Type": "List", - "UpdateType": "Mutable" - } - } - }, - "AWS::MediaPackage::Channel.IngestEndpoint": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediapackage-channel-ingestendpoint.html", - "Properties": { - "Id": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediapackage-channel-ingestendpoint.html#cfn-mediapackage-channel-ingestendpoint-id", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "Password": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediapackage-channel-ingestendpoint.html#cfn-mediapackage-channel-ingestendpoint-password", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "Url": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediapackage-channel-ingestendpoint.html#cfn-mediapackage-channel-ingestendpoint-url", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "Username": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediapackage-channel-ingestendpoint.html#cfn-mediapackage-channel-ingestendpoint-username", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - } - } - }, "AWS::MediaPackage::OriginEndpoint.Authorization": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediapackage-originendpoint-authorization.html", "Properties": { @@ -42971,6 +42983,12 @@ "Required": false, "UpdateType": "Mutable" }, + "EntityId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pinpoint-campaign-campaignsmsmessage.html#cfn-pinpoint-campaign-campaignsmsmessage-entityid", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, "MessageType": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pinpoint-campaign-campaignsmsmessage.html#cfn-pinpoint-campaign-campaignsmsmessage-messagetype", "PrimitiveType": "String", @@ -42988,6 +43006,12 @@ "PrimitiveType": "String", "Required": false, "UpdateType": "Mutable" + }, + "TemplateId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pinpoint-campaign-campaignsmsmessage.html#cfn-pinpoint-campaign-campaignsmsmessage-templateid", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" } } }, @@ -44152,23 +44176,6 @@ } } }, - "AWS::QuickSight::Dashboard.DashboardError": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-dashboard-dashboarderror.html", - "Properties": { - "Message": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-dashboard-dashboarderror.html#cfn-quicksight-dashboard-dashboarderror-message", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "Type": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-dashboard-dashboarderror.html#cfn-quicksight-dashboard-dashboarderror-type", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - } - } - }, "AWS::QuickSight::Dashboard.DashboardPublishOptions": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-dashboard-dashboardpublishoptions.html", "Properties": { @@ -44221,74 +44228,6 @@ } } }, - "AWS::QuickSight::Dashboard.DashboardVersion": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-dashboard-dashboardversion.html", - "Properties": { - "Arn": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-dashboard-dashboardversion.html#cfn-quicksight-dashboard-dashboardversion-arn", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "CreatedTime": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-dashboard-dashboardversion.html#cfn-quicksight-dashboard-dashboardversion-createdtime", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "DataSetArns": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-dashboard-dashboardversion.html#cfn-quicksight-dashboard-dashboardversion-datasetarns", - "PrimitiveItemType": "String", - "Required": false, - "Type": "List", - "UpdateType": "Mutable" - }, - "Description": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-dashboard-dashboardversion.html#cfn-quicksight-dashboard-dashboardversion-description", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "Errors": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-dashboard-dashboardversion.html#cfn-quicksight-dashboard-dashboardversion-errors", - "ItemType": "DashboardError", - "Required": false, - "Type": "List", - "UpdateType": "Mutable" - }, - "Sheets": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-dashboard-dashboardversion.html#cfn-quicksight-dashboard-dashboardversion-sheets", - "ItemType": "Sheet", - "Required": false, - "Type": "List", - "UpdateType": "Mutable" - }, - "SourceEntityArn": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-dashboard-dashboardversion.html#cfn-quicksight-dashboard-dashboardversion-sourceentityarn", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "Status": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-dashboard-dashboardversion.html#cfn-quicksight-dashboard-dashboardversion-status", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "ThemeArn": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-dashboard-dashboardversion.html#cfn-quicksight-dashboard-dashboardversion-themearn", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "VersionNumber": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-dashboard-dashboardversion.html#cfn-quicksight-dashboard-dashboardversion-versionnumber", - "PrimitiveType": "Double", - "Required": false, - "UpdateType": "Mutable" - } - } - }, "AWS::QuickSight::Dashboard.DataSetReference": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-dashboard-datasetreference.html", "Properties": { @@ -44422,23 +44361,6 @@ } } }, - "AWS::QuickSight::Dashboard.Sheet": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-dashboard-sheet.html", - "Properties": { - "Name": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-dashboard-sheet.html#cfn-quicksight-dashboard-sheet-name", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "SheetId": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-dashboard-sheet.html#cfn-quicksight-dashboard-sheet-sheetid", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - } - } - }, "AWS::QuickSight::Dashboard.SheetControlsOption": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-dashboard-sheetcontrolsoption.html", "Properties": { @@ -44468,82 +44390,6 @@ } } }, - "AWS::QuickSight::Template.ColumnGroupColumnSchema": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-columngroupcolumnschema.html", - "Properties": { - "Name": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-columngroupcolumnschema.html#cfn-quicksight-template-columngroupcolumnschema-name", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - } - } - }, - "AWS::QuickSight::Template.ColumnGroupSchema": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-columngroupschema.html", - "Properties": { - "ColumnGroupColumnSchemaList": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-columngroupschema.html#cfn-quicksight-template-columngroupschema-columngroupcolumnschemalist", - "ItemType": "ColumnGroupColumnSchema", - "Required": false, - "Type": "List", - "UpdateType": "Mutable" - }, - "Name": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-columngroupschema.html#cfn-quicksight-template-columngroupschema-name", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - } - } - }, - "AWS::QuickSight::Template.ColumnSchema": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-columnschema.html", - "Properties": { - "DataType": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-columnschema.html#cfn-quicksight-template-columnschema-datatype", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "GeographicRole": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-columnschema.html#cfn-quicksight-template-columnschema-geographicrole", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "Name": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-columnschema.html#cfn-quicksight-template-columnschema-name", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - } - } - }, - "AWS::QuickSight::Template.DataSetConfiguration": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-datasetconfiguration.html", - "Properties": { - "ColumnGroupSchemaList": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-datasetconfiguration.html#cfn-quicksight-template-datasetconfiguration-columngroupschemalist", - "ItemType": "ColumnGroupSchema", - "Required": false, - "Type": "List", - "UpdateType": "Mutable" - }, - "DataSetSchema": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-datasetconfiguration.html#cfn-quicksight-template-datasetconfiguration-datasetschema", - "Required": false, - "Type": "DataSetSchema", - "UpdateType": "Mutable" - }, - "Placeholder": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-datasetconfiguration.html#cfn-quicksight-template-datasetconfiguration-placeholder", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - } - } - }, "AWS::QuickSight::Template.DataSetReference": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-datasetreference.html", "Properties": { @@ -44561,18 +44407,6 @@ } } }, - "AWS::QuickSight::Template.DataSetSchema": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-datasetschema.html", - "Properties": { - "ColumnSchemaList": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-datasetschema.html#cfn-quicksight-template-datasetschema-columnschemalist", - "ItemType": "ColumnSchema", - "Required": false, - "Type": "List", - "UpdateType": "Mutable" - } - } - }, "AWS::QuickSight::Template.ResourcePermission": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-resourcepermission.html", "Properties": { @@ -44591,40 +44425,6 @@ } } }, - "AWS::QuickSight::Template.Sheet": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-sheet.html", - "Properties": { - "Name": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-sheet.html#cfn-quicksight-template-sheet-name", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "SheetId": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-sheet.html#cfn-quicksight-template-sheet-sheetid", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - } - } - }, - "AWS::QuickSight::Template.TemplateError": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-templateerror.html", - "Properties": { - "Message": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-templateerror.html#cfn-quicksight-template-templateerror-message", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "Type": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-templateerror.html#cfn-quicksight-template-templateerror-type", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - } - } - }, "AWS::QuickSight::Template.TemplateSourceAnalysis": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-templatesourceanalysis.html", "Properties": { @@ -44671,68 +44471,6 @@ } } }, - "AWS::QuickSight::Template.TemplateVersion": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-templateversion.html", - "Properties": { - "CreatedTime": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-templateversion.html#cfn-quicksight-template-templateversion-createdtime", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "DataSetConfigurations": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-templateversion.html#cfn-quicksight-template-templateversion-datasetconfigurations", - "ItemType": "DataSetConfiguration", - "Required": false, - "Type": "List", - "UpdateType": "Mutable" - }, - "Description": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-templateversion.html#cfn-quicksight-template-templateversion-description", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "Errors": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-templateversion.html#cfn-quicksight-template-templateversion-errors", - "ItemType": "TemplateError", - "Required": false, - "Type": "List", - "UpdateType": "Mutable" - }, - "Sheets": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-templateversion.html#cfn-quicksight-template-templateversion-sheets", - "ItemType": "Sheet", - "Required": false, - "Type": "List", - "UpdateType": "Mutable" - }, - "SourceEntityArn": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-templateversion.html#cfn-quicksight-template-templateversion-sourceentityarn", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "Status": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-templateversion.html#cfn-quicksight-template-templateversion-status", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "ThemeArn": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-templateversion.html#cfn-quicksight-template-templateversion-themearn", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "VersionNumber": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-templateversion.html#cfn-quicksight-template-templateversion-versionnumber", - "PrimitiveType": "Double", - "Required": false, - "UpdateType": "Mutable" - } - } - }, "AWS::QuickSight::Theme.BorderStyle": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-theme-borderstyle.html", "Properties": { @@ -44866,77 +44604,6 @@ } } }, - "AWS::QuickSight::Theme.ThemeError": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-theme-themeerror.html", - "Properties": { - "Message": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-theme-themeerror.html#cfn-quicksight-theme-themeerror-message", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "Type": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-theme-themeerror.html#cfn-quicksight-theme-themeerror-type", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - } - } - }, - "AWS::QuickSight::Theme.ThemeVersion": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-theme-themeversion.html", - "Properties": { - "Arn": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-theme-themeversion.html#cfn-quicksight-theme-themeversion-arn", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "BaseThemeId": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-theme-themeversion.html#cfn-quicksight-theme-themeversion-basethemeid", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "Configuration": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-theme-themeversion.html#cfn-quicksight-theme-themeversion-configuration", - "Required": false, - "Type": "ThemeConfiguration", - "UpdateType": "Mutable" - }, - "CreatedTime": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-theme-themeversion.html#cfn-quicksight-theme-themeversion-createdtime", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "Description": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-theme-themeversion.html#cfn-quicksight-theme-themeversion-description", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "Errors": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-theme-themeversion.html#cfn-quicksight-theme-themeversion-errors", - "ItemType": "ThemeError", - "Required": false, - "Type": "List", - "UpdateType": "Mutable" - }, - "Status": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-theme-themeversion.html#cfn-quicksight-theme-themeversion-status", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - }, - "VersionNumber": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-theme-themeversion.html#cfn-quicksight-theme-themeversion-versionnumber", - "PrimitiveType": "Double", - "Required": false, - "UpdateType": "Mutable" - } - } - }, "AWS::QuickSight::Theme.TileLayoutStyle": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-theme-tilelayoutstyle.html", "Properties": { @@ -49083,6 +48750,17 @@ } } }, + "AWS::SageMaker::Model.InferenceExecutionConfig": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-model-inferenceexecutionconfig.html", + "Properties": { + "Mode": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-model-inferenceexecutionconfig.html#cfn-sagemaker-model-inferenceexecutionconfig-mode", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + } + } + }, "AWS::SageMaker::Model.MultiModelConfig": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-model-containerdefinition-multimodelconfig.html", "Properties": { @@ -51049,7 +50727,7 @@ "Handler": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-code.html#cfn-synthetics-canary-code-handler", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "S3Bucket": { @@ -51103,7 +50781,7 @@ "TimeoutInSeconds": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-runconfig.html#cfn-synthetics-canary-runconfig-timeoutinseconds", "PrimitiveType": "Integer", - "Required": true, + "Required": false, "UpdateType": "Mutable" } } @@ -53378,7 +53056,7 @@ } } }, - "ResourceSpecificationVersion": "29.0.0", + "ResourceSpecificationVersion": "30.0.0", "ResourceTypes": { "AWS::ACMPCA::Certificate": { "Attributes": { @@ -65642,6 +65320,44 @@ } } }, + "AWS::EC2::TransitGatewayConnect": { + "Attributes": { + "CreationTime": { + "PrimitiveType": "String" + }, + "State": { + "PrimitiveType": "String" + }, + "TransitGatewayAttachmentId": { + "PrimitiveType": "String" + }, + "TransitGatewayId": { + "PrimitiveType": "String" + } + }, + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewayconnect.html", + "Properties": { + "Options": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewayconnect.html#cfn-ec2-transitgatewayconnect-options", + "Required": true, + "Type": "TransitGatewayConnectOptions", + "UpdateType": "Immutable" + }, + "Tags": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewayconnect.html#cfn-ec2-transitgatewayconnect-tags", + "ItemType": "Tag", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + }, + "TransportTransitGatewayAttachmentId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewayconnect.html#cfn-ec2-transitgatewayconnect-transporttransitgatewayattachmentid", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + } + } + }, "AWS::EC2::TransitGatewayMulticastDomain": { "Attributes": { "CreationTime": { @@ -66439,6 +66155,14 @@ "PrimitiveType": "Json", "Required": false, "UpdateType": "Mutable" + }, + "Tags": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags", + "DuplicatesAllowed": false, + "ItemType": "Tag", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" } } }, @@ -67090,6 +66814,54 @@ } } }, + "AWS::EKS::Addon": { + "Attributes": { + "Arn": { + "PrimitiveType": "String" + } + }, + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-addon.html", + "Properties": { + "AddonName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-addon.html#cfn-eks-addon-addonname", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "AddonVersion": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-addon.html#cfn-eks-addon-addonversion", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "ClusterName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-addon.html#cfn-eks-addon-clustername", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "ResolveConflicts": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-addon.html#cfn-eks-addon-resolveconflicts", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "ServiceAccountRoleArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-addon.html#cfn-eks-addon-serviceaccountrolearn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "Tags": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-addon.html#cfn-eks-addon-tags", + "DuplicatesAllowed": false, + "ItemType": "Tag", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + } + } + }, "AWS::EKS::Cluster": { "Attributes": { "Arn": { @@ -67627,6 +67399,120 @@ } } }, + "AWS::EMR::Studio": { + "Attributes": { + "Arn": { + "PrimitiveType": "String" + }, + "StudioId": { + "PrimitiveType": "String" + }, + "Url": { + "PrimitiveType": "String" + } + }, + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-emr-studio.html", + "Properties": { + "AuthMode": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-emr-studio.html#cfn-emr-studio-authmode", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "DefaultS3Location": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-emr-studio.html#cfn-emr-studio-defaults3location", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + }, + "Description": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-emr-studio.html#cfn-emr-studio-description", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "EngineSecurityGroupId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-emr-studio.html#cfn-emr-studio-enginesecuritygroupid", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "Name": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-emr-studio.html#cfn-emr-studio-name", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + }, + "ServiceRole": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-emr-studio.html#cfn-emr-studio-servicerole", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "SubnetIds": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-emr-studio.html#cfn-emr-studio-subnetids", + "PrimitiveItemType": "String", + "Required": true, + "Type": "List", + "UpdateType": "Mutable" + }, + "Tags": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-emr-studio.html#cfn-emr-studio-tags", + "DuplicatesAllowed": false, + "ItemType": "Tag", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + }, + "UserRole": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-emr-studio.html#cfn-emr-studio-userrole", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "VpcId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-emr-studio.html#cfn-emr-studio-vpcid", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "WorkspaceSecurityGroupId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-emr-studio.html#cfn-emr-studio-workspacesecuritygroupid", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + } + } + }, + "AWS::EMR::StudioSessionMapping": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-emr-studiosessionmapping.html", + "Properties": { + "IdentityName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-emr-studiosessionmapping.html#cfn-emr-studiosessionmapping-identityname", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "IdentityType": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-emr-studiosessionmapping.html#cfn-emr-studiosessionmapping-identitytype", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "SessionPolicyArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-emr-studiosessionmapping.html#cfn-emr-studiosessionmapping-sessionpolicyarn", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + }, + "StudioId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-emr-studiosessionmapping.html#cfn-emr-studiosessionmapping-studioid", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + } + } + }, "AWS::EMRContainers::VirtualCluster": { "Attributes": { "Arn": { @@ -71800,6 +71686,44 @@ } } }, + "AWS::IAM::OIDCProvider": { + "Attributes": { + "Arn": { + "PrimitiveType": "String" + } + }, + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-oidcprovider.html", + "Properties": { + "ClientIdList": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-oidcprovider.html#cfn-iam-oidcprovider-clientidlist", + "PrimitiveItemType": "String", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + }, + "Tags": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-oidcprovider.html#cfn-iam-oidcprovider-tags", + "DuplicatesAllowed": true, + "ItemType": "Tag", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + }, + "ThumbprintList": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-oidcprovider.html#cfn-iam-oidcprovider-thumbprintlist", + "PrimitiveItemType": "String", + "Required": true, + "Type": "List", + "UpdateType": "Mutable" + }, + "Url": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-oidcprovider.html#cfn-iam-oidcprovider-url", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + } + } + }, "AWS::IAM::Policy": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-policy.html", "Properties": { @@ -71914,6 +71838,84 @@ } } }, + "AWS::IAM::SAMLProvider": { + "Attributes": { + "Arn": { + "PrimitiveType": "String" + } + }, + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-samlprovider.html", + "Properties": { + "Name": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-samlprovider.html#cfn-iam-samlprovider-name", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + }, + "SamlMetadataDocument": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-samlprovider.html#cfn-iam-samlprovider-samlmetadatadocument", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + }, + "Tags": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-samlprovider.html#cfn-iam-samlprovider-tags", + "DuplicatesAllowed": true, + "ItemType": "Tag", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + } + } + }, + "AWS::IAM::ServerCertificate": { + "Attributes": { + "Arn": { + "PrimitiveType": "String" + } + }, + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-servercertificate.html", + "Properties": { + "CertificateBody": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-servercertificate.html#cfn-iam-servercertificate-certificatebody", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + }, + "CertificateChain": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-servercertificate.html#cfn-iam-servercertificate-certificatechain", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + }, + "Path": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-servercertificate.html#cfn-iam-servercertificate-path", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "PrivateKey": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-servercertificate.html#cfn-iam-servercertificate-privatekey", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + }, + "ServerCertificateName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-servercertificate.html#cfn-iam-servercertificate-servercertificatename", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + }, + "Tags": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-servercertificate.html#cfn-iam-servercertificate-tags", + "DuplicatesAllowed": true, + "ItemType": "Tag", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + } + } + }, "AWS::IAM::ServiceLinkedRole": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-servicelinkedrole.html", "Properties": { @@ -72022,6 +72024,44 @@ } } }, + "AWS::IAM::VirtualMFADevice": { + "Attributes": { + "SerialNumber": { + "PrimitiveType": "String" + } + }, + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-virtualmfadevice.html", + "Properties": { + "Path": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-virtualmfadevice.html#cfn-iam-virtualmfadevice-path", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + }, + "Tags": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-virtualmfadevice.html#cfn-iam-virtualmfadevice-tags", + "DuplicatesAllowed": true, + "ItemType": "Tag", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + }, + "Users": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-virtualmfadevice.html#cfn-iam-virtualmfadevice-users", + "DuplicatesAllowed": true, + "PrimitiveItemType": "String", + "Required": true, + "Type": "List", + "UpdateType": "Mutable" + }, + "VirtualMfaDeviceName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-virtualmfadevice.html#cfn-iam-virtualmfadevice-virtualmfadevicename", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + } + } + }, "AWS::IVS::Channel": { "Attributes": { "Arn": { @@ -72054,6 +72094,12 @@ "Required": false, "UpdateType": "Mutable" }, + "RecordingConfigurationArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ivs-channel.html#cfn-ivs-channel-recordingconfigurationarn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, "Tags": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ivs-channel.html#cfn-ivs-channel-tags", "DuplicatesAllowed": false, @@ -73460,6 +73506,13 @@ }, "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iotsitewise-assetmodel.html", "Properties": { + "AssetModelCompositeModels": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iotsitewise-assetmodel.html#cfn-iotsitewise-assetmodel-assetmodelcompositemodels", + "ItemType": "AssetModelCompositeModel", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + }, "AssetModelDescription": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iotsitewise-assetmodel.html#cfn-iotsitewise-assetmodel-assetmodeldescription", "PrimitiveType": "String", @@ -73591,13 +73644,16 @@ }, "PortalStartUrl": { "PrimitiveType": "String" - }, - "PortalStatus": { - "Type": "PortalStatus" } }, "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iotsitewise-portal.html", "Properties": { + "PortalAuthMode": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iotsitewise-portal.html#cfn-iotsitewise-portal-portalauthmode", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + }, "PortalContactEmail": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iotsitewise-portal.html#cfn-iotsitewise-portal-portalcontactemail", "PrimitiveType": "String", @@ -76543,9 +76599,6 @@ "Attributes": { "Arn": { "PrimitiveType": "String" - }, - "HlsIngest": { - "Type": "HlsIngest" } }, "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mediapackage-channel.html", @@ -79472,9 +79525,6 @@ }, "LastUpdatedTime": { "PrimitiveType": "String" - }, - "Version": { - "Type": "DashboardVersion" } }, "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-quicksight-dashboard.html", @@ -79553,9 +79603,6 @@ }, "LastUpdatedTime": { "PrimitiveType": "String" - }, - "Version": { - "Type": "TemplateVersion" } }, "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-quicksight-template.html", @@ -79619,9 +79666,6 @@ }, "Type": { "PrimitiveType": "String" - }, - "Version": { - "Type": "ThemeVersion" } }, "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-quicksight-theme.html", @@ -81710,9 +81754,6 @@ "Attributes": { "NetworkOrigin": { "PrimitiveType": "String" - }, - "PolicyStatus": { - "PrimitiveType": "Json" } }, "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-accesspoint.html", @@ -83403,6 +83444,78 @@ } } }, + "AWS::SageMaker::Image": { + "Attributes": { + "ImageArn": { + "PrimitiveType": "String" + } + }, + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-image.html", + "Properties": { + "ImageDescription": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-image.html#cfn-sagemaker-image-imagedescription", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "ImageDisplayName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-image.html#cfn-sagemaker-image-imagedisplayname", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "ImageName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-image.html#cfn-sagemaker-image-imagename", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "ImageRoleArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-image.html#cfn-sagemaker-image-imagerolearn", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + }, + "Tags": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-image.html#cfn-sagemaker-image-tags", + "ItemType": "Tag", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + } + } + }, + "AWS::SageMaker::ImageVersion": { + "Attributes": { + "ContainerImage": { + "PrimitiveType": "String" + }, + "ImageArn": { + "PrimitiveType": "String" + }, + "ImageVersionArn": { + "PrimitiveType": "String" + }, + "Version": { + "PrimitiveType": "Integer" + } + }, + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-imageversion.html", + "Properties": { + "BaseImage": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-imageversion.html#cfn-sagemaker-imageversion-baseimage", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "ImageName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-imageversion.html#cfn-sagemaker-imageversion-imagename", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + } + } + }, "AWS::SageMaker::Model": { "Attributes": { "ModelName": { @@ -83430,6 +83543,12 @@ "Required": true, "UpdateType": "Immutable" }, + "InferenceExecutionConfig": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-model.html#cfn-sagemaker-model-inferenceexecutionconfig", + "Required": false, + "Type": "InferenceExecutionConfig", + "UpdateType": "Immutable" + }, "ModelName": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-model.html#cfn-sagemaker-model-modelname", "PrimitiveType": "String", @@ -83963,9 +84082,6 @@ }, "ProjectStatus": { "PrimitiveType": "String" - }, - "ServiceCatalogProvisionedProductDetails": { - "PrimitiveType": "Json" } }, "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-project.html", @@ -84321,10 +84437,6 @@ "CloudformationStackArn": { "PrimitiveType": "String" }, - "Outputs": { - "PrimitiveItemType": "String", - "Type": "Map" - }, "ProvisionedProductId": { "PrimitiveType": "String" }, From cbed3488f03bdfba16f3950bda653535c8999db1 Mon Sep 17 00:00:00 2001 From: Tom Lei Date: Wed, 3 Mar 2021 15:13:15 -0800 Subject: [PATCH 75/78] fix(codebuild): allow FILE_PATH webhook filter for BitBucket (#13186) Remove restrictions around FILE_PATH for Bitbucket sources as this is supported by CloudFormation now. Closes #13175 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-codebuild/lib/source.ts | 15 ++------------- .../aws-codebuild/test/test.codebuild.ts | 18 ++++++++---------- 2 files changed, 10 insertions(+), 23 deletions(-) diff --git a/packages/@aws-cdk/aws-codebuild/lib/source.ts b/packages/@aws-cdk/aws-codebuild/lib/source.ts index 19161ef9b6172..a14026da98711 100644 --- a/packages/@aws-cdk/aws-codebuild/lib/source.ts +++ b/packages/@aws-cdk/aws-codebuild/lib/source.ts @@ -381,7 +381,7 @@ export class FilterGroup { * Create a new FilterGroup with an added condition: * the push that is the source of the event must affect a file that matches the given pattern. * Note that you can only use this method if this Group contains only the `PUSH` event action, - * and only for GitHub and GitHubEnterprise sources. + * and only for GitHub, Bitbucket and GitHubEnterprise sources. * * @param pattern a regular expression */ @@ -393,7 +393,7 @@ export class FilterGroup { * Create a new FilterGroup with an added condition: * the push that is the source of the event must not affect a file that matches the given pattern. * Note that you can only use this method if this Group contains only the `PUSH` event action, - * and only for GitHub and GitHubEnterprise sources. + * and only for GitHub, Bitbucket and GitHubEnterprise sources. * * @param pattern a regular expression */ @@ -788,11 +788,6 @@ class BitBucketSource extends ThirdPartyGitSource { throw new Error('BitBucket sources do not support the PULL_REQUEST_REOPENED webhook event action'); } - // they also don't support file path conditions - if (this.anyWebhookFilterContainsFilePathConditions()) { - throw new Error('BitBucket sources do not support file path conditions for webhook filters'); - } - const superConfig = super.bind(_scope, _project); return { sourceProperty: { @@ -809,12 +804,6 @@ class BitBucketSource extends ThirdPartyGitSource { return fg._actions.findIndex(a => a === EventAction.PULL_REQUEST_REOPENED) !== -1; }) !== -1; } - - private anyWebhookFilterContainsFilePathConditions() { - return this.webhookFilters.findIndex(fg => { - return fg._filters.findIndex(f => f.type === WebhookFilterTypes.FILE_PATH) !== -1; - }) !== -1; - } } function set2Array(set: Set): T[] { diff --git a/packages/@aws-cdk/aws-codebuild/test/test.codebuild.ts b/packages/@aws-cdk/aws-codebuild/test/test.codebuild.ts index d6341771d71b7..806ec437c20c6 100644 --- a/packages/@aws-cdk/aws-codebuild/test/test.codebuild.ts +++ b/packages/@aws-cdk/aws-codebuild/test/test.codebuild.ts @@ -1801,19 +1801,17 @@ export = { test.done(); }, - 'BitBucket sources do not support file path conditions'(test: Test) { + 'BitBucket sources support file path conditions'(test: Test) { const stack = new cdk.Stack(); const filterGroup = codebuild.FilterGroup.inEventOf(codebuild.EventAction.PUSH).andFilePathIs('.*'); - test.throws(() => { - new codebuild.Project(stack, 'Project', { - source: codebuild.Source.bitBucket({ - owner: 'owner', - repo: 'repo', - webhookFilters: [filterGroup], - }), - }); - }, /BitBucket sources do not support file path conditions for webhook filters/); + new codebuild.Project(stack, 'Project', { + source: codebuild.Source.bitBucket({ + owner: 'owner', + repo: 'repo', + webhookFilters: [filterGroup], + }), + }); test.done(); }, From 8b00de09cdb6ff4cade8fbb1b9d3e66a3e05e583 Mon Sep 17 00:00:00 2001 From: AWS CDK Automation <43080478+aws-cdk-automation@users.noreply.github.com> Date: Thu, 4 Mar 2021 12:42:24 +0200 Subject: [PATCH 76/78] chore: npm-check-updates && yarn upgrade (#13390) Ran npm-check-updates and yarn upgrade to keep the `yarn.lock` file up-to-date. --- package.json | 6 +- packages/@aws-cdk/assert/package.json | 2 +- .../package.json | 4 +- .../aws-global-table-coordinator/package.json | 2 +- packages/@aws-cdk/aws-dynamodb/package.json | 2 +- .../@aws-cdk/aws-lambda-nodejs/package.json | 2 +- packages/@aws-cdk/aws-logs/package.json | 2 +- packages/@aws-cdk/aws-sam/package.json | 2 +- .../@aws-cdk/cloudformation-diff/package.json | 2 +- .../cloudformation-include/package.json | 2 +- .../@aws-cdk/custom-resources/package.json | 2 +- .../@monocdk-experiment/assert/package.json | 2 +- packages/aws-cdk/package.json | 6 +- packages/awslint/package.json | 4 +- packages/cdk-dasm/package.json | 2 +- packages/decdk/package.json | 4 +- tools/cdk-build-tools/package.json | 8 +- tools/cfn2ts/package.json | 2 +- yarn.lock | 209 +++++++++--------- 19 files changed, 132 insertions(+), 133 deletions(-) diff --git a/package.json b/package.json index 84eeb77a0016c..6ddae6c7ad5d5 100644 --- a/package.json +++ b/package.json @@ -18,9 +18,9 @@ "fs-extra": "^9.1.0", "graceful-fs": "^4.2.6", "jest-junit": "^12.0.0", - "jsii-diff": "^1.23.0", - "jsii-pacmak": "^1.23.0", - "jsii-rosetta": "^1.23.0", + "jsii-diff": "^1.24.0", + "jsii-pacmak": "^1.24.0", + "jsii-rosetta": "^1.24.0", "lerna": "^3.22.1", "standard-version": "^9.1.1", "typescript": "~3.9.9" diff --git a/packages/@aws-cdk/assert/package.json b/packages/@aws-cdk/assert/package.json index 17a2d01fae5c9..95d88e937b9d0 100644 --- a/packages/@aws-cdk/assert/package.json +++ b/packages/@aws-cdk/assert/package.json @@ -25,7 +25,7 @@ "cdk-build-tools": "0.0.0", "jest": "^26.6.3", "pkglint": "0.0.0", - "ts-jest": "^26.5.2" + "ts-jest": "^26.5.3" }, "dependencies": { "@aws-cdk/cloud-assembly-schema": "0.0.0", diff --git a/packages/@aws-cdk/aws-certificatemanager/lambda-packages/dns_validated_certificate_handler/package.json b/packages/@aws-cdk/aws-certificatemanager/lambda-packages/dns_validated_certificate_handler/package.json index d0f82b65a940e..0190f7771c88e 100644 --- a/packages/@aws-cdk/aws-certificatemanager/lambda-packages/dns_validated_certificate_handler/package.json +++ b/packages/@aws-cdk/aws-certificatemanager/lambda-packages/dns_validated_certificate_handler/package.json @@ -37,7 +37,7 @@ "eslint-plugin-standard": "^4.1.0", "jest": "^26.6.3", "lambda-tester": "^3.6.0", - "nock": "^13.0.9", - "ts-jest": "^26.5.2" + "nock": "^13.0.10", + "ts-jest": "^26.5.3" } } diff --git a/packages/@aws-cdk/aws-dynamodb-global/lambda-packages/aws-global-table-coordinator/package.json b/packages/@aws-cdk/aws-dynamodb-global/lambda-packages/aws-global-table-coordinator/package.json index 001e9b369ea83..e2ae4352eabe5 100644 --- a/packages/@aws-cdk/aws-dynamodb-global/lambda-packages/aws-global-table-coordinator/package.json +++ b/packages/@aws-cdk/aws-dynamodb-global/lambda-packages/aws-global-table-coordinator/package.json @@ -37,6 +37,6 @@ "eslint-plugin-standard": "^4.1.0", "jest": "^26.6.3", "lambda-tester": "^3.6.0", - "nock": "^13.0.9" + "nock": "^13.0.10" } } diff --git a/packages/@aws-cdk/aws-dynamodb/package.json b/packages/@aws-cdk/aws-dynamodb/package.json index 5737a58a67816..01ce9c576c096 100644 --- a/packages/@aws-cdk/aws-dynamodb/package.json +++ b/packages/@aws-cdk/aws-dynamodb/package.json @@ -81,7 +81,7 @@ "jest": "^26.6.3", "pkglint": "0.0.0", "sinon": "^9.2.4", - "ts-jest": "^26.5.2" + "ts-jest": "^26.5.3" }, "dependencies": { "@aws-cdk/aws-applicationautoscaling": "0.0.0", diff --git a/packages/@aws-cdk/aws-lambda-nodejs/package.json b/packages/@aws-cdk/aws-lambda-nodejs/package.json index 7ae4a7822c113..03e6cb806817e 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/package.json +++ b/packages/@aws-cdk/aws-lambda-nodejs/package.json @@ -67,7 +67,7 @@ "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "delay": "5.0.0", - "esbuild": "^0.8.54", + "esbuild": "^0.8.55", "pkglint": "0.0.0" }, "dependencies": { diff --git a/packages/@aws-cdk/aws-logs/package.json b/packages/@aws-cdk/aws-logs/package.json index c1b3eef36c73b..f778b855211eb 100644 --- a/packages/@aws-cdk/aws-logs/package.json +++ b/packages/@aws-cdk/aws-logs/package.json @@ -77,7 +77,7 @@ "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "cfn2ts": "0.0.0", - "nock": "^13.0.9", + "nock": "^13.0.10", "nodeunit": "^0.11.3", "pkglint": "0.0.0", "sinon": "^9.2.4" diff --git a/packages/@aws-cdk/aws-sam/package.json b/packages/@aws-cdk/aws-sam/package.json index 6643799114182..686ceb3b92b41 100644 --- a/packages/@aws-cdk/aws-sam/package.json +++ b/packages/@aws-cdk/aws-sam/package.json @@ -78,7 +78,7 @@ "cfn2ts": "0.0.0", "jest": "^26.6.3", "pkglint": "0.0.0", - "ts-jest": "^26.5.2" + "ts-jest": "^26.5.3" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/cloudformation-diff/package.json b/packages/@aws-cdk/cloudformation-diff/package.json index d717c69b9db96..bcbb1c7193e68 100644 --- a/packages/@aws-cdk/cloudformation-diff/package.json +++ b/packages/@aws-cdk/cloudformation-diff/package.json @@ -36,7 +36,7 @@ "fast-check": "^2.13.0", "jest": "^26.6.3", "pkglint": "0.0.0", - "ts-jest": "^26.5.2" + "ts-jest": "^26.5.3" }, "repository": { "url": "https://github.com/aws/aws-cdk.git", diff --git a/packages/@aws-cdk/cloudformation-include/package.json b/packages/@aws-cdk/cloudformation-include/package.json index ce9716626baee..f9b2e79888365 100644 --- a/packages/@aws-cdk/cloudformation-include/package.json +++ b/packages/@aws-cdk/cloudformation-include/package.json @@ -367,7 +367,7 @@ "cdk-integ-tools": "0.0.0", "jest": "^26.6.3", "pkglint": "0.0.0", - "ts-jest": "^26.5.2" + "ts-jest": "^26.5.3" }, "keywords": [ "aws", diff --git a/packages/@aws-cdk/custom-resources/package.json b/packages/@aws-cdk/custom-resources/package.json index 0044f79eda383..97363c57b7918 100644 --- a/packages/@aws-cdk/custom-resources/package.json +++ b/packages/@aws-cdk/custom-resources/package.json @@ -84,7 +84,7 @@ "cdk-integ-tools": "0.0.0", "cfn2ts": "0.0.0", "fs-extra": "^9.1.0", - "nock": "^13.0.9", + "nock": "^13.0.10", "pkglint": "0.0.0", "sinon": "^9.2.4" }, diff --git a/packages/@monocdk-experiment/assert/package.json b/packages/@monocdk-experiment/assert/package.json index a4d825852a613..f70aec783eff1 100644 --- a/packages/@monocdk-experiment/assert/package.json +++ b/packages/@monocdk-experiment/assert/package.json @@ -41,7 +41,7 @@ "jest": "^26.6.3", "monocdk": "0.0.0", "pkglint": "0.0.0", - "ts-jest": "^26.5.2" + "ts-jest": "^26.5.3" }, "dependencies": { "@aws-cdk/cloudformation-diff": "0.0.0" diff --git a/packages/aws-cdk/package.json b/packages/aws-cdk/package.json index 785087c8fb196..71a094e6e72ca 100644 --- a/packages/aws-cdk/package.json +++ b/packages/aws-cdk/package.json @@ -39,7 +39,7 @@ "license": "Apache-2.0", "devDependencies": { "@aws-cdk/core": "0.0.0", - "@octokit/rest": "^18.3.1", + "@octokit/rest": "^18.3.2", "@types/archiver": "^5.1.0", "@types/fs-extra": "^8.1.1", "@types/glob": "^7.1.3", @@ -59,10 +59,10 @@ "jest": "^26.6.3", "make-runnable": "^1.3.8", "mockery": "^2.1.0", - "nock": "^13.0.9", + "nock": "^13.0.10", "pkglint": "0.0.0", "sinon": "^9.2.4", - "ts-jest": "^26.5.2", + "ts-jest": "^26.5.3", "ts-mock-imports": "^1.3.3", "xml-js": "^1.6.11" }, diff --git a/packages/awslint/package.json b/packages/awslint/package.json index 3a5e17066742b..3be540173745f 100644 --- a/packages/awslint/package.json +++ b/packages/awslint/package.json @@ -16,11 +16,11 @@ "awslint": "bin/awslint" }, "dependencies": { - "@jsii/spec": "^1.23.0", + "@jsii/spec": "^1.24.0", "camelcase": "^6.2.0", "colors": "^1.4.0", "fs-extra": "^9.1.0", - "jsii-reflect": "^1.23.0", + "jsii-reflect": "^1.24.0", "yargs": "^16.2.0" }, "devDependencies": { diff --git a/packages/cdk-dasm/package.json b/packages/cdk-dasm/package.json index a60843d4454b7..067cf1694ff98 100644 --- a/packages/cdk-dasm/package.json +++ b/packages/cdk-dasm/package.json @@ -26,7 +26,7 @@ }, "license": "Apache-2.0", "dependencies": { - "codemaker": "^1.23.0", + "codemaker": "^1.24.0", "yaml": "1.10.0" }, "devDependencies": { diff --git a/packages/decdk/package.json b/packages/decdk/package.json index 2fa2feeaabae7..8b8b17d52f621 100644 --- a/packages/decdk/package.json +++ b/packages/decdk/package.json @@ -210,7 +210,7 @@ "@aws-cdk/yaml-cfn": "0.0.0", "constructs": "^3.2.0", "fs-extra": "^9.1.0", - "jsii-reflect": "^1.23.0", + "jsii-reflect": "^1.24.0", "jsonschema": "^1.4.0", "yaml": "1.10.0", "yargs": "^16.2.0" @@ -221,7 +221,7 @@ "@types/yaml": "1.9.7", "@types/yargs": "^15.0.13", "jest": "^26.6.3", - "jsii": "^1.23.0" + "jsii": "^1.24.0" }, "keywords": [ "aws", diff --git a/tools/cdk-build-tools/package.json b/tools/cdk-build-tools/package.json index c9bd2823410f3..645d6eb54b454 100644 --- a/tools/cdk-build-tools/package.json +++ b/tools/cdk-build-tools/package.json @@ -51,13 +51,13 @@ "eslint-plugin-jest": "^24.1.5", "fs-extra": "^9.1.0", "jest": "^26.6.3", - "jsii": "^1.23.0", - "jsii-pacmak": "^1.23.0", - "markdownlint-cli": "^0.27.0", + "jsii": "^1.24.0", + "jsii-pacmak": "^1.24.0", + "markdownlint-cli": "^0.27.1", "nodeunit": "^0.11.3", "nyc": "^15.1.0", "semver": "^7.3.4", - "ts-jest": "^26.5.2", + "ts-jest": "^26.5.3", "typescript": "~3.9.9", "yargs": "^16.2.0", "yarn-cling": "0.0.0" diff --git a/tools/cfn2ts/package.json b/tools/cfn2ts/package.json index bcee4f73d7020..6bc7f4ebb4d58 100644 --- a/tools/cfn2ts/package.json +++ b/tools/cfn2ts/package.json @@ -30,7 +30,7 @@ "license": "Apache-2.0", "dependencies": { "@aws-cdk/cfnspec": "0.0.0", - "codemaker": "^1.23.0", + "codemaker": "^1.24.0", "fast-json-patch": "^3.0.0-1", "fs-extra": "^9.1.0", "yargs": "^16.2.0" diff --git a/yarn.lock b/yarn.lock index a882be99918c4..9e33a1efe99be 100644 --- a/yarn.lock +++ b/yarn.lock @@ -587,10 +587,10 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" -"@jsii/spec@^1.23.0": - version "1.23.0" - resolved "https://registry.yarnpkg.com/@jsii/spec/-/spec-1.23.0.tgz#c554cc77d0206f00ba4c101e96cb89d4ecec2985" - integrity sha512-+8Df/m/SRnThSAARlfxknwq1iWnCc2I1kThopuGQiz+peTRMoDVXaH7ZKT+54iZFIrbSf9Pjetho8g0/AZwrKg== +"@jsii/spec@^1.24.0": + version "1.24.0" + resolved "https://registry.yarnpkg.com/@jsii/spec/-/spec-1.24.0.tgz#59dd43af7bb65074b39bd457a98f4ab3cb385bd3" + integrity sha512-Km0va0ZBlzWPOijsNlo7SwozYT6Ej9h01xXYtBmoHw2CLccofOEQLV2Ig3+ydhU+aTW5yLKJrVPsAjJoaaBAgA== dependencies: jsonschema "^1.4.0" @@ -1350,10 +1350,10 @@ "@octokit/types" "^6.0.3" universal-user-agent "^6.0.0" -"@octokit/openapi-types@^5.2.1": - version "5.2.1" - resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-5.2.1.tgz#5e846f86104aef96ace20091d8afb6be27979d8a" - integrity sha512-Bf7MBvQ1nMpv15ANaQtRBsC7YnwQFPM0eUztp3luQs9L6sBEiQ6ArM1Wx5CG+N7tXETtd0oE0DMcU4wbLlCZIw== +"@octokit/openapi-types@^5.2.2": + version "5.2.2" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-5.2.2.tgz#1590c118a131031610faffd4222ae54915e2b82d" + integrity sha512-b3nHy/0uufJJsaZERwZM0syLRO6gfr6vvBPLewQxBKzzbhGDx1ygTyoELMNADD7mIPPzGMqbfdCeJTSeZueZwA== "@octokit/plugin-enterprise-rest@^6.0.1": version "6.0.1" @@ -1387,12 +1387,12 @@ "@octokit/types" "^2.0.1" deprecation "^2.3.1" -"@octokit/plugin-rest-endpoint-methods@4.13.1": - version "4.13.1" - resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.13.1.tgz#d8c807bbd0e187ac903620f53321e2634818bb30" - integrity sha512-T9YhQqpbO9Onmg+FYk09uci9pfChg8CZR9GBaPJWj+bDSzictW1xnU0NtCSSKKyrwvpW/opu7CtuDSs/HF1Syg== +"@octokit/plugin-rest-endpoint-methods@4.13.2": + version "4.13.2" + resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.13.2.tgz#4e1fa30742a7bb1f0fe99e2f8e2b21f7aa8b7eb5" + integrity sha512-pnn0lGE05nqZ+EZuZgJBffJ4QRAlrlvg3LBFjCKHqUUWCI3PMqZ8kPJOxFj0R3B3D5hoGambtEIpCnaRD6nRJw== dependencies: - "@octokit/types" "^6.11.1" + "@octokit/types" "^6.11.2" deprecation "^2.3.1" "@octokit/request-error@^1.0.2": @@ -1449,15 +1449,15 @@ once "^1.4.0" universal-user-agent "^4.0.0" -"@octokit/rest@^18.3.1": - version "18.3.1" - resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.3.1.tgz#6680331e941c422dbff0e758a9bd3dc4edcbd2db" - integrity sha512-g57ebsk7dtbLjiPBgEYDAiDTsyQM9kvlIt0J5UN6OSjG82K6fQQck6HXPpwcyNIDqbN7lIaWr3nsz56jBfI6qg== +"@octokit/rest@^18.3.2": + version "18.3.2" + resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.3.2.tgz#dae61ff8c70e3f968e182919f36f1338163c8ea8" + integrity sha512-TSTI47/jLqdq8qvc/a/P/VApBal7QHeISPZ8a1v7ma8NN/YdU5HRTSCb15+IvzUeuM7Iagp0aG+ypvQXJgmgQw== dependencies: "@octokit/core" "^3.2.3" "@octokit/plugin-paginate-rest" "^2.6.2" "@octokit/plugin-request-log" "^1.0.2" - "@octokit/plugin-rest-endpoint-methods" "4.13.1" + "@octokit/plugin-rest-endpoint-methods" "4.13.2" "@octokit/types@^2.0.0", "@octokit/types@^2.0.1": version "2.16.2" @@ -1466,12 +1466,12 @@ dependencies: "@types/node" ">= 8" -"@octokit/types@^6.0.3", "@octokit/types@^6.11.0", "@octokit/types@^6.11.1", "@octokit/types@^6.7.1": - version "6.11.1" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.11.1.tgz#54ece128029526fa99bd71e757b9e35478403d95" - integrity sha512-UiSRTG2lrFbMUMwhKNR0uSV33Fzv4bNu1n5iFuuNOg80XCh0VYNhR4TQWgrkLhVxdDuej6s61aP3eQvVm6K6uA== +"@octokit/types@^6.0.3", "@octokit/types@^6.11.0", "@octokit/types@^6.11.2", "@octokit/types@^6.7.1": + version "6.11.2" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.11.2.tgz#43973dc29cdf59bf9d5f3ab0d16275c4b4a6eb8d" + integrity sha512-EKQRFZU/oOfUlqk9ntLIE5UO/bcOx8exFpdXGBciJP90f05me3mza0sacIpqVqmiIQP3nJsBjnZHMmtijE5XwQ== dependencies: - "@octokit/openapi-types" "^5.2.1" + "@octokit/openapi-types" "^5.2.2" "@sinonjs/commons@^1.6.0", "@sinonjs/commons@^1.7.0", "@sinonjs/commons@^1.8.1": version "1.8.2" @@ -1605,7 +1605,7 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@26.x", "@types/jest@^26.0.20": +"@types/jest@^26.0.20": version "26.0.20" resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.20.tgz#cd2f2702ecf69e86b586e1f5223a60e454056307" integrity sha512-9zi2Y+5USJRxd0FsahERhBwlcvFh6D2GLQnY2FH2BzK8J9s9omvNHIbvABwIluXa0fD8XVKMLTO0aOEuUfACAA== @@ -1685,9 +1685,9 @@ integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== "@types/prettier@^2.0.0": - version "2.2.1" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.2.1.tgz#374e31645d58cb18a07b3ecd8e9dede4deb2cccd" - integrity sha512-DxZZbyMAM9GWEzXL+BMZROWz9oo6A9EilwwOMET2UVu2uZTqMWS5S69KVtuVKaRjCUpcrOXRalet86/OpG4kqw== + version "2.2.2" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.2.2.tgz#e2280c89ddcbeef340099d6968d8c86ba155fdf6" + integrity sha512-i99hy7Ki19EqVOl77WplDrvgNugHnsSjECVR/wUrzw2TJXz1zlUfT2ngGckR6xN7yFYaijsMAqPkOLx9HgUqHg== "@types/promptly@^3.0.1": version "3.0.1" @@ -2285,9 +2285,9 @@ aws-sdk-mock@^5.1.0: traverse "^0.6.6" aws-sdk@^2.596.0, aws-sdk@^2.637.0, aws-sdk@^2.848.0: - version "2.854.0" - resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.854.0.tgz#531525cdfdfc774232d86619d2c2c2ae3e1a71a8" - integrity sha512-Ex/YJcRB4avEW64UZ7uJ7aBxN8qFPuoSaG7YpLWUGJv+p9Vsqm0v0IqmMo7O5/s2LpIXRG8mLi3UbNZYz2iGhg== + version "2.856.0" + resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.856.0.tgz#a82719952949bdfda73832b465321a49577cf784" + integrity sha512-B9uRDhIxlmaz5GIDC2Q+OgVMnsPFzuu1HknWedpTre6ARG+Ukm8KQ3VA5MhsBtSm61X5u1Uwk5AlEv+feLaShA== dependencies: buffer "4.9.2" events "1.1.1" @@ -2684,9 +2684,9 @@ camelcase@^6.0.0, camelcase@^6.2.0: integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== caniuse-lite@^1.0.30001181: - version "1.0.30001194" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001194.tgz#3d16ff3d734a5a7d9818402c28b1f636c5be5bed" - integrity sha512-iDUOH+oFeBYk5XawYsPtsx/8fFpndAPUQJC7gBTfxHM8xw5nOZv7ceAD4frS1MKCLUac7QL5wdAJiFQlDRjXlA== + version "1.0.30001196" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001196.tgz#00518a2044b1abf3e0df31fadbe5ed90b63f4e64" + integrity sha512-CPvObjD3ovWrNBaXlAIGWmg2gQQuJ5YhuciUOjPRox6hIQttu8O+b51dx6VIpIY9ESd2d0Vac1RKpICdG4rGUg== capture-exit@^2.0.0: version "2.0.0" @@ -2868,10 +2868,10 @@ code-point-at@^1.0.0: resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= -codemaker@^1.23.0: - version "1.23.0" - resolved "https://registry.yarnpkg.com/codemaker/-/codemaker-1.23.0.tgz#2d2168e70829496cff0549983b6ea7b7f843c1a3" - integrity sha512-VpHeRuvibqJbayWj9xHb15yKRLBOJUrZuhsmH868m6xGz5FXwLD1aUdSY9rqaNI0df8FfFyCYhk5f/A+bi0/wg== +codemaker@^1.24.0: + version "1.24.0" + resolved "https://registry.yarnpkg.com/codemaker/-/codemaker-1.24.0.tgz#6b8d4d106fd275713a078bf62fc5c6ebcaa65343" + integrity sha512-oKi5BNSyH0LBtFoxWKRvWnTut8NRdRgOzIF6/YKCaNnVECqq0oMqUpEBKNgcS+sOxfJfI/tkORpSdNGGVE0tmA== dependencies: camelcase "^6.2.0" decamelize "^5.0.0" @@ -2977,10 +2977,10 @@ component-emitter@^1.2.1: resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== -compress-commons@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/compress-commons/-/compress-commons-4.0.2.tgz#d6896be386e52f37610cef9e6fa5defc58c31bd7" - integrity sha512-qhd32a9xgzmpfoga1VQEiLEwdKZ6Plnpx5UCgIsf89FSolyJ7WnifY4Gtjgv5WR6hWAyRaHxC5MiEhU/38U70A== +compress-commons@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/compress-commons/-/compress-commons-4.1.0.tgz#25ec7a4528852ccd1d441a7d4353cd0ece11371b" + integrity sha512-ofaaLqfraD1YRTkrRKPCrGJ1pFeDG/MVCkVVV2FNGeWquSlqw5wOrwOfPQ1xF2u+blpeWASie5EubHz+vsNIgA== dependencies: buffer-crc32 "^0.2.13" crc32-stream "^4.0.1" @@ -3026,9 +3026,9 @@ console-control-strings@^1.0.0, console-control-strings@~1.1.0: integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= constructs@^3.2.0: - version "3.3.48" - resolved "https://registry.yarnpkg.com/constructs/-/constructs-3.3.48.tgz#56446b7bd8da8023f33a2e4c1bc7d2df3971e6eb" - integrity sha512-5AKrTtmiioQWloJ3WRFZb0/uR1lrRboaVE9go++XZltvRnZkN2/kQjaZ0gtFxynU5u5k9mWVtk8mNcgJ9yoRbQ== + version "3.3.55" + resolved "https://registry.yarnpkg.com/constructs/-/constructs-3.3.55.tgz#ee54bd2202d8d72d9ce10694f055054d8cffef1f" + integrity sha512-PKlPeHnIN7EAdanoVpwUnj6Zb5Zhgb6lCQ1YTES52puksbw34TG7oqO2kzmTVTK3MVDMUdhCDKyroaVmNOtiiw== contains-path@^0.1.0: version "0.1.0" @@ -3782,9 +3782,9 @@ ejs@^2.5.2: integrity sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA== electron-to-chromium@^1.3.649: - version "1.3.677" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.677.tgz#b5d586b0d1976c97cc7e95262677ac5944199513" - integrity sha512-Tcmk+oKQgpjcM+KYanlkd76ZtpzalkpUULnlJDP6vjHtR7UU564IM9Qv5DxqHZNBQjzXm6mkn7Y8bw2OoE3FmQ== + version "1.3.680" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.680.tgz#88cc44bd2a85b46cf7521f714db57dd74d0cd488" + integrity sha512-XBACJT9RdpdWtoMXQPR8Be3ZtmizWWbxfw8cY2b5feUwiDO3FUl8qo4W2jXoq/WnnA3xBRqafu1XbpczqyUvlA== emittery@^0.7.1: version "0.7.2" @@ -3855,9 +3855,9 @@ error-ex@^1.2.0, error-ex@^1.3.1: is-arrayish "^0.2.1" es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2: - version "1.18.0-next.3" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0-next.3.tgz#56bc8b5cc36b2cca25a13be07f3c02c2343db6b7" - integrity sha512-VMzHx/Bczjg59E6jZOQjHeN3DEoptdhejpARgflAViidlqSpjdq9zA6lKwlhRRs/lOw1gHJv2xkkSFRgvEwbQg== + version "1.18.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0.tgz#ab80b359eecb7ede4c298000390bc5ac3ec7b5a4" + integrity sha512-LJzK7MrQa8TS0ja2w3YNLzUgJCGPdPOV1yVvezjNnS89D+VR08+Szt2mz3YB2Dck/+w5tfIq/RoUAFqJJGM2yw== dependencies: call-bind "^1.0.2" es-to-primitive "^1.2.1" @@ -3921,10 +3921,10 @@ es6-promisify@^5.0.0: dependencies: es6-promise "^4.0.3" -esbuild@^0.8.54: - version "0.8.54" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.8.54.tgz#2f32ff80e95c69a0f25b799d76a27c05e2857cdf" - integrity sha512-DJH38OiTgXJxFb/EhHrCrY8eGmtdkTtWymHpN9IYN9AF+4jykT0dQArr7wzFejpVbaB0TMIq2+vfNRWr3LXpvw== +esbuild@^0.8.55: + version "0.8.55" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.8.55.tgz#4bf949c44db4ffc2a206ac0c002e8e94eecff7d5" + integrity sha512-mM/s7hjYe5mQR+zAWOM5JVrCtYCke182E9l1Bbs6rG5EDP3b1gZF9sHZka53PD/iNt6OccymVZRWkTtBfcKW4w== escalade@^3.1.1: version "3.1.1" @@ -6250,65 +6250,65 @@ jsesc@^2.5.1: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== -jsii-diff@^1.23.0: - version "1.23.0" - resolved "https://registry.yarnpkg.com/jsii-diff/-/jsii-diff-1.23.0.tgz#57fc832155e4739fbfc7a235b177c305e9cb6f67" - integrity sha512-1g41UE2yJK8E50eDo4JSJQZRlfmUzWDw0D7DF40Z6upbay3jQKWjerXbJmD9RvJkD6I8khAoEnI77daw1AgQTw== +jsii-diff@^1.24.0: + version "1.24.0" + resolved "https://registry.yarnpkg.com/jsii-diff/-/jsii-diff-1.24.0.tgz#97375083661a9cdd931764b526184bb5eb192497" + integrity sha512-Wkj/fyAmtNsaLSr5r6abgm5nnU7aHnlaqj//gG0azum7+TkbrmNj9LaxwXYJWT2fROCmP/fS8/jJta5U3wAi7Q== dependencies: - "@jsii/spec" "^1.23.0" + "@jsii/spec" "^1.24.0" fs-extra "^9.1.0" - jsii-reflect "^1.23.0" + jsii-reflect "^1.24.0" log4js "^6.3.0" typescript "~3.9.9" yargs "^16.2.0" -jsii-pacmak@^1.23.0: - version "1.23.0" - resolved "https://registry.yarnpkg.com/jsii-pacmak/-/jsii-pacmak-1.23.0.tgz#aedc0f17dc420da5be9446189eae5096fe170bd3" - integrity sha512-LchV8amHqWHjypbPLDZqdLkmp0rVYJYhFbS88sApvO4TaDdh0C3KnbEjNf3Jn/JpPXxd2PUNtCw8D9fDy7zwVw== +jsii-pacmak@^1.24.0: + version "1.24.0" + resolved "https://registry.yarnpkg.com/jsii-pacmak/-/jsii-pacmak-1.24.0.tgz#f16cb329ded0b2ce435846013910c811c6e29c34" + integrity sha512-8L5AOOy2LU3Y8tLy+KBTdmtxfu+Kn6g54htj+d1g3dVCxApC/G83C1DudhkYCxM3gDavsLPHhG6+fyopdTVV5A== dependencies: - "@jsii/spec" "^1.23.0" + "@jsii/spec" "^1.24.0" clone "^2.1.2" - codemaker "^1.23.0" + codemaker "^1.24.0" commonmark "^0.29.3" escape-string-regexp "^4.0.0" fs-extra "^9.1.0" - jsii-reflect "^1.23.0" - jsii-rosetta "^1.23.0" + jsii-reflect "^1.24.0" + jsii-rosetta "^1.24.0" semver "^7.3.4" spdx-license-list "^6.4.0" xmlbuilder "^15.1.1" yargs "^16.2.0" -jsii-reflect@^1.23.0: - version "1.23.0" - resolved "https://registry.yarnpkg.com/jsii-reflect/-/jsii-reflect-1.23.0.tgz#fd046e25e4d89887bc0ea7416d68e42568c6689e" - integrity sha512-jxQnz5hm5tk7l85iWgfyuxnB+mpzmj/y96AIkSbbOfHDeHpLG7h+yOROZoe2K8tUcHKamA70p+gNcZOETZP3OA== +jsii-reflect@^1.24.0: + version "1.24.0" + resolved "https://registry.yarnpkg.com/jsii-reflect/-/jsii-reflect-1.24.0.tgz#61589ba10bc4bceeaeb68dd9e13acc22ac4b4e73" + integrity sha512-LWWReRtLhmyUMRD5NOFDV+HJHP/ChHRa6alccSPU9vTL5tm9HtMW0oO2XaVj4a2YPujvQ+sH7APzndj60Qgzqw== dependencies: - "@jsii/spec" "^1.23.0" + "@jsii/spec" "^1.24.0" colors "^1.4.0" fs-extra "^9.1.0" - oo-ascii-tree "^1.23.0" + oo-ascii-tree "^1.24.0" yargs "^16.2.0" -jsii-rosetta@^1.23.0: - version "1.23.0" - resolved "https://registry.yarnpkg.com/jsii-rosetta/-/jsii-rosetta-1.23.0.tgz#fd62dbf84b16cb119c80aca4397ab5d6ee02f071" - integrity sha512-LBFq1LBrq97MUU5T9sgrIPq0wMWUCsUt3tnZEpjIDXPHYptVVn7HmKbu5PjG47GbNTOcsY/nP2r7N3RFrG881g== +jsii-rosetta@^1.24.0: + version "1.24.0" + resolved "https://registry.yarnpkg.com/jsii-rosetta/-/jsii-rosetta-1.24.0.tgz#f0c674e6fa88d449360171400a46c556cde184bd" + integrity sha512-BMYxIjYG62wctUZFjYc5xKPNTgzTRRw2Fp8R9p4o0VeFE224ntyHgy9y7oKuCu+K1ev917NRoCLj7f2tyGTMAg== dependencies: - "@jsii/spec" "^1.23.0" + "@jsii/spec" "^1.24.0" commonmark "^0.29.3" fs-extra "^9.1.0" typescript "~3.9.9" xmldom "^0.4.0" yargs "^16.2.0" -jsii@^1.23.0: - version "1.23.0" - resolved "https://registry.yarnpkg.com/jsii/-/jsii-1.23.0.tgz#12e04a565114024bc6721f6482e9a362bbf50926" - integrity sha512-vwwFEt+7wXtex8G1ztWIuOPDhahZA/a+XvtiucZYnIO7VwkmeqAxrgwdBIrQoH2GJKYs55kMnDa4+yfnTGcOgw== +jsii@^1.24.0: + version "1.24.0" + resolved "https://registry.yarnpkg.com/jsii/-/jsii-1.24.0.tgz#48e156b77f54d067520e0789f75d70c883be058a" + integrity sha512-ROCFFFdbs2o8OgQEWvpMY/UMXshndkGr8TunG0NQx8kQfONYeCjgNFqMcbcyXuhlR+DI1MUGVVOzw6zc9geyGA== dependencies: - "@jsii/spec" "^1.23.0" + "@jsii/spec" "^1.24.0" case "^1.6.3" colors "^1.4.0" deep-equal "^2.0.5" @@ -6880,10 +6880,10 @@ markdown-it@12.0.4: mdurl "^1.0.1" uc.micro "^1.0.5" -markdownlint-cli@^0.27.0: - version "0.27.0" - resolved "https://registry.yarnpkg.com/markdownlint-cli/-/markdownlint-cli-0.27.0.tgz#d89264319ef7ae6a02e0b2fd472fbbb11bde47f7" - integrity sha512-lci/GD1V2aysJOpJFXfIt5KlpF62Rw+7hUfGg3ZwkLBBeNuUwLZj/IomQ924m00Ido/tPGbFObelKlZaUlETpQ== +markdownlint-cli@^0.27.1: + version "0.27.1" + resolved "https://registry.yarnpkg.com/markdownlint-cli/-/markdownlint-cli-0.27.1.tgz#8fa095eea94936b6dea891f9db7f269c60e6d6fa" + integrity sha512-p1VV6aSbGrDlpUWzHizAnSNEQAweVR3qUI/AIUubxW7BGPXziSXkIED+uRtSohUlRS/jmqp3Wi4es5j6fIrdeQ== dependencies: commander "~7.1.0" deep-extend "~0.6.0" @@ -7273,10 +7273,10 @@ nise@^4.0.4: just-extend "^4.0.2" path-to-regexp "^1.7.0" -nock@^13.0.9: - version "13.0.9" - resolved "https://registry.yarnpkg.com/nock/-/nock-13.0.9.tgz#32b9f6408a71991b25f044109cac92ee556c8539" - integrity sha512-SoGx/J0SsZPOdBFrBC9PP6NwaEgOBQIRPbsOsO9q+OwOPWc5eT6wALSxn3ZNE4Fv2ImIUXM4Hv/07rjq/uWDew== +nock@^13.0.10: + version "13.0.10" + resolved "https://registry.yarnpkg.com/nock/-/nock-13.0.10.tgz#a9a015269408d56ec9ac57fe3ede86b0a83ecc6a" + integrity sha512-AvUO/tbiWVBjlC3WsuIutPXltPbPmHWfcLwDSYzykKBJhOeo9eZPczo8n9aV4AHHCgpeL70zBXLwiSE+mzx89g== dependencies: debug "^4.1.0" json-stringify-safe "^5.0.1" @@ -7664,10 +7664,10 @@ onetime@^5.1.0: dependencies: mimic-fn "^2.1.0" -oo-ascii-tree@^1.23.0: - version "1.23.0" - resolved "https://registry.yarnpkg.com/oo-ascii-tree/-/oo-ascii-tree-1.23.0.tgz#b7a8ece5d313a420689a6a9d728a2696e8991e40" - integrity sha512-+T0rUcBAvJaEXbdCe3p8A7qjJ82CRGSgfUSvkGscH2F0lFqrELN1ey0UGDf0UV7C/ivIFzct5DYJAhrVvFbeUw== +oo-ascii-tree@^1.24.0: + version "1.24.0" + resolved "https://registry.yarnpkg.com/oo-ascii-tree/-/oo-ascii-tree-1.24.0.tgz#4eae1b2c2c6ba5bd83129c54d4b82443316dd378" + integrity sha512-rJYspYyrr2lDCDnybz4/70eml5cen98r4u2uw8sGodROePXiKKE+2Al8tfiS6uYx7vUEozEHCLoNQ/2jpxa7gw== opener@^1.5.1: version "1.5.2" @@ -9863,12 +9863,11 @@ trivial-deferred@^1.0.1: resolved "https://registry.yarnpkg.com/trivial-deferred/-/trivial-deferred-1.0.1.tgz#376d4d29d951d6368a6f7a0ae85c2f4d5e0658f3" integrity sha1-N21NKdlR1jaKb3oK6FwvTV4GWPM= -ts-jest@^26.5.2: - version "26.5.2" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.5.2.tgz#5281d6b44c2f94f71205728a389edc3d7995b0c4" - integrity sha512-bwyJ2zJieSugf7RB+o8fgkMeoMVMM2KPDE0UklRLuACxjwJsOrZNo6chrcScmK33YavPSwhARffy8dZx5LJdUQ== +ts-jest@^26.5.3: + version "26.5.3" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.5.3.tgz#a6ee00ba547be3b09877550df40a1465d0295554" + integrity sha512-nBiiFGNvtujdLryU7MiMQh1iPmnZ/QvOskBbD2kURiI1MwqvxlxNnaAB/z9TbslMqCsSbu5BXvSSQPc5tvHGeA== dependencies: - "@types/jest" "26.x" bs-logger "0.x" buffer-from "1.x" fast-json-stable-stringify "2.x" @@ -10673,10 +10672,10 @@ yocto-queue@^0.1.0: integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== zip-stream@^4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/zip-stream/-/zip-stream-4.0.4.tgz#3a8f100b73afaa7d1ae9338d910b321dec77ff3a" - integrity sha512-a65wQ3h5gcQ/nQGWV1mSZCEzCML6EK/vyVPcrPNynySP1j3VBbQKh3nhC8CbORb+jfl2vXvh56Ul5odP1bAHqw== + version "4.1.0" + resolved "https://registry.yarnpkg.com/zip-stream/-/zip-stream-4.1.0.tgz#51dd326571544e36aa3f756430b313576dc8fc79" + integrity sha512-zshzwQW7gG7hjpBlgeQP9RuyPGNxvJdzR8SUM3QhxCnLjWN2E7j3dOvpeDcQoETfHx0urRS7EtmVToql7YpU4A== dependencies: archiver-utils "^2.1.0" - compress-commons "^4.0.2" + compress-commons "^4.1.0" readable-stream "^3.6.0" From 396acee11f9e7c0669b53a148a83063d6889047d Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Thu, 4 Mar 2021 16:00:08 +0200 Subject: [PATCH 77/78] chore: fix auto-approve workflow (#13392) I believe the reason our auto-approve workflow does not work is because it was triggered when the pull request was _created_ and before the `pr/auto-approve` label was applied to it. This adds `types: [ labeled ]` so the workflow is triggered when a PR is labeled. The condition remains the same. --- .github/workflows/auto-approve.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml index cf2ed7e21ca69..c289f5381995c 100644 --- a/.github/workflows/auto-approve.yml +++ b/.github/workflows/auto-approve.yml @@ -1,7 +1,9 @@ # Approve PRs with "pr/auto-approve". mergify takes care of the actual merge. name: auto-approve -on: pull_request +on: + pull_request: + types: [ labeled, unlabeled, opened, synchronize, reopened, ready_for_review, review_requested ] jobs: auto-approve: From 9331657bf177a25fa4d7535ffb027a106b2bebe3 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Thu, 4 Mar 2021 15:34:04 +0100 Subject: [PATCH 78/78] chore(build): yarn-cling does not work under Node 15 (#13391) Some tricks we are using to locate packages on disk don't work anymore under newer Node versions. Switch strategies. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- tools/yarn-cling/lib/index.ts | 46 +++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/tools/yarn-cling/lib/index.ts b/tools/yarn-cling/lib/index.ts index 44a09a09fcb8d..38a766c27d7e5 100644 --- a/tools/yarn-cling/lib/index.ts +++ b/tools/yarn-cling/lib/index.ts @@ -1,6 +1,6 @@ -import * as lockfile from '@yarnpkg/lockfile'; -import { promises as fs } from 'fs'; +import { promises as fs, exists } from 'fs'; import * as path from 'path'; +import * as lockfile from '@yarnpkg/lockfile'; import { hoistDependencies } from './hoisting'; import { PackageJson, PackageLock, PackageLockEntry, PackageLockPackage, YarnLock } from './types'; @@ -42,7 +42,7 @@ export async function generateShrinkwrap(options: ShrinkwrapOptions): Promise, yarnLock: YarnLock, rootDir = await fs.realpath(rootDir); for (const [depName, versionRange] of Object.entries(deps)) { - const depPkgJsonFile = require.resolve(`${depName}/package.json`, { paths: [rootDir] }); + const depDir = await findPackageDir(depName, rootDir); + const depPkgJsonFile = path.join(depDir, 'package.json'); const depPkgJson = await loadPackageJson(depPkgJsonFile); - const depDir = path.dirname(depPkgJsonFile); const yarnKey = `${depName}@${versionRange}`; // Sanity check @@ -150,4 +150,40 @@ export function formatPackageLock(entry: PackageLockEntry) { recurse([...names, depName], depEntry); } } +} + +/** + * Find package directory + * + * Do this by walking upwards in the directory tree until we find + * `/node_modules//package.json`. + * + * ------- + * + * Things that we tried but don't work: + * + * 1. require.resolve(`${depName}/package.json`, { paths: [rootDir] }); + * + * Breaks with ES Modules if `package.json` has not been exported, which is + * being enforced starting Node12. + * + * 2. findPackageJsonUpwardFrom(require.resolve(depName, { paths: [rootDir] })) + * + * Breaks if a built-in NodeJS package name conflicts with an NPM package name + * (in Node15 `string_decoder` is introduced...) + */ +async function findPackageDir(depName: string, rootDir: string) { + let prevDir; + let dir = rootDir; + while (dir !== prevDir) { + const candidateDir = path.join(dir, 'node_modules', depName); + if (await new Promise(ok => exists(path.join(candidateDir, 'package.json'), ok))) { + return candidateDir; + } + + prevDir = dir; + dir = path.dirname(dir); // dirname('/') -> '/', dirname('c:\\') -> 'c:\\' + } + + throw new Error(`Did not find '${depName}' upwards of '${rootDir}'`); } \ No newline at end of file