diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e09a8e2f4562e..22245baafecde 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -60,7 +60,7 @@ The following tools need to be installed on your system prior to installing the - [Node.js >= 14.15.0](https://nodejs.org/download/release/latest-v14.x/) - We recommend using a version in [Active LTS](https://nodejs.org/en/about/releases/) - [Yarn >= 1.19.1, < 2](https://yarnpkg.com/lang/en/docs/install) -- [.NET Core SDK >= 3.1.x](https://www.microsoft.com/net/download) +- [.NET SDK >= 6.0.x](https://www.microsoft.com/net/download) - [Python >= 3.6.5, < 4.0](https://www.python.org/downloads/release/python-365/) - [Docker >= 19.03](https://docs.docker.com/get-docker/) - the Docker daemon must also be running diff --git a/README.md b/README.md index 3395782708ae6..4b1cfb2405421 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ The CDK is available in the following languages: - We recommend using a version in [Active LTS](https://nodejs.org/en/about/releases/) * Python ([Python ≥ 3.6](https://www.python.org/downloads/)) * Java ([Java ≥ 8](https://www.oracle.com/technetwork/java/javase/downloads/index.html) and [Maven ≥ 3.5.4](https://maven.apache.org/download.cgi)) -* .NET ([.NET Core ≥ 3.1](https://dotnet.microsoft.com/download)) +* .NET ([.NET ≥ 6.0](https://dotnet.microsoft.com/download)) * Go ([Go ≥ 1.16.4](https://golang.org/)) Third-party Language Deprecation: language version is only supported until its EOL (End Of Life) shared by the vendor or community and is subject to change with prior notice. diff --git a/package.json b/package.json index 74b8ddc59fef8..02cb1f0f0ad24 100644 --- a/package.json +++ b/package.json @@ -19,15 +19,15 @@ "@types/node": "18.11.19", "@types/prettier": "2.6.0", "@yarnpkg/lockfile": "^1.1.0", - "cdk-generate-synthetic-examples": "^0.1.155", + "cdk-generate-synthetic-examples": "^0.1.167", "conventional-changelog-cli": "^2.2.2", "fs-extra": "^9.1.0", "graceful-fs": "^4.2.10", "jest-junit": "^13.2.0", - "jsii-diff": "1.75.0", - "jsii-pacmak": "1.75.0", - "jsii-reflect": "1.75.0", - "jsii-rosetta": "1.75.0", + "jsii-diff": "1.76.0", + "jsii-pacmak": "1.76.0", + "jsii-reflect": "1.76.0", + "jsii-rosetta": "v4.9-next", "lerna": "^4.0.0", "patch-package": "^6.5.1", "semver": "^6.3.0", diff --git a/packages/@aws-cdk-testing/cli-integ/bin/stage-distribution.ts b/packages/@aws-cdk-testing/cli-integ/bin/stage-distribution.ts index a5cfd6b496e5c..0c8f5e11eac53 100644 --- a/packages/@aws-cdk-testing/cli-integ/bin/stage-distribution.ts +++ b/packages/@aws-cdk-testing/cli-integ/bin/stage-distribution.ts @@ -34,6 +34,12 @@ async function main() { type: 'boolean', requiresArg: false, }) + .option('regression', { + description: 'Enable access to previous versions of the staged packages (this is expensive for CodeArtifact so we only do it when necessary)', + type: 'boolean', + requiresArg: false, + default: false, + }) .command('publish ', 'Publish a given directory', cmd => cmd .positional('DIRECTORY', { descripton: 'Directory distribution', @@ -190,6 +196,7 @@ async function publish(repo: TestRepository, usageDir: UsageDir, args: { python?: boolean; java?: boolean; dotnet?: boolean; + regression?: boolean; }) { const directory = `${args.DIRECTORY}`; const login = await repo.loginInformation(); @@ -221,8 +228,10 @@ async function publish(repo: TestRepository, usageDir: UsageDir, args: { await uploadDotnetPackages(glob.sync(path.join(directory, 'dotnet', '**', '*.nupkg')), usageDir); }); - console.log('🛍 Configuring packages for upstream versions'); - await repo.markAllUpstreamAllow(); + if (args.regression) { + console.log('🛍 Configuring packages for upstream versions'); + await repo.markAllUpstreamAllow(); + } } function whichRepos(args: { diff --git a/packages/@aws-cdk-testing/cli-integ/package.json b/packages/@aws-cdk-testing/cli-integ/package.json index 8a47dbe509cdc..c10c9e803dd9f 100644 --- a/packages/@aws-cdk-testing/cli-integ/package.json +++ b/packages/@aws-cdk-testing/cli-integ/package.json @@ -39,7 +39,7 @@ }, "dependencies": { "@octokit/rest": "^18.12.0", - "aws-sdk": "^2.1317.0", + "aws-sdk": "^2.1325.0", "axios": "^0.27.2", "fs-extra": "^9.1.0", "glob": "^7.2.3", @@ -50,7 +50,8 @@ "p-queue": "^6.6.2", "semver": "^7.3.8", "ts-mock-imports": "^1.3.8", - "yargs": "^17.7.0" + "yaml": "1.10.2", + "yargs": "^17.7.1" }, "repository": { "url": "https://github.com/aws/aws-cdk.git", diff --git a/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/bootstrapping.integtest.ts b/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/bootstrapping.integtest.ts index a2c56be3fe815..e5a33dae577ea 100644 --- a/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/bootstrapping.integtest.ts +++ b/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/bootstrapping.integtest.ts @@ -1,5 +1,6 @@ import * as fs from 'fs'; import * as path from 'path'; +import * as yaml from 'yaml'; import { integTest, randomString, withoutBootstrap } from '../../lib'; jest.setTimeout(2 * 60 * 60_000); // Includes the time to acquire locks, worst-case single-threaded runtime @@ -196,6 +197,41 @@ integTest('can dump the template, modify and use it to deploy a custom bootstrap }); })); +integTest('a customized template vendor will not overwrite the default template', withoutBootstrap(async (fixture) => { + // Initial bootstrap + const toolkitStackName = fixture.bootstrapStackName; + await fixture.cdkBootstrapModern({ + toolkitStackName, + cfnExecutionPolicy: 'arn:aws:iam::aws:policy/AdministratorAccess', + }); + + // Customize template + const templateStr = await fixture.cdkBootstrapModern({ + // toolkitStackName doesn't matter for this particular invocation + toolkitStackName, + showTemplate: true, + cliOptions: { + captureStderr: false, + }, + }); + + const template = yaml.parse(templateStr, { schema: 'core' }); + template.Parameters.BootstrapVariant.Default = 'CustomizedVendor'; + const filename = path.join(fixture.integTestDir, `${fixture.qualifier}-template.yaml`); + fs.writeFileSync(filename, yaml.stringify(template, { schema: 'yaml-1.1' }), { encoding: 'utf-8' }); + + // Rebootstrap. For some reason, this doesn't cause a failure, it's a successful no-op. + const output = await fixture.cdkBootstrapModern({ + toolkitStackName, + template: filename, + cfnExecutionPolicy: 'arn:aws:iam::aws:policy/AdministratorAccess', + cliOptions: { + captureStderr: true, + }, + }); + expect(output).toContain('Not overwriting it with a template containing'); +})); + integTest('can use the default permissions boundary to bootstrap', withoutBootstrap(async (fixture) => { let template = await fixture.cdkBootstrapModern({ // toolkitStackName doesn't matter for this particular invocation diff --git a/packages/@aws-cdk/aws-amplify/package.json b/packages/@aws-cdk/aws-amplify/package.json index 07447b969992b..f20455b24296e 100644 --- a/packages/@aws-cdk/aws-amplify/package.json +++ b/packages/@aws-cdk/aws-amplify/package.json @@ -88,7 +88,7 @@ "@aws-cdk/cfn2ts": "0.0.0", "@aws-cdk/pkglint": "0.0.0", "@types/jest": "^27.5.2", - "aws-sdk": "^2.1317.0", + "aws-sdk": "^2.1325.0", "jsii": "v4.9-next" }, "dependencies": { diff --git a/packages/@aws-cdk/aws-apigateway/lib/restapi.ts b/packages/@aws-cdk/aws-apigateway/lib/restapi.ts index 7f44eddaf0ca9..41a0990e4f5f7 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/restapi.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/restapi.ts @@ -1,7 +1,7 @@ import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; import { IVpcEndpoint } from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; -import { ArnFormat, CfnOutput, IResource as IResourceBase, Resource, Stack, Token, FeatureFlags, RemovalPolicy } from '@aws-cdk/core'; +import { ArnFormat, CfnOutput, IResource as IResourceBase, Resource, Stack, Token, FeatureFlags, RemovalPolicy, Size } from '@aws-cdk/core'; import { APIGATEWAY_DISABLE_CLOUDWATCH_ROLE } from '@aws-cdk/cx-api'; import { Construct } from 'constructs'; import { ApiDefinition } from './api-definition'; @@ -225,9 +225,22 @@ export interface RestApiProps extends RestApiOptions { * payload size. * * @default - Compression is disabled. + * @deprecated - superseded by `minCompressionSize` */ readonly minimumCompressionSize?: number; + /** + * A Size(in bytes, kibibytes, mebibytes etc) that is used to enable compression (with non-negative + * between 0 and 10485760 (10M) bytes, inclusive) or disable compression + * (when undefined) on an API. When compression is enabled, compression or + * decompression is not applied on the payload if the payload size is + * smaller than this value. Setting it to zero allows compression for any + * payload size. + * + * @default - Compression is disabled. + */ + readonly minCompressionSize?: Size; + /** * The ID of the API Gateway RestApi resource that you want to clone. * @@ -261,6 +274,18 @@ export interface SpecRestApiProps extends RestApiBaseProps { * @see https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api.html */ readonly apiDefinition: ApiDefinition; + + /** + * A Size(in bytes, kibibytes, mebibytes etc) that is used to enable compression (with non-negative + * between 0 and 10485760 (10M) bytes, inclusive) or disable compression + * (when undefined) on an API. When compression is enabled, compression or + * decompression is not applied on the payload if the payload size is + * smaller than this value. Setting it to zero allows compression for any + * payload size. + * + * @default - Compression is disabled. + */ + readonly minCompressionSize?: Size; } /** @@ -648,6 +673,7 @@ export class SpecRestApi extends RestApiBase { name: this.restApiName, policy: props.policy, failOnWarnings: props.failOnWarnings, + minimumCompressionSize: props.minCompressionSize?.toBytes(), body: apiDefConfig.inlineDefinition ?? undefined, bodyS3Location: apiDefConfig.inlineDefinition ? undefined : apiDefConfig.s3Location, endpointConfiguration: this._configureEndpoints(props), @@ -758,12 +784,16 @@ export class RestApi extends RestApiBase { constructor(scope: Construct, id: string, props: RestApiProps = { }) { super(scope, id, props); + if (props.minCompressionSize !== undefined && props.minimumCompressionSize !== undefined) { + throw new Error('both properties minCompressionSize and minimumCompressionSize cannot be set at once.'); + } + const resource = new CfnRestApi(this, 'Resource', { name: this.physicalName, description: props.description, policy: props.policy, failOnWarnings: props.failOnWarnings, - minimumCompressionSize: props.minimumCompressionSize, + minimumCompressionSize: props.minCompressionSize?.toBytes() ?? props.minimumCompressionSize, binaryMediaTypes: props.binaryMediaTypes, endpointConfiguration: this._configureEndpoints(props), apiKeySourceType: props.apiKeySourceType, diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.js.snapshot/apigatewayrestapiDefaultTestDeployAssert6A9696A7.assets.json b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.js.snapshot/apigatewayrestapiDefaultTestDeployAssert6A9696A7.assets.json index 40422419875ec..0a13f744eed97 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.js.snapshot/apigatewayrestapiDefaultTestDeployAssert6A9696A7.assets.json +++ b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.js.snapshot/apigatewayrestapiDefaultTestDeployAssert6A9696A7.assets.json @@ -1,5 +1,5 @@ { - "version": "21.0.0", + "version": "30.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.js.snapshot/cdk.out b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.js.snapshot/cdk.out index 8ecc185e9dbee..ae4b03c54e770 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"21.0.0"} \ No newline at end of file +{"version":"30.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.js.snapshot/integ.json b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.js.snapshot/integ.json index ab9a770171263..67626e9b771eb 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "21.0.0", + "version": "30.0.0", "testCases": { "apigateway-restapi/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.js.snapshot/manifest.json b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.js.snapshot/manifest.json index ec6db85280ab2..382751142abcf 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { - "version": "21.0.0", + "version": "30.0.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "test-apigateway-restapi.assets": { "type": "cdk:asset-manifest", "properties": { @@ -23,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/527feb6f65d1f41404abb6acfb6504a918e1d7489665b74acb9fa0ca23f34049.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/94f416193221135915e06201345d08e3db001c8bbf22b073f16ec02d3b8fba4b.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -60,7 +54,7 @@ "/test-apigateway-restapi/my-api/Deployment/Resource": [ { "type": "aws:cdk:logicalId", - "data": "myapiDeployment92F2CB4996088bac04ec19d9db88f146f3d88bca" + "data": "myapiDeployment92F2CB496a6dee9579dae89ab3a0b094b4d193eb" } ], "/test-apigateway-restapi/my-api/DeploymentStage.beta/Resource": [ @@ -204,7 +198,7 @@ "/test-apigateway-restapi/TestDeployment/Resource": [ { "type": "aws:cdk:logicalId", - "data": "TestDeploymentD77B56866f3141cef1e8fea8ab3b3b8bc90df36d" + "data": "TestDeploymentD77B56860a9c34c1bc306bfbc7d318827eacd1e1" } ], "/test-apigateway-restapi/TestStage/Resource": [ @@ -231,28 +225,19 @@ "data": "CheckBootstrapVersion" } ], - "myapiDeployment92F2CB4963d40685c54c6f8da21d80a83f16d3d5": [ + "myapiDeployment92F2CB4996088bac04ec19d9db88f146f3d88bca": [ { "type": "aws:cdk:logicalId", - "data": "myapiDeployment92F2CB4963d40685c54c6f8da21d80a83f16d3d5", + "data": "myapiDeployment92F2CB4996088bac04ec19d9db88f146f3d88bca", "trace": [ "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" ] } ], - "myapiv1appliances507FEFF4": [ + "TestDeploymentD77B56866f3141cef1e8fea8ab3b3b8bc90df36d": [ { "type": "aws:cdk:logicalId", - "data": "myapiv1appliances507FEFF4", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] - } - ], - "myapiv1appliancesGET8FE872EC": [ - { - "type": "aws:cdk:logicalId", - "data": "myapiv1appliancesGET8FE872EC", + "data": "TestDeploymentD77B56866f3141cef1e8fea8ab3b3b8bc90df36d", "trace": [ "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" ] @@ -307,6 +292,12 @@ ] }, "displayName": "apigateway-restapi/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.js.snapshot/test-apigateway-restapi.assets.json b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.js.snapshot/test-apigateway-restapi.assets.json index b397476ca59d6..09a88ca2b52e8 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.js.snapshot/test-apigateway-restapi.assets.json +++ b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.js.snapshot/test-apigateway-restapi.assets.json @@ -1,7 +1,7 @@ { - "version": "21.0.0", + "version": "30.0.0", "files": { - "527feb6f65d1f41404abb6acfb6504a918e1d7489665b74acb9fa0ca23f34049": { + "94f416193221135915e06201345d08e3db001c8bbf22b073f16ec02d3b8fba4b": { "source": { "path": "test-apigateway-restapi.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "527feb6f65d1f41404abb6acfb6504a918e1d7489665b74acb9fa0ca23f34049.json", + "objectKey": "94f416193221135915e06201345d08e3db001c8bbf22b073f16ec02d3b8fba4b.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.js.snapshot/test-apigateway-restapi.template.json b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.js.snapshot/test-apigateway-restapi.template.json index 1e9121a7471dc..43a8699e33d49 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.js.snapshot/test-apigateway-restapi.template.json +++ b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.js.snapshot/test-apigateway-restapi.template.json @@ -3,6 +3,7 @@ "myapi4C7BF186": { "Type": "AWS::ApiGateway::RestApi", "Properties": { + "MinimumCompressionSize": 1024, "Name": "my-api" } }, @@ -55,7 +56,7 @@ "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Retain" }, - "myapiDeployment92F2CB4996088bac04ec19d9db88f146f3d88bca": { + "myapiDeployment92F2CB496a6dee9579dae89ab3a0b094b4d193eb": { "Type": "AWS::ApiGateway::Deployment", "Properties": { "RestApiId": { @@ -87,7 +88,7 @@ "CacheClusterEnabled": true, "CacheClusterSize": "0.5", "DeploymentId": { - "Ref": "myapiDeployment92F2CB4996088bac04ec19d9db88f146f3d88bca" + "Ref": "myapiDeployment92F2CB496a6dee9579dae89ab3a0b094b4d193eb" }, "Description": "beta stage", "MethodSettings": [ @@ -672,7 +673,7 @@ "MyHandlerServiceRoleFFA06653" ] }, - "TestDeploymentD77B56866f3141cef1e8fea8ab3b3b8bc90df36d": { + "TestDeploymentD77B56860a9c34c1bc306bfbc7d318827eacd1e1": { "Type": "AWS::ApiGateway::Deployment", "Properties": { "RestApiId": { @@ -695,7 +696,7 @@ "Ref": "myapi4C7BF186" }, "DeploymentId": { - "Ref": "TestDeploymentD77B56866f3141cef1e8fea8ab3b3b8bc90df36d" + "Ref": "TestDeploymentD77B56860a9c34c1bc306bfbc7d318827eacd1e1" }, "StageName": "prod" }, diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.js.snapshot/tree.json b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.js.snapshot/tree.json index c4920b5ecffdf..3bf0e3cc25e09 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.js.snapshot/tree.json @@ -4,14 +4,6 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.129" - } - }, "test-apigateway-restapi": { "id": "test-apigateway-restapi", "path": "test-apigateway-restapi", @@ -26,6 +18,7 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::ApiGateway::RestApi", "aws:cdk:cloudformation:props": { + "minimumCompressionSize": 1024, "name": "my-api" } }, @@ -38,6 +31,14 @@ "id": "CloudWatchRole", "path": "test-apigateway-restapi/my-api/CloudWatchRole", "children": { + "ImportCloudWatchRole": { + "id": "ImportCloudWatchRole", + "path": "test-apigateway-restapi/my-api/CloudWatchRole/ImportCloudWatchRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "test-apigateway-restapi/my-api/CloudWatchRole/Resource", @@ -145,7 +146,7 @@ "cacheClusterEnabled": true, "cacheClusterSize": "0.5", "deploymentId": { - "Ref": "myapiDeployment92F2CB4996088bac04ec19d9db88f146f3d88bca" + "Ref": "myapiDeployment92F2CB496a6dee9579dae89ab3a0b094b4d193eb" }, "description": "beta stage", "methodSettings": [ @@ -992,6 +993,14 @@ "id": "ServiceRole", "path": "test-apigateway-restapi/MyHandler/ServiceRole", "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "test-apigateway-restapi/MyHandler/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "test-apigateway-restapi/MyHandler/ServiceRole/Resource", @@ -1107,7 +1116,7 @@ "Ref": "myapi4C7BF186" }, "deploymentId": { - "Ref": "TestDeploymentD77B56866f3141cef1e8fea8ab3b3b8bc90df36d" + "Ref": "TestDeploymentD77B56860a9c34c1bc306bfbc7d318827eacd1e1" }, "stageName": "prod" } @@ -1156,6 +1165,22 @@ "fqn": "@aws-cdk/aws-apigateway.Stage", "version": "0.0.0" } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "test-apigateway-restapi/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "test-apigateway-restapi/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } } }, "constructInfo": { @@ -1176,12 +1201,30 @@ "path": "apigateway-restapi/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.129" + "version": "10.1.249" } }, "DeployAssert": { "id": "DeployAssert", "path": "apigateway-restapi/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "apigateway-restapi/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "apigateway-restapi/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, "constructInfo": { "fqn": "@aws-cdk/core.Stack", "version": "0.0.0" @@ -1198,6 +1241,14 @@ "fqn": "@aws-cdk/integ-tests.IntegTest", "version": "0.0.0" } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.249" + } } }, "constructInfo": { diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.ts b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.ts index 4a2373e9d6aa9..47030c17160fe 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.ts +++ b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.ts @@ -1,5 +1,6 @@ import * as lambda from '@aws-cdk/aws-lambda'; import * as cdk from '@aws-cdk/core'; +import { Size } from '@aws-cdk/core'; import { IntegTest } from '@aws-cdk/integ-tests'; import * as apigateway from '../lib'; @@ -10,6 +11,7 @@ class Test extends cdk.Stack { const api = new apigateway.RestApi(this, 'my-api', { retainDeployments: true, cloudWatchRole: true, + minCompressionSize: Size.bytes(1024), deployOptions: { cacheClusterEnabled: true, stageName: 'beta', diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.js.snapshot/apigatewayspecrestapiDefaultTestDeployAssertD16AA485.assets.json b/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.js.snapshot/apigatewayspecrestapiDefaultTestDeployAssertD16AA485.assets.json index 7c4a2beda03b5..eae4994100f87 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.js.snapshot/apigatewayspecrestapiDefaultTestDeployAssertD16AA485.assets.json +++ b/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.js.snapshot/apigatewayspecrestapiDefaultTestDeployAssertD16AA485.assets.json @@ -1,5 +1,5 @@ { - "version": "21.0.0", + "version": "30.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.js.snapshot/cdk.out b/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.js.snapshot/cdk.out index 8ecc185e9dbee..ae4b03c54e770 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"21.0.0"} \ No newline at end of file +{"version":"30.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.js.snapshot/integ.json b/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.js.snapshot/integ.json index f4c240596beb4..27ab5a7e80179 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "21.0.0", + "version": "30.0.0", "testCases": { "apigateway-spec-restapi/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.js.snapshot/manifest.json b/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.js.snapshot/manifest.json index ec86acb97e7a9..1112099915ed4 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { - "version": "21.0.0", + "version": "30.0.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "test-apigateway-spec-restapi.assets": { "type": "cdk:asset-manifest", "properties": { @@ -23,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/4b4324bd66c0a5352124c718d0cb3990046afe7ccf1cea94d4488ed7cd67191b.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/a361f357c68964992ee5038aa363d75be98e145d828b8955269361c54d7722ae.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -156,7 +150,7 @@ "/test-apigateway-spec-restapi/my-api/Deployment/Resource": [ { "type": "aws:cdk:logicalId", - "data": "myapiDeployment92F2CB49e2ce3595b92ff44fad021c2e55149db1" + "data": "myapiDeployment92F2CB492c49d8fa05ada8b5cddee1ce76138bd0" } ], "/test-apigateway-spec-restapi/my-api/DeploymentStage.beta/Resource": [ @@ -212,6 +206,15 @@ "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } + ], + "myapiDeployment92F2CB49e2ce3595b92ff44fad021c2e55149db1": [ + { + "type": "aws:cdk:logicalId", + "data": "myapiDeployment92F2CB49e2ce3595b92ff44fad021c2e55149db1", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } ] }, "displayName": "test-apigateway-spec-restapi" @@ -262,6 +265,12 @@ ] }, "displayName": "apigateway-spec-restapi/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.js.snapshot/test-apigateway-spec-restapi.assets.json b/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.js.snapshot/test-apigateway-spec-restapi.assets.json index 2bff91cb920f7..54d375c1f6975 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.js.snapshot/test-apigateway-spec-restapi.assets.json +++ b/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.js.snapshot/test-apigateway-spec-restapi.assets.json @@ -1,5 +1,5 @@ { - "version": "21.0.0", + "version": "30.0.0", "files": { "68497ac876de4e963fc8f7b5f1b28844c18ecc95e3f7c6e9e0bf250e03c037fb": { "source": { @@ -14,7 +14,7 @@ } } }, - "4b4324bd66c0a5352124c718d0cb3990046afe7ccf1cea94d4488ed7cd67191b": { + "a361f357c68964992ee5038aa363d75be98e145d828b8955269361c54d7722ae": { "source": { "path": "test-apigateway-spec-restapi.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "4b4324bd66c0a5352124c718d0cb3990046afe7ccf1cea94d4488ed7cd67191b.json", + "objectKey": "a361f357c68964992ee5038aa363d75be98e145d828b8955269361c54d7722ae.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.js.snapshot/test-apigateway-spec-restapi.template.json b/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.js.snapshot/test-apigateway-spec-restapi.template.json index 5214b610b9995..219437fc11d7c 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.js.snapshot/test-apigateway-spec-restapi.template.json +++ b/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.js.snapshot/test-apigateway-spec-restapi.template.json @@ -10,6 +10,7 @@ "Key": "68497ac876de4e963fc8f7b5f1b28844c18ecc95e3f7c6e9e0bf250e03c037fb.yaml" }, "DisableExecuteApiEndpoint": true, + "MinimumCompressionSize": 1024, "Name": "my-api" } }, @@ -516,7 +517,7 @@ "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Retain" }, - "myapiDeployment92F2CB49e2ce3595b92ff44fad021c2e55149db1": { + "myapiDeployment92F2CB492c49d8fa05ada8b5cddee1ce76138bd0": { "Type": "AWS::ApiGateway::Deployment", "Properties": { "RestApiId": { @@ -548,7 +549,7 @@ "CacheClusterEnabled": true, "CacheClusterSize": "0.5", "DeploymentId": { - "Ref": "myapiDeployment92F2CB49e2ce3595b92ff44fad021c2e55149db1" + "Ref": "myapiDeployment92F2CB492c49d8fa05ada8b5cddee1ce76138bd0" }, "Description": "beta stage", "MethodSettings": [ diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.js.snapshot/tree.json b/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.js.snapshot/tree.json index 10cba98b03d1a..2dd509aaa2020 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.js.snapshot/tree.json @@ -4,14 +4,6 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.140" - } - }, "test-apigateway-spec-restapi": { "id": "test-apigateway-spec-restapi", "path": "test-apigateway-spec-restapi", @@ -59,6 +51,7 @@ "key": "68497ac876de4e963fc8f7b5f1b28844c18ecc95e3f7c6e9e0bf250e03c037fb.yaml" }, "disableExecuteApiEndpoint": true, + "minimumCompressionSize": 1024, "name": "my-api" } }, @@ -763,6 +756,14 @@ "id": "CloudWatchRole", "path": "test-apigateway-spec-restapi/my-api/CloudWatchRole", "children": { + "ImportCloudWatchRole": { + "id": "ImportCloudWatchRole", + "path": "test-apigateway-spec-restapi/my-api/CloudWatchRole/ImportCloudWatchRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "test-apigateway-spec-restapi/my-api/CloudWatchRole/Resource", @@ -870,7 +871,7 @@ "cacheClusterEnabled": true, "cacheClusterSize": "0.5", "deploymentId": { - "Ref": "myapiDeployment92F2CB49e2ce3595b92ff44fad021c2e55149db1" + "Ref": "myapiDeployment92F2CB492c49d8fa05ada8b5cddee1ce76138bd0" }, "description": "beta stage", "methodSettings": [ @@ -1025,6 +1026,14 @@ "id": "ServiceRole", "path": "test-apigateway-spec-restapi/MyHandler/ServiceRole", "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "test-apigateway-spec-restapi/MyHandler/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "test-apigateway-spec-restapi/MyHandler/ServiceRole/Resource", @@ -1099,6 +1108,22 @@ "fqn": "@aws-cdk/aws-lambda.Function", "version": "0.0.0" } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "test-apigateway-spec-restapi/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "test-apigateway-spec-restapi/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } } }, "constructInfo": { @@ -1119,12 +1144,30 @@ "path": "apigateway-spec-restapi/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.140" + "version": "10.1.249" } }, "DeployAssert": { "id": "DeployAssert", "path": "apigateway-spec-restapi/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "apigateway-spec-restapi/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "apigateway-spec-restapi/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, "constructInfo": { "fqn": "@aws-cdk/core.Stack", "version": "0.0.0" @@ -1141,6 +1184,14 @@ "fqn": "@aws-cdk/integ-tests.IntegTest", "version": "0.0.0" } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.249" + } } }, "constructInfo": { diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.ts b/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.ts index 512fc8dd8e91c..f10f166232a2d 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.ts +++ b/packages/@aws-cdk/aws-apigateway/test/integ.spec-restapi.ts @@ -1,6 +1,7 @@ import * as path from 'path'; import * as lambda from '@aws-cdk/aws-lambda'; import * as cdk from '@aws-cdk/core'; +import { Size } from '@aws-cdk/core'; import { IntegTest } from '@aws-cdk/integ-tests'; import * as apigateway from '../lib'; @@ -11,6 +12,7 @@ class Test extends cdk.Stack { const api = new apigateway.SpecRestApi(this, 'my-api', { apiDefinition: apigateway.ApiDefinition.fromAsset(path.join(__dirname, 'sample-definition.yaml')), disableExecuteApiEndpoint: true, + minCompressionSize: Size.bytes(1024), retainDeployments: true, cloudWatchRole: true, deployOptions: { diff --git a/packages/@aws-cdk/aws-apigateway/test/restapi.test.ts b/packages/@aws-cdk/aws-apigateway/test/restapi.test.ts index 0156bd2cb4821..205686f7a0c5b 100644 --- a/packages/@aws-cdk/aws-apigateway/test/restapi.test.ts +++ b/packages/@aws-cdk/aws-apigateway/test/restapi.test.ts @@ -1,7 +1,7 @@ import { Template } from '@aws-cdk/assertions'; import { GatewayVpcEndpoint } from '@aws-cdk/aws-ec2'; import { testDeprecated } from '@aws-cdk/cdk-build-tools'; -import { App, CfnElement, CfnResource, Lazy, Stack } from '@aws-cdk/core'; +import { App, CfnElement, CfnResource, Lazy, Size, Stack } from '@aws-cdk/core'; import * as apigw from '../lib'; describe('restapi', () => { @@ -868,163 +868,252 @@ describe('restapi', () => { expect(method.api).toBeDefined(); }); - describe('Import', () => { - test('fromRestApiId()', () => { - // GIVEN - const stack = new Stack(); + test('RestApi minCompressionSize', () => { + // GIVEN + const app = new App({ + context: { + '@aws-cdk/aws-apigateway:disableCloudWatchRole': true, + }, + }); - // WHEN - const imported = apigw.RestApi.fromRestApiId(stack, 'imported-api', 'api-rxt4498f'); + const stack = new Stack(app); + const api = new apigw.RestApi(stack, 'RestApi', { + minCompressionSize: Size.bytes(1024), + }); - // THEN - expect(stack.resolve(imported.restApiId)).toEqual('api-rxt4498f'); - expect(imported.restApiName).toEqual('imported-api'); + // WHEN + api.root.addMethod('GET'); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::RestApi', { + Name: 'RestApi', + MinimumCompressionSize: 1024, }); + }); - test('fromRestApiAttributes()', () => { - // GIVEN - const stack = new Stack(); + testDeprecated('RestApi minimumCompressionSize', () => { + // GIVEN + const app = new App({ + context: { + '@aws-cdk/aws-apigateway:disableCloudWatchRole': true, + }, + }); - // WHEN - const imported = apigw.RestApi.fromRestApiAttributes(stack, 'imported-api', { - restApiId: 'test-restapi-id', - rootResourceId: 'test-root-resource-id', - }); - const resource = imported.root.addResource('pets'); - resource.addMethod('GET'); + const stack = new Stack(app); + const api = new apigw.RestApi(stack, 'RestApi', { + minimumCompressionSize: 1024, + }); - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::Resource', { - PathPart: 'pets', - ParentId: stack.resolve(imported.restApiRootResourceId), - }); - Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::Method', { - HttpMethod: 'GET', - ResourceId: stack.resolve(resource.resourceId), - }); - expect(imported.restApiName).toEqual('imported-api'); - }); - - test('fromRestApiAttributes() with restApiName', () => { - // GIVEN - const stack = new Stack(); + // WHEN + api.root.addMethod('GET'); - // WHEN - const imported = apigw.RestApi.fromRestApiAttributes(stack, 'imported-api', { - restApiId: 'test-restapi-id', - rootResourceId: 'test-root-resource-id', - restApiName: 'test-restapi-name', - }); - const resource = imported.root.addResource('pets'); - resource.addMethod('GET'); + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::RestApi', { + Name: 'RestApi', + MinimumCompressionSize: 1024, + }); + }); - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::Resource', { - PathPart: 'pets', - ParentId: stack.resolve(imported.restApiRootResourceId), - }); - Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::Method', { - HttpMethod: 'GET', - ResourceId: stack.resolve(resource.resourceId), - }); - expect(imported.restApiName).toEqual('test-restapi-name'); + testDeprecated('throws error when both minimumCompressionSize and minCompressionSize are used', () => { + // GIVEN + const app = new App({ + context: { + '@aws-cdk/aws-apigateway:disableCloudWatchRole': true, + }, }); + + // WHEN + const stack = new Stack(app); + + // THEN + expect(() => new apigw.RestApi(stack, 'RestApi', { + minCompressionSize: Size.bytes(500), + minimumCompressionSize: 1024, + })).toThrow(/both properties minCompressionSize and minimumCompressionSize cannot be set at once./); }); +}); - describe('SpecRestApi', () => { - test('add Methods and Resources', () => { - // GIVEN - const stack = new Stack(); - const api = new apigw.SpecRestApi(stack, 'SpecRestApi', { - apiDefinition: apigw.ApiDefinition.fromInline({ foo: 'bar' }), - }); - // WHEN - const resource = api.root.addResource('pets'); - resource.addMethod('GET'); +describe('Import', () => { + test('fromRestApiId()', () => { + // GIVEN + const stack = new Stack(); - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::Resource', { - PathPart: 'pets', - ParentId: stack.resolve(api.restApiRootResourceId), - }); - Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::Method', { - HttpMethod: 'GET', - ResourceId: stack.resolve(resource.resourceId), - }); + // WHEN + const imported = apigw.RestApi.fromRestApiId(stack, 'imported-api', 'api-rxt4498f'); + + // THEN + expect(stack.resolve(imported.restApiId)).toEqual('api-rxt4498f'); + expect(imported.restApiName).toEqual('imported-api'); + }); + + test('fromRestApiAttributes()', () => { + // GIVEN + const stack = new Stack(); + + // WHEN + const imported = apigw.RestApi.fromRestApiAttributes(stack, 'imported-api', { + restApiId: 'test-restapi-id', + rootResourceId: 'test-root-resource-id', }); + const resource = imported.root.addResource('pets'); + resource.addMethod('GET'); - test('"endpointTypes" can be used to specify endpoint configuration for SpecRestApi', () => { - // GIVEN - const stack = new Stack(); + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::Resource', { + PathPart: 'pets', + ParentId: stack.resolve(imported.restApiRootResourceId), + }); + Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::Method', { + HttpMethod: 'GET', + ResourceId: stack.resolve(resource.resourceId), + }); + expect(imported.restApiName).toEqual('imported-api'); + }); - // WHEN - const api = new apigw.SpecRestApi(stack, 'api', { - apiDefinition: apigw.ApiDefinition.fromInline({ foo: 'bar' }), - endpointTypes: [apigw.EndpointType.EDGE, apigw.EndpointType.PRIVATE], - }); + test('fromRestApiAttributes() with restApiName', () => { + // GIVEN + const stack = new Stack(); - api.root.addMethod('GET'); + // WHEN + const imported = apigw.RestApi.fromRestApiAttributes(stack, 'imported-api', { + restApiId: 'test-restapi-id', + rootResourceId: 'test-root-resource-id', + restApiName: 'test-restapi-name', + }); + const resource = imported.root.addResource('pets'); + resource.addMethod('GET'); - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::RestApi', { - EndpointConfiguration: { - Types: [ - 'EDGE', - 'PRIVATE', - ], - }, - }); + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::Resource', { + PathPart: 'pets', + ParentId: stack.resolve(imported.restApiRootResourceId), }); + Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::Method', { + HttpMethod: 'GET', + ResourceId: stack.resolve(resource.resourceId), + }); + expect(imported.restApiName).toEqual('test-restapi-name'); + }); +}); - testDeprecated('addApiKey is supported', () => { - // GIVEN - const stack = new Stack(); - const api = new apigw.SpecRestApi(stack, 'myapi', { - apiDefinition: apigw.ApiDefinition.fromInline({ foo: 'bar' }), - }); - api.root.addMethod('OPTIONS'); +describe('SpecRestApi', () => { + test('add Methods and Resources', () => { + // GIVEN + const stack = new Stack(); + const api = new apigw.SpecRestApi(stack, 'SpecRestApi', { + apiDefinition: apigw.ApiDefinition.fromInline({ foo: 'bar' }), + }); - // WHEN - api.addApiKey('myapikey', { - apiKeyName: 'myApiKey1', - value: '01234567890ABCDEFabcdef', - }); + // WHEN + const resource = api.root.addResource('pets'); + resource.addMethod('GET'); - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::ApiKey', { - Enabled: true, - Name: 'myApiKey1', - StageKeys: [ - { - RestApiId: { Ref: 'myapi162F20B8' }, - StageName: { Ref: 'myapiDeploymentStageprod329F21FF' }, - }, + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::Resource', { + PathPart: 'pets', + ParentId: stack.resolve(api.restApiRootResourceId), + }); + Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::Method', { + HttpMethod: 'GET', + ResourceId: stack.resolve(resource.resourceId), + }); + }); + + test('"endpointTypes" can be used to specify endpoint configuration for SpecRestApi', () => { + // GIVEN + const stack = new Stack(); + + // WHEN + const api = new apigw.SpecRestApi(stack, 'api', { + apiDefinition: apigw.ApiDefinition.fromInline({ foo: 'bar' }), + endpointTypes: [apigw.EndpointType.EDGE, apigw.EndpointType.PRIVATE], + }); + + api.root.addMethod('GET'); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::RestApi', { + EndpointConfiguration: { + Types: [ + 'EDGE', + 'PRIVATE', ], - Value: '01234567890ABCDEFabcdef', - }); + }, }); + }); - test('featureFlag @aws-cdk/aws-apigateway:disableCloudWatchRole CloudWatch role is not created created for API Gateway', () => { - // GIVEN - const app = new App({ - context: { - '@aws-cdk/aws-apigateway:disableCloudWatchRole': true, + testDeprecated('addApiKey is supported', () => { + // GIVEN + const stack = new Stack(); + const api = new apigw.SpecRestApi(stack, 'myapi', { + apiDefinition: apigw.ApiDefinition.fromInline({ foo: 'bar' }), + }); + api.root.addMethod('OPTIONS'); + + // WHEN + api.addApiKey('myapikey', { + apiKeyName: 'myApiKey1', + value: '01234567890ABCDEFabcdef', + }); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::ApiKey', { + Enabled: true, + Name: 'myApiKey1', + StageKeys: [ + { + RestApiId: { Ref: 'myapi162F20B8' }, + StageName: { Ref: 'myapiDeploymentStageprod329F21FF' }, }, - }); + ], + Value: '01234567890ABCDEFabcdef', + }); + }); - const stack = new Stack(app); - const api = new apigw.SpecRestApi(stack, 'SpecRestApi', { - apiDefinition: apigw.ApiDefinition.fromInline({ foo: 'bar' }), - }); + test('featureFlag @aws-cdk/aws-apigateway:disableCloudWatchRole CloudWatch role is not created created for API Gateway', () => { + // GIVEN + const app = new App({ + context: { + '@aws-cdk/aws-apigateway:disableCloudWatchRole': true, + }, + }); - // WHEN - const resource = api.root.addResource('pets'); - resource.addMethod('GET'); + const stack = new Stack(app); + const api = new apigw.SpecRestApi(stack, 'SpecRestApi', { + apiDefinition: apigw.ApiDefinition.fromInline({ foo: 'bar' }), + }); - // THEN - Template.fromStack(stack).resourceCountIs('AWS::IAM::Role', 0); - Template.fromStack(stack).resourceCountIs('AWS::ApiGateway::Account', 0); + // WHEN + const resource = api.root.addResource('pets'); + resource.addMethod('GET'); + + // THEN + Template.fromStack(stack).resourceCountIs('AWS::IAM::Role', 0); + Template.fromStack(stack).resourceCountIs('AWS::ApiGateway::Account', 0); + }); + + test('SpecRestApi minimumCompressionSize', () => { + // GIVEN + const app = new App({ + context: { + '@aws-cdk/aws-apigateway:disableCloudWatchRole': true, + }, + }); + + const stack = new Stack(app); + const api = new apigw.SpecRestApi(stack, 'SpecRestApi', { + apiDefinition: apigw.ApiDefinition.fromInline({ foo: 'bar' }), + minCompressionSize: Size.bytes(1024), + }); + + // WHEN + api.root.addMethod('GET'); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::RestApi', { + Name: 'SpecRestApi', + MinimumCompressionSize: 1024, }); }); diff --git a/packages/@aws-cdk/aws-apigatewayv2-authorizers/package.json b/packages/@aws-cdk/aws-apigatewayv2-authorizers/package.json index 84874ef955ba9..8e19141b46930 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-authorizers/package.json +++ b/packages/@aws-cdk/aws-apigatewayv2-authorizers/package.json @@ -85,7 +85,7 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/aws-lambda": "^8.10.110", + "@types/aws-lambda": "^8.10.111", "@aws-cdk/integ-tests": "0.0.0", "@types/jest": "^27.5.2", "jsii": "v4.9-next" diff --git a/packages/@aws-cdk/aws-autoscaling/test/integ.asg-lt.js.snapshot/aws-cdk-asg-integ.assets.json b/packages/@aws-cdk/aws-autoscaling/test/integ.asg-lt.js.snapshot/aws-cdk-asg-integ.assets.json index 6f9a7efb4533c..610a2c40c6d1c 100644 --- a/packages/@aws-cdk/aws-autoscaling/test/integ.asg-lt.js.snapshot/aws-cdk-asg-integ.assets.json +++ b/packages/@aws-cdk/aws-autoscaling/test/integ.asg-lt.js.snapshot/aws-cdk-asg-integ.assets.json @@ -1,7 +1,7 @@ { "version": "22.0.0", "files": { - "768b8ff8b1178a04dbfca488da9459f4f402bfad643db0b4791787ef23ec4db5": { + "2f0699c7863c01ee4fb7ccca4b192b311d9d6723f012b40f36bdf25a5db22f0c": { "source": { "path": "aws-cdk-asg-integ.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "768b8ff8b1178a04dbfca488da9459f4f402bfad643db0b4791787ef23ec4db5.json", + "objectKey": "2f0699c7863c01ee4fb7ccca4b192b311d9d6723f012b40f36bdf25a5db22f0c.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-autoscaling/test/integ.asg-lt.js.snapshot/aws-cdk-asg-integ.template.json b/packages/@aws-cdk/aws-autoscaling/test/integ.asg-lt.js.snapshot/aws-cdk-asg-integ.template.json index 0698ba8c6c24d..69bff2fd6e318 100644 --- a/packages/@aws-cdk/aws-autoscaling/test/integ.asg-lt.js.snapshot/aws-cdk-asg-integ.template.json +++ b/packages/@aws-cdk/aws-autoscaling/test/integ.asg-lt.js.snapshot/aws-cdk-asg-integ.template.json @@ -27,7 +27,10 @@ } ] } - ] + ], + "UserData": { + "Fn::Base64": "#!/bin/bash" + } }, "TagSpecifications": [ { @@ -69,7 +72,10 @@ } ] } - ] + ], + "UserData": { + "Fn::Base64": "#!/bin/bash" + } }, "TagSpecifications": [ { diff --git a/packages/@aws-cdk/aws-autoscaling/test/integ.asg-lt.js.snapshot/manifest.json b/packages/@aws-cdk/aws-autoscaling/test/integ.asg-lt.js.snapshot/manifest.json index 2aaf97a525a2a..7e4747019548a 100644 --- a/packages/@aws-cdk/aws-autoscaling/test/integ.asg-lt.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-autoscaling/test/integ.asg-lt.js.snapshot/manifest.json @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/768b8ff8b1178a04dbfca488da9459f4f402bfad643db0b4791787ef23ec4db5.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/2f0699c7863c01ee4fb7ccca4b192b311d9d6723f012b40f36bdf25a5db22f0c.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk/aws-autoscaling/test/integ.asg-lt.js.snapshot/tree.json b/packages/@aws-cdk/aws-autoscaling/test/integ.asg-lt.js.snapshot/tree.json index a5f63ed131aae..e6c641f4d3a8c 100644 --- a/packages/@aws-cdk/aws-autoscaling/test/integ.asg-lt.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-autoscaling/test/integ.asg-lt.js.snapshot/tree.json @@ -42,7 +42,10 @@ } ] } - ] + ], + "userData": { + "Fn::Base64": "#!/bin/bash" + } }, "tagSpecifications": [ { @@ -118,7 +121,10 @@ } ] } - ] + ], + "userData": { + "Fn::Base64": "#!/bin/bash" + } }, "tagSpecifications": [ { @@ -1275,7 +1281,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.168" + "version": "10.1.189" } } }, diff --git a/packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/BatchWithEFSTestDefaultTestDeployAssert0F887B55.assets.json b/packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/BatchWithEFSTestDefaultTestDeployAssert0F887B55.assets.json index 6f2911b10864e..3a915fbe9e315 100644 --- a/packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/BatchWithEFSTestDefaultTestDeployAssert0F887B55.assets.json +++ b/packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/BatchWithEFSTestDefaultTestDeployAssert0F887B55.assets.json @@ -1,5 +1,5 @@ { - "version": "21.0.0", + "version": "30.1.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/batch-stack.assets.json b/packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/batch-stack.assets.json index f5ced56610124..4f1e56ca8afe6 100644 --- a/packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/batch-stack.assets.json +++ b/packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/batch-stack.assets.json @@ -1,7 +1,7 @@ { - "version": "21.0.0", + "version": "30.1.0", "files": { - "742f32336d22265973f0e225f7f35f8254d591f606eb0b3fbbc4ffbe4909a323": { + "dea8441064e2b7f93a29d086bcfc92bbdd9b163aed56cc08208f3ec941e96441": { "source": { "path": "batch-stack.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "742f32336d22265973f0e225f7f35f8254d591f606eb0b3fbbc4ffbe4909a323.json", + "objectKey": "dea8441064e2b7f93a29d086bcfc92bbdd9b163aed56cc08208f3ec941e96441.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/batch-stack.template.json b/packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/batch-stack.template.json index 76d049affafdb..e7cf6f760094e 100644 --- a/packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/batch-stack.template.json +++ b/packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/batch-stack.template.json @@ -577,6 +577,12 @@ "FileSystemId": { "Ref": "EFSF3301CFD" }, + "AccessPointTags": [ + { + "Key": "Name", + "Value": "batch-stack/EFSAccessPoint" + } + ], "PosixUser": { "Gid": "1000", "Uid": "1000" diff --git a/packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/cdk.out b/packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/cdk.out index 588d7b269d34f..b72fef144f05c 100644 --- a/packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"20.0.0"} \ No newline at end of file +{"version":"30.1.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/integ.json b/packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/integ.json index d96168e1c2dd6..c48cd863fc5e6 100644 --- a/packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "21.0.0", + "version": "30.1.0", "testCases": { "BatchWithEFSTest/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/manifest.json b/packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/manifest.json index 0f03538f69fa3..57c6b4202d2fe 100644 --- a/packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { - "version": "21.0.0", + "version": "30.1.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "batch-stack.assets": { "type": "cdk:asset-manifest", "properties": { @@ -23,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/742f32336d22265973f0e225f7f35f8254d591f606eb0b3fbbc4ffbe4909a323.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/dea8441064e2b7f93a29d086bcfc92bbdd9b163aed56cc08208f3ec941e96441.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -490,6 +484,12 @@ ] }, "displayName": "BatchWithEFSTest/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/tree.json b/packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/tree.json index a6ba9cf4b5ca2..bece4c4bbb608 100644 --- a/packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/tree.json @@ -4,14 +4,6 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.140" - } - }, "batch-stack": { "id": "batch-stack", "path": "batch-stack", @@ -942,6 +934,12 @@ "fileSystemId": { "Ref": "EFSF3301CFD" }, + "accessPointTags": [ + { + "key": "Name", + "value": "batch-stack/EFSAccessPoint" + } + ], "posixUser": { "uid": "1000", "gid": "1000" @@ -970,6 +968,14 @@ "id": "DefaultJobRole", "path": "batch-stack/DefaultJobRole", "children": { + "ImportDefaultJobRole": { + "id": "ImportDefaultJobRole", + "path": "batch-stack/DefaultJobRole/ImportDefaultJobRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "batch-stack/DefaultJobRole/Resource", @@ -1132,6 +1138,14 @@ "id": "Ecs-Instance-Role", "path": "batch-stack/batch-demand-compute-env-launch-template/Ecs-Instance-Role", "children": { + "ImportEcs-Instance-Role": { + "id": "ImportEcs-Instance-Role", + "path": "batch-stack/batch-demand-compute-env-launch-template/Ecs-Instance-Role/ImportEcs-Instance-Role", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "batch-stack/batch-demand-compute-env-launch-template/Ecs-Instance-Role/Resource", @@ -1199,6 +1213,14 @@ "id": "Resource-Service-Instance-Role", "path": "batch-stack/batch-demand-compute-env-launch-template/Resource-Service-Instance-Role", "children": { + "ImportResource-Service-Instance-Role": { + "id": "ImportResource-Service-Instance-Role", + "path": "batch-stack/batch-demand-compute-env-launch-template/Resource-Service-Instance-Role/ImportResource-Service-Instance-Role", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "batch-stack/batch-demand-compute-env-launch-template/Resource-Service-Instance-Role/Resource", @@ -1358,6 +1380,14 @@ "id": "Ecs-Instance-Role", "path": "batch-stack/batch-spot-compute-env/Ecs-Instance-Role", "children": { + "ImportEcs-Instance-Role": { + "id": "ImportEcs-Instance-Role", + "path": "batch-stack/batch-spot-compute-env/Ecs-Instance-Role/ImportEcs-Instance-Role", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "batch-stack/batch-spot-compute-env/Ecs-Instance-Role/Resource", @@ -1425,6 +1455,14 @@ "id": "Resource-Service-Instance-Role", "path": "batch-stack/batch-spot-compute-env/Resource-Service-Instance-Role", "children": { + "ImportResource-Service-Instance-Role": { + "id": "ImportResource-Service-Instance-Role", + "path": "batch-stack/batch-spot-compute-env/Resource-Service-Instance-Role/ImportResource-Service-Instance-Role", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "batch-stack/batch-spot-compute-env/Resource-Service-Instance-Role/Resource", @@ -1587,6 +1625,14 @@ "id": "Ecs-Instance-Role", "path": "batch-stack/batch-demand-compute-env-launch-template-2/Ecs-Instance-Role", "children": { + "ImportEcs-Instance-Role": { + "id": "ImportEcs-Instance-Role", + "path": "batch-stack/batch-demand-compute-env-launch-template-2/Ecs-Instance-Role/ImportEcs-Instance-Role", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "batch-stack/batch-demand-compute-env-launch-template-2/Ecs-Instance-Role/Resource", @@ -1654,6 +1700,14 @@ "id": "Resource-Service-Instance-Role", "path": "batch-stack/batch-demand-compute-env-launch-template-2/Resource-Service-Instance-Role", "children": { + "ImportResource-Service-Instance-Role": { + "id": "ImportResource-Service-Instance-Role", + "path": "batch-stack/batch-demand-compute-env-launch-template-2/Resource-Service-Instance-Role/ImportResource-Service-Instance-Role", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "batch-stack/batch-demand-compute-env-launch-template-2/Resource-Service-Instance-Role/Resource", @@ -1852,6 +1906,14 @@ "id": "Resource-Service-Instance-Role", "path": "batch-stack/batch-fargate-compute-env/Resource-Service-Instance-Role", "children": { + "ImportResource-Service-Instance-Role": { + "id": "ImportResource-Service-Instance-Role", + "path": "batch-stack/batch-fargate-compute-env/Resource-Service-Instance-Role/ImportResource-Service-Instance-Role", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "batch-stack/batch-fargate-compute-env/Resource-Service-Instance-Role/Resource", @@ -1986,6 +2048,14 @@ "id": "Resource-Service-Instance-Role", "path": "batch-stack/batch-fargate-spot-compute-env/Resource-Service-Instance-Role", "children": { + "ImportResource-Service-Instance-Role": { + "id": "ImportResource-Service-Instance-Role", + "path": "batch-stack/batch-fargate-spot-compute-env/Resource-Service-Instance-Role/ImportResource-Service-Instance-Role", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "batch-stack/batch-fargate-spot-compute-env/Resource-Service-Instance-Role/Resource", @@ -2313,6 +2383,14 @@ "id": "execution-role", "path": "batch-stack/execution-role", "children": { + "Importexecution-role": { + "id": "Importexecution-role", + "path": "batch-stack/execution-role/Importexecution-role", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "batch-stack/execution-role/Resource", @@ -2502,6 +2580,22 @@ "fqn": "@aws-cdk/aws-batch.JobDefinition", "version": "0.0.0" } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "batch-stack/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "batch-stack/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } } }, "constructInfo": { @@ -2522,12 +2616,30 @@ "path": "BatchWithEFSTest/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.140" + "version": "10.1.252" } }, "DeployAssert": { "id": "DeployAssert", "path": "BatchWithEFSTest/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "BatchWithEFSTest/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "BatchWithEFSTest/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, "constructInfo": { "fqn": "@aws-cdk/core.Stack", "version": "0.0.0" @@ -2544,6 +2656,14 @@ "fqn": "@aws-cdk/integ-tests.IntegTest", "version": "0.0.0" } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.252" + } } }, "constructInfo": { 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 3f9651aebba3d..c3b0d3fada58a 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,10 +29,10 @@ }, "license": "Apache-2.0", "devDependencies": { - "@types/aws-lambda": "^8.10.110", + "@types/aws-lambda": "^8.10.111", "@types/sinon": "^9.0.11", "@aws-cdk/cdk-build-tools": "0.0.0", - "aws-sdk": "^2.1317.0", + "aws-sdk": "^2.1325.0", "aws-sdk-mock": "5.6.0", "eslint": "^7.32.0", "eslint-config-standard": "^14.1.1", diff --git a/packages/@aws-cdk/aws-cloudformation/package.json b/packages/@aws-cdk/aws-cloudformation/package.json index b65281cad3c3d..3955563cb8786 100644 --- a/packages/@aws-cdk/aws-cloudformation/package.json +++ b/packages/@aws-cdk/aws-cloudformation/package.json @@ -89,7 +89,7 @@ "@aws-cdk/integ-tests": "0.0.0", "@aws-cdk/cfn2ts": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/aws-lambda": "^8.10.110", + "@types/aws-lambda": "^8.10.111", "@types/jest": "^27.5.2", "jest": "^27.5.1" }, diff --git a/packages/@aws-cdk/aws-cloudfront-origins/package.json b/packages/@aws-cdk/aws-cloudfront-origins/package.json index 422c0368fa76e..932b2d8481ecf 100644 --- a/packages/@aws-cdk/aws-cloudfront-origins/package.json +++ b/packages/@aws-cdk/aws-cloudfront-origins/package.json @@ -85,7 +85,7 @@ "@aws-cdk/integ-tests": "0.0.0", "@aws-cdk/pkglint": "0.0.0", "@types/jest": "^27.5.2", - "aws-sdk": "^2.1317.0" + "aws-sdk": "^2.1325.0" }, "dependencies": { "@aws-cdk/aws-apigateway": "0.0.0", diff --git a/packages/@aws-cdk/aws-cloudfront/package.json b/packages/@aws-cdk/aws-cloudfront/package.json index f85a2538c1bd4..c01da3b4a87dc 100644 --- a/packages/@aws-cdk/aws-cloudfront/package.json +++ b/packages/@aws-cdk/aws-cloudfront/package.json @@ -88,7 +88,7 @@ "@aws-cdk/cfn2ts": "0.0.0", "@aws-cdk/pkglint": "0.0.0", "@types/jest": "^27.5.2", - "aws-sdk": "^2.1317.0", + "aws-sdk": "^2.1325.0", "jest": "^27.5.1" }, "dependencies": { diff --git a/packages/@aws-cdk/aws-cloudtrail/package.json b/packages/@aws-cdk/aws-cloudtrail/package.json index 1e392e3526eea..648268d27890b 100644 --- a/packages/@aws-cdk/aws-cloudtrail/package.json +++ b/packages/@aws-cdk/aws-cloudtrail/package.json @@ -87,7 +87,7 @@ "@aws-cdk/cfn2ts": "0.0.0", "@aws-cdk/pkglint": "0.0.0", "@types/jest": "^27.5.2", - "aws-sdk": "^2.1317.0", + "aws-sdk": "^2.1325.0", "jest": "^27.5.1" }, "dependencies": { diff --git a/packages/@aws-cdk/aws-codebuild/package.json b/packages/@aws-cdk/aws-codebuild/package.json index 86568eaeaa0ae..85b89e6d33502 100644 --- a/packages/@aws-cdk/aws-codebuild/package.json +++ b/packages/@aws-cdk/aws-codebuild/package.json @@ -93,7 +93,7 @@ "@aws-cdk/cfn2ts": "0.0.0", "@aws-cdk/pkglint": "0.0.0", "@types/jest": "^27.5.2", - "aws-sdk": "^2.1317.0", + "aws-sdk": "^2.1325.0", "jest": "^27.5.1" }, "dependencies": { diff --git a/packages/@aws-cdk/aws-codecommit/package.json b/packages/@aws-cdk/aws-codecommit/package.json index c9a902db27c96..90821ac3cedf1 100644 --- a/packages/@aws-cdk/aws-codecommit/package.json +++ b/packages/@aws-cdk/aws-codecommit/package.json @@ -93,7 +93,7 @@ "@aws-cdk/cloud-assembly-schema": "0.0.0", "@aws-cdk/pkglint": "0.0.0", "@types/jest": "^27.5.2", - "aws-sdk": "^2.1317.0", + "aws-sdk": "^2.1325.0", "jest": "^27.5.1" }, "dependencies": { diff --git a/packages/@aws-cdk/aws-docdb/test/integ.cluster-rotation.lit.js.snapshot/aws-cdk-docdb-cluster-rotation.assets.json b/packages/@aws-cdk/aws-docdb/test/integ.cluster-rotation.lit.js.snapshot/aws-cdk-docdb-cluster-rotation.assets.json index db774132f479a..e79687b2c71f4 100644 --- a/packages/@aws-cdk/aws-docdb/test/integ.cluster-rotation.lit.js.snapshot/aws-cdk-docdb-cluster-rotation.assets.json +++ b/packages/@aws-cdk/aws-docdb/test/integ.cluster-rotation.lit.js.snapshot/aws-cdk-docdb-cluster-rotation.assets.json @@ -1,7 +1,7 @@ { - "version": "20.0.0", + "version": "30.1.0", "files": { - "16960a7525b0e7f3fc99af30374461429f32d815db45bab3e136c4a994140575": { + "ffa0280c20139b5a0ec753fdb4365af29fb08ea9703b9139810054417bc99c10": { "source": { "path": "aws-cdk-docdb-cluster-rotation.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "16960a7525b0e7f3fc99af30374461429f32d815db45bab3e136c4a994140575.json", + "objectKey": "ffa0280c20139b5a0ec753fdb4365af29fb08ea9703b9139810054417bc99c10.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-docdb/test/integ.cluster-rotation.lit.js.snapshot/aws-cdk-docdb-cluster-rotation.template.json b/packages/@aws-cdk/aws-docdb/test/integ.cluster-rotation.lit.js.snapshot/aws-cdk-docdb-cluster-rotation.template.json index 18907654c9a2e..0f59b9f2136f3 100644 --- a/packages/@aws-cdk/aws-docdb/test/integ.cluster-rotation.lit.js.snapshot/aws-cdk-docdb-cluster-rotation.template.json +++ b/packages/@aws-cdk/aws-docdb/test/integ.cluster-rotation.lit.js.snapshot/aws-cdk-docdb-cluster-rotation.template.json @@ -508,7 +508,7 @@ } } }, - "DatabaseSecretAttachmentPolicy5ACFE6CA": { + "DatabaseSecretPolicyEE73D3F8": { "Type": "AWS::SecretsManager::ResourcePolicy", "Properties": { "ResourcePolicy": { @@ -540,7 +540,7 @@ "Version": "2012-10-17" }, "SecretId": { - "Ref": "DatabaseSecretAttachmentE5D1B020" + "Ref": "DatabaseSecret3B817195" } } }, diff --git a/packages/@aws-cdk/aws-docdb/test/integ.cluster-rotation.lit.js.snapshot/cdk.out b/packages/@aws-cdk/aws-docdb/test/integ.cluster-rotation.lit.js.snapshot/cdk.out index 588d7b269d34f..b72fef144f05c 100644 --- a/packages/@aws-cdk/aws-docdb/test/integ.cluster-rotation.lit.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-docdb/test/integ.cluster-rotation.lit.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"20.0.0"} \ No newline at end of file +{"version":"30.1.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-docdb/test/integ.cluster-rotation.lit.js.snapshot/integ.json b/packages/@aws-cdk/aws-docdb/test/integ.cluster-rotation.lit.js.snapshot/integ.json index 5466489d4db95..60a46976636ef 100644 --- a/packages/@aws-cdk/aws-docdb/test/integ.cluster-rotation.lit.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-docdb/test/integ.cluster-rotation.lit.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "20.0.0", + "version": "30.1.0", "testCases": { "integ.cluster-rotation.lit": { "stacks": [ diff --git a/packages/@aws-cdk/aws-docdb/test/integ.cluster-rotation.lit.js.snapshot/manifest.json b/packages/@aws-cdk/aws-docdb/test/integ.cluster-rotation.lit.js.snapshot/manifest.json index 521408f82eb4a..be159955f9791 100644 --- a/packages/@aws-cdk/aws-docdb/test/integ.cluster-rotation.lit.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-docdb/test/integ.cluster-rotation.lit.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { - "version": "20.0.0", + "version": "30.1.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "aws-cdk-docdb-cluster-rotation.assets": { "type": "cdk:asset-manifest", "properties": { @@ -23,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/16960a7525b0e7f3fc99af30374461429f32d815db45bab3e136c4a994140575.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/ffa0280c20139b5a0ec753fdb4365af29fb08ea9703b9139810054417bc99c10.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -213,10 +207,10 @@ "data": "DatabaseSecretAttachmentRotationScheduleA4E9F034" } ], - "/aws-cdk-docdb-cluster-rotation/Database/Secret/Attachment/Policy/Resource": [ + "/aws-cdk-docdb-cluster-rotation/Database/Secret/Policy/Resource": [ { "type": "aws:cdk:logicalId", - "data": "DatabaseSecretAttachmentPolicy5ACFE6CA" + "data": "DatabaseSecretPolicyEE73D3F8" } ], "/aws-cdk-docdb-cluster-rotation/Database/Resource": [ @@ -260,9 +254,24 @@ "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } + ], + "DatabaseSecretAttachmentPolicy5ACFE6CA": [ + { + "type": "aws:cdk:logicalId", + "data": "DatabaseSecretAttachmentPolicy5ACFE6CA", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } ] }, "displayName": "aws-cdk-docdb-cluster-rotation" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-docdb/test/integ.cluster-rotation.lit.js.snapshot/tree.json b/packages/@aws-cdk/aws-docdb/test/integ.cluster-rotation.lit.js.snapshot/tree.json index d6b2cf350eea3..22d76ec24c566 100644 --- a/packages/@aws-cdk/aws-docdb/test/integ.cluster-rotation.lit.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-docdb/test/integ.cluster-rotation.lit.js.snapshot/tree.json @@ -4,14 +4,6 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" - } - }, "aws-cdk-docdb-cluster-rotation": { "id": "aws-cdk-docdb-cluster-rotation", "path": "aws-cdk-docdb-cluster-rotation", @@ -91,8 +83,8 @@ "id": "Acl", "path": "aws-cdk-docdb-cluster-rotation/VPC/PublicSubnet1/Acl", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" } }, "RouteTable": { @@ -258,8 +250,8 @@ "id": "Acl", "path": "aws-cdk-docdb-cluster-rotation/VPC/PublicSubnet2/Acl", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" } }, "RouteTable": { @@ -425,8 +417,8 @@ "id": "Acl", "path": "aws-cdk-docdb-cluster-rotation/VPC/PrivateSubnet1/Acl", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" } }, "RouteTable": { @@ -544,8 +536,8 @@ "id": "Acl", "path": "aws-cdk-docdb-cluster-rotation/VPC/PrivateSubnet2/Acl", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" } }, "RouteTable": { @@ -850,64 +842,64 @@ "fqn": "@aws-cdk/aws-secretsmanager.RotationSchedule", "version": "0.0.0" } - }, - "Policy": { - "id": "Policy", - "path": "aws-cdk-docdb-cluster-rotation/Database/Secret/Attachment/Policy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-cdk-docdb-cluster-rotation/Database/Secret/Attachment/Policy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::SecretsManager::ResourcePolicy", - "aws:cdk:cloudformation:props": { - "resourcePolicy": { - "Statement": [ - { - "Action": "secretsmanager:DeleteSecret", - "Effect": "Deny", - "Principal": { - "AWS": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::", - { - "Ref": "AWS::AccountId" - }, - ":root" - ] - ] - } - }, - "Resource": "*" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.SecretTargetAttachment", + "version": "0.0.0" + } + }, + "Policy": { + "id": "Policy", + "path": "aws-cdk-docdb-cluster-rotation/Database/Secret/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-docdb-cluster-rotation/Database/Secret/Policy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::ResourcePolicy", + "aws:cdk:cloudformation:props": { + "resourcePolicy": { + "Statement": [ + { + "Action": "secretsmanager:DeleteSecret", + "Effect": "Deny", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] } - ], - "Version": "2012-10-17" - }, - "secretId": { - "Ref": "DatabaseSecretAttachmentE5D1B020" + }, + "Resource": "*" } - } + ], + "Version": "2012-10-17" }, - "constructInfo": { - "fqn": "@aws-cdk/aws-secretsmanager.CfnResourcePolicy", - "version": "0.0.0" + "secretId": { + "Ref": "DatabaseSecret3B817195" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-secretsmanager.ResourcePolicy", + "fqn": "@aws-cdk/aws-secretsmanager.CfnResourcePolicy", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-secretsmanager.SecretTargetAttachment", + "fqn": "@aws-cdk/aws-secretsmanager.ResourcePolicy", "version": "0.0.0" } } @@ -1025,8 +1017,8 @@ "id": "SARMapping", "path": "aws-cdk-docdb-cluster-rotation/Database/RotationSingleUser/SARMapping", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.CfnMapping", + "version": "0.0.0" } }, "Resource": { @@ -1120,17 +1112,41 @@ "fqn": "@aws-cdk/aws-docdb.DatabaseCluster", "version": "0.0.0" } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-cdk-docdb-cluster-rotation/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-cdk-docdb-cluster-rotation/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } } }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.85" + "version": "10.1.252" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-dynamodb/package.json b/packages/@aws-cdk/aws-dynamodb/package.json index 8a335fd2b0fc7..3270864374893 100644 --- a/packages/@aws-cdk/aws-dynamodb/package.json +++ b/packages/@aws-cdk/aws-dynamodb/package.json @@ -86,10 +86,10 @@ "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/integ-tests": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/aws-lambda": "^8.10.110", + "@types/aws-lambda": "^8.10.111", "@types/jest": "^27.5.2", "@types/sinon": "^9.0.11", - "aws-sdk": "^2.1317.0", + "aws-sdk": "^2.1325.0", "aws-sdk-mock": "5.6.0", "jest": "^27.5.1", "sinon": "^9.2.4", diff --git a/packages/@aws-cdk/aws-ec2/lib/launch-template.ts b/packages/@aws-cdk/aws-ec2/lib/launch-template.ts index 24e7424bfeb93..0f27c58240c44 100644 --- a/packages/@aws-cdk/aws-ec2/lib/launch-template.ts +++ b/packages/@aws-cdk/aws-ec2/lib/launch-template.ts @@ -12,7 +12,9 @@ import { TagType, Tags, Token, + FeatureFlags, } from '@aws-cdk/core'; +import * as cxapi from '@aws-cdk/cx-api'; import { Construct } from 'constructs'; import { Connections, IConnectable } from './connections'; import { CfnLaunchTemplate } from './ec2.generated'; @@ -591,8 +593,19 @@ export class LaunchTemplate extends Resource implements ILaunchTemplate, iam.IGr }, }); - if (props.userData) { - this.userData = props.userData; + const imageConfig: MachineImageConfig | undefined = props.machineImage?.getImage(this); + if (imageConfig) { + this.osType = imageConfig.osType; + this.imageId = imageConfig.imageId; + } + + if (FeatureFlags.of(this).isEnabled(cxapi.EC2_LAUNCH_TEMPLATE_DEFAULT_USER_DATA)) { + // priority: prop.userData -> userData from machineImage -> undefined + this.userData = props.userData ?? imageConfig?.userData; + } else { + if (props.userData) { + this.userData = props.userData; + } } const userDataToken = Lazy.string({ produce: () => { @@ -603,12 +616,6 @@ export class LaunchTemplate extends Resource implements ILaunchTemplate, iam.IGr }, }); - const imageConfig: MachineImageConfig | undefined = props.machineImage?.getImage(this); - if (imageConfig) { - this.osType = imageConfig.osType; - this.imageId = imageConfig.imageId; - } - this.instanceType = props.instanceType; let marketOptions: any = undefined; diff --git a/packages/@aws-cdk/aws-ec2/package.json b/packages/@aws-cdk/aws-ec2/package.json index f20feee08f5c9..3f1949aeba9a6 100644 --- a/packages/@aws-cdk/aws-ec2/package.json +++ b/packages/@aws-cdk/aws-ec2/package.json @@ -88,7 +88,7 @@ "@aws-cdk/cloud-assembly-schema": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/aws-lambda": "^8.10.110", + "@types/aws-lambda": "^8.10.111", "@types/jest": "^27.5.2", "jest": "^27.5.1" }, diff --git a/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/LambdaTestDefaultTestDeployAssert1AF2B360.assets.json b/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/LambdaTestDefaultTestDeployAssert1AF2B360.assets.json index 1d2e86648cf93..57e75754f5e88 100644 --- a/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/LambdaTestDefaultTestDeployAssert1AF2B360.assets.json +++ b/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/LambdaTestDefaultTestDeployAssert1AF2B360.assets.json @@ -1,5 +1,5 @@ { - "version": "21.0.0", + "version": "22.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/TestStack.template.json b/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/TestStack.template.json deleted file mode 100644 index 3a078b81f8fc5..0000000000000 --- a/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/TestStack.template.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "Resources": { - "LTC4631592": { - "Type": "AWS::EC2::LaunchTemplate", - "Properties": { - "LaunchTemplateData": { - "MetadataOptions": { - "HttpEndpoint": "enabled", - "HttpProtocolIpv6": "enabled", - "HttpPutResponseHopLimit": 2, - "HttpTokens": "required", - "InstanceMetadataTags": "enabled" - }, - "TagSpecifications": [ - { - "ResourceType": "instance", - "Tags": [ - { - "Key": "Name", - "Value": "TestStack/LT" - } - ] - }, - { - "ResourceType": "volume", - "Tags": [ - { - "Key": "Name", - "Value": "TestStack/LT" - } - ] - } - ] - }, - "TagSpecifications": [ - { - "ResourceType": "launch-template", - "Tags": [ - { - "Key": "Name", - "Value": "TestStack/LT" - } - ] - } - ] - } - } - }, - "Parameters": { - "BootstrapVersion": { - "Type": "AWS::SSM::Parameter::Value", - "Default": "/cdk-bootstrap/hnb659fds/version", - "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" - } - }, - "Rules": { - "CheckBootstrapVersion": { - "Assertions": [ - { - "Assert": { - "Fn::Not": [ - { - "Fn::Contains": [ - [ - "1", - "2", - "3", - "4", - "5" - ], - { - "Ref": "BootstrapVersion" - } - ] - } - ] - }, - "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." - } - ] - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/aws-cdk-ec2-lt-metadata-1.assets.json b/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/aws-cdk-ec2-lt-metadata-1.assets.json index 9ed72b653b653..dac10038e94d8 100644 --- a/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/aws-cdk-ec2-lt-metadata-1.assets.json +++ b/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/aws-cdk-ec2-lt-metadata-1.assets.json @@ -1,7 +1,7 @@ { - "version": "21.0.0", + "version": "22.0.0", "files": { - "ea313fee581c8e898c158e9d123dd48345192689bb08a3f7e84716db61247c6c": { + "534a1fbecaccb7e2a071086c8085be5c15b2501781767cdeddf754fe3a0ceecb": { "source": { "path": "aws-cdk-ec2-lt-metadata-1.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "ea313fee581c8e898c158e9d123dd48345192689bb08a3f7e84716db61247c6c.json", + "objectKey": "534a1fbecaccb7e2a071086c8085be5c15b2501781767cdeddf754fe3a0ceecb.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/aws-cdk-ec2-lt-metadata-1.template.json b/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/aws-cdk-ec2-lt-metadata-1.template.json index 3ff46f6e06e20..83f874269b6db 100644 --- a/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/aws-cdk-ec2-lt-metadata-1.template.json +++ b/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/aws-cdk-ec2-lt-metadata-1.template.json @@ -44,9 +44,57 @@ } ] } + }, + "LTWithMachineImageAAC227A5": { + "Type": "AWS::EC2::LaunchTemplate", + "Properties": { + "LaunchTemplateData": { + "ImageId": { + "Ref": "SsmParameterValueawsserviceamiamazonlinuxlatestamzn2amihvmx8664gp2C96584B6F00A464EAD1953AFF4B05118Parameter" + }, + "TagSpecifications": [ + { + "ResourceType": "instance", + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-ec2-lt-metadata-1/LTWithMachineImage" + } + ] + }, + { + "ResourceType": "volume", + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-ec2-lt-metadata-1/LTWithMachineImage" + } + ] + } + ], + "UserData": { + "Fn::Base64": "#!/bin/bash" + } + }, + "TagSpecifications": [ + { + "ResourceType": "launch-template", + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-ec2-lt-metadata-1/LTWithMachineImage" + } + ] + } + ] + } } }, "Parameters": { + "SsmParameterValueawsserviceamiamazonlinuxlatestamzn2amihvmx8664gp2C96584B6F00A464EAD1953AFF4B05118Parameter": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2" + }, "BootstrapVersion": { "Type": "AWS::SSM::Parameter::Value", "Default": "/cdk-bootstrap/hnb659fds/version", diff --git a/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/cdk.out b/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/cdk.out index 8ecc185e9dbee..145739f539580 100644 --- a/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"21.0.0"} \ No newline at end of file +{"version":"22.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/integ.json b/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/integ.json index 92f821d9eb880..d0325b9f439fc 100644 --- a/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "21.0.0", + "version": "22.0.0", "testCases": { "LambdaTest/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/manifest.json b/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/manifest.json index ac57774761bca..2a95821bd2fc1 100644 --- a/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { - "version": "21.0.0", + "version": "22.0.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "aws-cdk-ec2-lt-metadata-1.assets": { "type": "cdk:asset-manifest", "properties": { @@ -23,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/ea313fee581c8e898c158e9d123dd48345192689bb08a3f7e84716db61247c6c.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/534a1fbecaccb7e2a071086c8085be5c15b2501781767cdeddf754fe3a0ceecb.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -45,6 +39,18 @@ "data": "LTC4631592" } ], + "/aws-cdk-ec2-lt-metadata-1/LTWithMachineImage/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "LTWithMachineImageAAC227A5" + } + ], + "/aws-cdk-ec2-lt-metadata-1/SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ + { + "type": "aws:cdk:logicalId", + "data": "SsmParameterValueawsserviceamiamazonlinuxlatestamzn2amihvmx8664gp2C96584B6F00A464EAD1953AFF4B05118Parameter" + } + ], "/aws-cdk-ec2-lt-metadata-1/BootstrapVersion": [ { "type": "aws:cdk:logicalId", @@ -106,6 +112,12 @@ ] }, "displayName": "LambdaTest/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/tree.json b/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/tree.json index 36dbaccbedb90..96da980720391 100644 --- a/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/tree.json @@ -4,14 +4,6 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.108" - } - }, "aws-cdk-ec2-lt-metadata-1": { "id": "aws-cdk-ec2-lt-metadata-1", "path": "aws-cdk-ec2-lt-metadata-1", @@ -69,15 +61,109 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", + "fqn": "@aws-cdk/aws-ec2.CfnLaunchTemplate", "version": "0.0.0" } } }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.LaunchTemplate", + "version": "0.0.0" + } + }, + "LTWithMachineImage": { + "id": "LTWithMachineImage", + "path": "aws-cdk-ec2-lt-metadata-1/LTWithMachineImage", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-ec2-lt-metadata-1/LTWithMachineImage/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::LaunchTemplate", + "aws:cdk:cloudformation:props": { + "launchTemplateData": { + "imageId": { + "Ref": "SsmParameterValueawsserviceamiamazonlinuxlatestamzn2amihvmx8664gp2C96584B6F00A464EAD1953AFF4B05118Parameter" + }, + "tagSpecifications": [ + { + "resourceType": "instance", + "tags": [ + { + "key": "Name", + "value": "aws-cdk-ec2-lt-metadata-1/LTWithMachineImage" + } + ] + }, + { + "resourceType": "volume", + "tags": [ + { + "key": "Name", + "value": "aws-cdk-ec2-lt-metadata-1/LTWithMachineImage" + } + ] + } + ], + "userData": { + "Fn::Base64": "#!/bin/bash" + } + }, + "tagSpecifications": [ + { + "resourceType": "launch-template", + "tags": [ + { + "key": "Name", + "value": "aws-cdk-ec2-lt-metadata-1/LTWithMachineImage" + } + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnLaunchTemplate", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.LaunchTemplate", + "version": "0.0.0" + } + }, + "SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": { + "id": "SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", + "path": "aws-cdk-ec2-lt-metadata-1/SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118": { + "id": "SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118", + "path": "aws-cdk-ec2-lt-metadata-1/SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118", "constructInfo": { "fqn": "@aws-cdk/core.Resource", "version": "0.0.0" } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-cdk-ec2-lt-metadata-1/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-cdk-ec2-lt-metadata-1/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } } }, "constructInfo": { @@ -98,12 +184,30 @@ "path": "LambdaTest/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.108" + "version": "10.1.189" } }, "DeployAssert": { "id": "DeployAssert", "path": "LambdaTest/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "LambdaTest/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "LambdaTest/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, "constructInfo": { "fqn": "@aws-cdk/core.Stack", "version": "0.0.0" @@ -120,6 +224,14 @@ "fqn": "@aws-cdk/integ-tests.IntegTest", "version": "0.0.0" } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } } }, "constructInfo": { diff --git a/packages/@aws-cdk/aws-ec2/test/integ.launch-template.ts b/packages/@aws-cdk/aws-ec2/test/integ.launch-template.ts index 5ee628b4bacdc..ba56a75edd4d5 100644 --- a/packages/@aws-cdk/aws-ec2/test/integ.launch-template.ts +++ b/packages/@aws-cdk/aws-ec2/test/integ.launch-template.ts @@ -15,10 +15,14 @@ new ec2.LaunchTemplate(stack, 'LT', { instanceMetadataTags: true, }); +new ec2.LaunchTemplate(stack, 'LTWithMachineImage', { + machineImage: ec2.MachineImage.latestAmazonLinux({ + generation: ec2.AmazonLinuxGeneration.AMAZON_LINUX_2, + }), +}); new integ.IntegTest(app, 'LambdaTest', { testCases: [stack], }); app.synth(); - diff --git a/packages/@aws-cdk/aws-ec2/test/launch-template.test.ts b/packages/@aws-cdk/aws-ec2/test/launch-template.test.ts index 74ec38e098019..234d6558bbca2 100644 --- a/packages/@aws-cdk/aws-ec2/test/launch-template.test.ts +++ b/packages/@aws-cdk/aws-ec2/test/launch-template.test.ts @@ -12,6 +12,7 @@ import { Stack, Tags, } from '@aws-cdk/core'; +import * as cxapi from '@aws-cdk/cx-api'; import { stringLike } from './util'; import { AmazonLinuxImage, @@ -367,6 +368,44 @@ describe('LaunchTemplate', () => { }); }); + describe('feature flag @aws-cdk/aws-ec2:launchTemplateDefaultUserData', () => { + test('Given machineImage (Linux)', () => { + // WHEN + stack.node.setContext(cxapi.EC2_LAUNCH_TEMPLATE_DEFAULT_USER_DATA, true); + const template = new LaunchTemplate(stack, 'Template', { + machineImage: new AmazonLinuxImage(), + }); + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::EC2::LaunchTemplate', { + LaunchTemplateData: { + ImageId: { + Ref: stringLike('SsmParameterValueawsserviceamiamazonlinuxlatestamznami.*Parameter'), + }, + }, + }); + expect(template.osType).toBe(OperatingSystemType.LINUX); + expect(template.userData).toBeDefined(); + }); + + test('Given machineImage (Windows)', () => { + // WHEN + stack.node.setContext(cxapi.EC2_LAUNCH_TEMPLATE_DEFAULT_USER_DATA, true); + const template = new LaunchTemplate(stack, 'Template', { + machineImage: new WindowsImage(WindowsVersion.WINDOWS_SERVER_2019_ENGLISH_FULL_BASE), + }); + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::EC2::LaunchTemplate', { + LaunchTemplateData: { + ImageId: { + Ref: stringLike('SsmParameterValueawsserviceamiwindowslatestWindowsServer2019EnglishFullBase.*Parameter'), + }, + }, + }); + expect(template.osType).toBe(OperatingSystemType.WINDOWS); + expect(template.userData).toBeDefined(); + }); + }); + test.each([ [CpuCredits.STANDARD, 'standard'], [CpuCredits.UNLIMITED, 'unlimited'], @@ -901,6 +940,5 @@ describe('LaunchTemplate metadataOptions', () => { }, }, }); - }); }); diff --git a/packages/@aws-cdk/aws-ecr-assets/lib/tarball-asset.ts b/packages/@aws-cdk/aws-ecr-assets/lib/tarball-asset.ts index 32603cf7664b6..95dbbee1d1119 100644 --- a/packages/@aws-cdk/aws-ecr-assets/lib/tarball-asset.ts +++ b/packages/@aws-cdk/aws-ecr-assets/lib/tarball-asset.ts @@ -77,7 +77,7 @@ export class TarballImageAsset extends Construct implements IAsset { executable: [ 'sh', '-c', - `docker load -i ${relativePathInOutDir} | sed "s/Loaded image: //g"`, + `docker load -i ${relativePathInOutDir} | tail -n 1 | sed "s/Loaded image: //g"`, ], }); diff --git a/packages/@aws-cdk/aws-ecr-assets/package.json b/packages/@aws-cdk/aws-ecr-assets/package.json index cb90917e0511b..fe5a11e20b6ba 100644 --- a/packages/@aws-cdk/aws-ecr-assets/package.json +++ b/packages/@aws-cdk/aws-ecr-assets/package.json @@ -76,6 +76,7 @@ "@aws-cdk/assertions": "0.0.0", "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", + "@aws-cdk/integ-tests": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", "@aws-cdk/pkglint": "0.0.0", "@types/jest": "^27.5.2", diff --git a/packages/@aws-cdk/aws-ecr-assets/test/demo-tarball-hello-world/hello-world.tar b/packages/@aws-cdk/aws-ecr-assets/test/demo-tarball-hello-world/hello-world.tar new file mode 100644 index 0000000000000..2e9b55a25a8a7 Binary files /dev/null and b/packages/@aws-cdk/aws-ecr-assets/test/demo-tarball-hello-world/hello-world.tar differ diff --git a/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.js.snapshot/LoadFromTarballDefaultTestDeployAssert46673615.assets.json b/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.js.snapshot/LoadFromTarballDefaultTestDeployAssert46673615.assets.json new file mode 100644 index 0000000000000..19e97d96f3815 --- /dev/null +++ b/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.js.snapshot/LoadFromTarballDefaultTestDeployAssert46673615.assets.json @@ -0,0 +1,19 @@ +{ + "version": "22.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "LoadFromTarballDefaultTestDeployAssert46673615.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.js.snapshot/LoadFromTarballDefaultTestDeployAssert46673615.template.json b/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.js.snapshot/LoadFromTarballDefaultTestDeployAssert46673615.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.js.snapshot/LoadFromTarballDefaultTestDeployAssert46673615.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.js.snapshot/asset.a5fbe3aa4a0e49fac7d3fbe7b913cf022d307bfad6ef1e88e06cc2a229523474.tar b/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.js.snapshot/asset.a5fbe3aa4a0e49fac7d3fbe7b913cf022d307bfad6ef1e88e06cc2a229523474.tar new file mode 100644 index 0000000000000..2e9b55a25a8a7 Binary files /dev/null and b/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.js.snapshot/asset.a5fbe3aa4a0e49fac7d3fbe7b913cf022d307bfad6ef1e88e06cc2a229523474.tar differ diff --git a/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.js.snapshot/cdk.out b/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.js.snapshot/cdk.out new file mode 100644 index 0000000000000..145739f539580 --- /dev/null +++ b/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"22.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.js.snapshot/integ-assets-tarball.assets.json b/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.js.snapshot/integ-assets-tarball.assets.json new file mode 100644 index 0000000000000..ad93a80114888 --- /dev/null +++ b/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.js.snapshot/integ-assets-tarball.assets.json @@ -0,0 +1,36 @@ +{ + "version": "22.0.0", + "files": { + "7e85363095650cdc9e77b849e3afda82da3123dd43f5d237b9601f816ddf583e": { + "source": { + "path": "integ-assets-tarball.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "7e85363095650cdc9e77b849e3afda82da3123dd43f5d237b9601f816ddf583e.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": { + "a5fbe3aa4a0e49fac7d3fbe7b913cf022d307bfad6ef1e88e06cc2a229523474": { + "source": { + "executable": [ + "sh", + "-c", + "docker load -i asset.a5fbe3aa4a0e49fac7d3fbe7b913cf022d307bfad6ef1e88e06cc2a229523474.tar | tail -n 1 | sed \"s/Loaded image: //g\"" + ] + }, + "destinations": { + "current_account-current_region": { + "repositoryName": "cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}", + "imageTag": "a5fbe3aa4a0e49fac7d3fbe7b913cf022d307bfad6ef1e88e06cc2a229523474", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-image-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.js.snapshot/integ-assets-tarball.template.json b/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.js.snapshot/integ-assets-tarball.template.json new file mode 100644 index 0000000000000..a79e4296debea --- /dev/null +++ b/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.js.snapshot/integ-assets-tarball.template.json @@ -0,0 +1,105 @@ +{ + "Resources": { + "MyUserDC45028B": { + "Type": "AWS::IAM::User" + }, + "MyUserDefaultPolicy7B897426": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:BatchGetImage", + "ecr:GetDownloadUrlForLayer" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ecr:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":repository/", + { + "Fn::Sub": "cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}" + } + ] + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "MyUserDefaultPolicy7B897426", + "Users": [ + { + "Ref": "MyUserDC45028B" + } + ] + } + } + }, + "Outputs": { + "ImageUri": { + "Value": { + "Fn::Sub": "${AWS::AccountId}.dkr.ecr.${AWS::Region}.${AWS::URLSuffix}/cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}:a5fbe3aa4a0e49fac7d3fbe7b913cf022d307bfad6ef1e88e06cc2a229523474" + } + }, + "ImageUri2": { + "Value": { + "Fn::Sub": "${AWS::AccountId}.dkr.ecr.${AWS::Region}.${AWS::URLSuffix}/cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}:a5fbe3aa4a0e49fac7d3fbe7b913cf022d307bfad6ef1e88e06cc2a229523474" + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.js.snapshot/integ.json b/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.js.snapshot/integ.json new file mode 100644 index 0000000000000..0f4dded2efe13 --- /dev/null +++ b/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "22.0.0", + "testCases": { + "LoadFromTarball/DefaultTest": { + "stacks": [ + "integ-assets-tarball" + ], + "assertionStack": "LoadFromTarball/DefaultTest/DeployAssert", + "assertionStackName": "LoadFromTarballDefaultTestDeployAssert46673615" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.js.snapshot/manifest.json b/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.js.snapshot/manifest.json new file mode 100644 index 0000000000000..f5c1d20d76c84 --- /dev/null +++ b/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.js.snapshot/manifest.json @@ -0,0 +1,129 @@ +{ + "version": "22.0.0", + "artifacts": { + "integ-assets-tarball.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "integ-assets-tarball.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "integ-assets-tarball": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "integ-assets-tarball.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/7e85363095650cdc9e77b849e3afda82da3123dd43f5d237b9601f816ddf583e.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "integ-assets-tarball.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "integ-assets-tarball.assets" + ], + "metadata": { + "/integ-assets-tarball/MyUser/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "MyUserDC45028B" + } + ], + "/integ-assets-tarball/MyUser/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "MyUserDefaultPolicy7B897426" + } + ], + "/integ-assets-tarball/ImageUri": [ + { + "type": "aws:cdk:logicalId", + "data": "ImageUri" + } + ], + "/integ-assets-tarball/ImageUri2": [ + { + "type": "aws:cdk:logicalId", + "data": "ImageUri2" + } + ], + "/integ-assets-tarball/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/integ-assets-tarball/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "integ-assets-tarball" + }, + "LoadFromTarballDefaultTestDeployAssert46673615.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "LoadFromTarballDefaultTestDeployAssert46673615.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "LoadFromTarballDefaultTestDeployAssert46673615": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "LoadFromTarballDefaultTestDeployAssert46673615.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "LoadFromTarballDefaultTestDeployAssert46673615.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "LoadFromTarballDefaultTestDeployAssert46673615.assets" + ], + "metadata": { + "/LoadFromTarball/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/LoadFromTarball/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "LoadFromTarball/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.js.snapshot/tree.json b/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.js.snapshot/tree.json new file mode 100644 index 0000000000000..3c7e326c73b0d --- /dev/null +++ b/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.js.snapshot/tree.json @@ -0,0 +1,261 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "integ-assets-tarball": { + "id": "integ-assets-tarball", + "path": "integ-assets-tarball", + "children": { + "DockerImage": { + "id": "DockerImage", + "path": "integ-assets-tarball/DockerImage", + "children": { + "Staging": { + "id": "Staging", + "path": "integ-assets-tarball/DockerImage/Staging", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "Repository": { + "id": "Repository", + "path": "integ-assets-tarball/DockerImage/Repository", + "constructInfo": { + "fqn": "@aws-cdk/aws-ecr.RepositoryBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ecr-assets.TarballImageAsset", + "version": "0.0.0" + } + }, + "DockerImage2": { + "id": "DockerImage2", + "path": "integ-assets-tarball/DockerImage2", + "children": { + "Staging": { + "id": "Staging", + "path": "integ-assets-tarball/DockerImage2/Staging", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "Repository": { + "id": "Repository", + "path": "integ-assets-tarball/DockerImage2/Repository", + "constructInfo": { + "fqn": "@aws-cdk/aws-ecr.RepositoryBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ecr-assets.TarballImageAsset", + "version": "0.0.0" + } + }, + "MyUser": { + "id": "MyUser", + "path": "integ-assets-tarball/MyUser", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-assets-tarball/MyUser/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::User", + "aws:cdk:cloudformation:props": {} + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnUser", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "integ-assets-tarball/MyUser/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-assets-tarball/MyUser/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:BatchGetImage", + "ecr:GetDownloadUrlForLayer" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ecr:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":repository/", + { + "Fn::Sub": "cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}" + } + ] + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "policyName": "MyUserDefaultPolicy7B897426", + "users": [ + { + "Ref": "MyUserDC45028B" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.User", + "version": "0.0.0" + } + }, + "ImageUri": { + "id": "ImageUri", + "path": "integ-assets-tarball/ImageUri", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "ImageUri2": { + "id": "ImageUri2", + "path": "integ-assets-tarball/ImageUri2", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "integ-assets-tarball/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "integ-assets-tarball/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "LoadFromTarball": { + "id": "LoadFromTarball", + "path": "LoadFromTarball", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "LoadFromTarball/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "LoadFromTarball/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "LoadFromTarball/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "LoadFromTarball/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "LoadFromTarball/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.ts b/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.ts new file mode 100644 index 0000000000000..472d512369067 --- /dev/null +++ b/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-tarball.ts @@ -0,0 +1,29 @@ +import * as path from 'path'; +import * as iam from '@aws-cdk/aws-iam'; +import * as cdk from '@aws-cdk/core'; +import { IntegTest } from '@aws-cdk/integ-tests'; +import * as assets from '../lib'; + +const app = new cdk.App(); +const stack = new cdk.Stack(app, 'integ-assets-tarball'); + +const asset = new assets.TarballImageAsset(stack, 'DockerImage', { + tarballFile: path.join(__dirname, 'demo-tarball-hello-world/hello-world.tar'), +}); + +const asset2 = new assets.TarballImageAsset(stack, 'DockerImage2', { + tarballFile: path.join(__dirname, 'demo-tarball-hello-world/hello-world.tar'), +}); + +const user = new iam.User(stack, 'MyUser'); +asset.repository.grantPull(user); +asset2.repository.grantPull(user); + +new cdk.CfnOutput(stack, 'ImageUri', { value: asset.imageUri }); +new cdk.CfnOutput(stack, 'ImageUri2', { value: asset2.imageUri }); + +new IntegTest(app, 'LoadFromTarball', { + testCases: [ + stack, + ], +}); diff --git a/packages/@aws-cdk/aws-ecr-assets/test/tarball-asset.test.ts b/packages/@aws-cdk/aws-ecr-assets/test/tarball-asset.test.ts index 1333cc8e5c91b..e06d84eb31534 100644 --- a/packages/@aws-cdk/aws-ecr-assets/test/tarball-asset.test.ts +++ b/packages/@aws-cdk/aws-ecr-assets/test/tarball-asset.test.ts @@ -42,7 +42,7 @@ describe('image asset', () => { executable: [ 'sh', '-c', - `docker load -i asset.${asset.assetHash}.tar | sed "s/Loaded image: //g"`, + `docker load -i asset.${asset.assetHash}.tar | tail -n 1 | sed "s/Loaded image: //g"`, ], }, ); diff --git a/packages/@aws-cdk/aws-ecs/lib/container-definition.ts b/packages/@aws-cdk/aws-ecs/lib/container-definition.ts index 4eda8f884b813..6ca07346dff28 100644 --- a/packages/@aws-cdk/aws-ecs/lib/container-definition.ts +++ b/packages/@aws-cdk/aws-ecs/lib/container-definition.ts @@ -566,43 +566,15 @@ export class ContainerDefinition extends Construct { */ public addPortMappings(...portMappings: PortMapping[]) { this.portMappings.push(...portMappings.map(pm => { - if (this.taskDefinition.networkMode === NetworkMode.AWS_VPC || this.taskDefinition.networkMode === NetworkMode.HOST) { - if (pm.containerPort !== pm.hostPort && pm.hostPort !== undefined) { - throw new Error(`Host port (${pm.hostPort}) must be left out or equal to container port ${pm.containerPort} for network mode ${this.taskDefinition.networkMode}`); - } - } - // No empty strings as port mapping names. - if (pm.name === '') { - throw new Error('Port mapping name cannot be an empty string.'); - } - // Service connect logic. - if (pm.name || pm.appProtocol) { - - // Service connect only supports Awsvpc and Bridge network modes. - if (![NetworkMode.BRIDGE, NetworkMode.AWS_VPC].includes(this.taskDefinition.networkMode)) { - throw new Error(`Service connect related port mapping fields 'name' and 'appProtocol' are not supported for network mode ${this.taskDefinition.networkMode}`); - } - - // Name is not set but App Protocol is; this config is meaningless and we should throw. - if (!pm.name) { - throw new Error('Service connect-related port mapping field \'appProtocol\' cannot be set without \'name\''); - } - - if (this._namedPorts.has(pm.name)) { - throw new Error(`Port mapping name '${pm.name}' already exists on this container`); - } - this._namedPorts.set(pm.name, pm); + const portMap = new PortMap(this.taskDefinition.networkMode, pm); + portMap.validate(); + const serviceConnect = new ServiceConnect(this.taskDefinition.networkMode, pm); + if (serviceConnect.isServiceConnect()) { + serviceConnect.validate(); + this.setNamedPort(pm); } - - if (this.taskDefinition.networkMode === NetworkMode.BRIDGE) { - if (pm.hostPort === undefined) { - pm = { - ...pm, - hostPort: 0, - }; - } - } - return pm; + const sanitizedPM = this.addHostPortIfNeeded(pm); + return sanitizedPM; })); } @@ -688,6 +660,32 @@ export class ContainerDefinition extends Construct { return this._namedPorts.get(name); } + /** + * This method adds an namedPort + */ + private setNamedPort(pm: PortMapping) :void { + if (!pm.name) return; + if (this._namedPorts.has(pm.name)) { + throw new Error(`Port mapping name '${pm.name}' already exists on this container`); + } + this._namedPorts.set(pm.name, pm); + } + + + /** + * Set HostPort to 0 When netowork mode is Brdige + */ + private addHostPortIfNeeded(pm: PortMapping) :PortMapping { + const newPM = { + ...pm, + }; + if (this.taskDefinition.networkMode !== NetworkMode.BRIDGE) return newPM; + if (pm.hostPort !== undefined) return newPM; + newPM.hostPort = 0; + return newPM; + } + + /** * Whether this container definition references a specific JSON field of a secret * stored in Secrets Manager. @@ -1086,6 +1084,116 @@ export interface PortMapping { readonly appProtocol?: AppProtocol; } +/** + * PortMap ValueObjectClass having by ContainerDefinition + */ +export class PortMap { + + /** + * The networking mode to use for the containers in the task. + */ + readonly networkmode: NetworkMode; + + /** + * Port mappings allow containers to access ports on the host container instance to send or receive traffic. + */ + readonly portmapping: PortMapping; + + constructor(networkmode: NetworkMode, pm: PortMapping) { + this.networkmode = networkmode; + this.portmapping = pm; + } + + /** + * validate invalid portmapping and networkmode parameters. + * throw Error when invalid parameters. + */ + public validate(): void { + if (!this.isvalidPortName()) { + throw new Error('Port mapping name cannot be an empty string.'); + } + if (!this.isValidPorts()) { + const pm = this.portmapping; + throw new Error(`Host port (${pm.hostPort}) must be left out or equal to container port ${pm.containerPort} for network mode ${this.networkmode}`); + } + } + + private isvalidPortName(): boolean { + if (this.portmapping.name === '') { + return false; + } + return true; + } + + private isValidPorts() :boolean { + const isAwsVpcMode = this.networkmode == NetworkMode.AWS_VPC; + const isHostMode = this.networkmode == NetworkMode.HOST; + if (!isAwsVpcMode && !isHostMode) return true; + const hostPort = this.portmapping.hostPort; + const containerPort = this.portmapping.containerPort; + if (containerPort !== hostPort && hostPort !== undefined ) return false; + return true; + } + +} + + +/** + * ServiceConnect ValueObjectClass having by ContainerDefinition + */ +export class ServiceConnect { + /** + * Port mappings allow containers to access ports on the host container instance to send or receive traffic. + */ + readonly portmapping: PortMapping; + + /** + * The networking mode to use for the containers in the task. + */ + readonly networkmode: NetworkMode; + + constructor(networkmode: NetworkMode, pm: PortMapping) { + this.portmapping = pm; + this.networkmode = networkmode; + } + + /** + * Judge parameters can be serviceconnect logick. + * If parameters can be serviceConnect return true. + */ + public isServiceConnect() :boolean { + const hasPortname = this.portmapping.name; + const hasAppProtcol = this.portmapping.appProtocol; + if (hasPortname || hasAppProtcol) return true; + return false; + } + + /** + * Judge serviceconnect parametes are valid. + * If invalid, throw Error. + */ + public validate() :void { + if (!this.isValidNetworkmode()) { + throw new Error(`Service connect related port mapping fields 'name' and 'appProtocol' are not supported for network mode ${this.networkmode}`); + } + if (!this.isValidPortName()) { + throw new Error('Service connect-related port mapping field \'appProtocol\' cannot be set without \'name\''); + } + } + + private isValidNetworkmode() :boolean { + const isAwsVpcMode = this.networkmode == NetworkMode.AWS_VPC; + const isBridgeMode = this.networkmode == NetworkMode.BRIDGE; + if (isAwsVpcMode || isBridgeMode) return true; + return false; + } + + private isValidPortName() :boolean { + if (!this.portmapping.name) return false; + return true; + } +} + /** * Network protocol */ 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 df6b12e553769..12c8c699ff733 100644 --- a/packages/@aws-cdk/aws-ecs/test/container-definition.test.ts +++ b/packages/@aws-cdk/aws-ecs/test/container-definition.test.ts @@ -35,6 +35,156 @@ describe('container definition', () => { }); }); + describe('PortMap validates', () => { + test('throws when PortMapping.name is empty string.', () => { + // GIVEN + const portMapping: ecs.PortMapping = { + containerPort: 8080, + name: '', + }; + const networkmode = ecs.NetworkMode.AWS_VPC; + const portMap = new ecs.PortMap(networkmode, portMapping); + // THEN + expect(() => { + portMap.validate(); + }).toThrow(); + }); + + describe('ContainerPort should not eqaul Hostport', () => { + test('when AWS_VPC Networkmode', () => { + // GIVEN + const portMapping: ecs.PortMapping = { + containerPort: 8080, + hostPort: 8081, + }; + const networkmode = ecs.NetworkMode.AWS_VPC; + const portMap = new ecs.PortMap(networkmode, portMapping); + // THEN + expect(() => { + portMap.validate(); + }).toThrow(); + }); + + test('when Host Networkmode', () => { + // GIVEN + const portMapping: ecs.PortMapping = { + containerPort: 8080, + hostPort: 8081, + }; + const networkmode = ecs.NetworkMode.HOST; + const portMap = new ecs.PortMap(networkmode, portMapping); + // THEN + expect(() => { + portMap.validate(); + }).toThrow(); + }); + }); + + describe('ContainerPort can equal HostPort cases', () => { + test('when Bridge Networkmode', () => { + // GIVEN + const portMapping: ecs.PortMapping = { + containerPort: 8080, + hostPort: 8080, + }; + const networkmode = ecs.NetworkMode.BRIDGE; + const portMap = new ecs.PortMap(networkmode, portMapping); + // THEN + expect(() => { + portMap.validate(); + }).not.toThrow(); + }); + + }); + + }); + + describe('ServiceConnect class', () => { + describe('isServiceConnect', () => { + test('return true if params has portname', () => { + // GIVEN + const portMapping: ecs.PortMapping = { + containerPort: 8080, + name: 'test', + }; + const networkmode = ecs.NetworkMode.AWS_VPC; + const serviceConnect = new ecs.ServiceConnect(networkmode, portMapping); + // THEN + expect(serviceConnect.isServiceConnect()).toEqual(true); + }); + + test('return true if params has appProtocol', () => { + // GIVEN + const portMapping: ecs.PortMapping = { + containerPort: 8080, + appProtocol: ecs.AppProtocol.http2, + }; + const networkmode = ecs.NetworkMode.AWS_VPC; + const serviceConnect = new ecs.ServiceConnect(networkmode, portMapping); + // THEN + expect(serviceConnect.isServiceConnect()).toEqual(true); + }); + + test('return false if params has not appProtocl and portName ', () => { + // GIVEN + const portMapping: ecs.PortMapping = { + containerPort: 8080, + }; + const networkmode = ecs.NetworkMode.AWS_VPC; + const serviceConnect = new ecs.ServiceConnect(networkmode, portMapping); + // THEN + expect(serviceConnect.isServiceConnect()).toEqual(false); + }); + + }); + + describe('validate', () => { + test('throw if Host Networkmode', () => { + // GIVEN + const portMapping: ecs.PortMapping = { + containerPort: 8080, + name: 'test', + }; + const networkmode = ecs.NetworkMode.HOST; + const serviceConnect = new ecs.ServiceConnect(networkmode, portMapping); + // THEN + expect(() => { + serviceConnect.validate(); + }).toThrow(); + }); + + test('throw if has not portmap name', () => { + // GIVEN + const portMapping: ecs.PortMapping = { + containerPort: 8080, + appProtocol: ecs.AppProtocol.http2, + }; + const networkmode = ecs.NetworkMode.AWS_VPC; + const serviceConnect = new ecs.ServiceConnect(networkmode, portMapping); + // THEN + expect(() => { + serviceConnect.validate(); + }).toThrow('Service connect-related port mapping field \'appProtocol\' cannot be set without \'name\''); + }); + + test('should not throw if AWS_VPC NetworkMode and has portname', () => { + // GIVEN + const portMapping: ecs.PortMapping = { + containerPort: 8080, + name: 'test', + }; + const networkmode = ecs.NetworkMode.AWS_VPC; + const serviceConnect = new ecs.ServiceConnect(networkmode, portMapping); + // THEN + expect(() => { + serviceConnect.validate(); + }).not.toThrow(); + }); + + }); + + }); + test('port mapping throws an error when appProtocol is set without name', () => { // GIVEN const stack = new cdk.Stack(); diff --git a/packages/@aws-cdk/aws-efs/lib/access-point.ts b/packages/@aws-cdk/aws-efs/lib/access-point.ts index 74eefa878773e..41424f96378e5 100644 --- a/packages/@aws-cdk/aws-efs/lib/access-point.ts +++ b/packages/@aws-cdk/aws-efs/lib/access-point.ts @@ -1,4 +1,4 @@ -import { ArnFormat, IResource, Resource, Stack } from '@aws-cdk/core'; +import { ArnFormat, IResource, Resource, Stack, Tags } from '@aws-cdk/core'; import { Construct } from 'constructs'; import { IFileSystem } from './efs-file-system'; import { CfnAccessPoint } from './efs.generated'; @@ -218,6 +218,8 @@ export class AccessPoint extends AccessPointBase { } : undefined, }); + Tags.of(this).add('Name', this.node.path); + this.accessPointId = resource.ref; this.accessPointArn = Stack.of(scope).formatArn({ service: 'elasticfilesystem', diff --git a/packages/@aws-cdk/aws-efs/test/access-point.test.ts b/packages/@aws-cdk/aws-efs/test/access-point.test.ts index 488dbb93dee4f..6571be822a720 100644 --- a/packages/@aws-cdk/aws-efs/test/access-point.test.ts +++ b/packages/@aws-cdk/aws-efs/test/access-point.test.ts @@ -1,6 +1,6 @@ import { Template } from '@aws-cdk/assertions'; import * as ec2 from '@aws-cdk/aws-ec2'; -import { Stack } from '@aws-cdk/core'; +import { Stack, Tags } from '@aws-cdk/core'; import { AccessPoint, FileSystem } from '../lib'; let stack: Stack; @@ -31,6 +31,25 @@ test('new AccessPoint correctly', () => { Template.fromStack(stack).resourceCountIs('AWS::EFS::AccessPoint', 1); }); +test('support tags for AccessPoint', () => { + // WHEN + const accessPoint = new AccessPoint(stack, 'MyAccessPoint', { + fileSystem, + }); + Tags.of(accessPoint).add('key1', 'value1'); + Tags.of(accessPoint).add('key2', 'value2'); + Tags.of(accessPoint).add('Name', 'MyAccessPointName'); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::EFS::AccessPoint', { + AccessPointTags: [ + { Key: 'key1', Value: 'value1' }, + { Key: 'key2', Value: 'value2' }, + { Key: 'Name', Value: 'MyAccessPointName' }, + ], + }); +}); + test('import an AccessPoint using fromAccessPointId', () => { // WHEN const ap = new AccessPoint(stack, 'MyAccessPoint', { diff --git a/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.js.snapshot/FileSystemPolicyTestDefaultTestDeployAssertD0596FC1.assets.json b/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.js.snapshot/FileSystemPolicyTestDefaultTestDeployAssertD0596FC1.assets.json index 63310c336fab4..c89606077c44e 100644 --- a/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.js.snapshot/FileSystemPolicyTestDefaultTestDeployAssertD0596FC1.assets.json +++ b/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.js.snapshot/FileSystemPolicyTestDefaultTestDeployAssertD0596FC1.assets.json @@ -1,5 +1,5 @@ { - "version": "30.0.0", + "version": "30.1.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.js.snapshot/cdk.out b/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.js.snapshot/cdk.out index ae4b03c54e770..b72fef144f05c 100644 --- a/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"30.0.0"} \ No newline at end of file +{"version":"30.1.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.js.snapshot/integ.json b/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.js.snapshot/integ.json index 92343ca276aaf..a5b791d6df896 100644 --- a/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "30.0.0", + "version": "30.1.0", "testCases": { "FileSystemPolicyTest/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.js.snapshot/manifest.json b/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.js.snapshot/manifest.json index e59b3eec02264..3c673ba5033f3 100644 --- a/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "30.0.0", + "version": "30.1.0", "artifacts": { "test-efs-integ.assets": { "type": "cdk:asset-manifest", @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/c5e7b14cbe61beadd8ee29f1e2e8da7ac152bf472dfba586a792ff422a1eef41.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/7d5832d3a930b18cb36abc1ffaed24a2bf408a8130ba7fab108ff6f6fa75dd98.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -183,6 +183,12 @@ "data": "FileSystemEfsMountTarget24B8EBB43" } ], + "/test-efs-integ/AccessPoint/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "AccessPointE936DE82" + } + ], "/test-efs-integ/BootstrapVersion": [ { "type": "aws:cdk:logicalId", diff --git a/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.js.snapshot/test-efs-integ.assets.json b/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.js.snapshot/test-efs-integ.assets.json index 4b4483a20346e..2c398da3f69db 100644 --- a/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.js.snapshot/test-efs-integ.assets.json +++ b/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.js.snapshot/test-efs-integ.assets.json @@ -1,7 +1,7 @@ { - "version": "30.0.0", + "version": "30.1.0", "files": { - "c5e7b14cbe61beadd8ee29f1e2e8da7ac152bf472dfba586a792ff422a1eef41": { + "7d5832d3a930b18cb36abc1ffaed24a2bf408a8130ba7fab108ff6f6fa75dd98": { "source": { "path": "test-efs-integ.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "c5e7b14cbe61beadd8ee29f1e2e8da7ac152bf472dfba586a792ff422a1eef41.json", + "objectKey": "7d5832d3a930b18cb36abc1ffaed24a2bf408a8130ba7fab108ff6f6fa75dd98.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.js.snapshot/test-efs-integ.template.json b/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.js.snapshot/test-efs-integ.template.json index 7abbbf57f980e..0349d15da0f88 100644 --- a/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.js.snapshot/test-efs-integ.template.json +++ b/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.js.snapshot/test-efs-integ.template.json @@ -464,6 +464,21 @@ "Ref": "VpcPrivateSubnet2Subnet3788AAA1" } } + }, + "AccessPointE936DE82": { + "Type": "AWS::EFS::AccessPoint", + "Properties": { + "FileSystemId": { + "Ref": "FileSystem8A8E25C0" + }, + "AccessPointTags": [ + { + "Key": "Name", + "Value": "MyAccessPoint" + } + ], + "RootDirectory": {} + } } }, "Parameters": { diff --git a/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.js.snapshot/tree.json b/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.js.snapshot/tree.json index d231356b874e9..b32beb54b1e25 100644 --- a/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.js.snapshot/tree.json @@ -763,6 +763,39 @@ "version": "0.0.0" } }, + "AccessPoint": { + "id": "AccessPoint", + "path": "test-efs-integ/AccessPoint", + "children": { + "Resource": { + "id": "Resource", + "path": "test-efs-integ/AccessPoint/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EFS::AccessPoint", + "aws:cdk:cloudformation:props": { + "fileSystemId": { + "Ref": "FileSystem8A8E25C0" + }, + "accessPointTags": [ + { + "key": "Name", + "value": "MyAccessPoint" + } + ], + "rootDirectory": {} + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-efs.CfnAccessPoint", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-efs.AccessPoint", + "version": "0.0.0" + } + }, "BootstrapVersion": { "id": "BootstrapVersion", "path": "test-efs-integ/BootstrapVersion", @@ -798,7 +831,7 @@ "path": "FileSystemPolicyTest/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.249" + "version": "10.1.252" } }, "DeployAssert": { @@ -844,7 +877,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.249" + "version": "10.1.252" } } }, diff --git a/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.ts b/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.ts index a468a6822e2f1..79f40dccec337 100644 --- a/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.ts +++ b/packages/@aws-cdk/aws-efs/test/integ.efs-filesystem-policy.ts @@ -3,7 +3,7 @@ import { AccountRootPrincipal, PolicyDocument, PolicyStatement } from '@aws-cdk/ import * as cdk from '@aws-cdk/core'; // eslint-disable-next-line import/no-extraneous-dependencies import * as integ from '@aws-cdk/integ-tests'; -import { FileSystem } from '../lib'; +import { AccessPoint, FileSystem } from '../lib'; const app = new cdk.App(); const stack = new cdk.Stack(app, 'test-efs-integ'); @@ -26,12 +26,17 @@ const myFileSystemPolicy = new PolicyDocument({ })], }); -new FileSystem(stack, 'FileSystem', { +const fileSystem = new FileSystem(stack, 'FileSystem', { vpc, fileSystemPolicy: myFileSystemPolicy, }); +const accessPoint = new AccessPoint(stack, 'AccessPoint', { + fileSystem, +}); +cdk.Tags.of(accessPoint).add('Name', 'MyAccessPoint'); + new integ.IntegTest(app, 'FileSystemPolicyTest', { testCases: [stack], }); -app.synth(); \ No newline at end of file +app.synth(); diff --git a/packages/@aws-cdk/aws-efs/test/integ.efs.js.snapshot/cdk.out b/packages/@aws-cdk/aws-efs/test/integ.efs.js.snapshot/cdk.out index 588d7b269d34f..b72fef144f05c 100644 --- a/packages/@aws-cdk/aws-efs/test/integ.efs.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-efs/test/integ.efs.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"20.0.0"} \ No newline at end of file +{"version":"30.1.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-efs/test/integ.efs.js.snapshot/integ.json b/packages/@aws-cdk/aws-efs/test/integ.efs.js.snapshot/integ.json index 4d02881b45ff2..5092c4c2a994c 100644 --- a/packages/@aws-cdk/aws-efs/test/integ.efs.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-efs/test/integ.efs.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "20.0.0", + "version": "30.1.0", "testCases": { "integ.efs": { "stacks": [ diff --git a/packages/@aws-cdk/aws-efs/test/integ.efs.js.snapshot/manifest.json b/packages/@aws-cdk/aws-efs/test/integ.efs.js.snapshot/manifest.json index a38f0441c01ba..e46186a23e262 100644 --- a/packages/@aws-cdk/aws-efs/test/integ.efs.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-efs/test/integ.efs.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { - "version": "20.0.0", + "version": "30.1.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "test-efs-integ.assets": { "type": "cdk:asset-manifest", "properties": { @@ -23,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/5a176f99ace1339beed54ef48f307a4119e039540eec6e4f95196f9f2ce08b41.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/bf1856ec9969cccf2ed5dcc40acf92ce4870f877b88f68aa2813b3feb3c775af.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -209,6 +203,12 @@ ] }, "displayName": "test-efs-integ" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-efs/test/integ.efs.js.snapshot/test-efs-integ.assets.json b/packages/@aws-cdk/aws-efs/test/integ.efs.js.snapshot/test-efs-integ.assets.json index 6b72588d8271c..f6e5a2cd9a4ed 100644 --- a/packages/@aws-cdk/aws-efs/test/integ.efs.js.snapshot/test-efs-integ.assets.json +++ b/packages/@aws-cdk/aws-efs/test/integ.efs.js.snapshot/test-efs-integ.assets.json @@ -1,7 +1,7 @@ { - "version": "20.0.0", + "version": "30.1.0", "files": { - "5a176f99ace1339beed54ef48f307a4119e039540eec6e4f95196f9f2ce08b41": { + "bf1856ec9969cccf2ed5dcc40acf92ce4870f877b88f68aa2813b3feb3c775af": { "source": { "path": "test-efs-integ.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "5a176f99ace1339beed54ef48f307a4119e039540eec6e4f95196f9f2ce08b41.json", + "objectKey": "bf1856ec9969cccf2ed5dcc40acf92ce4870f877b88f68aa2813b3feb3c775af.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-efs/test/integ.efs.js.snapshot/test-efs-integ.template.json b/packages/@aws-cdk/aws-efs/test/integ.efs.js.snapshot/test-efs-integ.template.json index 3db99e3c0979d..ca89c3654f94a 100644 --- a/packages/@aws-cdk/aws-efs/test/integ.efs.js.snapshot/test-efs-integ.template.json +++ b/packages/@aws-cdk/aws-efs/test/integ.efs.js.snapshot/test-efs-integ.template.json @@ -435,6 +435,12 @@ "FileSystemId": { "Ref": "FileSystem8A8E25C0" }, + "AccessPointTags": [ + { + "Key": "Name", + "Value": "test-efs-integ/FileSystem/AccessPoint" + } + ], "PosixUser": { "Gid": "1000", "Uid": "1000" diff --git a/packages/@aws-cdk/aws-efs/test/integ.efs.js.snapshot/tree.json b/packages/@aws-cdk/aws-efs/test/integ.efs.js.snapshot/tree.json index 21c6134519363..ea1056800dbb4 100644 --- a/packages/@aws-cdk/aws-efs/test/integ.efs.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-efs/test/integ.efs.js.snapshot/tree.json @@ -4,14 +4,6 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" - } - }, "test-efs-integ": { "id": "test-efs-integ", "path": "test-efs-integ", @@ -91,8 +83,8 @@ "id": "Acl", "path": "test-efs-integ/Vpc/PublicSubnet1/Acl", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" } }, "RouteTable": { @@ -258,8 +250,8 @@ "id": "Acl", "path": "test-efs-integ/Vpc/PublicSubnet2/Acl", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" } }, "RouteTable": { @@ -377,8 +369,8 @@ "id": "Acl", "path": "test-efs-integ/Vpc/PrivateSubnet1/Acl", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" } }, "RouteTable": { @@ -496,8 +488,8 @@ "id": "Acl", "path": "test-efs-integ/Vpc/PrivateSubnet2/Acl", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" } }, "RouteTable": { @@ -742,6 +734,12 @@ "fileSystemId": { "Ref": "FileSystem8A8E25C0" }, + "accessPointTags": [ + { + "key": "Name", + "value": "test-efs-integ/FileSystem/AccessPoint" + } + ], "posixUser": { "uid": "1000", "gid": "1000" @@ -772,17 +770,41 @@ "fqn": "@aws-cdk/aws-efs.FileSystem", "version": "0.0.0" } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "test-efs-integ/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "test-efs-integ/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } } }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.85" + "version": "10.1.252" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-eks/README.md b/packages/@aws-cdk/aws-eks/README.md index e10cba101ec14..4b146e1d50d9c 100644 --- a/packages/@aws-cdk/aws-eks/README.md +++ b/packages/@aws-cdk/aws-eks/README.md @@ -1193,6 +1193,20 @@ cluster.addHelmChart('ExternalSecretsOperator', { }); ``` +Helm chart can come with Custom Resource Definitions (CRDs) defined that by default will be installed by helm as well. However in special cases it might be needed to skip the installation of CRDs, for that the property `skipCrds` can be used. + +```ts +declare const cluster: eks.Cluster; +// option 1: use a construct +new eks.HelmChart(this, 'NginxIngress', { + cluster, + chart: 'nginx-ingress', + repository: 'https://helm.nginx.com/stable', + namespace: 'kube-system', + skipCrds: true, +}); +``` + ### OCI Charts OCI charts are also supported. diff --git a/packages/@aws-cdk/aws-eks/lib/helm-chart.ts b/packages/@aws-cdk/aws-eks/lib/helm-chart.ts index 9dfebd5ac0715..40e062ff157bd 100644 --- a/packages/@aws-cdk/aws-eks/lib/helm-chart.ts +++ b/packages/@aws-cdk/aws-eks/lib/helm-chart.ts @@ -78,6 +78,12 @@ export interface HelmChartOptions { * @default true */ readonly createNamespace?: boolean; + + /** + * if set, no CRDs will be installed + * @default - CRDs are installed if not already present + */ + readonly skipCrds?: boolean; } /** @@ -129,6 +135,8 @@ export class HelmChart extends Construct { const wait = props.wait ?? false; // default to create new namespace const createNamespace = props.createNamespace ?? true; + // default to not skip crd installation + const skipCrds = props.skipCrds ?? false; props.chartAsset?.grantRead(provider.handlerRole); @@ -148,6 +156,7 @@ export class HelmChart extends Construct { Namespace: props.namespace ?? 'default', Repository: props.repository, CreateNamespace: createNamespace || undefined, + SkipCrds: skipCrds || undefined, }, }); } diff --git a/packages/@aws-cdk/aws-eks/lib/kubectl-handler/helm/__init__.py b/packages/@aws-cdk/aws-eks/lib/kubectl-handler/helm/__init__.py index 286976ced219a..34481f86a81d7 100644 --- a/packages/@aws-cdk/aws-eks/lib/kubectl-handler/helm/__init__.py +++ b/packages/@aws-cdk/aws-eks/lib/kubectl-handler/helm/__init__.py @@ -46,6 +46,7 @@ def helm_handler(event, context): create_namespace = props.get('CreateNamespace', None) repository = props.get('Repository', None) values_text = props.get('Values', None) + skip_crds = props.get('SkipCrds', False) # "log in" to the cluster subprocess.check_call([ 'aws', 'eks', 'update-kubeconfig', @@ -146,7 +147,7 @@ def get_chart_from_oci(tmpdir, repository = None, version = None): raise Exception(f'Operation failed after {maxAttempts} attempts: {output}') -def helm(verb, release, chart = None, repo = None, file = None, namespace = None, version = None, wait = False, timeout = None, create_namespace = None): +def helm(verb, release, chart = None, repo = None, file = None, namespace = None, version = None, wait = False, timeout = None, create_namespace = None, skip_crds = False): import subprocess cmnd = ['helm', verb, release] @@ -166,6 +167,8 @@ def helm(verb, release, chart = None, repo = None, file = None, namespace = None cmnd.extend(['--namespace', namespace]) if wait: cmnd.append('--wait') + if skip_crds: + cmnd.append('--skip-crds') if not timeout is None: cmnd.extend(['--timeout', timeout]) cmnd.extend(['--kubeconfig', kubeconfig]) diff --git a/packages/@aws-cdk/aws-eks/package.json b/packages/@aws-cdk/aws-eks/package.json index a42cda8ebb6a6..479e774d254a0 100644 --- a/packages/@aws-cdk/aws-eks/package.json +++ b/packages/@aws-cdk/aws-eks/package.json @@ -80,7 +80,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/lambda-layer-kubectl-v24": "^2.0.100", + "@aws-cdk/lambda-layer-kubectl-v24": "^2.0.113", "aws-cdk-lib": "2.47.0", "@aws-cdk/assertions": "0.0.0", "@aws-cdk/cdk-build-tools": "0.0.0", @@ -88,13 +88,13 @@ "@aws-cdk/integ-tests": "0.0.0", "@aws-cdk/cfn2ts": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/aws-lambda": "^8.10.110", + "@types/aws-lambda": "^8.10.111", "@types/jest": "^27.5.2", "@types/sinon": "^9.0.11", "@types/yaml": "1.9.6", - "aws-sdk": "^2.1317.0", - "cdk8s": "^2.7.2", - "cdk8s-plus-24": "2.4.23", + "aws-sdk": "^2.1325.0", + "cdk8s": "^2.7.15", + "cdk8s-plus-24": "2.4.40", "jest": "^27.5.1", "sinon": "^9.2.4" }, diff --git a/packages/@aws-cdk/aws-eks/test/helm-chart.test.ts b/packages/@aws-cdk/aws-eks/test/helm-chart.test.ts index 6da8b851174eb..3587d4071bb2d 100644 --- a/packages/@aws-cdk/aws-eks/test/helm-chart.test.ts +++ b/packages/@aws-cdk/aws-eks/test/helm-chart.test.ts @@ -226,5 +226,27 @@ describe('helm chart', () => { // THEN Template.fromStack(stack).hasResourceProperties(eks.HelmChart.RESOURCE_TYPE, { Timeout: '600s' }); }); + + test('should disable skip crds by default', () => { + // GIVEN + const { stack, cluster } = testFixtureCluster(); + + // WHEN + new eks.HelmChart(stack, 'MyChart', { cluster, chart: 'chart' }); + + // THEN + const charts = Template.fromStack(stack).findResources(eks.HelmChart.RESOURCE_TYPE, { SkipCrds: false }); + expect(Object.keys(charts).length).toEqual(0); + }); + test('should enable atomic operations when specified', () => { + // GIVEN + const { stack, cluster } = testFixtureCluster(); + + // WHEN + new eks.HelmChart(stack, 'MyAtomicChart', { cluster, chart: 'chart', skipCrds: true }); + + // THEN + Template.fromStack(stack).hasResourceProperties(eks.HelmChart.RESOURCE_TYPE, { SkipCrds: true }); + }); }); }); diff --git a/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/asset.ad44c2b0638f04871c889d78e71dea90ffae67b9cc4aa4366d5102db42435ee1.zip b/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/asset.ad44c2b0638f04871c889d78e71dea90ffae67b9cc4aa4366d5102db42435ee1.zip index 13983109fc5f5..5f4ba6c9291d8 100644 Binary files a/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/asset.ad44c2b0638f04871c889d78e71dea90ffae67b9cc4aa4366d5102db42435ee1.zip and b/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/asset.ad44c2b0638f04871c889d78e71dea90ffae67b9cc4aa4366d5102db42435ee1.zip differ diff --git a/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip b/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip index 9bf8ba72b34ab..6cab68362ec21 100644 Binary files a/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip and b/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/asset.c475180f5b1bbabac165414da13a9b843b111cd3b6d5fae9c954c006640c4064.zip differ diff --git a/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/asset.5d8d1d0aacea23824c62f362e1e3c14b7dd14a31c71b53bfae4d14a6373c5510.zip b/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/asset.c9455aefa243f3cd7a810b3f6df8ed37e457d3e1d046353da27c4aa13551d4dc.zip similarity index 67% rename from packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/asset.5d8d1d0aacea23824c62f362e1e3c14b7dd14a31c71b53bfae4d14a6373c5510.zip rename to packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/asset.c9455aefa243f3cd7a810b3f6df8ed37e457d3e1d046353da27c4aa13551d4dc.zip index f62fe1e5a06d6..6b4e14c2e2d00 100644 Binary files a/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/asset.5d8d1d0aacea23824c62f362e1e3c14b7dd14a31c71b53bfae4d14a6373c5510.zip and b/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/asset.c9455aefa243f3cd7a810b3f6df8ed37e457d3e1d046353da27c4aa13551d4dc.zip differ diff --git a/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/aws-cdk-eks-cluster-test.assets.json b/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/aws-cdk-eks-cluster-test.assets.json index 1c482d6bacdb4..fafedf85d4a75 100644 --- a/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/aws-cdk-eks-cluster-test.assets.json +++ b/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/aws-cdk-eks-cluster-test.assets.json @@ -71,15 +71,15 @@ } } }, - "5d8d1d0aacea23824c62f362e1e3c14b7dd14a31c71b53bfae4d14a6373c5510": { + "c9455aefa243f3cd7a810b3f6df8ed37e457d3e1d046353da27c4aa13551d4dc": { "source": { - "path": "asset.5d8d1d0aacea23824c62f362e1e3c14b7dd14a31c71b53bfae4d14a6373c5510.zip", + "path": "asset.c9455aefa243f3cd7a810b3f6df8ed37e457d3e1d046353da27c4aa13551d4dc.zip", "packaging": "file" }, "destinations": { "current_account-us-east-1": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1", - "objectKey": "5d8d1d0aacea23824c62f362e1e3c14b7dd14a31c71b53bfae4d14a6373c5510.zip", + "objectKey": "c9455aefa243f3cd7a810b3f6df8ed37e457d3e1d046353da27c4aa13551d4dc.zip", "region": "us-east-1", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-us-east-1" } @@ -141,7 +141,7 @@ } } }, - "8036bc5a59e7909aeeb9b09610d5b223033cd2bff3abae01c6b616800daf868f": { + "67a3aa529ec1ed1816a4cf80820b64e8664fc647e3c49f45996ed25b332e7d07": { "source": { "path": "awscdkeksclustertestawscdkawseksKubectlProviderE05943BF.nested.template.json", "packaging": "file" @@ -149,13 +149,13 @@ "destinations": { "current_account-us-east-1": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1", - "objectKey": "8036bc5a59e7909aeeb9b09610d5b223033cd2bff3abae01c6b616800daf868f.json", + "objectKey": "67a3aa529ec1ed1816a4cf80820b64e8664fc647e3c49f45996ed25b332e7d07.json", "region": "us-east-1", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-us-east-1" } } }, - "3d2522af747fc8da02b4f2bc4496653d3df949b859ad847b25a3fbc06fb24df2": { + "6782a2a042fa36c961aad9bb00a06c22bfc03046118bf097208ad738af93cbe7": { "source": { "path": "aws-cdk-eks-cluster-test.template.json", "packaging": "file" @@ -163,7 +163,7 @@ "destinations": { "current_account-us-east-1": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1", - "objectKey": "3d2522af747fc8da02b4f2bc4496653d3df949b859ad847b25a3fbc06fb24df2.json", + "objectKey": "6782a2a042fa36c961aad9bb00a06c22bfc03046118bf097208ad738af93cbe7.json", "region": "us-east-1", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-us-east-1" } diff --git a/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/aws-cdk-eks-cluster-test.template.json b/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/aws-cdk-eks-cluster-test.template.json index 651be5f73a751..ed7cc1de372b2 100644 --- a/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/aws-cdk-eks-cluster-test.template.json +++ b/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/aws-cdk-eks-cluster-test.template.json @@ -3019,11 +3019,11 @@ "Fn::Join": [ "", [ - "[{\"apiVersion\":\"v1\",\"kind\":\"ConfigMap\",\"data\":{\"clusterName\":\"", + "[{\"apiVersion\":\"v1\",\"kind\":\"ConfigMap\",\"metadata\":{\"name\":\"chart-config-map-c820e51c\",\"labels\":{\"aws.cdk.eks/prune-c89c99db0e333353528b2e912b1fb988b6870edc75\":\"\"}},\"data\":{\"clusterName\":\"", { "Ref": "Cluster9EE0221C" }, - "\"},\"immutable\":false,\"metadata\":{\"name\":\"chart-config-map-c820e51c\",\"labels\":{\"aws.cdk.eks/prune-c89c99db0e333353528b2e912b1fb988b6870edc75\":\"\"}}}]" + "\"},\"immutable\":false}]" ] ] }, @@ -3406,7 +3406,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1" }, - "/8036bc5a59e7909aeeb9b09610d5b223033cd2bff3abae01c6b616800daf868f.json" + "/67a3aa529ec1ed1816a4cf80820b64e8664fc647e3c49f45996ed25b332e7d07.json" ] ] }, diff --git a/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/awscdkeksclustertestawscdkawseksKubectlProviderE05943BF.nested.template.json b/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/awscdkeksclustertestawscdkawseksKubectlProviderE05943BF.nested.template.json index efbd392c372a2..5bd4e0d860851 100644 --- a/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/awscdkeksclustertestawscdkawseksKubectlProviderE05943BF.nested.template.json +++ b/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/awscdkeksclustertestawscdkawseksKubectlProviderE05943BF.nested.template.json @@ -186,7 +186,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1" }, - "S3Key": "5d8d1d0aacea23824c62f362e1e3c14b7dd14a31c71b53bfae4d14a6373c5510.zip" + "S3Key": "c9455aefa243f3cd7a810b3f6df8ed37e457d3e1d046353da27c4aa13551d4dc.zip" }, "Description": "/opt/awscli/aws" } diff --git a/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/manifest.json b/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/manifest.json index 04efc8ae44d15..3bea8fd594551 100644 --- a/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/manifest.json @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-us-east-1", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-us-east-1", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1/3d2522af747fc8da02b4f2bc4496653d3df949b859ad847b25a3fbc06fb24df2.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1/6782a2a042fa36c961aad9bb00a06c22bfc03046118bf097208ad738af93cbe7.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/tree.json b/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/tree.json index ce3ff96298b44..e294b91873431 100644 --- a/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-eks/test/integ.eks-cluster.js.snapshot/tree.json @@ -798,7 +798,7 @@ }, "constructInfo": { "fqn": "@aws-cdk/lambda-layer-kubectl-v24.KubectlV24Layer", - "version": "2.0.100" + "version": "2.0.108" } }, "Cluster": { @@ -1197,7 +1197,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.252" + "version": "10.1.259" } }, "KubectlReadyBarrier": { @@ -5557,7 +5557,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.252" + "version": "10.1.259" } } }, @@ -5632,7 +5632,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.252" + "version": "10.1.259" } }, "@aws-cdk--aws-eks.KubectlProvider": { @@ -5942,7 +5942,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1" }, - "s3Key": "5d8d1d0aacea23824c62f362e1e3c14b7dd14a31c71b53bfae4d14a6373c5510.zip" + "s3Key": "c9455aefa243f3cd7a810b3f6df8ed37e457d3e1d046353da27c4aa13551d4dc.zip" }, "description": "/opt/awscli/aws" } @@ -6271,7 +6271,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1" }, - "/8036bc5a59e7909aeeb9b09610d5b223033cd2bff3abae01c6b616800daf868f.json" + "/67a3aa529ec1ed1816a4cf80820b64e8664fc647e3c49f45996ed25b332e7d07.json" ] ] }, @@ -6314,7 +6314,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.252" + "version": "10.1.259" } }, "SsmParameterValue:--aws--service--eks--optimized-ami--1.24--amazon-linux-2--recommended--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": { @@ -6618,7 +6618,7 @@ "path": "aws-cdk-eks-cluster/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.252" + "version": "10.1.259" } }, "DeployAssert": { @@ -6664,7 +6664,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.252" + "version": "10.1.259" } } }, diff --git a/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.c17e6c5822dd39738b3ba669bef4bb7c8fceaea76b51477bf94d6745d0c201c8/apply/__init__.py b/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.92ea03f8b2e779503519f7781d06c03f95b46863db85f5c50a4e7debfd04be02/apply/__init__.py similarity index 100% rename from packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.c17e6c5822dd39738b3ba669bef4bb7c8fceaea76b51477bf94d6745d0c201c8/apply/__init__.py rename to packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.92ea03f8b2e779503519f7781d06c03f95b46863db85f5c50a4e7debfd04be02/apply/__init__.py diff --git a/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.c17e6c5822dd39738b3ba669bef4bb7c8fceaea76b51477bf94d6745d0c201c8/get/__init__.py b/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.92ea03f8b2e779503519f7781d06c03f95b46863db85f5c50a4e7debfd04be02/get/__init__.py similarity index 100% rename from packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.c17e6c5822dd39738b3ba669bef4bb7c8fceaea76b51477bf94d6745d0c201c8/get/__init__.py rename to packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.92ea03f8b2e779503519f7781d06c03f95b46863db85f5c50a4e7debfd04be02/get/__init__.py diff --git a/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.c17e6c5822dd39738b3ba669bef4bb7c8fceaea76b51477bf94d6745d0c201c8/helm/__init__.py b/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.92ea03f8b2e779503519f7781d06c03f95b46863db85f5c50a4e7debfd04be02/helm/__init__.py similarity index 98% rename from packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.c17e6c5822dd39738b3ba669bef4bb7c8fceaea76b51477bf94d6745d0c201c8/helm/__init__.py rename to packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.92ea03f8b2e779503519f7781d06c03f95b46863db85f5c50a4e7debfd04be02/helm/__init__.py index 286976ced219a..34481f86a81d7 100644 --- a/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.c17e6c5822dd39738b3ba669bef4bb7c8fceaea76b51477bf94d6745d0c201c8/helm/__init__.py +++ b/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.92ea03f8b2e779503519f7781d06c03f95b46863db85f5c50a4e7debfd04be02/helm/__init__.py @@ -46,6 +46,7 @@ def helm_handler(event, context): create_namespace = props.get('CreateNamespace', None) repository = props.get('Repository', None) values_text = props.get('Values', None) + skip_crds = props.get('SkipCrds', False) # "log in" to the cluster subprocess.check_call([ 'aws', 'eks', 'update-kubeconfig', @@ -146,7 +147,7 @@ def get_chart_from_oci(tmpdir, repository = None, version = None): raise Exception(f'Operation failed after {maxAttempts} attempts: {output}') -def helm(verb, release, chart = None, repo = None, file = None, namespace = None, version = None, wait = False, timeout = None, create_namespace = None): +def helm(verb, release, chart = None, repo = None, file = None, namespace = None, version = None, wait = False, timeout = None, create_namespace = None, skip_crds = False): import subprocess cmnd = ['helm', verb, release] @@ -166,6 +167,8 @@ def helm(verb, release, chart = None, repo = None, file = None, namespace = None cmnd.extend(['--namespace', namespace]) if wait: cmnd.append('--wait') + if skip_crds: + cmnd.append('--skip-crds') if not timeout is None: cmnd.extend(['--timeout', timeout]) cmnd.extend(['--kubeconfig', kubeconfig]) diff --git a/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.c17e6c5822dd39738b3ba669bef4bb7c8fceaea76b51477bf94d6745d0c201c8/index.py b/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.92ea03f8b2e779503519f7781d06c03f95b46863db85f5c50a4e7debfd04be02/index.py similarity index 100% rename from packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.c17e6c5822dd39738b3ba669bef4bb7c8fceaea76b51477bf94d6745d0c201c8/index.py rename to packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.92ea03f8b2e779503519f7781d06c03f95b46863db85f5c50a4e7debfd04be02/index.py diff --git a/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.c17e6c5822dd39738b3ba669bef4bb7c8fceaea76b51477bf94d6745d0c201c8/patch/__init__.py b/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.92ea03f8b2e779503519f7781d06c03f95b46863db85f5c50a4e7debfd04be02/patch/__init__.py similarity index 100% rename from packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.c17e6c5822dd39738b3ba669bef4bb7c8fceaea76b51477bf94d6745d0c201c8/patch/__init__.py rename to packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/asset.92ea03f8b2e779503519f7781d06c03f95b46863db85f5c50a4e7debfd04be02/patch/__init__.py diff --git a/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/aws-cdk-eks-helm-test.assets.json b/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/aws-cdk-eks-helm-test.assets.json index 11e0e1b19d794..7264badd715f4 100644 --- a/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/aws-cdk-eks-helm-test.assets.json +++ b/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/aws-cdk-eks-helm-test.assets.json @@ -53,15 +53,15 @@ } } }, - "c17e6c5822dd39738b3ba669bef4bb7c8fceaea76b51477bf94d6745d0c201c8": { + "92ea03f8b2e779503519f7781d06c03f95b46863db85f5c50a4e7debfd04be02": { "source": { - "path": "asset.c17e6c5822dd39738b3ba669bef4bb7c8fceaea76b51477bf94d6745d0c201c8", + "path": "asset.92ea03f8b2e779503519f7781d06c03f95b46863db85f5c50a4e7debfd04be02", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "c17e6c5822dd39738b3ba669bef4bb7c8fceaea76b51477bf94d6745d0c201c8.zip", + "objectKey": "92ea03f8b2e779503519f7781d06c03f95b46863db85f5c50a4e7debfd04be02.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -105,7 +105,7 @@ } } }, - "75cb3907a84a56903beb94d07a13f98c8f205e4c2592eca626920d0e31119d45": { + "228d4002689856d23e839fb690137b828253b51ab0ba4bd84b6ff0d65e1c23ca": { "source": { "path": "awscdkekshelmtestawscdkawseksKubectlProvider207F42E4.nested.template.json", "packaging": "file" @@ -113,12 +113,12 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "75cb3907a84a56903beb94d07a13f98c8f205e4c2592eca626920d0e31119d45.json", + "objectKey": "228d4002689856d23e839fb690137b828253b51ab0ba4bd84b6ff0d65e1c23ca.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "60857bca8b2d47131d19f9e53e3cfc304441787c56ab3ca35883021a9924a793": { + "efe0e6bc3feeea333864740608c04489da76bd20395f877733932bad8ccc7a66": { "source": { "path": "aws-cdk-eks-helm-test.template.json", "packaging": "file" @@ -126,7 +126,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "60857bca8b2d47131d19f9e53e3cfc304441787c56ab3ca35883021a9924a793.json", + "objectKey": "efe0e6bc3feeea333864740608c04489da76bd20395f877733932bad8ccc7a66.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/aws-cdk-eks-helm-test.template.json b/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/aws-cdk-eks-helm-test.template.json index faba886e3e890..29e21c9df3b32 100644 --- a/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/aws-cdk-eks-helm-test.template.json +++ b/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/aws-cdk-eks-helm-test.template.json @@ -973,6 +973,38 @@ "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, + "ClustercharttestskipcrdinstallationB8323954": { + "Type": "Custom::AWSCDK-EKS-HelmChart", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B", + "Outputs.awscdkekshelmtestawscdkawseksKubectlProviderframeworkonEvent9D93C644Arn" + ] + }, + "ClusterName": { + "Ref": "Cluster9EE0221C" + }, + "RoleArn": { + "Fn::GetAtt": [ + "ClusterCreationRole360249B6", + "Arn" + ] + }, + "Release": "lambda-chart-release", + "Chart": "lambda-chart", + "Version": "v0.1.4", + "Namespace": "ack-system", + "Repository": "oci://public.ecr.aws/aws-controllers-k8s/lambda-chart", + "CreateNamespace": true, + "SkipCrds": true + }, + "DependsOn": [ + "ClusterKubectlReadyBarrier200052AF" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, "awscdkawseksClusterResourceProviderNestedStackawscdkawseksClusterResourceProviderNestedStackResource9827C454": { "Type": "AWS::CloudFormation::Stack", "Properties": { @@ -1027,7 +1059,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/75cb3907a84a56903beb94d07a13f98c8f205e4c2592eca626920d0e31119d45.json" + "/228d4002689856d23e839fb690137b828253b51ab0ba4bd84b6ff0d65e1c23ca.json" ] ] }, diff --git a/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/awscdkekshelmtestawscdkawseksKubectlProvider207F42E4.nested.template.json b/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/awscdkekshelmtestawscdkawseksKubectlProvider207F42E4.nested.template.json index 933401166ba6a..1d645caa5c219 100644 --- a/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/awscdkekshelmtestawscdkawseksKubectlProvider207F42E4.nested.template.json +++ b/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/awscdkekshelmtestawscdkawseksKubectlProvider207F42E4.nested.template.json @@ -145,7 +145,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "c17e6c5822dd39738b3ba669bef4bb7c8fceaea76b51477bf94d6745d0c201c8.zip" + "S3Key": "92ea03f8b2e779503519f7781d06c03f95b46863db85f5c50a4e7debfd04be02.zip" }, "Role": { "Fn::GetAtt": [ diff --git a/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/manifest.json b/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/manifest.json index 6e2dc2a0a68c6..1d20823d73040 100644 --- a/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/manifest.json @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/60857bca8b2d47131d19f9e53e3cfc304441787c56ab3ca35883021a9924a793.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/efe0e6bc3feeea333864740608c04489da76bd20395f877733932bad8ccc7a66.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -255,6 +255,12 @@ "data": "Clustercharttestocichartdifferentreleasename6D3FD1A1" } ], + "/aws-cdk-eks-helm-test/Cluster/chart-test-skip-crd-installation/Resource/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "ClustercharttestskipcrdinstallationB8323954" + } + ], "/aws-cdk-eks-helm-test/@aws-cdk--aws-eks.ClusterResourceProvider/NodeProxyAgentLayer/Resource": [ { "type": "aws:cdk:logicalId", diff --git a/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/tree.json b/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/tree.json index 8091d68af0fde..3fb0075876cea 100644 --- a/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.js.snapshot/tree.json @@ -1306,6 +1306,34 @@ "fqn": "@aws-cdk/aws-eks.HelmChart", "version": "0.0.0" } + }, + "chart-test-skip-crd-installation": { + "id": "chart-test-skip-crd-installation", + "path": "aws-cdk-eks-helm-test/Cluster/chart-test-skip-crd-installation", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-eks-helm-test/Cluster/chart-test-skip-crd-installation/Resource", + "children": { + "Default": { + "id": "Default", + "path": "aws-cdk-eks-helm-test/Cluster/chart-test-skip-crd-installation/Resource/Default", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-eks.HelmChart", + "version": "0.0.0" + } } }, "constructInfo": { @@ -2833,7 +2861,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "c17e6c5822dd39738b3ba669bef4bb7c8fceaea76b51477bf94d6745d0c201c8.zip" + "s3Key": "92ea03f8b2e779503519f7781d06c03f95b46863db85f5c50a4e7debfd04be02.zip" }, "role": { "Fn::GetAtt": [ @@ -3255,7 +3283,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/75cb3907a84a56903beb94d07a13f98c8f205e4c2592eca626920d0e31119d45.json" + "/228d4002689856d23e839fb690137b828253b51ab0ba4bd84b6ff0d65e1c23ca.json" ] ] }, diff --git a/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.ts b/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.ts index afda984814487..f266123a6c6c8 100644 --- a/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.ts +++ b/packages/@aws-cdk/aws-eks/test/integ.eks-helm-asset.ts @@ -76,6 +76,17 @@ class EksClusterStack extends Stack { namespace: 'ack-system', createNamespace: true, }); + + // testing the disable mechanism of the installation of CRDs + this.cluster.addHelmChart('test-skip-crd-installation', { + chart: 'lambda-chart', + release: 'lambda-chart-release', + repository: 'oci://public.ecr.aws/aws-controllers-k8s/lambda-chart', + version: 'v0.1.4', + namespace: 'ack-system', + createNamespace: true, + skipCrds: true, + }); } } diff --git a/packages/@aws-cdk/aws-eks/test/sdk-call-integ-test-docker-app/app/package.json b/packages/@aws-cdk/aws-eks/test/sdk-call-integ-test-docker-app/app/package.json index e8c7bde1b56a1..e954bcb2b77e7 100644 --- a/packages/@aws-cdk/aws-eks/test/sdk-call-integ-test-docker-app/app/package.json +++ b/packages/@aws-cdk/aws-eks/test/sdk-call-integ-test-docker-app/app/package.json @@ -2,6 +2,6 @@ "name": "eks-service-account-sdk-call-integ-test", "private": "true", "dependencies": { - "aws-sdk": "^2.1313.0" + "aws-sdk": "^2.1325.0" } } diff --git a/packages/@aws-cdk/aws-events-targets/package.json b/packages/@aws-cdk/aws-events-targets/package.json index 552362b73046c..3455b64b3521f 100644 --- a/packages/@aws-cdk/aws-events-targets/package.json +++ b/packages/@aws-cdk/aws-events-targets/package.json @@ -89,7 +89,7 @@ "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", "@types/jest": "^27.5.2", - "aws-sdk": "^2.1317.0", + "aws-sdk": "^2.1325.0", "aws-sdk-mock": "5.6.0", "jest": "^27.5.1" }, diff --git a/packages/@aws-cdk/aws-gamelift/test/integ.game-server-group.js.snapshot/GameServerGroupDefaultTestDeployAssertA631B19B.assets.json b/packages/@aws-cdk/aws-gamelift/test/integ.game-server-group.js.snapshot/GameServerGroupDefaultTestDeployAssertA631B19B.assets.json index f7fa24e781380..91ef9038e0724 100644 --- a/packages/@aws-cdk/aws-gamelift/test/integ.game-server-group.js.snapshot/GameServerGroupDefaultTestDeployAssertA631B19B.assets.json +++ b/packages/@aws-cdk/aws-gamelift/test/integ.game-server-group.js.snapshot/GameServerGroupDefaultTestDeployAssertA631B19B.assets.json @@ -1,5 +1,5 @@ { - "version": "21.0.0", + "version": "22.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk/aws-gamelift/test/integ.game-server-group.js.snapshot/aws-gamelift-game-server-group.assets.json b/packages/@aws-cdk/aws-gamelift/test/integ.game-server-group.js.snapshot/aws-gamelift-game-server-group.assets.json index 5d2d42f94c1eb..3d77e4130511e 100644 --- a/packages/@aws-cdk/aws-gamelift/test/integ.game-server-group.js.snapshot/aws-gamelift-game-server-group.assets.json +++ b/packages/@aws-cdk/aws-gamelift/test/integ.game-server-group.js.snapshot/aws-gamelift-game-server-group.assets.json @@ -1,7 +1,7 @@ { - "version": "21.0.0", + "version": "22.0.0", "files": { - "0233f946355da9a29bd7caaf5049caf4cd4e71dfa10d084bd5ff56e547903847": { + "aea05f75441842463319434840166da7e1c6156dbb321d52b22c5ec2174adfc2": { "source": { "path": "aws-gamelift-game-server-group.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "0233f946355da9a29bd7caaf5049caf4cd4e71dfa10d084bd5ff56e547903847.json", + "objectKey": "aea05f75441842463319434840166da7e1c6156dbb321d52b22c5ec2174adfc2.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-gamelift/test/integ.game-server-group.js.snapshot/aws-gamelift-game-server-group.template.json b/packages/@aws-cdk/aws-gamelift/test/integ.game-server-group.js.snapshot/aws-gamelift-game-server-group.template.json index 451002608b0dc..85efe09357b4f 100644 --- a/packages/@aws-cdk/aws-gamelift/test/integ.game-server-group.js.snapshot/aws-gamelift-game-server-group.template.json +++ b/packages/@aws-cdk/aws-gamelift/test/integ.game-server-group.js.snapshot/aws-gamelift-game-server-group.template.json @@ -417,7 +417,10 @@ } ] } - ] + ], + "UserData": { + "Fn::Base64": "#!/bin/bash" + } }, "TagSpecifications": [ { diff --git a/packages/@aws-cdk/aws-gamelift/test/integ.game-server-group.js.snapshot/cdk.out b/packages/@aws-cdk/aws-gamelift/test/integ.game-server-group.js.snapshot/cdk.out index 8ecc185e9dbee..145739f539580 100644 --- a/packages/@aws-cdk/aws-gamelift/test/integ.game-server-group.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-gamelift/test/integ.game-server-group.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"21.0.0"} \ No newline at end of file +{"version":"22.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-gamelift/test/integ.game-server-group.js.snapshot/integ.json b/packages/@aws-cdk/aws-gamelift/test/integ.game-server-group.js.snapshot/integ.json index 7dfb7ecf345df..cae6781e9e083 100644 --- a/packages/@aws-cdk/aws-gamelift/test/integ.game-server-group.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-gamelift/test/integ.game-server-group.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "21.0.0", + "version": "22.0.0", "testCases": { "GameServerGroup/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk/aws-gamelift/test/integ.game-server-group.js.snapshot/manifest.json b/packages/@aws-cdk/aws-gamelift/test/integ.game-server-group.js.snapshot/manifest.json index 97bde0478466e..3dcafd41299d3 100644 --- a/packages/@aws-cdk/aws-gamelift/test/integ.game-server-group.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-gamelift/test/integ.game-server-group.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { - "version": "21.0.0", + "version": "22.0.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "aws-gamelift-game-server-group.assets": { "type": "cdk:asset-manifest", "properties": { @@ -23,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/0233f946355da9a29bd7caaf5049caf4cd4e71dfa10d084bd5ff56e547903847.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/aea05f75441842463319434840166da7e1c6156dbb321d52b22c5ec2174adfc2.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -262,6 +256,12 @@ ] }, "displayName": "GameServerGroup/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-gamelift/test/integ.game-server-group.js.snapshot/tree.json b/packages/@aws-cdk/aws-gamelift/test/integ.game-server-group.js.snapshot/tree.json index 486d29aa67194..eaab485b51630 100644 --- a/packages/@aws-cdk/aws-gamelift/test/integ.game-server-group.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-gamelift/test/integ.game-server-group.js.snapshot/tree.json @@ -4,14 +4,6 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.140" - } - }, "aws-gamelift-game-server-group": { "id": "aws-gamelift-game-server-group", "path": "aws-gamelift-game-server-group", @@ -692,7 +684,10 @@ } ] } - ] + ], + "userData": { + "Fn::Base64": "#!/bin/bash" + } }, "tagSpecifications": [ { @@ -742,6 +737,14 @@ "id": "ServiceRole", "path": "aws-gamelift-game-server-group/MyGameServerGroup/ServiceRole", "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "aws-gamelift-game-server-group/MyGameServerGroup/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "aws-gamelift-game-server-group/MyGameServerGroup/ServiceRole/Resource", @@ -846,6 +849,22 @@ "fqn": "@aws-cdk/aws-gamelift.GameServerGroup", "version": "0.0.0" } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-gamelift-game-server-group/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-gamelift-game-server-group/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } } }, "constructInfo": { @@ -866,12 +885,30 @@ "path": "GameServerGroup/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.140" + "version": "10.1.189" } }, "DeployAssert": { "id": "DeployAssert", "path": "GameServerGroup/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "GameServerGroup/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "GameServerGroup/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, "constructInfo": { "fqn": "@aws-cdk/core.Stack", "version": "0.0.0" @@ -888,6 +925,14 @@ "fqn": "@aws-cdk/integ-tests.IntegTest", "version": "0.0.0" } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.189" + } } }, "constructInfo": { diff --git a/packages/@aws-cdk/aws-globalaccelerator-endpoints/package.json b/packages/@aws-cdk/aws-globalaccelerator-endpoints/package.json index 2a9c7bac3b8e6..2f1f657b94807 100644 --- a/packages/@aws-cdk/aws-globalaccelerator-endpoints/package.json +++ b/packages/@aws-cdk/aws-globalaccelerator-endpoints/package.json @@ -81,7 +81,7 @@ "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", "@types/jest": "^27.5.2", - "aws-sdk": "^2.1317.0", + "aws-sdk": "^2.1325.0", "aws-sdk-mock": "5.6.0", "jest": "^27.5.1" }, diff --git a/packages/@aws-cdk/aws-iam/lib/group.ts b/packages/@aws-cdk/aws-iam/lib/group.ts index 0b81c6c572158..850c9a4a660d1 100644 --- a/packages/@aws-cdk/aws-iam/lib/group.ts +++ b/packages/@aws-cdk/aws-iam/lib/group.ts @@ -1,4 +1,4 @@ -import { ArnFormat, Lazy, Resource, Stack } from '@aws-cdk/core'; +import { Annotations, ArnFormat, Lazy, Resource, Stack } from '@aws-cdk/core'; import { Construct } from 'constructs'; import { CfnGroup } from './iam.generated'; import { IIdentity } from './identity-base'; @@ -200,14 +200,25 @@ export class Group extends GroupBase { // Removes leading slash from path resourceName: `${props.path ? props.path.substr(props.path.charAt(0) === '/' ? 1 : 0) : ''}${this.physicalName}`, }); + + this.managedPoliciesExceededWarning(); } /** - * Attaches a managed policy to this group. + * Attaches a managed policy to this group. See [IAM and AWS STS quotas, name requirements, and character limits] + * (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-quotas-entities) + * for quota of managed policies attached to an IAM group. * @param policy The managed policy to attach. */ public addManagedPolicy(policy: IManagedPolicy) { if (this.managedPolicies.find(mp => mp === policy)) { return; } this.managedPolicies.push(policy); + this.managedPoliciesExceededWarning(); + } + + private managedPoliciesExceededWarning() { + if (this.managedPolicies.length > 10) { + Annotations.of(this).addWarning(`You added ${this.managedPolicies.length} to IAM Group ${this.physicalName}. The maximum number of managed policies attached to an IAM group is 10.`); + } } } diff --git a/packages/@aws-cdk/aws-iam/package.json b/packages/@aws-cdk/aws-iam/package.json index f42f7619e20d2..22800ec1f5fad 100644 --- a/packages/@aws-cdk/aws-iam/package.json +++ b/packages/@aws-cdk/aws-iam/package.json @@ -86,7 +86,7 @@ "@aws-cdk/integ-tests": "0.0.0", "@aws-cdk/cfn2ts": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/aws-lambda": "^8.10.110", + "@types/aws-lambda": "^8.10.111", "@types/jest": "^27.5.2", "@types/sinon": "^9.0.11", "jest": "^27.5.1", diff --git a/packages/@aws-cdk/aws-iam/test/group.test.ts b/packages/@aws-cdk/aws-iam/test/group.test.ts index 6d0a4e83e05cc..7ea6580d51ea9 100644 --- a/packages/@aws-cdk/aws-iam/test/group.test.ts +++ b/packages/@aws-cdk/aws-iam/test/group.test.ts @@ -1,4 +1,4 @@ -import { Template } from '@aws-cdk/assertions'; +import { Annotations, Template } from '@aws-cdk/assertions'; import { App, CfnResource, Stack } from '@aws-cdk/core'; import { Group, ManagedPolicy, User } from '../lib'; @@ -103,3 +103,44 @@ test('cross-env group ARNs include path', () => { }, }); }); + +test('throw warning if attached managed policies exceed 10 in constructor', () => { + // GIVEN + const stack = new Stack(); + + // WHEN + new Group(stack, 'MyGroup', { + groupName: 'MyGroup', + managedPolicies: [ + ManagedPolicy.fromAwsManagedPolicyName('0'), + ManagedPolicy.fromAwsManagedPolicyName('1'), + ManagedPolicy.fromAwsManagedPolicyName('2'), + ManagedPolicy.fromAwsManagedPolicyName('3'), + ManagedPolicy.fromAwsManagedPolicyName('4'), + ManagedPolicy.fromAwsManagedPolicyName('5'), + ManagedPolicy.fromAwsManagedPolicyName('6'), + ManagedPolicy.fromAwsManagedPolicyName('7'), + ManagedPolicy.fromAwsManagedPolicyName('8'), + ManagedPolicy.fromAwsManagedPolicyName('9'), + ManagedPolicy.fromAwsManagedPolicyName('10'), + ], + }); + + Annotations.fromStack(stack).hasWarning('*', 'You added 11 to IAM Group MyGroup. The maximum number of managed policies attached to an IAM group is 10.'); +}); + +test('throw warning if attached managed policies exceed 10 when calling `addManagedPolicy`', () => { + // GIVEN + const stack = new Stack(); + + // WHEN + const group = new Group(stack, 'MyGroup', { + groupName: 'MyGroup', + }); + + for (let i = 0; i <= 11; i++) { + group.addManagedPolicy(ManagedPolicy.fromAwsManagedPolicyName(i.toString())); + } + + Annotations.fromStack(stack).hasWarning('/Default/MyGroup', 'You added 11 to IAM Group MyGroup. The maximum number of managed policies attached to an IAM group is 10.'); +}); diff --git a/packages/@aws-cdk/aws-lambda-nodejs/package.json b/packages/@aws-cdk/aws-lambda-nodejs/package.json index c0a233f9b1e00..d84acd65d1fde 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/package.json +++ b/packages/@aws-cdk/aws-lambda-nodejs/package.json @@ -81,7 +81,7 @@ "@aws-cdk/triggers": "0.0.0", "@types/jest": "^27.5.2", "delay": "5.0.0", - "esbuild": "^0.17.8" + "esbuild": "^0.17.10" }, "dependencies": { "@aws-cdk/aws-lambda": "0.0.0", diff --git a/packages/@aws-cdk/aws-lambda/package.json b/packages/@aws-cdk/aws-lambda/package.json index 6fe5c6d2e7833..9c5efe90094cd 100644 --- a/packages/@aws-cdk/aws-lambda/package.json +++ b/packages/@aws-cdk/aws-lambda/package.json @@ -91,7 +91,7 @@ "@aws-cdk/cfn2ts": "0.0.0", "@aws-cdk/cfnspec": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/aws-lambda": "^8.10.110", + "@types/aws-lambda": "^8.10.111", "@types/jest": "^27.5.2", "@types/lodash": "^4.14.191", "@aws-cdk/aws-ssm": "0.0.0", diff --git a/packages/@aws-cdk/aws-lambda/test/integ.lambda.filesystem.js.snapshot/aws-cdk-lambda-1.assets.json b/packages/@aws-cdk/aws-lambda/test/integ.lambda.filesystem.js.snapshot/aws-cdk-lambda-1.assets.json index 2bf00b6e59333..029e733f879ae 100644 --- a/packages/@aws-cdk/aws-lambda/test/integ.lambda.filesystem.js.snapshot/aws-cdk-lambda-1.assets.json +++ b/packages/@aws-cdk/aws-lambda/test/integ.lambda.filesystem.js.snapshot/aws-cdk-lambda-1.assets.json @@ -1,7 +1,7 @@ { - "version": "21.0.0", + "version": "30.1.0", "files": { - "db659d970a5c19f47e5b73f555e343ee0dbc0d912df8c8b17b6fa0ebfab283b8": { + "99f646d44e5cdeefa552647d4c7ab32663f1ba5316065e52de38d8530187ab1d": { "source": { "path": "aws-cdk-lambda-1.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "db659d970a5c19f47e5b73f555e343ee0dbc0d912df8c8b17b6fa0ebfab283b8.json", + "objectKey": "99f646d44e5cdeefa552647d4c7ab32663f1ba5316065e52de38d8530187ab1d.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-lambda/test/integ.lambda.filesystem.js.snapshot/aws-cdk-lambda-1.template.json b/packages/@aws-cdk/aws-lambda/test/integ.lambda.filesystem.js.snapshot/aws-cdk-lambda-1.template.json index 533cfb5d55526..1197d43cbbd41 100644 --- a/packages/@aws-cdk/aws-lambda/test/integ.lambda.filesystem.js.snapshot/aws-cdk-lambda-1.template.json +++ b/packages/@aws-cdk/aws-lambda/test/integ.lambda.filesystem.js.snapshot/aws-cdk-lambda-1.template.json @@ -456,6 +456,12 @@ "FileSystemId": { "Ref": "Efs9E8BF36B" }, + "AccessPointTags": [ + { + "Key": "Name", + "Value": "aws-cdk-lambda-1/Efs/AccessPoint" + } + ], "PosixUser": { "Gid": "1001", "Uid": "1001" diff --git a/packages/@aws-cdk/aws-lambda/test/integ.lambda.filesystem.js.snapshot/cdk.out b/packages/@aws-cdk/aws-lambda/test/integ.lambda.filesystem.js.snapshot/cdk.out index 8ecc185e9dbee..b72fef144f05c 100644 --- a/packages/@aws-cdk/aws-lambda/test/integ.lambda.filesystem.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-lambda/test/integ.lambda.filesystem.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"21.0.0"} \ No newline at end of file +{"version":"30.1.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda/test/integ.lambda.filesystem.js.snapshot/integ.json b/packages/@aws-cdk/aws-lambda/test/integ.lambda.filesystem.js.snapshot/integ.json index 1b9167c9341cb..4e4f69a9e5e34 100644 --- a/packages/@aws-cdk/aws-lambda/test/integ.lambda.filesystem.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-lambda/test/integ.lambda.filesystem.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "21.0.0", + "version": "30.1.0", "testCases": { "integ.lambda.filesystem": { "stacks": [ diff --git a/packages/@aws-cdk/aws-lambda/test/integ.lambda.filesystem.js.snapshot/manifest.json b/packages/@aws-cdk/aws-lambda/test/integ.lambda.filesystem.js.snapshot/manifest.json index 8c79792676aa1..3fcc769449284 100644 --- a/packages/@aws-cdk/aws-lambda/test/integ.lambda.filesystem.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-lambda/test/integ.lambda.filesystem.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { - "version": "21.0.0", + "version": "30.1.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "aws-cdk-lambda-1.assets": { "type": "cdk:asset-manifest", "properties": { @@ -23,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/db659d970a5c19f47e5b73f555e343ee0dbc0d912df8c8b17b6fa0ebfab283b8.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/99f646d44e5cdeefa552647d4c7ab32663f1ba5316065e52de38d8530187ab1d.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -269,6 +263,12 @@ ] }, "displayName": "aws-cdk-lambda-1" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda/test/integ.lambda.filesystem.js.snapshot/tree.json b/packages/@aws-cdk/aws-lambda/test/integ.lambda.filesystem.js.snapshot/tree.json index f9eaeccd551b2..09d8a80dd8a6b 100644 --- a/packages/@aws-cdk/aws-lambda/test/integ.lambda.filesystem.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-lambda/test/integ.lambda.filesystem.js.snapshot/tree.json @@ -4,14 +4,6 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" - } - }, "aws-cdk-lambda-1": { "id": "aws-cdk-lambda-1", "path": "aws-cdk-lambda-1", @@ -771,6 +763,12 @@ "fileSystemId": { "Ref": "Efs9E8BF36B" }, + "accessPointTags": [ + { + "key": "Name", + "value": "aws-cdk-lambda-1/Efs/AccessPoint" + } + ], "posixUser": { "uid": "1001", "gid": "1001" @@ -810,6 +808,14 @@ "id": "ServiceRole", "path": "aws-cdk-lambda-1/MyLambda/ServiceRole", "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "aws-cdk-lambda-1/MyLambda/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "aws-cdk-lambda-1/MyLambda/ServiceRole/Resource", @@ -1133,6 +1139,14 @@ "id": "ServiceRole", "path": "aws-cdk-lambda-1/MyLambda2/ServiceRole", "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "aws-cdk-lambda-1/MyLambda2/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "aws-cdk-lambda-1/MyLambda2/ServiceRole/Resource", @@ -1392,12 +1406,36 @@ "fqn": "@aws-cdk/aws-lambda.Function", "version": "0.0.0" } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-cdk-lambda-1/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-cdk-lambda-1/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } } }, "constructInfo": { "fqn": "@aws-cdk/core.Stack", "version": "0.0.0" } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.252" + } } }, "constructInfo": { diff --git a/packages/@aws-cdk/aws-logs/package.json b/packages/@aws-cdk/aws-logs/package.json index 41dff1f9d17dd..56ae9b9b1293d 100644 --- a/packages/@aws-cdk/aws-logs/package.json +++ b/packages/@aws-cdk/aws-logs/package.json @@ -86,10 +86,10 @@ "@aws-cdk/integ-tests": "0.0.0", "@aws-cdk/cfn2ts": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/aws-lambda": "^8.10.110", + "@types/aws-lambda": "^8.10.111", "@types/jest": "^27.5.2", "@types/sinon": "^9.0.11", - "aws-sdk": "^2.1317.0", + "aws-sdk": "^2.1325.0", "aws-sdk-mock": "5.6.0", "jest": "^27.5.1", "nock": "^13.3.0", diff --git a/packages/@aws-cdk/aws-rds/lib/instance-engine.ts b/packages/@aws-cdk/aws-rds/lib/instance-engine.ts index 4d85631b02ba1..11f2e7cf2d1c3 100644 --- a/packages/@aws-cdk/aws-rds/lib/instance-engine.ts +++ b/packages/@aws-cdk/aws-rds/lib/instance-engine.ts @@ -568,6 +568,8 @@ export class MysqlEngineVersion { public static readonly VER_5_7_39 = MysqlEngineVersion.of('5.7.39', '5.7'); /** Version "5.7.40". */ public static readonly VER_5_7_40 = MysqlEngineVersion.of('5.7.40', '5.7'); + /** Version "5.7.41". */ + public static readonly VER_5_7_41 = MysqlEngineVersion.of('5.7.41', '5.7'); /** Version "8.0" (only a major version, without a specific minor version). */ public static readonly VER_8_0 = MysqlEngineVersion.of('8.0', '8.0'); @@ -601,6 +603,8 @@ export class MysqlEngineVersion { public static readonly VER_8_0_30 = MysqlEngineVersion.of('8.0.30', '8.0'); /** Version "8.0.31". */ public static readonly VER_8_0_31 = MysqlEngineVersion.of('8.0.31', '8.0'); + /** Version "8.0.32". */ + public static readonly VER_8_0_32 = MysqlEngineVersion.of('8.0.32', '8.0'); /** * Create a new MysqlEngineVersion with an arbitrary version. @@ -1328,6 +1332,9 @@ export class OracleEngineVersion { public static readonly VER_19_0_0_0_2022_07_R1 = OracleEngineVersion.of('19.0.0.0.ru-2022-07.rur-2022-07.r1', '19'); /** Version "19.0.0.0.ru-2022-10.rur-2022-10.r1". */ public static readonly VER_19_0_0_0_2022_10_R1 = OracleEngineVersion.of('19.0.0.0.ru-2022-10.rur-2022-10.r1', '19'); + /** Version "19.0.0.0.ru-2023-01.rur-2023-01.r1". */ + public static readonly VER_19_0_0_0_2023_01_R1 = OracleEngineVersion.of('19.0.0.0.ru-2023-01.rur-2023-01.r1', '19'); + /** Version "21" (only a major version, without a specific minor version). */ public static readonly VER_21 = OracleEngineVersion.of('21', '21'); @@ -1339,6 +1346,8 @@ export class OracleEngineVersion { public static readonly VER_21_0_0_0_2022_07_R1 = OracleEngineVersion.of('21.0.0.0.ru-2022-07.rur-2022-07.r1', '21'); /** Version "21.0.0.0.ru-2022-10.rur-2022-10.r1". */ public static readonly VER_21_0_0_0_2022_10_R1 = OracleEngineVersion.of('21.0.0.0.ru-2022-10.rur-2022-10.r1', '21'); + /** Version "21.0.0.0.ru-2023-01.rur-2023-01.r1". */ + public static readonly VER_21_0_0_0_2023_01_R1 = OracleEngineVersion.of('21.0.0.0.ru-2023-01.rur-2023-01.r1', '21'); /** * Creates a new OracleEngineVersion with an arbitrary version. diff --git a/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.js.snapshot/aws-cdk-rds-cluster-rotation.assets.json b/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.js.snapshot/aws-cdk-rds-cluster-rotation.assets.json index ae1f3168553a8..6256aa3105eec 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.js.snapshot/aws-cdk-rds-cluster-rotation.assets.json +++ b/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.js.snapshot/aws-cdk-rds-cluster-rotation.assets.json @@ -1,7 +1,7 @@ { - "version": "21.0.0", + "version": "30.1.0", "files": { - "dfc2f8e8aa2f2f42357312f7f92524a12cb383c762b91eaecbbefb8ad8400f82": { + "f1be03db0810455e897d5600a00d7d089273d1f89b9a319be25928bf241a9490": { "source": { "path": "aws-cdk-rds-cluster-rotation.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "dfc2f8e8aa2f2f42357312f7f92524a12cb383c762b91eaecbbefb8ad8400f82.json", + "objectKey": "f1be03db0810455e897d5600a00d7d089273d1f89b9a319be25928bf241a9490.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.js.snapshot/aws-cdk-rds-cluster-rotation.template.json b/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.js.snapshot/aws-cdk-rds-cluster-rotation.template.json index bd800aaa20877..0252e7533406a 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.js.snapshot/aws-cdk-rds-cluster-rotation.template.json +++ b/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.js.snapshot/aws-cdk-rds-cluster-rotation.template.json @@ -606,7 +606,7 @@ } } }, - "DatabaseSecretAttachmentPolicy5ACFE6CA": { + "DatabaseSecretPolicyEE73D3F8": { "Type": "AWS::SecretsManager::ResourcePolicy", "Properties": { "ResourcePolicy": { @@ -638,18 +638,18 @@ "Version": "2012-10-17" }, "SecretId": { - "Ref": "DatabaseSecretAttachmentE5D1B020" + "Ref": "DatabaseSecret3B817195" } } }, "DatabaseB269D8BB": { "Type": "AWS::RDS::DBCluster", "Properties": { - "Engine": "aurora", "CopyTagsToSnapshot": true, "DBSubnetGroupName": { "Ref": "DatabaseSubnets56F17B9A" }, + "Engine": "aurora", "MasterUsername": { "Fn::Join": [ "", @@ -924,7 +924,7 @@ } } }, - "CustomRotationOptionsSecretAttachmentPolicyAB818C64": { + "CustomRotationOptionsSecretPolicyA73E17A8": { "Type": "AWS::SecretsManager::ResourcePolicy", "Properties": { "ResourcePolicy": { @@ -956,18 +956,18 @@ "Version": "2012-10-17" }, "SecretId": { - "Ref": "CustomRotationOptionsSecretAttachment697A23BF" + "Ref": "CustomRotationOptionsSecret7DCFFFDB" } } }, "CustomRotationOptions7CA9E132": { "Type": "AWS::RDS::DBCluster", "Properties": { - "Engine": "aurora", "CopyTagsToSnapshot": true, "DBSubnetGroupName": { "Ref": "CustomRotationOptionsSubnets52AEBCED" }, + "Engine": "aurora", "MasterUsername": { "Fn::Join": [ "", diff --git a/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.js.snapshot/cdk.out b/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.js.snapshot/cdk.out index 8ecc185e9dbee..b72fef144f05c 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"21.0.0"} \ No newline at end of file +{"version":"30.1.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.js.snapshot/integ.json b/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.js.snapshot/integ.json index 3cee3075c64cc..5bbe8121413b0 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "21.0.0", + "version": "30.1.0", "testCases": { "integ.cluster-rotation.lit": { "stacks": [ diff --git a/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.js.snapshot/manifest.json b/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.js.snapshot/manifest.json index 21ee20339ed5f..0da5ccc5e746a 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "21.0.0", + "version": "30.1.0", "artifacts": { "aws-cdk-rds-cluster-rotation.assets": { "type": "cdk:asset-manifest", @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/dfc2f8e8aa2f2f42357312f7f92524a12cb383c762b91eaecbbefb8ad8400f82.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/f1be03db0810455e897d5600a00d7d089273d1f89b9a319be25928bf241a9490.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -225,10 +225,10 @@ "data": "DatabaseSecretAttachmentRotationScheduleA4E9F034" } ], - "/aws-cdk-rds-cluster-rotation/Database/Secret/Attachment/Policy/Resource": [ + "/aws-cdk-rds-cluster-rotation/Database/Secret/Policy/Resource": [ { "type": "aws:cdk:logicalId", - "data": "DatabaseSecretAttachmentPolicy5ACFE6CA" + "data": "DatabaseSecretPolicyEE73D3F8" } ], "/aws-cdk-rds-cluster-rotation/Database/Resource": [ @@ -264,10 +264,7 @@ "/aws-cdk-rds-cluster-rotation/Database/RotationSingleUser/Resource": [ { "type": "aws:cdk:logicalId", - "data": "DatabaseRotationSingleUser65F55654", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" - ] + "data": "DatabaseRotationSingleUser65F55654" } ], "/aws-cdk-rds-cluster-rotation/CustomRotationOptions/Subnets/Default": [ @@ -306,10 +303,10 @@ "data": "CustomRotationOptionsSecretAttachmentRotationScheduleD5AEB622" } ], - "/aws-cdk-rds-cluster-rotation/CustomRotationOptions/Secret/Attachment/Policy/Resource": [ + "/aws-cdk-rds-cluster-rotation/CustomRotationOptions/Secret/Policy/Resource": [ { "type": "aws:cdk:logicalId", - "data": "CustomRotationOptionsSecretAttachmentPolicyAB818C64" + "data": "CustomRotationOptionsSecretPolicyA73E17A8" } ], "/aws-cdk-rds-cluster-rotation/CustomRotationOptions/Resource": [ @@ -354,10 +351,19 @@ "data": "CheckBootstrapVersion" } ], - "DatabaseSecurityGroupfromawscdkrdsclusterrotationSecurityGroupB986D266IndirectPortE461A61D": [ + "DatabaseSecretAttachmentPolicy5ACFE6CA": [ + { + "type": "aws:cdk:logicalId", + "data": "DatabaseSecretAttachmentPolicy5ACFE6CA", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "CustomRotationOptionsSecretAttachmentPolicyAB818C64": [ { "type": "aws:cdk:logicalId", - "data": "DatabaseSecurityGroupfromawscdkrdsclusterrotationSecurityGroupB986D266IndirectPortE461A61D", + "data": "CustomRotationOptionsSecretAttachmentPolicyAB818C64", "trace": [ "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" ] diff --git a/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.js.snapshot/tree.json b/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.js.snapshot/tree.json index 756823a7c2091..5eefe4ba0e14b 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.js.snapshot/tree.json @@ -1004,64 +1004,64 @@ "fqn": "@aws-cdk/aws-secretsmanager.RotationSchedule", "version": "0.0.0" } - }, - "Policy": { - "id": "Policy", - "path": "aws-cdk-rds-cluster-rotation/Database/Secret/Attachment/Policy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-cdk-rds-cluster-rotation/Database/Secret/Attachment/Policy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::SecretsManager::ResourcePolicy", - "aws:cdk:cloudformation:props": { - "resourcePolicy": { - "Statement": [ - { - "Action": "secretsmanager:DeleteSecret", - "Effect": "Deny", - "Principal": { - "AWS": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::", - { - "Ref": "AWS::AccountId" - }, - ":root" - ] - ] - } - }, - "Resource": "*" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.SecretTargetAttachment", + "version": "0.0.0" + } + }, + "Policy": { + "id": "Policy", + "path": "aws-cdk-rds-cluster-rotation/Database/Secret/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-rds-cluster-rotation/Database/Secret/Policy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::ResourcePolicy", + "aws:cdk:cloudformation:props": { + "resourcePolicy": { + "Statement": [ + { + "Action": "secretsmanager:DeleteSecret", + "Effect": "Deny", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] } - ], - "Version": "2012-10-17" - }, - "secretId": { - "Ref": "DatabaseSecretAttachmentE5D1B020" + }, + "Resource": "*" } - } + ], + "Version": "2012-10-17" }, - "constructInfo": { - "fqn": "@aws-cdk/aws-secretsmanager.CfnResourcePolicy", - "version": "0.0.0" + "secretId": { + "Ref": "DatabaseSecret3B817195" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-secretsmanager.ResourcePolicy", + "fqn": "@aws-cdk/aws-secretsmanager.CfnResourcePolicy", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-secretsmanager.SecretTargetAttachment", + "fqn": "@aws-cdk/aws-secretsmanager.ResourcePolicy", "version": "0.0.0" } } @@ -1077,11 +1077,11 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::RDS::DBCluster", "aws:cdk:cloudformation:props": { - "engine": "aurora", "copyTagsToSnapshot": true, "dbSubnetGroupName": { "Ref": "DatabaseSubnets56F17B9A" }, + "engine": "aurora", "masterUsername": { "Fn::Join": [ "", @@ -1502,64 +1502,64 @@ "fqn": "@aws-cdk/aws-secretsmanager.RotationSchedule", "version": "0.0.0" } - }, - "Policy": { - "id": "Policy", - "path": "aws-cdk-rds-cluster-rotation/CustomRotationOptions/Secret/Attachment/Policy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-cdk-rds-cluster-rotation/CustomRotationOptions/Secret/Attachment/Policy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::SecretsManager::ResourcePolicy", - "aws:cdk:cloudformation:props": { - "resourcePolicy": { - "Statement": [ - { - "Action": "secretsmanager:DeleteSecret", - "Effect": "Deny", - "Principal": { - "AWS": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::", - { - "Ref": "AWS::AccountId" - }, - ":root" - ] - ] - } - }, - "Resource": "*" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.SecretTargetAttachment", + "version": "0.0.0" + } + }, + "Policy": { + "id": "Policy", + "path": "aws-cdk-rds-cluster-rotation/CustomRotationOptions/Secret/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-rds-cluster-rotation/CustomRotationOptions/Secret/Policy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::ResourcePolicy", + "aws:cdk:cloudformation:props": { + "resourcePolicy": { + "Statement": [ + { + "Action": "secretsmanager:DeleteSecret", + "Effect": "Deny", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] } - ], - "Version": "2012-10-17" - }, - "secretId": { - "Ref": "CustomRotationOptionsSecretAttachment697A23BF" + }, + "Resource": "*" } - } + ], + "Version": "2012-10-17" }, - "constructInfo": { - "fqn": "@aws-cdk/aws-secretsmanager.CfnResourcePolicy", - "version": "0.0.0" + "secretId": { + "Ref": "CustomRotationOptionsSecret7DCFFFDB" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-secretsmanager.ResourcePolicy", + "fqn": "@aws-cdk/aws-secretsmanager.CfnResourcePolicy", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-secretsmanager.SecretTargetAttachment", + "fqn": "@aws-cdk/aws-secretsmanager.ResourcePolicy", "version": "0.0.0" } } @@ -1575,11 +1575,11 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::RDS::DBCluster", "aws:cdk:cloudformation:props": { - "engine": "aurora", "copyTagsToSnapshot": true, "dbSubnetGroupName": { "Ref": "CustomRotationOptionsSubnets52AEBCED" }, + "engine": "aurora", "masterUsername": { "Fn::Join": [ "", @@ -1796,7 +1796,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.161" + "version": "10.1.252" } } }, diff --git a/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037/outbound.js b/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037/outbound.js deleted file mode 100644 index 70203dcc42f3f..0000000000000 --- a/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037/outbound.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.httpRequest = exports.invokeFunction = exports.startExecution = void 0; -/* istanbul ignore file */ -const https = require("https"); -// eslint-disable-next-line import/no-extraneous-dependencies -const AWS = require("aws-sdk"); -const FRAMEWORK_HANDLER_TIMEOUT = 900000; // 15 minutes -// In order to honor the overall maximum timeout set for the target process, -// the default 2 minutes from AWS SDK has to be overriden: -// https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Config.html#httpOptions-property -const awsSdkConfig = { - httpOptions: { timeout: FRAMEWORK_HANDLER_TIMEOUT }, -}; -async function defaultHttpRequest(options, responseBody) { - return new Promise((resolve, reject) => { - try { - const request = https.request(options, resolve); - request.on('error', reject); - request.write(responseBody); - request.end(); - } - catch (e) { - reject(e); - } - }); -} -let sfn; -let lambda; -async function defaultStartExecution(req) { - if (!sfn) { - sfn = new AWS.StepFunctions(awsSdkConfig); - } - return sfn.startExecution(req).promise(); -} -async function defaultInvokeFunction(req) { - if (!lambda) { - lambda = new AWS.Lambda(awsSdkConfig); - } - return lambda.invoke(req).promise(); -} -exports.startExecution = defaultStartExecution; -exports.invokeFunction = defaultInvokeFunction; -exports.httpRequest = defaultHttpRequest; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3V0Ym91bmQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJvdXRib3VuZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwwQkFBMEI7QUFDMUIsK0JBQStCO0FBQy9CLDZEQUE2RDtBQUM3RCwrQkFBK0I7QUFJL0IsTUFBTSx5QkFBeUIsR0FBRyxNQUFNLENBQUMsQ0FBQyxhQUFhO0FBRXZELDRFQUE0RTtBQUM1RSwwREFBMEQ7QUFDMUQsMkZBQTJGO0FBQzNGLE1BQU0sWUFBWSxHQUF5QjtJQUN6QyxXQUFXLEVBQUUsRUFBRSxPQUFPLEVBQUUseUJBQXlCLEVBQUU7Q0FDcEQsQ0FBQztBQUVGLEtBQUssVUFBVSxrQkFBa0IsQ0FBQyxPQUE2QixFQUFFLFlBQW9CO0lBQ25GLE9BQU8sSUFBSSxPQUFPLENBQUMsQ0FBQyxPQUFPLEVBQUUsTUFBTSxFQUFFLEVBQUU7UUFDckMsSUFBSTtZQUNGLE1BQU0sT0FBTyxHQUFHLEtBQUssQ0FBQyxPQUFPLENBQUMsT0FBTyxFQUFFLE9BQU8sQ0FBQyxDQUFDO1lBQ2hELE9BQU8sQ0FBQyxFQUFFLENBQUMsT0FBTyxFQUFFLE1BQU0sQ0FBQyxDQUFDO1lBQzVCLE9BQU8sQ0FBQyxLQUFLLENBQUMsWUFBWSxDQUFDLENBQUM7WUFDNUIsT0FBTyxDQUFDLEdBQUcsRUFBRSxDQUFDO1NBQ2Y7UUFBQyxPQUFPLENBQUMsRUFBRTtZQUNWLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQztTQUNYO0lB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V0IHNmbjogQVdTLlN0ZXBGdW5jdGlvbnM7XG5sZXQgbGFtYmRhOiBBV1MuTGFtYmRhO1xuXG5hc3luYyBmdW5jdGlvbiBkZWZhdWx0U3RhcnRFeGVjdXRpb24ocmVxOiBBV1MuU3RlcEZ1bmN0aW9ucy5TdGFydEV4ZWN1dGlvbklucHV0KTogUHJvbWlzZTxBV1MuU3RlcEZ1bmN0aW9ucy5TdGFydEV4ZWN1dGlvbk91dHB1dD4ge1xuICBpZiAoIXNmbikge1xuICAgIHNmbiA9IG5ldyBBV1MuU3RlcEZ1bmN0aW9ucyhhd3NTZGtDb25maWcpO1xuICB9XG5cbiAgcmV0dXJuIHNmbi5zdGFydEV4ZWN1dGlvbihyZXEpLnByb21pc2UoKTtcbn1cblxuYXN5bmMgZnVuY3Rpb24gZGVmYXVsdEludm9rZUZ1bmN0aW9uKHJlcTogQVdTLkxhbWJkYS5JbnZvY2F0aW9uUmVxdWVzdCk6IFByb21pc2U8QVdTLkxhbWJkYS5JbnZvY2F0aW9uUmVzcG9uc2U+IHtcbiAgaWYgKCFsYW1iZGEpIHtcbiAgICBsYW1iZGEgPSBuZXcgQVdTLkxhbWJkYShhd3NTZGtDb25maWcpO1xuICB9XG5cbiAgcmV0dXJuIGxhbWJkYS5pbnZva2UocmVxKS5wcm9taXNlKCk7XG59XG5cbmV4cG9ydCBsZXQgc3RhcnRFeGVjdXRpb24gPSBkZWZhdWx0U3RhcnRFeGVjdXRpb247XG5leHBvcnQgbGV0IGludm9rZUZ1bmN0aW9uID0gZGVmYXVsdEludm9rZUZ1bmN0aW9uO1xuZXhwb3J0IGxldCBodHRwUmVxdWVzdCA9IGRlZmF1bHRIdHRwUmVxdWVzdDtcbiJdfQ== \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037/cfn-response.js b/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/asset.a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585/cfn-response.js similarity index 100% rename from packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037/cfn-response.js rename to packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/asset.a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585/cfn-response.js diff --git a/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037/consts.js b/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/asset.a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585/consts.js similarity index 100% rename from packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037/consts.js rename to packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/asset.a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585/consts.js diff --git a/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037/framework.js b/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/asset.a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585/framework.js similarity index 100% rename from packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037/framework.js rename to packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/asset.a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585/framework.js diff --git a/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/asset.a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585/outbound.js b/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/asset.a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585/outbound.js new file mode 100644 index 0000000000000..cc0667d42f0e8 --- /dev/null +++ b/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/asset.a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585/outbound.js @@ -0,0 +1,69 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.httpRequest = exports.invokeFunction = exports.startExecution = void 0; +/* istanbul ignore file */ +const https = require("https"); +// eslint-disable-next-line import/no-extraneous-dependencies +const AWS = require("aws-sdk"); +const FRAMEWORK_HANDLER_TIMEOUT = 900000; // 15 minutes +// In order to honor the overall maximum timeout set for the target process, +// the default 2 minutes from AWS SDK has to be overriden: +// https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Config.html#httpOptions-property +const awsSdkConfig = { + httpOptions: { timeout: FRAMEWORK_HANDLER_TIMEOUT }, +}; +async function defaultHttpRequest(options, responseBody) { + return new Promise((resolve, reject) => { + try { + const request = https.request(options, resolve); + request.on('error', reject); + request.write(responseBody); + request.end(); + } + catch (e) { + reject(e); + } + }); +} +let sfn; +let lambda; +async function defaultStartExecution(req) { + if (!sfn) { + sfn = new AWS.StepFunctions(awsSdkConfig); + } + return sfn.startExecution(req).promise(); +} +async function defaultInvokeFunction(req) { + if (!lambda) { + lambda = new AWS.Lambda(awsSdkConfig); + } + try { + /** + * Try an initial invoke. + * + * When you try to invoke a function that is inactive, the invocation fails and Lambda sets + * the function to pending state until the function resources are recreated. + * If Lambda fails to recreate the resources, the function is set to the inactive state. + * + * We're using invoke first because `waitFor` doesn't trigger an inactive function to do anything, + * it just runs `getFunction` and checks the state. + */ + return await lambda.invoke(req).promise(); + } + catch (error) { + /** + * The status of the Lambda function is checked every second for up to 300 seconds. + * Exits the loop on 'Active' state and throws an error on 'Inactive' or 'Failed'. + * + * And now we wait. + */ + await lambda.waitFor('functionActiveV2', { + FunctionName: req.FunctionName, + }).promise(); + return await lambda.invoke(req).promise(); + } +} +exports.startExecution = defaultStartExecution; +exports.invokeFunction = defaultInvokeFunction; +exports.httpRequest = defaultHttpRequest; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3V0Ym91bmQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJvdXRib3VuZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwwQkFBMEI7QUFDMUIsK0JBQStCO0FBQy9CLDZEQUE2RDtBQUM3RCwrQkFBK0I7QUFJL0IsTUFBTSx5QkFBeUIsR0FBRyxNQUFNLENBQUMsQ0FBQyxhQUFhO0FBRXZELDRFQUE0RTtBQUM1RSwwREFBMEQ7QUFDMUQsMkZBQTJGO0FBQzNGLE1BQU0sWUFBWSxHQUF5QjtJQUN6QyxXQUFXLEVBQUUsRUFBRSxPQUFPLEVBQUUseUJBQXlCLEVBQUU7Q0FDcEQsQ0FBQztBQUVGLEtBQUssVUFBVSxrQkFBa0IsQ0FBQyxPQUE2QixFQUFFLFlBQW9CO0lBQ25GLE9BQU8sSUFBSSxPQUFPLENBQUMsQ0FBQyxPQUFPLEVBQUUsTUFBTSxFQUFFLEVBQUU7UUFDckMsSUFBSTtZQUNGLE1BQU0sT0FBTyxHQUFHLEtBQUssQ0FBQyxPQUFPLENBQUMsT0FBTyxFQUFFLE9BQU8sQ0FBQyxDQUFDO1lBQ2hELE9BQU8sQ0FBQyxFQUFFLENBQUMsT0FBTyxFQUFFLE1BQU0sQ0FBQyxDQUFDO1lBQzVCLE9BQU8sQ0FBQyxLQUFLLENBQUMsWUFBWSxDQUFDLENBQUM7WUFDNUIsT0FBTyxDQUFDLEdBQ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ZhaWxlZCcuXG4gICAgICpcbiAgICAgKiBBbmQgbm93IHdlIHdhaXQuXG4gICAgICovXG4gICAgYXdhaXQgbGFtYmRhLndhaXRGb3IoJ2Z1bmN0aW9uQWN0aXZlVjInLCB7XG4gICAgICBGdW5jdGlvbk5hbWU6IHJlcS5GdW5jdGlvbk5hbWUsXG4gICAgfSkucHJvbWlzZSgpO1xuICAgIHJldHVybiBhd2FpdCBsYW1iZGEuaW52b2tlKHJlcSkucHJvbWlzZSgpO1xuICB9XG59XG5cbmV4cG9ydCBsZXQgc3RhcnRFeGVjdXRpb24gPSBkZWZhdWx0U3RhcnRFeGVjdXRpb247XG5leHBvcnQgbGV0IGludm9rZUZ1bmN0aW9uID0gZGVmYXVsdEludm9rZUZ1bmN0aW9uO1xuZXhwb3J0IGxldCBodHRwUmVxdWVzdCA9IGRlZmF1bHRIdHRwUmVxdWVzdDtcbiJdfQ== \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037/util.js b/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/asset.a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585/util.js similarity index 100% rename from packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037/util.js rename to packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/asset.a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585/util.js diff --git a/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/cdk-integ-cluster-snapshot.assets.json b/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/cdk-integ-cluster-snapshot.assets.json index 52f14f55deb74..91d24983fc3c9 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/cdk-integ-cluster-snapshot.assets.json +++ b/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/cdk-integ-cluster-snapshot.assets.json @@ -1,5 +1,5 @@ { - "version": "21.0.0", + "version": "30.1.0", "files": { "2e7ee01d9005281c0784e709cad69500591734343d1cb95da2fb4a3f5076aadd": { "source": { @@ -14,20 +14,20 @@ } } }, - "7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037": { + "a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585": { "source": { - "path": "asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037", + "path": "asset.a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037.zip", + "objectKey": "a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "58fc394d5f5f45f41e0b793cb553bcba2bb2899eec75a6b2e00e1df08ad19eff": { + "f52756563b89062acac165275c62a93cfda25f7fa3aed987a65809db27bc37a5": { "source": { "path": "cdk-integ-cluster-snapshot.template.json", "packaging": "file" @@ -35,7 +35,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "58fc394d5f5f45f41e0b793cb553bcba2bb2899eec75a6b2e00e1df08ad19eff.json", + "objectKey": "f52756563b89062acac165275c62a93cfda25f7fa3aed987a65809db27bc37a5.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/cdk-integ-cluster-snapshot.template.json b/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/cdk-integ-cluster-snapshot.template.json index ecff73b539c94..5a9b5e79c4b51 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/cdk-integ-cluster-snapshot.template.json +++ b/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/cdk-integ-cluster-snapshot.template.json @@ -425,12 +425,12 @@ "ClusterEB0386A7": { "Type": "AWS::RDS::DBCluster", "Properties": { - "Engine": "aurora-mysql", "CopyTagsToSnapshot": true, "DBClusterParameterGroupName": "default.aurora-mysql5.7", "DBSubnetGroupName": { "Ref": "ClusterSubnetsDCFA5CB7" }, + "Engine": "aurora-mysql", "EngineVersion": "5.7.mysql_aurora.2.10.2", "MasterUsername": { "Fn::Join": [ @@ -858,7 +858,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037.zip" + "S3Key": "a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585.zip" }, "Role": { "Fn::GetAtt": [ @@ -995,7 +995,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037.zip" + "S3Key": "a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585.zip" }, "Role": { "Fn::GetAtt": [ @@ -1129,7 +1129,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037.zip" + "S3Key": "a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585.zip" }, "Role": { "Fn::GetAtt": [ @@ -1446,7 +1446,7 @@ } } }, - "FromSnapshotSnapshotSecretAttachmentPolicy3136FEC0": { + "FromSnapshotSnapshotSecretPolicyA5C332BE": { "Type": "AWS::SecretsManager::ResourcePolicy", "Properties": { "ResourcePolicy": { @@ -1478,19 +1478,19 @@ "Version": "2012-10-17" }, "SecretId": { - "Ref": "FromSnapshotSnapshotSecretAttachmentA3F619B8" + "Ref": "cdkintegclustersnapshotFromSnapshotSnapshotSecretD93327943fdaad7efa858a3daf9490cf0a702aeb" } } }, "FromSnapshotEE0682C5": { "Type": "AWS::RDS::DBCluster", "Properties": { - "Engine": "aurora-mysql", "CopyTagsToSnapshot": true, "DBClusterParameterGroupName": "default.aurora-mysql5.7", "DBSubnetGroupName": { "Ref": "FromSnapshotSubnets9ED4B8EE" }, + "Engine": "aurora-mysql", "EngineVersion": "5.7.mysql_aurora.2.10.2", "MasterUserPassword": { "Fn::Join": [ diff --git a/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/cdk.out b/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/cdk.out index 8ecc185e9dbee..b72fef144f05c 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"21.0.0"} \ No newline at end of file +{"version":"30.1.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/integ.json b/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/integ.json index 329077c22006c..daa81ef94fabf 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "21.0.0", + "version": "30.1.0", "testCases": { "integ.cluster-snapshot": { "stacks": [ diff --git a/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/manifest.json b/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/manifest.json index 323e4184407ac..f386e19c0f970 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "21.0.0", + "version": "30.1.0", "artifacts": { "cdk-integ-cluster-snapshot.assets": { "type": "cdk:asset-manifest", @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/58fc394d5f5f45f41e0b793cb553bcba2bb2899eec75a6b2e00e1df08ad19eff.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/f52756563b89062acac165275c62a93cfda25f7fa3aed987a65809db27bc37a5.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -363,10 +363,10 @@ "data": "FromSnapshotSnapshotSecretAttachmentRotationSchedule102BDEB3" } ], - "/cdk-integ-cluster-snapshot/FromSnapshot/SnapshotSecret/Attachment/Policy/Resource": [ + "/cdk-integ-cluster-snapshot/FromSnapshot/SnapshotSecret/Policy/Resource": [ { "type": "aws:cdk:logicalId", - "data": "FromSnapshotSnapshotSecretAttachmentPolicy3136FEC0" + "data": "FromSnapshotSnapshotSecretPolicyA5C332BE" } ], "/cdk-integ-cluster-snapshot/FromSnapshot/Resource": [ @@ -416,6 +416,15 @@ "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } + ], + "FromSnapshotSnapshotSecretAttachmentPolicy3136FEC0": [ + { + "type": "aws:cdk:logicalId", + "data": "FromSnapshotSnapshotSecretAttachmentPolicy3136FEC0", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } ] }, "displayName": "cdk-integ-cluster-snapshot" diff --git a/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/tree.json b/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/tree.json index fa892eca6a00d..780a8f2d8ebc6 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-rds/test/integ.cluster-snapshot.js.snapshot/tree.json @@ -757,12 +757,12 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::RDS::DBCluster", "aws:cdk:cloudformation:props": { - "engine": "aurora-mysql", "copyTagsToSnapshot": true, "dbClusterParameterGroupName": "default.aurora-mysql5.7", "dbSubnetGroupName": { "Ref": "ClusterSubnetsDCFA5CB7" }, + "engine": "aurora-mysql", "engineVersion": "5.7.mysql_aurora.2.10.2", "masterUsername": { "Fn::Join": [ @@ -863,6 +863,14 @@ "id": "ServiceRole", "path": "cdk-integ-cluster-snapshot/Snapshoter/OnEventHandler/ServiceRole", "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "cdk-integ-cluster-snapshot/Snapshoter/OnEventHandler/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "cdk-integ-cluster-snapshot/Snapshoter/OnEventHandler/ServiceRole/Resource", @@ -1061,6 +1069,14 @@ "id": "ServiceRole", "path": "cdk-integ-cluster-snapshot/Snapshoter/IsCompleteHandler/ServiceRole", "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "cdk-integ-cluster-snapshot/Snapshoter/IsCompleteHandler/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "cdk-integ-cluster-snapshot/Snapshoter/IsCompleteHandler/ServiceRole/Resource", @@ -1234,6 +1250,14 @@ "id": "ServiceRole", "path": "cdk-integ-cluster-snapshot/Snapshoter/SnapshotProvider/framework-onEvent/ServiceRole", "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "cdk-integ-cluster-snapshot/Snapshoter/SnapshotProvider/framework-onEvent/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "cdk-integ-cluster-snapshot/Snapshoter/SnapshotProvider/framework-onEvent/ServiceRole/Resource", @@ -1402,7 +1426,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037.zip" + "s3Key": "a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585.zip" }, "role": { "Fn::GetAtt": [ @@ -1454,6 +1478,14 @@ "id": "ServiceRole", "path": "cdk-integ-cluster-snapshot/Snapshoter/SnapshotProvider/framework-isComplete/ServiceRole", "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "cdk-integ-cluster-snapshot/Snapshoter/SnapshotProvider/framework-isComplete/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "cdk-integ-cluster-snapshot/Snapshoter/SnapshotProvider/framework-isComplete/ServiceRole/Resource", @@ -1615,7 +1647,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037.zip" + "s3Key": "a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585.zip" }, "role": { "Fn::GetAtt": [ @@ -1664,6 +1696,14 @@ "id": "ServiceRole", "path": "cdk-integ-cluster-snapshot/Snapshoter/SnapshotProvider/framework-onTimeout/ServiceRole", "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "cdk-integ-cluster-snapshot/Snapshoter/SnapshotProvider/framework-onTimeout/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "cdk-integ-cluster-snapshot/Snapshoter/SnapshotProvider/framework-onTimeout/ServiceRole/Resource", @@ -1825,7 +1865,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037.zip" + "s3Key": "a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585.zip" }, "role": { "Fn::GetAtt": [ @@ -1874,6 +1914,14 @@ "id": "Role", "path": "cdk-integ-cluster-snapshot/Snapshoter/SnapshotProvider/waiter-state-machine/Role", "children": { + "ImportRole": { + "id": "ImportRole", + "path": "cdk-integ-cluster-snapshot/Snapshoter/SnapshotProvider/waiter-state-machine/Role/ImportRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "cdk-integ-cluster-snapshot/Snapshoter/SnapshotProvider/waiter-state-machine/Role/Resource", @@ -1996,7 +2044,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.140" + "version": "10.1.252" } } }, @@ -2026,7 +2074,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.140" + "version": "10.1.252" } }, "FromSnapshot": { @@ -2308,64 +2356,64 @@ "fqn": "@aws-cdk/aws-secretsmanager.RotationSchedule", "version": "0.0.0" } - }, - "Policy": { - "id": "Policy", - "path": "cdk-integ-cluster-snapshot/FromSnapshot/SnapshotSecret/Attachment/Policy", - "children": { - "Resource": { - "id": "Resource", - "path": "cdk-integ-cluster-snapshot/FromSnapshot/SnapshotSecret/Attachment/Policy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::SecretsManager::ResourcePolicy", - "aws:cdk:cloudformation:props": { - "resourcePolicy": { - "Statement": [ - { - "Action": "secretsmanager:DeleteSecret", - "Effect": "Deny", - "Principal": { - "AWS": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::", - { - "Ref": "AWS::AccountId" - }, - ":root" - ] - ] - } - }, - "Resource": "*" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.SecretTargetAttachment", + "version": "0.0.0" + } + }, + "Policy": { + "id": "Policy", + "path": "cdk-integ-cluster-snapshot/FromSnapshot/SnapshotSecret/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "cdk-integ-cluster-snapshot/FromSnapshot/SnapshotSecret/Policy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::ResourcePolicy", + "aws:cdk:cloudformation:props": { + "resourcePolicy": { + "Statement": [ + { + "Action": "secretsmanager:DeleteSecret", + "Effect": "Deny", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] } - ], - "Version": "2012-10-17" - }, - "secretId": { - "Ref": "FromSnapshotSnapshotSecretAttachmentA3F619B8" + }, + "Resource": "*" } - } + ], + "Version": "2012-10-17" }, - "constructInfo": { - "fqn": "@aws-cdk/aws-secretsmanager.CfnResourcePolicy", - "version": "0.0.0" + "secretId": { + "Ref": "cdkintegclustersnapshotFromSnapshotSnapshotSecretD93327943fdaad7efa858a3daf9490cf0a702aeb" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-secretsmanager.ResourcePolicy", + "fqn": "@aws-cdk/aws-secretsmanager.CfnResourcePolicy", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-secretsmanager.SecretTargetAttachment", + "fqn": "@aws-cdk/aws-secretsmanager.ResourcePolicy", "version": "0.0.0" } } @@ -2381,12 +2429,12 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::RDS::DBCluster", "aws:cdk:cloudformation:props": { - "engine": "aurora-mysql", "copyTagsToSnapshot": true, "dbClusterParameterGroupName": "default.aurora-mysql5.7", "dbSubnetGroupName": { "Ref": "FromSnapshotSubnets9ED4B8EE" }, + "engine": "aurora-mysql", "engineVersion": "5.7.mysql_aurora.2.10.2", "masterUserPassword": { "Fn::Join": [ @@ -2628,7 +2676,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.140" + "version": "10.1.252" } } }, diff --git a/packages/@aws-cdk/aws-rds/test/integ.instance.lit.js.snapshot/aws-cdk-rds-instance.assets.json b/packages/@aws-cdk/aws-rds/test/integ.instance.lit.js.snapshot/aws-cdk-rds-instance.assets.json index 5867eb7ea2b91..06206b4bc735d 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.instance.lit.js.snapshot/aws-cdk-rds-instance.assets.json +++ b/packages/@aws-cdk/aws-rds/test/integ.instance.lit.js.snapshot/aws-cdk-rds-instance.assets.json @@ -1,5 +1,5 @@ { - "version": "20.0.0", + "version": "30.1.0", "files": { "d01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347": { "source": { @@ -14,7 +14,7 @@ } } }, - "ca59a5a9368640ecbf25d69e1e3312350b2d7b735c3b73b031c02657142ca94b": { + "e7bc0b577d93d8f59c7fe5e6f67a018347fe8fe4ea16a012eba5a7504564f2e0": { "source": { "path": "aws-cdk-rds-instance.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "ca59a5a9368640ecbf25d69e1e3312350b2d7b735c3b73b031c02657142ca94b.json", + "objectKey": "e7bc0b577d93d8f59c7fe5e6f67a018347fe8fe4ea16a012eba5a7504564f2e0.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-rds/test/integ.instance.lit.js.snapshot/aws-cdk-rds-instance.template.json b/packages/@aws-cdk/aws-rds/test/integ.instance.lit.js.snapshot/aws-cdk-rds-instance.template.json index 4f724da4a1845..1e7427c56b992 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.instance.lit.js.snapshot/aws-cdk-rds-instance.template.json +++ b/packages/@aws-cdk/aws-rds/test/integ.instance.lit.js.snapshot/aws-cdk-rds-instance.template.json @@ -623,7 +623,7 @@ } } }, - "InstanceSecretAttachmentPolicy60A8B8DE": { + "InstanceSecretPolicy87F03D0F": { "Type": "AWS::SecretsManager::ResourcePolicy", "Properties": { "ResourcePolicy": { @@ -655,7 +655,7 @@ "Version": "2012-10-17" }, "SecretId": { - "Ref": "InstanceSecretAttachment83BEE581" + "Ref": "InstanceSecret478E0A47" } } }, diff --git a/packages/@aws-cdk/aws-rds/test/integ.instance.lit.js.snapshot/cdk.out b/packages/@aws-cdk/aws-rds/test/integ.instance.lit.js.snapshot/cdk.out index 588d7b269d34f..b72fef144f05c 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.instance.lit.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-rds/test/integ.instance.lit.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"20.0.0"} \ No newline at end of file +{"version":"30.1.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rds/test/integ.instance.lit.js.snapshot/integ.json b/packages/@aws-cdk/aws-rds/test/integ.instance.lit.js.snapshot/integ.json index f00922c1b07f1..c82bfe665cd8e 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.instance.lit.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-rds/test/integ.instance.lit.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "20.0.0", + "version": "30.1.0", "testCases": { "integ.instance.lit": { "stacks": [ diff --git a/packages/@aws-cdk/aws-rds/test/integ.instance.lit.js.snapshot/manifest.json b/packages/@aws-cdk/aws-rds/test/integ.instance.lit.js.snapshot/manifest.json index c78f81ebe89f1..95cadf434598f 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.instance.lit.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-rds/test/integ.instance.lit.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { - "version": "20.0.0", + "version": "30.1.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "aws-cdk-rds-instance.assets": { "type": "cdk:asset-manifest", "properties": { @@ -23,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/ca59a5a9368640ecbf25d69e1e3312350b2d7b735c3b73b031c02657142ca94b.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/e7bc0b577d93d8f59c7fe5e6f67a018347fe8fe4ea16a012eba5a7504564f2e0.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -243,10 +237,10 @@ "data": "InstanceSecretAttachmentRotationScheduleCC555119" } ], - "/aws-cdk-rds-instance/Instance/Secret/Attachment/Policy/Resource": [ + "/aws-cdk-rds-instance/Instance/Secret/Policy/Resource": [ { "type": "aws:cdk:logicalId", - "data": "InstanceSecretAttachmentPolicy60A8B8DE" + "data": "InstanceSecretPolicy87F03D0F" } ], "/aws-cdk-rds-instance/Instance/Resource": [ @@ -356,9 +350,24 @@ "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } + ], + "InstanceSecretAttachmentPolicy60A8B8DE": [ + { + "type": "aws:cdk:logicalId", + "data": "InstanceSecretAttachmentPolicy60A8B8DE", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } ] }, "displayName": "aws-cdk-rds-instance" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rds/test/integ.instance.lit.js.snapshot/tree.json b/packages/@aws-cdk/aws-rds/test/integ.instance.lit.js.snapshot/tree.json index 59040e2e6e3a0..504c4594cbf5b 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.instance.lit.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-rds/test/integ.instance.lit.js.snapshot/tree.json @@ -4,14 +4,6 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" - } - }, "aws-cdk-rds-instance": { "id": "aws-cdk-rds-instance", "path": "aws-cdk-rds-instance", @@ -91,8 +83,8 @@ "id": "Acl", "path": "aws-cdk-rds-instance/VPC/PublicSubnet1/Acl", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" } }, "RouteTable": { @@ -258,8 +250,8 @@ "id": "Acl", "path": "aws-cdk-rds-instance/VPC/PublicSubnet2/Acl", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" } }, "RouteTable": { @@ -425,8 +417,8 @@ "id": "Acl", "path": "aws-cdk-rds-instance/VPC/PrivateSubnet1/Acl", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" } }, "RouteTable": { @@ -544,8 +536,8 @@ "id": "Acl", "path": "aws-cdk-rds-instance/VPC/PrivateSubnet2/Acl", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" } }, "RouteTable": { @@ -920,6 +912,14 @@ "id": "MonitoringRole", "path": "aws-cdk-rds-instance/Instance/MonitoringRole", "children": { + "ImportMonitoringRole": { + "id": "ImportMonitoringRole", + "path": "aws-cdk-rds-instance/Instance/MonitoringRole/ImportMonitoringRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "aws-cdk-rds-instance/Instance/MonitoringRole/Resource", @@ -1057,64 +1057,64 @@ "fqn": "@aws-cdk/aws-secretsmanager.RotationSchedule", "version": "0.0.0" } - }, - "Policy": { - "id": "Policy", - "path": "aws-cdk-rds-instance/Instance/Secret/Attachment/Policy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-cdk-rds-instance/Instance/Secret/Attachment/Policy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::SecretsManager::ResourcePolicy", - "aws:cdk:cloudformation:props": { - "resourcePolicy": { - "Statement": [ - { - "Action": "secretsmanager:DeleteSecret", - "Effect": "Deny", - "Principal": { - "AWS": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::", - { - "Ref": "AWS::AccountId" - }, - ":root" - ] - ] - } - }, - "Resource": "*" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.SecretTargetAttachment", + "version": "0.0.0" + } + }, + "Policy": { + "id": "Policy", + "path": "aws-cdk-rds-instance/Instance/Secret/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-rds-instance/Instance/Secret/Policy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::ResourcePolicy", + "aws:cdk:cloudformation:props": { + "resourcePolicy": { + "Statement": [ + { + "Action": "secretsmanager:DeleteSecret", + "Effect": "Deny", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] } - ], - "Version": "2012-10-17" - }, - "secretId": { - "Ref": "InstanceSecretAttachment83BEE581" + }, + "Resource": "*" } - } + ], + "Version": "2012-10-17" }, - "constructInfo": { - "fqn": "@aws-cdk/aws-secretsmanager.CfnResourcePolicy", - "version": "0.0.0" + "secretId": { + "Ref": "InstanceSecret478E0A47" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-secretsmanager.ResourcePolicy", + "fqn": "@aws-cdk/aws-secretsmanager.CfnResourcePolicy", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-secretsmanager.SecretTargetAttachment", + "fqn": "@aws-cdk/aws-secretsmanager.ResourcePolicy", "version": "0.0.0" } } @@ -1214,8 +1214,8 @@ "id": "Resource", "path": "aws-cdk-rds-instance/Instance/LogRetentiontrace/Resource", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" } } }, @@ -1232,8 +1232,8 @@ "id": "Resource", "path": "aws-cdk-rds-instance/Instance/LogRetentionaudit/Resource", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" } } }, @@ -1250,8 +1250,8 @@ "id": "Resource", "path": "aws-cdk-rds-instance/Instance/LogRetentionalert/Resource", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" } } }, @@ -1268,8 +1268,8 @@ "id": "Resource", "path": "aws-cdk-rds-instance/Instance/LogRetentionlistener/Resource", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" } } }, @@ -1320,8 +1320,8 @@ "id": "SARMapping", "path": "aws-cdk-rds-instance/Instance/RotationSingleUser/SARMapping", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.CfnMapping", + "version": "0.0.0" } }, "Resource": { @@ -1525,8 +1525,8 @@ "id": "Stage", "path": "aws-cdk-rds-instance/LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8a/Code/Stage", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" } }, "AssetBucket": { @@ -1547,6 +1547,14 @@ "id": "ServiceRole", "path": "aws-cdk-rds-instance/LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8a/ServiceRole", "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "aws-cdk-rds-instance/LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8a/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "aws-cdk-rds-instance/LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8a/ServiceRole/Resource", @@ -1638,14 +1646,14 @@ "id": "Resource", "path": "aws-cdk-rds-instance/LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8a/Resource", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.85" + "version": "10.1.252" } }, "HighCPU": { @@ -1694,6 +1702,14 @@ "id": "ServiceRole", "path": "aws-cdk-rds-instance/Function/ServiceRole", "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "aws-cdk-rds-instance/Function/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "aws-cdk-rds-instance/Function/ServiceRole/Resource", @@ -1768,17 +1784,41 @@ "fqn": "@aws-cdk/aws-lambda.Function", "version": "0.0.0" } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-cdk-rds-instance/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-cdk-rds-instance/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } } }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.85" + "version": "10.1.252" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster-secret-rotation.js.snapshot/aws-cdk-rds-integ-secret-rotation.assets.json b/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster-secret-rotation.js.snapshot/aws-cdk-rds-integ-secret-rotation.assets.json new file mode 100644 index 0000000000000..c67db596bcf31 --- /dev/null +++ b/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster-secret-rotation.js.snapshot/aws-cdk-rds-integ-secret-rotation.assets.json @@ -0,0 +1,19 @@ +{ + "version": "30.1.0", + "files": { + "3b78e7a70e98ec500faa058ecc14892c94df0ab8d0359ba99718203b67d4a2e6": { + "source": { + "path": "aws-cdk-rds-integ-secret-rotation.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "3b78e7a70e98ec500faa058ecc14892c94df0ab8d0359ba99718203b67d4a2e6.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster-secret-rotation.js.snapshot/aws-cdk-rds-integ-secret-rotation.template.json b/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster-secret-rotation.js.snapshot/aws-cdk-rds-integ-secret-rotation.template.json new file mode 100644 index 0000000000000..84e9db49cabdc --- /dev/null +++ b/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster-secret-rotation.js.snapshot/aws-cdk-rds-integ-secret-rotation.template.json @@ -0,0 +1,234 @@ +{ + "Transform": "AWS::SecretsManager-2020-07-23", + "Resources": { + "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": "Retain", + "DeletionPolicy": "Retain" + }, + "testsecretF8BBC644": { + "Type": "AWS::SecretsManager::Secret", + "Properties": { + "Description": { + "Fn::Join": [ + "", + [ + "Generated by the CDK for stack: ", + { + "Ref": "AWS::StackName" + } + ] + ] + }, + "GenerateSecretString": { + "ExcludeCharacters": " %+~`#$&*()|[]{}:;<>?!'/@\"\\", + "GenerateStringKey": "password", + "PasswordLength": 30, + "SecretStringTemplate": "{\"username\":\"admin\"}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "testsecretAttachment19AD251F": { + "Type": "AWS::SecretsManager::SecretTargetAttachment", + "Properties": { + "SecretId": { + "Ref": "testsecretF8BBC644" + }, + "TargetId": { + "Ref": "DatabaseB269D8BB" + }, + "TargetType": "AWS::RDS::DBCluster" + } + }, + "testsecrettestscheduleEA0B5085": { + "Type": "AWS::SecretsManager::RotationSchedule", + "Properties": { + "SecretId": { + "Ref": "testsecretF8BBC644" + }, + "HostedRotationLambda": { + "ExcludeCharacters": " %+~`#$&*()|[]{}:;<>?!'/@\"\\", + "RotationType": "MySQLSingleUser" + }, + "RotationRules": { + "AutomaticallyAfterDays": 30 + } + } + }, + "testsecretPolicyA5D2F46F": { + "Type": "AWS::SecretsManager::ResourcePolicy", + "Properties": { + "ResourcePolicy": { + "Statement": [ + { + "Action": "secretsmanager:DeleteSecret", + "Effect": "Deny", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] + } + }, + "Resource": "*" + }, + { + "Action": [ + "secretsmanager:DescribeSecret", + "secretsmanager:GetSecretValue" + ], + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] + }, + "Service": "ecs-tasks.amazonaws.com" + }, + "Resource": { + "Ref": "testsecretAttachment19AD251F" + } + } + ], + "Version": "2012-10-17" + }, + "SecretId": { + "Ref": "testsecretF8BBC644" + } + } + }, + "DatabaseB269D8BB": { + "Type": "AWS::RDS::DBCluster", + "Properties": { + "CopyTagsToSnapshot": true, + "DBClusterParameterGroupName": "default.aurora-mysql5.7", + "EnableHttpEndpoint": true, + "Engine": "aurora-mysql", + "EngineMode": "serverless", + "KmsKeyId": { + "Fn::GetAtt": [ + "DbSecurity381C2C15", + "Arn" + ] + }, + "MasterUsername": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "testsecretF8BBC644" + }, + ":SecretString:username::}}" + ] + ] + }, + "MasterUserPassword": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "testsecretF8BBC644" + }, + ":SecretString:password::}}" + ] + ] + }, + "StorageEncrypted": true, + "VpcSecurityGroupIds": [] + }, + "UpdateReplacePolicy": "Snapshot", + "DeletionPolicy": "Snapshot" + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster-secret-rotation.js.snapshot/cdk.out b/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster-secret-rotation.js.snapshot/cdk.out new file mode 100644 index 0000000000000..b72fef144f05c --- /dev/null +++ b/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster-secret-rotation.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"30.1.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster-secret-rotation.js.snapshot/cdkrdsintegsecretrotationDefaultTestDeployAssert9780868B.assets.json b/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster-secret-rotation.js.snapshot/cdkrdsintegsecretrotationDefaultTestDeployAssert9780868B.assets.json new file mode 100644 index 0000000000000..b8d0a12323139 --- /dev/null +++ b/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster-secret-rotation.js.snapshot/cdkrdsintegsecretrotationDefaultTestDeployAssert9780868B.assets.json @@ -0,0 +1,19 @@ +{ + "version": "30.1.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "cdkrdsintegsecretrotationDefaultTestDeployAssert9780868B.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster-secret-rotation.js.snapshot/cdkrdsintegsecretrotationDefaultTestDeployAssert9780868B.template.json b/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster-secret-rotation.js.snapshot/cdkrdsintegsecretrotationDefaultTestDeployAssert9780868B.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster-secret-rotation.js.snapshot/cdkrdsintegsecretrotationDefaultTestDeployAssert9780868B.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster-secret-rotation.js.snapshot/integ.json b/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster-secret-rotation.js.snapshot/integ.json new file mode 100644 index 0000000000000..796211c1a7c05 --- /dev/null +++ b/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster-secret-rotation.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "30.1.0", + "testCases": { + "cdk-rds-integ-secret-rotation/DefaultTest": { + "stacks": [ + "aws-cdk-rds-integ-secret-rotation" + ], + "assertionStack": "cdk-rds-integ-secret-rotation/DefaultTest/DeployAssert", + "assertionStackName": "cdkrdsintegsecretrotationDefaultTestDeployAssert9780868B" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster-secret-rotation.js.snapshot/manifest.json b/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster-secret-rotation.js.snapshot/manifest.json new file mode 100644 index 0000000000000..db97d586370c2 --- /dev/null +++ b/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster-secret-rotation.js.snapshot/manifest.json @@ -0,0 +1,141 @@ +{ + "version": "30.1.0", + "artifacts": { + "aws-cdk-rds-integ-secret-rotation.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "aws-cdk-rds-integ-secret-rotation.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "aws-cdk-rds-integ-secret-rotation": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "aws-cdk-rds-integ-secret-rotation.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/3b78e7a70e98ec500faa058ecc14892c94df0ab8d0359ba99718203b67d4a2e6.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "aws-cdk-rds-integ-secret-rotation.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "aws-cdk-rds-integ-secret-rotation.assets" + ], + "metadata": { + "/aws-cdk-rds-integ-secret-rotation/DbSecurity/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "DbSecurity381C2C15" + } + ], + "/aws-cdk-rds-integ-secret-rotation/test-secret/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsecretF8BBC644" + } + ], + "/aws-cdk-rds-integ-secret-rotation/test-secret/Attachment/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsecretAttachment19AD251F" + } + ], + "/aws-cdk-rds-integ-secret-rotation/test-secret/test-schedule/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsecrettestscheduleEA0B5085" + } + ], + "/aws-cdk-rds-integ-secret-rotation/test-secret/Policy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsecretPolicyA5D2F46F" + } + ], + "/aws-cdk-rds-integ-secret-rotation/Database/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "DatabaseB269D8BB" + } + ], + "/aws-cdk-rds-integ-secret-rotation/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/aws-cdk-rds-integ-secret-rotation/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "aws-cdk-rds-integ-secret-rotation" + }, + "cdkrdsintegsecretrotationDefaultTestDeployAssert9780868B.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "cdkrdsintegsecretrotationDefaultTestDeployAssert9780868B.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "cdkrdsintegsecretrotationDefaultTestDeployAssert9780868B": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "cdkrdsintegsecretrotationDefaultTestDeployAssert9780868B.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "cdkrdsintegsecretrotationDefaultTestDeployAssert9780868B.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "cdkrdsintegsecretrotationDefaultTestDeployAssert9780868B.assets" + ], + "metadata": { + "/cdk-rds-integ-secret-rotation/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/cdk-rds-integ-secret-rotation/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "cdk-rds-integ-secret-rotation/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster-secret-rotation.js.snapshot/tree.json b/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster-secret-rotation.js.snapshot/tree.json new file mode 100644 index 0000000000000..324bde72c38a6 --- /dev/null +++ b/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster-secret-rotation.js.snapshot/tree.json @@ -0,0 +1,406 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "aws-cdk-rds-integ-secret-rotation": { + "id": "aws-cdk-rds-integ-secret-rotation", + "path": "aws-cdk-rds-integ-secret-rotation", + "children": { + "DbSecurity": { + "id": "DbSecurity", + "path": "aws-cdk-rds-integ-secret-rotation/DbSecurity", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-rds-integ-secret-rotation/DbSecurity/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::KMS::Key", + "aws:cdk:cloudformation:props": { + "keyPolicy": { + "Statement": [ + { + "Action": "kms:*", + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] + } + }, + "Resource": "*" + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-kms.CfnKey", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-kms.Key", + "version": "0.0.0" + } + }, + "test-secret": { + "id": "test-secret", + "path": "aws-cdk-rds-integ-secret-rotation/test-secret", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-rds-integ-secret-rotation/test-secret/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::Secret", + "aws:cdk:cloudformation:props": { + "description": { + "Fn::Join": [ + "", + [ + "Generated by the CDK for stack: ", + { + "Ref": "AWS::StackName" + } + ] + ] + }, + "generateSecretString": { + "passwordLength": 30, + "secretStringTemplate": "{\"username\":\"admin\"}", + "generateStringKey": "password", + "excludeCharacters": " %+~`#$&*()|[]{}:;<>?!'/@\"\\" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.CfnSecret", + "version": "0.0.0" + } + }, + "Attachment": { + "id": "Attachment", + "path": "aws-cdk-rds-integ-secret-rotation/test-secret/Attachment", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-rds-integ-secret-rotation/test-secret/Attachment/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::SecretTargetAttachment", + "aws:cdk:cloudformation:props": { + "secretId": { + "Ref": "testsecretF8BBC644" + }, + "targetId": { + "Ref": "DatabaseB269D8BB" + }, + "targetType": "AWS::RDS::DBCluster" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.CfnSecretTargetAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.SecretTargetAttachment", + "version": "0.0.0" + } + }, + "test-schedule": { + "id": "test-schedule", + "path": "aws-cdk-rds-integ-secret-rotation/test-secret/test-schedule", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-rds-integ-secret-rotation/test-secret/test-schedule/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::RotationSchedule", + "aws:cdk:cloudformation:props": { + "secretId": { + "Ref": "testsecretF8BBC644" + }, + "hostedRotationLambda": { + "rotationType": "MySQLSingleUser", + "excludeCharacters": " %+~`#$&*()|[]{}:;<>?!'/@\"\\" + }, + "rotationRules": { + "automaticallyAfterDays": 30 + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.CfnRotationSchedule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.RotationSchedule", + "version": "0.0.0" + } + }, + "Policy": { + "id": "Policy", + "path": "aws-cdk-rds-integ-secret-rotation/test-secret/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-rds-integ-secret-rotation/test-secret/Policy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::ResourcePolicy", + "aws:cdk:cloudformation:props": { + "resourcePolicy": { + "Statement": [ + { + "Action": "secretsmanager:DeleteSecret", + "Effect": "Deny", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] + } + }, + "Resource": "*" + }, + { + "Action": [ + "secretsmanager:DescribeSecret", + "secretsmanager:GetSecretValue" + ], + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] + }, + "Service": "ecs-tasks.amazonaws.com" + }, + "Resource": { + "Ref": "testsecretAttachment19AD251F" + } + } + ], + "Version": "2012-10-17" + }, + "secretId": { + "Ref": "testsecretF8BBC644" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.CfnResourcePolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.ResourcePolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-rds.DatabaseSecret", + "version": "0.0.0" + } + }, + "Database": { + "id": "Database", + "path": "aws-cdk-rds-integ-secret-rotation/Database", + "children": { + "AuroraMySqlDatabaseClusterEngineDefaultParameterGroup": { + "id": "AuroraMySqlDatabaseClusterEngineDefaultParameterGroup", + "path": "aws-cdk-rds-integ-secret-rotation/Database/AuroraMySqlDatabaseClusterEngineDefaultParameterGroup", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-rds-integ-secret-rotation/Database/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::RDS::DBCluster", + "aws:cdk:cloudformation:props": { + "copyTagsToSnapshot": true, + "dbClusterParameterGroupName": "default.aurora-mysql5.7", + "enableHttpEndpoint": true, + "engine": "aurora-mysql", + "engineMode": "serverless", + "kmsKeyId": { + "Fn::GetAtt": [ + "DbSecurity381C2C15", + "Arn" + ] + }, + "masterUsername": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "testsecretF8BBC644" + }, + ":SecretString:username::}}" + ] + ] + }, + "masterUserPassword": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "testsecretF8BBC644" + }, + ":SecretString:password::}}" + ] + ] + }, + "storageEncrypted": true, + "vpcSecurityGroupIds": [] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-rds.CfnDBCluster", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-rds.ServerlessCluster", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-cdk-rds-integ-secret-rotation/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-cdk-rds-integ-secret-rotation/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "cdk-rds-integ-secret-rotation": { + "id": "cdk-rds-integ-secret-rotation", + "path": "cdk-rds-integ-secret-rotation", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "cdk-rds-integ-secret-rotation/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "cdk-rds-integ-secret-rotation/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.252" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "cdk-rds-integ-secret-rotation/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "cdk-rds-integ-secret-rotation/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "cdk-rds-integ-secret-rotation/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.252" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster-secret-rotation.ts b/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster-secret-rotation.ts new file mode 100644 index 0000000000000..af00df5d5ce99 --- /dev/null +++ b/packages/@aws-cdk/aws-rds/test/integ.serverless-cluster-secret-rotation.ts @@ -0,0 +1,33 @@ +import * as iam from '@aws-cdk/aws-iam'; +import * as kms from '@aws-cdk/aws-kms'; +import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; +import * as cdk from '@aws-cdk/core'; +import { IntegTest } from '@aws-cdk/integ-tests'; +import { Credentials, ServerlessCluster, DatabaseClusterEngine, DatabaseSecret } from '../lib'; + +const app = new cdk.App(); +const stack = new cdk.Stack(app, 'aws-cdk-rds-integ-secret-rotation'); + +const kmsKey = new kms.Key(stack, 'DbSecurity'); +const secret = new DatabaseSecret(stack, 'test-secret', { + username: 'admin', +}); + +const cluster = new ServerlessCluster(stack, 'Database', { + engine: DatabaseClusterEngine.AURORA_MYSQL, + credentials: Credentials.fromSecret(secret), + storageEncryptionKey: kmsKey, +}); + +secret.addRotationSchedule('test-schedule', { + hostedRotation: secretsmanager.HostedRotation.mysqlSingleUser(), +}); + +cluster.grantDataApiAccess(new iam.AccountRootPrincipal()); +cluster.grantDataApiAccess(new iam.ServicePrincipal('ecs-tasks.amazonaws.com')); + +new IntegTest(app, 'cdk-rds-integ-secret-rotation', { + testCases: [stack], +}); + +app.synth(); diff --git a/packages/@aws-cdk/aws-redshift/package.json b/packages/@aws-cdk/aws-redshift/package.json index eed9d19d1b10c..e3e4f52a79eed 100644 --- a/packages/@aws-cdk/aws-redshift/package.json +++ b/packages/@aws-cdk/aws-redshift/package.json @@ -87,7 +87,7 @@ "@aws-cdk/pkglint": "0.0.0", "@aws-cdk/integ-tests": "0.0.0", "@types/jest": "^27.5.2", - "aws-sdk": "^2.1317.0", + "aws-sdk": "^2.1325.0", "jest": "^27.5.1", "jsii": "v4.9-next" }, diff --git a/packages/@aws-cdk/aws-route53/package.json b/packages/@aws-cdk/aws-route53/package.json index 70fe58b64d860..c25d2219a974a 100644 --- a/packages/@aws-cdk/aws-route53/package.json +++ b/packages/@aws-cdk/aws-route53/package.json @@ -85,9 +85,9 @@ "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/cfn2ts": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/aws-lambda": "^8.10.110", + "@types/aws-lambda": "^8.10.111", "@types/jest": "^27.5.2", - "aws-sdk": "^2.1317.0", + "aws-sdk": "^2.1325.0", "jest": "^27.5.1" }, "dependencies": { diff --git a/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/asset.5d8d1d0aacea23824c62f362e1e3c14b7dd14a31c71b53bfae4d14a6373c5510.zip b/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/asset.5d8d1d0aacea23824c62f362e1e3c14b7dd14a31c71b53bfae4d14a6373c5510.zip index d1065f07d934c..f62fe1e5a06d6 100644 Binary files a/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/asset.5d8d1d0aacea23824c62f362e1e3c14b7dd14a31c71b53bfae4d14a6373c5510.zip and b/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/asset.5d8d1d0aacea23824c62f362e1e3c14b7dd14a31c71b53bfae4d14a6373c5510.zip differ diff --git a/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/asset.e3900c1e0365029a742f5b51f9ccb158093a5e209a71840a41f9793498c3ed1b.bundle/index.js b/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle/index.js similarity index 60% rename from packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/asset.e3900c1e0365029a742f5b51f9ccb158093a5e209a71840a41f9793498c3ed1b.bundle/index.js rename to packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle/index.js index d26d8b290deae..58bcb1ef7f38e 100644 --- a/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/asset.e3900c1e0365029a742f5b51f9ccb158093a5e209a71840a41f9793498c3ed1b.bundle/index.js +++ b/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle/index.js @@ -1,3 +1,4 @@ +"use strict"; var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; @@ -17,6 +18,10 @@ var __copyProps = (to, from, except, desc) => { return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); @@ -33,40 +38,83 @@ module.exports = __toCommonJS(lambda_handler_exports); // ../assertions/lib/matcher.ts var Matcher = class { + /** + * Check whether the provided object is a subtype of the `IMatcher`. + */ static isMatcher(x) { return x && x instanceof Matcher; } }; var MatchResult = class { constructor(target) { - this.failures = []; + this.failuresHere = /* @__PURE__ */ new Map(); this.captures = /* @__PURE__ */ new Map(); this.finalized = false; + this.innerMatchFailures = /* @__PURE__ */ new Map(); + this._hasFailed = false; + this._failCount = 0; + this._cost = 0; this.target = target; } + /** + * DEPRECATED + * @deprecated use recordFailure() + */ push(matcher, path, message) { return this.recordFailure({ matcher, path, message }); } + /** + * Record a new failure into this result at a specific path. + */ recordFailure(failure) { - this.failures.push(failure); + const failKey = failure.path.join("."); + let list = this.failuresHere.get(failKey); + if (!list) { + list = []; + this.failuresHere.set(failKey, list); + } + this._failCount += 1; + this._cost += failure.cost ?? 1; + list.push(failure); + this._hasFailed = true; return this; } + /** Whether the match is a success */ + get isSuccess() { + return !this._hasFailed; + } + /** Does the result contain any failures. If not, the result is a success */ hasFailed() { - return this.failures.length !== 0; + return this._hasFailed; } + /** The number of failures */ get failCount() { - return this.failures.length; + return this._failCount; } + /** The cost of the failures so far */ + get failCost() { + return this._cost; + } + /** + * Compose the results of a previous match as a subtree. + * @param id the id of the parent tree. + */ compose(id, inner) { - const innerF = inner.failures; - this.failures.push(...innerF.map((f) => { - return { path: [id, ...f.path], message: f.message, matcher: f.matcher }; - })); + if (inner.hasFailed()) { + this._hasFailed = true; + this._failCount += inner.failCount; + this._cost += inner._cost; + this.innerMatchFailures.set(id, inner); + } inner.captures.forEach((vals, capture) => { vals.forEach((value) => this.recordCapture({ capture, value })); }); return this; } + /** + * Prepare the result to be analyzed. + * This API *must* be called prior to analyzing these results. + */ finished() { if (this.finalized) { return this; @@ -77,12 +125,169 @@ var MatchResult = class { this.finalized = true; return this; } + /** + * Render the failed match in a presentable way + * + * Prefer using `renderMismatch` over this method. It is left for backwards + * compatibility for test suites that expect it, but `renderMismatch()` will + * produce better output. + */ toHumanStrings() { - return this.failures.map((r) => { - const loc = r.path.length === 0 ? "" : ` at ${r.path.join("")}`; + const failures = new Array(); + debugger; + recurse(this, []); + return failures.map((r) => { + const loc = r.path.length === 0 ? "" : ` at /${r.path.join("/")}`; return "" + r.message + loc + ` (using ${r.matcher.name} matcher)`; }); + function recurse(x, prefix) { + for (const fail of Array.from(x.failuresHere.values()).flat()) { + failures.push({ + matcher: fail.matcher, + message: fail.message, + path: [...prefix, ...fail.path] + }); + } + for (const [key, inner] of x.innerMatchFailures.entries()) { + recurse(inner, [...prefix, key]); + } + } } + /** + * Do a deep render of the match result, showing the structure mismatches in context + */ + renderMismatch() { + if (!this.hasFailed()) { + return ""; + } + const parts = new Array(); + const indents = new Array(); + emitFailures(this, ""); + recurse(this); + return moveMarkersToFront(parts.join("").trimEnd()); + function emit(x) { + if (x === void 0) { + debugger; + } + parts.push(x.replace(/\n/g, ` +${indents.join("")}`)); + } + function emitFailures(r, path, scrapSet) { + for (const fail of r.failuresHere.get(path) ?? []) { + emit(`!! ${fail.message} +`); + } + scrapSet == null ? void 0 : scrapSet.delete(path); + } + function recurse(r) { + const remainingFailures = new Set(Array.from(r.failuresHere.keys()).filter((x) => x !== "")); + if (Array.isArray(r.target)) { + indents.push(" "); + emit("[\n"); + for (const [first, i] of enumFirst(range(r.target.length))) { + if (!first) { + emit(",\n"); + } + emitFailures(r, `${i}`, remainingFailures); + const innerMatcher = r.innerMatchFailures.get(`${i}`); + if (innerMatcher) { + emitFailures(innerMatcher, ""); + recurseComparingValues(innerMatcher, r.target[i]); + } else { + emit(renderAbridged(r.target[i])); + } + } + emitRemaining(); + indents.pop(); + emit("\n]"); + return; + } + if (r.target && typeof r.target === "object") { + indents.push(" "); + emit("{\n"); + const keys = Array.from(/* @__PURE__ */ new Set([ + ...Object.keys(r.target), + ...Array.from(remainingFailures) + ])).sort(); + for (const [first, key] of enumFirst(keys)) { + if (!first) { + emit(",\n"); + } + emitFailures(r, key, remainingFailures); + const innerMatcher = r.innerMatchFailures.get(key); + if (innerMatcher) { + emitFailures(innerMatcher, ""); + emit(`${jsonify(key)}: `); + recurseComparingValues(innerMatcher, r.target[key]); + } else { + emit(`${jsonify(key)}: `); + emit(renderAbridged(r.target[key])); + } + } + emitRemaining(); + indents.pop(); + emit("\n}"); + return; + } + emitRemaining(); + emit(jsonify(r.target)); + function emitRemaining() { + if (remainingFailures.size > 0) { + emit("\n"); + } + for (const key of remainingFailures) { + emitFailures(r, key); + } + } + } + function recurseComparingValues(inner, actualValue) { + if (inner.target === actualValue) { + return recurse(inner); + } + emit(renderAbridged(actualValue)); + emit(" <*> "); + recurse(inner); + } + function renderAbridged(x) { + if (Array.isArray(x)) { + switch (x.length) { + case 0: + return "[]"; + case 1: + return `[ ${renderAbridged(x[0])} ]`; + case 2: + if (x.every((e) => ["number", "boolean", "string"].includes(typeof e))) { + return `[ ${x.map(renderAbridged).join(", ")} ]`; + } + return "[ ... ]"; + default: + return "[ ... ]"; + } + } + if (x && typeof x === "object") { + const keys = Object.keys(x); + switch (keys.length) { + case 0: + return "{}"; + case 1: + return `{ ${JSON.stringify(keys[0])}: ${renderAbridged(x[keys[0]])} }`; + default: + return "{ ... }"; + } + } + return jsonify(x); + } + function jsonify(x) { + return JSON.stringify(x) ?? "undefined"; + } + function moveMarkersToFront(x) { + const re = /^(\s+)!!/gm; + return x.replace(re, (_, spaces) => `!!${spaces.substring(0, spaces.length - 2)}`); + } + } + /** + * Record a capture against in this match result. + */ recordCapture(options) { let values = this.captures.get(options.capture); if (values === void 0) { @@ -92,6 +297,18 @@ var MatchResult = class { this.captures.set(options.capture, values); } }; +function* range(n) { + for (let i = 0; i < n; i++) { + yield i; + } +} +function* enumFirst(xs) { + let first = true; + for (const x of xs) { + yield [first, x]; + first = false; + } +} // ../assertions/lib/private/matchers/absent.ts var AbsentMatch = class extends Matcher { @@ -112,6 +329,51 @@ var AbsentMatch = class extends Matcher { } }; +// ../assertions/lib/private/sorting.ts +function sortKeyComparator(keyFn) { + return (a, b) => { + const ak = keyFn(a); + const bk = keyFn(b); + for (let i = 0; i < ak.length && i < bk.length; i++) { + const av = ak[i]; + const bv = bk[i]; + let diff = 0; + if (typeof av === "number" && typeof bv === "number") { + diff = av - bv; + } else if (typeof av === "string" && typeof bv === "string") { + diff = av.localeCompare(bv); + } + if (diff !== 0) { + return diff; + } + } + return bk.length - ak.length; + }; +} + +// ../assertions/lib/private/sparse-matrix.ts +var SparseMatrix = class { + constructor() { + this.matrix = /* @__PURE__ */ new Map(); + } + get(row, col) { + var _a; + return (_a = this.matrix.get(row)) == null ? void 0 : _a.get(col); + } + row(row) { + var _a; + return Array.from(((_a = this.matrix.get(row)) == null ? void 0 : _a.entries()) ?? []); + } + set(row, col, value) { + let r = this.matrix.get(row); + if (!r) { + r = /* @__PURE__ */ new Map(); + this.matrix.set(row, r); + } + r.set(col, value); + } +}; + // ../assertions/lib/private/type.ts function getType(obj) { return Array.isArray(obj) ? "array" : typeof obj; @@ -119,33 +381,74 @@ function getType(obj) { // ../assertions/lib/match.ts var Match = class { + /** + * Use this matcher in the place of a field's value, if the field must not be present. + */ static absent() { return new AbsentMatch("absent"); } + /** + * Matches the specified pattern with the array found in the same relative path of the target. + * The set of elements (or matchers) must be in the same order as would be found. + * @param pattern the pattern to match + */ static arrayWith(pattern) { return new ArrayMatch("arrayWith", pattern); } + /** + * Matches the specified pattern with the array found in the same relative path of the target. + * The set of elements (or matchers) must match exactly and in order. + * @param pattern the pattern to match + */ static arrayEquals(pattern) { return new ArrayMatch("arrayEquals", pattern, { subsequence: false }); } + /** + * Deep exact matching of the specified pattern to the target. + * @param pattern the pattern to match + */ static exact(pattern) { return new LiteralMatch("exact", pattern, { partialObjects: false }); } + /** + * Matches the specified pattern to an object found in the same relative path of the target. + * The keys and their values (or matchers) must be present in the target but the target can be a superset. + * @param pattern the pattern to match + */ static objectLike(pattern) { return new ObjectMatch("objectLike", pattern); } + /** + * Matches the specified pattern to an object found in the same relative path of the target. + * The keys and their values (or matchers) must match exactly with the target. + * @param pattern the pattern to match + */ static objectEquals(pattern) { return new ObjectMatch("objectEquals", pattern, { partial: false }); } + /** + * Matches any target which does NOT follow the specified pattern. + * @param pattern the pattern to NOT match + */ static not(pattern) { return new NotMatch("not", pattern); } + /** + * Matches any string-encoded JSON and applies the specified pattern after parsing it. + * @param pattern the pattern to match after parsing the encoded JSON. + */ static serializedJson(pattern) { return new SerializedJson("serializedJson", pattern); } + /** + * Matches any non-null value at the target. + */ static anyValue() { return new AnyMatch("anyValue"); } + /** + * Matches targets according to a regular expression + */ static stringLikeRegexp(pattern) { return new StringLikeRegexpMatch("stringLikeRegexp", pattern); } @@ -202,40 +505,87 @@ var ArrayMatch = class extends Matcher { message: `Expected type array but received ${getType(actual)}` }); } - if (!this.subsequence && this.pattern.length !== actual.length) { - return new MatchResult(actual).recordFailure({ + return this.subsequence ? this.testSubsequence(actual) : this.testFullArray(actual); + } + testFullArray(actual) { + const result = new MatchResult(actual); + let i = 0; + for (; i < this.pattern.length && i < actual.length; i++) { + const patternElement = this.pattern[i]; + const matcher = Matcher.isMatcher(patternElement) ? patternElement : new LiteralMatch(this.name, patternElement, { partialObjects: this.partialObjects }); + const innerResult = matcher.test(actual[i]); + result.compose(`${i}`, innerResult); + } + if (i < this.pattern.length) { + result.recordFailure({ matcher: this, - path: [], - message: `Expected array of length ${this.pattern.length} but received ${actual.length}` + message: `Not enough elements in array (expecting ${this.pattern.length}, got ${actual.length})`, + path: [`${i}`] + }); + } + if (i < actual.length) { + result.recordFailure({ + matcher: this, + message: `Too many elements in array (expecting ${this.pattern.length}, got ${actual.length})`, + path: [`${i}`] }); } + return result; + } + testSubsequence(actual) { + const result = new MatchResult(actual); let patternIdx = 0; let actualIdx = 0; - const result = new MatchResult(actual); + const matches = new SparseMatrix(); while (patternIdx < this.pattern.length && actualIdx < actual.length) { const patternElement = this.pattern[patternIdx]; const matcher = Matcher.isMatcher(patternElement) ? patternElement : new LiteralMatch(this.name, patternElement, { partialObjects: this.partialObjects }); const matcherName = matcher.name; - if (this.subsequence && (matcherName == "absent" || matcherName == "anyValue")) { + if (matcherName == "absent" || matcherName == "anyValue") { throw new Error(`The Matcher ${matcherName}() cannot be nested within arrayWith()`); } const innerResult = matcher.test(actual[actualIdx]); - if (!this.subsequence || !innerResult.hasFailed()) { - result.compose(`[${actualIdx}]`, innerResult); + matches.set(patternIdx, actualIdx, innerResult); + actualIdx++; + if (innerResult.isSuccess) { + result.compose(`${actualIdx}`, innerResult); patternIdx++; - actualIdx++; - } else { - actualIdx++; } } - for (; patternIdx < this.pattern.length; patternIdx++) { - const pattern = this.pattern[patternIdx]; - const element = Matcher.isMatcher(pattern) || typeof pattern === "object" ? " " : ` [${pattern}] `; - result.recordFailure({ - matcher: this, - path: [], - message: `Missing element${element}at pattern index ${patternIdx}` - }); + if (patternIdx < this.pattern.length) { + for (let spi = 0; spi < patternIdx; spi++) { + const foundMatch = matches.row(spi).find(([, r]) => r.isSuccess); + if (!foundMatch) { + continue; + } + const [index] = foundMatch; + result.compose(`${index}`, new MatchResult(actual[index]).recordFailure({ + matcher: this, + message: `arrayWith pattern ${spi} matched here`, + path: [], + cost: 0 + // This is an informational message so it would be unfair to assign it cost + })); + } + const failedMatches = matches.row(patternIdx); + failedMatches.sort(sortKeyComparator(([i, r]) => [r.failCost, i])); + if (failedMatches.length > 0) { + const [index, innerResult] = failedMatches[0]; + result.recordFailure({ + matcher: this, + message: `Could not match arrayWith pattern ${patternIdx}. This is the closest match`, + path: [`${index}`], + cost: 0 + // Informational message + }); + result.compose(`${index}`, innerResult); + } else { + result.recordFailure({ + matcher: this, + message: `Could not match arrayWith pattern ${patternIdx}. No more elements to try`, + path: [`${actual.length}`] + }); + } } return result; } @@ -261,8 +611,8 @@ var ObjectMatch = class extends Matcher { if (!(a in this.pattern)) { result.recordFailure({ matcher: this, - path: [`/${a}`], - message: "Unexpected key" + path: [a], + message: `Unexpected key ${a}` }); } } @@ -271,14 +621,14 @@ var ObjectMatch = class extends Matcher { if (!(patternKey in actual) && !(patternVal instanceof AbsentMatch)) { result.recordFailure({ matcher: this, - path: [`/${patternKey}`], - message: `Missing key '${patternKey}' among {${Object.keys(actual).join(",")}}` + path: [patternKey], + message: `Missing key '${patternKey}'` }); continue; } const matcher = Matcher.isMatcher(patternVal) ? patternVal : new LiteralMatch(this.name, patternVal, { partialObjects: this.partial }); const inner = matcher.test(actual[patternKey]); - result.compose(`/${patternKey}`, inner); + result.compose(patternKey, inner); } return result; } @@ -290,34 +640,37 @@ var SerializedJson = class extends Matcher { this.pattern = pattern; } test(actual) { - const result = new MatchResult(actual); if (getType(actual) !== "string") { - result.recordFailure({ + return new MatchResult(actual).recordFailure({ matcher: this, path: [], message: `Expected JSON as a string but found ${getType(actual)}` }); - return result; } let parsed; try { parsed = JSON.parse(actual); } catch (err) { if (err instanceof SyntaxError) { - result.recordFailure({ + return new MatchResult(actual).recordFailure({ matcher: this, path: [], message: `Invalid JSON string: ${actual}` }); - return result; } else { throw err; } } const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); const innerResult = matcher.test(parsed); - result.compose(`(${this.name})`, innerResult); - return result; + if (innerResult.hasFailed()) { + innerResult.recordFailure({ + matcher: this, + path: [], + message: "Encoded JSON value does not match" + }); + } + return innerResult; } }; var NotMatch = class extends Matcher { @@ -404,6 +757,10 @@ var CustomResourceHandler = class { this.event = event; this.physicalResourceId = extractPhysicalResourceId(event); } + /** + * Handles executing the custom resource event. If `stateMachineArn` is present + * in the props then trigger the waiter statemachine + */ async handle() { try { if ("stateMachineArn" in this.event.ResourceProperties) { @@ -425,6 +782,9 @@ var CustomResourceHandler = class { clearTimeout(this.timeout); } } + /** + * Handle async requests from the waiter state machine + */ async handleIsComplete() { try { const result = await this.processEvent(this.event.ResourceProperties); @@ -436,6 +796,10 @@ var CustomResourceHandler = class { clearTimeout(this.timeout); } } + /** + * Start a step function state machine which will wait for the request + * to be successful. + */ async startExecution(req) { try { const sfn = new AWS.StepFunctions(); @@ -506,10 +870,7 @@ var AssertionHandler = class extends CustomResourceHandler { failed: true, assertion: JSON.stringify({ status: "fail", - message: [ - ...matchResult.toHumanStrings(), - JSON.stringify(matchResult.target, void 0, 2) - ].join("\n") + message: matchResult.renderMismatch() }) }; if (request2.failDeployment) { @@ -531,6 +892,65 @@ var MatchCreator = class { matcher: obj }; } + /** + * Return a Matcher that can be tested against the actual results. + * This will convert the encoded matchers into their corresponding + * assertions matcher. + * + * For example: + * + * ExpectedResult.objectLike({ + * Messages: [{ + * Body: Match.objectLike({ + * Elements: Match.arrayWith([{ Asdf: 3 }]), + * Payload: Match.serializedJson({ key: 'value' }), + * }), + * }], + * }); + * + * Will be encoded as: + * { + * $ObjectLike: { + * Messages: [{ + * Body: { + * $ObjectLike: { + * Elements: { + * $ArrayWith: [{ Asdf: 3 }], + * }, + * Payload: { + * $SerializedJson: { key: 'value' } + * } + * }, + * }, + * }], + * }, + * } + * + * Which can then be parsed by this function. For each key (recursively) + * the parser will check if the value has one of the encoded matchers as a key + * and if so, it will set the value as the Matcher. So, + * + * { + * Body: { + * $ObjectLike: { + * Elements: { + * $ArrayWith: [{ Asdf: 3 }], + * }, + * Payload: { + * $SerializedJson: { key: 'value' } + * } + * }, + * }, + * } + * + * Will be converted to + * { + * Body: Match.objectLike({ + * Elements: Match.arrayWith([{ Asdf: 3 }]), + * Payload: Match.serializedJson({ key: 'value' }), + * }), + * } + */ getMatcher() { try { const final = JSON.parse(JSON.stringify(this.parsedObj), function(_k, v) { @@ -542,6 +962,8 @@ var MatchCreator = class { return Match.objectLike(v[nested]); case "$StringLike": return Match.stringLikeRegexp(v[nested]); + case "$SerializedJson": + return Match.serializedJson(v[nested]); default: return v; } @@ -678,6 +1100,7 @@ async function handler(event, context) { await provider.respond({ status: "SUCCESS", reason: "OK", + // return both the result of the API call _and_ the assertion results data: { ...assertionResult, ...result diff --git a/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/cdk.out b/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/cdk.out index 145739f539580..b72fef144f05c 100644 --- a/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"22.0.0"} \ No newline at end of file +{"version":"30.1.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/integ.json b/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/integ.json index 258cb246cc28d..eca95212c44ed 100644 --- a/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "22.0.0", + "version": "30.1.0", "testCases": { "integ-test-bucket-deployments/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/integtestbucketdeploymentsDefaultTestDeployAssertCF25A2DF.assets.json b/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/integtestbucketdeploymentsDefaultTestDeployAssertCF25A2DF.assets.json index 4c728fe27d8c8..205d7688474e5 100644 --- a/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/integtestbucketdeploymentsDefaultTestDeployAssertCF25A2DF.assets.json +++ b/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/integtestbucketdeploymentsDefaultTestDeployAssertCF25A2DF.assets.json @@ -1,20 +1,20 @@ { - "version": "22.0.0", + "version": "30.1.0", "files": { - "e3900c1e0365029a742f5b51f9ccb158093a5e209a71840a41f9793498c3ed1b": { + "73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4": { "source": { - "path": "asset.e3900c1e0365029a742f5b51f9ccb158093a5e209a71840a41f9793498c3ed1b.bundle", + "path": "asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "e3900c1e0365029a742f5b51f9ccb158093a5e209a71840a41f9793498c3ed1b.zip", + "objectKey": "73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "320a35b24ed97136c867ae2541ddd087d6d0ff3502311494d4aa87572b881e91": { + "cb68a9799f1b0a01be938de2628b70716eb6756ab8b00a9cc4e25379b475254e": { "source": { "path": "integtestbucketdeploymentsDefaultTestDeployAssertCF25A2DF.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "320a35b24ed97136c867ae2541ddd087d6d0ff3502311494d4aa87572b881e91.json", + "objectKey": "cb68a9799f1b0a01be938de2628b70716eb6756ab8b00a9cc4e25379b475254e.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/integtestbucketdeploymentsDefaultTestDeployAssertCF25A2DF.template.json b/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/integtestbucketdeploymentsDefaultTestDeployAssertCF25A2DF.template.json index d9de0017d7da7..8325db2396a0a 100644 --- a/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/integtestbucketdeploymentsDefaultTestDeployAssertCF25A2DF.template.json +++ b/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/integtestbucketdeploymentsDefaultTestDeployAssertCF25A2DF.template.json @@ -18,7 +18,7 @@ } }, "flattenResponse": "false", - "salt": "1671126524996" + "salt": "1677600919513" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -82,7 +82,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "e3900c1e0365029a742f5b51f9ccb158093a5e209a71840a41f9793498c3ed1b.zip" + "S3Key": "73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.zip" }, "Timeout": 120, "Handler": "index.handler", diff --git a/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/manifest.json b/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/manifest.json index bd74b674f0dd0..c1296996930d5 100644 --- a/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "22.0.0", + "version": "30.1.0", "artifacts": { "test-bucket-deployments-2.assets": { "type": "cdk:asset-manifest", @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/9854d9c205c56719d3e954eb4cf27a828725afdcd6e7e00b7ccecfce1866740f.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/5f955b28abc21da07dc33a4cdd724c0f329f3bb14a71217ca89b731e2ab54413.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -484,7 +484,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/320a35b24ed97136c867ae2541ddd087d6d0ff3502311494d4aa87572b881e91.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/cb68a9799f1b0a01be938de2628b70716eb6756ab8b00a9cc4e25379b475254e.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/test-bucket-deployments-2.assets.json b/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/test-bucket-deployments-2.assets.json index a705c32a9f7c6..d88f37ddc79ed 100644 --- a/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/test-bucket-deployments-2.assets.json +++ b/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/test-bucket-deployments-2.assets.json @@ -1,5 +1,5 @@ { - "version": "22.0.0", + "version": "30.1.0", "files": { "33e2651435a0d472a75c1e033c9832b21321d9e56711926b04c5705e5f63874c": { "source": { @@ -79,7 +79,7 @@ } } }, - "9854d9c205c56719d3e954eb4cf27a828725afdcd6e7e00b7ccecfce1866740f": { + "5f955b28abc21da07dc33a4cdd724c0f329f3bb14a71217ca89b731e2ab54413": { "source": { "path": "test-bucket-deployments-2.template.json", "packaging": "file" @@ -87,7 +87,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "9854d9c205c56719d3e954eb4cf27a828725afdcd6e7e00b7ccecfce1866740f.json", + "objectKey": "5f955b28abc21da07dc33a4cdd724c0f329f3bb14a71217ca89b731e2ab54413.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/test-bucket-deployments-2.template.json b/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/test-bucket-deployments-2.template.json index 9f8408949492e..159a28e97aee6 100644 --- a/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/test-bucket-deployments-2.template.json +++ b/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/test-bucket-deployments-2.template.json @@ -1013,6 +1013,12 @@ "FileSystemId": { "Ref": "BucketDeploymentEFSVPCc8e45d2d82aec23f89c7172e7e6f994ff3d9c444faDE9EC34B" }, + "AccessPointTags": [ + { + "Key": "Name", + "Value": "test-bucket-deployments-2/BucketDeploymentEFS-VPC-c8e45d2d82aec23f89c7172e7e6f994ff3d9c444fa/AccessPoint" + } + ], "PosixUser": { "Gid": "1001", "Uid": "1001" diff --git a/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/tree.json b/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/tree.json index 82f3c333bf0e8..f54637e846602 100644 --- a/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/tree.json @@ -1534,6 +1534,12 @@ "fileSystemId": { "Ref": "BucketDeploymentEFSVPCc8e45d2d82aec23f89c7172e7e6f994ff3d9c444faDE9EC34B" }, + "accessPointTags": [ + { + "key": "Name", + "value": "test-bucket-deployments-2/BucketDeploymentEFS-VPC-c8e45d2d82aec23f89c7172e7e6f994ff3d9c444fa/AccessPoint" + } + ], "posixUser": { "uid": "1001", "gid": "1001" @@ -3188,7 +3194,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.189" + "version": "10.1.252" } }, "BootstrapVersion": { @@ -3226,7 +3232,7 @@ "path": "integ-test-bucket-deployments/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.189" + "version": "10.1.252" } }, "DeployAssert": { @@ -3246,7 +3252,7 @@ "path": "integ-test-bucket-deployments/DefaultTest/DeployAssert/AwsApiCallS3listObjects/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.189" + "version": "10.1.252" } } }, @@ -3318,7 +3324,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.189" + "version": "10.1.252" } }, "BootstrapVersion": { @@ -3360,7 +3366,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.189" + "version": "10.1.252" } } }, diff --git a/packages/@aws-cdk/aws-s3/README.md b/packages/@aws-cdk/aws-s3/README.md index c435a96eee6bf..05e313b39dfc9 100644 --- a/packages/@aws-cdk/aws-s3/README.md +++ b/packages/@aws-cdk/aws-s3/README.md @@ -1,4 +1,5 @@ # Amazon S3 Construct Library + --- @@ -19,24 +20,24 @@ const bucket = new s3.Bucket(this, 'MyFirstBucket'); `Bucket` constructs expose the following deploy-time attributes: - * `bucketArn` - the ARN of the bucket (i.e. `arn:aws:s3:::bucket_name`) - * `bucketName` - the name of the bucket (i.e. `bucket_name`) - * `bucketWebsiteUrl` - the Website URL of the bucket (i.e. - `http://bucket_name.s3-website-us-west-1.amazonaws.com`) - * `bucketDomainName` - the URL of the bucket (i.e. `bucket_name.s3.amazonaws.com`) - * `bucketDualStackDomainName` - the dual-stack URL of the bucket (i.e. - `bucket_name.s3.dualstack.eu-west-1.amazonaws.com`) - * `bucketRegionalDomainName` - the regional URL of the bucket (i.e. - `bucket_name.s3.eu-west-1.amazonaws.com`) - * `arnForObjects(pattern)` - the ARN of an object or objects within the bucket (i.e. - `arn:aws:s3:::bucket_name/exampleobject.png` or - `arn:aws:s3:::bucket_name/Development/*`) - * `urlForObject(key)` - the HTTP URL of an object within the bucket (i.e. - `https://s3.cn-north-1.amazonaws.com.cn/china-bucket/mykey`) - * `virtualHostedUrlForObject(key)` - the virtual-hosted style HTTP URL of an object - within the bucket (i.e. `https://china-bucket-s3.cn-north-1.amazonaws.com.cn/mykey`) - * `s3UrlForObject(key)` - the S3 URL of an object within the bucket (i.e. - `s3://bucket/mykey`) +- `bucketArn` - the ARN of the bucket (i.e. `arn:aws:s3:::bucket_name`) +- `bucketName` - the name of the bucket (i.e. `bucket_name`) +- `bucketWebsiteUrl` - the Website URL of the bucket (i.e. + `http://bucket_name.s3-website-us-west-1.amazonaws.com`) +- `bucketDomainName` - the URL of the bucket (i.e. `bucket_name.s3.amazonaws.com`) +- `bucketDualStackDomainName` - the dual-stack URL of the bucket (i.e. + `bucket_name.s3.dualstack.eu-west-1.amazonaws.com`) +- `bucketRegionalDomainName` - the regional URL of the bucket (i.e. + `bucket_name.s3.eu-west-1.amazonaws.com`) +- `arnForObjects(pattern)` - the ARN of an object or objects within the bucket (i.e. + `arn:aws:s3:::bucket_name/exampleobject.png` or + `arn:aws:s3:::bucket_name/Development/*`) +- `urlForObject(key)` - the HTTP URL of an object within the bucket (i.e. + `https://s3.cn-north-1.amazonaws.com.cn/china-bucket/mykey`) +- `virtualHostedUrlForObject(key)` - the virtual-hosted style HTTP URL of an object + within the bucket (i.e. `https://china-bucket-s3.cn-north-1.amazonaws.com.cn/mykey`) +- `s3UrlForObject(key)` - the S3 URL of an object within the bucket (i.e. + `s3://bucket/mykey`) ## Encryption @@ -90,11 +91,13 @@ A bucket policy will be automatically created for the bucket upon the first call ```ts const bucket = new s3.Bucket(this, 'MyBucket'); -const result = bucket.addToResourcePolicy(new iam.PolicyStatement({ - actions: ['s3:GetObject'], - resources: [bucket.arnForObjects('file.txt')], - principals: [new iam.AccountRootPrincipal()], -})); +const result = bucket.addToResourcePolicy( + new iam.PolicyStatement({ + actions: ['s3:GetObject'], + resources: [bucket.arnForObjects('file.txt')], + principals: [new iam.AccountRootPrincipal()], + }) +); ``` If you try to add a policy statement to an existing bucket, this method will @@ -104,11 +107,13 @@ not do anything: const bucket = s3.Bucket.fromBucketName(this, 'existingBucket', 'bucket-name'); // No policy statement will be added to the resource -const result = bucket.addToResourcePolicy(new iam.PolicyStatement({ - actions: ['s3:GetObject'], - resources: [bucket.arnForObjects('file.txt')], - principals: [new iam.AccountRootPrincipal()], -})); +const result = bucket.addToResourcePolicy( + new iam.PolicyStatement({ + actions: ['s3:GetObject'], + resources: [bucket.arnForObjects('file.txt')], + principals: [new iam.AccountRootPrincipal()], + }) +); ``` That's because it's not possible to tell whether the bucket @@ -117,11 +122,13 @@ statements to it. We recommend that you always check the result of the call: ```ts const bucket = new s3.Bucket(this, 'MyBucket'); -const result = bucket.addToResourcePolicy(new iam.PolicyStatement({ - actions: ['s3:GetObject'], - resources: [bucket.arnForObjects('file.txt')], - principals: [new iam.AccountRootPrincipal()], -})); +const result = bucket.addToResourcePolicy( + new iam.PolicyStatement({ + actions: ['s3:GetObject'], + resources: [bucket.arnForObjects('file.txt')], + principals: [new iam.AccountRootPrincipal()], + }) +); if (!result.statementAdded) { // Uh-oh! Someone probably made a mistake here. @@ -166,7 +173,42 @@ const bucket = new s3.Bucket(this, 'Bucket', { To use a bucket in a different stack in the same CDK application, pass the object to the other stack: -[sharing bucket between stacks](test/integ.bucket-sharing.lit.ts) +```ts +/** + * Stack that defines the bucket + */ +class Producer extends cdk.Stack { + public readonly myBucket: s3.Bucket; + + constructor(scope: cdk.App, id: string, props?: cdk.StackProps) { + super(scope, id, props); + + const bucket = new s3.Bucket(this, 'MyBucket', { + removalPolicy: cdk.RemovalPolicy.DESTROY, + }); + this.myBucket = bucket; + } +} + +interface ConsumerProps extends cdk.StackProps { + userBucket: s3.IBucket; +} + +/** + * Stack that consumes the bucket + */ +class Consumer extends cdk.Stack { + constructor(scope: cdk.App, id: string, props: ConsumerProps) { + super(scope, id, props); + + const user = new iam.User(this, 'MyUser'); + props.userBucket.grantReadWrite(user); + } +} + +const producer = new Producer(app, 'ProducerStack'); +new Consumer(app, 'ConsumerStack', { userBucket: producer.myBucket }); +``` ## Importing existing buckets @@ -181,7 +223,9 @@ const bucket = s3.Bucket.fromBucketAttributes(this, 'ImportedBucket', { }); // now you can just call methods on the bucket -bucket.addEventNotification(s3.EventType.OBJECT_CREATED, new s3n.LambdaDestination(myLambda), {prefix: 'home/myusername/*'}); +bucket.addEventNotification(s3.EventType.OBJECT_CREATED, new s3n.LambdaDestination(myLambda), { + prefix: 'home/myusername/*', +}); ``` Alternatively, short-hand factories are available as `Bucket.fromBucketName` and @@ -190,7 +234,7 @@ name or ARN respectively: ```ts const byName = s3.Bucket.fromBucketName(this, 'BucketByName', 'my-bucket'); -const byArn = s3.Bucket.fromBucketArn(this, 'BucketByArn', 'arn:aws:s3:::my-bucket'); +const byArn = s3.Bucket.fromBucketArn(this, 'BucketByArn', 'arn:aws:s3:::my-bucket'); ``` The bucket's region defaults to the current stack's region, but can also be explicitly set in cases where one of the bucket's @@ -234,9 +278,10 @@ have the `.jpg` suffix are removed from the bucket. ```ts declare const myQueue: sqs.Queue; const bucket = new s3.Bucket(this, 'MyBucket'); -bucket.addEventNotification(s3.EventType.OBJECT_REMOVED, - new s3n.SqsDestination(myQueue), - { prefix: 'foo/', suffix: '.jpg' }); +bucket.addEventNotification(s3.EventType.OBJECT_REMOVED, new s3n.SqsDestination(myQueue), { + prefix: 'foo/', + suffix: '.jpg', +}); ``` Adding notifications on existing buckets: @@ -249,7 +294,7 @@ const bucket = s3.Bucket.fromBucketAttributes(this, 'ImportedBucket', { bucket.addEventNotification(s3.EventType.OBJECT_CREATED, new s3n.SnsDestination(topic)); ``` -When you add an event notification to a bucket, a custom resource is created to +When you add an event notification to a bucket, a custom resource is created to manage the notifications. By default, a new role is created for the Lambda function that implements this feature. If you want to use your own role instead, you should provide it in the `Bucket` constructor: @@ -261,10 +306,10 @@ const bucket = new s3.Bucket(this, 'MyBucket', { }); ``` -Whatever role you provide, the CDK will try to modify it by adding the -permissions from `AWSLambdaBasicExecutionRole` (an AWS managed policy) as well -as the permissions `s3:PutBucketNotification` and `s3:GetBucketNotification`. -If you’re passing an imported role, and you don’t want this to happen, configure +Whatever role you provide, the CDK will try to modify it by adding the +permissions from `AWSLambdaBasicExecutionRole` (an AWS managed policy) as well +as the permissions `s3:PutBucketNotification` and `s3:GetBucketNotification`. +If you’re passing an imported role, and you don’t want this to happen, configure it to be immutable: ```ts @@ -273,11 +318,10 @@ const importedRole = iam.Role.fromRoleArn(this, 'role', 'arn:aws:iam::1234567890 }); ``` -> If you provide an imported immutable role, make sure that it has at least all +> If you provide an imported immutable role, make sure that it has at least all > the permissions mentioned above. Otherwise, the deployment will fail! -[S3 Bucket Notifications]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html - +[s3 bucket notifications]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html ### EventBridge notifications @@ -292,7 +336,7 @@ const bucket = new s3.Bucket(this, 'MyEventBridgeBucket', { }); ``` -[S3 EventBridge notifications]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/EventBridge.html +[s3 eventbridge notifications]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/EventBridge.html ## Block Public Access @@ -439,16 +483,18 @@ Alternatively, you can also define multiple `websiteRoutingRules`, to define com ```ts const bucket = new s3.Bucket(this, 'MyRedirectedBucket', { - websiteRoutingRules: [{ - hostName: 'www.example.com', - httpRedirectCode: '302', - protocol: s3.RedirectProtocol.HTTPS, - replaceKey: s3.ReplaceKey.prefixWith('test/'), - condition: { - httpErrorCodeReturnedEquals: '200', - keyPrefixEquals: 'prefix', + websiteRoutingRules: [ + { + hostName: 'www.example.com', + httpRedirectCode: '302', + protocol: s3.RedirectProtocol.HTTPS, + replaceKey: s3.ReplaceKey.prefixWith('test/'), + condition: { + httpErrorCodeReturnedEquals: '200', + keyPrefixEquals: 'prefix', + }, }, - }], + ], }); ``` @@ -479,7 +525,7 @@ bucket.virtualHostedUrlForObject('objectname', { regional: false }); // Virtual You can use one of following properties to specify the bucket [object Ownership]. -[object Ownership]: https://docs.aws.amazon.com/AmazonS3/latest/dev/about-object-ownership.html +[object ownership]: https://docs.aws.amazon.com/AmazonS3/latest/dev/about-object-ownership.html ### Object writer @@ -516,9 +562,9 @@ new s3.Bucket(this, 'MyBucket', { Some services may not not support log delivery to buckets that have object ownership set to bucket owner enforced, such as [S3 buckets using ACLs](#allowing-access-log-delivery-using-a-bucket-policy-recommended) -or [CloudFront Distributions][CloudFront S3 Bucket]. +or [CloudFront Distributions][cloudfront s3 bucket]. -[CloudFront S3 Bucket]: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/AccessLogs.html#AccessLogsBucketAndFileOwnership +[cloudfront s3 bucket]: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/AccessLogs.html#AccessLogsBucketAndFileOwnership ## Bucket deletion @@ -539,7 +585,7 @@ const bucket = new s3.Bucket(this, 'MyTempFileBucket', { ``` **Warning** if you have deployed a bucket with `autoDeleteObjects: true`, -switching this to `false` in a CDK version *before* `1.126.0` will lead to +switching this to `false` in a CDK version _before_ `1.126.0` will lead to all objects in the bucket being deleted. Be sure to update your bucket resources by deploying with CDK version `1.126.0` or later **before** switching this value to `false`. @@ -568,15 +614,16 @@ bucket.transferAccelerationUrlForObject('objectname'); ```ts new s3.Bucket(this, 'MyBucket', { - intelligentTieringConfigurations: [{ - name: 'foo', - prefix: 'folder/name', - archiveAccessTierTime: cdk.Duration.days(90), - deepArchiveAccessTierTime: cdk.Duration.days(180), - tags: [{key: 'tagname', value: 'tagvalue'}] - }], + intelligentTieringConfigurations: [ + { + name: 'foo', + prefix: 'folder/name', + archiveAccessTierTime: cdk.Duration.days(90), + deepArchiveAccessTierTime: cdk.Duration.days(180), + tags: [{ key: 'tagname', value: 'tagvalue' }], + }, + ], }); - ``` ## Lifecycle Rule @@ -585,35 +632,41 @@ new s3.Bucket(this, 'MyBucket', { ```ts const bucket = new s3.Bucket(this, 'MyBucket', { - lifecycleRules: [{ - abortIncompleteMultipartUploadAfter: cdk.Duration.minutes(30), - enabled: false, - expiration: cdk.Duration.days(30), - expirationDate: new Date(), - expiredObjectDeleteMarker: false, - id: 'id', - noncurrentVersionExpiration: cdk.Duration.days(30), - - // the properties below are optional - noncurrentVersionsToRetain: 123, - noncurrentVersionTransitions: [{ - storageClass: s3.StorageClass.GLACIER, - transitionAfter: cdk.Duration.days(30), + lifecycleRules: [ + { + abortIncompleteMultipartUploadAfter: cdk.Duration.minutes(30), + enabled: false, + expiration: cdk.Duration.days(30), + expirationDate: new Date(), + expiredObjectDeleteMarker: false, + id: 'id', + noncurrentVersionExpiration: cdk.Duration.days(30), // the properties below are optional noncurrentVersionsToRetain: 123, - }], - objectSizeGreaterThan: 500, - prefix: 'prefix', - objectSizeLessThan: 10000, - transitions: [{ - storageClass: s3.StorageClass.GLACIER, - - // the properties below are optional - transitionAfter: cdk.Duration.days(30), - transitionDate: new Date(), - }], - }] + noncurrentVersionTransitions: [ + { + storageClass: s3.StorageClass.GLACIER, + transitionAfter: cdk.Duration.days(30), + + // the properties below are optional + noncurrentVersionsToRetain: 123, + }, + ], + objectSizeGreaterThan: 500, + prefix: 'prefix', + objectSizeLessThan: 10000, + transitions: [ + { + storageClass: s3.StorageClass.GLACIER, + + // the properties below are optional + transitionAfter: cdk.Duration.days(30), + transitionDate: new Date(), + }, + ], + }, + ], }); ``` @@ -628,7 +681,7 @@ Object Lock can be enabled on an S3 bucket by specifying: ```ts const bucket = new s3.Bucket(this, 'MyBucket', { - objectLockEnabled: true + objectLockEnabled: true, }); ``` @@ -647,5 +700,4 @@ new s3.Bucket(this, 'Bucket1', { new s3.Bucket(this, 'Bucket2', { objectLockDefaultRetention: s3.ObjectLockRetention.compliance(cdk.Duration.days(365)), }); - ``` diff --git a/packages/@aws-cdk/aws-s3/package.json b/packages/@aws-cdk/aws-s3/package.json index b6b9814d26540..3a40c7e810fdc 100644 --- a/packages/@aws-cdk/aws-s3/package.json +++ b/packages/@aws-cdk/aws-s3/package.json @@ -86,7 +86,7 @@ "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/integ-tests": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/aws-lambda": "^8.10.110", + "@types/aws-lambda": "^8.10.111", "@types/jest": "^27.5.2", "jest": "^27.5.1" }, diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.01eedf6f2e5aae25db3514bf9c65e042c4365726d7876ad9f10d35b65f5500cf/__entrypoint__.js b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.01eedf6f2e5aae25db3514bf9c65e042c4365726d7876ad9f10d35b65f5500cf/__entrypoint__.js new file mode 100644 index 0000000000000..1e3a3093c1706 --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.01eedf6f2e5aae25db3514bf9c65e042c4365726d7876ad9f10d35b65f5500cf/__entrypoint__.js @@ -0,0 +1,144 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.withRetries = exports.handler = exports.external = void 0; +const https = require("https"); +const url = require("url"); +// for unit tests +exports.external = { + sendHttpRequest: defaultSendHttpRequest, + log: defaultLog, + includeStackTraces: true, + userHandlerIndex: './index', +}; +const CREATE_FAILED_PHYSICAL_ID_MARKER = 'AWSCDK::CustomResourceProviderFramework::CREATE_FAILED'; +const MISSING_PHYSICAL_ID_MARKER = 'AWSCDK::CustomResourceProviderFramework::MISSING_PHYSICAL_ID'; +async function handler(event, context) { + const sanitizedEvent = { ...event, ResponseURL: '...' }; + exports.external.log(JSON.stringify(sanitizedEvent, undefined, 2)); + // ignore DELETE event when the physical resource ID is the marker that + // indicates that this DELETE is a subsequent DELETE to a failed CREATE + // operation. + if (event.RequestType === 'Delete' && event.PhysicalResourceId === CREATE_FAILED_PHYSICAL_ID_MARKER) { + exports.external.log('ignoring DELETE event caused by a failed CREATE event'); + await submitResponse('SUCCESS', event); + return; + } + try { + // invoke the user handler. this is intentionally inside the try-catch to + // ensure that if there is an error it's reported as a failure to + // cloudformation (otherwise cfn waits). + // eslint-disable-next-line @typescript-eslint/no-require-imports + const userHandler = require(exports.external.userHandlerIndex).handler; + const result = await userHandler(sanitizedEvent, context); + // validate user response and create the combined event + const responseEvent = renderResponse(event, result); + // submit to cfn as success + await submitResponse('SUCCESS', responseEvent); + } + catch (e) { + const resp = { + ...event, + Reason: exports.external.includeStackTraces ? e.stack : e.message, + }; + if (!resp.PhysicalResourceId) { + // special case: if CREATE fails, which usually implies, we usually don't + // have a physical resource id. in this case, the subsequent DELETE + // operation does not have any meaning, and will likely fail as well. to + // address this, we use a marker so the provider framework can simply + // ignore the subsequent DELETE. + if (event.RequestType === 'Create') { + exports.external.log('CREATE failed, responding with a marker physical resource id so that the subsequent DELETE will be ignored'); + resp.PhysicalResourceId = CREATE_FAILED_PHYSICAL_ID_MARKER; + } + else { + // otherwise, if PhysicalResourceId is not specified, something is + // terribly wrong because all other events should have an ID. + exports.external.log(`ERROR: Malformed event. "PhysicalResourceId" is required: ${JSON.stringify(event)}`); + } + } + // this is an actual error, fail the activity altogether and exist. + await submitResponse('FAILED', resp); + } +} +exports.handler = handler; +function renderResponse(cfnRequest, handlerResponse = {}) { + // if physical ID is not returned, we have some defaults for you based + // on the request type. + const physicalResourceId = handlerResponse.PhysicalResourceId ?? cfnRequest.PhysicalResourceId ?? cfnRequest.RequestId; + // if we are in DELETE and physical ID was changed, it's an error. + if (cfnRequest.RequestType === 'Delete' && physicalResourceId !== cfnRequest.PhysicalResourceId) { + throw new Error(`DELETE: cannot change the physical resource ID from "${cfnRequest.PhysicalResourceId}" to "${handlerResponse.PhysicalResourceId}" during deletion`); + } + // merge request event and result event (result prevails). + return { + ...cfnRequest, + ...handlerResponse, + PhysicalResourceId: physicalResourceId, + }; +} +async function submitResponse(status, event) { + const json = { + Status: status, + Reason: event.Reason ?? status, + StackId: event.StackId, + RequestId: event.RequestId, + PhysicalResourceId: event.PhysicalResourceId || MISSING_PHYSICAL_ID_MARKER, + LogicalResourceId: event.LogicalResourceId, + NoEcho: event.NoEcho, + Data: event.Data, + }; + exports.external.log('submit response to cloudformation', json); + const responseBody = JSON.stringify(json); + const parsedUrl = url.parse(event.ResponseURL); + const req = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: 'PUT', + headers: { 'content-type': '', 'content-length': responseBody.length }, + }; + const retryOptions = { + attempts: 5, + sleep: 1000, + }; + await withRetries(retryOptions, exports.external.sendHttpRequest)(req, responseBody); +} +async function defaultSendHttpRequest(options, responseBody) { + return new Promise((resolve, reject) => { + try { + const request = https.request(options, _ => resolve()); + request.on('error', reject); + request.write(responseBody); + request.end(); + } + catch (e) { + reject(e); + } + }); +} +function defaultLog(fmt, ...params) { + // eslint-disable-next-line no-console + console.log(fmt, ...params); +} +function withRetries(options, fn) { + return async (...xs) => { + let attempts = options.attempts; + let ms = options.sleep; + while (true) { + try { + return await fn(...xs); + } + catch (e) { + if (attempts-- <= 0) { + throw e; + } + await sleep(Math.floor(Math.random() * ms)); + ms *= 2; + } + } + }; +} +exports.withRetries = withRetries; +async function sleep(ms) { + return new Promise((ok) => setTimeout(ok, ms)); +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm9kZWpzLWVudHJ5cG9pbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJub2RlanMtZW50cnlwb2ludC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwrQkFBK0I7QUFDL0IsMkJBQTJCO0FBRTNCLGlCQUFpQjtBQUNKLFFBQUEsUUFBUSxHQUFHO0lBQ3RCLGVBQWUsRUFBRSxzQkFBc0I7SUFDdkMsR0FBRyxFQUFFLFVBQVU7SUFDZixrQkFBa0IsRUFBRSxJQUFJO0lBQ3hCLGdCQUFnQixFQUFFLFNBQVM7Q0FDNUIsQ0FBQztBQUVGLE1BQU0sZ0NBQWdDLEdBQUcsd0RBQXdELENBQUM7QUFDbEcsTUFBTSwwQkFBMEIsR0FBRyw4REFBOEQsQ0FBQztBQVczRixLQUFLLFVBQVUsT0FBTyxDQUFDLEtBQWtELEVBQUUsT0FBMEI7SUFDMUcsTUFBTSxjQUFjLEdBQUcsRUFBRSxHQUFHLEtBQUssRUFBRSxXQUFXLEVBQUUsS0FBSyxFQUFFLENBQUM7SUFDeEQsZ0JBQVEsQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxjQUFjLEVBQUUsU0FBUyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUM7SUFFM0QsdUVBQXVFO0lBQ3ZFLHVFQUF1RTtJQUN2RSxhQUFhO0lBQ2IsSUFBSSxLQUFLLENBQUMsV0FBVyxLQUFLLFFBQVEsSUFBSSxLQUFLLENBQUMsa0JBQWtCLEtBQUssZ0NBQWdDLEVBQUU7UUFDbkcsZ0JBQVEsQ0FBQyxHQUFHLENBQUMsdURBQXVELENBQUMsQ0FBQztRQUN0RSxNQUFNLGNBQW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gIGxldCBtcyA9IG9wdGlvbnMuc2xlZXA7XG4gICAgd2hpbGUgKHRydWUpIHtcbiAgICAgIHRyeSB7XG4gICAgICAgIHJldHVybiBhd2FpdCBmbiguLi54cyk7XG4gICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgIGlmIChhdHRlbXB0cy0tIDw9IDApIHtcbiAgICAgICAgICB0aHJvdyBlO1xuICAgICAgICB9XG4gICAgICAgIGF3YWl0IHNsZWVwKE1hdGguZmxvb3IoTWF0aC5yYW5kb20oKSAqIG1zKSk7XG4gICAgICAgIG1zICo9IDI7XG4gICAgICB9XG4gICAgfVxuICB9O1xufVxuXG5hc3luYyBmdW5jdGlvbiBzbGVlcChtczogbnVtYmVyKTogUHJvbWlzZTx2b2lkPiB7XG4gIHJldHVybiBuZXcgUHJvbWlzZSgob2spID0+IHNldFRpbWVvdXQob2ssIG1zKSk7XG59Il19 \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.e9c68cf1f45c13541846ac21c968ae404003e58f772e7c54163c0980d8123e12/index.js b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.01eedf6f2e5aae25db3514bf9c65e042c4365726d7876ad9f10d35b65f5500cf/index.js similarity index 100% rename from packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.e9c68cf1f45c13541846ac21c968ae404003e58f772e7c54163c0980d8123e12/index.js rename to packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.01eedf6f2e5aae25db3514bf9c65e042c4365726d7876ad9f10d35b65f5500cf/index.js diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.33e2651435a0d472a75c1e033c9832b21321d9e56711926b04c5705e5f63874c/__entrypoint__.js b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.33e2651435a0d472a75c1e033c9832b21321d9e56711926b04c5705e5f63874c/__entrypoint__.js new file mode 100644 index 0000000000000..1e3a3093c1706 --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.33e2651435a0d472a75c1e033c9832b21321d9e56711926b04c5705e5f63874c/__entrypoint__.js @@ -0,0 +1,144 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.withRetries = exports.handler = exports.external = void 0; +const https = require("https"); +const url = require("url"); +// for unit tests +exports.external = { + sendHttpRequest: defaultSendHttpRequest, + log: defaultLog, + includeStackTraces: true, + userHandlerIndex: './index', +}; +const CREATE_FAILED_PHYSICAL_ID_MARKER = 'AWSCDK::CustomResourceProviderFramework::CREATE_FAILED'; +const MISSING_PHYSICAL_ID_MARKER = 'AWSCDK::CustomResourceProviderFramework::MISSING_PHYSICAL_ID'; +async function handler(event, context) { + const sanitizedEvent = { ...event, ResponseURL: '...' }; + exports.external.log(JSON.stringify(sanitizedEvent, undefined, 2)); + // ignore DELETE event when the physical resource ID is the marker that + // indicates that this DELETE is a subsequent DELETE to a failed CREATE + // operation. + if (event.RequestType === 'Delete' && event.PhysicalResourceId === CREATE_FAILED_PHYSICAL_ID_MARKER) { + exports.external.log('ignoring DELETE event caused by a failed CREATE event'); + await submitResponse('SUCCESS', event); + return; + } + try { + // invoke the user handler. this is intentionally inside the try-catch to + // ensure that if there is an error it's reported as a failure to + // cloudformation (otherwise cfn waits). + // eslint-disable-next-line @typescript-eslint/no-require-imports + const userHandler = require(exports.external.userHandlerIndex).handler; + const result = await userHandler(sanitizedEvent, context); + // validate user response and create the combined event + const responseEvent = renderResponse(event, result); + // submit to cfn as success + await submitResponse('SUCCESS', responseEvent); + } + catch (e) { + const resp = { + ...event, + Reason: exports.external.includeStackTraces ? e.stack : e.message, + }; + if (!resp.PhysicalResourceId) { + // special case: if CREATE fails, which usually implies, we usually don't + // have a physical resource id. in this case, the subsequent DELETE + // operation does not have any meaning, and will likely fail as well. to + // address this, we use a marker so the provider framework can simply + // ignore the subsequent DELETE. + if (event.RequestType === 'Create') { + exports.external.log('CREATE failed, responding with a marker physical resource id so that the subsequent DELETE will be ignored'); + resp.PhysicalResourceId = CREATE_FAILED_PHYSICAL_ID_MARKER; + } + else { + // otherwise, if PhysicalResourceId is not specified, something is + // terribly wrong because all other events should have an ID. + exports.external.log(`ERROR: Malformed event. "PhysicalResourceId" is required: ${JSON.stringify(event)}`); + } + } + // this is an actual error, fail the activity altogether and exist. + await submitResponse('FAILED', resp); + } +} +exports.handler = handler; +function renderResponse(cfnRequest, handlerResponse = {}) { + // if physical ID is not returned, we have some defaults for you based + // on the request type. + const physicalResourceId = handlerResponse.PhysicalResourceId ?? cfnRequest.PhysicalResourceId ?? cfnRequest.RequestId; + // if we are in DELETE and physical ID was changed, it's an error. + if (cfnRequest.RequestType === 'Delete' && physicalResourceId !== cfnRequest.PhysicalResourceId) { + throw new Error(`DELETE: cannot change the physical resource ID from "${cfnRequest.PhysicalResourceId}" to "${handlerResponse.PhysicalResourceId}" during deletion`); + } + // merge request event and result event (result prevails). + return { + ...cfnRequest, + ...handlerResponse, + PhysicalResourceId: physicalResourceId, + }; +} +async function submitResponse(status, event) { + const json = { + Status: status, + Reason: event.Reason ?? status, + StackId: event.StackId, + RequestId: event.RequestId, + PhysicalResourceId: event.PhysicalResourceId || MISSING_PHYSICAL_ID_MARKER, + LogicalResourceId: event.LogicalResourceId, + NoEcho: event.NoEcho, + Data: event.Data, + }; + exports.external.log('submit response to cloudformation', json); + const responseBody = JSON.stringify(json); + const parsedUrl = url.parse(event.ResponseURL); + const req = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: 'PUT', + headers: { 'content-type': '', 'content-length': responseBody.length }, + }; + const retryOptions = { + attempts: 5, + sleep: 1000, + }; + await withRetries(retryOptions, exports.external.sendHttpRequest)(req, responseBody); +} +async function defaultSendHttpRequest(options, responseBody) { + return new Promise((resolve, reject) => { + try { + const request = https.request(options, _ => resolve()); + request.on('error', reject); + request.write(responseBody); + request.end(); + } + catch (e) { + reject(e); + } + }); +} +function defaultLog(fmt, ...params) { + // eslint-disable-next-line no-console + console.log(fmt, ...params); +} +function withRetries(options, fn) { + return async (...xs) => { + let attempts = options.attempts; + let ms = options.sleep; + while (true) { + try { + return await fn(...xs); + } + catch (e) { + if (attempts-- <= 0) { + throw e; + } + await sleep(Math.floor(Math.random() * ms)); + ms *= 2; + } + } + }; +} +exports.withRetries = withRetries; +async function sleep(ms) { + return new Promise((ok) => setTimeout(ok, ms)); +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm9kZWpzLWVudHJ5cG9pbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJub2RlanMtZW50cnlwb2ludC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwrQkFBK0I7QUFDL0IsMkJBQTJCO0FBRTNCLGlCQUFpQjtBQUNKLFFBQUEsUUFBUSxHQUFHO0lBQ3RCLGVBQWUsRUFBRSxzQkFBc0I7SUFDdkMsR0FBRyxFQUFFLFVBQVU7SUFDZixrQkFBa0IsRUFBRSxJQUFJO0lBQ3hCLGdCQUFnQixFQUFFLFNBQVM7Q0FDNUIsQ0FBQztBQUVGLE1BQU0sZ0NBQWdDLEdBQUcsd0RBQXdELENBQUM7QUFDbEcsTUFBTSwwQkFBMEIsR0FBRyw4REFBOEQsQ0FBQztBQVczRixLQUFLLFVBQVUsT0FBTyxDQUFDLEtBQWtELEVBQUUsT0FBMEI7SUFDMUcsTUFBTSxjQUFjLEdBQUcsRUFBRSxHQUFHLEtBQUssRUFBRSxXQUFXLEVBQUUsS0FBSyxFQUFFLENBQUM7SUFDeEQsZ0JBQVEsQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxjQUFjLEVBQUUsU0FBUyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUM7SUFFM0QsdUVBQXVFO0lBQ3ZFLHVF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sIEI+KG9wdGlvbnM6IFJldHJ5T3B0aW9ucywgZm46ICguLi54czogQSkgPT4gUHJvbWlzZTxCPik6ICguLi54czogQSkgPT4gUHJvbWlzZTxCPiB7XG4gIHJldHVybiBhc3luYyAoLi4ueHM6IEEpID0+IHtcbiAgICBsZXQgYXR0ZW1wdHMgPSBvcHRpb25zLmF0dGVtcHRzO1xuICAgIGxldCBtcyA9IG9wdGlvbnMuc2xlZXA7XG4gICAgd2hpbGUgKHRydWUpIHtcbiAgICAgIHRyeSB7XG4gICAgICAgIHJldHVybiBhd2FpdCBmbiguLi54cyk7XG4gICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgIGlmIChhdHRlbXB0cy0tIDw9IDApIHtcbiAgICAgICAgICB0aHJvdyBlO1xuICAgICAgICB9XG4gICAgICAgIGF3YWl0IHNsZWVwKE1hdGguZmxvb3IoTWF0aC5yYW5kb20oKSAqIG1zKSk7XG4gICAgICAgIG1zICo9IDI7XG4gICAgICB9XG4gICAgfVxuICB9O1xufVxuXG5hc3luYyBmdW5jdGlvbiBzbGVlcChtczogbnVtYmVyKTogUHJvbWlzZTx2b2lkPiB7XG4gIHJldHVybiBuZXcgUHJvbWlzZSgob2spID0+IHNldFRpbWVvdXQob2ssIG1zKSk7XG59Il19 \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.60767da3831353fede3cfe92efef10580a600592dec8ccbb06c051e95b9c1b26/index.js b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.33e2651435a0d472a75c1e033c9832b21321d9e56711926b04c5705e5f63874c/index.js similarity index 100% rename from packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.60767da3831353fede3cfe92efef10580a600592dec8ccbb06c051e95b9c1b26/index.js rename to packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.33e2651435a0d472a75c1e033c9832b21321d9e56711926b04c5705e5f63874c/index.js diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.60767da3831353fede3cfe92efef10580a600592dec8ccbb06c051e95b9c1b26/__entrypoint__.js b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.60767da3831353fede3cfe92efef10580a600592dec8ccbb06c051e95b9c1b26/__entrypoint__.js deleted file mode 100644 index 9df94382cc74e..0000000000000 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.60767da3831353fede3cfe92efef10580a600592dec8ccbb06c051e95b9c1b26/__entrypoint__.js +++ /dev/null @@ -1,118 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.handler = exports.external = void 0; -const https = require("https"); -const url = require("url"); -// for unit tests -exports.external = { - sendHttpRequest: defaultSendHttpRequest, - log: defaultLog, - includeStackTraces: true, - userHandlerIndex: './index', -}; -const CREATE_FAILED_PHYSICAL_ID_MARKER = 'AWSCDK::CustomResourceProviderFramework::CREATE_FAILED'; -const MISSING_PHYSICAL_ID_MARKER = 'AWSCDK::CustomResourceProviderFramework::MISSING_PHYSICAL_ID'; -async function handler(event, context) { - const sanitizedEvent = { ...event, ResponseURL: '...' }; - exports.external.log(JSON.stringify(sanitizedEvent, undefined, 2)); - // ignore DELETE event when the physical resource ID is the marker that - // indicates that this DELETE is a subsequent DELETE to a failed CREATE - // operation. - if (event.RequestType === 'Delete' && event.PhysicalResourceId === CREATE_FAILED_PHYSICAL_ID_MARKER) { - exports.external.log('ignoring DELETE event caused by a failed CREATE event'); - await submitResponse('SUCCESS', event); - return; - } - try { - // invoke the user handler. this is intentionally inside the try-catch to - // ensure that if there is an error it's reported as a failure to - // cloudformation (otherwise cfn waits). - // eslint-disable-next-line @typescript-eslint/no-require-imports - const userHandler = require(exports.external.userHandlerIndex).handler; - const result = await userHandler(sanitizedEvent, context); - // validate user response and create the combined event - const responseEvent = renderResponse(event, result); - // submit to cfn as success - await submitResponse('SUCCESS', responseEvent); - } - catch (e) { - const resp = { - ...event, - Reason: exports.external.includeStackTraces ? e.stack : e.message, - }; - if (!resp.PhysicalResourceId) { - // special case: if CREATE fails, which usually implies, we usually don't - // have a physical resource id. in this case, the subsequent DELETE - // operation does not have any meaning, and will likely fail as well. to - // address this, we use a marker so the provider framework can simply - // ignore the subsequent DELETE. - if (event.RequestType === 'Create') { - exports.external.log('CREATE failed, responding with a marker physical resource id so that the subsequent DELETE will be ignored'); - resp.PhysicalResourceId = CREATE_FAILED_PHYSICAL_ID_MARKER; - } - else { - // otherwise, if PhysicalResourceId is not specified, something is - // terribly wrong because all other events should have an ID. - exports.external.log(`ERROR: Malformed event. "PhysicalResourceId" is required: ${JSON.stringify(event)}`); - } - } - // this is an actual error, fail the activity altogether and exist. - await submitResponse('FAILED', resp); - } -} -exports.handler = handler; -function renderResponse(cfnRequest, handlerResponse = {}) { - // if physical ID is not returned, we have some defaults for you based - // on the request type. - const physicalResourceId = handlerResponse.PhysicalResourceId ?? cfnRequest.PhysicalResourceId ?? cfnRequest.RequestId; - // if we are in DELETE and physical ID was changed, it's an error. - if (cfnRequest.RequestType === 'Delete' && physicalResourceId !== cfnRequest.PhysicalResourceId) { - throw new Error(`DELETE: cannot change the physical resource ID from "${cfnRequest.PhysicalResourceId}" to "${handlerResponse.PhysicalResourceId}" during deletion`); - } - // merge request event and result event (result prevails). - return { - ...cfnRequest, - ...handlerResponse, - PhysicalResourceId: physicalResourceId, - }; -} -async function submitResponse(status, event) { - const json = { - Status: status, - Reason: event.Reason ?? status, - StackId: event.StackId, - RequestId: event.RequestId, - PhysicalResourceId: event.PhysicalResourceId || MISSING_PHYSICAL_ID_MARKER, - LogicalResourceId: event.LogicalResourceId, - NoEcho: event.NoEcho, - Data: event.Data, - }; - exports.external.log('submit response to cloudformation', json); - const responseBody = JSON.stringify(json); - const parsedUrl = url.parse(event.ResponseURL); - const req = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: 'PUT', - headers: { 'content-type': '', 'content-length': responseBody.length }, - }; - await exports.external.sendHttpRequest(req, responseBody); -} -async function defaultSendHttpRequest(options, responseBody) { - return new Promise((resolve, reject) => { - try { - const request = https.request(options, _ => resolve()); - request.on('error', reject); - request.write(responseBody); - request.end(); - } - catch (e) { - reject(e); - } - }); -} -function defaultLog(fmt, ...params) { - // eslint-disable-next-line no-console - console.log(fmt, ...params); -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm9kZWpzLWVudHJ5cG9pbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJub2RlanMtZW50cnlwb2ludC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwrQkFBK0I7QUFDL0IsMkJBQTJCO0FBRTNCLGlCQUFpQjtBQUNKLFFBQUEsUUFBUSxHQUFHO0lBQ3RCLGVBQWUsRUFBRSxzQkFBc0I7SUFDdkMsR0FBRyxFQUFFLFVBQVU7SUFDZixrQkFBa0IsRUFBRSxJQUFJO0lBQ3hCLGdCQUFnQixFQUFFLFNBQVM7Q0FDNUIsQ0FBQztBQUVGLE1BQU0sZ0NBQWdDLEdBQUcsd0RBQXdELENBQUM7QUFDbEcsTUFBTSwwQkFBMEIsR0FBRyw4REFBOEQsQ0FBQztBQVczRixLQUFLLFVBQVUsT0FBTyxDQUFDLEtBQWtELEVBQUUsT0FBMEI7SUFDMUcsTUFBTSxjQUFjLEdBQUcsRUFBRSxHQUFHLEtBQUssRUFBRSxXQUFXLEVBQUUsS0FBSyxFQUFFLENBQUM7SUFDeEQsZ0JBQVEsQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxjQUFjLEVBQUUsU0FBUyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUM7SUFFM0QsdUVBQXVFO0lBQ3ZFLHVFQUF1RTtJQUN2RSxhQUFhO0lBQ2IsSUFBSSxLQUFLLENBQUMsV0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rpb24gZGVmYXVsdFNlbmRIdHRwUmVxdWVzdChvcHRpb25zOiBodHRwcy5SZXF1ZXN0T3B0aW9ucywgcmVzcG9uc2VCb2R5OiBzdHJpbmcpOiBQcm9taXNlPHZvaWQ+IHtcbiAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHtcbiAgICB0cnkge1xuICAgICAgY29uc3QgcmVxdWVzdCA9IGh0dHBzLnJlcXVlc3Qob3B0aW9ucywgXyA9PiByZXNvbHZlKCkpO1xuICAgICAgcmVxdWVzdC5vbignZXJyb3InLCByZWplY3QpO1xuICAgICAgcmVxdWVzdC53cml0ZShyZXNwb25zZUJvZHkpO1xuICAgICAgcmVxdWVzdC5lbmQoKTtcbiAgICB9IGNhdGNoIChlKSB7XG4gICAgICByZWplY3QoZSk7XG4gICAgfVxuICB9KTtcbn1cblxuZnVuY3Rpb24gZGVmYXVsdExvZyhmbXQ6IHN0cmluZywgLi4ucGFyYW1zOiBhbnlbXSkge1xuICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tY29uc29sZVxuICBjb25zb2xlLmxvZyhmbXQsIC4uLnBhcmFtcyk7XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.60767da3831353fede3cfe92efef10580a600592dec8ccbb06c051e95b9c1b26/index.d.ts b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.60767da3831353fede3cfe92efef10580a600592dec8ccbb06c051e95b9c1b26/index.d.ts deleted file mode 100644 index 3554dc94d4617..0000000000000 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.60767da3831353fede3cfe92efef10580a600592dec8ccbb06c051e95b9c1b26/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function handler(event: AWSLambda.CloudFormationCustomResourceEvent): Promise; diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.60767da3831353fede3cfe92efef10580a600592dec8ccbb06c051e95b9c1b26/index.ts b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.60767da3831353fede3cfe92efef10580a600592dec8ccbb06c051e95b9c1b26/index.ts deleted file mode 100644 index 2459d44ab1d18..0000000000000 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.60767da3831353fede3cfe92efef10580a600592dec8ccbb06c051e95b9c1b26/index.ts +++ /dev/null @@ -1,82 +0,0 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { S3 } from 'aws-sdk'; - -const AUTO_DELETE_OBJECTS_TAG = 'aws-cdk:auto-delete-objects'; - -const s3 = new S3(); - -export async function handler(event: AWSLambda.CloudFormationCustomResourceEvent) { - switch (event.RequestType) { - case 'Create': - return; - case 'Update': - return onUpdate(event); - case 'Delete': - return onDelete(event.ResourceProperties?.BucketName); - } -} - -async function onUpdate(event: AWSLambda.CloudFormationCustomResourceEvent) { - const updateEvent = event as AWSLambda.CloudFormationCustomResourceUpdateEvent; - const oldBucketName = updateEvent.OldResourceProperties?.BucketName; - const newBucketName = updateEvent.ResourceProperties?.BucketName; - const bucketNameHasChanged = newBucketName != null && oldBucketName != null && newBucketName !== oldBucketName; - - /* If the name of the bucket has changed, CloudFormation will try to delete the bucket - and create a new one with the new name. So we have to delete the contents of the - bucket so that this operation does not fail. */ - if (bucketNameHasChanged) { - return onDelete(oldBucketName); - } -} - -/** - * Recursively delete all items in the bucket - * - * @param bucketName the bucket name - */ -async function emptyBucket(bucketName: string) { - const listedObjects = await s3.listObjectVersions({ Bucket: bucketName }).promise(); - const contents = [...listedObjects.Versions ?? [], ...listedObjects.DeleteMarkers ?? []]; - if (contents.length === 0) { - return; - } - - const records = contents.map((record: any) => ({ Key: record.Key, VersionId: record.VersionId })); - await s3.deleteObjects({ Bucket: bucketName, Delete: { Objects: records } }).promise(); - - if (listedObjects?.IsTruncated) { - await emptyBucket(bucketName); - } -} - -async function onDelete(bucketName?: string) { - if (!bucketName) { - throw new Error('No BucketName was provided.'); - } - if (!await isBucketTaggedForDeletion(bucketName)) { - process.stdout.write(`Bucket does not have '${AUTO_DELETE_OBJECTS_TAG}' tag, skipping cleaning.\n`); - return; - } - try { - await emptyBucket(bucketName); - } catch (e) { - if (e.code !== 'NoSuchBucket') { - throw e; - } - // Bucket doesn't exist. Ignoring - } -} - -/** - * The bucket will only be tagged for deletion if it's being deleted in the same - * deployment as this Custom Resource. - * - * If the Custom Resource is every deleted before the bucket, it must be because - * `autoDeleteObjects` has been switched to false, in which case the tag would have - * been removed before we get to this Delete event. - */ -async function isBucketTaggedForDeletion(bucketName: string) { - const response = await s3.getBucketTagging({ Bucket: bucketName }).promise(); - return response.TagSet.some(tag => tag.Key === AUTO_DELETE_OBJECTS_TAG && tag.Value === 'true'); -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.e9c68cf1f45c13541846ac21c968ae404003e58f772e7c54163c0980d8123e12/__entrypoint__.js b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.e9c68cf1f45c13541846ac21c968ae404003e58f772e7c54163c0980d8123e12/__entrypoint__.js deleted file mode 100644 index 9df94382cc74e..0000000000000 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.e9c68cf1f45c13541846ac21c968ae404003e58f772e7c54163c0980d8123e12/__entrypoint__.js +++ /dev/null @@ -1,118 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.handler = exports.external = void 0; -const https = require("https"); -const url = require("url"); -// for unit tests -exports.external = { - sendHttpRequest: defaultSendHttpRequest, - log: defaultLog, - includeStackTraces: true, - userHandlerIndex: './index', -}; -const CREATE_FAILED_PHYSICAL_ID_MARKER = 'AWSCDK::CustomResourceProviderFramework::CREATE_FAILED'; -const MISSING_PHYSICAL_ID_MARKER = 'AWSCDK::CustomResourceProviderFramework::MISSING_PHYSICAL_ID'; -async function handler(event, context) { - const sanitizedEvent = { ...event, ResponseURL: '...' }; - exports.external.log(JSON.stringify(sanitizedEvent, undefined, 2)); - // ignore DELETE event when the physical resource ID is the marker that - // indicates that this DELETE is a subsequent DELETE to a failed CREATE - // operation. - if (event.RequestType === 'Delete' && event.PhysicalResourceId === CREATE_FAILED_PHYSICAL_ID_MARKER) { - exports.external.log('ignoring DELETE event caused by a failed CREATE event'); - await submitResponse('SUCCESS', event); - return; - } - try { - // invoke the user handler. this is intentionally inside the try-catch to - // ensure that if there is an error it's reported as a failure to - // cloudformation (otherwise cfn waits). - // eslint-disable-next-line @typescript-eslint/no-require-imports - const userHandler = require(exports.external.userHandlerIndex).handler; - const result = await userHandler(sanitizedEvent, context); - // validate user response and create the combined event - const responseEvent = renderResponse(event, result); - // submit to cfn as success - await submitResponse('SUCCESS', responseEvent); - } - catch (e) { - const resp = { - ...event, - Reason: exports.external.includeStackTraces ? e.stack : e.message, - }; - if (!resp.PhysicalResourceId) { - // special case: if CREATE fails, which usually implies, we usually don't - // have a physical resource id. in this case, the subsequent DELETE - // operation does not have any meaning, and will likely fail as well. to - // address this, we use a marker so the provider framework can simply - // ignore the subsequent DELETE. - if (event.RequestType === 'Create') { - exports.external.log('CREATE failed, responding with a marker physical resource id so that the subsequent DELETE will be ignored'); - resp.PhysicalResourceId = CREATE_FAILED_PHYSICAL_ID_MARKER; - } - else { - // otherwise, if PhysicalResourceId is not specified, something is - // terribly wrong because all other events should have an ID. - exports.external.log(`ERROR: Malformed event. "PhysicalResourceId" is required: ${JSON.stringify(event)}`); - } - } - // this is an actual error, fail the activity altogether and exist. - await submitResponse('FAILED', resp); - } -} -exports.handler = handler; -function renderResponse(cfnRequest, handlerResponse = {}) { - // if physical ID is not returned, we have some defaults for you based - // on the request type. - const physicalResourceId = handlerResponse.PhysicalResourceId ?? cfnRequest.PhysicalResourceId ?? cfnRequest.RequestId; - // if we are in DELETE and physical ID was changed, it's an error. - if (cfnRequest.RequestType === 'Delete' && physicalResourceId !== cfnRequest.PhysicalResourceId) { - throw new Error(`DELETE: cannot change the physical resource ID from "${cfnRequest.PhysicalResourceId}" to "${handlerResponse.PhysicalResourceId}" during deletion`); - } - // merge request event and result event (result prevails). - return { - ...cfnRequest, - ...handlerResponse, - PhysicalResourceId: physicalResourceId, - }; -} -async function submitResponse(status, event) { - const json = { - Status: status, - Reason: event.Reason ?? status, - StackId: event.StackId, - RequestId: event.RequestId, - PhysicalResourceId: event.PhysicalResourceId || MISSING_PHYSICAL_ID_MARKER, - LogicalResourceId: event.LogicalResourceId, - NoEcho: event.NoEcho, - Data: event.Data, - }; - exports.external.log('submit response to cloudformation', json); - const responseBody = JSON.stringify(json); - const parsedUrl = url.parse(event.ResponseURL); - const req = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: 'PUT', - headers: { 'content-type': '', 'content-length': responseBody.length }, - }; - await exports.external.sendHttpRequest(req, responseBody); -} -async function defaultSendHttpRequest(options, responseBody) { - return new Promise((resolve, reject) => { - try { - const request = https.request(options, _ => resolve()); - request.on('error', reject); - request.write(responseBody); - request.end(); - } - catch (e) { - reject(e); - } - }); -} -function defaultLog(fmt, ...params) { - // eslint-disable-next-line no-console - console.log(fmt, ...params); -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm9kZWpzLWVudHJ5cG9pbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJub2RlanMtZW50cnlwb2ludC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwrQkFBK0I7QUFDL0IsMkJBQTJCO0FBRTNCLGlCQUFpQjtBQUNKLFFBQUEsUUFBUSxHQUFHO0lBQ3RCLGVBQWUsRUFBRSxzQkFBc0I7SUFDdkMsR0FBRyxFQUFFLFVBQVU7SUFDZixrQkFBa0IsRUFBRSxJQUFJO0lBQ3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mUgbm8tY29uc29sZVxuICBjb25zb2xlLmxvZyhmbXQsIC4uLnBhcmFtcyk7XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.e9c68cf1f45c13541846ac21c968ae404003e58f772e7c54163c0980d8123e12/index.d.ts b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.e9c68cf1f45c13541846ac21c968ae404003e58f772e7c54163c0980d8123e12/index.d.ts deleted file mode 100644 index 3554dc94d4617..0000000000000 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.e9c68cf1f45c13541846ac21c968ae404003e58f772e7c54163c0980d8123e12/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function handler(event: AWSLambda.CloudFormationCustomResourceEvent): Promise; diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.e9c68cf1f45c13541846ac21c968ae404003e58f772e7c54163c0980d8123e12/index.ts b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.e9c68cf1f45c13541846ac21c968ae404003e58f772e7c54163c0980d8123e12/index.ts deleted file mode 100644 index 4a392db00cb66..0000000000000 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.e9c68cf1f45c13541846ac21c968ae404003e58f772e7c54163c0980d8123e12/index.ts +++ /dev/null @@ -1,31 +0,0 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { S3 } from 'aws-sdk'; - -const s3 = new S3(); - -export async function handler(event: AWSLambda.CloudFormationCustomResourceEvent): Promise { - switch (event.RequestType) { - case 'Create': - if (event.ResourceProperties.Fail) { - throw new Error('Failing on request!'); - } - const bucketName = event.ResourceProperties.BucketName; - if (!bucketName) { - throw new Error('Missing BucketName'); - } - return putObjects(bucketName); - case 'Update': - case 'Delete': - return; - } -} - -async function putObjects(bucketName: string, n = 5) { - // Put n objects in parallel - await Promise.all([...Array(n).keys()] - .map(key => s3.putObject({ - Bucket: bucketName, - Key: `Key${key}`, - Body: `Body${key}`, - }).promise())); -} diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/cdk-s3-bucket-auto-delete-objects.assets.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/cdk-s3-bucket-auto-delete-objects.assets.json index 47dcdbf3ac082..b89707c1bbeae 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/cdk-s3-bucket-auto-delete-objects.assets.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/cdk-s3-bucket-auto-delete-objects.assets.json @@ -1,33 +1,33 @@ { - "version": "20.0.0", + "version": "30.1.0", "files": { - "60767da3831353fede3cfe92efef10580a600592dec8ccbb06c051e95b9c1b26": { + "33e2651435a0d472a75c1e033c9832b21321d9e56711926b04c5705e5f63874c": { "source": { - "path": "asset.60767da3831353fede3cfe92efef10580a600592dec8ccbb06c051e95b9c1b26", + "path": "asset.33e2651435a0d472a75c1e033c9832b21321d9e56711926b04c5705e5f63874c", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "60767da3831353fede3cfe92efef10580a600592dec8ccbb06c051e95b9c1b26.zip", + "objectKey": "33e2651435a0d472a75c1e033c9832b21321d9e56711926b04c5705e5f63874c.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "e9c68cf1f45c13541846ac21c968ae404003e58f772e7c54163c0980d8123e12": { + "01eedf6f2e5aae25db3514bf9c65e042c4365726d7876ad9f10d35b65f5500cf": { "source": { - "path": "asset.e9c68cf1f45c13541846ac21c968ae404003e58f772e7c54163c0980d8123e12", + "path": "asset.01eedf6f2e5aae25db3514bf9c65e042c4365726d7876ad9f10d35b65f5500cf", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "e9c68cf1f45c13541846ac21c968ae404003e58f772e7c54163c0980d8123e12.zip", + "objectKey": "01eedf6f2e5aae25db3514bf9c65e042c4365726d7876ad9f10d35b65f5500cf.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "34588b22066351ec4599612a9503dbbce052c535da98310bc64dda1d3fcc5b3f": { + "90947b61ca4c7d99edb9187a285712c5d12e38ed13467bf721afe3b08c325877": { "source": { "path": "cdk-s3-bucket-auto-delete-objects.template.json", "packaging": "file" @@ -35,7 +35,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "34588b22066351ec4599612a9503dbbce052c535da98310bc64dda1d3fcc5b3f.json", + "objectKey": "90947b61ca4c7d99edb9187a285712c5d12e38ed13467bf721afe3b08c325877.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/cdk-s3-bucket-auto-delete-objects.template.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/cdk-s3-bucket-auto-delete-objects.template.json index adfe920639ba7..c1b94ee7f40ac 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/cdk-s3-bucket-auto-delete-objects.template.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/cdk-s3-bucket-auto-delete-objects.template.json @@ -112,7 +112,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "60767da3831353fede3cfe92efef10580a600592dec8ccbb06c051e95b9c1b26.zip" + "S3Key": "33e2651435a0d472a75c1e033c9832b21321d9e56711926b04c5705e5f63874c.zip" }, "Timeout": 900, "MemorySize": 128, @@ -198,7 +198,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "e9c68cf1f45c13541846ac21c968ae404003e58f772e7c54163c0980d8123e12.zip" + "S3Key": "01eedf6f2e5aae25db3514bf9c65e042c4365726d7876ad9f10d35b65f5500cf.zip" }, "Timeout": 900, "MemorySize": 128, diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/cdk.out b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/cdk.out index 588d7b269d34f..b72fef144f05c 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"20.0.0"} \ No newline at end of file +{"version":"30.1.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/cdkintegs3bucketautodeleteobjectsDefaultTestDeployAssert7EEB3F44.assets.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/cdkintegs3bucketautodeleteobjectsDefaultTestDeployAssert7EEB3F44.assets.json new file mode 100644 index 0000000000000..684eab00c908f --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/cdkintegs3bucketautodeleteobjectsDefaultTestDeployAssert7EEB3F44.assets.json @@ -0,0 +1,19 @@ +{ + "version": "30.1.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "cdkintegs3bucketautodeleteobjectsDefaultTestDeployAssert7EEB3F44.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/cdkintegs3bucketautodeleteobjectsDefaultTestDeployAssert7EEB3F44.template.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/cdkintegs3bucketautodeleteobjectsDefaultTestDeployAssert7EEB3F44.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/cdkintegs3bucketautodeleteobjectsDefaultTestDeployAssert7EEB3F44.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/integ.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/integ.json index 38516cf9c396b..5a1661f5c8d31 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/integ.json @@ -1,14 +1,12 @@ { - "version": "20.0.0", + "version": "30.1.0", "testCases": { - "integ.bucket-auto-delete-objects": { + "cdk-integ-s3-bucket-auto-delete-objects/DefaultTest": { "stacks": [ "cdk-s3-bucket-auto-delete-objects" ], - "diffAssets": false, - "stackUpdateWorkflow": true + "assertionStack": "cdk-integ-s3-bucket-auto-delete-objects/DefaultTest/DeployAssert", + "assertionStackName": "cdkintegs3bucketautodeleteobjectsDefaultTestDeployAssert7EEB3F44" } - }, - "synthContext": {}, - "enableLookups": false + } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/manifest.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/manifest.json index 1221080a9fc4c..7203978a6d570 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { - "version": "20.0.0", + "version": "30.1.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "cdk-s3-bucket-auto-delete-objects.assets": { "type": "cdk:asset-manifest", "properties": { @@ -23,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/34588b22066351ec4599612a9503dbbce052c535da98310bc64dda1d3fcc5b3f.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/90947b61ca4c7d99edb9187a285712c5d12e38ed13467bf721afe3b08c325877.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -101,6 +95,59 @@ ] }, "displayName": "cdk-s3-bucket-auto-delete-objects" + }, + "cdkintegs3bucketautodeleteobjectsDefaultTestDeployAssert7EEB3F44.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "cdkintegs3bucketautodeleteobjectsDefaultTestDeployAssert7EEB3F44.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "cdkintegs3bucketautodeleteobjectsDefaultTestDeployAssert7EEB3F44": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "cdkintegs3bucketautodeleteobjectsDefaultTestDeployAssert7EEB3F44.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "cdkintegs3bucketautodeleteobjectsDefaultTestDeployAssert7EEB3F44.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "cdkintegs3bucketautodeleteobjectsDefaultTestDeployAssert7EEB3F44.assets" + ], + "metadata": { + "/cdk-integ-s3-bucket-auto-delete-objects/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/cdk-integ-s3-bucket-auto-delete-objects/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "cdk-integ-s3-bucket-auto-delete-objects/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/tree.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/tree.json index 9aae0df949919..7b820afa82fe1 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/tree.json @@ -4,14 +4,6 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" - } - }, "cdk-s3-bucket-auto-delete-objects": { "id": "cdk-s3-bucket-auto-delete-objects", "path": "cdk-s3-bucket-auto-delete-objects", @@ -116,14 +108,14 @@ "id": "Default", "path": "cdk-s3-bucket-auto-delete-objects/Bucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" } } }, @@ -140,30 +132,30 @@ "id": "Staging", "path": "cdk-s3-bucket-auto-delete-objects/Custom::S3AutoDeleteObjectsCustomResourceProvider/Staging", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" } }, "Role": { "id": "Role", "path": "cdk-s3-bucket-auto-delete-objects/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" } }, "Handler": { "id": "Handler", "path": "cdk-s3-bucket-auto-delete-objects/Custom::S3AutoDeleteObjectsCustomResourceProvider/Handler", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.CustomResourceProvider", + "version": "0.0.0" } }, "Custom::S3PutObjectsCustomResourceProvider": { @@ -174,30 +166,30 @@ "id": "Staging", "path": "cdk-s3-bucket-auto-delete-objects/Custom::S3PutObjectsCustomResourceProvider/Staging", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" } }, "Role": { "id": "Role", "path": "cdk-s3-bucket-auto-delete-objects/Custom::S3PutObjectsCustomResourceProvider/Role", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" } }, "Handler": { "id": "Handler", "path": "cdk-s3-bucket-auto-delete-objects/Custom::S3PutObjectsCustomResourceProvider/Handler", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.CustomResourceProvider", + "version": "0.0.0" } }, "PutObjectsCustomResource": { @@ -207,27 +199,105 @@ "Default": { "id": "Default", "path": "cdk-s3-bucket-auto-delete-objects/PutObjectsCustomResource/Default", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "cdk-s3-bucket-auto-delete-objects/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "cdk-s3-bucket-auto-delete-objects/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "cdk-integ-s3-bucket-auto-delete-objects": { + "id": "cdk-integ-s3-bucket-auto-delete-objects", + "path": "cdk-integ-s3-bucket-auto-delete-objects", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "cdk-integ-s3-bucket-auto-delete-objects/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "cdk-integ-s3-bucket-auto-delete-objects/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.85" + "version": "10.1.252" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "cdk-integ-s3-bucket-auto-delete-objects/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "cdk-integ-s3-bucket-auto-delete-objects/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "cdk-integ-s3-bucket-auto-delete-objects/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" } } }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.85" + "version": "10.1.252" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" } } } \ No newline at end of file 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 1ecd9ae6f8dea..ba27583d3ce86 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 @@ -1,5 +1,6 @@ import * as path from 'path'; import { App, CustomResource, CustomResourceProvider, CustomResourceProviderRuntime, RemovalPolicy, Stack, StackProps } from '@aws-cdk/core'; +import { IntegTest } from '@aws-cdk/integ-tests'; import { Construct } from 'constructs'; import * as s3 from '../lib'; @@ -35,5 +36,7 @@ class TestStack extends Stack { } const app = new App(); -new TestStack(app, 'cdk-s3-bucket-auto-delete-objects'); -app.synth(); + +new IntegTest(app, 'cdk-integ-s3-bucket-auto-delete-objects', { + testCases: [new TestStack(app, 'cdk-s3-bucket-auto-delete-objects')], +}); diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.js.snapshot/aws-cdk-s3.assets.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.js.snapshot/aws-cdk-s3.assets.json index e1a9fa328274b..e70230520755e 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.js.snapshot/aws-cdk-s3.assets.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.js.snapshot/aws-cdk-s3.assets.json @@ -1,5 +1,5 @@ { - "version": "20.0.0", + "version": "30.1.0", "files": { "d58564e550578b842d263813989612c57f0be57bbe638c5d041fa759b57db7c1": { "source": { diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.js.snapshot/cdk.out b/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.js.snapshot/cdk.out index 588d7b269d34f..b72fef144f05c 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"20.0.0"} \ No newline at end of file +{"version":"30.1.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.js.snapshot/cdkintegs3grantdeletekmsDefaultTestDeployAssertEC0923BA.assets.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.js.snapshot/cdkintegs3grantdeletekmsDefaultTestDeployAssertEC0923BA.assets.json new file mode 100644 index 0000000000000..88b918d331bd8 --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.js.snapshot/cdkintegs3grantdeletekmsDefaultTestDeployAssertEC0923BA.assets.json @@ -0,0 +1,19 @@ +{ + "version": "30.1.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "cdkintegs3grantdeletekmsDefaultTestDeployAssertEC0923BA.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.js.snapshot/cdkintegs3grantdeletekmsDefaultTestDeployAssertEC0923BA.template.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.js.snapshot/cdkintegs3grantdeletekmsDefaultTestDeployAssertEC0923BA.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.js.snapshot/cdkintegs3grantdeletekmsDefaultTestDeployAssertEC0923BA.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.js.snapshot/integ.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.js.snapshot/integ.json index 716c4104c85ec..d72f7b902a999 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.js.snapshot/integ.json @@ -1,14 +1,12 @@ { - "version": "20.0.0", + "version": "30.1.0", "testCases": { - "integ.bucket-grantdelete-kms": { + "cdk-integ-s3-grant-delete-kms/DefaultTest": { "stacks": [ "aws-cdk-s3" ], - "diffAssets": false, - "stackUpdateWorkflow": true + "assertionStack": "cdk-integ-s3-grant-delete-kms/DefaultTest/DeployAssert", + "assertionStackName": "cdkintegs3grantdeletekmsDefaultTestDeployAssertEC0923BA" } - }, - "synthContext": {}, - "enableLookups": false + } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.js.snapshot/manifest.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.js.snapshot/manifest.json index 6c0a90b296a12..c199d0d8a92f2 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { - "version": "20.0.0", + "version": "30.1.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "aws-cdk-s3.assets": { "type": "cdk:asset-manifest", "properties": { @@ -77,6 +71,59 @@ ] }, "displayName": "aws-cdk-s3" + }, + "cdkintegs3grantdeletekmsDefaultTestDeployAssertEC0923BA.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "cdkintegs3grantdeletekmsDefaultTestDeployAssertEC0923BA.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "cdkintegs3grantdeletekmsDefaultTestDeployAssertEC0923BA": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "cdkintegs3grantdeletekmsDefaultTestDeployAssertEC0923BA.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "cdkintegs3grantdeletekmsDefaultTestDeployAssertEC0923BA.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "cdkintegs3grantdeletekmsDefaultTestDeployAssertEC0923BA.assets" + ], + "metadata": { + "/cdk-integ-s3-grant-delete-kms/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/cdk-integ-s3-grant-delete-kms/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "cdk-integ-s3-grant-delete-kms/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.js.snapshot/tree.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.js.snapshot/tree.json index ae389a29bb402..f7cd1fdddc619 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.js.snapshot/tree.json @@ -4,14 +4,6 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" - } - }, "aws-cdk-s3": { "id": "aws-cdk-s3", "path": "aws-cdk-s3", @@ -178,17 +170,95 @@ "fqn": "@aws-cdk/aws-s3.Bucket", "version": "0.0.0" } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-cdk-s3/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-cdk-s3/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "cdk-integ-s3-grant-delete-kms": { + "id": "cdk-integ-s3-grant-delete-kms", + "path": "cdk-integ-s3-grant-delete-kms", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "cdk-integ-s3-grant-delete-kms/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "cdk-integ-s3-grant-delete-kms/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.252" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "cdk-integ-s3-grant-delete-kms/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "cdk-integ-s3-grant-delete-kms/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "cdk-integ-s3-grant-delete-kms/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } } }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.85" + "version": "10.1.252" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.ts b/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.ts index c3ba55f721599..8faecb66bb2bf 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.ts +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-grantdelete-kms.ts @@ -2,6 +2,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; import * as cdk from '@aws-cdk/core'; +import { IntegTest } from '@aws-cdk/integ-tests'; import * as s3 from '../lib'; const app = new cdk.App(); @@ -18,4 +19,6 @@ const bucket = new s3.Bucket(stack, 'MyBucket', { // when bucket.grantDelete(deleter); -app.synth(); \ No newline at end of file +new IntegTest(app, 'cdk-integ-s3-grant-delete-kms', { + testCases: [stack], +}); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.js.snapshot/ServerAccessLogsImportTestDefaultTestDeployAssert076DA7F5.assets.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.js.snapshot/ServerAccessLogsImportTestDefaultTestDeployAssert076DA7F5.assets.json index 158be521a0100..f7aac2f276aab 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.js.snapshot/ServerAccessLogsImportTestDefaultTestDeployAssert076DA7F5.assets.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.js.snapshot/ServerAccessLogsImportTestDefaultTestDeployAssert076DA7F5.assets.json @@ -1,5 +1,5 @@ { - "version": "22.0.0", + "version": "30.1.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.js.snapshot/aws-cdk-s3-access-logs-delivery.assets.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.js.snapshot/aws-cdk-s3-access-logs-delivery.assets.json index 3f6f0869c8925..cd7238bd28a3f 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.js.snapshot/aws-cdk-s3-access-logs-delivery.assets.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.js.snapshot/aws-cdk-s3-access-logs-delivery.assets.json @@ -1,5 +1,5 @@ { - "version": "22.0.0", + "version": "30.1.0", "files": { "33e2651435a0d472a75c1e033c9832b21321d9e56711926b04c5705e5f63874c": { "source": { diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.js.snapshot/aws-cdk-s3-access-logs-target.assets.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.js.snapshot/aws-cdk-s3-access-logs-target.assets.json index d1dfc1490358c..3c941d80b4b9b 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.js.snapshot/aws-cdk-s3-access-logs-target.assets.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.js.snapshot/aws-cdk-s3-access-logs-target.assets.json @@ -1,5 +1,5 @@ { - "version": "22.0.0", + "version": "30.1.0", "files": { "33e2651435a0d472a75c1e033c9832b21321d9e56711926b04c5705e5f63874c": { "source": { diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.js.snapshot/cdk.out b/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.js.snapshot/cdk.out index 145739f539580..b72fef144f05c 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"22.0.0"} \ No newline at end of file +{"version":"30.1.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.js.snapshot/integ.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.js.snapshot/integ.json index 67c79ca839b8c..8accb4d457ca4 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "22.0.0", + "version": "30.1.0", "testCases": { "ServerAccessLogsImportTest/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.js.snapshot/manifest.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.js.snapshot/manifest.json index 5d197f4fd7011..acad90361aea3 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "22.0.0", + "version": "30.1.0", "artifacts": { "aws-cdk-s3-access-logs-target.assets": { "type": "cdk:asset-manifest", diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.js.snapshot/tree.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.js.snapshot/tree.json index a560510a2ffa3..ebd61577c5fe9 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.js.snapshot/tree.json @@ -251,7 +251,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.189" + "version": "10.1.252" } }, "BootstrapVersion": { @@ -528,7 +528,7 @@ "path": "ServerAccessLogsImportTest/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.189" + "version": "10.1.252" } }, "DeployAssert": { @@ -574,7 +574,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.189" + "version": "10.1.252" } } }, diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.ts b/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.ts index 3039a216b4489..612fd2e587112 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.ts +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-import-server-access-logs.ts @@ -34,5 +34,3 @@ new s3.Bucket(sourceBucketStack, 'SourceBucket', { new integ.IntegTest(app, 'ServerAccessLogsImportTest', { testCases: [sourceBucketStack], }); - -app.synth(); diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.js.snapshot/aws-cdk-s3.assets.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.js.snapshot/aws-cdk-s3.assets.json index 48832f621b5ce..03d30c13f3f15 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.js.snapshot/aws-cdk-s3.assets.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.js.snapshot/aws-cdk-s3.assets.json @@ -1,5 +1,5 @@ { - "version": "20.0.0", + "version": "30.1.0", "files": { "adf3c2f8262352f66ed192a1df02462d836f377c0853aa48562db222c63ca4fe": { "source": { diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.js.snapshot/cdk.out b/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.js.snapshot/cdk.out index 588d7b269d34f..b72fef144f05c 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"20.0.0"} \ No newline at end of file +{"version":"30.1.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.js.snapshot/cdkintegintelligenttieringDefaultTestDeployAssertCA983383.assets.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.js.snapshot/cdkintegintelligenttieringDefaultTestDeployAssertCA983383.assets.json new file mode 100644 index 0000000000000..56fdf483341e3 --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.js.snapshot/cdkintegintelligenttieringDefaultTestDeployAssertCA983383.assets.json @@ -0,0 +1,19 @@ +{ + "version": "30.1.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "cdkintegintelligenttieringDefaultTestDeployAssertCA983383.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.js.snapshot/cdkintegintelligenttieringDefaultTestDeployAssertCA983383.template.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.js.snapshot/cdkintegintelligenttieringDefaultTestDeployAssertCA983383.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.js.snapshot/cdkintegintelligenttieringDefaultTestDeployAssertCA983383.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.js.snapshot/integ.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.js.snapshot/integ.json index ff5cf6fc5aaa5..4a3bc5434b7f4 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.js.snapshot/integ.json @@ -1,14 +1,12 @@ { - "version": "20.0.0", + "version": "30.1.0", "testCases": { - "integ.bucket-intelligent-tiering": { + "cdk-integ-intelligent-tiering/DefaultTest": { "stacks": [ "aws-cdk-s3" ], - "diffAssets": false, - "stackUpdateWorkflow": true + "assertionStack": "cdk-integ-intelligent-tiering/DefaultTest/DeployAssert", + "assertionStackName": "cdkintegintelligenttieringDefaultTestDeployAssertCA983383" } - }, - "synthContext": {}, - "enableLookups": false + } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.js.snapshot/manifest.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.js.snapshot/manifest.json index e6a63b1756962..173ff55816481 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { - "version": "20.0.0", + "version": "30.1.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "aws-cdk-s3.assets": { "type": "cdk:asset-manifest", "properties": { @@ -59,6 +53,59 @@ ] }, "displayName": "aws-cdk-s3" + }, + "cdkintegintelligenttieringDefaultTestDeployAssertCA983383.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "cdkintegintelligenttieringDefaultTestDeployAssertCA983383.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "cdkintegintelligenttieringDefaultTestDeployAssertCA983383": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "cdkintegintelligenttieringDefaultTestDeployAssertCA983383.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "cdkintegintelligenttieringDefaultTestDeployAssertCA983383.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "cdkintegintelligenttieringDefaultTestDeployAssertCA983383.assets" + ], + "metadata": { + "/cdk-integ-intelligent-tiering/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/cdk-integ-intelligent-tiering/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "cdk-integ-intelligent-tiering/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.js.snapshot/tree.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.js.snapshot/tree.json index f46944949aba4..961474f149d9e 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.js.snapshot/tree.json @@ -4,14 +4,6 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" - } - }, "aws-cdk-s3": { "id": "aws-cdk-s3", "path": "aws-cdk-s3", @@ -61,17 +53,95 @@ "fqn": "@aws-cdk/aws-s3.Bucket", "version": "0.0.0" } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-cdk-s3/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-cdk-s3/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "cdk-integ-intelligent-tiering": { + "id": "cdk-integ-intelligent-tiering", + "path": "cdk-integ-intelligent-tiering", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "cdk-integ-intelligent-tiering/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "cdk-integ-intelligent-tiering/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.252" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "cdk-integ-intelligent-tiering/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "cdk-integ-intelligent-tiering/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "cdk-integ-intelligent-tiering/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } } }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.85" + "version": "10.1.252" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.ts b/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.ts index a39b06dd42a55..1419e1d0e0b64 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.ts +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-intelligent-tiering.ts @@ -1,4 +1,5 @@ import { App, Duration, Stack } from '@aws-cdk/core'; +import { IntegTest } from '@aws-cdk/integ-tests'; import * as s3 from '../lib/index'; const app = new App(); @@ -16,4 +17,6 @@ new s3.Bucket(stack, 'MyBucket', { }); -app.synth(); +new IntegTest(app, 'cdk-integ-intelligent-tiering', { + testCases: [stack], +}); diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.js.snapshot/aws-cdk-s3.assets.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.js.snapshot/aws-cdk-s3.assets.json index 95a28b2cae4ee..cea7b54847759 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.js.snapshot/aws-cdk-s3.assets.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.js.snapshot/aws-cdk-s3.assets.json @@ -1,5 +1,5 @@ { - "version": "20.0.0", + "version": "30.1.0", "files": { "a1456aedf39cb4f8db9c2e9de34250499617d8dd23f8210ef251f35870e1ac24": { "source": { diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.js.snapshot/cdk.out b/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.js.snapshot/cdk.out index 588d7b269d34f..b72fef144f05c 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"20.0.0"} \ No newline at end of file +{"version":"30.1.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.js.snapshot/cdkintegbucketinventoryDefaultTestDeployAssertDAAFB0C3.assets.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.js.snapshot/cdkintegbucketinventoryDefaultTestDeployAssertDAAFB0C3.assets.json new file mode 100644 index 0000000000000..0ec925d5129e3 --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.js.snapshot/cdkintegbucketinventoryDefaultTestDeployAssertDAAFB0C3.assets.json @@ -0,0 +1,19 @@ +{ + "version": "30.1.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "cdkintegbucketinventoryDefaultTestDeployAssertDAAFB0C3.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.js.snapshot/cdkintegbucketinventoryDefaultTestDeployAssertDAAFB0C3.template.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.js.snapshot/cdkintegbucketinventoryDefaultTestDeployAssertDAAFB0C3.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.js.snapshot/cdkintegbucketinventoryDefaultTestDeployAssertDAAFB0C3.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.js.snapshot/integ.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.js.snapshot/integ.json index 83852196c4971..e31192fcf4b7b 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.js.snapshot/integ.json @@ -1,14 +1,12 @@ { - "version": "20.0.0", + "version": "30.1.0", "testCases": { - "integ.bucket-inventory": { + "cdk-integ-bucket-inventory/DefaultTest": { "stacks": [ "aws-cdk-s3" ], - "diffAssets": false, - "stackUpdateWorkflow": true + "assertionStack": "cdk-integ-bucket-inventory/DefaultTest/DeployAssert", + "assertionStackName": "cdkintegbucketinventoryDefaultTestDeployAssertDAAFB0C3" } - }, - "synthContext": {}, - "enableLookups": false + } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.js.snapshot/manifest.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.js.snapshot/manifest.json index 49323b3b36b2a..984beb3d402bb 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { - "version": "20.0.0", + "version": "30.1.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "aws-cdk-s3.assets": { "type": "cdk:asset-manifest", "properties": { @@ -83,6 +77,59 @@ ] }, "displayName": "aws-cdk-s3" + }, + "cdkintegbucketinventoryDefaultTestDeployAssertDAAFB0C3.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "cdkintegbucketinventoryDefaultTestDeployAssertDAAFB0C3.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "cdkintegbucketinventoryDefaultTestDeployAssertDAAFB0C3": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "cdkintegbucketinventoryDefaultTestDeployAssertDAAFB0C3.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "cdkintegbucketinventoryDefaultTestDeployAssertDAAFB0C3.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "cdkintegbucketinventoryDefaultTestDeployAssertDAAFB0C3.assets" + ], + "metadata": { + "/cdk-integ-bucket-inventory/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/cdk-integ-bucket-inventory/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "cdk-integ-bucket-inventory/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.js.snapshot/tree.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.js.snapshot/tree.json index f3913165054a0..09a6c29d35738 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.js.snapshot/tree.json @@ -4,14 +4,6 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" - } - }, "aws-cdk-s3": { "id": "aws-cdk-s3", "path": "aws-cdk-s3", @@ -255,17 +247,95 @@ "fqn": "@aws-cdk/aws-s3.Bucket", "version": "0.0.0" } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-cdk-s3/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-cdk-s3/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "cdk-integ-bucket-inventory": { + "id": "cdk-integ-bucket-inventory", + "path": "cdk-integ-bucket-inventory", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "cdk-integ-bucket-inventory/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "cdk-integ-bucket-inventory/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.252" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "cdk-integ-bucket-inventory/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "cdk-integ-bucket-inventory/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "cdk-integ-bucket-inventory/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } } }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.85" + "version": "10.1.252" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.ts b/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.ts index 3bea814804e87..090a633c8ebcd 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.ts +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-inventory.ts @@ -1,5 +1,6 @@ #!/usr/bin/env node import * as cdk from '@aws-cdk/core'; +import { IntegTest } from '@aws-cdk/integ-tests'; import * as s3 from '../lib'; const app = new cdk.App(); @@ -34,4 +35,6 @@ myBucket.addInventory({ }, }); -app.synth(); +new IntegTest(app, 'cdk-integ-bucket-inventory', { + testCases: [stack], +}); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-object-lock.js.snapshot/ServerAccessLogsImportTestDefaultTestDeployAssert076DA7F5.assets.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-object-lock.js.snapshot/ServerAccessLogsImportTestDefaultTestDeployAssert076DA7F5.assets.json index 76ee419f6b0f1..f7aac2f276aab 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-object-lock.js.snapshot/ServerAccessLogsImportTestDefaultTestDeployAssert076DA7F5.assets.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-object-lock.js.snapshot/ServerAccessLogsImportTestDefaultTestDeployAssert076DA7F5.assets.json @@ -1,5 +1,5 @@ { - "version": "29.0.0", + "version": "30.1.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-object-lock.js.snapshot/aws-cdk-s3-bucket-object-lock.assets.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-object-lock.js.snapshot/aws-cdk-s3-bucket-object-lock.assets.json index 5c3ec41a3c2da..2633542c847ef 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-object-lock.js.snapshot/aws-cdk-s3-bucket-object-lock.assets.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-object-lock.js.snapshot/aws-cdk-s3-bucket-object-lock.assets.json @@ -1,5 +1,5 @@ { - "version": "29.0.0", + "version": "30.1.0", "files": { "e7897599241ca9562999cb8666f011365be1fbf7f990cfea3947f6026fd8fbb9": { "source": { diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-object-lock.js.snapshot/cdk.out b/packages/@aws-cdk/aws-s3/test/integ.bucket-object-lock.js.snapshot/cdk.out index d8b441d447f8a..b72fef144f05c 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-object-lock.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-object-lock.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"29.0.0"} \ No newline at end of file +{"version":"30.1.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-object-lock.js.snapshot/integ.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-object-lock.js.snapshot/integ.json index 52345f6fc37d6..31f4d6f15be26 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-object-lock.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-object-lock.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "29.0.0", + "version": "30.1.0", "testCases": { "ServerAccessLogsImportTest/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-object-lock.js.snapshot/manifest.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-object-lock.js.snapshot/manifest.json index a9877309176d5..cb5afd444bba9 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-object-lock.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-object-lock.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "29.0.0", + "version": "30.1.0", "artifacts": { "aws-cdk-s3-bucket-object-lock.assets": { "type": "cdk:asset-manifest", diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-object-lock.js.snapshot/tree.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-object-lock.js.snapshot/tree.json index 14e8a242e087e..dad95d997c9c0 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-object-lock.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-object-lock.js.snapshot/tree.json @@ -100,7 +100,7 @@ "path": "ServerAccessLogsImportTest/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.216" + "version": "10.1.252" } }, "DeployAssert": { @@ -146,7 +146,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.216" + "version": "10.1.252" } } }, diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-object-lock.ts b/packages/@aws-cdk/aws-s3/test/integ.bucket-object-lock.ts index 72434a129e426..60b267d682963 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-object-lock.ts +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-object-lock.ts @@ -17,5 +17,3 @@ new s3.Bucket(stack, 'ObjectLockWithRetentionBucket', { new integ.IntegTest(app, 'ServerAccessLogsImportTest', { testCases: [stack], }); - -app.synth(); diff --git a/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/TestStack.assets.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/ConsumerStack.assets.json similarity index 63% rename from packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/TestStack.assets.json rename to packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/ConsumerStack.assets.json index e9c52dc148e48..a0bbed1c1beda 100644 --- a/packages/@aws-cdk/aws-ec2/test/integ.launch-template.js.snapshot/TestStack.assets.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/ConsumerStack.assets.json @@ -1,15 +1,15 @@ { - "version": "21.0.0", + "version": "30.1.0", "files": { - "d17275411e4cfac0e49078863acdd9766783f143736b4534a3a0f1b5a4de118a": { + "8256310f1a5d004f222c2df04da2c9bcf7d0e1416fc0c2f07ab472f9eb7858e3": { "source": { - "path": "TestStack.template.json", + "path": "ConsumerStack.template.json", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "d17275411e4cfac0e49078863acdd9766783f143736b4534a3a0f1b5a4de118a.json", + "objectKey": "8256310f1a5d004f222c2df04da2c9bcf7d0e1416fc0c2f07ab472f9eb7858e3.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.lit.js.snapshot/ConsumerStack.template.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/ConsumerStack.template.json similarity index 58% rename from packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.lit.js.snapshot/ConsumerStack.template.json rename to packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/ConsumerStack.template.json index 88e399876949e..906df6ecc3ff8 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.lit.js.snapshot/ConsumerStack.template.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/ConsumerStack.template.json @@ -50,5 +50,39 @@ ] } } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/ProducerStack.assets.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/ProducerStack.assets.json new file mode 100644 index 0000000000000..094284cad5536 --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/ProducerStack.assets.json @@ -0,0 +1,19 @@ +{ + "version": "30.1.0", + "files": { + "72d18a5cfa63befafc29d9feb111797e3e5a8d80dd2005e1a2c81bc6dd6593ea": { + "source": { + "path": "ProducerStack.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "72d18a5cfa63befafc29d9feb111797e3e5a8d80dd2005e1a2c81bc6dd6593ea.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/ProducerStack.template.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/ProducerStack.template.json new file mode 100644 index 0000000000000..324bf05c33e5e --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/ProducerStack.template.json @@ -0,0 +1,56 @@ +{ + "Resources": { + "MyBucketF68F3FF0": { + "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Outputs": { + "ExportsOutputFnGetAttMyBucketF68F3FF0Arn0F7E8E58": { + "Value": { + "Fn::GetAtt": [ + "MyBucketF68F3FF0", + "Arn" + ] + }, + "Export": { + "Name": "ProducerStack:ExportsOutputFnGetAttMyBucketF68F3FF0Arn0F7E8E58" + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/cdk.out b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/cdk.out new file mode 100644 index 0000000000000..b72fef144f05c --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"30.1.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/cdkintegbucketsharingDefaultTestDeployAssertD8250F42.assets.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/cdkintegbucketsharingDefaultTestDeployAssertD8250F42.assets.json new file mode 100644 index 0000000000000..6e4902779fea7 --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/cdkintegbucketsharingDefaultTestDeployAssertD8250F42.assets.json @@ -0,0 +1,19 @@ +{ + "version": "30.1.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "cdkintegbucketsharingDefaultTestDeployAssertD8250F42.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/cdkintegbucketsharingDefaultTestDeployAssertD8250F42.template.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/cdkintegbucketsharingDefaultTestDeployAssertD8250F42.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/cdkintegbucketsharingDefaultTestDeployAssertD8250F42.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/integ.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/integ.json new file mode 100644 index 0000000000000..a62a9208c2058 --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "30.1.0", + "testCases": { + "cdk-integ-bucket-sharing/DefaultTest": { + "stacks": [ + "ConsumerStack" + ], + "assertionStack": "cdk-integ-bucket-sharing/DefaultTest/DeployAssert", + "assertionStackName": "cdkintegbucketsharingDefaultTestDeployAssertD8250F42" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/manifest.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/manifest.json new file mode 100644 index 0000000000000..fd4be2df984f7 --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/manifest.json @@ -0,0 +1,177 @@ +{ + "version": "30.1.0", + "artifacts": { + "ProducerStack.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "ProducerStack.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "ProducerStack": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "ProducerStack.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/72d18a5cfa63befafc29d9feb111797e3e5a8d80dd2005e1a2c81bc6dd6593ea.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "ProducerStack.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "ProducerStack.assets" + ], + "metadata": { + "/ProducerStack/MyBucket/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "MyBucketF68F3FF0" + } + ], + "/ProducerStack/Exports/Output{\"Fn::GetAtt\":[\"MyBucketF68F3FF0\",\"Arn\"]}": [ + { + "type": "aws:cdk:logicalId", + "data": "ExportsOutputFnGetAttMyBucketF68F3FF0Arn0F7E8E58" + } + ], + "/ProducerStack/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/ProducerStack/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "ProducerStack" + }, + "ConsumerStack.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "ConsumerStack.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "ConsumerStack": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "ConsumerStack.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/8256310f1a5d004f222c2df04da2c9bcf7d0e1416fc0c2f07ab472f9eb7858e3.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "ConsumerStack.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "ProducerStack", + "ConsumerStack.assets" + ], + "metadata": { + "/ConsumerStack/MyUser/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "MyUserDC45028B" + } + ], + "/ConsumerStack/MyUser/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "MyUserDefaultPolicy7B897426" + } + ], + "/ConsumerStack/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/ConsumerStack/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "ConsumerStack" + }, + "cdkintegbucketsharingDefaultTestDeployAssertD8250F42.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "cdkintegbucketsharingDefaultTestDeployAssertD8250F42.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "cdkintegbucketsharingDefaultTestDeployAssertD8250F42": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "cdkintegbucketsharingDefaultTestDeployAssertD8250F42.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "cdkintegbucketsharingDefaultTestDeployAssertD8250F42.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "cdkintegbucketsharingDefaultTestDeployAssertD8250F42.assets" + ], + "metadata": { + "/cdk-integ-bucket-sharing/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/cdk-integ-bucket-sharing/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "cdk-integ-bucket-sharing/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.lit.js.snapshot/tree.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/tree.json similarity index 64% rename from packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.lit.js.snapshot/tree.json rename to packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/tree.json index a7ee9710bdd05..a2f4d17bfdd8e 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.lit.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.js.snapshot/tree.json @@ -4,14 +4,6 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.0.9" - } - }, "ProducerStack": { "id": "ProducerStack", "path": "ProducerStack", @@ -53,7 +45,23 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.0.9" + "version": "10.1.252" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "ProducerStack/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "ProducerStack/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" } } }, @@ -152,12 +160,90 @@ "fqn": "@aws-cdk/aws-iam.User", "version": "0.0.0" } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "ConsumerStack/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "ConsumerStack/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } } }, "constructInfo": { "fqn": "@aws-cdk/core.Stack", "version": "0.0.0" } + }, + "cdk-integ-bucket-sharing": { + "id": "cdk-integ-bucket-sharing", + "path": "cdk-integ-bucket-sharing", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "cdk-integ-bucket-sharing/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "cdk-integ-bucket-sharing/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.252" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "cdk-integ-bucket-sharing/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "cdk-integ-bucket-sharing/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "cdk-integ-bucket-sharing/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.252" + } } }, "constructInfo": { diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.lit.js.snapshot/ProducerStack.template.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.lit.js.snapshot/ProducerStack.template.json deleted file mode 100644 index 08eb66859f88a..0000000000000 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.lit.js.snapshot/ProducerStack.template.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "Resources": { - "MyBucketF68F3FF0": { - "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - } - }, - "Outputs": { - "ExportsOutputFnGetAttMyBucketF68F3FF0Arn0F7E8E58": { - "Value": { - "Fn::GetAtt": [ - "MyBucketF68F3FF0", - "Arn" - ] - }, - "Export": { - "Name": "ProducerStack:ExportsOutputFnGetAttMyBucketF68F3FF0Arn0F7E8E58" - } - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.lit.js.snapshot/cdk.out b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.lit.js.snapshot/cdk.out deleted file mode 100644 index 90bef2e09ad39..0000000000000 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.lit.js.snapshot/cdk.out +++ /dev/null @@ -1 +0,0 @@ -{"version":"17.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.lit.js.snapshot/integ.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.lit.js.snapshot/integ.json deleted file mode 100644 index a514368e7d9fe..0000000000000 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.lit.js.snapshot/integ.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "version": "20.0.0", - "testCases": { - "integ.bucket-sharing.lit": { - "stacks": [ - "*" - ], - "diffAssets": false, - "stackUpdateWorkflow": true - } - }, - "synthContext": {}, - "enableLookups": false -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.lit.js.snapshot/manifest.json b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.lit.js.snapshot/manifest.json deleted file mode 100644 index 3abf44d21065b..0000000000000 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.lit.js.snapshot/manifest.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "version": "17.0.0", - "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, - "ProducerStack": { - "type": "aws:cloudformation:stack", - "environment": "aws://unknown-account/unknown-region", - "properties": { - "templateFile": "ProducerStack.template.json", - "validateOnSynth": false - }, - "metadata": { - "/ProducerStack/MyBucket/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "MyBucketF68F3FF0" - } - ], - "/ProducerStack/Exports/Output{\"Fn::GetAtt\":[\"MyBucketF68F3FF0\",\"Arn\"]}": [ - { - "type": "aws:cdk:logicalId", - "data": "ExportsOutputFnGetAttMyBucketF68F3FF0Arn0F7E8E58" - } - ] - }, - "displayName": "ProducerStack" - }, - "ConsumerStack": { - "type": "aws:cloudformation:stack", - "environment": "aws://unknown-account/unknown-region", - "properties": { - "templateFile": "ConsumerStack.template.json", - "validateOnSynth": false - }, - "dependencies": [ - "ProducerStack" - ], - "metadata": { - "/ConsumerStack/MyUser/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "MyUserDC45028B" - } - ], - "/ConsumerStack/MyUser/DefaultPolicy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "MyUserDefaultPolicy7B897426" - } - ] - }, - "displayName": "ConsumerStack" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.lit.ts b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.ts similarity index 82% rename from packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.lit.ts rename to packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.ts index e5108cd2389d5..efce9843d0359 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.lit.ts +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.ts @@ -1,12 +1,10 @@ -/// !cdk-integ * import * as iam from '@aws-cdk/aws-iam'; import * as cdk from '@aws-cdk/core'; +import { IntegTest } from '@aws-cdk/integ-tests'; import * as s3 from '../lib'; const app = new cdk.App(); -/// !show - /** * Stack that defines the bucket */ @@ -40,7 +38,7 @@ class Consumer extends cdk.Stack { } const producer = new Producer(app, 'ProducerStack'); -new Consumer(app, 'ConsumerStack', { userBucket: producer.myBucket }); -/// !hide -app.synth(); +new IntegTest(app, 'cdk-integ-bucket-sharing', { + testCases: [new Consumer(app, 'ConsumerStack', { userBucket: producer.myBucket })], +}); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/aws-cdk-s3-urls.assets.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/aws-cdk-domain-name.assets.json similarity index 88% rename from packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/aws-cdk-s3-urls.assets.json rename to packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/aws-cdk-domain-name.assets.json index c36f09e0ecc94..f6f1e081b00e4 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/aws-cdk-s3-urls.assets.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/aws-cdk-domain-name.assets.json @@ -1,9 +1,9 @@ { - "version": "20.0.0", + "version": "30.1.0", "files": { "3ef2de923dd866776ef065e9d3915359136b24280dbb0244c322a1badc1f3fff": { "source": { - "path": "aws-cdk-s3-urls.template.json", + "path": "aws-cdk-domain-name.template.json", "packaging": "file" }, "destinations": { diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/aws-cdk-s3-urls.template.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/aws-cdk-domain-name.template.json similarity index 100% rename from packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/aws-cdk-s3-urls.template.json rename to packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/aws-cdk-domain-name.template.json diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/cdk.out b/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/cdk.out index 588d7b269d34f..b72fef144f05c 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"20.0.0"} \ No newline at end of file +{"version":"30.1.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/cdkintegbucketdomainnameDefaultTestDeployAssert72465477.assets.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/cdkintegbucketdomainnameDefaultTestDeployAssert72465477.assets.json new file mode 100644 index 0000000000000..c81c0689ba16a --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/cdkintegbucketdomainnameDefaultTestDeployAssert72465477.assets.json @@ -0,0 +1,19 @@ +{ + "version": "30.1.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "cdkintegbucketdomainnameDefaultTestDeployAssert72465477.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/cdkintegbucketdomainnameDefaultTestDeployAssert72465477.template.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/cdkintegbucketdomainnameDefaultTestDeployAssert72465477.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/cdkintegbucketdomainnameDefaultTestDeployAssert72465477.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/integ.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/integ.json index 7cd8e272a81cb..351a9367bae02 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/integ.json @@ -1,14 +1,12 @@ { - "version": "20.0.0", + "version": "30.1.0", "testCases": { - "integ.bucket.domain-name": { + "cdk-integ-bucket-domain-name/DefaultTest": { "stacks": [ - "aws-cdk-s3-urls" + "aws-cdk-domain-name" ], - "diffAssets": false, - "stackUpdateWorkflow": true + "assertionStack": "cdk-integ-bucket-domain-name/DefaultTest/DeployAssert", + "assertionStackName": "cdkintegbucketdomainnameDefaultTestDeployAssert72465477" } - }, - "synthContext": {}, - "enableLookups": false + } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/manifest.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/manifest.json index 2b08e23195b76..5ba5c31306575 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/manifest.json @@ -1,25 +1,19 @@ { - "version": "20.0.0", + "version": "30.1.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, - "aws-cdk-s3-urls.assets": { + "aws-cdk-domain-name.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "aws-cdk-s3-urls.assets.json", + "file": "aws-cdk-domain-name.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "aws-cdk-s3-urls": { + "aws-cdk-domain-name": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "aws-cdk-s3-urls.template.json", + "templateFile": "aws-cdk-domain-name.template.json", "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", @@ -27,7 +21,7 @@ "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "aws-cdk-s3-urls.assets" + "aws-cdk-domain-name.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", @@ -36,41 +30,94 @@ } }, "dependencies": [ - "aws-cdk-s3-urls.assets" + "aws-cdk-domain-name.assets" ], "metadata": { - "/aws-cdk-s3-urls/MyBucket/Resource": [ + "/aws-cdk-domain-name/MyBucket/Resource": [ { "type": "aws:cdk:logicalId", "data": "MyBucketF68F3FF0" } ], - "/aws-cdk-s3-urls/RealBucketDomain": [ + "/aws-cdk-domain-name/RealBucketDomain": [ { "type": "aws:cdk:logicalId", "data": "RealBucketDomain" } ], - "/aws-cdk-s3-urls/ImportedBucketDomain": [ + "/aws-cdk-domain-name/ImportedBucketDomain": [ { "type": "aws:cdk:logicalId", "data": "ImportedBucketDomain" } ], - "/aws-cdk-s3-urls/BootstrapVersion": [ + "/aws-cdk-domain-name/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/aws-cdk-s3-urls/CheckBootstrapVersion": [ + "/aws-cdk-domain-name/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } ] }, - "displayName": "aws-cdk-s3-urls" + "displayName": "aws-cdk-domain-name" + }, + "cdkintegbucketdomainnameDefaultTestDeployAssert72465477.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "cdkintegbucketdomainnameDefaultTestDeployAssert72465477.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "cdkintegbucketdomainnameDefaultTestDeployAssert72465477": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "cdkintegbucketdomainnameDefaultTestDeployAssert72465477.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "cdkintegbucketdomainnameDefaultTestDeployAssert72465477.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "cdkintegbucketdomainnameDefaultTestDeployAssert72465477.assets" + ], + "metadata": { + "/cdk-integ-bucket-domain-name/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/cdk-integ-bucket-domain-name/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "cdk-integ-bucket-domain-name/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/tree.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/tree.json index 95617a948d928..15a1d70df873c 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.js.snapshot/tree.json @@ -4,25 +4,17 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" - } - }, - "aws-cdk-s3-urls": { - "id": "aws-cdk-s3-urls", - "path": "aws-cdk-s3-urls", + "aws-cdk-domain-name": { + "id": "aws-cdk-domain-name", + "path": "aws-cdk-domain-name", "children": { "MyBucket": { "id": "MyBucket", - "path": "aws-cdk-s3-urls/MyBucket", + "path": "aws-cdk-domain-name/MyBucket", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-s3-urls/MyBucket/Resource", + "path": "aws-cdk-domain-name/MyBucket/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::S3::Bucket", "aws:cdk:cloudformation:props": {} @@ -40,7 +32,7 @@ }, "MyBucket2": { "id": "MyBucket2", - "path": "aws-cdk-s3-urls/MyBucket2", + "path": "aws-cdk-domain-name/MyBucket2", "constructInfo": { "fqn": "@aws-cdk/aws-s3.BucketBase", "version": "0.0.0" @@ -48,30 +40,108 @@ }, "RealBucketDomain": { "id": "RealBucketDomain", - "path": "aws-cdk-s3-urls/RealBucketDomain", + "path": "aws-cdk-domain-name/RealBucketDomain", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" } }, "ImportedBucketDomain": { "id": "ImportedBucketDomain", - "path": "aws-cdk-s3-urls/ImportedBucketDomain", + "path": "aws-cdk-domain-name/ImportedBucketDomain", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-cdk-domain-name/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-cdk-domain-name/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" } } }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "cdk-integ-bucket-domain-name": { + "id": "cdk-integ-bucket-domain-name", + "path": "cdk-integ-bucket-domain-name", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "cdk-integ-bucket-domain-name/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "cdk-integ-bucket-domain-name/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.252" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "cdk-integ-bucket-domain-name/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "cdk-integ-bucket-domain-name/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "cdk-integ-bucket-domain-name/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.85" + "version": "10.1.252" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.ts b/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.ts index 86619ff4d3e17..2be6add4c317b 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.ts +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.ts @@ -1,11 +1,11 @@ import * as cdk from '@aws-cdk/core'; +import { IntegTest } from '@aws-cdk/integ-tests'; import * as s3 from '../lib'; class TestStack extends cdk.Stack { constructor(scope: cdk.App, id: string) { super(scope, id); - /// !show const bucket = new s3.Bucket(this, 'MyBucket', { removalPolicy: cdk.RemovalPolicy.DESTROY, }); @@ -15,10 +15,11 @@ class TestStack extends cdk.Stack { new cdk.CfnOutput(this, 'RealBucketDomain', { value: bucket.bucketDomainName }); new cdk.CfnOutput(this, 'ImportedBucketDomain', { value: bucket2.bucketDomainName }); - /// !hide } } const app = new cdk.App(); -new TestStack(app, 'aws-cdk-s3-urls'); -app.synth(); + +new IntegTest(app, 'cdk-integ-bucket-domain-name', { + testCases: [new TestStack(app, 'aws-cdk-domain-name')], +}); diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.js.snapshot/aws-cdk-s3.assets.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.js.snapshot/aws-cdk-s3.assets.json index 5a4df0849d791..b1a0dfd3a2622 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.js.snapshot/aws-cdk-s3.assets.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.js.snapshot/aws-cdk-s3.assets.json @@ -1,5 +1,5 @@ { - "version": "20.0.0", + "version": "30.1.0", "files": { "6ae3d2477de11ae9c62bfb4d56e5a92e2357fb0d390af77b733130578aee7339": { "source": { diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.js.snapshot/cdk.out b/packages/@aws-cdk/aws-s3/test/integ.bucket.js.snapshot/cdk.out index 588d7b269d34f..b72fef144f05c 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"20.0.0"} \ No newline at end of file +{"version":"30.1.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.js.snapshot/cdkintegs3bucketDefaultTestDeployAssertB89636B8.assets.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.js.snapshot/cdkintegs3bucketDefaultTestDeployAssertB89636B8.assets.json new file mode 100644 index 0000000000000..0fbecffa142a0 --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.js.snapshot/cdkintegs3bucketDefaultTestDeployAssertB89636B8.assets.json @@ -0,0 +1,19 @@ +{ + "version": "30.1.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "cdkintegs3bucketDefaultTestDeployAssertB89636B8.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.js.snapshot/cdkintegs3bucketDefaultTestDeployAssertB89636B8.template.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.js.snapshot/cdkintegs3bucketDefaultTestDeployAssertB89636B8.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.js.snapshot/cdkintegs3bucketDefaultTestDeployAssertB89636B8.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.js.snapshot/integ.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.js.snapshot/integ.json index e5cbca8a87998..4f0015ef4deff 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.js.snapshot/integ.json @@ -1,14 +1,12 @@ { - "version": "20.0.0", + "version": "30.1.0", "testCases": { - "integ.bucket": { + "cdk-integ-s3-bucket/DefaultTest": { "stacks": [ "aws-cdk-s3" ], - "diffAssets": false, - "stackUpdateWorkflow": true + "assertionStack": "cdk-integ-s3-bucket/DefaultTest/DeployAssert", + "assertionStackName": "cdkintegs3bucketDefaultTestDeployAssertB89636B8" } - }, - "synthContext": {}, - "enableLookups": false + } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.js.snapshot/manifest.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.js.snapshot/manifest.json index cf5f45b7c3082..02f5db42af79b 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { - "version": "20.0.0", + "version": "30.1.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "aws-cdk-s3.assets": { "type": "cdk:asset-manifest", "properties": { @@ -83,6 +77,59 @@ ] }, "displayName": "aws-cdk-s3" + }, + "cdkintegs3bucketDefaultTestDeployAssertB89636B8.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "cdkintegs3bucketDefaultTestDeployAssertB89636B8.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "cdkintegs3bucketDefaultTestDeployAssertB89636B8": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "cdkintegs3bucketDefaultTestDeployAssertB89636B8.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "cdkintegs3bucketDefaultTestDeployAssertB89636B8.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "cdkintegs3bucketDefaultTestDeployAssertB89636B8.assets" + ], + "metadata": { + "/cdk-integ-s3-bucket/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/cdk-integ-s3-bucket/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "cdk-integ-s3-bucket/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.js.snapshot/tree.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.js.snapshot/tree.json index cfad941f839d2..b8869297cae25 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.js.snapshot/tree.json @@ -4,14 +4,6 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" - } - }, "aws-cdk-s3": { "id": "aws-cdk-s3", "path": "aws-cdk-s3", @@ -276,17 +268,95 @@ "fqn": "@aws-cdk/aws-iam.User", "version": "0.0.0" } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-cdk-s3/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-cdk-s3/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "cdk-integ-s3-bucket": { + "id": "cdk-integ-s3-bucket", + "path": "cdk-integ-s3-bucket", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "cdk-integ-s3-bucket/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "cdk-integ-s3-bucket/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.252" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "cdk-integ-s3-bucket/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "cdk-integ-s3-bucket/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "cdk-integ-s3-bucket/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } } }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.85" + "version": "10.1.252" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.notifications.js.snapshot/NotificationTestDefaultTestDeployAssertBFB81666.assets.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.notifications.js.snapshot/NotificationTestDefaultTestDeployAssertBFB81666.assets.json index eee5ef607d9db..65ace0540faa1 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.notifications.js.snapshot/NotificationTestDefaultTestDeployAssertBFB81666.assets.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.notifications.js.snapshot/NotificationTestDefaultTestDeployAssertBFB81666.assets.json @@ -1,5 +1,5 @@ { - "version": "22.0.0", + "version": "30.1.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.notifications.js.snapshot/aws-cdk-s3-notifications.assets.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.notifications.js.snapshot/aws-cdk-s3-notifications.assets.json index 9db394e3de998..7c465ce50f598 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.notifications.js.snapshot/aws-cdk-s3-notifications.assets.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.notifications.js.snapshot/aws-cdk-s3-notifications.assets.json @@ -1,5 +1,5 @@ { - "version": "22.0.0", + "version": "30.1.0", "files": { "0950e270b55171f331f16b0a63f107106782d89c7816c2ec3ba14a69c11be52d": { "source": { diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.notifications.js.snapshot/cdk.out b/packages/@aws-cdk/aws-s3/test/integ.bucket.notifications.js.snapshot/cdk.out index 145739f539580..b72fef144f05c 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.notifications.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.notifications.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"22.0.0"} \ No newline at end of file +{"version":"30.1.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.notifications.js.snapshot/integ.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.notifications.js.snapshot/integ.json index 786c78b96c982..4a2cb2cd16b15 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.notifications.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.notifications.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "22.0.0", + "version": "30.1.0", "testCases": { "NotificationTest/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.notifications.js.snapshot/manifest.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.notifications.js.snapshot/manifest.json index 9068079d380c6..dd0024801e596 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.notifications.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.notifications.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "22.0.0", + "version": "30.1.0", "artifacts": { "aws-cdk-s3-notifications.assets": { "type": "cdk:asset-manifest", diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.notifications.js.snapshot/tree.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.notifications.js.snapshot/tree.json index 2f81d672269cf..c0e23242f761c 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.notifications.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.notifications.js.snapshot/tree.json @@ -39,7 +39,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.168" + "version": "10.1.252" } } }, @@ -159,7 +159,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.168" + "version": "10.1.252" } }, "BootstrapVersion": { @@ -197,7 +197,7 @@ "path": "NotificationTest/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.168" + "version": "10.1.252" } }, "DeployAssert": { @@ -243,7 +243,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.168" + "version": "10.1.252" } } }, diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.notifications.ts b/packages/@aws-cdk/aws-s3/test/integ.bucket.notifications.ts index 59092658fb929..c8a16e067d8a6 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.notifications.ts +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.notifications.ts @@ -15,5 +15,3 @@ new s3.Bucket(stack, 'MyEventBridgeBucket', { new integ.IntegTest(app, 'NotificationTest', { testCases: [stack], }); - -app.synth(); diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.js.snapshot/aws-cdk-s3-access-logs.assets.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.js.snapshot/aws-cdk-s3-access-logs.assets.json index 1b4fa26e8804e..9c6efb372abf0 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.js.snapshot/aws-cdk-s3-access-logs.assets.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.js.snapshot/aws-cdk-s3-access-logs.assets.json @@ -1,5 +1,5 @@ { - "version": "22.0.0", + "version": "30.1.0", "files": { "f58a2b25314952a1a5a6b42c6b9092caf2710430af09ba4f5d807e60f2fd3542": { "source": { diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.js.snapshot/cdk.out b/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.js.snapshot/cdk.out index 145739f539580..b72fef144f05c 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"22.0.0"} \ No newline at end of file +{"version":"30.1.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.js.snapshot/cdkintegs3accesslogsDefaultTestDeployAssert37A16466.assets.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.js.snapshot/cdkintegs3accesslogsDefaultTestDeployAssert37A16466.assets.json new file mode 100644 index 0000000000000..44d48a4bd52ea --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.js.snapshot/cdkintegs3accesslogsDefaultTestDeployAssert37A16466.assets.json @@ -0,0 +1,19 @@ +{ + "version": "30.1.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "cdkintegs3accesslogsDefaultTestDeployAssert37A16466.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.js.snapshot/cdkintegs3accesslogsDefaultTestDeployAssert37A16466.template.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.js.snapshot/cdkintegs3accesslogsDefaultTestDeployAssert37A16466.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.js.snapshot/cdkintegs3accesslogsDefaultTestDeployAssert37A16466.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.js.snapshot/integ.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.js.snapshot/integ.json index eba84b97fa6de..db07e940c872b 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.js.snapshot/integ.json @@ -1,14 +1,12 @@ { - "version": "22.0.0", + "version": "30.1.0", "testCases": { - "integ.bucket.server-access-logs": { + "cdk-integ-s3-access-logs/DefaultTest": { "stacks": [ "aws-cdk-s3-access-logs" ], - "diffAssets": false, - "stackUpdateWorkflow": true + "assertionStack": "cdk-integ-s3-access-logs/DefaultTest/DeployAssert", + "assertionStackName": "cdkintegs3accesslogsDefaultTestDeployAssert37A16466" } - }, - "synthContext": {}, - "enableLookups": false + } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.js.snapshot/manifest.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.js.snapshot/manifest.json index 2a1a113d65e6d..f8bde1cb1a252 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "22.0.0", + "version": "30.1.0", "artifacts": { "aws-cdk-s3-access-logs.assets": { "type": "cdk:asset-manifest", @@ -66,6 +66,53 @@ }, "displayName": "aws-cdk-s3-access-logs" }, + "cdkintegs3accesslogsDefaultTestDeployAssert37A16466.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "cdkintegs3accesslogsDefaultTestDeployAssert37A16466.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "cdkintegs3accesslogsDefaultTestDeployAssert37A16466": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "cdkintegs3accesslogsDefaultTestDeployAssert37A16466.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "cdkintegs3accesslogsDefaultTestDeployAssert37A16466.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "cdkintegs3accesslogsDefaultTestDeployAssert37A16466.assets" + ], + "metadata": { + "/cdk-integ-s3-access-logs/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/cdk-integ-s3-access-logs/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "cdk-integ-s3-access-logs/DefaultTest/DeployAssert" + }, "Tree": { "type": "cdk:tree", "properties": { diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.js.snapshot/tree.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.js.snapshot/tree.json index 2cdf059009410..dc67221905049 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.js.snapshot/tree.json @@ -148,12 +148,66 @@ "version": "0.0.0" } }, + "cdk-integ-s3-access-logs": { + "id": "cdk-integ-s3-access-logs", + "path": "cdk-integ-s3-access-logs", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "cdk-integ-s3-access-logs/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "cdk-integ-s3-access-logs/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.252" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "cdk-integ-s3-access-logs/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "cdk-integ-s3-access-logs/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "cdk-integ-s3-access-logs/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + }, "Tree": { "id": "Tree", "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.189" + "version": "10.1.252" } } }, diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.ts b/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.ts index 3373257e5529c..ac9ca66688cc2 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.ts +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.ts @@ -1,5 +1,6 @@ #!/usr/bin/env node import * as cdk from '@aws-cdk/core'; +import { IntegTest } from '@aws-cdk/integ-tests'; import * as s3 from '../lib'; const app = new cdk.App(); @@ -16,4 +17,6 @@ new s3.Bucket(stack, 'MyBucket', { removalPolicy: cdk.RemovalPolicy.DESTROY, }); -app.synth(); +new IntegTest(app, 'cdk-integ-s3-access-logs', { + testCases: [stack], +}); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.ts b/packages/@aws-cdk/aws-s3/test/integ.bucket.ts index 506c9c952a41b..ec8b536ea887e 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.ts +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.ts @@ -1,6 +1,7 @@ #!/usr/bin/env node import * as iam from '@aws-cdk/aws-iam'; import * as cdk from '@aws-cdk/core'; +import { IntegTest } from '@aws-cdk/integ-tests'; import * as s3 from '../lib'; const app = new cdk.App(); @@ -21,4 +22,6 @@ const user = new iam.User(stack, 'MyUser'); bucket.grantReadWrite(user); otherwiseEncryptedBucket.grantRead(user); -app.synth(); +new IntegTest(app, 'cdk-integ-s3-bucket', { + testCases: [stack], +}); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.url.lit.js.snapshot/aws-cdk-s3-urls.assets.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.url.js.snapshot/aws-cdk-s3-urls.assets.json similarity index 96% rename from packages/@aws-cdk/aws-s3/test/integ.bucket.url.lit.js.snapshot/aws-cdk-s3-urls.assets.json rename to packages/@aws-cdk/aws-s3/test/integ.bucket.url.js.snapshot/aws-cdk-s3-urls.assets.json index a50f14c71b58a..c7c009a8b4f4c 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.url.lit.js.snapshot/aws-cdk-s3-urls.assets.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.url.js.snapshot/aws-cdk-s3-urls.assets.json @@ -1,5 +1,5 @@ { - "version": "20.0.0", + "version": "30.1.0", "files": { "efcd9b5b8fd4dda412d0411dc133a79ecdb73e7451f792b4b4dc31ffe6814e4c": { "source": { diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.url.lit.js.snapshot/aws-cdk-s3-urls.template.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.url.js.snapshot/aws-cdk-s3-urls.template.json similarity index 100% rename from packages/@aws-cdk/aws-s3/test/integ.bucket.url.lit.js.snapshot/aws-cdk-s3-urls.template.json rename to packages/@aws-cdk/aws-s3/test/integ.bucket.url.js.snapshot/aws-cdk-s3-urls.template.json diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.url.js.snapshot/cdk.out b/packages/@aws-cdk/aws-s3/test/integ.bucket.url.js.snapshot/cdk.out new file mode 100644 index 0000000000000..b72fef144f05c --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.url.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"30.1.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.url.js.snapshot/cdkintegs3urlsDefaultTestDeployAssertDB43F13E.assets.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.url.js.snapshot/cdkintegs3urlsDefaultTestDeployAssertDB43F13E.assets.json new file mode 100644 index 0000000000000..72ea9cdfd1dd3 --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.url.js.snapshot/cdkintegs3urlsDefaultTestDeployAssertDB43F13E.assets.json @@ -0,0 +1,19 @@ +{ + "version": "30.1.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "cdkintegs3urlsDefaultTestDeployAssertDB43F13E.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.url.js.snapshot/cdkintegs3urlsDefaultTestDeployAssertDB43F13E.template.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.url.js.snapshot/cdkintegs3urlsDefaultTestDeployAssertDB43F13E.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.url.js.snapshot/cdkintegs3urlsDefaultTestDeployAssertDB43F13E.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.url.js.snapshot/integ.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.url.js.snapshot/integ.json new file mode 100644 index 0000000000000..19979740944e4 --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.url.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "30.1.0", + "testCases": { + "cdk-integ-s3-urls/DefaultTest": { + "stacks": [ + "aws-cdk-s3-urls" + ], + "assertionStack": "cdk-integ-s3-urls/DefaultTest/DeployAssert", + "assertionStackName": "cdkintegs3urlsDefaultTestDeployAssertDB43F13E" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.url.lit.js.snapshot/manifest.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.url.js.snapshot/manifest.json similarity index 57% rename from packages/@aws-cdk/aws-s3/test/integ.bucket.url.lit.js.snapshot/manifest.json rename to packages/@aws-cdk/aws-s3/test/integ.bucket.url.js.snapshot/manifest.json index 2c9b86e9335fd..66384b0d9c930 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.url.lit.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.url.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { - "version": "20.0.0", + "version": "30.1.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "aws-cdk-s3-urls.assets": { "type": "cdk:asset-manifest", "properties": { @@ -89,6 +83,59 @@ ] }, "displayName": "aws-cdk-s3-urls" + }, + "cdkintegs3urlsDefaultTestDeployAssertDB43F13E.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "cdkintegs3urlsDefaultTestDeployAssertDB43F13E.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "cdkintegs3urlsDefaultTestDeployAssertDB43F13E": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "cdkintegs3urlsDefaultTestDeployAssertDB43F13E.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "cdkintegs3urlsDefaultTestDeployAssertDB43F13E.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "cdkintegs3urlsDefaultTestDeployAssertDB43F13E.assets" + ], + "metadata": { + "/cdk-integ-s3-urls/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/cdk-integ-s3-urls/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "cdk-integ-s3-urls/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.url.js.snapshot/tree.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.url.js.snapshot/tree.json new file mode 100644 index 0000000000000..1461eabddf38b --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.url.js.snapshot/tree.json @@ -0,0 +1,163 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "aws-cdk-s3-urls": { + "id": "aws-cdk-s3-urls", + "path": "aws-cdk-s3-urls", + "children": { + "MyBucket": { + "id": "MyBucket", + "path": "aws-cdk-s3-urls/MyBucket", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-s3-urls/MyBucket/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::S3::Bucket", + "aws:cdk:cloudformation:props": {} + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.CfnBucket", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.Bucket", + "version": "0.0.0" + } + }, + "BucketURL": { + "id": "BucketURL", + "path": "aws-cdk-s3-urls/BucketURL", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "ObjectURL": { + "id": "ObjectURL", + "path": "aws-cdk-s3-urls/ObjectURL", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "VirtualHostedObjectURL": { + "id": "VirtualHostedObjectURL", + "path": "aws-cdk-s3-urls/VirtualHostedObjectURL", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "VirtualHostedObjectURLNonRegional": { + "id": "VirtualHostedObjectURLNonRegional", + "path": "aws-cdk-s3-urls/VirtualHostedObjectURLNonRegional", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "S3ObjectURL": { + "id": "S3ObjectURL", + "path": "aws-cdk-s3-urls/S3ObjectURL", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-cdk-s3-urls/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-cdk-s3-urls/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "cdk-integ-s3-urls": { + "id": "cdk-integ-s3-urls", + "path": "cdk-integ-s3-urls", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "cdk-integ-s3-urls/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "cdk-integ-s3-urls/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.252" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "cdk-integ-s3-urls/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "cdk-integ-s3-urls/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "cdk-integ-s3-urls/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.252" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.url.lit.js.snapshot/cdk.out b/packages/@aws-cdk/aws-s3/test/integ.bucket.url.lit.js.snapshot/cdk.out deleted file mode 100644 index 588d7b269d34f..0000000000000 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.url.lit.js.snapshot/cdk.out +++ /dev/null @@ -1 +0,0 @@ -{"version":"20.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.url.lit.js.snapshot/integ.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.url.lit.js.snapshot/integ.json deleted file mode 100644 index ebc1d60d49eb9..0000000000000 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.url.lit.js.snapshot/integ.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "version": "20.0.0", - "testCases": { - "integ.bucket.url.lit": { - "stacks": [ - "aws-cdk-s3-urls" - ], - "diffAssets": false, - "stackUpdateWorkflow": true - } - }, - "synthContext": {}, - "enableLookups": false -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.url.lit.js.snapshot/tree.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.url.lit.js.snapshot/tree.json deleted file mode 100644 index 5bcc462859559..0000000000000 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.url.lit.js.snapshot/tree.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "version": "tree-0.1", - "tree": { - "id": "App", - "path": "", - "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" - } - }, - "aws-cdk-s3-urls": { - "id": "aws-cdk-s3-urls", - "path": "aws-cdk-s3-urls", - "children": { - "MyBucket": { - "id": "MyBucket", - "path": "aws-cdk-s3-urls/MyBucket", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-cdk-s3-urls/MyBucket/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::S3::Bucket", - "aws:cdk:cloudformation:props": {} - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-s3.CfnBucket", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-s3.Bucket", - "version": "0.0.0" - } - }, - "BucketURL": { - "id": "BucketURL", - "path": "aws-cdk-s3-urls/BucketURL", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" - } - }, - "ObjectURL": { - "id": "ObjectURL", - "path": "aws-cdk-s3-urls/ObjectURL", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" - } - }, - "VirtualHostedObjectURL": { - "id": "VirtualHostedObjectURL", - "path": "aws-cdk-s3-urls/VirtualHostedObjectURL", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" - } - }, - "VirtualHostedObjectURLNonRegional": { - "id": "VirtualHostedObjectURLNonRegional", - "path": "aws-cdk-s3-urls/VirtualHostedObjectURLNonRegional", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" - } - }, - "S3ObjectURL": { - "id": "S3ObjectURL", - "path": "aws-cdk-s3-urls/S3ObjectURL", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" - } - } - }, - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" - } - } - }, - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.url.lit.ts b/packages/@aws-cdk/aws-s3/test/integ.bucket.url.ts similarity index 85% rename from packages/@aws-cdk/aws-s3/test/integ.bucket.url.lit.ts rename to packages/@aws-cdk/aws-s3/test/integ.bucket.url.ts index e3655bf6e1f94..421df8bd28912 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.url.lit.ts +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.url.ts @@ -1,11 +1,11 @@ import * as cdk from '@aws-cdk/core'; +import { IntegTest } from '@aws-cdk/integ-tests'; import * as s3 from '../lib'; class TestStack extends cdk.Stack { constructor(scope: cdk.App, id: string) { super(scope, id); - /// !show const bucket = new s3.Bucket(this, 'MyBucket', { removalPolicy: cdk.RemovalPolicy.DESTROY, }); @@ -15,10 +15,11 @@ class TestStack extends cdk.Stack { new cdk.CfnOutput(this, 'VirtualHostedObjectURL', { value: bucket.virtualHostedUrlForObject('myfolder/myfile.txt') }); new cdk.CfnOutput(this, 'VirtualHostedObjectURLNonRegional', { value: bucket.virtualHostedUrlForObject('myfolder/myfile.txt', { regional: false }) }); new cdk.CfnOutput(this, 'S3ObjectURL', { value: bucket.s3UrlForObject('myfolder/myfile.txt') }); - /// !hide } } const app = new cdk.App(); -new TestStack(app, 'aws-cdk-s3-urls'); -app.synth(); + +new IntegTest(app, 'cdk-integ-s3-urls', { + testCases: [new TestStack(app, 'aws-cdk-s3-urls')], +}); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.js.snapshot/aws-cdk-s3.assets.json b/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.js.snapshot/aws-cdk-s3.assets.json index e73c5ea2885ca..8a75c282efdc2 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.js.snapshot/aws-cdk-s3.assets.json +++ b/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.js.snapshot/aws-cdk-s3.assets.json @@ -1,5 +1,5 @@ { - "version": "21.0.0", + "version": "30.1.0", "files": { "928a24cbf7a16b7c4d15a9ceca38a2f7f016495b93db9bdf0160accc3d13876c": { "source": { diff --git a/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.js.snapshot/cdk.out b/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.js.snapshot/cdk.out index 8ecc185e9dbee..b72fef144f05c 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"21.0.0"} \ No newline at end of file +{"version":"30.1.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.js.snapshot/cdkinteglifecycleexpirationDefaultTestDeployAssertDFC0D8F1.assets.json b/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.js.snapshot/cdkinteglifecycleexpirationDefaultTestDeployAssertDFC0D8F1.assets.json new file mode 100644 index 0000000000000..21188babbd388 --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.js.snapshot/cdkinteglifecycleexpirationDefaultTestDeployAssertDFC0D8F1.assets.json @@ -0,0 +1,19 @@ +{ + "version": "30.1.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "cdkinteglifecycleexpirationDefaultTestDeployAssertDFC0D8F1.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.js.snapshot/cdkinteglifecycleexpirationDefaultTestDeployAssertDFC0D8F1.template.json b/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.js.snapshot/cdkinteglifecycleexpirationDefaultTestDeployAssertDFC0D8F1.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.js.snapshot/cdkinteglifecycleexpirationDefaultTestDeployAssertDFC0D8F1.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.js.snapshot/integ.json b/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.js.snapshot/integ.json index 286d239e483cd..16308002dcfe8 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.js.snapshot/integ.json @@ -1,14 +1,12 @@ { - "version": "21.0.0", + "version": "30.1.0", "testCases": { - "integ.lifecycle-expiration": { + "cdk-integ-lifecycle-expiration/DefaultTest": { "stacks": [ "aws-cdk-s3" ], - "diffAssets": false, - "stackUpdateWorkflow": true + "assertionStack": "cdk-integ-lifecycle-expiration/DefaultTest/DeployAssert", + "assertionStackName": "cdkinteglifecycleexpirationDefaultTestDeployAssertDFC0D8F1" } - }, - "synthContext": {}, - "enableLookups": false + } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.js.snapshot/manifest.json b/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.js.snapshot/manifest.json index b7ae856f8f23f..0f24d4e0277a4 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { - "version": "21.0.0", + "version": "30.1.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "aws-cdk-s3.assets": { "type": "cdk:asset-manifest", "properties": { @@ -59,6 +53,59 @@ ] }, "displayName": "aws-cdk-s3" + }, + "cdkinteglifecycleexpirationDefaultTestDeployAssertDFC0D8F1.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "cdkinteglifecycleexpirationDefaultTestDeployAssertDFC0D8F1.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "cdkinteglifecycleexpirationDefaultTestDeployAssertDFC0D8F1": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "cdkinteglifecycleexpirationDefaultTestDeployAssertDFC0D8F1.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "cdkinteglifecycleexpirationDefaultTestDeployAssertDFC0D8F1.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "cdkinteglifecycleexpirationDefaultTestDeployAssertDFC0D8F1.assets" + ], + "metadata": { + "/cdk-integ-lifecycle-expiration/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/cdk-integ-lifecycle-expiration/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "cdk-integ-lifecycle-expiration/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.js.snapshot/tree.json b/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.js.snapshot/tree.json index 62d43a017ab0e..64e9161bab062 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.js.snapshot/tree.json @@ -4,14 +4,6 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.140" - } - }, "aws-cdk-s3": { "id": "aws-cdk-s3", "path": "aws-cdk-s3", @@ -49,12 +41,90 @@ "fqn": "@aws-cdk/aws-s3.Bucket", "version": "0.0.0" } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-cdk-s3/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-cdk-s3/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } } }, "constructInfo": { "fqn": "@aws-cdk/core.Stack", "version": "0.0.0" } + }, + "cdk-integ-lifecycle-expiration": { + "id": "cdk-integ-lifecycle-expiration", + "path": "cdk-integ-lifecycle-expiration", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "cdk-integ-lifecycle-expiration/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "cdk-integ-lifecycle-expiration/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.252" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "cdk-integ-lifecycle-expiration/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "cdk-integ-lifecycle-expiration/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "cdk-integ-lifecycle-expiration/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.252" + } } }, "constructInfo": { diff --git a/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.ts b/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.ts index 211ac74c8261d..eaaab2e6f25db 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.ts +++ b/packages/@aws-cdk/aws-s3/test/integ.lifecycle-expiration.ts @@ -1,4 +1,5 @@ import { App, Duration, Stack } from '@aws-cdk/core'; +import { IntegTest } from '@aws-cdk/integ-tests'; import { Bucket } from '../lib'; const app = new App(); @@ -12,4 +13,6 @@ new Bucket(stack, 'MyBucket', { }], }); -app.synth(); \ No newline at end of file +new IntegTest(app, 'cdk-integ-lifecycle-expiration', { + testCases: [stack], +}); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.lifecycle.js.snapshot/aws-cdk-s3.assets.json b/packages/@aws-cdk/aws-s3/test/integ.lifecycle.js.snapshot/aws-cdk-s3.assets.json index d122bdeed0d38..d0a5cb96b7665 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.lifecycle.js.snapshot/aws-cdk-s3.assets.json +++ b/packages/@aws-cdk/aws-s3/test/integ.lifecycle.js.snapshot/aws-cdk-s3.assets.json @@ -1,5 +1,5 @@ { - "version": "20.0.0", + "version": "30.1.0", "files": { "ec43659201be5ffe7c1311b82c63224f177655acd30be0d6f1b0b377a9915825": { "source": { diff --git a/packages/@aws-cdk/aws-s3/test/integ.lifecycle.js.snapshot/cdk.out b/packages/@aws-cdk/aws-s3/test/integ.lifecycle.js.snapshot/cdk.out index 588d7b269d34f..b72fef144f05c 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.lifecycle.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-s3/test/integ.lifecycle.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"20.0.0"} \ No newline at end of file +{"version":"30.1.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.lifecycle.js.snapshot/cdkinteglifecycleDefaultTestDeployAssert83FA03B1.assets.json b/packages/@aws-cdk/aws-s3/test/integ.lifecycle.js.snapshot/cdkinteglifecycleDefaultTestDeployAssert83FA03B1.assets.json new file mode 100644 index 0000000000000..dbb0b2c6c9725 --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.lifecycle.js.snapshot/cdkinteglifecycleDefaultTestDeployAssert83FA03B1.assets.json @@ -0,0 +1,19 @@ +{ + "version": "30.1.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "cdkinteglifecycleDefaultTestDeployAssert83FA03B1.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.lifecycle.js.snapshot/cdkinteglifecycleDefaultTestDeployAssert83FA03B1.template.json b/packages/@aws-cdk/aws-s3/test/integ.lifecycle.js.snapshot/cdkinteglifecycleDefaultTestDeployAssert83FA03B1.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.lifecycle.js.snapshot/cdkinteglifecycleDefaultTestDeployAssert83FA03B1.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.lifecycle.js.snapshot/integ.json b/packages/@aws-cdk/aws-s3/test/integ.lifecycle.js.snapshot/integ.json index 7ea8db89e32c8..913066fd7cda7 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.lifecycle.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-s3/test/integ.lifecycle.js.snapshot/integ.json @@ -1,14 +1,12 @@ { - "version": "20.0.0", + "version": "30.1.0", "testCases": { - "integ.lifecycle": { + "cdk-integ-lifecycle/DefaultTest": { "stacks": [ "aws-cdk-s3" ], - "diffAssets": false, - "stackUpdateWorkflow": true + "assertionStack": "cdk-integ-lifecycle/DefaultTest/DeployAssert", + "assertionStackName": "cdkinteglifecycleDefaultTestDeployAssert83FA03B1" } - }, - "synthContext": {}, - "enableLookups": false + } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.lifecycle.js.snapshot/manifest.json b/packages/@aws-cdk/aws-s3/test/integ.lifecycle.js.snapshot/manifest.json index 4cc58b12d361b..07b06677e1601 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.lifecycle.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-s3/test/integ.lifecycle.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { - "version": "20.0.0", + "version": "30.1.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "aws-cdk-s3.assets": { "type": "cdk:asset-manifest", "properties": { @@ -59,6 +53,59 @@ ] }, "displayName": "aws-cdk-s3" + }, + "cdkinteglifecycleDefaultTestDeployAssert83FA03B1.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "cdkinteglifecycleDefaultTestDeployAssert83FA03B1.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "cdkinteglifecycleDefaultTestDeployAssert83FA03B1": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "cdkinteglifecycleDefaultTestDeployAssert83FA03B1.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "cdkinteglifecycleDefaultTestDeployAssert83FA03B1.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "cdkinteglifecycleDefaultTestDeployAssert83FA03B1.assets" + ], + "metadata": { + "/cdk-integ-lifecycle/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/cdk-integ-lifecycle/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "cdk-integ-lifecycle/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.lifecycle.js.snapshot/tree.json b/packages/@aws-cdk/aws-s3/test/integ.lifecycle.js.snapshot/tree.json index 0779286d122f6..9f6808d78e9b5 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.lifecycle.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-s3/test/integ.lifecycle.js.snapshot/tree.json @@ -4,14 +4,6 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" - } - }, "aws-cdk-s3": { "id": "aws-cdk-s3", "path": "aws-cdk-s3", @@ -52,17 +44,95 @@ "fqn": "@aws-cdk/aws-s3.Bucket", "version": "0.0.0" } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-cdk-s3/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-cdk-s3/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "cdk-integ-lifecycle": { + "id": "cdk-integ-lifecycle", + "path": "cdk-integ-lifecycle", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "cdk-integ-lifecycle/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "cdk-integ-lifecycle/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.252" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "cdk-integ-lifecycle/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "cdk-integ-lifecycle/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "cdk-integ-lifecycle/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } } }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.85" + "version": "10.1.252" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.lifecycle.ts b/packages/@aws-cdk/aws-s3/test/integ.lifecycle.ts index 249480959e414..af506cbdd658e 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.lifecycle.ts +++ b/packages/@aws-cdk/aws-s3/test/integ.lifecycle.ts @@ -1,4 +1,5 @@ import { App, RemovalPolicy, Stack } from '@aws-cdk/core'; +import { IntegTest } from '@aws-cdk/integ-tests'; import { Bucket } from '../lib'; const app = new App(); @@ -20,4 +21,6 @@ new Bucket(stack, 'MyBucket', { removalPolicy: RemovalPolicy.DESTROY, }); -app.synth(); +new IntegTest(app, 'cdk-integ-lifecycle', { + testCases: [stack], +}); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-secretsmanager/lib/secret.ts b/packages/@aws-cdk/aws-secretsmanager/lib/secret.ts index bc49b5b6198ee..de80530b9ab6a 100644 --- a/packages/@aws-cdk/aws-secretsmanager/lib/secret.ts +++ b/packages/@aws-cdk/aws-secretsmanager/lib/secret.ts @@ -835,22 +835,38 @@ export class SecretTargetAttachment extends SecretBase implements ISecretTargetA protected readonly autoCreatePolicy = true; + private readonly attachedSecret: ISecret; + constructor(scope: Construct, id: string, props: SecretTargetAttachmentProps) { super(scope, id); + this.attachedSecret = props.secret; const attachment = new secretsmanager.CfnSecretTargetAttachment(this, 'Resource', { - secretId: props.secret.secretArn, + secretId: this.attachedSecret.secretArn, targetId: props.target.asSecretAttachmentTarget().targetId, targetType: attachmentTargetTypeToString(props.target.asSecretAttachmentTarget().targetType), }); - this.encryptionKey = props.secret.encryptionKey; - this.secretName = props.secret.secretName; + this.encryptionKey = this.attachedSecret.encryptionKey; + this.secretName = this.attachedSecret.secretName; // This allows to reference the secret after attachment (dependency). this.secretArn = attachment.ref; this.secretTargetAttachmentSecretArn = attachment.ref; } + + /** + * Forward any additions to the resource policy to the original secret. + * This is required because a secret can only have a single resource policy. + * If we do not forward policy additions, a new policy resource is created using the secret attachment ARN. + * This ends up being rejected by CloudFormation. + */ + public addToResourcePolicy(statement: iam.PolicyStatement): iam.AddToResourcePolicyResult { + if (FeatureFlags.of(this).isEnabled(cxapi.SECRETS_MANAGER_TARGET_ATTACHMENT_RESOURCE_POLICY)) { + return this.attachedSecret.addToResourcePolicy(statement); + } + return super.addToResourcePolicy(statement); + } } /** diff --git a/packages/@aws-cdk/aws-secretsmanager/test/policy.test.ts b/packages/@aws-cdk/aws-secretsmanager/test/policy.test.ts new file mode 100644 index 0000000000000..a40c409b007b5 --- /dev/null +++ b/packages/@aws-cdk/aws-secretsmanager/test/policy.test.ts @@ -0,0 +1,43 @@ +import { Template } from '@aws-cdk/assertions'; +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 secretsmanager from '../lib'; +import { AttachmentTargetType, ISecretAttachmentTarget } from '../lib'; + +class MockAttachmentTarget extends cdk.Resource implements ISecretAttachmentTarget { + asSecretAttachmentTarget(): secretsmanager.SecretAttachmentTargetProps { + return { + targetId: 'mock-id', + targetType: AttachmentTargetType.RDS_DB_INSTANCE, + }; + } +} + +describe.each([ + [false, 2], + [true, 1], +])('@aws-cdk/aws-secretsmanager:useAttachedSecretResourcePolicyForSecretTargetAttachments=%s', (featureFlagValue, expectedResourcePolicyCount) => { + const app = new cdk.App({ + context: { + [cxapi.SECRETS_MANAGER_TARGET_ATTACHMENT_RESOURCE_POLICY]: featureFlagValue, + }, + }); + const stack = new cdk.Stack(app); + + test('using addToResourcePolicy on a Secret and on a SecretAttachmentTarget attaching this Secret', () => { + // GIVEN + + const secret = new secretsmanager.Secret(stack, 'Secret'); + const servicePrincipalOne = new iam.ServicePrincipal('some-service-a'); + const servicePrincipalTwo = new iam.ServicePrincipal('some-service-b'); + const secretAttachment = secret.attach(new MockAttachmentTarget(stack, 'mock-target')); + + // WHEN + secret.grantRead(servicePrincipalOne); + secretAttachment.grantRead(servicePrincipalTwo); + + // THEN + Template.fromStack(stack).resourceCountIs('AWS::SecretsManager::ResourcePolicy', expectedResourcePolicyCount); + }); +}); diff --git a/packages/@aws-cdk/aws-servicecatalog/lib/private/product-stack-synthesizer.ts b/packages/@aws-cdk/aws-servicecatalog/lib/private/product-stack-synthesizer.ts index d451f34fc51ad..53a88bf463718 100644 --- a/packages/@aws-cdk/aws-servicecatalog/lib/private/product-stack-synthesizer.ts +++ b/packages/@aws-cdk/aws-servicecatalog/lib/private/product-stack-synthesizer.ts @@ -23,7 +23,7 @@ export class ProductStackSynthesizer extends cdk.StackSynthesizer { throw new Error('An Asset Bucket must be provided to use Assets'); } const outdir = cdk.App.of(this.boundStack)?.outdir ?? 'cdk.out'; - const assetPath = `./${outdir}/${asset.fileName}`; + const assetPath = `${outdir}/${asset.fileName}`; if (!this.bucketDeployment) { const parentStack = (this.boundStack as ProductStack)._getParentStack(); if (!cdk.Resource.isOwnedResource(this.assetBucket)) { diff --git a/packages/@aws-cdk/aws-servicecatalog/test/product-stack.test.ts b/packages/@aws-cdk/aws-servicecatalog/test/product-stack.test.ts index fd897111d1f5e..8a56bafa932f3 100644 --- a/packages/@aws-cdk/aws-servicecatalog/test/product-stack.test.ts +++ b/packages/@aws-cdk/aws-servicecatalog/test/product-stack.test.ts @@ -54,6 +54,32 @@ describe('ProductStack', () => { }); }); + test('Use correct assetPath when outdir is absolute', () => { + // GIVEN + const app = new cdk.App( + { outdir: '/tmp/foobar' }, + ); + const mainStack = new cdk.Stack(app, 'MyStackAbsolutePath'); + const testAssetBucket = new s3.Bucket(mainStack, 'TestAssetBucket', { + bucketName: 'test-asset-bucket', + }); + const productStack = new servicecatalog.ProductStack(mainStack, 'MyProductStackAbsolutePath', { + assetBucket: testAssetBucket, + }); + + new lambda.Function(productStack, 'HelloHandler', { + runtime: lambda.Runtime.PYTHON_3_9, + code: lambda.Code.fromAsset(path.join(__dirname, 'assets')), + handler: 'index.handler', + }); + + // WHEN + const assembly = app.synth(); + + // THEN + expect(assembly.directory).toBe('/tmp/foobar'); + }); + test('Used defined Asset bucket in product stack with nested assets', () => { // GIVEN const app = new cdk.App( diff --git a/packages/@aws-cdk/aws-ses/package.json b/packages/@aws-cdk/aws-ses/package.json index 3032c97aff112..01bfcb1c416f4 100644 --- a/packages/@aws-cdk/aws-ses/package.json +++ b/packages/@aws-cdk/aws-ses/package.json @@ -86,7 +86,7 @@ "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/cfn2ts": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/aws-lambda": "^8.10.110", + "@types/aws-lambda": "^8.10.111", "@types/jest": "^27.5.2", "jest": "^27.5.1" }, diff --git a/packages/@aws-cdk/aws-sqs/package.json b/packages/@aws-cdk/aws-sqs/package.json index 764aaf0c2da92..1e2ebe4bbb600 100644 --- a/packages/@aws-cdk/aws-sqs/package.json +++ b/packages/@aws-cdk/aws-sqs/package.json @@ -88,7 +88,7 @@ "@aws-cdk/cfn2ts": "0.0.0", "@aws-cdk/pkglint": "0.0.0", "@types/jest": "^27.5.2", - "aws-sdk": "^2.1317.0", + "aws-sdk": "^2.1325.0", "jest": "^27.5.1" }, "dependencies": { diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/README.md b/packages/@aws-cdk/aws-stepfunctions-tasks/README.md index 073fee55f1dda..b2ca56076dab8 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/README.md +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/README.md @@ -228,7 +228,7 @@ state machine role's policy. Use it in the case where the call requires more tha to be executed: ```ts -const detectLabels = new tasks.CallAwsService(stack, 'DetectLabels', { +const detectLabels = new tasks.CallAwsService(this, 'DetectLabels', { service: 'rekognition', action: 'detectLabels', iamResources: ['*'], diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/ecs/run-task.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/ecs/run-task.ts index dd8ed338e68e3..6c02159a56bfe 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/ecs/run-task.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/ecs/run-task.ts @@ -27,6 +27,13 @@ export interface EcsRunTaskProps extends sfn.TaskStateBaseProps { */ readonly taskDefinition: ecs.TaskDefinition; + /** + * The revision number of ECS task definiton family + * + * @default - '$latest' + */ + readonly revisionNumber?: number; + /** * Container setting overrides * @@ -282,7 +289,7 @@ export class EcsRunTask extends sfn.TaskStateBase implements ec2.IConnectable { Resource: integrationResourceArn('ecs', 'runTask', this.integrationPattern), Parameters: sfn.FieldUtils.renderObject({ Cluster: this.props.cluster.clusterArn, - TaskDefinition: this.props.taskDefinition.family, + TaskDefinition: this.props.revisionNumber === undefined ? this.props.taskDefinition.family : `${this.props.taskDefinition.family}:${this.props.revisionNumber.toString()}`, NetworkConfiguration: this.networkConfiguration, Overrides: renderOverrides(this.props.containerOverrides), ...this.props.launchTarget.bind(this, { taskDefinition: this.props.taskDefinition, cluster: this.props.cluster }).parameters, diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/aws-sfn-tasks-ecs-fargate-integ.assets.json b/packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/aws-sfn-tasks-ecs-fargate-integ.assets.json index 43d2aed6b91cd..a5092dbba5075 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/aws-sfn-tasks-ecs-fargate-integ.assets.json +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/aws-sfn-tasks-ecs-fargate-integ.assets.json @@ -1,7 +1,7 @@ { "version": "30.0.0", "files": { - "add92abd33bdedcd7447faa84ea0fe330f8f547f3de2b71052511e602a947aa7": { + "e24a1536363f5a0e085f665d59c23d647a03864eb45d88b8d07e2d0d8e285ee1": { "source": { "path": "aws-sfn-tasks-ecs-fargate-integ.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "add92abd33bdedcd7447faa84ea0fe330f8f547f3de2b71052511e602a947aa7.json", + "objectKey": "e24a1536363f5a0e085f665d59c23d647a03864eb45d88b8d07e2d0d8e285ee1.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/aws-sfn-tasks-ecs-fargate-integ.template.json b/packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/aws-sfn-tasks-ecs-fargate-integ.template.json index dace358976d49..d027193b1669d 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/aws-sfn-tasks-ecs-fargate-integ.template.json +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/aws-sfn-tasks-ecs-fargate-integ.template.json @@ -560,6 +560,22 @@ } } }, + "FargeateTaskSetRevisionNumberSecurityGroup916C9B0B": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "aws-sfn-tasks-ecs-fargate-integ/FargeateTaskSetRevisionNumber/SecurityGroup", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": { + "Ref": "FargateClusterVpc377E8024" + } + } + }, "StateMachineRoleB840431D": { "Type": "AWS::IAM::Role", "Properties": { @@ -775,7 +791,7 @@ "Fn::Join": [ "", [ - "{\"StartAt\":\"Start\",\"States\":{\"Start\":{\"Type\":\"Pass\",\"Result\":{\"SomeKey\":\"SomeValue\",\"Timeout\":900},\"Next\":\"FargateTask\"},\"FargateTask\":{\"End\":true,\"Type\":\"Task\",\"TimeoutSecondsPath\":\"$.Timeout\",\"Resource\":\"arn:", + "{\"StartAt\":\"Start\",\"States\":{\"Start\":{\"Type\":\"Pass\",\"Result\":{\"SomeKey\":\"SomeValue\",\"Timeout\":900},\"Next\":\"FargateTask\"},\"FargateTask\":{\"Next\":\"FargeateTaskSetRevisionNumber\",\"Type\":\"Task\",\"TimeoutSecondsPath\":\"$.Timeout\",\"Resource\":\"arn:", { "Ref": "AWS::Partition" }, @@ -801,7 +817,33 @@ "GroupId" ] }, - "\"]}},\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"TheContainer\",\"Environment\":[{\"Name\":\"SOME_KEY\",\"Value.$\":\"$.SomeKey\"}]}]},\"LaunchType\":\"FARGATE\",\"PlatformVersion\":\"1.4.0\"}}}}" + "\"]}},\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"TheContainer\",\"Environment\":[{\"Name\":\"SOME_KEY\",\"Value.$\":\"$.SomeKey\"}]}]},\"LaunchType\":\"FARGATE\",\"PlatformVersion\":\"1.4.0\"}},\"FargeateTaskSetRevisionNumber\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::ecs:runTask\",\"Parameters\":{\"Cluster\":\"", + { + "Fn::GetAtt": [ + "FargateCluster7CCD5F93", + "Arn" + ] + }, + "\",\"TaskDefinition\":\"awssfntasksecsfargateintegTaskDefD0F4AD10:1\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"Subnets\":[\"", + { + "Ref": "FargateClusterVpcPrivateSubnet1Subnet9127625F" + }, + "\",\"", + { + "Ref": "FargateClusterVpcPrivateSubnet2Subnet307CEE57" + }, + "\"],\"SecurityGroups\":[\"", + { + "Fn::GetAtt": [ + "FargeateTaskSetRevisionNumberSecurityGroup916C9B0B", + "GroupId" + ] + }, + "\"]}},\"LaunchType\":\"FARGATE\",\"PlatformVersion\":\"1.4.0\"}}}}" ] ] } diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/manifest.json b/packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/manifest.json index d083ec552aba6..92d553548b2a9 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/manifest.json @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/add92abd33bdedcd7447faa84ea0fe330f8f547f3de2b71052511e602a947aa7.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/e24a1536363f5a0e085f665d59c23d647a03864eb45d88b8d07e2d0d8e285ee1.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -213,6 +213,12 @@ "data": "FargateTaskSecurityGroup0BBB27CB" } ], + "/aws-sfn-tasks-ecs-fargate-integ/FargeateTaskSetRevisionNumber/SecurityGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "FargeateTaskSetRevisionNumberSecurityGroup916C9B0B" + } + ], "/aws-sfn-tasks-ecs-fargate-integ/StateMachine/Role/Resource": [ { "type": "aws:cdk:logicalId", diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/tree.json b/packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/tree.json index 0e0a729a20371..4391e121d8b04 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.js.snapshot/tree.json @@ -1016,6 +1016,50 @@ "version": "0.0.0" } }, + "FargeateTaskSetRevisionNumber": { + "id": "FargeateTaskSetRevisionNumber", + "path": "aws-sfn-tasks-ecs-fargate-integ/FargeateTaskSetRevisionNumber", + "children": { + "SecurityGroup": { + "id": "SecurityGroup", + "path": "aws-sfn-tasks-ecs-fargate-integ/FargeateTaskSetRevisionNumber/SecurityGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-sfn-tasks-ecs-fargate-integ/FargeateTaskSetRevisionNumber/SecurityGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", + "aws:cdk:cloudformation:props": { + "groupDescription": "aws-sfn-tasks-ecs-fargate-integ/FargeateTaskSetRevisionNumber/SecurityGroup", + "securityGroupEgress": [ + { + "cidrIp": "0.0.0.0/0", + "description": "Allow all outbound traffic by default", + "ipProtocol": "-1" + } + ], + "vpcId": { + "Ref": "FargateClusterVpc377E8024" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.SecurityGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-stepfunctions-tasks.EcsRunTask", + "version": "0.0.0" + } + }, "StateMachine": { "id": "StateMachine", "path": "aws-sfn-tasks-ecs-fargate-integ/StateMachine", @@ -1282,7 +1326,7 @@ "Fn::Join": [ "", [ - "{\"StartAt\":\"Start\",\"States\":{\"Start\":{\"Type\":\"Pass\",\"Result\":{\"SomeKey\":\"SomeValue\",\"Timeout\":900},\"Next\":\"FargateTask\"},\"FargateTask\":{\"End\":true,\"Type\":\"Task\",\"TimeoutSecondsPath\":\"$.Timeout\",\"Resource\":\"arn:", + "{\"StartAt\":\"Start\",\"States\":{\"Start\":{\"Type\":\"Pass\",\"Result\":{\"SomeKey\":\"SomeValue\",\"Timeout\":900},\"Next\":\"FargateTask\"},\"FargateTask\":{\"Next\":\"FargeateTaskSetRevisionNumber\",\"Type\":\"Task\",\"TimeoutSecondsPath\":\"$.Timeout\",\"Resource\":\"arn:", { "Ref": "AWS::Partition" }, @@ -1308,7 +1352,33 @@ "GroupId" ] }, - "\"]}},\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"TheContainer\",\"Environment\":[{\"Name\":\"SOME_KEY\",\"Value.$\":\"$.SomeKey\"}]}]},\"LaunchType\":\"FARGATE\",\"PlatformVersion\":\"1.4.0\"}}}}" + "\"]}},\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"TheContainer\",\"Environment\":[{\"Name\":\"SOME_KEY\",\"Value.$\":\"$.SomeKey\"}]}]},\"LaunchType\":\"FARGATE\",\"PlatformVersion\":\"1.4.0\"}},\"FargeateTaskSetRevisionNumber\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::ecs:runTask\",\"Parameters\":{\"Cluster\":\"", + { + "Fn::GetAtt": [ + "FargateCluster7CCD5F93", + "Arn" + ] + }, + "\",\"TaskDefinition\":\"awssfntasksecsfargateintegTaskDefD0F4AD10:1\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"Subnets\":[\"", + { + "Ref": "FargateClusterVpcPrivateSubnet1Subnet9127625F" + }, + "\",\"", + { + "Ref": "FargateClusterVpcPrivateSubnet2Subnet307CEE57" + }, + "\"],\"SecurityGroups\":[\"", + { + "Fn::GetAtt": [ + "FargeateTaskSetRevisionNumberSecurityGroup916C9B0B", + "GroupId" + ] + }, + "\"]}},\"LaunchType\":\"FARGATE\",\"PlatformVersion\":\"1.4.0\"}}}}" ] ] } diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.ts index 9863b0d9d688e..cbee6f54f03c7 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task.ts @@ -55,6 +55,15 @@ const definition = new sfn.Pass(stack, 'Start', { }), taskTimeout: sfn.Timeout.at('$.Timeout'), }), +).next( + new tasks.EcsRunTask(stack, 'FargeateTaskSetRevisionNumber', { + cluster, + taskDefinition, + revisionNumber: 1, + launchTarget: new tasks.EcsFargateLaunchTarget({ + platformVersion: ecs.FargatePlatformVersion.VERSION1_4, + }), + }), ); const sm = new sfn.StateMachine(stack, 'StateMachine', { diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/run-tasks.test.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/run-tasks.test.ts index 88a1c91af2d2a..a4074a7869d03 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/run-tasks.test.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/run-tasks.test.ts @@ -563,3 +563,72 @@ test('Running a task with WAIT_FOR_TASK_TOKEN and task token in environment', () taskDefinition, })).not.toThrow(); }); + +test('Set revision number of ECS task denition family', () => { + // When + const taskDefinition = new ecs.TaskDefinition(stack, 'TD', { + memoryMiB: '512', + cpu: '256', + compatibility: ecs.Compatibility.FARGATE, + }); + taskDefinition.addContainer('TheContainer', { + image: ecs.ContainerImage.fromRegistry('foo/bar'), + memoryLimitMiB: 256, + }); + const runTask = new tasks.EcsRunTask(stack, 'task', { + cluster, + taskDefinition: taskDefinition, + revisionNumber: 1, + launchTarget: new tasks.EcsFargateLaunchTarget(), + }); + + // Then + expect(stack.resolve(runTask.toStateJson())).toEqual( + { + End: true, + Parameters: { + Cluster: { + 'Fn::GetAtt': [ + 'ClusterEB0386A7', + 'Arn', + ], + }, + LaunchType: 'FARGATE', + NetworkConfiguration: { + AwsvpcConfiguration: { + SecurityGroups: [ + { + 'Fn::GetAtt': [ + 'taskSecurityGroup28F0D539', + 'GroupId', + ], + }, + ], + Subnets: [ + { + Ref: 'VpcPrivateSubnet1Subnet536B997A', + }, + { + Ref: 'VpcPrivateSubnet2Subnet3788AAA1', + }, + ], + }, + }, + TaskDefinition: 'TD:1', + }, + Resource: { + 'Fn::Join': [ + '', + [ + 'arn:', + { + 'Ref': 'AWS::Partition', + }, + ':states:::ecs:runTask', + ], + ], + }, + Type: 'Task', + }, + ); +}); diff --git a/packages/@aws-cdk/cfnspec/lib/schema/property.ts b/packages/@aws-cdk/cfnspec/lib/schema/property.ts index 5278b6300190f..d78e99971198e 100644 --- a/packages/@aws-cdk/cfnspec/lib/schema/property.ts +++ b/packages/@aws-cdk/cfnspec/lib/schema/property.ts @@ -96,7 +96,7 @@ export interface MapOfListsOfPrimitives extends MapPropertyBase { } export interface TagPropertyStandard extends PropertyBase { - ItemType: 'Tag' | 'TagsEntry' | 'TagRef' | 'ElasticFileSystemTag' | 'HostedZoneTag'; + ItemType: 'Tag' | 'TagsEntry' | 'TagRef' | 'ElasticFileSystemTag' | 'HostedZoneTag' | 'AccessPointTag'; Type: 'Tags'; } @@ -256,6 +256,7 @@ const tagPropertyNames = { HostedZoneTags: '', Tags: '', UserPoolTags: '', + AccessPointTags: '', }; export type TagPropertyName = keyof typeof tagPropertyNames; @@ -288,7 +289,8 @@ export function isTagPropertyStandard(prop: Property): prop is TagPropertyStanda (prop as TagPropertyStandard).Type === 'Tags' || (prop as TagPropertyStandard).ItemType === 'TagRef' || (prop as TagPropertyStandard).ItemType === 'ElasticFileSystemTag' || - (prop as TagPropertyStandard).ItemType === 'HostedZoneTag' + (prop as TagPropertyStandard).ItemType === 'HostedZoneTag' || + (prop as TagPropertyStandard).ItemType === 'AccessPointTag' ); } diff --git a/packages/@aws-cdk/cfnspec/lib/schema/resource-type.ts b/packages/@aws-cdk/cfnspec/lib/schema/resource-type.ts index 8a33571504545..0e817500bfeec 100644 --- a/packages/@aws-cdk/cfnspec/lib/schema/resource-type.ts +++ b/packages/@aws-cdk/cfnspec/lib/schema/resource-type.ts @@ -34,6 +34,7 @@ export interface TaggableResource extends ResourceType { HostedZoneTags: TagProperty; Tags: TagProperty; UserPoolTags: TagProperty; + AccessPointTags: TagProperty; [name: string]: Property; } } diff --git a/packages/@aws-cdk/cfnspec/spec-source/cfn-docs/cfn-docs.json b/packages/@aws-cdk/cfnspec/spec-source/cfn-docs/cfn-docs.json index dfe0b7f165091..51cb135d5d5ad 100644 --- a/packages/@aws-cdk/cfnspec/spec-source/cfn-docs/cfn-docs.json +++ b/packages/@aws-cdk/cfnspec/spec-source/cfn-docs/cfn-docs.json @@ -23457,7 +23457,7 @@ "DeploymentId": "The ID of the deployment.", "Ref": "`Ref` returns the `DeploymentId` ." }, - "description": "Creates a continuous deployment for a target, which is a AWS IoT Greengrass core device or group of core devices. When you add a new core device to a group of core devices that has a deployment, AWS IoT Greengrass deploys that group's deployment to the new device.\n\nYou can define one deployment for each target. When you create a new deployment for a target that has an existing deployment, you replace the previous deployment. AWS IoT Greengrass applies the new deployment to the target devices.\n\nYou can only add, update, or delete up to 10 deployments at a time to a single target.\n\nEvery deployment has a revision number that indicates how many deployment revisions you define for a target. Use this operation to create a new revision of an existing deployment. This operation returns the revision number of the new deployment when you create it.\n\nFor more information, see the [Create deployments](https://docs.aws.amazon.com/greengrass/v2/latest/developerguide/create-deployments.html) in the *AWS IoT Greengrass V2 Developer Guide* .\n\n> Deployment resources are deleted when you delete stacks. To keep the deployments in a stack, you must specify `\"DeletionPolicy\": \"Retain\"` on each deployment resource in the stack template that you want to keep. For more information, see [DeletionPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html) .\n> \n> You can only delete up to 10 deployment resources at a time. If you delete more than 10 resources, you receive an error.", + "description": "Creates a continuous deployment for a target, which is a AWS IoT Greengrass core device or group of core devices. When you add a new core device to a group of core devices that has a deployment, AWS IoT Greengrass deploys that group's deployment to the new device.\n\nYou can define one deployment for each target. When you create a new deployment for a target that has an existing deployment, you replace the previous deployment. AWS IoT Greengrass applies the new deployment to the target devices.\n\nYou can only add, update, or delete up to 10 deployments at a time to a single target.\n\nEvery deployment has a revision number that indicates how many deployment revisions you define for a target. Use this operation to create a new revision of an existing deployment. This operation returns the revision number of the new deployment when you create it.\n\nFor more information, see the [Create deployments](https://docs.aws.amazon.com/greengrass/v2/developerguide/create-deployments.html) in the *AWS IoT Greengrass V2 Developer Guide* .\n\n> Deployment resources are deleted when you delete stacks. To keep the deployments in a stack, you must specify `\"DeletionPolicy\": \"Retain\"` on each deployment resource in the stack template that you want to keep. For more information, see [DeletionPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html) .\n> \n> You can only delete up to 10 deployment resources at a time. If you delete more than 10 resources, you receive an error.", "properties": { "Components": "The components to deploy. This is a dictionary, where each key is the name of a component, and each key's value is the version and configuration to deploy for that component.", "DeploymentName": "The name of the deployment.", @@ -23497,13 +23497,13 @@ "attributes": {}, "description": "Contains information about a deployment's policy that defines when components are safe to update.\n\nEach component on a device can report whether or not it's ready to update. After a component and its dependencies are ready, they can apply the update in the deployment. You can configure whether or not the deployment notifies components of an update and waits for a response. You specify the amount of time each component has to respond to the update notification.", "properties": { - "Action": "Whether or not to notify components and wait for components to become safe to update. Choose from the following options:\n\n- `NOTIFY_COMPONENTS` \u2013 The deployment notifies each component before it stops and updates that component. Components can use the [SubscribeToComponentUpdates](https://docs.aws.amazon.com/greengrass/v2/developerguide/interprocess-communication.html#ipc-operation-subscribetocomponentupdates) IPC operation to receive these notifications. Then, components can respond with the [DeferComponentUpdate](https://docs.aws.amazon.com/greengrass/v2/developerguide/interprocess-communication.html#ipc-operation-defercomponentupdate) IPC operation. For more information, see the [Create deployments](https://docs.aws.amazon.com/greengrass/v2/latest/developerguide/create-deployments.html) in the *AWS IoT Greengrass V2 Developer Guide* .\n- `SKIP_NOTIFY_COMPONENTS` \u2013 The deployment doesn't notify components or wait for them to be safe to update.\n\nDefault: `NOTIFY_COMPONENTS`", + "Action": "Whether or not to notify components and wait for components to become safe to update. Choose from the following options:\n\n- `NOTIFY_COMPONENTS` \u2013 The deployment notifies each component before it stops and updates that component. Components can use the [SubscribeToComponentUpdates](https://docs.aws.amazon.com/greengrass/v2/developerguide/interprocess-communication.html#ipc-operation-subscribetocomponentupdates) IPC operation to receive these notifications. Then, components can respond with the [DeferComponentUpdate](https://docs.aws.amazon.com/greengrass/v2/developerguide/interprocess-communication.html#ipc-operation-defercomponentupdate) IPC operation. For more information, see the [Create deployments](https://docs.aws.amazon.com/greengrass/v2/developerguide/create-deployments.html) in the *AWS IoT Greengrass V2 Developer Guide* .\n- `SKIP_NOTIFY_COMPONENTS` \u2013 The deployment doesn't notify components or wait for them to be safe to update.\n\nDefault: `NOTIFY_COMPONENTS`", "TimeoutInSeconds": "The amount of time in seconds that each component on a device has to report that it's safe to update. If the component waits for longer than this timeout, then the deployment proceeds on the device.\n\nDefault: `60`" } }, "AWS::GreengrassV2::Deployment.DeploymentConfigurationValidationPolicy": { "attributes": {}, - "description": "Contains information about how long a component on a core device can validate its configuration updates before it times out. Components can use the [SubscribeToValidateConfigurationUpdates](https://docs.aws.amazon.com/greengrass/v2/developerguide/interprocess-communication.html#ipc-operation-subscribetovalidateconfigurationupdates) IPC operation to receive notifications when a deployment specifies a configuration update. Then, components can respond with the [SendConfigurationValidityReport](https://docs.aws.amazon.com/greengrass/v2/developerguide/interprocess-communication.html#ipc-operation-sendconfigurationvalidityreport) IPC operation. For more information, see the [Create deployments](https://docs.aws.amazon.com/greengrass/v2/latest/developerguide/create-deployments.html) in the *AWS IoT Greengrass V2 Developer Guide* .", + "description": "Contains information about how long a component on a core device can validate its configuration updates before it times out. Components can use the [SubscribeToValidateConfigurationUpdates](https://docs.aws.amazon.com/greengrass/v2/developerguide/interprocess-communication.html#ipc-operation-subscribetovalidateconfigurationupdates) IPC operation to receive notifications when a deployment specifies a configuration update. Then, components can respond with the [SendConfigurationValidityReport](https://docs.aws.amazon.com/greengrass/v2/developerguide/interprocess-communication.html#ipc-operation-sendconfigurationvalidityreport) IPC operation. For more information, see the [Create deployments](https://docs.aws.amazon.com/greengrass/v2/developerguide/create-deployments.html) in the *AWS IoT Greengrass V2 Developer Guide* .", "properties": { "TimeoutInSeconds": "The amount of time in seconds that a component can validate its configuration updates. If the validation time exceeds this timeout, then the deployment proceeds for the device.\n\nDefault: `30`" } @@ -30697,11 +30697,11 @@ "description": "The `AWS::Lambda::EventSourceMapping` resource creates a mapping between an event source and an AWS Lambda function. Lambda reads items from the event source and triggers the function.\n\nFor details about each event source type, see the following topics. In particular, each of the topics describes the required and optional parameters for the specific event source.\n\n- [Configuring a Dynamo DB stream as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-dynamodb-eventsourcemapping)\n- [Configuring a Kinesis stream as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-eventsourcemapping)\n- [Configuring an SQS queue as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-eventsource)\n- [Configuring an MQ broker as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-eventsourcemapping)\n- [Configuring MSK as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html)\n- [Configuring Self-Managed Apache Kafka as an event source](https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html)", "properties": { "AmazonManagedKafkaEventSourceConfig": "Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.", - "BatchSize": "The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation (6 MB).\n\n- *Amazon Kinesis* \u2013 Default 100. Max 10,000.\n- *Amazon DynamoDB Streams* \u2013 Default 100. Max 10,000.\n- *Amazon Simple Queue Service* \u2013 Default 10. For standard queues the max is 10,000. For FIFO queues the max is 10.\n- *Amazon Managed Streaming for Apache Kafka* \u2013 Default 100. Max 10,000.\n- *Self-managed Apache Kafka* \u2013 Default 100. Max 10,000.\n- *Amazon MQ (ActiveMQ and RabbitMQ)* \u2013 Default 100. Max 10,000.", + "BatchSize": "The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation (6 MB).\n\n- *Amazon Kinesis* \u2013 Default 100. Max 10,000.\n- *Amazon DynamoDB Streams* \u2013 Default 100. Max 10,000.\n- *Amazon Simple Queue Service* \u2013 Default 10. For standard queues the max is 10,000. For FIFO queues the max is 10.\n- *Amazon Managed Streaming for Apache Kafka* \u2013 Default 100. Max 10,000.\n- *Self-managed Apache Kafka* \u2013 Default 100. Max 10,000.\n- *Amazon MQ (ActiveMQ and RabbitMQ)* \u2013 Default 100. Max 10,000.\n- *DocumentDB* \u2013 Default 100. Max 10,000.", "BisectBatchOnFunctionError": "(Streams only) If the function returns an error, split the batch in two and retry. The default value is false.", "DestinationConfig": "(Streams only) An Amazon SQS queue or Amazon SNS topic destination for discarded records.", "Enabled": "When true, the event source mapping is active. When false, Lambda pauses polling and invocation.\n\nDefault: True", - "EventSourceArn": "The Amazon Resource Name (ARN) of the event source.\n\n- *Amazon Kinesis* \u2013 The ARN of the data stream or a stream consumer.\n- *Amazon DynamoDB Streams* \u2013 The ARN of the stream.\n- *Amazon Simple Queue Service* \u2013 The ARN of the queue.\n- *Amazon Managed Streaming for Apache Kafka* \u2013 The ARN of the cluster.\n- *Amazon MQ* \u2013 The ARN of the broker.", + "EventSourceArn": "The Amazon Resource Name (ARN) of the event source.\n\n- *Amazon Kinesis* \u2013 The ARN of the data stream or a stream consumer.\n- *Amazon DynamoDB Streams* \u2013 The ARN of the stream.\n- *Amazon Simple Queue Service* \u2013 The ARN of the queue.\n- *Amazon Managed Streaming for Apache Kafka* \u2013 The ARN of the cluster.\n- *Amazon MQ* \u2013 The ARN of the broker.\n- *Amazon DocumentDB* \u2013 The ARN of the DocumentDB change stream.", "FilterCriteria": "An object that defines the filter criteria that determine whether Lambda should process an event. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html) .", "FunctionName": "The name of the Lambda function.\n\n**Name formats** - *Function name* \u2013 `MyFunction` .\n- *Function ARN* \u2013 `arn:aws:lambda:us-west-2:123456789012:function:MyFunction` .\n- *Version or Alias ARN* \u2013 `arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD` .\n- *Partial ARN* \u2013 `123456789012:function:MyFunction` .\n\nThe length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 characters in length.", "FunctionResponseTypes": "(Streams and SQS) A list of current response type enums applied to the event source mapping.\n\nValid Values: `ReportBatchItemFailures`", @@ -33555,9 +33555,9 @@ }, "AWS::ManagedBlockchain::Member.MemberFabricConfiguration": { "attributes": {}, - "description": "Configuration properties for Hyperledger Fabric for a member in a Managed Blockchain network using the Hyperledger Fabric framework.", + "description": "Configuration properties for Hyperledger Fabric for a member in a Managed Blockchain network that is using the Hyperledger Fabric framework.", "properties": { - "AdminPassword": "The password for the member's initial administrative user. The `AdminPassword` must be at least eight characters long and no more than 32 characters. It must contain at least one uppercase letter, one lowercase letter, and one digit. It cannot have a single quotation mark (\u2018), a double quotation marks (\u201c), a forward slash(/), a backward slash(\\), @, or a space.", + "AdminPassword": "The password for the member's initial administrative user. The `AdminPassword` must be at least 8 characters long and no more than 32 characters. It must contain at least one uppercase letter, one lowercase letter, and one digit. It cannot have a single quotation mark (\u2018), a double quotation marks (\u201c), a forward slash(/), a backward slash(\\), @, or a space.", "AdminUsername": "The user name for the member's initial administrative user." } }, @@ -33577,21 +33577,21 @@ "FrameworkVersion": "The version of the blockchain framework that the network uses.", "Name": "The name of the network.", "NetworkFrameworkConfiguration": "Configuration properties relevant to the network for the blockchain framework that the network uses.", - "VotingPolicy": "The voting rules for the network to decide if a proposal is accepted." + "VotingPolicy": "The voting rules that the network uses to decide if a proposal is accepted." } }, "AWS::ManagedBlockchain::Member.NetworkFabricConfiguration": { "attributes": {}, "description": "Hyperledger Fabric configuration properties for the network.", "properties": { - "Edition": "The edition of Amazon Managed Blockchain that the network uses. Valid values are `standard` and `starter` . For more information, see" + "Edition": "The edition of Amazon Managed Blockchain that the network uses. Valid values are `standard` and `starter` . For more information, see [Amazon Managed Blockchain Pricing](https://docs.aws.amazon.com/managed-blockchain/pricing/)" } }, "AWS::ManagedBlockchain::Member.NetworkFrameworkConfiguration": { "attributes": {}, "description": "Configuration properties relevant to the network for the blockchain framework that the network uses.", "properties": { - "NetworkFabricConfiguration": "Configuration properties for Hyperledger Fabric for a member in a Managed Blockchain network using the Hyperledger Fabric framework." + "NetworkFabricConfiguration": "Configuration properties for Hyperledger Fabric for a member in a Managed Blockchain network that is using the Hyperledger Fabric framework." } }, "AWS::ManagedBlockchain::Member.VotingPolicy": { @@ -38509,7 +38509,7 @@ "CustomDeliveryConfiguration": "The delivery configuration settings for sending the treatment through a custom channel. This object is required if the `MessageConfiguration` object for the treatment specifies a `CustomMessage` object.", "Description": "A custom description of the campaign.", "HoldoutPercent": "The allocated percentage of users (segment members) who shouldn't receive messages from the campaign.", - "IsPaused": "Specifies whether to pause the campaign. A paused campaign doesn't run unless you resume it by changing this value to `false` . If you restart a campaign, the campaign restarts from the beginning and not at the point you paused it.", + "IsPaused": "Specifies whether to pause the campaign. A paused campaign doesn't run unless you resume it by changing this value to `false` . If you restart a campaign, the campaign restarts from the beginning and not at the point you paused it. If a campaign is running it will complete and then pause. Pause only pauses or skips the next run for a recurring future scheduled campaign. A campaign scheduled for immediate can't be paused.", "Limits": "The messaging limits for the campaign.", "MessageConfiguration": "The message configuration settings for the campaign.", "Name": "The name of the campaign.", @@ -39795,7 +39795,7 @@ "attributes": {}, "description": "The configuration settings of the Amazon Kinesis Data Streams destination for an Amazon QLDB journal stream.", "properties": { - "AggregationEnabled": "Enables QLDB to publish multiple data records in a single Kinesis Data Streams record, increasing the number of records sent per API call.\n\n*This option is enabled by default.* Record aggregation has important implications for processing records and requires de-aggregation in your stream consumer. To learn more, see [KPL Key Concepts](https://docs.aws.amazon.com/streams/latest/dev/kinesis-kpl-concepts.html) and [Consumer De-aggregation](https://docs.aws.amazon.com/streams/latest/dev/kinesis-kpl-consumer-deaggregation.html) in the *Amazon Kinesis Data Streams Developer Guide* .", + "AggregationEnabled": "Enables QLDB to publish multiple data records in a single Kinesis Data Streams record, increasing the number of records sent per API call.\n\nDefault: `True`\n\nRecord aggregation has important implications for processing records and requires de-aggregation in your stream consumer. To learn more, see [KPL Key Concepts](https://docs.aws.amazon.com/streams/latest/dev/kinesis-kpl-concepts.html) and [Consumer De-aggregation](https://docs.aws.amazon.com/streams/latest/dev/kinesis-kpl-consumer-deaggregation.html) in the *Amazon Kinesis Data Streams Developer Guide* .", "StreamArn": "The Amazon Resource Name (ARN) of the Kinesis Data Streams resource." } }, @@ -41046,7 +41046,7 @@ }, "description": "The `AWS::RDS::DBClusterParameterGroup` resource creates a new Amazon RDS DB cluster parameter group.\n\nFor information about configuring parameters for Amazon Aurora DB clusters, see [Working with parameter groups](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_WorkingWithParamGroups.html) in the *Amazon Aurora User Guide* .\n\n> If you apply a parameter group to a DB cluster, then its DB instances might need to reboot. This can result in an outage while the DB instances are rebooting.\n> \n> If you apply a change to parameter group associated with a stopped DB cluster, then the update stack waits until the DB cluster is started.", "properties": { - "DBClusterParameterGroupName": "The name of the DB cluster parameter group.\n\nConstraints:\n\n- Must not match the name of an existing DB cluster parameter group.\n\nIf you don't specify a value for `DBClusterParameterGroupName` property, a name is automatically created for the DB cluster paramter group.\n\n> This value is stored as a lowercase string.", + "DBClusterParameterGroupName": "The name of the DB cluster parameter group.\n\nConstraints:\n\n- Must not match the name of an existing DB cluster parameter group.\n\nIf you don't specify a value for `DBClusterParameterGroupName` property, a name is automatically created for the DB cluster parameter group.\n\n> This value is stored as a lowercase string.", "Description": "A friendly description for this DB cluster parameter group.", "Family": "The DB cluster parameter group family name. A DB cluster parameter group can be associated with one and only one DB cluster parameter group family, and can be applied only to a DB cluster running a DB engine and engine version compatible with that DB cluster parameter group family.\n\n> The DB cluster parameter group family can't be changed when updating a DB cluster parameter group. \n\nTo list all of the available parameter group families, use the following command:\n\n`aws rds describe-db-engine-versions --query \"DBEngineVersions[].DBParameterGroupFamily\"`\n\nThe output contains duplicates.\n\nFor more information, see `[CreateDBClusterParameterGroup](https://docs.aws.amazon.com//AmazonRDS/latest/APIReference/API_CreateDBClusterParameterGroup.html)` .", "Parameters": "Provides a list of parameters for the DB cluster parameter group.", @@ -41114,7 +41114,7 @@ "NetworkType": "The network type of the DB instance.\n\nValid values:\n\n- `IPV4`\n- `DUAL`\n\nThe network type is determined by the `DBSubnetGroup` specified for the DB instance. A `DBSubnetGroup` can support only the IPv4 protocol or the IPv4 and IPv6 protocols ( `DUAL` ).\n\nFor more information, see [Working with a DB instance in a VPC](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html) in the *Amazon RDS User Guide.*", "OptionGroupName": "Indicates that the DB instance should be associated with the specified option group.\n\nPermanent options, such as the TDE option for Oracle Advanced Security TDE, can't be removed from an option group. Also, that option group can't be removed from a DB instance once it is associated with a DB instance.", "PerformanceInsightsKMSKeyId": "The AWS KMS key identifier for encryption of Performance Insights data.\n\nThe KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key.\n\nIf you do not specify a value for `PerformanceInsightsKMSKeyId` , then Amazon RDS uses your default KMS key. There is a default KMS key for your AWS account. Your AWS account has a different default KMS key for each AWS Region.\n\nFor information about enabling Performance Insights, see [EnablePerformanceInsights](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-enableperformanceinsights) .", - "PerformanceInsightsRetentionPeriod": "The amount of time, in days, to retain Performance Insights data. Valid values are 7 or 731 (2 years).\n\nFor information about enabling Performance Insights, see [EnablePerformanceInsights](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-enableperformanceinsights) .", + "PerformanceInsightsRetentionPeriod": "The number of days to retain Performance Insights data. The default is 7 days. The following values are valid:\n\n- 7\n- *month* * 31, where *month* is a number of months from 1-23\n- 731\n\nFor example, the following values are valid:\n\n- 93 (3 months * 31)\n- 341 (11 months * 31)\n- 589 (19 months * 31)\n- 731\n\nIf you specify a retention period such as 94, which isn't a valid value, RDS issues an error.\n\nThis setting doesn't apply to RDS Custom.", "Port": "The port number on which the database accepts connections.\n\n*Amazon Aurora*\n\nNot applicable. The port number is managed by the DB cluster.", "PreferredBackupWindow": "The daily time range during which automated backups are created if automated backups are enabled, using the `BackupRetentionPeriod` parameter. For more information, see [Backup Window](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithAutomatedBackups.html#USER_WorkingWithAutomatedBackups.BackupWindow) in the *Amazon RDS User Guide.*\n\nConstraints:\n\n- Must be in the format `hh24:mi-hh24:mi` .\n- Must be in Universal Coordinated Time (UTC).\n- Must not conflict with the preferred maintenance window.\n- Must be at least 30 minutes.\n\n*Amazon Aurora*\n\nNot applicable. The daily time range for creating automated backups is managed by the DB cluster.", "PreferredMaintenanceWindow": "The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).\n\nFormat: `ddd:hh24:mi-ddd:hh24:mi`\n\nThe default is a 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. To see the time blocks available, see [Adjusting the Preferred DB Instance Maintenance Window](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.Maintenance.html#AdjustingTheMaintenanceWindow) in the *Amazon RDS User Guide.*\n\n> This property applies when AWS CloudFormation initially creates the DB instance. If you use AWS CloudFormation to update the DB instance, those updates are applied immediately. \n\nConstraints: Minimum 30-minute window.", @@ -42381,42 +42381,42 @@ "AWS::RolesAnywhere::CRL": { "attributes": { "CrlId": "The unique primary identifier of the Crl", - "Ref": "`Ref` returns `CrlId` ." + "Ref": "The name of the CRL." }, - "description": "The state of the certificate revocation list (CRL) after a read or write operation.", + "description": "Creates a Crl.", "properties": { - "CrlData": "The revocation record for a certificate, following the x509 v3 standard.", - "Enabled": "Indicates whether the certificate revocation list (CRL) is enabled.", - "Name": "The name of the certificate revocation list (CRL).", - "Tags": "A list of tags to attach to the CRL.", + "CrlData": "x509 v3 Certificate Revocation List to revoke auth for corresponding certificates presented in CreateSession operations", + "Enabled": "The enabled status of the resource.", + "Name": "The customer specified name of the resource.", + "Tags": "A list of Tags.", "TrustAnchorArn": "The ARN of the TrustAnchor the certificate revocation list (CRL) will provide revocation for." } }, "AWS::RolesAnywhere::Profile": { "attributes": { - "ProfileArn": "The ARN of the profile.", + "ProfileArn": "", "ProfileId": "The unique primary identifier of the Profile", - "Ref": "`Ref` returns `ProfileId` ." + "Ref": "The name of the Profile" }, - "description": "Creates a *profile* , a list of the roles that Roles Anywhere service is trusted to assume. You use profiles to intersect permissions with IAM managed policies.\n\n*Required permissions:* `rolesanywhere:CreateProfile` .", + "description": "Creates a Profile.", "properties": { - "DurationSeconds": "Sets the maximum number of seconds that vended temporary credentials through [CreateSession](https://docs.aws.amazon.com/rolesanywhere/latest/userguide/authentication-create-session.html) will be valid for, between 900 and 3600.", - "Enabled": "Indicates whether the profile is enabled.", - "ManagedPolicyArns": "A list of managed policy ARNs that apply to the vended session credentials.", - "Name": "The name of the profile.", - "RequireInstanceProperties": "Specifies whether instance properties are required in temporary credential requests with this profile.", - "RoleArns": "A list of IAM role ARNs. During `CreateSession` , if a matching role ARN is provided, the properties in this profile will be applied to the intersection session policy.", - "SessionPolicy": "A session policy that applies to the trust boundary of the vended session credentials.", - "Tags": "A list of tags to attach to the profile." + "DurationSeconds": "The number of seconds vended session credentials will be valid for", + "Enabled": "The enabled status of the resource.", + "ManagedPolicyArns": "A list of managed policy ARNs. Managed policies identified by this list will be applied to the vended session credentials.", + "Name": "The customer specified name of the resource.", + "RequireInstanceProperties": "Specifies whether instance properties are required in CreateSession requests with this profile.", + "RoleArns": "A list of IAM role ARNs that can be assumed when this profile is specified in a CreateSession request.", + "SessionPolicy": "A session policy that will applied to the trust boundary of the vended session credentials.", + "Tags": "A list of Tags." } }, "AWS::RolesAnywhere::TrustAnchor": { "attributes": { "Ref": "`Ref` returns `TrustAnchorId` .", "TrustAnchorArn": "The ARN of the trust anchor.", - "TrustAnchorId": "The unique primary identifier of the TrustAnchor" + "TrustAnchorId": "" }, - "description": "The state of the trust anchor after a read or write operation.", + "description": "Creates a TrustAnchor.", "properties": { "Enabled": "Indicates whether the trust anchor is enabled.", "Name": "The name of the trust anchor.", @@ -42426,15 +42426,15 @@ }, "AWS::RolesAnywhere::TrustAnchor.Source": { "attributes": {}, - "description": "The trust anchor type and its related certificate data.", + "description": "Object representing the TrustAnchor type and its related certificate data.", "properties": { - "SourceData": "The data field of the trust anchor depending on its type.", - "SourceType": "The type of the trust anchor." + "SourceData": "A union object representing the data field of the TrustAnchor depending on its type", + "SourceType": "The type of the TrustAnchor." } }, "AWS::RolesAnywhere::TrustAnchor.SourceData": { "attributes": {}, - "description": "The data field of the trust anchor depending on its type.", + "description": "A union object representing the data field of the TrustAnchor depending on its type", "properties": { "AcmPcaArn": "The root certificate of the AWS Private Certificate Authority specified by this ARN is used in trust validation for temporary credential requests. Included for trust anchors of type `AWS_ACM_PCA` .", "X509CertificateData": "The PEM-encoded data for the certificate anchor. Included for trust anchors of type `CERTIFICATE_BUNDLE` ." diff --git a/packages/@aws-cdk/core/package.json b/packages/@aws-cdk/core/package.json index 0c2dcf5bfe6a4..5a63f16d1761d 100644 --- a/packages/@aws-cdk/core/package.json +++ b/packages/@aws-cdk/core/package.json @@ -186,12 +186,12 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/cfn2ts": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/aws-lambda": "^8.10.110", + "@types/aws-lambda": "^8.10.111", "@types/fs-extra": "^9.0.13", "@types/jest": "^27.5.2", "@types/lodash": "^4.14.191", "@types/minimatch": "^3.0.5", - "aws-sdk": "^2.1317.0", + "aws-sdk": "^2.1325.0", "@types/sinon": "^9.0.11", "fast-check": "^2.25.0", "jest": "^27.5.1", diff --git a/packages/@aws-cdk/custom-resources/package.json b/packages/@aws-cdk/custom-resources/package.json index 1dfc4ac772b77..43d88f5e7a823 100644 --- a/packages/@aws-cdk/custom-resources/package.json +++ b/packages/@aws-cdk/custom-resources/package.json @@ -89,11 +89,11 @@ "@aws-cdk/integ-tests": "0.0.0", "@aws-cdk/cfn2ts": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/aws-lambda": "^8.10.110", + "@types/aws-lambda": "^8.10.111", "@types/fs-extra": "^9.0.13", "@types/jest": "^27.5.2", "@types/sinon": "^9.0.11", - "aws-sdk": "^2.1317.0", + "aws-sdk": "^2.1325.0", "aws-sdk-mock": "5.6.0", "fs-extra": "^9.1.0", "nock": "^13.3.0", diff --git a/packages/@aws-cdk/cx-api/FEATURE_FLAGS.md b/packages/@aws-cdk/cx-api/FEATURE_FLAGS.md index b9f524ecb972a..b1ef62b576767 100644 --- a/packages/@aws-cdk/cx-api/FEATURE_FLAGS.md +++ b/packages/@aws-cdk/cx-api/FEATURE_FLAGS.md @@ -46,6 +46,8 @@ Flags come in three types: | [@aws-cdk/aws-codedeploy:removeAlarmsFromDeploymentGroup](#aws-cdkaws-codedeployremovealarmsfromdeploymentgroup) | Remove CloudWatch alarms from deployment group | 2.65.0 | (fix) | | [@aws-cdk/aws-rds:databaseProxyUniqueResourceName](#aws-cdkaws-rdsdatabaseproxyuniqueresourcename) | Use unique resource name for Database Proxy | 2.65.0 | (fix) | | [@aws-cdk/aws-apigateway:authorizerChangeDeploymentLogicalId](#aws-cdkaws-apigatewayauthorizerchangedeploymentlogicalid) | Include authorizer configuration in the calculation of the API deployment logical ID. | 2.66.0 | (fix) | +| [@aws-cdk/aws-ec2:launchTemplateDefaultUserData](#aws-cdkaws-ec2launchtemplatedefaultuserdata) | Define user data for a launch template by default when a machine image is provided. | V2NEXT | (fix) | +| [@aws-cdk/aws-secretsmanager:useAttachedSecretResourcePolicyForSecretTargetAttachments](#aws-cdkaws-secretsmanageruseattachedsecretresourcepolicyforsecrettargetattachments) | SecretTargetAttachments uses the ResourcePolicy of the attached Secret. | V2NEXT | (fix) | @@ -82,7 +84,9 @@ The following json shows the current recommended set of flags, as `cdk init` wou "@aws-cdk/customresources:installLatestAwsSdkDefault": false, "@aws-cdk/aws-rds:databaseProxyUniqueResourceName": true, "@aws-cdk/aws-codedeploy:removeAlarmsFromDeploymentGroup": true, - "@aws-cdk/aws-apigateway:authorizerChangeDeploymentLogicalId": true + "@aws-cdk/aws-apigateway:authorizerChangeDeploymentLogicalId": true, + "@aws-cdk/aws-ec2:launchTemplateDefaultUserData": true, + "@aws-cdk/aws-secretsmanager:useAttachedSecretResourcePolicyForSecretTargetAttachments": true } } ``` @@ -834,4 +838,41 @@ calculation, so any changes made to an authorizer will create a new deployment. | 2.66.0 | `false` | `true` | +### @aws-cdk/aws-ec2:launchTemplateDefaultUserData + +*Define user data for a launch template by default when a machine image is provided.* (fix) + +The ec2.LaunchTemplate construct did not define user data when a machine image is +provided despite the document. If this is set, a user data is automatically defined +according to the OS of the machine image. + + +| Since | Default | Recommended | +| ----- | ----- | ----- | +| (not in v1) | | | +| V2NEXT | `false` | `true` | + + +### @aws-cdk/aws-secretsmanager:useAttachedSecretResourcePolicyForSecretTargetAttachments + +*SecretTargetAttachments uses the ResourcePolicy of the attached Secret.* (fix) + +Enable this feature flag to make SecretTargetAttachments use the ResourcePolicy of the attached Secret. +SecretTargetAttachments are created to connect a Secret to a target resource. +In CDK code, they behave like regular Secret and can be used as a stand-in in most situations. +Previously, adding to the ResourcePolicy of a SecretTargetAttachment did attempt to create a separate ResourcePolicy for the same Secret. +However Secrets can only have a single ResourcePolicy, causing the CloudFormation deployment to fail. + +When enabling this feature flag for an existing Stack, ResourcePolicies created via a SecretTargetAttachment will need replacement. +This won't be possible without intervention due to limitation outlined above. +First remove all permissions granted to the Secret and deploy without the ResourcePolicies. +Then you can re-add the permissions and deploy again. + + +| Since | Default | Recommended | +| ----- | ----- | ----- | +| (not in v1) | | | +| V2NEXT | `false` | `true` | + + diff --git a/packages/@aws-cdk/cx-api/lib/features.ts b/packages/@aws-cdk/cx-api/lib/features.ts index 8850205a5eec2..1ae7e4dd6f2fc 100644 --- a/packages/@aws-cdk/cx-api/lib/features.ts +++ b/packages/@aws-cdk/cx-api/lib/features.ts @@ -81,6 +81,8 @@ export const AWS_CUSTOM_RESOURCE_LATEST_SDK_DEFAULT = '@aws-cdk/customresources: export const DATABASE_PROXY_UNIQUE_RESOURCE_NAME = '@aws-cdk/aws-rds:databaseProxyUniqueResourceName'; export const CODEDEPLOY_REMOVE_ALARMS_FROM_DEPLOYMENT_GROUP = '@aws-cdk/aws-codedeploy:removeAlarmsFromDeploymentGroup'; export const APIGATEWAY_AUTHORIZER_CHANGE_DEPLOYMENT_LOGICAL_ID = '@aws-cdk/aws-apigateway:authorizerChangeDeploymentLogicalId'; +export const EC2_LAUNCH_TEMPLATE_DEFAULT_USER_DATA = '@aws-cdk/aws-ec2:launchTemplateDefaultUserData'; +export const SECRETS_MANAGER_TARGET_ATTACHMENT_RESOURCE_POLICY = '@aws-cdk/aws-secretsmanager:useAttachedSecretResourcePolicyForSecretTargetAttachments'; export const FLAGS: Record = { ////////////////////////////////////////////////////////////////////// @@ -661,6 +663,7 @@ export const FLAGS: Record = { recommendedValue: true, }, + ////////////////////////////////////////////////////////////////////// [APIGATEWAY_AUTHORIZER_CHANGE_DEPLOYMENT_LOGICAL_ID]: { type: FlagType.BugFix, summary: 'Include authorizer configuration in the calculation of the API deployment logical ID.', @@ -673,6 +676,39 @@ export const FLAGS: Record = { introducedIn: { v2: '2.66.0' }, recommendedValue: true, }, + + ////////////////////////////////////////////////////////////////////// + [EC2_LAUNCH_TEMPLATE_DEFAULT_USER_DATA]: { + type: FlagType.BugFix, + summary: 'Define user data for a launch template by default when a machine image is provided.', + detailsMd: ` + The ec2.LaunchTemplate construct did not define user data when a machine image is + provided despite the document. If this is set, a user data is automatically defined + according to the OS of the machine image. + `, + recommendedValue: true, + introducedIn: { v2: 'V2NEXT' }, + }, + + ////////////////////////////////////////////////////////////////////// + [SECRETS_MANAGER_TARGET_ATTACHMENT_RESOURCE_POLICY]: { + type: FlagType.BugFix, + summary: 'SecretTargetAttachments uses the ResourcePolicy of the attached Secret.', + detailsMd: ` + Enable this feature flag to make SecretTargetAttachments use the ResourcePolicy of the attached Secret. + SecretTargetAttachments are created to connect a Secret to a target resource. + In CDK code, they behave like regular Secret and can be used as a stand-in in most situations. + Previously, adding to the ResourcePolicy of a SecretTargetAttachment did attempt to create a separate ResourcePolicy for the same Secret. + However Secrets can only have a single ResourcePolicy, causing the CloudFormation deployment to fail. + + When enabling this feature flag for an existing Stack, ResourcePolicies created via a SecretTargetAttachment will need replacement. + This won't be possible without intervention due to limitation outlined above. + First remove all permissions granted to the Secret and deploy without the ResourcePolicies. + Then you can re-add the permissions and deploy again. + `, + recommendedValue: true, + introducedIn: { v2: 'V2NEXT' }, + }, }; const CURRENT_MV = 'v2'; diff --git a/packages/@aws-cdk/integ-runner/THIRD_PARTY_LICENSES b/packages/@aws-cdk/integ-runner/THIRD_PARTY_LICENSES index 25381811df08b..2df6fb89cca98 100644 --- a/packages/@aws-cdk/integ-runner/THIRD_PARTY_LICENSES +++ b/packages/@aws-cdk/integ-runner/THIRD_PARTY_LICENSES @@ -156,7 +156,7 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH RE ---------------- -** aws-sdk@2.1317.0 - https://www.npmjs.com/package/aws-sdk/v/2.1317.0 | Apache-2.0 +** aws-sdk@2.1325.0 - https://www.npmjs.com/package/aws-sdk/v/2.1325.0 | Apache-2.0 AWS SDK for JavaScript Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. @@ -1534,7 +1534,7 @@ THE SOFTWARE. ---------------- -** readable-stream@2.3.7 - https://www.npmjs.com/package/readable-stream/v/2.3.7 | MIT +** readable-stream@2.3.8 - https://www.npmjs.com/package/readable-stream/v/2.3.8 | MIT Node.js is licensed for use as follows: """ @@ -1586,7 +1586,7 @@ IN THE SOFTWARE. ---------------- -** readable-stream@3.6.0 - https://www.npmjs.com/package/readable-stream/v/3.6.0 | MIT +** readable-stream@3.6.1 - https://www.npmjs.com/package/readable-stream/v/3.6.1 | MIT Node.js is licensed for use as follows: """ @@ -2263,7 +2263,7 @@ OTHER DEALINGS IN THE SOFTWARE. ---------------- -** workerpool@6.3.1 - https://www.npmjs.com/package/workerpool/v/6.3.1 | Apache-2.0 +** workerpool@6.4.0 - https://www.npmjs.com/package/workerpool/v/6.4.0 | Apache-2.0 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -2452,7 +2452,7 @@ Apache License same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright (C) 2014-2022 Jos de Jong wjosdejong@gmail.com + Copyright (C) 2014-2023 Jos de Jong wjosdejong@gmail.com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/packages/@aws-cdk/integ-runner/package.json b/packages/@aws-cdk/integ-runner/package.json index 5aa94108aeb42..d51ee787172ce 100644 --- a/packages/@aws-cdk/integ-runner/package.json +++ b/packages/@aws-cdk/integ-runner/package.json @@ -75,7 +75,7 @@ "aws-cdk": "0.0.0", "chalk": "^4", "fs-extra": "^9.1.0", - "workerpool": "^6.3.1", + "workerpool": "^6.4.0", "yargs": "^16.2.0" }, "repository": { diff --git a/packages/@aws-cdk/integ-tests/package.json b/packages/@aws-cdk/integ-tests/package.json index 5ff680a5d142e..26955f48c4e18 100644 --- a/packages/@aws-cdk/integ-tests/package.json +++ b/packages/@aws-cdk/integ-tests/package.json @@ -67,7 +67,7 @@ "@aws-cdk/pkglint": "0.0.0", "@types/fs-extra": "^9.0.13", "@types/jest": "^27.5.2", - "aws-sdk": "^2.1317.0", + "aws-sdk": "^2.1325.0", "aws-sdk-mock": "5.6.0", "jest": "^27.5.1", "nock": "^13.3.0", diff --git a/packages/@aws-cdk/lambda-layer-awscli/package.json b/packages/@aws-cdk/lambda-layer-awscli/package.json index 70fbd525300cf..a9661d7872f3b 100644 --- a/packages/@aws-cdk/lambda-layer-awscli/package.json +++ b/packages/@aws-cdk/lambda-layer-awscli/package.json @@ -84,7 +84,7 @@ "dependencies": { "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "@aws-cdk/asset-awscli-v1": "^2.2.69", + "@aws-cdk/asset-awscli-v1": "^2.2.85", "constructs": "^10.0.0" }, "homepage": "https://github.com/aws/aws-cdk", diff --git a/packages/@aws-cdk/lambda-layer-node-proxy-agent/package.json b/packages/@aws-cdk/lambda-layer-node-proxy-agent/package.json index 326a2d93e1673..33fc33d129d07 100644 --- a/packages/@aws-cdk/lambda-layer-node-proxy-agent/package.json +++ b/packages/@aws-cdk/lambda-layer-node-proxy-agent/package.json @@ -84,7 +84,7 @@ "dependencies": { "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "@aws-cdk/asset-node-proxy-agent-v5": "^2.0.58", + "@aws-cdk/asset-node-proxy-agent-v5": "^2.0.71", "constructs": "^10.0.0" }, "homepage": "https://github.com/aws/aws-cdk", diff --git a/packages/@aws-cdk/pipelines/package.json b/packages/@aws-cdk/pipelines/package.json index 3c80bc8c72978..22003dab4cd5f 100644 --- a/packages/@aws-cdk/pipelines/package.json +++ b/packages/@aws-cdk/pipelines/package.json @@ -51,7 +51,7 @@ "@aws-cdk/cfn2ts": "0.0.0", "@aws-cdk/pkglint": "0.0.0", "@types/jest": "^27.5.2", - "aws-sdk": "^2.1317.0" + "aws-sdk": "^2.1325.0" }, "peerDependencies": { "@aws-cdk/aws-codebuild": "0.0.0", diff --git a/packages/@aws-cdk/triggers/package.json b/packages/@aws-cdk/triggers/package.json index 05d426c268df8..0fcc8c783120a 100644 --- a/packages/@aws-cdk/triggers/package.json +++ b/packages/@aws-cdk/triggers/package.json @@ -78,7 +78,7 @@ "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/integ-tests": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", - "aws-sdk": "^2.1317.0", + "aws-sdk": "^2.1325.0", "@aws-cdk/pkglint": "0.0.0", "@types/jest": "^27.5.2", "jest": "^27.5.1" diff --git a/packages/aws-cdk-lib/package.json b/packages/aws-cdk-lib/package.json index bfc20cc70e174..5a5c4ef436d66 100644 --- a/packages/aws-cdk-lib/package.json +++ b/packages/aws-cdk-lib/package.json @@ -114,8 +114,8 @@ "punycode": "^2.3.0", "semver": "^7.3.8", "yaml": "1.10.2", - "@aws-cdk/asset-awscli-v1": "^2.2.69", - "@aws-cdk/asset-node-proxy-agent-v5": "^2.0.58", + "@aws-cdk/asset-awscli-v1": "^2.2.85", + "@aws-cdk/asset-node-proxy-agent-v5": "^2.0.71", "@aws-cdk/asset-kubectl-v20": "^2.1.1" }, "devDependencies": { @@ -380,7 +380,7 @@ "@aws-cdk/triggers": "0.0.0", "@aws-cdk/ubergen": "0.0.0", "constructs": "^10.0.0", - "esbuild": "^0.17.8", + "esbuild": "^0.17.10", "fs-extra": "^9.1.0", "ts-node": "^9.1.1", "typescript": "~3.8.3" diff --git a/packages/aws-cdk/THIRD_PARTY_LICENSES b/packages/aws-cdk/THIRD_PARTY_LICENSES index 4497b540f5ff9..144889e860f6e 100644 --- a/packages/aws-cdk/THIRD_PARTY_LICENSES +++ b/packages/aws-cdk/THIRD_PARTY_LICENSES @@ -1,6 +1,6 @@ The aws-cdk package includes the following third-party software/licensing: -** @jsii/check-node@1.75.0 - https://www.npmjs.com/package/@jsii/check-node/v/1.75.0 | Apache-2.0 +** @jsii/check-node@1.76.0 - https://www.npmjs.com/package/@jsii/check-node/v/1.76.0 | Apache-2.0 jsii Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. @@ -268,7 +268,7 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH RE ---------------- -** aws-sdk@2.1317.0 - https://www.npmjs.com/package/aws-sdk/v/2.1317.0 | Apache-2.0 +** aws-sdk@2.1325.0 - https://www.npmjs.com/package/aws-sdk/v/2.1325.0 | Apache-2.0 AWS SDK for JavaScript Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. @@ -2475,7 +2475,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ---------------- -** raw-body@2.5.1 - https://www.npmjs.com/package/raw-body/v/2.5.1 | MIT +** raw-body@2.5.2 - https://www.npmjs.com/package/raw-body/v/2.5.2 | MIT The MIT License (MIT) Copyright (c) 2013-2014 Jonathan Ong @@ -2545,7 +2545,7 @@ IN THE SOFTWARE. ---------------- -** readable-stream@2.3.7 - https://www.npmjs.com/package/readable-stream/v/2.3.7 | MIT +** readable-stream@2.3.8 - https://www.npmjs.com/package/readable-stream/v/2.3.8 | MIT Node.js is licensed for use as follows: """ @@ -2597,7 +2597,7 @@ IN THE SOFTWARE. ---------------- -** readable-stream@3.6.0 - https://www.npmjs.com/package/readable-stream/v/3.6.0 | MIT +** readable-stream@3.6.1 - https://www.npmjs.com/package/readable-stream/v/3.6.1 | MIT Node.js is licensed for use as follows: """ diff --git a/packages/aws-cdk/lib/api/bootstrap/bootstrap-environment.ts b/packages/aws-cdk/lib/api/bootstrap/bootstrap-environment.ts index e02767b50cc90..a60ab815562b4 100644 --- a/packages/aws-cdk/lib/api/bootstrap/bootstrap-environment.ts +++ b/packages/aws-cdk/lib/api/bootstrap/bootstrap-environment.ts @@ -139,16 +139,26 @@ export class Bootstrapper { * - the name indicating the custom permissions boundary to be used * Re-bootstrapping will NOT be blocked by either tightening or relaxing the permissions' boundary. */ - const currentPermissionsBoundary = current.parameters.InputPermissionsBoundary; + + // InputPermissionsBoundary is an `any` type and if it is not defined it + // appears as an empty string ''. We need to force it to evaluate an empty string + // as undefined + const currentPermissionsBoundary: string | undefined = current.parameters.InputPermissionsBoundary || undefined; const inputPolicyName = params.examplePermissionsBoundary ? CDK_BOOTSTRAP_PERMISSIONS_BOUNDARY : params.customPermissionsBoundary; - let policyName; + let policyName: string | undefined; if (inputPolicyName) { // If the example policy is not already in place, it must be created. const sdk = (await sdkProvider.forEnvironment(environment, Mode.ForWriting)).sdk; policyName = await this.getPolicyName(environment, sdk, inputPolicyName, partition, params); } if (currentPermissionsBoundary !== policyName) { - warning(`Switching from ${currentPermissionsBoundary} to ${policyName} as permissions boundary`); + if (!currentPermissionsBoundary) { + warning(`Adding new permissions boundary ${policyName}`); + } else if (!policyName) { + warning(`Removing existing permissions boundary ${currentPermissionsBoundary}`); + } else { + warning(`Changing permissions boundary from ${currentPermissionsBoundary} to ${policyName}`); + } } return current.update( diff --git a/packages/aws-cdk/lib/api/bootstrap/bootstrap-props.ts b/packages/aws-cdk/lib/api/bootstrap/bootstrap-props.ts index 1d28a442e8ea1..afc05e41c1888 100644 --- a/packages/aws-cdk/lib/api/bootstrap/bootstrap-props.ts +++ b/packages/aws-cdk/lib/api/bootstrap/bootstrap-props.ts @@ -5,6 +5,12 @@ export const REPOSITORY_NAME_OUTPUT = 'RepositoryName'; export const BUCKET_DOMAIN_NAME_OUTPUT = 'BucketDomainName'; export const BOOTSTRAP_VERSION_OUTPUT = 'BootstrapVersion'; export const BOOTSTRAP_VERSION_RESOURCE = 'CdkBootstrapVersion'; +export const BOOTSTRAP_VARIANT_PARAMETER = 'BootstrapVariant'; + +/** + * The assumed vendor of a template in case it is not set + */ +export const DEFAULT_BOOTSTRAP_VARIANT = 'AWS CDK: Default Resources'; /** * Options for the bootstrapEnvironment operation(s) diff --git a/packages/aws-cdk/lib/api/bootstrap/bootstrap-template.yaml b/packages/aws-cdk/lib/api/bootstrap/bootstrap-template.yaml index e5461d63d5fdd..88a5ef4409ce3 100644 --- a/packages/aws-cdk/lib/api/bootstrap/bootstrap-template.yaml +++ b/packages/aws-cdk/lib/api/bootstrap/bootstrap-template.yaml @@ -50,6 +50,12 @@ Parameters: Default: 'false' AllowedValues: [ 'true', 'false' ] Type: String + BootstrapVariant: + Type: String + Default: 'AWS CDK: Default Resources' + Description: Describe the provenance of the resources in this bootstrap + stack. Change this when you customize the template. To prevent accidents, + the CDK CLI will not overwrite bootstrap stacks with a different variant. Conditions: HasTrustedAccounts: Fn::Not: diff --git a/packages/aws-cdk/lib/api/bootstrap/deploy-bootstrap.ts b/packages/aws-cdk/lib/api/bootstrap/deploy-bootstrap.ts index 74f6b7142e66c..684b9ce1e709d 100644 --- a/packages/aws-cdk/lib/api/bootstrap/deploy-bootstrap.ts +++ b/packages/aws-cdk/lib/api/bootstrap/deploy-bootstrap.ts @@ -3,7 +3,7 @@ import * as path from 'path'; import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import * as cxapi from '@aws-cdk/cx-api'; import * as fs from 'fs-extra'; -import { BOOTSTRAP_VERSION_OUTPUT, BootstrapEnvironmentOptions, BOOTSTRAP_VERSION_RESOURCE } from './bootstrap-props'; +import { BOOTSTRAP_VERSION_OUTPUT, BootstrapEnvironmentOptions, BOOTSTRAP_VERSION_RESOURCE, BOOTSTRAP_VARIANT_PARAMETER, DEFAULT_BOOTSTRAP_VARIANT } from './bootstrap-props'; import * as logging from '../../logging'; import { Mode, SdkProvider, ISDK } from '../aws-auth'; import { deployStack, DeployStackResult } from '../deploy-stack'; @@ -63,21 +63,34 @@ export class BootstrapStack { parameters: Record, options: Omit, ): Promise { - - const newVersion = bootstrapVersionFromTemplate(template); - if (this.currentToolkitInfo.found && newVersion < this.currentToolkitInfo.version && !options.force) { - logging.warning(`Bootstrap stack already at version '${this.currentToolkitInfo.version}'. Not downgrading it to version '${newVersion}' (use --force if you intend to downgrade)`); - if (newVersion === 0) { - // A downgrade with 0 as target version means we probably have a new-style bootstrap in the account, - // and an old-style bootstrap as current target, which means the user probably forgot to put this flag in. - logging.warning('(Did you set the \'@aws-cdk/core:newStyleStackSynthesis\' feature flag in cdk.json?)'); - } - - return { + if (this.currentToolkitInfo.found && !options.force) { + // Safety checks + const abortResponse = { noOp: true, outputs: {}, stackArn: this.currentToolkitInfo.bootstrapStack.stackId, }; + + // Validate that the bootstrap stack we're trying to replace is from the same variant as the one we're trying to deploy + const currentVariant = this.currentToolkitInfo.variant; + const newVariant = bootstrapVariantFromTemplate(template); + if (currentVariant !== newVariant) { + logging.warning(`Bootstrap stack already exists, containing '${currentVariant}'. Not overwriting it with a template containing '${newVariant}' (use --force if you intend to overwrite)`); + return abortResponse; + } + + // Validate that we're not downgrading the bootstrap stack + const newVersion = bootstrapVersionFromTemplate(template); + const currentVersion = this.currentToolkitInfo.version; + if (newVersion < currentVersion) { + logging.warning(`Bootstrap stack already at version ${currentVersion}. Not downgrading it to version ${newVersion} (use --force if you intend to downgrade)`); + if (newVersion === 0) { + // A downgrade with 0 as target version means we probably have a new-style bootstrap in the account, + // and an old-style bootstrap as current target, which means the user probably forgot to put this flag in. + logging.warning('(Did you set the \'@aws-cdk/core:newStyleStackSynthesis\' feature flag in cdk.json?)'); + } + return abortResponse; + } } const outdir = await fs.mkdtemp(path.join(os.tmpdir(), 'cdk-bootstrap')); @@ -127,3 +140,7 @@ export function bootstrapVersionFromTemplate(template: any): number { } return 0; } + +export function bootstrapVariantFromTemplate(template: any): string { + return template.Parameters?.[BOOTSTRAP_VARIANT_PARAMETER]?.Default ?? DEFAULT_BOOTSTRAP_VARIANT; +} diff --git a/packages/aws-cdk/lib/api/toolkit-info.ts b/packages/aws-cdk/lib/api/toolkit-info.ts index 87a772e5253aa..a2b1b7fd0abc1 100644 --- a/packages/aws-cdk/lib/api/toolkit-info.ts +++ b/packages/aws-cdk/lib/api/toolkit-info.ts @@ -1,7 +1,7 @@ import * as cxapi from '@aws-cdk/cx-api'; import * as chalk from 'chalk'; import { ISDK } from './aws-auth'; -import { BOOTSTRAP_VERSION_OUTPUT, BUCKET_DOMAIN_NAME_OUTPUT, BUCKET_NAME_OUTPUT } from './bootstrap/bootstrap-props'; +import { BOOTSTRAP_VERSION_OUTPUT, BUCKET_DOMAIN_NAME_OUTPUT, BUCKET_NAME_OUTPUT, BOOTSTRAP_VARIANT_PARAMETER, DEFAULT_BOOTSTRAP_VARIANT } from './bootstrap/bootstrap-props'; import { stabilizeStack, CloudFormationStack } from './util/cloudformation'; import { debug, warning } from '../logging'; @@ -102,6 +102,7 @@ export abstract class ToolkitInfo { public abstract readonly bucketUrl: string; public abstract readonly bucketName: string; public abstract readonly version: number; + public abstract readonly variant: string; public abstract readonly bootstrapStack: CloudFormationStack; constructor(protected readonly sdk: ISDK) { @@ -132,6 +133,10 @@ class ExistingToolkitInfo extends ToolkitInfo { return parseInt(this.bootstrapStack.outputs[BOOTSTRAP_VERSION_OUTPUT] ?? '0', 10); } + public get variant() { + return this.bootstrapStack.parameters[BOOTSTRAP_VARIANT_PARAMETER] ?? DEFAULT_BOOTSTRAP_VARIANT; + } + public get parameters(): Record { return this.bootstrapStack.parameters ?? {}; } @@ -258,6 +263,10 @@ class BootstrapStackNotFoundInfo extends ToolkitInfo { throw new Error(this.errorMessage); } + public get variant(): string { + throw new Error(this.errorMessage); + } + public async validateVersion(expectedVersion: number, ssmParameterName: string | undefined): Promise { if (ssmParameterName === undefined) { throw new Error(this.errorMessage); diff --git a/packages/aws-cdk/lib/init-templates/app/csharp/README.md b/packages/aws-cdk/lib/init-templates/app/csharp/README.md index d2eb4e9e33144..f28e4d55306cb 100644 --- a/packages/aws-cdk/lib/init-templates/app/csharp/README.md +++ b/packages/aws-cdk/lib/init-templates/app/csharp/README.md @@ -4,7 +4,7 @@ This is a blank project for CDK development with C#. The `cdk.json` file tells the CDK Toolkit how to execute your app. -It uses the [.NET Core CLI](https://docs.microsoft.com/dotnet/articles/core/) to compile and execute your project. +It uses the [.NET CLI](https://docs.microsoft.com/dotnet/articles/core/) to compile and execute your project. ## Useful commands diff --git a/packages/aws-cdk/lib/init-templates/app/csharp/src/%name.PascalCased%/%name.PascalCased%.template.csproj b/packages/aws-cdk/lib/init-templates/app/csharp/src/%name.PascalCased%/%name.PascalCased%.template.csproj index a839c9651027a..e82ee424f2b6c 100644 --- a/packages/aws-cdk/lib/init-templates/app/csharp/src/%name.PascalCased%/%name.PascalCased%.template.csproj +++ b/packages/aws-cdk/lib/init-templates/app/csharp/src/%name.PascalCased%/%name.PascalCased%.template.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 Major diff --git a/packages/aws-cdk/lib/init-templates/app/fsharp/src/%name.PascalCased%/%name.PascalCased%.template.fsproj b/packages/aws-cdk/lib/init-templates/app/fsharp/src/%name.PascalCased%/%name.PascalCased%.template.fsproj index e28dbb84b14a1..07755869f787b 100644 --- a/packages/aws-cdk/lib/init-templates/app/fsharp/src/%name.PascalCased%/%name.PascalCased%.template.fsproj +++ b/packages/aws-cdk/lib/init-templates/app/fsharp/src/%name.PascalCased%/%name.PascalCased%.template.fsproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 Major diff --git a/packages/aws-cdk/lib/init-templates/app/javascript/package.json b/packages/aws-cdk/lib/init-templates/app/javascript/package.json index 25f9cd9a79e94..3d4f898b31c6b 100644 --- a/packages/aws-cdk/lib/init-templates/app/javascript/package.json +++ b/packages/aws-cdk/lib/init-templates/app/javascript/package.json @@ -11,7 +11,7 @@ }, "devDependencies": { "aws-cdk": "%cdk-version%", - "jest": "^29.4.2" + "jest": "^29.4.3" }, "dependencies": { "aws-cdk-lib": "%cdk-version%", diff --git a/packages/aws-cdk/lib/init-templates/app/typescript/package.json b/packages/aws-cdk/lib/init-templates/app/typescript/package.json index 08a087dd655c1..c2d4c49eb5f5f 100644 --- a/packages/aws-cdk/lib/init-templates/app/typescript/package.json +++ b/packages/aws-cdk/lib/init-templates/app/typescript/package.json @@ -12,8 +12,8 @@ }, "devDependencies": { "@types/jest": "^29.4.0", - "@types/node": "18.13.0", - "jest": "^29.4.2", + "@types/node": "18.14.2", + "jest": "^29.4.3", "ts-jest": "^29.0.5", "aws-cdk": "%cdk-version%", "ts-node": "^10.9.1", diff --git a/packages/aws-cdk/lib/init-templates/lib/typescript/package.json b/packages/aws-cdk/lib/init-templates/lib/typescript/package.json index 130562ff49e73..ddfbc0ba961ab 100644 --- a/packages/aws-cdk/lib/init-templates/lib/typescript/package.json +++ b/packages/aws-cdk/lib/init-templates/lib/typescript/package.json @@ -10,10 +10,10 @@ }, "devDependencies": { "@types/jest": "^29.4.0", - "@types/node": "18.13.0", + "@types/node": "18.14.2", "aws-cdk-lib": "%cdk-version%", "constructs": "%constructs-version%", - "jest": "^29.4.2", + "jest": "^29.4.3", "ts-jest": "^29.0.5", "typescript": "~4.9.5" }, diff --git a/packages/aws-cdk/lib/init-templates/sample-app/csharp/README.template.md b/packages/aws-cdk/lib/init-templates/sample-app/csharp/README.template.md index 411d4e653994e..829e5976af869 100644 --- a/packages/aws-cdk/lib/init-templates/sample-app/csharp/README.template.md +++ b/packages/aws-cdk/lib/init-templates/sample-app/csharp/README.template.md @@ -5,7 +5,7 @@ which contains an Amazon SQS queue that is subscribed to an Amazon SNS topic. The `cdk.json` file tells the CDK Toolkit how to execute your app. -It uses the [.NET Core CLI](https://docs.microsoft.com/dotnet/articles/core/) to compile and execute your project. +It uses the [.NET CLI](https://docs.microsoft.com/dotnet/articles/core/) to compile and execute your project. ## Useful commands diff --git a/packages/aws-cdk/lib/init-templates/sample-app/csharp/src/%name.PascalCased%/%name.PascalCased%.template.csproj b/packages/aws-cdk/lib/init-templates/sample-app/csharp/src/%name.PascalCased%/%name.PascalCased%.template.csproj index a839c9651027a..e82ee424f2b6c 100644 --- a/packages/aws-cdk/lib/init-templates/sample-app/csharp/src/%name.PascalCased%/%name.PascalCased%.template.csproj +++ b/packages/aws-cdk/lib/init-templates/sample-app/csharp/src/%name.PascalCased%/%name.PascalCased%.template.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 Major diff --git a/packages/aws-cdk/lib/init-templates/sample-app/fsharp/README.template.md b/packages/aws-cdk/lib/init-templates/sample-app/fsharp/README.template.md index d1bfcf9a90ccf..71d05a9cdeb27 100644 --- a/packages/aws-cdk/lib/init-templates/sample-app/fsharp/README.template.md +++ b/packages/aws-cdk/lib/init-templates/sample-app/fsharp/README.template.md @@ -6,7 +6,7 @@ which contains an Amazon SQS queue that is subscribed to an Amazon SNS topic. The `cdk.json` file tells the CDK Toolkit how to execute your app. -It uses the [.NET Core CLI](https://docs.microsoft.com/dotnet/articles/core/) to compile and execute your project. +It uses the [.NET CLI](https://docs.microsoft.com/dotnet/articles/core/) to compile and execute your project. ## Useful commands diff --git a/packages/aws-cdk/lib/init-templates/sample-app/fsharp/src/%name.PascalCased%/%name.PascalCased%.template.fsproj b/packages/aws-cdk/lib/init-templates/sample-app/fsharp/src/%name.PascalCased%/%name.PascalCased%.template.fsproj index e28dbb84b14a1..07755869f787b 100644 --- a/packages/aws-cdk/lib/init-templates/sample-app/fsharp/src/%name.PascalCased%/%name.PascalCased%.template.fsproj +++ b/packages/aws-cdk/lib/init-templates/sample-app/fsharp/src/%name.PascalCased%/%name.PascalCased%.template.fsproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 Major diff --git a/packages/aws-cdk/lib/init-templates/sample-app/javascript/package.json b/packages/aws-cdk/lib/init-templates/sample-app/javascript/package.json index 25f9cd9a79e94..3d4f898b31c6b 100644 --- a/packages/aws-cdk/lib/init-templates/sample-app/javascript/package.json +++ b/packages/aws-cdk/lib/init-templates/sample-app/javascript/package.json @@ -11,7 +11,7 @@ }, "devDependencies": { "aws-cdk": "%cdk-version%", - "jest": "^29.4.2" + "jest": "^29.4.3" }, "dependencies": { "aws-cdk-lib": "%cdk-version%", diff --git a/packages/aws-cdk/lib/init-templates/sample-app/typescript/package.json b/packages/aws-cdk/lib/init-templates/sample-app/typescript/package.json index f2df4136e89d2..3c82377faa1c2 100644 --- a/packages/aws-cdk/lib/init-templates/sample-app/typescript/package.json +++ b/packages/aws-cdk/lib/init-templates/sample-app/typescript/package.json @@ -12,8 +12,8 @@ }, "devDependencies": { "@types/jest": "^29.4.0", - "@types/node": "18.13.0", - "jest": "^29.4.2", + "@types/node": "18.14.2", + "jest": "^29.4.3", "ts-jest": "^29.0.5", "aws-cdk": "%cdk-version%", "ts-node": "^10.9.1", diff --git a/packages/aws-cdk/package.json b/packages/aws-cdk/package.json index bfb389e4204f9..00f0dc12be4f3 100644 --- a/packages/aws-cdk/package.json +++ b/packages/aws-cdk/package.json @@ -98,9 +98,9 @@ "@aws-cdk/cloudformation-diff": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "@jsii/check-node": "1.75.0", + "@jsii/check-node": "1.76.0", "archiver": "^5.3.1", - "aws-sdk": "^2.1317.0", + "aws-sdk": "^2.1325.0", "camelcase": "^6.3.0", "cdk-assets": "0.0.0", "chokidar": "^3.5.3", diff --git a/packages/aws-cdk/test/api/bootstrap2.test.ts b/packages/aws-cdk/test/api/bootstrap2.test.ts index 5ca8b6e3f9929..bedd4f968c2e5 100644 --- a/packages/aws-cdk/test/api/bootstrap2.test.ts +++ b/packages/aws-cdk/test/api/bootstrap2.test.ts @@ -12,9 +12,15 @@ import { mockBootstrapStack, MockSdk, MockSdkProvider } from '../util/mock-sdk'; let bootstrapper: Bootstrapper; let mockGetPolicyIamCode: (params: IAM.Types.GetPolicyRequest) => IAM.Types.GetPolicyResponse; let mockCreatePolicyIamCode: (params: IAM.Types.CreatePolicyRequest) => IAM.Types.CreatePolicyResponse; +let stderrMock: jest.SpyInstance; beforeEach(() => { bootstrapper = new Bootstrapper({ source: 'default' }); + stderrMock = jest.spyOn(process.stderr, 'write').mockImplementation(() => { return true; }); +}); + +afterEach(() => { + stderrMock.mockRestore(); }); function mockTheToolkitInfo(stackProps: Partial) { @@ -114,6 +120,14 @@ describe('Bootstrapping v2', () => { }); test('passes value to PermissionsBoundary', async () => { + mockTheToolkitInfo({ + Parameters: [ + { + ParameterKey: 'InputPermissionsBoundary', + ParameterValue: 'existing-pb', + }, + ], + }); await bootstrapper.bootstrapEnvironment(env, sdk, { parameters: { customPermissionsBoundary: 'permissions-boundary-name', @@ -125,6 +139,71 @@ describe('Bootstrapping v2', () => { InputPermissionsBoundary: 'permissions-boundary-name', }), })); + expect(stderrMock.mock.calls).toEqual(expect.arrayContaining([ + expect.arrayContaining([ + expect.stringMatching(/Changing permissions boundary from existing-pb to permissions-boundary-name/), + ]), + ])); + }); + + test('permission boundary switch message does not appear', async () => { + mockTheToolkitInfo({ + Parameters: [ + { + ParameterKey: 'InputPermissionsBoundary', + ParameterValue: '', + }, + ], + }); + await bootstrapper.bootstrapEnvironment(env, sdk); + + expect(stderrMock.mock.calls).toEqual(expect.arrayContaining([ + expect.not.arrayContaining([ + expect.stringMatching(/Changing permissions boundary/), + ]), + ])); + }); + + test('adding new permissions boundary', async () => { + mockTheToolkitInfo({ + Parameters: [ + { + ParameterKey: 'InputPermissionsBoundary', + ParameterValue: '', + }, + ], + }); + await bootstrapper.bootstrapEnvironment(env, sdk, { + parameters: { + customPermissionsBoundary: 'permissions-boundary-name', + }, + }); + + expect(stderrMock.mock.calls).toEqual(expect.arrayContaining([ + expect.arrayContaining([ + expect.stringMatching(/Adding new permissions boundary permissions-boundary-name/), + ]), + ])); + }); + + test('removing existing permissions boundary', async () => { + mockTheToolkitInfo({ + Parameters: [ + { + ParameterKey: 'InputPermissionsBoundary', + ParameterValue: 'permissions-boundary-name', + }, + ], + }); + await bootstrapper.bootstrapEnvironment(env, sdk, { + parameters: {}, + }); + + expect(stderrMock.mock.calls).toEqual(expect.arrayContaining([ + expect.arrayContaining([ + expect.stringMatching(/Removing existing permissions boundary permissions-boundary-name/), + ]), + ])); }); test('passing trusted accounts without CFN managed policies results in an error', async () => { @@ -220,6 +299,21 @@ describe('Bootstrapping v2', () => { })).resolves.toEqual(expect.objectContaining({ noOp: true })); }); + test('Do not allow overwriting bootstrap stack from a different vendor', async () => { + // GIVEN + mockTheToolkitInfo({ + Parameters: [ + { + ParameterKey: 'BootstrapVariant', + ParameterValue: 'JoeSchmoe', + }, + ], + }); + + await expect(bootstrapper.bootstrapEnvironment(env, sdk, { + })).resolves.toEqual(expect.objectContaining({ noOp: true })); + }); + test('bootstrap template has the right exports', async () => { let template: any; mockDeployStack.mockImplementation((args: DeployStackOptions) => { diff --git a/packages/aws-cdk/test/api/cloudformation-deployments.test.ts b/packages/aws-cdk/test/api/cloudformation-deployments.test.ts index 97278ffd3e8a8..40cc63e2edf68 100644 --- a/packages/aws-cdk/test/api/cloudformation-deployments.test.ts +++ b/packages/aws-cdk/test/api/cloudformation-deployments.test.ts @@ -8,6 +8,7 @@ import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import * as cxapi from '@aws-cdk/cx-api'; import { CloudFormation } from 'aws-sdk'; import { FakeCloudformationStack } from './fake-cloudformation-stack'; +import { DEFAULT_BOOTSTRAP_VARIANT } from '../../lib'; import { CloudFormationDeployments } from '../../lib/api/cloudformation-deployments'; import { deployStack } from '../../lib/api/deploy-stack'; import { HotswapMode } from '../../lib/api/hotswap/common'; @@ -931,6 +932,7 @@ function testStackWithAssetManifest() { public found: boolean = true; public bucketUrl: string = 's3://fake/here'; public bucketName: string = 'fake'; + public variant: string = DEFAULT_BOOTSTRAP_VARIANT; public version: number = 1234; public get bootstrapStack(): CloudFormationStack { throw new Error('This should never happen'); @@ -1000,4 +1002,4 @@ function testStackWithAssetManifest() { const assembly = builder.buildAssembly(); return assembly.getStackArtifact('stack'); -} \ No newline at end of file +} diff --git a/packages/aws-cdk/test/init.test.ts b/packages/aws-cdk/test/init.test.ts index 79af055608578..4ecdc53789530 100644 --- a/packages/aws-cdk/test/init.test.ts +++ b/packages/aws-cdk/test/init.test.ts @@ -58,6 +58,7 @@ describe('constructs version', () => { const sln = (await fs.readFile(slnFile, 'utf8')).split(/\r?\n/); expect(csproj).toContainEqual(expect.stringMatching(/\net6.0<\/TargetFramework>/)); expect(sln).toContainEqual(expect.stringMatching(/\"AwsCdkTest[a-zA-Z0-9]{6}\\AwsCdkTest[a-zA-Z0-9]{6}.csproj\"/)); }); @@ -73,6 +74,7 @@ describe('constructs version', () => { const sln = (await fs.readFile(slnFile, 'utf8')).split(/\r?\n/); expect(fsproj).toContainEqual(expect.stringMatching(/\net6.0<\/TargetFramework>/)); expect(sln).toContainEqual(expect.stringMatching(/\"AwsCdkTest[a-zA-Z0-9]{6}\\AwsCdkTest[a-zA-Z0-9]{6}.fsproj\"/)); }); @@ -85,6 +87,7 @@ describe('constructs version', () => { const csproj = (await fs.readFile(csprojFile, 'utf8')).split(/\r?\n/); expect(csproj).toContainEqual(expect.stringMatching(/\net6.0<\/TargetFramework>/)); }); cliTestWithDirSpaces('fsharp app with spaces', async (workDir) => { @@ -96,6 +99,7 @@ describe('constructs version', () => { const fsproj = (await fs.readFile(fsprojFile, 'utf8')).split(/\r?\n/); expect(fsproj).toContainEqual(expect.stringMatching(/\net6.0<\/TargetFramework>/)); }); cliTest('create a Python app project', async (workDir) => { diff --git a/packages/aws-cdk/test/integ/test-cli-regression-against-current-code.sh b/packages/aws-cdk/test/integ/test-cli-regression-against-current-code.sh index c735580c9fd58..b8d3684c70ba6 100755 --- a/packages/aws-cdk/test/integ/test-cli-regression-against-current-code.sh +++ b/packages/aws-cdk/test/integ/test-cli-regression-against-current-code.sh @@ -9,4 +9,4 @@ previous=$(${INTEG_TOOLS}/bin/query-github last-release --token $GITHUB_TOKEN -- echo "Previous version is: $previous" # Old tests, new CLI, new framework -exec $INTEG_TOOLS/bin/download-and-run-old-tests "$previous" --use-cli-release=$VERSION cli-integ-tests +exec $INTEG_TOOLS/bin/download-and-run-old-tests "$previous" --regression --use-cli-release=$VERSION cli-integ-tests diff --git a/packages/aws-cdk/test/integ/test-cli-regression-against-latest-release.sh b/packages/aws-cdk/test/integ/test-cli-regression-against-latest-release.sh index 8c828fb2138ce..854eb047c06b9 100755 --- a/packages/aws-cdk/test/integ/test-cli-regression-against-latest-release.sh +++ b/packages/aws-cdk/test/integ/test-cli-regression-against-latest-release.sh @@ -8,4 +8,4 @@ previous=$(${INTEG_TOOLS}/bin/query-github last-release --token $GITHUB_TOKEN -- echo "Previous version is: $previous" # Old tests, new CLI, old framework -exec $INTEG_TOOLS/bin/download-and-run-old-tests "$previous" --use-cli-release=$VERSION --framework-version=$previous cli-integ-tests +exec $INTEG_TOOLS/bin/download-and-run-old-tests "$previous" --regression --use-cli-release=$VERSION --framework-version=$previous cli-integ-tests diff --git a/packages/aws-cdk/test/util/mock-toolkitinfo.ts b/packages/aws-cdk/test/util/mock-toolkitinfo.ts index f86e7fec94965..e46054e5a5d4a 100644 --- a/packages/aws-cdk/test/util/mock-toolkitinfo.ts +++ b/packages/aws-cdk/test/util/mock-toolkitinfo.ts @@ -1,4 +1,4 @@ -import { ISDK, ToolkitInfo } from '../../lib/api'; +import { ISDK, ToolkitInfo, DEFAULT_BOOTSTRAP_VARIANT } from '../../lib/api'; import { CloudFormationStack } from '../../lib/api/util/cloudformation'; export interface MockToolkitInfoProps { @@ -17,6 +17,7 @@ export class MockToolkitInfo extends ToolkitInfo { public readonly bucketUrl: string; public readonly bucketName: string; public readonly version: number; + public readonly variant: string; public readonly prepareEcrRepository = mockLike(); private readonly _bootstrapStack?: CloudFormationStack; @@ -27,6 +28,7 @@ export class MockToolkitInfo extends ToolkitInfo { this.bucketName = props.bucketName ?? 'MockToolkitBucketName'; this.bucketUrl = props.bucketUrl ?? `https://${this.bucketName}.s3.amazonaws.com/`; this.version = props.version ?? 1; + this.variant = DEFAULT_BOOTSTRAP_VARIANT; this._bootstrapStack = props.bootstrapStack; } diff --git a/packages/awslint/package.json b/packages/awslint/package.json index eabb892dae50e..fd31ed7b098e7 100644 --- a/packages/awslint/package.json +++ b/packages/awslint/package.json @@ -18,11 +18,11 @@ "awslint": "bin/awslint" }, "dependencies": { - "@jsii/spec": "1.75.0", + "@jsii/spec": "1.76.0", "camelcase": "^6.3.0", "chalk": "^4", "fs-extra": "^9.1.0", - "jsii-reflect": "1.75.0", + "jsii-reflect": "1.76.0", "yargs": "^16.2.0" }, "devDependencies": { diff --git a/packages/cdk-assets/lib/private/docker.ts b/packages/cdk-assets/lib/private/docker.ts index 7cca00a2d0cbd..509e15cbed22f 100644 --- a/packages/cdk-assets/lib/private/docker.ts +++ b/packages/cdk-assets/lib/private/docker.ts @@ -2,7 +2,7 @@ import * as fs from 'fs'; import * as os from 'os'; import * as path from 'path'; import { cdkCredentialsConfig, obtainEcrCredentials } from './docker-credentials'; -import { Logger, shell, ShellOptions } from './shell'; +import { Logger, shell, ShellOptions, ProcessFailedError } from './shell'; import { createCriticalSection } from './util'; interface BuildOptions { @@ -31,6 +31,11 @@ export interface DockerDomainCredentials { readonly ecrRepository?: string; } +enum InspectImageErrorCode { + Docker = 1, + Podman = 125 +} + export class Docker { private configDir: string | undefined = undefined; @@ -46,8 +51,31 @@ export class Docker { await this.execute(['inspect', tag], { quiet: true }); return true; } catch (e) { - if (e.code !== 'PROCESS_FAILED' || e.exitCode !== 1) { throw e; } - return false; + const error: ProcessFailedError = e; + + /** + * The only error we expect to be thrown will have this property and value. + * If it doesn't, it's unrecognized so re-throw it. + */ + if (error.code !== 'PROCESS_FAILED') { + throw error; + } + + /** + * If we know the shell command above returned an error, check to see + * if the exit code is one we know to actually mean that the image doesn't + * exist. + */ + switch (error.exitCode) { + case InspectImageErrorCode.Docker: + case InspectImageErrorCode.Podman: + // Docker and Podman will return this exit code when an image doesn't exist, return false + // context: https://github.com/aws/aws-cdk/issues/16209 + return false; + default: + // This is an error but it's not an exit code we recognize, throw. + throw error; + } } } diff --git a/packages/cdk-assets/lib/private/shell.ts b/packages/cdk-assets/lib/private/shell.ts index 46eb7c6c571e1..ba7837f49810e 100644 --- a/packages/cdk-assets/lib/private/shell.ts +++ b/packages/cdk-assets/lib/private/shell.ts @@ -61,6 +61,8 @@ export async function shell(command: string[], options: ShellOptions = {}): Prom }); } +export type ProcessFailedError = ProcessFailed + class ProcessFailed extends Error { public readonly code = 'PROCESS_FAILED'; diff --git a/packages/cdk-assets/package.json b/packages/cdk-assets/package.json index a192f79aa6139..be2a4e69f3df4 100644 --- a/packages/cdk-assets/package.json +++ b/packages/cdk-assets/package.json @@ -46,7 +46,7 @@ "@aws-cdk/cloud-assembly-schema": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "archiver": "^5.3.1", - "aws-sdk": "^2.1317.0", + "aws-sdk": "^2.1325.0", "glob": "^7.2.3", "mime": "^2.6.0", "yargs": "^16.2.0" diff --git a/packages/cdk-assets/test/private/docker.test.ts b/packages/cdk-assets/test/private/docker.test.ts new file mode 100644 index 0000000000000..40c37ca35f271 --- /dev/null +++ b/packages/cdk-assets/test/private/docker.test.ts @@ -0,0 +1,94 @@ +import { Docker } from '../../lib/private/docker'; +import { ShellOptions, ProcessFailedError } from '../../lib/private/shell'; + +type ShellExecuteMock = jest.SpyInstance, Parameters>; + +describe('Docker', () => { + describe('exists', () => { + let docker: Docker; + + const makeShellExecuteMock = ( + fn: (params: string[]) => void, + ): ShellExecuteMock => + jest.spyOn<{ execute: Docker['execute'] }, 'execute'>(Docker.prototype as any, 'execute').mockImplementation( + async (params: string[], _options?: ShellOptions) => fn(params), + ); + + afterEach(() => { + jest.restoreAllMocks(); + }); + + beforeEach(() => { + docker = new Docker(); + }); + + test('returns true when image inspect command does not throw', async () => { + const spy = makeShellExecuteMock(() => undefined); + + const imageExists = await docker.exists('foo'); + + expect(imageExists).toBe(true); + expect(spy.mock.calls[0][0]).toEqual(['inspect', 'foo']); + }); + + test('throws when an arbitrary error is caught', async () => { + makeShellExecuteMock(() => { + throw new Error(); + }); + + await expect(docker.exists('foo')).rejects.toThrow(); + }); + + test('throws when the error is a shell failure but the exit code is unrecognized', async () => { + makeShellExecuteMock(() => { + throw new (class extends Error implements ProcessFailedError { + public readonly code = 'PROCESS_FAILED' + public readonly exitCode = 47 + public readonly signal = null + + constructor() { + super('foo'); + } + }); + }); + + await expect(docker.exists('foo')).rejects.toThrow(); + }); + + test('returns false when the error is a shell failure and the exit code is 1 (Docker)', async () => { + makeShellExecuteMock(() => { + throw new (class extends Error implements ProcessFailedError { + public readonly code = 'PROCESS_FAILED' + public readonly exitCode = 1 + public readonly signal = null + + constructor() { + super('foo'); + } + }); + }); + + const imageExists = await docker.exists('foo'); + + expect(imageExists).toBe(false); + }); + + test('returns false when the error is a shell failure and the exit code is 125 (Podman)', async () => { + makeShellExecuteMock(() => { + throw new (class extends Error implements ProcessFailedError { + public readonly code = 'PROCESS_FAILED' + public readonly exitCode = 125 + public readonly signal = null + + constructor() { + super('foo'); + } + }); + }); + + const imageExists = await docker.exists('foo'); + + expect(imageExists).toBe(false); + }); + }); +}); diff --git a/packages/cdk-dasm/package.json b/packages/cdk-dasm/package.json index 862919c7cabbd..0b9f1def89778 100644 --- a/packages/cdk-dasm/package.json +++ b/packages/cdk-dasm/package.json @@ -30,7 +30,7 @@ }, "license": "Apache-2.0", "dependencies": { - "codemaker": "1.75.0", + "codemaker": "1.76.0", "yaml": "1.10.2" }, "devDependencies": { diff --git a/scripts/check-build-prerequisites.sh b/scripts/check-build-prerequisites.sh index d90b5d76b73b4..93f9606e7c52e 100755 --- a/scripts/check-build-prerequisites.sh +++ b/scripts/check-build-prerequisites.sh @@ -121,13 +121,13 @@ else fi fi -# [.NET == 3.1.x, == 5.x] +# [.NET == 6.0.x] app="dotnet" -app_min="3.1.0" +app_min="6.0.100" check_which $app $app_min app_v=$(${app} --list-sdks) echo -e "Checking dotnet version... \c" -if [ $(echo $app_v | grep -c -E "(3\.1\.[0-9]+|[5-7]\.[0-9]+\.[0-9]+)") -eq 1 ] +if [ $(echo $app_v | grep -c -E "6\.[0-9]+\.[0-9]+") -eq 1 ] then echo "Ok" else diff --git a/scripts/check-pack-prerequisites.sh b/scripts/check-pack-prerequisites.sh index 01eb0fce515b0..30f42ad4b24e5 100755 --- a/scripts/check-pack-prerequisites.sh +++ b/scripts/check-pack-prerequisites.sh @@ -79,13 +79,13 @@ else wrong_version fi -# [.NET Core SDK 3.1.*] +# [.NET SDK 6.0.*] app="dotnet" -app_min="3.1.0" +app_min="6.0.100" check_which $app $app_min app_v=$(${app} --list-sdks) echo -e "Checking $app version... \c" -if [ $(echo $app_v | grep -c -E "3\.1\.[0-9].*|[4-9]\..*") -eq 1 ] +if [ $(echo $app_v | grep -c -E "6\.0\.[0-9].*|[4-9]\..*") -eq 1 ] then echo "Ok" else diff --git a/tools/@aws-cdk/cdk-build-tools/package.json b/tools/@aws-cdk/cdk-build-tools/package.json index fdf0692ee8235..b8ed716059491 100644 --- a/tools/@aws-cdk/cdk-build-tools/package.json +++ b/tools/@aws-cdk/cdk-build-tools/package.json @@ -57,9 +57,9 @@ "fs-extra": "^9.1.0", "jest": "^27.5.1", "jest-junit": "^13.2.0", - "jsii": "1.75.0", - "jsii-pacmak": "1.75.0", - "jsii-reflect": "1.75.0", + "jsii": "1.76.0", + "jsii-pacmak": "1.76.0", + "jsii-reflect": "1.76.0", "markdownlint-cli": "^0.33.0", "nyc": "^15.1.0", "semver": "^7.3.8", diff --git a/tools/@aws-cdk/cfn2ts/package.json b/tools/@aws-cdk/cfn2ts/package.json index 3f8ee3623f90b..73eebbefafe61 100644 --- a/tools/@aws-cdk/cfn2ts/package.json +++ b/tools/@aws-cdk/cfn2ts/package.json @@ -32,7 +32,7 @@ "license": "Apache-2.0", "dependencies": { "@aws-cdk/cfnspec": "0.0.0", - "codemaker": "1.75.0", + "codemaker": "1.76.0", "fast-json-patch": "^3.1.1", "fs-extra": "^9.1.0", "yargs": "^16.2.0" diff --git a/tools/@aws-cdk/node-bundle/package.json b/tools/@aws-cdk/node-bundle/package.json index 57948450adb39..4108e453a5a34 100644 --- a/tools/@aws-cdk/node-bundle/package.json +++ b/tools/@aws-cdk/node-bundle/package.json @@ -40,19 +40,19 @@ "jest-junit": "^13", "json-schema": "^0.4.0", "npm-check-updates": "^12", - "projen": "^0.67.57", + "projen": "^0.67.69", "standard-version": "^9", "ts-jest": "^27", "typescript": "^4.5.5" }, "dependencies": { - "cdk-generate-synthetic-examples": "^0.1.155", - "esbuild": "^0.17.8", + "cdk-generate-synthetic-examples": "^0.1.167", + "esbuild": "^0.17.10", "fs-extra": "^10.1.0", "license-checker": "^25.0.1", "madge": "^5.0.2", "shlex": "^2.1.2", - "yargs": "^17.7.0" + "yargs": "^17.7.1" }, "main": "lib/index.js", "license": "Apache-2.0", diff --git a/yarn.lock b/yarn.lock index 45da20e8e9130..a8e1c91085beb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27,7 +27,7 @@ dependencies: tunnel "^0.0.6" -"@ampproject/remapping@^2.1.0": +"@ampproject/remapping@^2.2.0": version "2.2.0" resolved "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz#56c133824780de3174aed5ab6834f3026790154d" integrity sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w== @@ -35,25 +35,25 @@ "@jridgewell/gen-mapping" "^0.1.0" "@jridgewell/trace-mapping" "^0.3.9" -"@aws-cdk/asset-awscli-v1@^2.2.69": - version "2.2.69" - resolved "https://registry.npmjs.org/@aws-cdk/asset-awscli-v1/-/asset-awscli-v1-2.2.69.tgz#8b896adbad686fc8924018dc4a2d81dcea1868d4" - integrity sha512-sKhINBDXKc9cad+4ghBsn6nB63ci7KcO7Vb2FswBI36Z7lkaIkz51pPwmVWn8AsYNOvCpcaCxUx0zngCbQOluQ== +"@aws-cdk/asset-awscli-v1@^2.2.85": + version "2.2.85" + resolved "https://registry.npmjs.org/@aws-cdk/asset-awscli-v1/-/asset-awscli-v1-2.2.85.tgz#3671dc4de44f243571a806d651697bb4f49d06c1" + integrity sha512-oNX4HMupi2+/blbUNctA8WIwyqFTLOGhGDB+gginMSy7QHevLWb/duMlwa7Np4wpiHeiBDMF/ccc5Mfb352srg== "@aws-cdk/asset-kubectl-v20@^2.1.1": version "2.1.1" resolved "https://registry.npmjs.org/@aws-cdk/asset-kubectl-v20/-/asset-kubectl-v20-2.1.1.tgz#d01c1efb867fb7f2cfd8c8b230b8eae16447e156" integrity sha512-U1ntiX8XiMRRRH5J1IdC+1t5CE89015cwyt5U63Cpk0GnMlN5+h9WsWMlKlPXZR4rdq/m806JRlBMRpBUB2Dhw== -"@aws-cdk/asset-node-proxy-agent-v5@^2.0.58": - version "2.0.58" - resolved "https://registry.npmjs.org/@aws-cdk/asset-node-proxy-agent-v5/-/asset-node-proxy-agent-v5-2.0.58.tgz#1a8de9fd628306d9a7e93de1b06a0ed424e89502" - integrity sha512-7BTzPo1tBw1tTYEmWNO0nS+bTJ/Ikg2qpFQZBb0GedEJ1v713IyRoySlKADAXAaMPJU9Gg05LCuJy+cs7RUDMQ== +"@aws-cdk/asset-node-proxy-agent-v5@^2.0.71": + version "2.0.71" + resolved "https://registry.npmjs.org/@aws-cdk/asset-node-proxy-agent-v5/-/asset-node-proxy-agent-v5-2.0.71.tgz#dd269f8aa160473e006633d2f0f5384f46747693" + integrity sha512-vB/KF9naAYkELP6Hi5+Oib59B4ZAz6jjtrpsKNzsIZTmcTs0IIBb4nVdAuwMpMkPcwT0mzhMg2tlsiSyjrOFBA== -"@aws-cdk/lambda-layer-kubectl-v24@^2.0.100": - version "2.0.100" - resolved "https://registry.npmjs.org/@aws-cdk/lambda-layer-kubectl-v24/-/lambda-layer-kubectl-v24-2.0.100.tgz#c4450e7985f16e048c1041525fa1146866d93eee" - integrity sha512-14svXKODfjR9K8uuVXS8raqtfCLXI6dEUWvBQafiq72GJ33vTycoa3rHalYgj0CLS+pXMERSyUT2NiBDNBG8iA== +"@aws-cdk/lambda-layer-kubectl-v24@^2.0.113": + version "2.0.113" + resolved "https://registry.npmjs.org/@aws-cdk/lambda-layer-kubectl-v24/-/lambda-layer-kubectl-v24-2.0.113.tgz#7b22497eb41bd88cfdea73a34c398721514b72c6" + integrity sha512-8mn6/5s/EDxmQP1cnoIAYqGwHmUl+Jimbnut/7Jhz6MzvmkDU9olpem1W6bESmrI6RFTX/1UABz+jaYthmqlXA== "@babel/code-frame@7.12.11": version "7.12.11" @@ -70,38 +70,39 @@ "@babel/highlight" "^7.18.6" "@babel/compat-data@^7.20.5": - version "7.20.14" - resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.20.14.tgz#4106fc8b755f3e3ee0a0a7c27dde5de1d2b2baf8" - integrity sha512-0YpKHD6ImkWMEINCyDAD0HLLUH/lPCefG8ld9it8DJB2wnApraKuhgYTvTY1z7UFIfBTGy5LwncZ+5HWWGbhFw== + version "7.21.0" + resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.21.0.tgz#c241dc454e5b5917e40d37e525e2f4530c399298" + integrity sha512-gMuZsmsgxk/ENC3O/fRw5QY8A9/uxQbbCEypnLIiYYc/qVJtEV7ouxC3EllIIwNzMqAQee5tanFabWsUOutS7g== "@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.7.2", "@babel/core@^7.7.5", "@babel/core@^7.8.0": - version "7.20.12" - resolved "https://registry.npmjs.org/@babel/core/-/core-7.20.12.tgz#7930db57443c6714ad216953d1356dac0eb8496d" - integrity sha512-XsMfHovsUYHFMdrIHkZphTN/2Hzzi78R08NuHfDBehym2VsPDL6Zn/JAD/JQdnRvbSsbQc4mVaU1m6JgtTEElg== + version "7.21.0" + resolved "https://registry.npmjs.org/@babel/core/-/core-7.21.0.tgz#1341aefdcc14ccc7553fcc688dd8986a2daffc13" + integrity sha512-PuxUbxcW6ZYe656yL3EAhpy7qXKq0DmYsrJLpbB8XrsCP9Nm+XCg9XFMb5vIDliPD7+U/+M+QJlH17XOcB7eXA== dependencies: - "@ampproject/remapping" "^2.1.0" + "@ampproject/remapping" "^2.2.0" "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.20.7" + "@babel/generator" "^7.21.0" "@babel/helper-compilation-targets" "^7.20.7" - "@babel/helper-module-transforms" "^7.20.11" - "@babel/helpers" "^7.20.7" - "@babel/parser" "^7.20.7" + "@babel/helper-module-transforms" "^7.21.0" + "@babel/helpers" "^7.21.0" + "@babel/parser" "^7.21.0" "@babel/template" "^7.20.7" - "@babel/traverse" "^7.20.12" - "@babel/types" "^7.20.7" + "@babel/traverse" "^7.21.0" + "@babel/types" "^7.21.0" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.2" semver "^6.3.0" -"@babel/generator@^7.20.7", "@babel/generator@^7.7.2": - version "7.20.14" - resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.20.14.tgz#9fa772c9f86a46c6ac9b321039400712b96f64ce" - integrity sha512-AEmuXHdcD3A52HHXxaTmYlb8q/xMEhoRP67B3T4Oq7lbmSoqroMZzjnGj3+i1io3pdnF8iBYVu4Ilj+c4hBxYg== +"@babel/generator@^7.21.0", "@babel/generator@^7.21.1", "@babel/generator@^7.7.2": + version "7.21.1" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.21.1.tgz#951cc626057bc0af2c35cd23e9c64d384dea83dd" + integrity sha512-1lT45bAYlQhFn/BHivJs43AiW2rg3/UbLyShGfF3C0KmHvO5fSghWd5kBJy30kpRRucGzXStvnnCFniCR2kXAA== dependencies: - "@babel/types" "^7.20.7" + "@babel/types" "^7.21.0" "@jridgewell/gen-mapping" "^0.3.2" + "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" "@babel/helper-compilation-targets@^7.20.7": @@ -120,13 +121,13 @@ resolved "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz#0c0cee9b35d2ca190478756865bb3528422f51be" integrity sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg== -"@babel/helper-function-name@^7.19.0": - version "7.19.0" - resolved "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz#941574ed5390682e872e52d3f38ce9d1bef4648c" - integrity sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w== +"@babel/helper-function-name@^7.21.0": + version "7.21.0" + resolved "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz#d552829b10ea9f120969304023cd0645fa00b1b4" + integrity sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg== dependencies: - "@babel/template" "^7.18.10" - "@babel/types" "^7.19.0" + "@babel/template" "^7.20.7" + "@babel/types" "^7.21.0" "@babel/helper-hoist-variables@^7.18.6": version "7.18.6" @@ -142,10 +143,10 @@ dependencies: "@babel/types" "^7.18.6" -"@babel/helper-module-transforms@^7.20.11": - version "7.20.11" - resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.20.11.tgz#df4c7af713c557938c50ea3ad0117a7944b2f1b0" - integrity sha512-uRy78kN4psmji1s2QtbtcCSaj/LILFDp0f/ymhpQH5QY3nljUZCaNWz9X1dEj/8MBdBEFECs7yRhKn8i7NjZgg== +"@babel/helper-module-transforms@^7.21.0": + version "7.21.2" + resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.21.2.tgz#160caafa4978ac8c00ac66636cb0fa37b024e2d2" + integrity sha512-79yj2AR4U/Oqq/WOV7Lx6hUjau1Zfo4cI+JLAVYeMV5XIlbOhmjEk5ulbTc9fMpmlojzZHkUUxAiK+UKn+hNQQ== dependencies: "@babel/helper-environment-visitor" "^7.18.9" "@babel/helper-module-imports" "^7.18.6" @@ -153,8 +154,8 @@ "@babel/helper-split-export-declaration" "^7.18.6" "@babel/helper-validator-identifier" "^7.19.1" "@babel/template" "^7.20.7" - "@babel/traverse" "^7.20.10" - "@babel/types" "^7.20.7" + "@babel/traverse" "^7.21.2" + "@babel/types" "^7.21.2" "@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.14.5", "@babel/helper-plugin-utils@^7.19.0", "@babel/helper-plugin-utils@^7.8.0": version "7.20.2" @@ -186,18 +187,18 @@ integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== "@babel/helper-validator-option@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz#bf0d2b5a509b1f336099e4ff36e1a63aa5db4db8" - integrity sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw== + version "7.21.0" + resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.21.0.tgz#8224c7e13ace4bafdc4004da2cf064ef42673180" + integrity sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ== -"@babel/helpers@^7.20.7": - version "7.20.13" - resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.20.13.tgz#e3cb731fb70dc5337134cadc24cbbad31cc87ad2" - integrity sha512-nzJ0DWCL3gB5RCXbUO3KIMMsBY2Eqbx8mBpKGE/02PgyRQFcPQLbkQ1vyy596mZLaP+dAfD+R4ckASzNVmW3jg== +"@babel/helpers@^7.21.0": + version "7.21.0" + resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.21.0.tgz#9dd184fb5599862037917cdc9eecb84577dc4e7e" + integrity sha512-XXve0CBtOW0pd7MRzzmoyuSj0e3SEzj8pgyFxnTT1NJZL38BD1MK7yYrm8yefRPIDvNNe14xR4FdbHwpInD4rA== dependencies: "@babel/template" "^7.20.7" - "@babel/traverse" "^7.20.13" - "@babel/types" "^7.20.7" + "@babel/traverse" "^7.21.0" + "@babel/types" "^7.21.0" "@babel/highlight@^7.10.4", "@babel/highlight@^7.18.6": version "7.18.6" @@ -208,10 +209,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.13", "@babel/parser@^7.20.7": - version "7.20.15" - resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.20.15.tgz#eec9f36d8eaf0948bb88c87a46784b5ee9fd0c89" - integrity sha512-DI4a1oZuf8wC+oAJA9RW6ga3Zbe8RZFt7kD9i4qAspz3I/yHet1VvC3DiSy/fsUvv5pvJuNPh0LPOdCcqinDPg== +"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.21.0", "@babel/parser@^7.21.2": + version "7.21.2" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.21.2.tgz#dacafadfc6d7654c3051a66d6fe55b6cb2f2a0b3" + integrity sha512-URpaIJQwEkEC2T9Kn+Ai6Xe/02iNaVCuT/PtoRz3GPVJVDpPd7mLo+VddTbhCRU9TXqW5mSrQfXZyi8kDKOVpQ== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -304,7 +305,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.19.0" -"@babel/template@^7.18.10", "@babel/template@^7.20.7", "@babel/template@^7.3.3": +"@babel/template@^7.20.7", "@babel/template@^7.3.3": version "7.20.7" resolved "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz#a15090c2839a83b02aa996c0b4994005841fd5a8" integrity sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw== @@ -313,26 +314,26 @@ "@babel/parser" "^7.20.7" "@babel/types" "^7.20.7" -"@babel/traverse@^7.20.10", "@babel/traverse@^7.20.12", "@babel/traverse@^7.20.13", "@babel/traverse@^7.7.2": - version "7.20.13" - resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.13.tgz#817c1ba13d11accca89478bd5481b2d168d07473" - integrity sha512-kMJXfF0T6DIS9E8cgdLCSAL+cuCK+YEZHWiLK0SXpTo8YRj5lpJu3CDNKiIBCne4m9hhTIqUg6SYTAI39tAiVQ== +"@babel/traverse@^7.21.0", "@babel/traverse@^7.21.2", "@babel/traverse@^7.7.2": + version "7.21.2" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.21.2.tgz#ac7e1f27658750892e815e60ae90f382a46d8e75" + integrity sha512-ts5FFU/dSUPS13tv8XiEObDu9K+iagEKME9kAbaP7r0Y9KtZJZ+NGndDvWoRAYNpeWafbpFeki3q9QoMD6gxyw== dependencies: "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.20.7" + "@babel/generator" "^7.21.1" "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.19.0" + "@babel/helper-function-name" "^7.21.0" "@babel/helper-hoist-variables" "^7.18.6" "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.20.13" - "@babel/types" "^7.20.7" + "@babel/parser" "^7.21.2" + "@babel/types" "^7.21.2" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.18.6", "@babel/types@^7.19.0", "@babel/types@^7.20.2", "@babel/types@^7.20.7", "@babel/types@^7.3.0", "@babel/types@^7.3.3": - version "7.20.7" - resolved "https://registry.npmjs.org/@babel/types/-/types-7.20.7.tgz#54ec75e252318423fc07fb644dc6a58a64c09b7f" - integrity sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg== +"@babel/types@^7.0.0", "@babel/types@^7.18.6", "@babel/types@^7.20.2", "@babel/types@^7.20.7", "@babel/types@^7.21.0", "@babel/types@^7.21.2", "@babel/types@^7.3.0", "@babel/types@^7.3.3": + version "7.21.2" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.21.2.tgz#92246f6e00f91755893c2876ad653db70c8310d1" + integrity sha512-3wRZSs7jiFaB8AjxiiD+VqN5DTG2iRvJGQ+qYFrs/654lg6kGTQWIOFjlBo5RaXuAZjBmP3+OQH4dmhqiiyYxw== dependencies: "@babel/helper-string-parser" "^7.19.4" "@babel/helper-validator-identifier" "^7.19.1" @@ -360,115 +361,115 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@esbuild/android-arm64@0.17.8": - version "0.17.8" - resolved "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.8.tgz#b3d5b65a3b2e073a6c7ee36b1f3c30c8f000315b" - integrity sha512-oa/N5j6v1svZQs7EIRPqR8f+Bf8g6HBDjD/xHC02radE/NjKHK7oQmtmLxPs1iVwYyvE+Kolo6lbpfEQ9xnhxQ== - -"@esbuild/android-arm@0.17.8": - version "0.17.8" - resolved "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.8.tgz#c41e496af541e175369d48164d0cf01a5f656cf6" - integrity sha512-0/rb91GYKhrtbeglJXOhAv9RuYimgI8h623TplY2X+vA4EXnk3Zj1fXZreJ0J3OJJu1bwmb0W7g+2cT/d8/l/w== - -"@esbuild/android-x64@0.17.8": - version "0.17.8" - resolved "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.8.tgz#080fa67c29be77f5a3ca5ee4cc78d5bf927e3a3b" - integrity sha512-bTliMLqD7pTOoPg4zZkXqCDuzIUguEWLpeqkNfC41ODBHwoUgZ2w5JBeYimv4oP6TDVocoYmEhZrCLQTrH89bg== - -"@esbuild/darwin-arm64@0.17.8": - version "0.17.8" - resolved "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.8.tgz#053622bf9a82f43d5c075b7818e02618f7b4a397" - integrity sha512-ghAbV3ia2zybEefXRRm7+lx8J/rnupZT0gp9CaGy/3iolEXkJ6LYRq4IpQVI9zR97ID80KJVoUlo3LSeA/sMAg== - -"@esbuild/darwin-x64@0.17.8": - version "0.17.8" - resolved "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.8.tgz#8a1aadb358d537d8efad817bb1a5bff91b84734b" - integrity sha512-n5WOpyvZ9TIdv2V1K3/iIkkJeKmUpKaCTdun9buhGRWfH//osmUjlv4Z5mmWdPWind/VGcVxTHtLfLCOohsOXw== - -"@esbuild/freebsd-arm64@0.17.8": - version "0.17.8" - resolved "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.8.tgz#e6738d0081ba0721a5c6c674e84c6e7fcea61989" - integrity sha512-a/SATTaOhPIPFWvHZDoZYgxaZRVHn0/LX1fHLGfZ6C13JqFUZ3K6SMD6/HCtwOQ8HnsNaEeokdiDSFLuizqv5A== - -"@esbuild/freebsd-x64@0.17.8": - version "0.17.8" - resolved "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.8.tgz#1855e562f2b730f4483f6e94086e9e2597feb4c3" - integrity sha512-xpFJb08dfXr5+rZc4E+ooZmayBW6R3q59daCpKZ/cDU96/kvDM+vkYzNeTJCGd8rtO6fHWMq5Rcv/1cY6p6/0Q== - -"@esbuild/linux-arm64@0.17.8": - version "0.17.8" - resolved "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.8.tgz#481da38952721a3fdb77c17a36ceaacc4270b5c5" - integrity sha512-v3iwDQuDljLTxpsqQDl3fl/yihjPAyOguxuloON9kFHYwopeJEf1BkDXODzYyXEI19gisEsQlG1bM65YqKSIww== - -"@esbuild/linux-arm@0.17.8": - version "0.17.8" - resolved "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.8.tgz#18127072b270bb6321c6d11be20bfd30e0d6ad17" - integrity sha512-6Ij8gfuGszcEwZpi5jQIJCVIACLS8Tz2chnEBfYjlmMzVsfqBP1iGmHQPp7JSnZg5xxK9tjCc+pJ2WtAmPRFVA== - -"@esbuild/linux-ia32@0.17.8": - version "0.17.8" - resolved "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.8.tgz#ee400af7b3bc69e8ca2e593ca35156ffb9abd54f" - integrity sha512-8svILYKhE5XetuFk/B6raFYIyIqydQi+GngEXJgdPdI7OMKUbSd7uzR02wSY4kb53xBrClLkhH4Xs8P61Q2BaA== - -"@esbuild/linux-loong64@0.17.8": - version "0.17.8" - resolved "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.8.tgz#8c509d8a454693d39824b83b3f66c400872fce82" - integrity sha512-B6FyMeRJeV0NpyEOYlm5qtQfxbdlgmiGdD+QsipzKfFky0K5HW5Td6dyK3L3ypu1eY4kOmo7wW0o94SBqlqBSA== - -"@esbuild/linux-mips64el@0.17.8": - version "0.17.8" - resolved "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.8.tgz#f2b0d36e63fb26bc3f95b203b6a80638292101ca" - integrity sha512-CCb67RKahNobjm/eeEqeD/oJfJlrWyw29fgiyB6vcgyq97YAf3gCOuP6qMShYSPXgnlZe/i4a8WFHBw6N8bYAA== - -"@esbuild/linux-ppc64@0.17.8": - version "0.17.8" - resolved "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.8.tgz#1e628be003e036e90423716028cc884fe5ba25bd" - integrity sha512-bytLJOi55y55+mGSdgwZ5qBm0K9WOCh0rx+vavVPx+gqLLhxtSFU0XbeYy/dsAAD6xECGEv4IQeFILaSS2auXw== - -"@esbuild/linux-riscv64@0.17.8": - version "0.17.8" - resolved "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.8.tgz#419a815cb4c3fb9f1b78ef5295f5b48b8bf6427a" - integrity sha512-2YpRyQJmKVBEHSBLa8kBAtbhucaclb6ex4wchfY0Tj3Kg39kpjeJ9vhRU7x4mUpq8ISLXRXH1L0dBYjAeqzZAw== - -"@esbuild/linux-s390x@0.17.8": - version "0.17.8" - resolved "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.8.tgz#291c49ae5c3d11d226352755c0835911fe1a9e5c" - integrity sha512-QgbNY/V3IFXvNf11SS6exkpVcX0LJcob+0RWCgV9OiDAmVElnxciHIisoSix9uzYzScPmS6dJFbZULdSAEkQVw== - -"@esbuild/linux-x64@0.17.8": - version "0.17.8" - resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.8.tgz#03199d91c76faf80bd54104f5cbf0a489bc39f6a" - integrity sha512-mM/9S0SbAFDBc4OPoyP6SEOo5324LpUxdpeIUUSrSTOfhHU9hEfqRngmKgqILqwx/0DVJBzeNW7HmLEWp9vcOA== - -"@esbuild/netbsd-x64@0.17.8": - version "0.17.8" - resolved "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.8.tgz#b436d767e1b21852f9ed212e2bb57f77203b0ae2" - integrity sha512-eKUYcWaWTaYr9zbj8GertdVtlt1DTS1gNBWov+iQfWuWyuu59YN6gSEJvFzC5ESJ4kMcKR0uqWThKUn5o8We6Q== - -"@esbuild/openbsd-x64@0.17.8": - version "0.17.8" - resolved "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.8.tgz#d1481d8539e21d4729cd04a0450a26c2c8789e89" - integrity sha512-Vc9J4dXOboDyMXKD0eCeW0SIeEzr8K9oTHJU+Ci1mZc5njPfhKAqkRt3B/fUNU7dP+mRyralPu8QUkiaQn7iIg== - -"@esbuild/sunos-x64@0.17.8": - version "0.17.8" - resolved "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.8.tgz#2cfb8126e079b2c00fd1bf095541e9f5c47877e4" - integrity sha512-0xvOTNuPXI7ft1LYUgiaXtpCEjp90RuBBYovdd2lqAFxje4sEucurg30M1WIm03+3jxByd3mfo+VUmPtRSVuOw== - -"@esbuild/win32-arm64@0.17.8": - version "0.17.8" - resolved "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.8.tgz#7c6ecfd097ca23b82119753bf7072bbaefe51e3a" - integrity sha512-G0JQwUI5WdEFEnYNKzklxtBheCPkuDdu1YrtRrjuQv30WsYbkkoixKxLLv8qhJmNI+ATEWquZe/N0d0rpr55Mg== - -"@esbuild/win32-ia32@0.17.8": - version "0.17.8" - resolved "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.8.tgz#cffec63c3cb0ef8563a04df4e09fa71056171d00" - integrity sha512-Fqy63515xl20OHGFykjJsMnoIWS+38fqfg88ClvPXyDbLtgXal2DTlhb1TfTX34qWi3u4I7Cq563QcHpqgLx8w== - -"@esbuild/win32-x64@0.17.8": - version "0.17.8" - resolved "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.8.tgz#200a0965cf654ac28b971358ecdca9cc5b44c335" - integrity sha512-1iuezdyDNngPnz8rLRDO2C/ZZ/emJLb72OsZeqQ6gL6Avko/XCXZw+NuxBSNhBAP13Hie418V7VMt9et1FMvpg== +"@esbuild/android-arm64@0.17.10": + version "0.17.10" + resolved "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.10.tgz#ad2ee47dd021035abdfb0c38848ff77a1e1918c4" + integrity sha512-ht1P9CmvrPF5yKDtyC+z43RczVs4rrHpRqrmIuoSvSdn44Fs1n6DGlpZKdK6rM83pFLbVaSUwle8IN+TPmkv7g== + +"@esbuild/android-arm@0.17.10": + version "0.17.10" + resolved "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.10.tgz#bb5a68af8adeb94b30eadee7307404dc5237d076" + integrity sha512-7YEBfZ5lSem9Tqpsz+tjbdsEshlO9j/REJrfv4DXgKTt1+/MHqGwbtlyxQuaSlMeUZLxUKBaX8wdzlTfHkmnLw== + +"@esbuild/android-x64@0.17.10": + version "0.17.10" + resolved "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.10.tgz#751d5d8ae9ece1efa9627b689c888eb85b102360" + integrity sha512-CYzrm+hTiY5QICji64aJ/xKdN70IK8XZ6iiyq0tZkd3tfnwwSWTYH1t3m6zyaaBxkuj40kxgMyj1km/NqdjQZA== + +"@esbuild/darwin-arm64@0.17.10": + version "0.17.10" + resolved "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.10.tgz#85601ee7efb2129cd3218d5bcbe8da1173bc1e8b" + integrity sha512-3HaGIowI+nMZlopqyW6+jxYr01KvNaLB5znXfbyyjuo4lE0VZfvFGcguIJapQeQMS4cX/NEispwOekJt3gr5Dg== + +"@esbuild/darwin-x64@0.17.10": + version "0.17.10" + resolved "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.10.tgz#362c7e988c61fe72d5edef4f717e4b4fc728da98" + integrity sha512-J4MJzGchuCRG5n+B4EHpAMoJmBeAE1L3wGYDIN5oWNqX0tEr7VKOzw0ymSwpoeSpdCa030lagGUfnfhS7OvzrQ== + +"@esbuild/freebsd-arm64@0.17.10": + version "0.17.10" + resolved "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.10.tgz#e8a85a46ede7c3a048a12f16b9d551d25adc8bb1" + integrity sha512-ZkX40Z7qCbugeK4U5/gbzna/UQkM9d9LNV+Fro8r7HA7sRof5Rwxc46SsqeMvB5ZaR0b1/ITQ/8Y1NmV2F0fXQ== + +"@esbuild/freebsd-x64@0.17.10": + version "0.17.10" + resolved "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.10.tgz#cd0a1b68bffbcb5b65e65b3fd542e8c7c3edd86b" + integrity sha512-0m0YX1IWSLG9hWh7tZa3kdAugFbZFFx9XrvfpaCMMvrswSTvUZypp0NFKriUurHpBA3xsHVE9Qb/0u2Bbi/otg== + +"@esbuild/linux-arm64@0.17.10": + version "0.17.10" + resolved "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.10.tgz#13b183f432512ed9d9281cc89476caeebe9e9123" + integrity sha512-g1EZJR1/c+MmCgVwpdZdKi4QAJ8DCLP5uTgLWSAVd9wlqk9GMscaNMEViG3aE1wS+cNMzXXgdWiW/VX4J+5nTA== + +"@esbuild/linux-arm@0.17.10": + version "0.17.10" + resolved "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.10.tgz#dd11e0a5faa3ea94dc80278a601c3be7b4fdf1da" + integrity sha512-whRdrrl0X+9D6o5f0sTZtDM9s86Xt4wk1bf7ltx6iQqrIIOH+sre1yjpcCdrVXntQPCNw/G+XqsD4HuxeS+2QA== + +"@esbuild/linux-ia32@0.17.10": + version "0.17.10" + resolved "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.10.tgz#4d836f87b92807d9292379963c4888270d282405" + integrity sha512-1vKYCjfv/bEwxngHERp7huYfJ4jJzldfxyfaF7hc3216xiDA62xbXJfRlradiMhGZbdNLj2WA1YwYFzs9IWNPw== + +"@esbuild/linux-loong64@0.17.10": + version "0.17.10" + resolved "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.10.tgz#92eb2ee200c17ef12c7fb3b648231948699e7a4c" + integrity sha512-mvwAr75q3Fgc/qz3K6sya3gBmJIYZCgcJ0s7XshpoqIAIBszzfXsqhpRrRdVFAyV1G9VUjj7VopL2HnAS8aHFA== + +"@esbuild/linux-mips64el@0.17.10": + version "0.17.10" + resolved "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.10.tgz#14f7d50c40fe7f7ee545a9bd07c6f6e4cba5570e" + integrity sha512-XilKPgM2u1zR1YuvCsFQWl9Fc35BqSqktooumOY2zj7CSn5czJn279j9TE1JEqSqz88izJo7yE4x3LSf7oxHzg== + +"@esbuild/linux-ppc64@0.17.10": + version "0.17.10" + resolved "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.10.tgz#1ab5802e93ae511ce9783e1cb95f37df0f84c4af" + integrity sha512-kM4Rmh9l670SwjlGkIe7pYWezk8uxKHX4Lnn5jBZYBNlWpKMBCVfpAgAJqp5doLobhzF3l64VZVrmGeZ8+uKmQ== + +"@esbuild/linux-riscv64@0.17.10": + version "0.17.10" + resolved "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.10.tgz#4fae25201ef7ad868731d16c8b50b0e386c4774a" + integrity sha512-r1m9ZMNJBtOvYYGQVXKy+WvWd0BPvSxMsVq8Hp4GzdMBQvfZRvRr5TtX/1RdN6Va8JMVQGpxqde3O+e8+khNJQ== + +"@esbuild/linux-s390x@0.17.10": + version "0.17.10" + resolved "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.10.tgz#126254d8335bb3586918b1ca60beb4abb46e6d54" + integrity sha512-LsY7QvOLPw9WRJ+fU5pNB3qrSfA00u32ND5JVDrn/xG5hIQo3kvTxSlWFRP0NJ0+n6HmhPGG0Q4jtQsb6PFoyg== + +"@esbuild/linux-x64@0.17.10": + version "0.17.10" + resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.10.tgz#7fa4667b2df81ea0538e1b75e607cf04e526ce91" + integrity sha512-zJUfJLebCYzBdIz/Z9vqwFjIA7iSlLCFvVi7glMgnu2MK7XYigwsonXshy9wP9S7szF+nmwrelNaP3WGanstEg== + +"@esbuild/netbsd-x64@0.17.10": + version "0.17.10" + resolved "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.10.tgz#2d24727ddc2305619685bf237a46d6087a02ee9a" + integrity sha512-lOMkailn4Ok9Vbp/q7uJfgicpDTbZFlXlnKT2DqC8uBijmm5oGtXAJy2ZZVo5hX7IOVXikV9LpCMj2U8cTguWA== + +"@esbuild/openbsd-x64@0.17.10": + version "0.17.10" + resolved "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.10.tgz#bf3fc38ee6ecf028c1f0cfe11f61d53cc75fef12" + integrity sha512-/VE0Kx6y7eekqZ+ZLU4AjMlB80ov9tEz4H067Y0STwnGOYL8CsNg4J+cCmBznk1tMpxMoUOf0AbWlb1d2Pkbig== + +"@esbuild/sunos-x64@0.17.10": + version "0.17.10" + resolved "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.10.tgz#8deabd6dfec6256f80bb101bc59d29dbae99c69b" + integrity sha512-ERNO0838OUm8HfUjjsEs71cLjLMu/xt6bhOlxcJ0/1MG3hNqCmbWaS+w/8nFLa0DDjbwZQuGKVtCUJliLmbVgg== + +"@esbuild/win32-arm64@0.17.10": + version "0.17.10" + resolved "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.10.tgz#1ec1ee04c788c4c57a83370b6abf79587b3e4965" + integrity sha512-fXv+L+Bw2AeK+XJHwDAQ9m3NRlNemG6Z6ijLwJAAVdu4cyoFbBWbEtyZzDeL+rpG2lWI51cXeMt70HA8g2MqIg== + +"@esbuild/win32-ia32@0.17.10": + version "0.17.10" + resolved "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.10.tgz#a362528d7f3ad5d44fa8710a96764677ef92ebe9" + integrity sha512-3s+HADrOdCdGOi5lnh5DMQEzgbsFsd4w57L/eLKKjMnN0CN4AIEP0DCP3F3N14xnxh3ruNc32A0Na9zYe1Z/AQ== + +"@esbuild/win32-x64@0.17.10": + version "0.17.10" + resolved "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.10.tgz#ac779220f2da96afd480fb3f3148a292f66e7fc3" + integrity sha512-oP+zFUjYNaMNmjTwlFtWep85hvwUu19cZklB3QsBOcZSs6y7hmH4LNCJ7075bsqzYaNvZFXJlAVaQ2ApITDXtw== "@eslint/eslintrc@^0.4.3": version "0.4.3" @@ -485,10 +486,10 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" -"@eslint/eslintrc@^1.4.1": - version "1.4.1" - resolved "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz#af58772019a2d271b7e2d4c23ff4ddcba3ccfb3e" - integrity sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA== +"@eslint/eslintrc@^2.0.0": + version "2.0.0" + resolved "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.0.tgz#943309d8697c52fc82c076e90c1c74fbbe69dbff" + integrity sha512-fluIaaV+GyV24CCu/ggiHdV+j4RNh85yQnAYS/G2mZODZgGmmlrgCydjUcV3YvxCm9x8nMAfThsqTni4KiXT4A== dependencies: ajv "^6.12.4" debug "^4.3.2" @@ -500,6 +501,11 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" +"@eslint/js@8.35.0": + version "8.35.0" + resolved "https://registry.npmjs.org/@eslint/js/-/js-8.35.0.tgz#b7569632b0b788a0ca0e438235154e45d42813a7" + integrity sha512-JXdzbRiWclLVoD8sNUjR443VVlYqiYmDVT6rGUEIEHU5YJW0gaVZwV2xgM7D4arkvASqD0IlLUVjHiFuxaftRw== + "@gar/promisify@^1.0.1", "@gar/promisify@^1.1.3": version "1.1.3" resolved "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6" @@ -773,7 +779,7 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@jridgewell/trace-mapping@^0.3.9": +"@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.9": version "0.3.17" resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz#793041277af9073b0951a7fe0f0d8c4c98c36985" integrity sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g== @@ -781,18 +787,18 @@ "@jridgewell/resolve-uri" "3.1.0" "@jridgewell/sourcemap-codec" "1.4.14" -"@jsii/check-node@1.75.0": - version "1.75.0" - resolved "https://registry.npmjs.org/@jsii/check-node/-/check-node-1.75.0.tgz#1cfc2ab5b461c1e80d9a4c18a6e351a9a13287ce" - integrity sha512-ODorfPJwN0920DJrZ/R/G3x0UHgtuhz9y10s6Xox1BDobVXOQpfUl3XEQjrTrSE7kiCt2FxZvazT4xu1MU0y6Q== +"@jsii/check-node@1.76.0": + version "1.76.0" + resolved "https://registry.npmjs.org/@jsii/check-node/-/check-node-1.76.0.tgz#3fcb41e916ae8bfba1fca0cbdc406fe0e0b2c7f5" + integrity sha512-iAQohlms0FQNtmAsXOV9Rrd7QDikkLw68R2TPwhlVKuLPdHPKIK3gyeN0jqZzc0luNQ9h+3P7kSqfpKd+Kr79Q== dependencies: chalk "^4.1.2" semver "^7.3.8" -"@jsii/spec@1.75.0", "@jsii/spec@^1.75.0": - version "1.75.0" - resolved "https://registry.npmjs.org/@jsii/spec/-/spec-1.75.0.tgz#d15a8fe7764e3d39e727e944452168de35fc2ec3" - integrity sha512-aUF5364qgJRCco1C5HBjkDDBGuHZv0uqD5/IXZ2+3A7P/RXdxJdVup0iMGAWKSAx3yPImgyqgD+JxpAnw06YYg== +"@jsii/spec@1.76.0", "@jsii/spec@^1.76.0": + version "1.76.0" + resolved "https://registry.npmjs.org/@jsii/spec/-/spec-1.76.0.tgz#9323aec77f4e0a3ec7c68a5c257b0841f5ad0731" + integrity sha512-7L8KeG44ECq0ulKYWaOr0FQvnFW7RavjxEGvMAdKfIOXb5mZyGERnj5pKl5kmq2m1lWE2VBZELoTfM7dDlAPtg== dependencies: ajv "^8.12.0" @@ -1966,10 +1972,10 @@ dependencies: "@types/glob" "*" -"@types/aws-lambda@^8.10.110": - version "8.10.110" - resolved "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.110.tgz#32a1f9d40b855d69830243492bbb6408098f4c88" - integrity sha512-r6egf2Cwv/JaFTTrF9OXFVUB3j/SXTgM9BwrlbBRjWAa2Tu6GWoDoLflppAZ8uSfbUJdXvC7Br3DjuN9pQ2NUQ== +"@types/aws-lambda@^8.10.111": + version "8.10.111" + resolved "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.111.tgz#9107c405f3011a5c423b5ac93fbf279439558571" + integrity sha512-8HR9UjIKmoemEzE2BviVtFkeenxfbizSu8raFjnT2VXxguZZ2JTlNww7INOH7IA0J/zRa3TjOftkYq6hVNkxDA== "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14": version "7.20.0" @@ -2037,9 +2043,9 @@ "@types/node" "*" "@types/glob@*": - version "8.0.1" - resolved "https://registry.npmjs.org/@types/glob/-/glob-8.0.1.tgz#6e3041640148b7764adf21ce5c7138ad454725b0" - integrity sha512-8bVUjXZvJacUFkJXHdyZ9iH1Eaj5V7I8c4NdH5sQJsdXkqT4CA5Dhb4yb4VE/3asyx4L9ayZr1NIhTsWHczmMw== + version "8.1.0" + resolved "https://registry.npmjs.org/@types/glob/-/glob-8.1.0.tgz#b63e70155391b0584dce44e7ea25190bbc38f2fc" + integrity sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w== dependencies: "@types/minimatch" "^5.1.2" "@types/node" "*" @@ -2151,9 +2157,9 @@ integrity sha512-uv53RrNdhbkV/3VmVCtfImfYCWC3GTTRn3R11Whni3EJ+gb178tkZBVNj2edLY5CMrB749dQi+SJkg87jsN8UQ== "@types/node@*": - version "18.13.0" - resolved "https://registry.npmjs.org/@types/node/-/node-18.13.0.tgz#0400d1e6ce87e9d3032c19eb6c58205b0d3f7850" - integrity sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg== + version "18.14.2" + resolved "https://registry.npmjs.org/@types/node/-/node-18.14.2.tgz#c076ed1d7b6095078ad3cf21dfeea951842778b1" + integrity sha512-1uEQxww3DaghA0RxqHx0O0ppVlo43pJhepY51OxuQIKHpjbnYLA7vcdwioNPzIqmC2u3I/dmylcqjlh0e7AyUA== "@types/node@18.11.19": version "18.11.19" @@ -2161,9 +2167,9 @@ integrity sha512-YUgMWAQBWLObABqrvx8qKO1enAvBUdjZOAWQ5grBAkp5LQv45jBvYKZ3oFS9iKRCQyFjqw6iuEa1vmFqtxYLZw== "@types/node@^16.9.2": - version "16.18.12" - resolved "https://registry.npmjs.org/@types/node/-/node-16.18.12.tgz#e3bfea80e31523fde4292a6118f19ffa24fd6f65" - integrity sha512-vzLe5NaNMjIE3mcddFVGlAXN1LEWueUsMsOJWaT6wWMJGyljHAWHznqfnKUQWGzu7TLPrGvWdNAsvQYW+C0xtw== + version "16.18.13" + resolved "https://registry.npmjs.org/@types/node/-/node-16.18.13.tgz#c572f8837094c6e3b73918a68674c784f6877fc0" + integrity sha512-l0/3XZ153UTlNOnZK8xSNoJlQda9/WnYgiTdcKKPJSZjdjI9MU+A9oMXOesAWLSnqAaaJhj3qfQsU07Dr8OUwg== "@types/normalize-package-data@^2.4.0": version "2.4.1" @@ -2322,13 +2328,13 @@ tsutils "^3.21.0" "@typescript-eslint/eslint-plugin@^5": - version "5.52.0" - resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.52.0.tgz#5fb0d43574c2411f16ea80f5fc335b8eaa7b28a8" - integrity sha512-lHazYdvYVsBokwCdKOppvYJKaJ4S41CgKBcPvyd0xjZNbvQdhn/pnJlGtQksQ/NhInzdaeaSarlBjDXHuclEbg== + version "5.54.0" + resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.54.0.tgz#2c821ad81b2c786d142279a8292090f77d1881f4" + integrity sha512-+hSN9BdSr629RF02d7mMtXhAJvDTyCbprNYJKrXETlul/Aml6YZwd90XioVbjejQeHbb3R8Dg0CkRgoJDxo8aw== dependencies: - "@typescript-eslint/scope-manager" "5.52.0" - "@typescript-eslint/type-utils" "5.52.0" - "@typescript-eslint/utils" "5.52.0" + "@typescript-eslint/scope-manager" "5.54.0" + "@typescript-eslint/type-utils" "5.54.0" + "@typescript-eslint/utils" "5.54.0" debug "^4.3.4" grapheme-splitter "^1.0.4" ignore "^5.2.0" @@ -2360,13 +2366,13 @@ debug "^4.3.1" "@typescript-eslint/parser@^5": - version "5.52.0" - resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.52.0.tgz#73c136df6c0133f1d7870de7131ccf356f5be5a4" - integrity sha512-e2KiLQOZRo4Y0D/b+3y08i3jsekoSkOYStROYmPUnGMEoA0h+k2qOH5H6tcjIc68WDvGwH+PaOrP1XRzLJ6QlA== + version "5.54.0" + resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.54.0.tgz#def186eb1b1dbd0439df0dacc44fb6d8d5c417fe" + integrity sha512-aAVL3Mu2qTi+h/r04WI/5PfNWvO6pdhpeMRWk9R7rEV4mwJNzoWf5CCU5vDKBsPIFQFjEq1xg7XBI2rjiMXQbQ== dependencies: - "@typescript-eslint/scope-manager" "5.52.0" - "@typescript-eslint/types" "5.52.0" - "@typescript-eslint/typescript-estree" "5.52.0" + "@typescript-eslint/scope-manager" "5.54.0" + "@typescript-eslint/types" "5.54.0" + "@typescript-eslint/typescript-estree" "5.54.0" debug "^4.3.4" "@typescript-eslint/scope-manager@4.33.0": @@ -2377,21 +2383,21 @@ "@typescript-eslint/types" "4.33.0" "@typescript-eslint/visitor-keys" "4.33.0" -"@typescript-eslint/scope-manager@5.52.0": - version "5.52.0" - resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.52.0.tgz#a993d89a0556ea16811db48eabd7c5b72dcb83d1" - integrity sha512-AR7sxxfBKiNV0FWBSARxM8DmNxrwgnYMPwmpkC1Pl1n+eT8/I2NAUPuwDy/FmDcC6F8pBfmOcaxcxRHspgOBMw== +"@typescript-eslint/scope-manager@5.54.0": + version "5.54.0" + resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.54.0.tgz#74b28ac9a3fc8166f04e806c957adb8c1fd00536" + integrity sha512-VTPYNZ7vaWtYna9M4oD42zENOBrb+ZYyCNdFs949GcN8Miwn37b8b7eMj+EZaq7VK9fx0Jd+JhmkhjFhvnovhg== dependencies: - "@typescript-eslint/types" "5.52.0" - "@typescript-eslint/visitor-keys" "5.52.0" + "@typescript-eslint/types" "5.54.0" + "@typescript-eslint/visitor-keys" "5.54.0" -"@typescript-eslint/type-utils@5.52.0": - version "5.52.0" - resolved "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.52.0.tgz#9fd28cd02e6f21f5109e35496df41893f33167aa" - integrity sha512-tEKuUHfDOv852QGlpPtB3lHOoig5pyFQN/cUiZtpw99D93nEBjexRLre5sQZlkMoHry/lZr8qDAt2oAHLKA6Jw== +"@typescript-eslint/type-utils@5.54.0": + version "5.54.0" + resolved "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.54.0.tgz#390717216eb61393a0cad2995da154b613ba7b26" + integrity sha512-WI+WMJ8+oS+LyflqsD4nlXMsVdzTMYTxl16myXPaCXnSgc7LWwMsjxQFZCK/rVmTZ3FN71Ct78ehO9bRC7erYQ== dependencies: - "@typescript-eslint/typescript-estree" "5.52.0" - "@typescript-eslint/utils" "5.52.0" + "@typescript-eslint/typescript-estree" "5.54.0" + "@typescript-eslint/utils" "5.54.0" debug "^4.3.4" tsutils "^3.21.0" @@ -2400,10 +2406,10 @@ resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72" integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ== -"@typescript-eslint/types@5.52.0": - version "5.52.0" - resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.52.0.tgz#19e9abc6afb5bd37a1a9bea877a1a836c0b3241b" - integrity sha512-oV7XU4CHYfBhk78fS7tkum+/Dpgsfi91IIDy7fjCyq2k6KB63M6gMC0YIvy+iABzmXThCRI6xpCEyVObBdWSDQ== +"@typescript-eslint/types@5.54.0": + version "5.54.0" + resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.54.0.tgz#7d519df01f50739254d89378e0dcac504cab2740" + integrity sha512-nExy+fDCBEgqblasfeE3aQ3NuafBUxZxgxXcYfzYRZFHdVvk5q60KhCSkG0noHgHRo/xQ/BOzURLZAafFpTkmQ== "@typescript-eslint/typescript-estree@4.33.0", "@typescript-eslint/typescript-estree@^4.33.0": version "4.33.0" @@ -2418,29 +2424,29 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/typescript-estree@5.52.0": - version "5.52.0" - resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.52.0.tgz#6408cb3c2ccc01c03c278cb201cf07e73347dfca" - integrity sha512-WeWnjanyEwt6+fVrSR0MYgEpUAuROxuAH516WPjUblIrClzYJj0kBbjdnbQXLpgAN8qbEuGywiQsXUVDiAoEuQ== +"@typescript-eslint/typescript-estree@5.54.0": + version "5.54.0" + resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.54.0.tgz#f6f3440cabee8a43a0b25fa498213ebb61fdfe99" + integrity sha512-X2rJG97Wj/VRo5YxJ8Qx26Zqf0RRKsVHd4sav8NElhbZzhpBI8jU54i6hfo9eheumj4oO4dcRN1B/zIVEqR/MQ== dependencies: - "@typescript-eslint/types" "5.52.0" - "@typescript-eslint/visitor-keys" "5.52.0" + "@typescript-eslint/types" "5.54.0" + "@typescript-eslint/visitor-keys" "5.54.0" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.52.0": - version "5.52.0" - resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.52.0.tgz#b260bb5a8f6b00a0ed51db66bdba4ed5e4845a72" - integrity sha512-As3lChhrbwWQLNk2HC8Ree96hldKIqk98EYvypd3It8Q1f8d5zWyIoaZEp2va5667M4ZyE7X8UUR+azXrFl+NA== +"@typescript-eslint/utils@5.54.0": + version "5.54.0" + resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.54.0.tgz#3db758aae078be7b54b8ea8ea4537ff6cd3fbc21" + integrity sha512-cuwm8D/Z/7AuyAeJ+T0r4WZmlnlxQ8wt7C7fLpFlKMR+dY6QO79Cq1WpJhvZbMA4ZeZGHiRWnht7ZJ8qkdAunw== dependencies: "@types/json-schema" "^7.0.9" "@types/semver" "^7.3.12" - "@typescript-eslint/scope-manager" "5.52.0" - "@typescript-eslint/types" "5.52.0" - "@typescript-eslint/typescript-estree" "5.52.0" + "@typescript-eslint/scope-manager" "5.54.0" + "@typescript-eslint/types" "5.54.0" + "@typescript-eslint/typescript-estree" "5.54.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" semver "^7.3.7" @@ -2453,12 +2459,12 @@ "@typescript-eslint/types" "4.33.0" eslint-visitor-keys "^2.0.0" -"@typescript-eslint/visitor-keys@5.52.0": - version "5.52.0" - resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.52.0.tgz#e38c971259f44f80cfe49d97dbffa38e3e75030f" - integrity sha512-qMwpw6SU5VHCPr99y274xhbm+PRViK/NATY6qzt+Et7+mThGuFSl/ompj2/hrBlRP/kq+BFdgagnOSgw9TB0eA== +"@typescript-eslint/visitor-keys@5.54.0": + version "5.54.0" + resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.54.0.tgz#846878afbf0cd67c19cfa8d75947383d4490db8f" + integrity sha512-xu4wT7aRCakGINTLGeyGqDn+78BwFlggwBjnHa1ar/KaGagnmwLYmlrXIrgAaQ3AE1Vd6nLfKASm7LrFHNbKGA== dependencies: - "@typescript-eslint/types" "5.52.0" + "@typescript-eslint/types" "5.54.0" eslint-visitor-keys "^3.3.0" "@xmldom/xmldom@^0.8.6": @@ -2881,10 +2887,10 @@ aws-sdk-mock@5.6.0: sinon "^11.1.1" traverse "^0.6.6" -aws-sdk@^2.1317.0, aws-sdk@^2.928.0: - version "2.1317.0" - resolved "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1317.0.tgz#b1534696b840654a55660eed467ed7ddbbb2e1d1" - integrity sha512-9gQ3ApcG4OhM19LEcmd/1jclwHvI3jjVaFYNQkY88g2eFJDW5T8qP+u2epdv+o3bPWxzg0TcyPhOSlN4xAnIJQ== +aws-sdk@^2.1325.0, aws-sdk@^2.928.0: + version "2.1325.0" + resolved "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1325.0.tgz#4529ede089ee8db79d6eb04ab46a211bfddbbe5b" + integrity sha512-ztg9HG5aoUHTprY+/eqjqb25E4joCgz+8ToxsP4OSKFQCtaBcF6my03j4e/J2j3fmpPifJnZSPMu4kV7DBj8WA== dependencies: buffer "4.9.2" events "1.1.1" @@ -3252,9 +3258,9 @@ camelcase@^6.2.0, camelcase@^6.3.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001449: - version "1.0.30001453" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001453.tgz#6d3a1501622bf424a3cee5ad9550e640b0de3de8" - integrity sha512-R9o/uySW38VViaTrOtwfbFEiBFUh7ST3uIG4OEymIG3/uKdHDO4xk/FaqfUw0d+irSUyFPy3dZszf9VvSTPnsA== + version "1.0.30001458" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001458.tgz#871e35866b4654a7d25eccca86864f411825540c" + integrity sha512-lQ1VlUUq5q9ro9X+5gOEyH7i3vm+AYVT1WDCVB69XOZ17KZRhnZ9J0Sqz7wTHQaLBJccNCHq8/Ww5LlOIZbB0w== case@1.6.3, case@^1.6.3: version "1.6.3" @@ -3266,29 +3272,29 @@ caseless@~0.12.0: resolved "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw== -cdk-generate-synthetic-examples@^0.1.155: - version "0.1.155" - resolved "https://registry.npmjs.org/cdk-generate-synthetic-examples/-/cdk-generate-synthetic-examples-0.1.155.tgz#a2f72783d8255eff983a2501c5249e6bf068c5e0" - integrity sha512-Ml9Pga/f8IYbRcKXeeqyMP4uc9yYcbQ/jBzpwYb4a074TXMsrjKvpqiU7r4O0x74yxAZntPpjteDFxy6GoSncg== +cdk-generate-synthetic-examples@^0.1.167: + version "0.1.167" + resolved "https://registry.npmjs.org/cdk-generate-synthetic-examples/-/cdk-generate-synthetic-examples-0.1.167.tgz#1fba547e4cab09b914c0cf36e72d618cedbf8df3" + integrity sha512-rjSRrw1fzalETc1tI5pm8aytdnuaqa6/oDD/r2fsSPzWzoOtV8W+TCNx4/BkPgZxaKJwwURpUAx7Jl8R12eZWg== dependencies: - "@jsii/spec" "^1.75.0" + "@jsii/spec" "^1.76.0" fs-extra "^10.1.0" - jsii "^1.75.0" - jsii-reflect "^1.75.0" - jsii-rosetta "^1.75.0" - yargs "^17.6.2" + jsii "^1.76.0" + jsii-reflect "^1.76.0" + jsii-rosetta "^1.76.0" + yargs "^17.7.1" -cdk8s-plus-24@2.4.23: - version "2.4.23" - resolved "https://registry.npmjs.org/cdk8s-plus-24/-/cdk8s-plus-24-2.4.23.tgz#dd3f49a6d4c2dac637a820b567b80e17e829799c" - integrity sha512-hPNSo6UQUa/wSo44IRqcoMVVzhEgweuRFSvE5TNMaYlDjwsXG+4u8XYV+5qIocZPli+epYqejgev2zleafTh9g== +cdk8s-plus-24@2.4.40: + version "2.4.40" + resolved "https://registry.npmjs.org/cdk8s-plus-24/-/cdk8s-plus-24-2.4.40.tgz#f27c4c5f0adf20ec58294ac7452fdbe3bcb64a9a" + integrity sha512-vDs1Q1XJ1cVg9ap/onOPEC4QRhuCMIHod7TeeQqO8v6I1bB2W9sZc52aLBEc4u9yEuI7/pP2t1rL9m+obcITvw== dependencies: minimatch "^3.1.2" -cdk8s@^2.7.2: - version "2.7.2" - resolved "https://registry.npmjs.org/cdk8s/-/cdk8s-2.7.2.tgz#64ead388fcba5ff08ff920fa52d65e8dfac3ad95" - integrity sha512-ID5oKvKGSh5OjSCC6tzoZDgyepcPgzVshqdgEO+1gwaO+ep/UNBaDYmFbCTU8EPwjdEdOwq2VFTkmoJTu9/r7g== +cdk8s@^2.7.15: + version "2.7.15" + resolved "https://registry.npmjs.org/cdk8s/-/cdk8s-2.7.15.tgz#f7d40a17e5ce662208d2713e02a1902593d1caa0" + integrity sha512-bQIYHUas23SnjSso1ajZdzs0uKY76jisv41KhdL0RMaG+kvHZ5U6WqbKgwMfocPB9DDKxl+k00emn/g5Eh+Nvg== dependencies: fast-json-patch "^3.1.1" follow-redirects "^1.15.2" @@ -3520,10 +3526,10 @@ co@^4.6.0: resolved "https://registry.npmjs.org/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== -codemaker@1.75.0, codemaker@^1.75.0: - version "1.75.0" - resolved "https://registry.npmjs.org/codemaker/-/codemaker-1.75.0.tgz#a54953cf590cb43629c364f62aaf53a7693fc031" - integrity sha512-HGZQMJb+IXlGD5MJj6Ae2IXzkd4aoIufj/OfM0HxpJnldWx5rlzBjzgpI+YcK1RdaLm3HWMNDtTLti0qMsHtSA== +codemaker@1.76.0, codemaker@^1.76.0: + version "1.76.0" + resolved "https://registry.npmjs.org/codemaker/-/codemaker-1.76.0.tgz#28a2c517ee53bdcfb02030c82520f669db6e5286" + integrity sha512-EqnBOOiEV+kjyRghA5Z0TX22VnVH2Mgo2diOSYelcmntlTSiQkZimGof6jxE5j1buzjEVBK1d1W7bhRKYGegUg== dependencies: camelcase "^6.3.0" decamelize "^5.0.1" @@ -3693,9 +3699,9 @@ console-control-strings@^1.0.0, console-control-strings@^1.1.0, console-control- integrity sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ== constructs@^10.0.0: - version "10.1.252" - resolved "https://registry.npmjs.org/constructs/-/constructs-10.1.252.tgz#a241329ffc50451b6de4fb9147ef32b0e181a515" - integrity sha512-8j3bcoSTlIjbCu1tflWHvipVDWmllUNu3dEWb5GXvsXCiYuH0NtXCCN5q6GmFInDcspZp8WOYu66uqQ8Bk7jzQ== + version "10.1.264" + resolved "https://registry.npmjs.org/constructs/-/constructs-10.1.264.tgz#84d418b582e6938b998d67e493a6db49011277bc" + integrity sha512-f9db+zgEV9xiIhmHxBuxNU2DjmnIQkM5M4IyLvjP+pBtS3r+PflQFwdZlDuy3K84NMnSaI4J/Sz5i5aNgwmDAg== conventional-changelog-angular@^5.0.12: version "5.0.13" @@ -4408,9 +4414,9 @@ ecc-jsbn@~0.1.1: safer-buffer "^2.1.0" electron-to-chromium@^1.4.284: - version "1.4.300" - resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.300.tgz#37097e9bcdef687fb98abb5184434bdb958dfcd9" - integrity sha512-tHLIBkKaxvG6NnDWuLgeYrz+LTwAnApHm2R3KBNcRrFn0qLmTrqQeB4X4atfN6YJbkOOOSdRBeQ89OfFUelnEQ== + version "1.4.314" + resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.314.tgz#33e4ad7a2ca2ddbe2e113874cc0c0e2a00cb46bf" + integrity sha512-+3RmNVx9hZLlc0gW//4yep0K5SYKmIvB5DXg1Yg6varsuAHlHwTeqeygfS8DWwLCsNOWrgj+p9qgM5WYjw1lXQ== emittery@^0.8.1: version "0.8.1" @@ -4593,33 +4599,33 @@ es6-weak-map@^2.0.3: es6-iterator "^2.0.3" es6-symbol "^3.1.1" -esbuild@^0.17.8: - version "0.17.8" - resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.17.8.tgz#f7f799abc7cdce3f0f2e3e0c01f120d4d55193b4" - integrity sha512-g24ybC3fWhZddZK6R3uD2iF/RIPnRpwJAqLov6ouX3hMbY4+tKolP0VMF3zuIYCaXun+yHwS5IPQ91N2BT191g== +esbuild@^0.17.10: + version "0.17.10" + resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.17.10.tgz#3be050561b34c5dc05b46978f4e1f326d5cc9437" + integrity sha512-n7V3v29IuZy5qgxx25TKJrEm0FHghAlS6QweUcyIgh/U0zYmQcvogWROitrTyZId1mHSkuhhuyEXtI9OXioq7A== optionalDependencies: - "@esbuild/android-arm" "0.17.8" - "@esbuild/android-arm64" "0.17.8" - "@esbuild/android-x64" "0.17.8" - "@esbuild/darwin-arm64" "0.17.8" - "@esbuild/darwin-x64" "0.17.8" - "@esbuild/freebsd-arm64" "0.17.8" - "@esbuild/freebsd-x64" "0.17.8" - "@esbuild/linux-arm" "0.17.8" - "@esbuild/linux-arm64" "0.17.8" - "@esbuild/linux-ia32" "0.17.8" - "@esbuild/linux-loong64" "0.17.8" - "@esbuild/linux-mips64el" "0.17.8" - "@esbuild/linux-ppc64" "0.17.8" - "@esbuild/linux-riscv64" "0.17.8" - "@esbuild/linux-s390x" "0.17.8" - "@esbuild/linux-x64" "0.17.8" - "@esbuild/netbsd-x64" "0.17.8" - "@esbuild/openbsd-x64" "0.17.8" - "@esbuild/sunos-x64" "0.17.8" - "@esbuild/win32-arm64" "0.17.8" - "@esbuild/win32-ia32" "0.17.8" - "@esbuild/win32-x64" "0.17.8" + "@esbuild/android-arm" "0.17.10" + "@esbuild/android-arm64" "0.17.10" + "@esbuild/android-x64" "0.17.10" + "@esbuild/darwin-arm64" "0.17.10" + "@esbuild/darwin-x64" "0.17.10" + "@esbuild/freebsd-arm64" "0.17.10" + "@esbuild/freebsd-x64" "0.17.10" + "@esbuild/linux-arm" "0.17.10" + "@esbuild/linux-arm64" "0.17.10" + "@esbuild/linux-ia32" "0.17.10" + "@esbuild/linux-loong64" "0.17.10" + "@esbuild/linux-mips64el" "0.17.10" + "@esbuild/linux-ppc64" "0.17.10" + "@esbuild/linux-riscv64" "0.17.10" + "@esbuild/linux-s390x" "0.17.10" + "@esbuild/linux-x64" "0.17.10" + "@esbuild/netbsd-x64" "0.17.10" + "@esbuild/openbsd-x64" "0.17.10" + "@esbuild/sunos-x64" "0.17.10" + "@esbuild/win32-arm64" "0.17.10" + "@esbuild/win32-ia32" "0.17.10" + "@esbuild/win32-x64" "0.17.10" escalade@^3.1.1: version "3.1.1" @@ -4852,11 +4858,12 @@ eslint@^7.32.0: v8-compile-cache "^2.0.3" eslint@^8: - version "8.34.0" - resolved "https://registry.npmjs.org/eslint/-/eslint-8.34.0.tgz#fe0ab0ef478104c1f9ebc5537e303d25a8fb22d6" - integrity sha512-1Z8iFsucw+7kSqXNZVslXS8Ioa4u2KM7GPwuKtkTFAqZ/cHMcEaR+1+Br0wLlot49cNxIiZk5wp8EAbPcYZxTg== + version "8.35.0" + resolved "https://registry.npmjs.org/eslint/-/eslint-8.35.0.tgz#fffad7c7e326bae606f0e8f436a6158566d42323" + integrity sha512-BxAf1fVL7w+JLRQhWl2pzGeSiGqbWumV4WNvc9Rhp6tiCtm4oHnyPBSEtMGZwrQgudFQ+otqzWoPB7x+hxoWsw== dependencies: - "@eslint/eslintrc" "^1.4.1" + "@eslint/eslintrc" "^2.0.0" + "@eslint/js" "8.35.0" "@humanwhocodes/config-array" "^0.11.8" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" @@ -4870,7 +4877,7 @@ eslint@^8: eslint-utils "^3.0.0" eslint-visitor-keys "^3.3.0" espree "^9.4.0" - esquery "^1.4.0" + esquery "^1.4.2" esutils "^2.0.2" fast-deep-equal "^3.1.3" file-entry-cache "^6.0.1" @@ -4919,7 +4926,7 @@ esprima@^4.0.0, esprima@^4.0.1: resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== -esquery@^1.4.0: +esquery@^1.4.0, esquery@^1.4.2: version "1.4.2" resolved "https://registry.npmjs.org/esquery/-/esquery-1.4.2.tgz#c6d3fee05dd665808e2ad870631f221f5617b1d1" integrity sha512-JVSoLdTlTDkmjFmab7H/9SL9qGSyjElT3myyKp7krqjVFQCDLmj1QFaCLRFBszBKI0XVZaiiXvuPIX3ZwHe1Ng== @@ -7009,73 +7016,90 @@ jsesc@^2.5.1: resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== -jsii-diff@1.75.0: - version "1.75.0" - resolved "https://registry.npmjs.org/jsii-diff/-/jsii-diff-1.75.0.tgz#d4b02e8ed16aa07e0ac618fa90792ff99d5e73f0" - integrity sha512-4MRc2ikiTHs3kKMFjcvwSeLjDMTRVQ5+ImgU8+NvfdmMANkP7DG6tbKotZy6Jz2/Afnu2PtSKXlnLBKHNMFmfg== +jsii-diff@1.76.0: + version "1.76.0" + resolved "https://registry.npmjs.org/jsii-diff/-/jsii-diff-1.76.0.tgz#8aba54481e1ac7dcd7e2c592d1ef11defe244b2a" + integrity sha512-i3U753ae5WzaiGLJV8ZFTu9rlGQGVuSJADCHxteP2UuHuFSWRSPY2iMhtyg7tEoQmdNYjPznM7fesqrDHLxBOg== dependencies: - "@jsii/check-node" "1.75.0" - "@jsii/spec" "^1.75.0" + "@jsii/check-node" "1.76.0" + "@jsii/spec" "^1.76.0" fs-extra "^10.1.0" - jsii-reflect "^1.75.0" + jsii-reflect "^1.76.0" log4js "^6.7.1" yargs "^16.2.0" -jsii-pacmak@1.75.0: - version "1.75.0" - resolved "https://registry.npmjs.org/jsii-pacmak/-/jsii-pacmak-1.75.0.tgz#2ecba3c95d587003c763ee8fc7516d30997cbabf" - integrity sha512-ENH5nNwMjN4CIK9D5mJ8OHDjiwInzQItQQmGwCdPJFLlUN9+9EkhYy2gEPVYPwh7e294c2nJ55DmiOj2CWR17g== +jsii-pacmak@1.76.0: + version "1.76.0" + resolved "https://registry.npmjs.org/jsii-pacmak/-/jsii-pacmak-1.76.0.tgz#e0d95bc20f757f7b067dc545587bc38795611b09" + integrity sha512-70h0puIRpDeDyYk/jLxQk7vPbg3w3ppJRATlF0qPntMk/WnSo4uvr8hlz1BmRzOOvQ7JqXBuNOaVd+bp7Xolbw== dependencies: - "@jsii/check-node" "1.75.0" - "@jsii/spec" "^1.75.0" + "@jsii/check-node" "1.76.0" + "@jsii/spec" "^1.76.0" clone "^2.1.2" - codemaker "^1.75.0" + codemaker "^1.76.0" commonmark "^0.30.0" escape-string-regexp "^4.0.0" fs-extra "^10.1.0" - jsii-reflect "^1.75.0" - jsii-rosetta "^1.75.0" + jsii-reflect "^1.76.0" + jsii-rosetta "^1.76.0" semver "^7.3.8" spdx-license-list "^6.6.0" xmlbuilder "^15.1.1" yargs "^16.2.0" -jsii-reflect@1.75.0, jsii-reflect@^1.75.0: - version "1.75.0" - resolved "https://registry.npmjs.org/jsii-reflect/-/jsii-reflect-1.75.0.tgz#136564eb8ec9a94a9fe218e3d275e80196cd6285" - integrity sha512-oB8X2MpLZbpl8T7XfD+jSADLjzhEMnCZH8BSY3hxSH8TGdhMUZriFHFgmz1NshkZXDh0zRz+xF2a8+uqEIKRYw== +jsii-reflect@1.76.0, jsii-reflect@^1.76.0: + version "1.76.0" + resolved "https://registry.npmjs.org/jsii-reflect/-/jsii-reflect-1.76.0.tgz#a80ab48f9bea9f1ad4212e8b2057eb0ae325e1e0" + integrity sha512-voS5WyeitP3o0knus00v00NlxVLbaU9ykvEDamFw5KPEc4z4wvAwDG9wBfNmdO1OulXgID41WhMzJOEJFKle6A== dependencies: - "@jsii/check-node" "1.75.0" - "@jsii/spec" "^1.75.0" + "@jsii/check-node" "1.76.0" + "@jsii/spec" "^1.76.0" chalk "^4" fs-extra "^10.1.0" - oo-ascii-tree "^1.75.0" + oo-ascii-tree "^1.76.0" yargs "^16.2.0" -jsii-rosetta@1.75.0, jsii-rosetta@^1.75.0: - version "1.75.0" - resolved "https://registry.npmjs.org/jsii-rosetta/-/jsii-rosetta-1.75.0.tgz#85a96669fc60f69d29409608a694ed063abcadd9" - integrity sha512-zsV8F0BoXTvS46N1/QCwapMXamQhJKFaAIapFBWk0a4l84v+FSYOWnKbgZz+FVZEuu3VBJpxg6uKE9R9A8Hvag== +jsii-rosetta@^1.76.0: + version "1.76.0" + resolved "https://registry.npmjs.org/jsii-rosetta/-/jsii-rosetta-1.76.0.tgz#450256361bdbb0d6d5524c4817a7b345d9647a57" + integrity sha512-y3OcYebjMdK/4Yxt8P9tMalK9Szmq8Xc4VXD3kGDIEulMjUxo3TpEUZc9WEfzVu6A+lSl/WRAwV50ZgzQyVWZg== dependencies: - "@jsii/check-node" "1.75.0" - "@jsii/spec" "1.75.0" + "@jsii/check-node" "1.76.0" + "@jsii/spec" "1.76.0" "@xmldom/xmldom" "^0.8.6" commonmark "^0.30.0" fast-glob "^3.2.12" - jsii "1.75.0" + jsii "1.76.0" semver "^7.3.8" semver-intersect "^1.4.0" typescript "~3.9.10" workerpool "^6.3.1" yargs "^16.2.0" -jsii@1.75.0, jsii@^1.75.0: - version "1.75.0" - resolved "https://registry.npmjs.org/jsii/-/jsii-1.75.0.tgz#e18fc8cb3ad985da93fb1513fc1e4d8ca191ff98" - integrity sha512-9CWt2IQcM6v5k4XZnaSnsK9epfIJfHWMyB69uOjITZpwYjF0CDzLrh/a8l1RyC3COSpp1K1yTjaebHEivyVr4Q== +jsii-rosetta@v4.9-next: + version "4.9.0-dev.2" + resolved "https://registry.npmjs.org/jsii-rosetta/-/jsii-rosetta-4.9.0-dev.2.tgz#2f08066badc532b7716f44c4af99584d4d904472" + integrity sha512-4SjSIJcujNmettnwXgsQN6BA9hZRdWqkqTPtJfg9C5Jz2dUa2fOZL4+GglAaR/z4hVUL4nNi0rY4IhOQ3l1s0A== + dependencies: + "@jsii/check-node" "1.76.0" + "@jsii/spec" "^1.76.0" + "@xmldom/xmldom" "^0.8.6" + commonmark "^0.30.0" + fast-glob "^3.2.12" + jsii v4.9-next + semver "^7.3.8" + semver-intersect "^1.4.0" + typescript "~4.9.5" + workerpool "^6.4.0" + yargs "^17.7.1" + +jsii@1.76.0, jsii@^1.76.0: + version "1.76.0" + resolved "https://registry.npmjs.org/jsii/-/jsii-1.76.0.tgz#b40c98108b1cac2cb86a5eb2b3f201ba52a316b6" + integrity sha512-IlQmxPPnscn2Va/cnnXRnQ7bnxEkO8ImKW0MBlEr66oqxhFQ9jy9+FWzOp/5kfHzhyyyM5mcqitB8O6fr1moIw== dependencies: - "@jsii/check-node" "1.75.0" - "@jsii/spec" "^1.75.0" + "@jsii/check-node" "1.76.0" + "@jsii/spec" "^1.76.0" case "^1.6.3" chalk "^4" fast-deep-equal "^3.1.3" @@ -7089,12 +7113,12 @@ jsii@1.75.0, jsii@^1.75.0: yargs "^16.2.0" jsii@v4.9-next: - version "4.9.0-dev.0" - resolved "https://registry.npmjs.org/jsii/-/jsii-4.9.0-dev.0.tgz#da1d4ce42879e718148e956a5a3ceeb0113377ac" - integrity sha512-otGy/z3jvUmn6GLQudPcpu5f8DhCZiA0RdS/tBbdEQCjdnWv/zrS6ZPbeeBaozuSdsJ/ni9jmQsWZIh6nz7vXA== + version "4.9.0-dev.1" + resolved "https://registry.npmjs.org/jsii/-/jsii-4.9.0-dev.1.tgz#3fcc0001a425f7cf933260b9b9dd999ca71739b6" + integrity sha512-1neCv7G/y9Ihku5ZEz2cDMuSNXpZYxNuTS1ycVXZ0ZhOVGn0+s0ghkOLj+Xecei3M0fBfZxlLiHSpw3xrJT/Mg== dependencies: - "@jsii/check-node" "1.75.0" - "@jsii/spec" "^1.75.0" + "@jsii/check-node" "1.76.0" + "@jsii/spec" "^1.76.0" case "^1.6.3" chalk "^4" downlevel-dts "^0.11.0" @@ -7173,7 +7197,7 @@ json5@2.x, json5@^2.2.2: resolved "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== -json5@^1.0.1: +json5@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA== @@ -7673,18 +7697,7 @@ log-symbols@^4.1.0: chalk "^4.1.0" is-unicode-supported "^0.1.0" -log4js@^6.7.1: - version "6.7.1" - resolved "https://registry.npmjs.org/log4js/-/log4js-6.7.1.tgz#06e12b1ac915dd1067146ffad8215f666f7d2c51" - integrity sha512-lzbd0Eq1HRdWM2abSD7mk6YIVY0AogGJzb/z+lqzRk+8+XJP+M6L1MS5FUSc3jjGru4dbKjEMJmqlsoYYpuivQ== - dependencies: - date-format "^4.0.14" - debug "^4.3.4" - flatted "^3.2.7" - rfdc "^1.3.0" - streamroller "^3.1.3" - -log4js@^6.8.0: +log4js@^6.7.1, log4js@^6.8.0: version "6.8.0" resolved "https://registry.npmjs.org/log4js/-/log4js-6.8.0.tgz#f0fe9b2b82725aaf97f20692e23381a5c5722448" integrity sha512-g+V8gZyurIexrOvWQ+AcZsIvuK/lBnx2argejZxL4gVZ4Hq02kUYH6WZOnqxgBml+zzQZYdaEoTN84B6Hzm8Fg== @@ -7720,9 +7733,9 @@ lru-cache@^6.0.0: yallist "^4.0.0" lru-cache@^7.4.4, lru-cache@^7.5.1, lru-cache@^7.7.1: - version "7.15.0" - resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-7.15.0.tgz#4437550407da5ec8c4fe0946a137fe2f7f07a171" - integrity sha512-LKpNuyKR1lRsqN5DatvMOkW2nmUAwI22HoQK604nhs+WiRWSIC0MFUKq2XYUKv1fCVPK9Cro4d4Il3DxM80/fQ== + version "7.18.1" + resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.1.tgz#4716408dec51d5d0104732647f584d1f6738b109" + integrity sha512-8/HcIENyQnfUTCDizRu9rrDyG6XG/21M4X7/YEGZeD76ZJilFPAUVb/2zysFf7VVO1LEjCDFyHp8pMMvozIrvg== lru-queue@^0.1.0: version "0.1.0" @@ -8003,9 +8016,9 @@ min-indent@^1.0.0: integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== minimatch@>=3.1: - version "6.2.0" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-6.2.0.tgz#2b70fd13294178c69c04dfc05aebdb97a4e79e42" - integrity sha512-sauLxniAmvnhhRjFwPNnJKaPFYyddAgbYdeUpHULtCT/GhzdCx/MDNy+Y40lBxTQUrMzDE8e0S43Z5uqfO0REg== + version "7.4.1" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-7.4.1.tgz#166705f9417985ba5149f2dbf2fa50c29832913b" + integrity sha512-Oz1iPEP+MGl7KS3SciLsLLcuZ7VsBfb7Qrz/jYt/s/sYAv272P26HSLz2f77Y6hzTKXiBi6g765fqpEDNc5fJw== dependencies: brace-expansion "^2.0.1" @@ -8111,9 +8124,9 @@ minipass@^3.0.0, minipass@^3.1.0, minipass@^3.1.1, minipass@^3.1.3, minipass@^3. yallist "^4.0.0" minipass@^4.0.0: - version "4.0.3" - resolved "https://registry.npmjs.org/minipass/-/minipass-4.0.3.tgz#00bfbaf1e16e35e804f4aa31a7c1f6b8d9f0ee72" - integrity sha512-OW2r4sQ0sI+z5ckEt5c1Tri4xTgZwYDxpE54eqWlQloQRoWtXjqt9udJ5Z4dSv7wK+nfFI7FRXyCpBSft+gpFw== + version "4.2.4" + resolved "https://registry.npmjs.org/minipass/-/minipass-4.2.4.tgz#7d0d97434b6a19f59c5c3221698b48bbf3b2cd06" + integrity sha512-lwycX3cBMTvcejsHITUgYj6Gy6A7Nh4Q6h9NP4sTHY1ccJlC7yKzDmiShEHsJ16Jf1nKGDEaiHxiltsJEvk0nQ== minizlib@^1.3.3: version "1.3.3" @@ -8847,10 +8860,10 @@ onetime@^5.1.0, onetime@^5.1.2: dependencies: mimic-fn "^2.1.0" -oo-ascii-tree@^1.75.0: - version "1.75.0" - resolved "https://registry.npmjs.org/oo-ascii-tree/-/oo-ascii-tree-1.75.0.tgz#966b2b373b6583fb5246e19b9ead534ca9afc72f" - integrity sha512-rM9YrFT0Zzes3nLF37sGJIlHIjLQpnEI17LcbioXw83oMHqdc8QW5pE9/IHkYlYRbN2Z+sRouSCkrXFZRai2Mg== +oo-ascii-tree@^1.76.0: + version "1.76.0" + resolved "https://registry.npmjs.org/oo-ascii-tree/-/oo-ascii-tree-1.76.0.tgz#776630f3e3df43a3a5082cbf23fa40e3ada808ab" + integrity sha512-I/me4GK6Dybc9lsPYZJdnd1OOFbbnZtfEIIizrbTuFx/v1if375Y59w9ol/TJ75MlSAKs4aHj7Xm+A4E0JitSw== open@^7.4.2: version "7.4.2" @@ -9445,10 +9458,10 @@ progress@^2.0.0, progress@^2.0.3: resolved "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== -projen@^0.67.57: - version "0.67.57" - resolved "https://registry.npmjs.org/projen/-/projen-0.67.57.tgz#9c5c546d18c961339fb00a49a556b22822686e39" - integrity sha512-0FGTllWD6tf9ZDgcjBnnbBJmUjtwMOOiZAu6oI4GwIqoySt7uyCTv6uG71OjyQPhsM6iXiLeBJVz57PSJu4g/g== +projen@^0.67.69: + version "0.67.69" + resolved "https://registry.npmjs.org/projen/-/projen-0.67.69.tgz#ec666e340395a3b429581a91733b6856d0602e86" + integrity sha512-F28eW4CZFQwsb93omeVfzAoK9hEajqrzBzKZCwIfKaEupAjqJ8KJkc29FW4MnI7tbZ0DzHg75u0yzzNtotaEXg== dependencies: "@iarna/toml" "^2.2.5" case "^1.6.3" @@ -9652,9 +9665,9 @@ quote-unquote@^1.0.0: integrity sha512-twwRO/ilhlG/FIgYeKGFqyHhoEhqgnKVkcmqMKi2r524gz3ZbDTcyFt38E9xjJI2vT+KbRNHVbnJ/e0I25Azwg== raw-body@^2.2.0: - version "2.5.1" - resolved "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857" - integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig== + version "2.5.2" + resolved "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a" + integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== dependencies: bytes "3.1.2" http-errors "2.0.0" @@ -9821,18 +9834,18 @@ readable-stream@1.1.x: string_decoder "~0.10.x" readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.6.0: - version "3.6.0" - resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" - integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== + version "3.6.1" + resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.1.tgz#f9f9b5f536920253b3d26e7660e7da4ccff9bb62" + integrity sha512-+rQmrWMYGA90yenhTYsLWAsLsqVC8osOw6PKE1HDYiO0gdPeKe/xDHNzIAIn4C91YQ6oenEhfYqqc1883qHbjQ== dependencies: inherits "^2.0.3" string_decoder "^1.1.1" util-deprecate "^1.0.1" readable-stream@^2.0.0, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@~2.3.6: - version "2.3.7" - resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" - integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== + version "2.3.8" + resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz#91125e8042bba1b9887f49345f6277027ce8be9b" + integrity sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA== dependencies: core-util-is "~1.0.0" inherits "~2.0.3" @@ -10565,7 +10578,7 @@ statuses@2.0.1: resolved "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== -streamroller@^3.1.3, streamroller@^3.1.5: +streamroller@^3.1.5: version "3.1.5" resolved "https://registry.npmjs.org/streamroller/-/streamroller-3.1.5.tgz#1263182329a45def1ffaef58d31b15d13d2ee7ff" integrity sha512-KFxaM7XT+irxvdqSP1LGLgNWbYN7ay5owZ3r/8t77p+EtSUAfUgtl7be3xtqtOmGUl9K9YPO2ca8133RlTjvKw== @@ -11040,12 +11053,12 @@ ts-node@^9.1.1: yn "3.1.1" tsconfig-paths@^3.10.1, tsconfig-paths@^3.14.1: - version "3.14.1" - resolved "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz#ba0734599e8ea36c862798e920bcf163277b137a" - integrity sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ== + version "3.14.2" + resolved "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz#6e32f1f79412decd261f92d633a9dc1cfa99f088" + integrity sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g== dependencies: "@types/json5" "^0.0.29" - json5 "^1.0.1" + json5 "^1.0.2" minimist "^1.2.6" strip-bom "^3.0.0" @@ -11188,9 +11201,9 @@ typescript@^4.5.5, typescript@~4.9.5: integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== typescript@next: - version "5.0.0-dev.20230222" - resolved "https://registry.npmjs.org/typescript/-/typescript-5.0.0-dev.20230222.tgz#58809d36b989d244ef037ae5f869f0fc233a952c" - integrity sha512-OCNanAIcGf3Uy1aBvLbPNe524MnDEZChefbzgo9gvEZPYNG7Zma1C6dXuOBSCapLgbLHksOTyoPwixKTbDkZPQ== + version "5.1.0-dev.20230301" + resolved "https://registry.npmjs.org/typescript/-/typescript-5.1.0-dev.20230301.tgz#3250b647dfd19942326bf904211350cdbbfdfe79" + integrity sha512-aJ0PIgQ00zlf9npD2tri7MWDAooMoh3iIn4v0hAMSRCSKqJjTzt7fVopvdtbvWPKripipxeXnX5mhkBZcGrEKQ== typescript@~3.8.3: version "3.8.3" @@ -11614,10 +11627,10 @@ wordwrap@>=0.0.2, wordwrap@^1.0.0: resolved "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== -workerpool@^6.3.1: - version "6.3.1" - resolved "https://registry.npmjs.org/workerpool/-/workerpool-6.3.1.tgz#80a9b76e70556acfb1457a3984f8637717f7cdee" - integrity sha512-0x7gJm1rhpn5SPG9NENOxPtbfUZZtK/qOg6gEdSqeDBA3dTeR91RJqSPjccPRCkhNfrnnl/dWxSSj5w9CtdzNA== +workerpool@^6.3.1, workerpool@^6.4.0: + version "6.4.0" + resolved "https://registry.npmjs.org/workerpool/-/workerpool-6.4.0.tgz#f8d5cfb45fde32fa3b7af72ad617c3369567a462" + integrity sha512-i3KR1mQMNwY2wx20ozq2EjISGtQWDIfV56We+yGJ5yDs8jTwQiLLaqHlkBHITlCuJnYlVRmXegxFxZg7gqI++A== wrap-ansi@^6.2.0: version "6.2.0" @@ -11866,20 +11879,7 @@ yargs@^16.0.0, yargs@^16.2.0: y18n "^5.0.5" yargs-parser "^20.2.2" -yargs@^17.1.1, yargs@^17.6.2, yargs@^17.7.0: - version "17.7.0" - resolved "https://registry.npmjs.org/yargs/-/yargs-17.7.0.tgz#b21e9af1e0a619a2a9c67b1133219b2975a07985" - integrity sha512-dwqOPg5trmrre9+v8SUo2q/hAwyKoVfu8OC1xPHKJGNdxAvPl4sKxL4vBnh3bQz/ZvvGAFeA5H3ou2kcOY8sQQ== - dependencies: - cliui "^8.0.1" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.3" - y18n "^5.0.5" - yargs-parser "^21.1.1" - -yargs@^17.7.1: +yargs@^17.1.1, yargs@^17.7.1: version "17.7.1" resolved "https://registry.npmjs.org/yargs/-/yargs-17.7.1.tgz#34a77645201d1a8fc5213ace787c220eabbd0967" integrity sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw==