From b36bc1146d06c7b9decface9f4ed9edeca61aa56 Mon Sep 17 00:00:00 2001 From: Raphael Manke Date: Tue, 6 Sep 2022 18:23:57 +0200 Subject: [PATCH 1/9] feat(lambda-event-sources): add kafka consumerGroupId support (#21791) This PR adds the capability to specify the consumerGroupId in the event-source-mapping when connection to Kafka. Adds the feature described in issue https://github.com/aws/aws-cdk/issues/21734 This features allows you to specify the consumerGroupId while connecting to a Kafka cluster. This feature was recently annouced https://aws.amazon.com/blogs/compute/using-custom-consumer-group-id-support-for-the-aws-lambda-event-sources-for-msk-and-self-managed-kafka/ and wasn't part of the cdk Kafka construct before. Things done: * Added missing attributes to class EventSourceMapping * amazonManagedKafkaEventSourceConfig * selfManagedKafkaEventSourceConfig * Added validation for the consumerGroupId value based in [CfnSpec](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-selfmanagedkafkaeventsourceconfig.html) * Added a common api `consumerGroupId` for adding the consumerGroupId independant if selfManaged or awsManaged * Updated existing integration test for SelfManagesKafkaConfig * The ManagedKafka Config is not integration tested because it requires a ManagedKafkaCluster which is not possible to deploy right now via cdk * Added Tests for consumerGroupId validation * Added Tests for template synth for SelfManagedKafka and AwsManagedKafka ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../aws-lambda-event-sources/README.md | 4 ++ .../aws-lambda-event-sources/lib/kafka.ts | 9 +++ .../test/integ.kafka-selfmanaged.ts | 1 + ...nt-source-kafka-self-managed.template.json | 3 + .../manifest.json | 5 +- .../tree.json | 3 + .../test/kafka.test.ts | 56 +++++++++++++++++++ .../aws-lambda/lib/event-source-mapping.ts | 30 ++++++++++ .../test/event-source-mapping.test.ts | 40 +++++++++++++ 9 files changed, 150 insertions(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-lambda-event-sources/README.md b/packages/@aws-cdk/aws-lambda-event-sources/README.md index c7143701ea422..dcd9eeb44958e 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/README.md +++ b/packages/@aws-cdk/aws-lambda-event-sources/README.md @@ -264,10 +264,14 @@ declare const secret: Secret; // (Optional) The secret containing the root CA certificate that your Kafka brokers use for TLS encryption declare const encryption: Secret; +// (Optional) The consumer group id to use when connecting to the Kafka broker. If omitted the UUID of the event source mapping will be used. +const consumerGroupId: "my-consumer-group-id"; + declare const myFunction: lambda.Function; myFunction.addEventSource(new SelfManagedKafkaEventSource({ bootstrapServers: bootstrapServers, topic: topic, + consumerGroupId: consumerGroupId, secret: secret, batchSize: 100, // default startingPosition: lambda.StartingPosition.TRIM_HORIZON, diff --git a/packages/@aws-cdk/aws-lambda-event-sources/lib/kafka.ts b/packages/@aws-cdk/aws-lambda-event-sources/lib/kafka.ts index 491c2011f071b..39acc9fd414a4 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/lib/kafka.ts +++ b/packages/@aws-cdk/aws-lambda-event-sources/lib/kafka.ts @@ -22,6 +22,13 @@ export interface KafkaEventSourceProps extends BaseStreamEventSourceProps { * @default none */ readonly secret?: secretsmanager.ISecret + /** + * The identifier for the Kafka consumer group to join. The consumer group ID must be unique among all your Kafka event sources. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value. The value must have a lenght between 1 and 200 and full the pattern '[a-zA-Z0-9-\/*:_+=.@-]*'. + * @see https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-consumer-group-id + * + * @default - none + */ + readonly consumerGroupId?: string; } /** @@ -125,6 +132,7 @@ export class ManagedKafkaEventSource extends StreamEventSource { startingPosition: this.innerProps.startingPosition, sourceAccessConfigurations: this.sourceAccessConfigurations(), kafkaTopic: this.innerProps.topic, + kafkaConsumerGroupId: this.innerProps.consumerGroupId, }), ); @@ -199,6 +207,7 @@ export class SelfManagedKafkaEventSource extends StreamEventSource { this.enrichMappingOptions({ kafkaBootstrapServers: this.innerProps.bootstrapServers, kafkaTopic: this.innerProps.topic, + kafkaConsumerGroupId: this.innerProps.consumerGroupId, startingPosition: this.innerProps.startingPosition, sourceAccessConfigurations: this.sourceAccessConfigurations(), }), diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/integ.kafka-selfmanaged.ts b/packages/@aws-cdk/aws-lambda-event-sources/test/integ.kafka-selfmanaged.ts index 8fa4532e80e16..eca822e362c6e 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/test/integ.kafka-selfmanaged.ts +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/integ.kafka-selfmanaged.ts @@ -48,6 +48,7 @@ zp2mwJn2NYB7AZ7+imp0azDZb+8YG2aUCiyqb6PnnA== new SelfManagedKafkaEventSource({ bootstrapServers, topic: 'my-test-topic', + consumerGroupId: 'myTestConsumerGroup', secret: clientCertificatesSecret, authenticationMethod: AuthenticationMethod.CLIENT_CERTIFICATE_TLS_AUTH, rootCACertificate: rootCASecret, diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/kafka-selfmanaged.integ.snapshot/lambda-event-source-kafka-self-managed.template.json b/packages/@aws-cdk/aws-lambda-event-sources/test/kafka-selfmanaged.integ.snapshot/lambda-event-source-kafka-self-managed.template.json index 498d118a948c0..0c9dd29d0fe28 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/test/kafka-selfmanaged.integ.snapshot/lambda-event-source-kafka-self-managed.template.json +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/kafka-selfmanaged.integ.snapshot/lambda-event-source-kafka-self-managed.template.json @@ -98,6 +98,9 @@ ] } }, + "SelfManagedKafkaEventSourceConfig": { + "ConsumerGroupId": "myTestConsumerGroup" + }, "SourceAccessConfigurations": [ { "Type": "CLIENT_CERTIFICATE_TLS_AUTH", diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/kafka-selfmanaged.integ.snapshot/manifest.json b/packages/@aws-cdk/aws-lambda-event-sources/test/kafka-selfmanaged.integ.snapshot/manifest.json index 33977182b934f..41a3e0e2372f3 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/test/kafka-selfmanaged.integ.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/kafka-selfmanaged.integ.snapshot/manifest.json @@ -60,7 +60,10 @@ "/lambda-event-source-kafka-self-managed/F/KafkaEventSource:838c4d5ff3c99c1a617120adfca83e5b:my-test-topic/Resource": [ { "type": "aws:cdk:logicalId", - "data": "FKafkaEventSource838c4d5ff3c99c1a617120adfca83e5bmytesttopic1E7A7798" + "data": "FKafkaEventSource838c4d5ff3c99c1a617120adfca83e5bmytesttopic1E7A7798", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" + ] } ], "/lambda-event-source-kafka-self-managed/S/Resource": [ diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/kafka-selfmanaged.integ.snapshot/tree.json b/packages/@aws-cdk/aws-lambda-event-sources/test/kafka-selfmanaged.integ.snapshot/tree.json index 7fbae658dd3ee..b1f236bc57cf9 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/test/kafka-selfmanaged.integ.snapshot/tree.json +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/kafka-selfmanaged.integ.snapshot/tree.json @@ -165,6 +165,9 @@ ] } }, + "selfManagedKafkaEventSourceConfig": { + "consumerGroupId": "myTestConsumerGroup" + }, "sourceAccessConfigurations": [ { "type": "CLIENT_CERTIFICATE_TLS_AUTH", diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/kafka.test.ts b/packages/@aws-cdk/aws-lambda-event-sources/test/kafka.test.ts index 3d0924e26de67..4688765ca1146 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/test/kafka.test.ts +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/kafka.test.ts @@ -634,6 +634,62 @@ describe('KafkaEventSource', () => { }); }); + test('consumerGroupId can be set for SelfManagedKafkaEventSource', () => { + // GIVEN + const stack = new cdk.Stack(); + const fn = new TestFunction(stack, 'Fn'); + const kafkaTopic = 'some-topic'; + const secret = new Secret(stack, 'Secret', { secretName: 'AmazonMSK_KafkaSecret' }); + const bootstrapServers = ['kafka-broker:9092']; + const consumerGroupId = 'my-consumer-group-id'; + const eventSourceMapping = new sources.SelfManagedKafkaEventSource( + { + bootstrapServers: bootstrapServers, + topic: kafkaTopic, + secret: secret, + startingPosition: lambda.StartingPosition.TRIM_HORIZON, + consumerGroupId: consumerGroupId, + }); + // WHEN + fn.addEventSource(eventSourceMapping); + + // THEN + const template = Template.fromStack(stack); + template.hasResourceProperties('AWS::Lambda::EventSourceMapping', { + SelfManagedKafkaEventSourceConfig: { ConsumerGroupId: consumerGroupId }, + }); + + }); + + test('consumerGroupId can be set for ManagedKafkaEventSource', () => { + + // GIVEN + const stack = new cdk.Stack(); + const fn = new TestFunction(stack, 'Fn'); + const clusterArn = 'some-arn'; + const kafkaTopic = 'some-topic'; + const consumerGroupId = 'my-consumer-group-id'; + + + const mskEventMapping = new sources.ManagedKafkaEventSource( + { + clusterArn, + topic: kafkaTopic, + startingPosition: lambda.StartingPosition.TRIM_HORIZON, + consumerGroupId, + }); + + // WHEN + fn.addEventSource(mskEventMapping); + expect(mskEventMapping.eventSourceMappingId).toBeDefined(); + + const template = Template.fromStack(stack); + template.hasResourceProperties('AWS::Lambda::EventSourceMapping', { + AmazonManagedKafkaEventSourceConfig: { ConsumerGroupId: consumerGroupId }, + }); + + }); + test('ManagedKafkaEventSource name conforms to construct id rules', () => { // GIVEN const stack = new cdk.Stack(); diff --git a/packages/@aws-cdk/aws-lambda/lib/event-source-mapping.ts b/packages/@aws-cdk/aws-lambda/lib/event-source-mapping.ts index d5e2d568bdd2e..08e43ca31e310 100644 --- a/packages/@aws-cdk/aws-lambda/lib/event-source-mapping.ts +++ b/packages/@aws-cdk/aws-lambda/lib/event-source-mapping.ts @@ -215,6 +215,16 @@ export interface EventSourceMappingOptions { */ readonly kafkaBootstrapServers?: string[] + /** + * The identifier for the Kafka consumer group to join. The consumer group ID must be unique among all your Kafka event sources. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value. The value must have a lenght between 1 and 200 and full the pattern '[a-zA-Z0-9-\/*:_+=.@-]*'. For more information, see [Customizable consumer group ID](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-consumer-group-id). + * @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-amazonmanagedkafkaeventsourceconfig.html + * @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-selfmanagedkafkaeventsourceconfig.html + * + * @default - none + */ + readonly kafkaConsumerGroupId?: string + + /** * Specific settings like the authentication protocol or the VPC components to secure access to your event source. * @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-sourceaccessconfiguration.html @@ -319,6 +329,10 @@ export class EventSourceMapping extends cdk.Resource implements IEventSourceMapp throw new Error('startingPositionTimestamp can only be used when startingPosition is AT_TIMESTAMP'); } + if (props.kafkaConsumerGroupId) { + this.validateKafkaConsumerGroupIdOrThrow(props.kafkaConsumerGroupId); + } + let destinationConfig; if (props.onFailure) { @@ -332,6 +346,8 @@ export class EventSourceMapping extends cdk.Resource implements IEventSourceMapp selfManagedEventSource = { endpoints: { kafkaBootstrapServers: props.kafkaBootstrapServers } }; } + let consumerGroupConfig = props.kafkaConsumerGroupId ? { consumerGroupId: props.kafkaConsumerGroupId } : undefined; + const cfnEventSourceMapping = new CfnEventSourceMapping(this, 'Resource', { batchSize: props.batchSize, bisectBatchOnFunctionError: props.bisectBatchOnError, @@ -350,9 +366,23 @@ export class EventSourceMapping extends cdk.Resource implements IEventSourceMapp tumblingWindowInSeconds: props.tumblingWindow?.toSeconds(), sourceAccessConfigurations: props.sourceAccessConfigurations?.map((o) => {return { type: o.type.type, uri: o.uri };}), selfManagedEventSource, + selfManagedKafkaEventSourceConfig: props.kafkaBootstrapServers ? consumerGroupConfig : undefined, + amazonManagedKafkaEventSourceConfig: props.eventSourceArn ? consumerGroupConfig : undefined, }); this.eventSourceMappingId = cfnEventSourceMapping.ref; } + + private validateKafkaConsumerGroupIdOrThrow(kafkaConsumerGroupId: string) { + if (kafkaConsumerGroupId.length > 200 ||kafkaConsumerGroupId.length < 1) { + throw new Error('kafkaConsumerGroupId must be a valid string between 1 and 200 characters'); + } + + const regex = new RegExp(/[a-zA-Z0-9-\/*:_+=.@-]*/); + const patternMatch = regex.exec(kafkaConsumerGroupId); + if (patternMatch === null || patternMatch[0] !== kafkaConsumerGroupId) { + throw new Error('kafkaConsumerGroupId contain ivalid characters. Allowed values are "[a-zA-Z0-9-\/*:_+=.@-]"'); + } + } } /** diff --git a/packages/@aws-cdk/aws-lambda/test/event-source-mapping.test.ts b/packages/@aws-cdk/aws-lambda/test/event-source-mapping.test.ts index 05a6ea811ceba..d283c63f09c09 100644 --- a/packages/@aws-cdk/aws-lambda/test/event-source-mapping.test.ts +++ b/packages/@aws-cdk/aws-lambda/test/event-source-mapping.test.ts @@ -154,6 +154,46 @@ describe('event source mapping', () => { })).toThrow(/kafkaBootStrapServers must not be empty if set/); }); + test('throws if kafkaConsumerGroupId is invalid', () => { + expect(() => new EventSourceMapping(stack, 'test', { + eventSourceArn: 'arn:aws:kafka:us-east-1:123456789012:cluster/vpc-2priv-2pub/751d2973-a626-431c-9d4e-d7975eb44dd7-2', + kafkaConsumerGroupId: 'some invalid', + target: fn, + })).toThrow('kafkaConsumerGroupId contain ivalid characters. Allowed values are "[a-zA-Z0-9-\/*:_+=.@-]"'); + }); + + test('throws if kafkaConsumerGroupId is too long', () => { + expect(() => new EventSourceMapping(stack, 'test', { + eventSourceArn: 'arn:aws:kafka:us-east-1:123456789012:cluster/vpc-2priv-2pub/751d2973-a626-431c-9d4e-d7975eb44dd7-2', + kafkaConsumerGroupId: 'x'.repeat(201), + target: fn, + })).toThrow('kafkaConsumerGroupId must be a valid string between 1 and 200 characters'); + }); + + test('not throws if kafkaConsumerGroupId is empty', () => { + expect(() => new EventSourceMapping(stack, 'test', { + eventSourceArn: 'arn:aws:kafka:us-east-1:123456789012:cluster/vpc-2priv-2pub/751d2973-a626-431c-9d4e-d7975eb44dd7-2', + kafkaConsumerGroupId: '', + target: fn, + })).not.toThrow(); + }); + + test('not throws if kafkaConsumerGroupId is valid for amazon managed kafka', () => { + expect(() => new EventSourceMapping(stack, 'test', { + eventSourceArn: 'arn:aws:kafka:us-east-1:123456789012:cluster/vpc-2priv-2pub/751d2973-a626-431c-9d4e-d7975eb44dd7-2', + kafkaConsumerGroupId: 'someValidConsumerGroupId', + target: fn, + })).not.toThrow(); + }); + + test('not throws if kafkaConsumerGroupId is valid for self managed kafka', () => { + expect(() => new EventSourceMapping(stack, 'test', { + kafkaBootstrapServers: ['kafka-broker-1:9092', 'kafka-broker-2:9092'], + kafkaConsumerGroupId: 'someValidConsumerGroupId', + target: fn, + })).not.toThrow(); + }); + test('eventSourceArn appears in stack', () => { const topicNameParam = new cdk.CfnParameter(stack, 'TopicNameParam', { type: 'String', From 9f2ea458609b29a91eb792165be6de596ce1aea9 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Tue, 6 Sep 2022 18:04:27 +0100 Subject: [PATCH 2/9] fix(core): `--debug` doesn't record stack traces (#21931) In v1 we used to record construct stack traces; those have disappeared in v2 because the defaults in the underlying `constructs` library changed. Re-add them when `--debug` is passed. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/core/lib/cfn-element.ts | 3 +++ .../@aws-cdk/core/test/cfn-resource.test.ts | 20 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/packages/@aws-cdk/core/lib/cfn-element.ts b/packages/@aws-cdk/core/lib/cfn-element.ts index f233288c02aa8..46a6a8f8d2833 100644 --- a/packages/@aws-cdk/core/lib/cfn-element.ts +++ b/packages/@aws-cdk/core/lib/cfn-element.ts @@ -1,6 +1,7 @@ import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import * as cxapi from '@aws-cdk/cx-api'; import { Construct, Node } from 'constructs'; +import { debugModeEnabled } from './debug'; import { Lazy } from './lazy'; const CFN_ELEMENT_SYMBOL = Symbol.for('@aws-cdk/core.CfnElement'); @@ -71,6 +72,7 @@ export abstract class CfnElement extends Construct { if (!this.node.tryGetContext(cxapi.DISABLE_LOGICAL_ID_METADATA)) { Node.of(this).addMetadata(cxschema.ArtifactMetadataEntryType.LOGICAL_ID, this.logicalId, { + stackTrace: debugModeEnabled(), traceFromFunction: this.constructor, }); } @@ -204,3 +206,4 @@ function notTooLong(x: string) { import { CfnReference } from './private/cfn-reference'; import { Stack } from './stack'; import { Token } from './token'; + diff --git a/packages/@aws-cdk/core/test/cfn-resource.test.ts b/packages/@aws-cdk/core/test/cfn-resource.test.ts index 30a240a234a54..4bc11c5ea43a4 100644 --- a/packages/@aws-cdk/core/test/cfn-resource.test.ts +++ b/packages/@aws-cdk/core/test/cfn-resource.test.ts @@ -1,3 +1,4 @@ +import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import { VALIDATE_SNAPSHOT_REMOVAL_POLICY } from '@aws-cdk/cx-api'; import { Construct } from 'constructs'; import * as core from '../lib'; @@ -255,4 +256,23 @@ describe('cfn resource', () => { }); }).toThrow(/should be created in the scope of a Stack, but no Stack found/); }); + + test('CfnResource has logical ID metadata with stack trace attached', () => { + process.env.CDK_DEBUG = '1'; + try { + const app = new core.App(); + const stack = new core.Stack(app, 'Stack'); + const res = new core.CfnResource(stack, 'SomeCfnResource', { + type: 'Some::Resource', + }); + + // THEN + const metadata = res.node.metadata.find(m => m.type === cxschema.ArtifactMetadataEntryType.LOGICAL_ID); + expect(metadata).toBeDefined(); + expect(metadata?.trace).toBeDefined(); + expect(metadata?.trace?.length).toBeGreaterThan(0); + } finally { + delete process.env.CDK_DEBUG; + } + }); }); From 9f26e8a0737b676d743fbd3d74340d8d61abbe14 Mon Sep 17 00:00:00 2001 From: liubnu <13728145+liubnu@users.noreply.github.com> Date: Tue, 6 Sep 2022 12:55:38 -0700 Subject: [PATCH 3/9] chore(region-info): add appmesh ecr accounts for ap-southeast-3 (#21932) Add ECR account of `ap-southeast-3` for AWS App Mesh. `ap-southeast-3` is an opt-in region, so we have to manually add the new ECR account. ---- ### All Submissions: * [Y] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [Y] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [N] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .gitallowed | 1 + packages/@aws-cdk/region-info/build-tools/fact-tables.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/.gitallowed b/.gitallowed index a7cacaea4980e..20a94b7dae003 100644 --- a/.gitallowed +++ b/.gitallowed @@ -25,6 +25,7 @@ account: '422531588944' account: '924023996002' account: '919366029133' #cn-north-1 account: '919830735681' #cn-northwest-1 +account: '909464085924' #ap-southeast-3 # The account IDs of password rotation applications of Serverless Application Repository # https://docs.aws.amazon.com/secretsmanager/latest/userguide/enable-rotation-rds.html diff --git a/packages/@aws-cdk/region-info/build-tools/fact-tables.ts b/packages/@aws-cdk/region-info/build-tools/fact-tables.ts index f901f99dbf1b2..6578ee94d4d95 100644 --- a/packages/@aws-cdk/region-info/build-tools/fact-tables.ts +++ b/packages/@aws-cdk/region-info/build-tools/fact-tables.ts @@ -171,6 +171,7 @@ export const APPMESH_ECR_ACCOUNTS: { [region: string]: string } = { 'ap-south-1': '840364872350', 'ap-southeast-1': '840364872350', 'ap-southeast-2': '840364872350', + 'ap-southeast-3': '909464085924', 'ca-central-1': '840364872350', 'cn-north-1': '919366029133', 'cn-northwest-1': '919830735681', From bad426e6e10fc8c0ea2252fb9a28a3d26b16f13a Mon Sep 17 00:00:00 2001 From: AWS CDK Automation <43080478+aws-cdk-automation@users.noreply.github.com> Date: Wed, 7 Sep 2022 08:00:03 -0700 Subject: [PATCH 4/9] chore: npm-check-updates && yarn upgrade (#21946) Ran npm-check-updates and yarn upgrade to keep the `yarn.lock` file up-to-date. --- package.json | 10 +- .../aws-apigatewayv2-authorizers/package.json | 2 +- .../package.json | 2 +- .../@aws-cdk/aws-cloudformation/package.json | 2 +- packages/@aws-cdk/aws-dynamodb/package.json | 2 +- packages/@aws-cdk/aws-ec2/package.json | 2 +- packages/@aws-cdk/aws-eks/package.json | 4 +- packages/@aws-cdk/aws-iam/package.json | 2 +- .../@aws-cdk/aws-lambda-nodejs/package.json | 2 +- packages/@aws-cdk/aws-lambda/package.json | 2 +- packages/@aws-cdk/aws-logs/package.json | 2 +- packages/@aws-cdk/aws-route53/package.json | 2 +- packages/@aws-cdk/aws-s3/package.json | 2 +- packages/@aws-cdk/aws-ses/package.json | 2 +- .../@aws-cdk/cloudformation-diff/package.json | 2 +- packages/@aws-cdk/core/package.json | 4 +- .../@aws-cdk/custom-resources/package.json | 2 +- .../integ-runner/THIRD_PARTY_LICENSES | 2 +- packages/@aws-cdk/integ-runner/package.json | 2 +- packages/@aws-cdk/integ-tests/package.json | 2 +- .../@monocdk-experiment/assert/package.json | 2 +- .../rewrite-imports/package.json | 2 +- packages/aws-cdk-lib/package.json | 4 +- packages/aws-cdk-migration/package.json | 2 +- packages/aws-cdk/THIRD_PARTY_LICENSES | 4 +- packages/aws-cdk/package.json | 4 +- packages/awslint/package.json | 4 +- packages/cdk-assets/package.json | 2 +- packages/cdk-cli-wrapper/package.json | 2 +- packages/cdk-dasm/package.json | 2 +- packages/monocdk/package.json | 2 +- tools/@aws-cdk/cdk-build-tools/package.json | 6 +- tools/@aws-cdk/cfn2ts/package.json | 2 +- tools/@aws-cdk/eslint-plugin/package.json | 2 +- tools/@aws-cdk/node-bundle/package.json | 6 +- tools/@aws-cdk/yarn-cling/package.json | 2 +- yarn.lock | 708 +++++++++--------- 37 files changed, 404 insertions(+), 404 deletions(-) diff --git a/package.json b/package.json index a81e661eea36c..811bde81c8e7b 100644 --- a/package.json +++ b/package.json @@ -18,15 +18,15 @@ "devDependencies": { "@types/prettier": "2.6.0", "@yarnpkg/lockfile": "^1.1.0", - "cdk-generate-synthetic-examples": "^0.1.16", + "cdk-generate-synthetic-examples": "^0.1.17", "conventional-changelog-cli": "^2.2.2", "fs-extra": "^9.1.0", "graceful-fs": "^4.2.10", "jest-junit": "^13.2.0", - "jsii-diff": "^1.66.0", - "jsii-pacmak": "^1.66.0", - "jsii-reflect": "^1.66.0", - "jsii-rosetta": "^1.66.0", + "jsii-diff": "^1.67.0", + "jsii-pacmak": "^1.67.0", + "jsii-reflect": "^1.67.0", + "jsii-rosetta": "^1.67.0", "lerna": "^4.0.0", "patch-package": "^6.4.7", "semver": "^6.3.0", diff --git a/packages/@aws-cdk/aws-apigatewayv2-authorizers/package.json b/packages/@aws-cdk/aws-apigatewayv2-authorizers/package.json index 114c6b3326444..6e6895f22d075 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.102", + "@types/aws-lambda": "^8.10.103", "@aws-cdk/integ-tests": "0.0.0", "@types/jest": "^27.5.2" }, 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 8410663bc4865..67f38963276c4 100644 --- a/packages/@aws-cdk/aws-certificatemanager/lambda-packages/dns_validated_certificate_handler/package.json +++ b/packages/@aws-cdk/aws-certificatemanager/lambda-packages/dns_validated_certificate_handler/package.json @@ -29,7 +29,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@types/aws-lambda": "^8.10.102", + "@types/aws-lambda": "^8.10.103", "@types/sinon": "^9.0.11", "@aws-cdk/cdk-build-tools": "0.0.0", "aws-sdk": "^2.596.0", diff --git a/packages/@aws-cdk/aws-cloudformation/package.json b/packages/@aws-cdk/aws-cloudformation/package.json index 1996acde1588f..b141331a3a3fb 100644 --- a/packages/@aws-cdk/aws-cloudformation/package.json +++ b/packages/@aws-cdk/aws-cloudformation/package.json @@ -87,7 +87,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.102", + "@types/aws-lambda": "^8.10.103", "@types/jest": "^27.5.2", "jest": "^27.5.1" }, diff --git a/packages/@aws-cdk/aws-dynamodb/package.json b/packages/@aws-cdk/aws-dynamodb/package.json index 5731580efb6e5..2bde6527c5452 100644 --- a/packages/@aws-cdk/aws-dynamodb/package.json +++ b/packages/@aws-cdk/aws-dynamodb/package.json @@ -85,7 +85,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.102", + "@types/aws-lambda": "^8.10.103", "@types/jest": "^27.5.2", "@types/sinon": "^9.0.11", "aws-sdk": "^2.848.0", diff --git a/packages/@aws-cdk/aws-ec2/package.json b/packages/@aws-cdk/aws-ec2/package.json index e7aac47c3ea71..6c01cb3933c64 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.102", + "@types/aws-lambda": "^8.10.103", "@types/jest": "^27.5.2", "jest": "^27.5.1" }, diff --git a/packages/@aws-cdk/aws-eks/package.json b/packages/@aws-cdk/aws-eks/package.json index d47e07847071b..b5d09511bd218 100644 --- a/packages/@aws-cdk/aws-eks/package.json +++ b/packages/@aws-cdk/aws-eks/package.json @@ -85,12 +85,12 @@ "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/cfn2ts": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@types/aws-lambda": "^8.10.102", + "@types/aws-lambda": "^8.10.103", "@types/jest": "^27.5.2", "@types/sinon": "^9.0.11", "@types/yaml": "1.9.6", "aws-sdk": "^2.848.0", - "cdk8s": "^2.4.17", + "cdk8s": "^2.4.20", "cdk8s-plus-21": "^2.0.0-beta.12", "jest": "^27.5.1", "sinon": "^9.2.4" diff --git a/packages/@aws-cdk/aws-iam/package.json b/packages/@aws-cdk/aws-iam/package.json index fcbd89d7ebfda..ec62e8fa6a6f0 100644 --- a/packages/@aws-cdk/aws-iam/package.json +++ b/packages/@aws-cdk/aws-iam/package.json @@ -85,7 +85,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.102", + "@types/aws-lambda": "^8.10.103", "@types/jest": "^27.5.2", "@types/sinon": "^9.0.11", "jest": "^27.5.1", diff --git a/packages/@aws-cdk/aws-lambda-nodejs/package.json b/packages/@aws-cdk/aws-lambda-nodejs/package.json index 7e26c84541628..7e0f97a8cec3c 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/package.json +++ b/packages/@aws-cdk/aws-lambda-nodejs/package.json @@ -79,7 +79,7 @@ "@aws-cdk/pkglint": "0.0.0", "@types/jest": "^27.5.2", "delay": "5.0.0", - "esbuild": "^0.15.6" + "esbuild": "^0.15.7" }, "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 475231ce7977c..d4a5ec47bd25e 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.102", + "@types/aws-lambda": "^8.10.103", "@types/jest": "^27.5.2", "@types/lodash": "^4.14.184", "jest": "^27.5.1", diff --git a/packages/@aws-cdk/aws-logs/package.json b/packages/@aws-cdk/aws-logs/package.json index 702b44567b447..950eae85d32a3 100644 --- a/packages/@aws-cdk/aws-logs/package.json +++ b/packages/@aws-cdk/aws-logs/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.102", + "@types/aws-lambda": "^8.10.103", "@types/jest": "^27.5.2", "@types/sinon": "^9.0.11", "aws-sdk": "^2.848.0", diff --git a/packages/@aws-cdk/aws-route53/package.json b/packages/@aws-cdk/aws-route53/package.json index fe30648e9ba74..0934f6fdd177d 100644 --- a/packages/@aws-cdk/aws-route53/package.json +++ b/packages/@aws-cdk/aws-route53/package.json @@ -85,7 +85,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.102", + "@types/aws-lambda": "^8.10.103", "@types/jest": "^27.5.2", "aws-sdk": "^2.848.0", "jest": "^27.5.1" diff --git a/packages/@aws-cdk/aws-s3/package.json b/packages/@aws-cdk/aws-s3/package.json index bb113e264aa4c..ea88795dc049b 100644 --- a/packages/@aws-cdk/aws-s3/package.json +++ b/packages/@aws-cdk/aws-s3/package.json @@ -85,7 +85,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.102", + "@types/aws-lambda": "^8.10.103", "@types/jest": "^27.5.2", "jest": "^27.5.1" }, diff --git a/packages/@aws-cdk/aws-ses/package.json b/packages/@aws-cdk/aws-ses/package.json index 0e35e993d5430..5e7c4f975b400 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.102", + "@types/aws-lambda": "^8.10.103", "@types/jest": "^27.5.2", "jest": "^27.5.1" }, diff --git a/packages/@aws-cdk/cloudformation-diff/package.json b/packages/@aws-cdk/cloudformation-diff/package.json index 29f6da14be8ab..79ccc4f865560 100644 --- a/packages/@aws-cdk/cloudformation-diff/package.json +++ b/packages/@aws-cdk/cloudformation-diff/package.json @@ -24,7 +24,7 @@ "license": "Apache-2.0", "dependencies": { "@aws-cdk/cfnspec": "0.0.0", - "@types/node": "^14.18.26", + "@types/node": "^14.18.27", "chalk": "^4", "diff": "^5.1.0", "fast-deep-equal": "^3.1.3", diff --git a/packages/@aws-cdk/core/package.json b/packages/@aws-cdk/core/package.json index a6212a3c42afb..c053496635001 100644 --- a/packages/@aws-cdk/core/package.json +++ b/packages/@aws-cdk/core/package.json @@ -184,12 +184,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.102", + "@types/aws-lambda": "^8.10.103", "@types/fs-extra": "^8.1.2", "@types/jest": "^27.5.2", "@types/lodash": "^4.14.184", "@types/minimatch": "^3.0.5", - "@types/node": "^14.18.26", + "@types/node": "^14.18.27", "@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 ddbdbe237308d..34ebcbf7264d8 100644 --- a/packages/@aws-cdk/custom-resources/package.json +++ b/packages/@aws-cdk/custom-resources/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.102", + "@types/aws-lambda": "^8.10.103", "@types/fs-extra": "^8.1.2", "@types/jest": "^27.5.2", "@types/sinon": "^9.0.11", diff --git a/packages/@aws-cdk/integ-runner/THIRD_PARTY_LICENSES b/packages/@aws-cdk/integ-runner/THIRD_PARTY_LICENSES index b259f40c9fca3..43ee2b74a9cb1 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.1206.0 - https://www.npmjs.com/package/aws-sdk/v/2.1206.0 | Apache-2.0 +** aws-sdk@2.1210.0 - https://www.npmjs.com/package/aws-sdk/v/2.1210.0 | Apache-2.0 AWS SDK for JavaScript Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/packages/@aws-cdk/integ-runner/package.json b/packages/@aws-cdk/integ-runner/package.json index 007f6d353061a..c33ac14521269 100644 --- a/packages/@aws-cdk/integ-runner/package.json +++ b/packages/@aws-cdk/integ-runner/package.json @@ -57,7 +57,7 @@ "@aws-cdk/pkglint": "0.0.0", "@types/fs-extra": "^8.1.2", "@types/jest": "^27.5.2", - "@types/node": "^14.18.26", + "@types/node": "^14.18.27", "@types/workerpool": "^6.1.0", "@types/yargs": "^15.0.14", "jest": "^27.5.1" diff --git a/packages/@aws-cdk/integ-tests/package.json b/packages/@aws-cdk/integ-tests/package.json index f3786804d207d..f036465dcb7d7 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": "^8.1.2", "@types/jest": "^27.5.2", - "@types/node": "^14.18.26", + "@types/node": "^14.18.27", "jest": "^27.5.1", "nock": "^13.2.9", "aws-sdk-mock": "5.6.0", diff --git a/packages/@monocdk-experiment/assert/package.json b/packages/@monocdk-experiment/assert/package.json index f1af4b834fd70..10290ca58ce80 100644 --- a/packages/@monocdk-experiment/assert/package.json +++ b/packages/@monocdk-experiment/assert/package.json @@ -39,7 +39,7 @@ "devDependencies": { "@monocdk-experiment/rewrite-imports": "0.0.0", "@types/jest": "^27.5.2", - "@types/node": "^14.18.26", + "@types/node": "^14.18.27", "@aws-cdk/cdk-build-tools": "0.0.0", "jest": "^27.5.1", "constructs": "^10.0.0", diff --git a/packages/@monocdk-experiment/rewrite-imports/package.json b/packages/@monocdk-experiment/rewrite-imports/package.json index 0e309d17f70b7..546cff84d9e8c 100644 --- a/packages/@monocdk-experiment/rewrite-imports/package.json +++ b/packages/@monocdk-experiment/rewrite-imports/package.json @@ -38,7 +38,7 @@ "devDependencies": { "@types/glob": "^7.2.0", "@types/jest": "^27.5.2", - "@types/node": "^14.18.26", + "@types/node": "^14.18.27", "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/pkglint": "0.0.0" }, diff --git a/packages/aws-cdk-lib/package.json b/packages/aws-cdk-lib/package.json index 875b7d872789b..a6a4c65149ba0 100644 --- a/packages/aws-cdk-lib/package.json +++ b/packages/aws-cdk-lib/package.json @@ -359,9 +359,9 @@ "@aws-cdk/triggers": "0.0.0", "@aws-cdk/ubergen": "0.0.0", "@types/fs-extra": "^8.1.2", - "@types/node": "^14.18.26", + "@types/node": "^14.18.27", "constructs": "^10.0.0", - "esbuild": "^0.15.6", + "esbuild": "^0.15.7", "fs-extra": "^9.1.0", "ts-node": "^9.1.1", "typescript": "~3.8.3" diff --git a/packages/aws-cdk-migration/package.json b/packages/aws-cdk-migration/package.json index 290133a90c99c..34bede2ee3c46 100644 --- a/packages/aws-cdk-migration/package.json +++ b/packages/aws-cdk-migration/package.json @@ -40,7 +40,7 @@ "devDependencies": { "@types/glob": "^7.2.0", "@types/jest": "^27.5.2", - "@types/node": "^14.18.26", + "@types/node": "^14.18.27", "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/pkglint": "0.0.0" }, diff --git a/packages/aws-cdk/THIRD_PARTY_LICENSES b/packages/aws-cdk/THIRD_PARTY_LICENSES index a9900d6b86fa7..5dd340f649aee 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.66.0 - https://www.npmjs.com/package/@jsii/check-node/v/1.66.0 | Apache-2.0 +** @jsii/check-node@1.67.0 - https://www.npmjs.com/package/@jsii/check-node/v/1.67.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.1206.0 - https://www.npmjs.com/package/aws-sdk/v/2.1206.0 | Apache-2.0 +** aws-sdk@2.1210.0 - https://www.npmjs.com/package/aws-sdk/v/2.1210.0 | Apache-2.0 AWS SDK for JavaScript Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/packages/aws-cdk/package.json b/packages/aws-cdk/package.json index d161ef35d56db..7ec4e5ebebf81 100644 --- a/packages/aws-cdk/package.json +++ b/packages/aws-cdk/package.json @@ -67,7 +67,7 @@ "@types/jest": "^27.5.2", "@types/minimatch": "^3.0.5", "@types/mockery": "^1.4.30", - "@types/node": "^14.18.26", + "@types/node": "^14.18.27", "@types/promptly": "^3.0.2", "@types/semver": "^7.3.12", "@types/sinon": "^9.0.11", @@ -95,7 +95,7 @@ "@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.66.0", + "@jsii/check-node": "1.67.0", "archiver": "^5.3.1", "aws-sdk": "^2.1093.0", "camelcase": "^6.3.0", diff --git a/packages/awslint/package.json b/packages/awslint/package.json index 823db28b11d50..3187720da8d96 100644 --- a/packages/awslint/package.json +++ b/packages/awslint/package.json @@ -18,11 +18,11 @@ "awslint": "bin/awslint" }, "dependencies": { - "@jsii/spec": "^1.66.0", + "@jsii/spec": "^1.67.0", "camelcase": "^6.3.0", "chalk": "^4", "fs-extra": "^9.1.0", - "jsii-reflect": "^1.66.0", + "jsii-reflect": "^1.67.0", "yargs": "^16.2.0" }, "devDependencies": { diff --git a/packages/cdk-assets/package.json b/packages/cdk-assets/package.json index c2fe5884d547e..502805bde5dca 100644 --- a/packages/cdk-assets/package.json +++ b/packages/cdk-assets/package.json @@ -35,7 +35,7 @@ "@types/jest": "^27.5.2", "@types/mime": "^2.0.3", "@types/mock-fs": "^4.13.1", - "@types/node": "^14.18.26", + "@types/node": "^14.18.27", "@types/yargs": "^15.0.14", "@aws-cdk/cdk-build-tools": "0.0.0", "jest": "^27.5.1", diff --git a/packages/cdk-cli-wrapper/package.json b/packages/cdk-cli-wrapper/package.json index f6bc70f85cc7f..6e6e94262850f 100644 --- a/packages/cdk-cli-wrapper/package.json +++ b/packages/cdk-cli-wrapper/package.json @@ -62,7 +62,7 @@ "license": "Apache-2.0", "devDependencies": { "@types/jest": "^27.5.2", - "@types/node": "^14.18.26", + "@types/node": "^14.18.27", "@aws-cdk/cdk-build-tools": "0.0.0", "jest": "^27.5.1", "@aws-cdk/pkglint": "0.0.0" diff --git a/packages/cdk-dasm/package.json b/packages/cdk-dasm/package.json index a1c1f2a8f41ef..3f067e24df31e 100644 --- a/packages/cdk-dasm/package.json +++ b/packages/cdk-dasm/package.json @@ -30,7 +30,7 @@ }, "license": "Apache-2.0", "dependencies": { - "codemaker": "^1.66.0", + "codemaker": "^1.67.0", "yaml": "1.10.2" }, "devDependencies": { diff --git a/packages/monocdk/package.json b/packages/monocdk/package.json index ded6fbf824d6e..8b8d34a90cdff 100644 --- a/packages/monocdk/package.json +++ b/packages/monocdk/package.json @@ -358,7 +358,7 @@ "@aws-cdk/ubergen": "0.0.0", "@aws-cdk/yaml-cfn": "0.0.0", "@types/fs-extra": "^8.1.2", - "@types/node": "^14.18.26", + "@types/node": "^14.18.27", "constructs": "^10.0.0", "fs-extra": "^9.1.0", "ts-node": "^9.1.1", diff --git a/tools/@aws-cdk/cdk-build-tools/package.json b/tools/@aws-cdk/cdk-build-tools/package.json index 8ba36312755f7..53459630a5954 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.66.0", - "jsii-pacmak": "^1.66.0", - "jsii-reflect": "^1.66.0", + "jsii": "^1.67.0", + "jsii-pacmak": "^1.67.0", + "jsii-reflect": "^1.67.0", "markdownlint-cli": "^0.32.2", "nyc": "^15.1.0", "semver": "^7.3.7", diff --git a/tools/@aws-cdk/cfn2ts/package.json b/tools/@aws-cdk/cfn2ts/package.json index 92014e5210e0f..2d37e97a1e597 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.66.0", + "codemaker": "^1.67.0", "fast-json-patch": "^3.1.1", "fs-extra": "^9.1.0", "yargs": "^16.2.0" diff --git a/tools/@aws-cdk/eslint-plugin/package.json b/tools/@aws-cdk/eslint-plugin/package.json index 3bb3b95bc097d..5e2156397e617 100644 --- a/tools/@aws-cdk/eslint-plugin/package.json +++ b/tools/@aws-cdk/eslint-plugin/package.json @@ -17,7 +17,7 @@ "@types/eslint": "^7.29.0", "@types/fs-extra": "^8.1.2", "@types/jest": "^27.5.2", - "@types/node": "^14.18.26", + "@types/node": "^14.18.27", "@types/estree": "*", "eslint-plugin-rulesdir": "^0.2.1", "jest": "^27.5.1", diff --git a/tools/@aws-cdk/node-bundle/package.json b/tools/@aws-cdk/node-bundle/package.json index 931d081840840..6340911ea7b5a 100644 --- a/tools/@aws-cdk/node-bundle/package.json +++ b/tools/@aws-cdk/node-bundle/package.json @@ -29,7 +29,7 @@ "@types/jest": "^27.5.2", "@types/license-checker": "^25.0.3", "@types/madge": "^5.0.0", - "@types/node": "^14.18.26", + "@types/node": "^14.18.27", "@typescript-eslint/eslint-plugin": "^5", "@typescript-eslint/parser": "^5", "eslint": "^8", @@ -40,13 +40,13 @@ "jest-junit": "^13", "json-schema": "^0.4.0", "npm-check-updates": "^12", - "projen": "^0.61.37", + "projen": "^0.61.45", "standard-version": "^9", "ts-jest": "^27", "typescript": "^4.5.5" }, "dependencies": { - "esbuild": "^0.15.6", + "esbuild": "^0.15.7", "fs-extra": "^10.1.0", "license-checker": "^25.0.1", "madge": "^5.0.1", diff --git a/tools/@aws-cdk/yarn-cling/package.json b/tools/@aws-cdk/yarn-cling/package.json index f9033903df770..97010a0327a0b 100644 --- a/tools/@aws-cdk/yarn-cling/package.json +++ b/tools/@aws-cdk/yarn-cling/package.json @@ -39,7 +39,7 @@ "devDependencies": { "@aws-cdk/pkglint": "0.0.0", "@types/jest": "^27.5.2", - "@types/node": "^14.18.26", + "@types/node": "^14.18.27", "@types/semver": "^7.3.12", "@types/yarnpkg__lockfile": "^1.1.5", "jest": "^27.5.1", diff --git a/yarn.lock b/yarn.lock index f2c9506459b7d..d463dd251b4b9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -55,47 +55,47 @@ dependencies: "@babel/highlight" "^7.18.6" -"@babel/compat-data@^7.18.8": - version "7.18.13" - resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.18.13.tgz#6aff7b350a1e8c3e40b029e46cbe78e24a913483" - integrity sha512-5yUzC5LqyTFp2HLmDoxGQelcdYgSpP9xsnMWBphAscOdFrHSAVbLNzWiy32sVNDqJRDiJK6klfDnAgu6PAGSHw== +"@babel/compat-data@^7.19.0": + version "7.19.0" + resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.19.0.tgz#2a592fd89bacb1fcde68de31bee4f2f2dacb0e86" + integrity sha512-y5rqgTTPTmaF5e2nVhOxw+Ur9HDJLsWb6U/KpgUzRZEdPfE6VOubXBKLdbcUTijzRptednSBDQbYZBOSqJxpJw== "@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.18.13" - resolved "https://registry.npmjs.org/@babel/core/-/core-7.18.13.tgz#9be8c44512751b05094a4d3ab05fc53a47ce00ac" - integrity sha512-ZisbOvRRusFktksHSG6pjj1CSvkPkcZq/KHD45LAkVP/oiHJkNBZWfpvlLmX8OtHDG8IuzsFlVRWo08w7Qxn0A== + version "7.19.0" + resolved "https://registry.npmjs.org/@babel/core/-/core-7.19.0.tgz#d2f5f4f2033c00de8096be3c9f45772563e150c3" + integrity sha512-reM4+U7B9ss148rh2n1Qs9ASS+w94irYXga7c2jaQv9RVzpS7Mv1a9rnYYwuDa45G+DkORt9g6An2k/V4d9LbQ== dependencies: "@ampproject/remapping" "^2.1.0" "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.18.13" - "@babel/helper-compilation-targets" "^7.18.9" - "@babel/helper-module-transforms" "^7.18.9" - "@babel/helpers" "^7.18.9" - "@babel/parser" "^7.18.13" + "@babel/generator" "^7.19.0" + "@babel/helper-compilation-targets" "^7.19.0" + "@babel/helper-module-transforms" "^7.19.0" + "@babel/helpers" "^7.19.0" + "@babel/parser" "^7.19.0" "@babel/template" "^7.18.10" - "@babel/traverse" "^7.18.13" - "@babel/types" "^7.18.13" + "@babel/traverse" "^7.19.0" + "@babel/types" "^7.19.0" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.1" semver "^6.3.0" -"@babel/generator@^7.18.13", "@babel/generator@^7.7.2": - version "7.18.13" - resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.18.13.tgz#59550cbb9ae79b8def15587bdfbaa388c4abf212" - integrity sha512-CkPg8ySSPuHTYPJYo7IRALdqyjM9HCbt/3uOBEFbzyGVP6Mn8bwFPB0jX6982JVNBlYzM1nnPkfjuXSOPtQeEQ== +"@babel/generator@^7.19.0", "@babel/generator@^7.7.2": + version "7.19.0" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.19.0.tgz#785596c06425e59334df2ccee63ab166b738419a" + integrity sha512-S1ahxf1gZ2dpoiFgA+ohK9DIpz50bJ0CWs7Zlzb54Z4sG8qmdIrGrVqmy1sAtTVRb+9CU6U8VqT9L0Zj7hxHVg== dependencies: - "@babel/types" "^7.18.13" + "@babel/types" "^7.19.0" "@jridgewell/gen-mapping" "^0.3.2" jsesc "^2.5.1" -"@babel/helper-compilation-targets@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.18.9.tgz#69e64f57b524cde3e5ff6cc5a9f4a387ee5563bf" - integrity sha512-tzLCyVmqUiFlcFoAPLA/gL9TeYrF61VLNtb+hvkuVaB5SUjW7jcfrglBIX1vUIoT7CLP3bBlIMeyEsIl2eFQNg== +"@babel/helper-compilation-targets@^7.19.0": + version "7.19.0" + resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.19.0.tgz#537ec8339d53e806ed422f1e06c8f17d55b96bb0" + integrity sha512-Ai5bNWXIvwDvWM7njqsG3feMlL9hCVQsPYXodsZyLwshYkZVJt59Gftau4VrE8S9IT9asd2uSP1hG6wCNw+sXA== dependencies: - "@babel/compat-data" "^7.18.8" + "@babel/compat-data" "^7.19.0" "@babel/helper-validator-option" "^7.18.6" browserslist "^4.20.2" semver "^6.3.0" @@ -105,13 +105,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.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.18.9.tgz#940e6084a55dee867d33b4e487da2676365e86b0" - integrity sha512-fJgWlZt7nxGksJS9a0XdSaI4XvpExnNIgRP+rVefWh5U7BL8pPuir6SJUmFKRfjWQ51OtWSzwOxhaH/EBWWc0A== +"@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== dependencies: - "@babel/template" "^7.18.6" - "@babel/types" "^7.18.9" + "@babel/template" "^7.18.10" + "@babel/types" "^7.19.0" "@babel/helper-hoist-variables@^7.18.6": version "7.18.6" @@ -127,24 +127,24 @@ dependencies: "@babel/types" "^7.18.6" -"@babel/helper-module-transforms@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.18.9.tgz#5a1079c005135ed627442df31a42887e80fcb712" - integrity sha512-KYNqY0ICwfv19b31XzvmI/mfcylOzbLtowkw+mfvGPAQ3kfCnMLYbED3YecL5tPd8nAYFQFAd6JHp2LxZk/J1g== +"@babel/helper-module-transforms@^7.19.0": + version "7.19.0" + resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.19.0.tgz#309b230f04e22c58c6a2c0c0c7e50b216d350c30" + integrity sha512-3HBZ377Fe14RbLIA+ac3sY4PTgpxHVkFrESaWhoI5PuyXPBBX8+C34qblV9G89ZtycGJCmCI/Ut+VUDK4bltNQ== dependencies: "@babel/helper-environment-visitor" "^7.18.9" "@babel/helper-module-imports" "^7.18.6" "@babel/helper-simple-access" "^7.18.6" "@babel/helper-split-export-declaration" "^7.18.6" "@babel/helper-validator-identifier" "^7.18.6" - "@babel/template" "^7.18.6" - "@babel/traverse" "^7.18.9" - "@babel/types" "^7.18.9" + "@babel/template" "^7.18.10" + "@babel/traverse" "^7.19.0" + "@babel/types" "^7.19.0" "@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.18.6", "@babel/helper-plugin-utils@^7.8.0": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.18.9.tgz#4b8aea3b069d8cb8a72cdfe28ddf5ceca695ef2f" - integrity sha512-aBXPT3bmtLryXaoJLyYPXPlSD4p1ld9aYeR+sJNOZjJJGiOpb+fKfh3NkcCu7J54nUJwCERPBExCCpyCOHnu/w== + version "7.19.0" + resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.19.0.tgz#4796bb14961521f0f8715990bee2fb6e51ce21bf" + integrity sha512-40Ryx7I8mT+0gaNxm8JGTZFUITNqdLAgdg0hXzeVZxVD6nFsdhQvip6v8dqkRHzsz1VFpFAaOCHNn0vKBL7Czw== "@babel/helper-simple-access@^7.18.6": version "7.18.6" @@ -175,14 +175,14 @@ resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz#bf0d2b5a509b1f336099e4ff36e1a63aa5db4db8" integrity sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw== -"@babel/helpers@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.18.9.tgz#4bef3b893f253a1eced04516824ede94dcfe7ff9" - integrity sha512-Jf5a+rbrLoR4eNdUmnFu8cN5eNJT6qdTdOg5IHIzq87WwyRw9PwguLFOWYgktN/60IP4fgDUawJvs7PjQIzELQ== +"@babel/helpers@^7.19.0": + version "7.19.0" + resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.19.0.tgz#f30534657faf246ae96551d88dd31e9d1fa1fc18" + integrity sha512-DRBCKGwIEdqY3+rPJgG/dKfQy9+08rHIAJx8q2p+HSWP87s2HCrQmaAMMyMll2kIXKCW0cO1RdQskx15Xakftg== dependencies: - "@babel/template" "^7.18.6" - "@babel/traverse" "^7.18.9" - "@babel/types" "^7.18.9" + "@babel/template" "^7.18.10" + "@babel/traverse" "^7.19.0" + "@babel/types" "^7.19.0" "@babel/highlight@^7.10.4", "@babel/highlight@^7.18.6": version "7.18.6" @@ -193,10 +193,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.18.10", "@babel/parser@^7.18.13": - version "7.18.13" - resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.18.13.tgz#5b2dd21cae4a2c5145f1fbd8ca103f9313d3b7e4" - integrity sha512-dgXcIfMuQ0kgzLB2b9tRZs7TTFFaGM2AbtA4fJgUUYukzGH4jwsS7hzQHEGs67jdehpm22vkgKwvbU+aEflgwg== +"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.18.10", "@babel/parser@^7.19.0": + version "7.19.0" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.19.0.tgz#497fcafb1d5b61376959c1c338745ef0577aa02c" + integrity sha512-74bEXKX2h+8rrfQUfsBfuZZHzsEs6Eql4pqy/T4Nn6Y9wNPggQOqD6z6pn5Bl8ZfysKouFZT/UXEH94ummEeQw== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -289,7 +289,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.18.6" -"@babel/template@^7.18.10", "@babel/template@^7.18.6", "@babel/template@^7.3.3": +"@babel/template@^7.18.10", "@babel/template@^7.3.3": version "7.18.10" resolved "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz#6f9134835970d1dbf0835c0d100c9f38de0c5e71" integrity sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA== @@ -298,26 +298,26 @@ "@babel/parser" "^7.18.10" "@babel/types" "^7.18.10" -"@babel/traverse@^7.18.13", "@babel/traverse@^7.18.9", "@babel/traverse@^7.7.2": - version "7.18.13" - resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.18.13.tgz#5ab59ef51a997b3f10c4587d648b9696b6cb1a68" - integrity sha512-N6kt9X1jRMLPxxxPYWi7tgvJRH/rtoU+dbKAPDM44RFHiMH8igdsaSBgFeskhSl/kLWLDUvIh1RXCrTmg0/zvA== +"@babel/traverse@^7.19.0", "@babel/traverse@^7.7.2": + version "7.19.0" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.19.0.tgz#eb9c561c7360005c592cc645abafe0c3c4548eed" + integrity sha512-4pKpFRDh+utd2mbRC8JLnlsMUii3PMHjpL6a0SZ4NMZy7YFP9aXORxEhdMVOc9CpWtDF09IkciQLEhK7Ml7gRA== dependencies: "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.18.13" + "@babel/generator" "^7.19.0" "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.18.9" + "@babel/helper-function-name" "^7.19.0" "@babel/helper-hoist-variables" "^7.18.6" "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.18.13" - "@babel/types" "^7.18.13" + "@babel/parser" "^7.19.0" + "@babel/types" "^7.19.0" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.18.10", "@babel/types@^7.18.13", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.3.0", "@babel/types@^7.3.3": - version "7.18.13" - resolved "https://registry.npmjs.org/@babel/types/-/types-7.18.13.tgz#30aeb9e514f4100f7c1cb6e5ba472b30e48f519a" - integrity sha512-ePqfTihzW0W6XAU+aMw2ykilisStJfDnsejDCXRchCcMJ4O0+8DhPXf2YUbZ6wjBlsEmZwLK/sPweWtu8hcJYQ== +"@babel/types@^7.0.0", "@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.19.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3": + version "7.19.0" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.19.0.tgz#75f21d73d73dc0351f3368d28db73465f4814600" + integrity sha512-YuGopBq3ke25BVSiS6fgF49Ul9gH1x70Bcr6bqRLjWCkcX8Hre1/5+z+IiWOIerRMSSEfGZVB9z9kyq7wVs9YA== dependencies: "@babel/helper-string-parser" "^7.18.10" "@babel/helper-validator-identifier" "^7.18.6" @@ -340,10 +340,10 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@esbuild/linux-loong64@0.15.6": - version "0.15.6" - resolved "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.6.tgz#45be4184f00e505411bc265a05e709764114acd8" - integrity sha512-hqmVU2mUjH6J2ZivHphJ/Pdse2ZD+uGCHK0uvsiLDk/JnSedEVj77CiVUnbMKuU4tih1TZZL8tG9DExQg/GZsw== +"@esbuild/linux-loong64@0.15.7": + version "0.15.7" + resolved "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.7.tgz#1ec4af4a16c554cbd402cc557ccdd874e3f7be53" + integrity sha512-IKznSJOsVUuyt7cDzzSZyqBEcZe+7WlBqTVXiF1OXP/4Nm387ToaXZ0fyLwI1iBlI/bzpxVq411QE2/Bt2XWWw== "@eslint/eslintrc@^0.4.3": version "0.4.3" @@ -667,18 +667,18 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@jsii/check-node@1.66.0": - version "1.66.0" - resolved "https://registry.npmjs.org/@jsii/check-node/-/check-node-1.66.0.tgz#df8472efad9e436097461bbca89d514a4677634b" - integrity sha512-UVEH+23fTkjJux2DCzDMJFjmEAMwGSpiiMW7xPAYNO8F/sjGE8VkRB847twJi9SX3sJZNIYa3lcEQpQ1Hr92Yg== +"@jsii/check-node@1.67.0": + version "1.67.0" + resolved "https://registry.npmjs.org/@jsii/check-node/-/check-node-1.67.0.tgz#6ab7dd81b21b7fcff21508c182a9bc1d0a2a7402" + integrity sha512-Rwi01YE74xFOJrCtnUj9jossXJaEtE5KUcuU5UUGl/W4LRUdrXoJHPH1v5Agt7Az0fGGbE8yI0kD2NviWqnTew== dependencies: chalk "^4.1.2" semver "^7.3.7" -"@jsii/spec@1.66.0", "@jsii/spec@^1.64.0", "@jsii/spec@^1.66.0": - version "1.66.0" - resolved "https://registry.npmjs.org/@jsii/spec/-/spec-1.66.0.tgz#cada7b01c8ab48cb5340c98e60f7d357eefa4b6b" - integrity sha512-xY8/viaIpzPmr5APKgXQ6TkUsEhYFcp/pjUQmLqVnS4MssS8uETfhUvtNgGe/lsJoEUnqF8N+DLsHeCS/ad43w== +"@jsii/spec@1.67.0", "@jsii/spec@^1.67.0": + version "1.67.0" + resolved "https://registry.npmjs.org/@jsii/spec/-/spec-1.67.0.tgz#d318739b4e8e82118e505721917e86b51fb1585b" + integrity sha512-C/rGqdqQTJxgN/6tWQ6qcbQnKH76moZAGP+deT/TVx9JrrtrabrFhWfdqjtNYqpgNl1HKmHOSEO3Id5bBoFgvw== dependencies: ajv "^8.11.0" @@ -1788,10 +1788,10 @@ dependencies: "@types/glob" "*" -"@types/aws-lambda@^8.10.102": - version "8.10.102" - resolved "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.102.tgz#d2402224ec30cdddfb669005c25b6ee01fd6f5be" - integrity sha512-BT05v46n9KtSHa9SgGuOvm49eSruJ9utD8iNXpdpuUVYk8wOcqmm1LEzpNRkrXxD0CULc38sdLpk6q3Wa2WOwg== +"@types/aws-lambda@^8.10.103": + version "8.10.103" + resolved "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.103.tgz#9f0d748036a206ebe4a3eb19febc53b52ee36352" + integrity sha512-mYWsrM5YPmnyJru7kMDX8RYSc486sDqVOP1kUdotthD3YjJ57iTBN3N7MMtL1qdVoPW2YmCnNnWscyidmPe6Gw== "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14": version "7.1.19" @@ -1954,9 +1954,9 @@ integrity sha512-Jus9s4CDbqwocc5pOAnh8ShfrnMcPHuJYzVcSUU7lrh8Ni5HuIqX3oilL86p3dlTrk0LzHRCgA/GQ7uNCw6l2Q== "@types/minimatch@*": - version "5.1.1" - resolved "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.1.tgz#b1429c0c016cd50e105f3166bf179f6918b7365f" - integrity sha512-v55NF6Dz0wrj14Rn8iEABTWrhYRmgkJYuokduunSiq++t3hZ9VZ6dvcDt+850Pm5sGJZk8RaHzkFCXPxVINZ+g== + version "5.1.2" + resolved "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" + integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA== "@types/minimatch@^3.0.3", "@types/minimatch@^3.0.5": version "3.0.5" @@ -1981,19 +1981,19 @@ integrity sha512-uv53RrNdhbkV/3VmVCtfImfYCWC3GTTRn3R11Whni3EJ+gb178tkZBVNj2edLY5CMrB749dQi+SJkg87jsN8UQ== "@types/node@*", "@types/node@>= 8": - version "18.7.14" - resolved "https://registry.npmjs.org/@types/node/-/node-18.7.14.tgz#0fe081752a3333392d00586d815485a17c2cf3c9" - integrity sha512-6bbDaETVi8oyIARulOE9qF1/Qdi/23z6emrUh0fNJRUmjznqrixD4MpGDdgOFk5Xb0m2H6Xu42JGdvAxaJR/wA== + version "18.7.15" + resolved "https://registry.npmjs.org/@types/node/-/node-18.7.15.tgz#20ae1ec80c57ee844b469f968a1cd511d4088b29" + integrity sha512-XnjpaI8Bgc3eBag2Aw4t2Uj/49lLBSStHWfqKvIuXD7FIrZyMLWp8KuAFHAqxMZYTF9l08N1ctUn9YNybZJVmQ== -"@types/node@^14.18.26": - version "14.18.26" - resolved "https://registry.npmjs.org/@types/node/-/node-14.18.26.tgz#239e19f8b4ea1a9eb710528061c1d733dc561996" - integrity sha512-0b+utRBSYj8L7XAp0d+DX7lI4cSmowNaaTkk6/1SKzbKkG+doLuPusB9EOvzLJ8ahJSk03bTLIL6cWaEd4dBKA== +"@types/node@^14.18.27": + version "14.18.27" + resolved "https://registry.npmjs.org/@types/node/-/node-14.18.27.tgz#940c1d419143fd9fbdc46ae1320b86077aef8155" + integrity sha512-DcTUcwT9xEcf4rp2UHyGAcmlqG4Mhe7acozl5vY2xzSrwP1z19ZVyjzQ6DsNUrvIadpiyZoQCTHFt4t2omYIZQ== "@types/node@^16.9.2": - version "16.11.56" - resolved "https://registry.npmjs.org/@types/node/-/node-16.11.56.tgz#dcbb617669481e158e0f1c6204d1c768cd675901" - integrity sha512-aFcUkv7EddxxOa/9f74DINReQ/celqH8DiB3fRYgVDM2Xm5QJL8sl80QKuAnGvwAsMn+H3IFA6WCrQh1CY7m1A== + version "16.11.57" + resolved "https://registry.npmjs.org/@types/node/-/node-16.11.57.tgz#786f74cef16acf2c5eb11795b6c3f7ae93596662" + integrity sha512-diBb5AE2V8h9Fs9zEDtBwSeLvIACng/aAkdZ3ujMV+cGuIQ9Nc/V+wQqurk9HJp8ni5roBxQHW21z/ZYbGDivg== "@types/normalize-package-data@^2.4.0": version "2.4.1" @@ -2138,13 +2138,13 @@ tsutils "^3.21.0" "@typescript-eslint/eslint-plugin@^5": - version "5.36.1" - resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.36.1.tgz#471f64dc53600025e470dad2ca4a9f2864139019" - integrity sha512-iC40UK8q1tMepSDwiLbTbMXKDxzNy+4TfPWgIL661Ym0sD42vRcQU93IsZIrmi+x292DBr60UI/gSwfdVYexCA== + version "5.36.2" + resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.36.2.tgz#6df092a20e0f9ec748b27f293a12cb39d0c1fe4d" + integrity sha512-OwwR8LRwSnI98tdc2z7mJYgY60gf7I9ZfGjN5EjCwwns9bdTuQfAXcsjSB2wSQ/TVNYSGKf4kzVXbNGaZvwiXw== dependencies: - "@typescript-eslint/scope-manager" "5.36.1" - "@typescript-eslint/type-utils" "5.36.1" - "@typescript-eslint/utils" "5.36.1" + "@typescript-eslint/scope-manager" "5.36.2" + "@typescript-eslint/type-utils" "5.36.2" + "@typescript-eslint/utils" "5.36.2" debug "^4.3.4" functional-red-black-tree "^1.0.1" ignore "^5.2.0" @@ -2175,13 +2175,13 @@ debug "^4.3.1" "@typescript-eslint/parser@^5": - version "5.36.1" - resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.36.1.tgz#931c22c7bacefd17e29734628cdec8b2acdcf1ce" - integrity sha512-/IsgNGOkBi7CuDfUbwt1eOqUXF9WGVBW9dwEe1pi+L32XrTsZIgmDFIi2RxjzsvB/8i+MIf5JIoTEH8LOZ368A== + version "5.36.2" + resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.36.2.tgz#3ddf323d3ac85a25295a55fcb9c7a49ab4680ddd" + integrity sha512-qS/Kb0yzy8sR0idFspI9Z6+t7mqk/oRjnAYfewG+VN73opAUvmYL3oPIMmgOX6CnQS6gmVIXGshlb5RY/R22pA== dependencies: - "@typescript-eslint/scope-manager" "5.36.1" - "@typescript-eslint/types" "5.36.1" - "@typescript-eslint/typescript-estree" "5.36.1" + "@typescript-eslint/scope-manager" "5.36.2" + "@typescript-eslint/types" "5.36.2" + "@typescript-eslint/typescript-estree" "5.36.2" debug "^4.3.4" "@typescript-eslint/scope-manager@4.33.0": @@ -2192,21 +2192,21 @@ "@typescript-eslint/types" "4.33.0" "@typescript-eslint/visitor-keys" "4.33.0" -"@typescript-eslint/scope-manager@5.36.1": - version "5.36.1" - resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.36.1.tgz#23c49b7ddbcffbe09082e6694c2524950766513f" - integrity sha512-pGC2SH3/tXdu9IH3ItoqciD3f3RRGCh7hb9zPdN2Drsr341zgd6VbhP5OHQO/reUqihNltfPpMpTNihFMarP2w== +"@typescript-eslint/scope-manager@5.36.2": + version "5.36.2" + resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.36.2.tgz#a75eb588a3879ae659514780831370642505d1cd" + integrity sha512-cNNP51L8SkIFSfce8B1NSUBTJTu2Ts4nWeWbFrdaqjmn9yKrAaJUBHkyTZc0cL06OFHpb+JZq5AUHROS398Orw== dependencies: - "@typescript-eslint/types" "5.36.1" - "@typescript-eslint/visitor-keys" "5.36.1" + "@typescript-eslint/types" "5.36.2" + "@typescript-eslint/visitor-keys" "5.36.2" -"@typescript-eslint/type-utils@5.36.1": - version "5.36.1" - resolved "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.36.1.tgz#016fc2bff6679f54c0b2df848a493f0ca3d4f625" - integrity sha512-xfZhfmoQT6m3lmlqDvDzv9TiCYdw22cdj06xY0obSznBsT///GK5IEZQdGliXpAOaRL34o8phEvXzEo/VJx13Q== +"@typescript-eslint/type-utils@5.36.2": + version "5.36.2" + resolved "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.36.2.tgz#752373f4babf05e993adf2cd543a763632826391" + integrity sha512-rPQtS5rfijUWLouhy6UmyNquKDPhQjKsaKH0WnY6hl/07lasj8gPaH2UD8xWkePn6SC+jW2i9c2DZVDnL+Dokw== dependencies: - "@typescript-eslint/typescript-estree" "5.36.1" - "@typescript-eslint/utils" "5.36.1" + "@typescript-eslint/typescript-estree" "5.36.2" + "@typescript-eslint/utils" "5.36.2" debug "^4.3.4" tsutils "^3.21.0" @@ -2215,10 +2215,10 @@ resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72" integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ== -"@typescript-eslint/types@5.36.1": - version "5.36.1" - resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.36.1.tgz#1cf0e28aed1cb3ee676917966eb23c2f8334ce2c" - integrity sha512-jd93ShpsIk1KgBTx9E+hCSEuLCUFwi9V/urhjOWnOaksGZFbTOxAT47OH2d4NLJnLhkVD+wDbB48BuaycZPLBg== +"@typescript-eslint/types@5.36.2": + version "5.36.2" + resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.36.2.tgz#a5066e500ebcfcee36694186ccc57b955c05faf9" + integrity sha512-9OJSvvwuF1L5eS2EQgFUbECb99F0mwq501w0H0EkYULkhFa19Qq7WFbycdw1PexAc929asupbZcgjVIe6OK/XQ== "@typescript-eslint/typescript-estree@4.33.0", "@typescript-eslint/typescript-estree@^4.33.0": version "4.33.0" @@ -2233,28 +2233,28 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/typescript-estree@5.36.1": - version "5.36.1" - resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.36.1.tgz#b857f38d6200f7f3f4c65cd0a5afd5ae723f2adb" - integrity sha512-ih7V52zvHdiX6WcPjsOdmADhYMDN15SylWRZrT2OMy80wzKbc79n8wFW0xpWpU0x3VpBz/oDgTm2xwDAnFTl+g== +"@typescript-eslint/typescript-estree@5.36.2": + version "5.36.2" + resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.36.2.tgz#0c93418b36c53ba0bc34c61fe9405c4d1d8fe560" + integrity sha512-8fyH+RfbKc0mTspfuEjlfqA4YywcwQK2Amcf6TDOwaRLg7Vwdu4bZzyvBZp4bjt1RRjQ5MDnOZahxMrt2l5v9w== dependencies: - "@typescript-eslint/types" "5.36.1" - "@typescript-eslint/visitor-keys" "5.36.1" + "@typescript-eslint/types" "5.36.2" + "@typescript-eslint/visitor-keys" "5.36.2" 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.36.1": - version "5.36.1" - resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.36.1.tgz#136d5208cc7a3314b11c646957f8f0b5c01e07ad" - integrity sha512-lNj4FtTiXm5c+u0pUehozaUWhh7UYKnwryku0nxJlYUEWetyG92uw2pr+2Iy4M/u0ONMKzfrx7AsGBTCzORmIg== +"@typescript-eslint/utils@5.36.2": + version "5.36.2" + resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.36.2.tgz#b01a76f0ab244404c7aefc340c5015d5ce6da74c" + integrity sha512-uNcopWonEITX96v9pefk9DC1bWMdkweeSsewJ6GeC7L6j2t0SJywisgkr9wUTtXk90fi2Eljj90HSHm3OGdGRg== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.36.1" - "@typescript-eslint/types" "5.36.1" - "@typescript-eslint/typescript-estree" "5.36.1" + "@typescript-eslint/scope-manager" "5.36.2" + "@typescript-eslint/types" "5.36.2" + "@typescript-eslint/typescript-estree" "5.36.2" eslint-scope "^5.1.1" eslint-utils "^3.0.0" @@ -2266,12 +2266,12 @@ "@typescript-eslint/types" "4.33.0" eslint-visitor-keys "^2.0.0" -"@typescript-eslint/visitor-keys@5.36.1": - version "5.36.1" - resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.36.1.tgz#7731175312d65738e501780f923896d200ad1615" - integrity sha512-ojB9aRyRFzVMN3b5joSYni6FAS10BBSCAfKJhjJAV08t/a95aM6tAhz+O1jF+EtgxktuSO3wJysp2R+Def/IWQ== +"@typescript-eslint/visitor-keys@5.36.2": + version "5.36.2" + resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.36.2.tgz#2f8f78da0a3bad3320d2ac24965791ac39dace5a" + integrity sha512-BtRvSR6dEdrNt7Net2/XDjbYKU5Ml6GqJgVfXT0CxTCJlnIqK7rAGreuWKMT2t8cFUT2Msv5oxw0GMRD7T5J7A== dependencies: - "@typescript-eslint/types" "5.36.1" + "@typescript-eslint/types" "5.36.2" eslint-visitor-keys "^3.3.0" "@xmldom/xmldom@^0.8.2": @@ -2670,9 +2670,9 @@ aws-sdk-mock@5.6.0: traverse "^0.6.6" aws-sdk@^2.1093.0, aws-sdk@^2.596.0, aws-sdk@^2.848.0, aws-sdk@^2.928.0: - version "2.1206.0" - resolved "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1206.0.tgz#8c5ed249952fb86b29cb4cf037e03b3136247341" - integrity sha512-rQckMXO+O1j7RxuC9Ic6+OjroLm4t9vYHCubSeSEj8bJCFEh/1aRO1eiMHcLGhI4jl3LijfTCX56YZJjDp2PdQ== + version "2.1210.0" + resolved "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1210.0.tgz#3e52047901bcf726bb34bac0d3ea2b835f78d9cb" + integrity sha512-cMrQoic+xJhAVgbaWawUflUp9fUd5h38+rjCdiakqKj12gFpVvvwyvYso8kG5MgRUlxNH+v+7sWRe82xHJsrsg== dependencies: buffer "4.9.2" events "1.1.1" @@ -3040,9 +3040,9 @@ camelcase@^6.2.0, camelcase@^6.3.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001370: - version "1.0.30001387" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001387.tgz#90d2b9bdfcc3ab9a5b9addee00a25ef86c9e2e1e" - integrity sha512-fKDH0F1KOJvR+mWSOvhj8lVRr/Q/mc5u5nabU2vi1/sgvlSqEsE8dOq0Hy/BqVbDkCYQPRRHB1WRjW6PGB/7PA== + version "1.0.30001390" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001390.tgz#158a43011e7068ef7fc73590e9fd91a7cece5e7f" + integrity sha512-sS4CaUM+/+vqQUlCvCJ2WtDlV81aWtHhqeEVkLokVJJa3ViN4zDxAGfq9R8i1m90uGHxo99cy10Od+lvn3hf0g== case@1.6.3, case@^1.6.3: version "1.6.3" @@ -3054,16 +3054,16 @@ 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.16: - version "0.1.16" - resolved "https://registry.npmjs.org/cdk-generate-synthetic-examples/-/cdk-generate-synthetic-examples-0.1.16.tgz#6c9829c14da742de94b47bdbb0daab2fe3142ef2" - integrity sha512-it4o7ie2ZN4HwA7V39eSDtpNdeHyXhUl3fBWH4Z8q75pH3SeoilqEV76fTampgEjPPb8+Nlyv4+UGtYsU3YFgw== +cdk-generate-synthetic-examples@^0.1.17: + version "0.1.17" + resolved "https://registry.npmjs.org/cdk-generate-synthetic-examples/-/cdk-generate-synthetic-examples-0.1.17.tgz#a5c8e2fc2f16e1cff41072439bcfeeed61e7283c" + integrity sha512-HMLmama/jfaYXi7fAmH1W1kxAjSGxOq7bBcTlefdsb2vmYLjp46U1q7uAFnd/fF+RnFy4pn1psFVgqVVj5meng== dependencies: - "@jsii/spec" "^1.64.0" + "@jsii/spec" "^1.67.0" fs-extra "^10.1.0" - jsii "^1.64.0" - jsii-reflect "^1.64.0" - jsii-rosetta "^1.64.0" + jsii "^1.67.0" + jsii-reflect "^1.67.0" + jsii-rosetta "^1.67.0" yargs "^17.5.1" cdk8s-plus-21@^2.0.0-beta.12: @@ -3074,10 +3074,10 @@ cdk8s-plus-21@^2.0.0-beta.12: minimatch "^3.1.2" safe-stable-stringify "*" -cdk8s@^2.4.17: - version "2.4.17" - resolved "https://registry.npmjs.org/cdk8s/-/cdk8s-2.4.17.tgz#377a76f13c2783d4e0b6721004247c7b3cef698d" - integrity sha512-zxMwRlWfSIkqLnRvbsmQTuVuz71kAAI+SgD5flwjjTf2ClYvxgfJsc9tJvLKHu8KloeYPS6NBem7Y3hUi5Yh3A== +cdk8s@^2.4.20: + version "2.4.20" + resolved "https://registry.npmjs.org/cdk8s/-/cdk8s-2.4.20.tgz#a796d819320ee2db8f8201cd65f11482d381f802" + integrity sha512-auWfcJEiqObMDvQMfizBgDZO0jEPioGB7vDOqBmFIuARwouOGRm9M6hpeyoLEuCnsx9DXAwD7iAB15Z506RZZw== dependencies: fast-json-patch "^3.1.1" follow-redirects "^1.15.1" @@ -3269,10 +3269,10 @@ co@^4.6.0: resolved "https://registry.npmjs.org/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== -codemaker@^1.66.0: - version "1.66.0" - resolved "https://registry.npmjs.org/codemaker/-/codemaker-1.66.0.tgz#834158b43beabfed15069e7b19a689f4390a8711" - integrity sha512-GSNazNdimFf5/hnY9dZUiAX67SM8erRkwcynQgw7v1yeoytrkenQ1253sbdY2XqOpwa2G3i/f9zzDr0kwVykuw== +codemaker@^1.67.0: + version "1.67.0" + resolved "https://registry.npmjs.org/codemaker/-/codemaker-1.67.0.tgz#adba45ef5058219cbd84e7b4bd70dfa60b98c3a2" + integrity sha512-ChqnwbXIDIq8EAju+OMOnuzJ5MQWXvFaf4PMZo2RLbLiqUfx4+ATv/i1y0rY5uZ7nvKC8lRfwmbRsgsbWQHAhA== dependencies: camelcase "^6.3.0" decamelize "^5.0.1" @@ -3421,9 +3421,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.92" - resolved "https://registry.npmjs.org/constructs/-/constructs-10.1.92.tgz#3341afb381c3127a3ff52517fbafaf1c4fcd3db8" - integrity sha512-ksULq4jw2mQyWGBJoxVktwhwsIkkWZFoxeCsWbiB9dt1hkXbK6z18R7FRsS/Ku7h6eGZo+odi699zC9hfZhvTg== + version "10.1.95" + resolved "https://registry.npmjs.org/constructs/-/constructs-10.1.95.tgz#9169d4c9d9b6d49d92750c6652c13b58fd29cdd7" + integrity sha512-1DQi86eF+FoKLfOnR+lNraxZ9cnTdK5EfnbHiR3Nto8kcOdIeaL4TdSJXKhnjs5g562mGUp6FLPBJH27/DNmJw== conventional-changelog-angular@^5.0.12: version "5.0.13" @@ -4136,9 +4136,9 @@ ecc-jsbn@~0.1.1: safer-buffer "^2.1.0" electron-to-chromium@^1.4.202: - version "1.4.237" - resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.237.tgz#c695c5fedc3bb48f04ba1b39470c5aef2aaafd84" - integrity sha512-vxVyGJcsgArNOVUJcXm+7iY3PJAfmSapEszQD1HbyPLl0qoCmNQ1o/EX3RI7Et5/88In9oLxX3SGF8J3orkUgA== + version "1.4.243" + resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.243.tgz#9d5f1b10eafd6e434b687a88f1e7b0441dee168a" + integrity sha512-BgLD2gBX43OSXwlT01oYRRD5NIB4n3okTRxkzEAC6G0SZG4TTlyrWMjbOo0fajCwqwpRtMHXQNMjtRN6qpNtfw== emittery@^0.8.1: version "0.8.1" @@ -4212,15 +4212,15 @@ error-ex@^1.3.1: is-arrayish "^0.2.1" es-abstract@^1.19.0, es-abstract@^1.19.1, es-abstract@^1.19.2, es-abstract@^1.19.5, es-abstract@^1.20.0, es-abstract@^1.20.1: - version "1.20.1" - resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.1.tgz#027292cd6ef44bd12b1913b828116f54787d1814" - integrity sha512-WEm2oBhfoI2sImeM4OF2zE2V3BYdSF+KnSi9Sidz51fQHd7+JuF8Xgcj9/0o+OWeIeIS/MiuNnlruQrJf16GQA== + version "1.20.2" + resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.2.tgz#8495a07bc56d342a3b8ea3ab01bd986700c2ccb3" + integrity sha512-XxXQuVNrySBNlEkTYJoDNFe5+s2yIOpzq80sUHEdPdQr0S5nTLz4ZPPPswNIpKseDDUS5yghX1gfLIHQZ1iNuQ== dependencies: call-bind "^1.0.2" es-to-primitive "^1.2.1" function-bind "^1.1.1" function.prototype.name "^1.1.5" - get-intrinsic "^1.1.1" + get-intrinsic "^1.1.2" get-symbol-description "^1.0.0" has "^1.0.3" has-property-descriptors "^1.0.0" @@ -4232,9 +4232,9 @@ es-abstract@^1.19.0, es-abstract@^1.19.1, es-abstract@^1.19.2, es-abstract@^1.19 is-shared-array-buffer "^1.0.2" is-string "^1.0.7" is-weakref "^1.0.2" - object-inspect "^1.12.0" + object-inspect "^1.12.2" object-keys "^1.1.1" - object.assign "^4.1.2" + object.assign "^4.1.4" regexp.prototype.flags "^1.4.3" string.prototype.trimend "^1.0.5" string.prototype.trimstart "^1.0.5" @@ -4302,132 +4302,132 @@ es6-weak-map@^2.0.3: es6-iterator "^2.0.3" es6-symbol "^3.1.1" -esbuild-android-64@0.15.6: - version "0.15.6" - resolved "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.15.6.tgz#baaed943ca510c2ad546e116728132e76d1d2044" - integrity sha512-Z1CHSgB1crVQi2LKSBwSkpaGtaloVz0ZIYcRMsvHc3uSXcR/x5/bv9wcZspvH/25lIGTaViosciS/NS09ERmVA== - -esbuild-android-arm64@0.15.6: - version "0.15.6" - resolved "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.15.6.tgz#1c33c73d4c074969e014e31958116460c8e75a7a" - integrity sha512-mvM+gqNxqKm2pCa3dnjdRzl7gIowuc4ga7P7c3yHzs58Im8v/Lfk1ixSgQ2USgIywT48QWaACRa3F4MG7djpSw== - -esbuild-darwin-64@0.15.6: - version "0.15.6" - resolved "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.15.6.tgz#388592ba61bf31993d79f6311f7452aa1ef255b9" - integrity sha512-BsfVt3usScAfGlXJiGtGamwVEOTM8AiYiw1zqDWhGv6BncLXCnTg1As+90mxWewdTZKq3iIy8s9g8CKkrrAXVw== - -esbuild-darwin-arm64@0.15.6: - version "0.15.6" - resolved "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.6.tgz#194e987849dc4688654008a1792f26e948f52e74" - integrity sha512-CnrAeJaEpPakUobhqO4wVSA4Zm6TPaI5UY4EsI62j9mTrjIyQPXA1n4Ju6Iu5TVZRnEqV6q8blodgYJ6CJuwCA== - -esbuild-freebsd-64@0.15.6: - version "0.15.6" - resolved "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.6.tgz#daa72faee585ec2ec27cc65e86a6ce0786373e66" - integrity sha512-+qFdmqi+jkAsxsNJkaWVrnxEUUI50nu6c3MBVarv3RCDCbz7ZS1a4ZrdkwEYFnKcVWu6UUE0Kkb1SQ1yGEG6sg== - -esbuild-freebsd-arm64@0.15.6: - version "0.15.6" - resolved "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.6.tgz#70c8a2a30bf6bb9d547a0d8dc93aa015ec4f77f9" - integrity sha512-KtQkQOhnNciXm2yrTYZMD3MOm2zBiiwFSU+dkwNbcfDumzzUprr1x70ClTdGuZwieBS1BM/k0KajRQX7r504Xw== - -esbuild-linux-32@0.15.6: - version "0.15.6" - resolved "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.15.6.tgz#d69ed2335b2d68c00b3248254b432172077b7ced" - integrity sha512-IAkDNz3TpxwISTGVdQijwyHBZrbFgLlRi5YXcvaEHtgbmayLSDcJmH5nV1MFgo/x2QdKcHBkOYHdjhKxUAcPwg== - -esbuild-linux-64@0.15.6: - version "0.15.6" - resolved "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.15.6.tgz#dca821e8f129cccde23ac947fd0d4bea3b333808" - integrity sha512-gQPksyrEYfA4LJwyfTQWAZaVZCx4wpaLrSzo2+Xc9QLC+i/sMWmX31jBjrn4nLJCd79KvwCinto36QC7BEIU/A== - -esbuild-linux-arm64@0.15.6: - version "0.15.6" - resolved "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.6.tgz#c9e8bc86f3c58a7c8ff1ded5880c6a39ade7621b" - integrity sha512-aovDkclFa6C9EdZVBuOXxqZx83fuoq8097xZKhEPSygwuy4Lxs8J4anHG7kojAsR+31lfUuxzOo2tHxv7EiNHA== - -esbuild-linux-arm@0.15.6: - version "0.15.6" - resolved "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.15.6.tgz#354ecad0223f5b176995cf4462560eec2633de24" - integrity sha512-xZ0Bq2aivsthDjA/ytQZzxrxIZbG0ATJYMJxNeOIBc1zUjpbVpzBKgllOZMsTSXMHFHGrow6TnCcgwqY0+oEoQ== - -esbuild-linux-mips64le@0.15.6: - version "0.15.6" - resolved "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.6.tgz#f4fb941a4ff0af437deed69a2e0712983c8fff3e" - integrity sha512-wVpW8wkWOGizsCqCwOR/G3SHwhaecpGy3fic9BF1r7vq4djLjUcA8KunDaBCjJ6TgLQFhJ98RjDuyEf8AGjAvw== - -esbuild-linux-ppc64le@0.15.6: - version "0.15.6" - resolved "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.6.tgz#19774a8b52c77173f2d4f171b8a8cf839b12e686" - integrity sha512-z6w6gsPH/Y77uchocluDC8tkCg9rfkcPTePzZKNr879bF4tu7j9t255wuNOCE396IYEGxY7y8u2HJ9i7kjCLVw== - -esbuild-linux-riscv64@0.15.6: - version "0.15.6" - resolved "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.6.tgz#66bd83b065c4a1e623df02c122bc7e4e15fd8486" - integrity sha512-pfK/3MJcmbfU399TnXW5RTPS1S+ID6ra+CVj9TFZ2s0q9Ja1F5A1VirUUvViPkjiw+Kq3zveyn6U09Wg1zJXrw== - -esbuild-linux-s390x@0.15.6: - version "0.15.6" - resolved "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.6.tgz#1e024bddc75afe8dc70ed48fc9627af770d7f34b" - integrity sha512-OZeeDu32liefcwAE63FhVqM4heWTC8E3MglOC7SK0KYocDdY/6jyApw0UDkDHlcEK9mW6alX/SH9r3PDjcCo/Q== - -esbuild-netbsd-64@0.15.6: - version "0.15.6" - resolved "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.6.tgz#c11477d197f059c8794ee1691e3399201f7c4b9a" - integrity sha512-kaxw61wcHMyiEsSsi5ut1YYs/hvTC2QkxJwyRvC2Cnsz3lfMLEu8zAjpBKWh9aU/N0O/gsRap4wTur5GRuSvBA== - -esbuild-openbsd-64@0.15.6: - version "0.15.6" - resolved "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.6.tgz#b29e7faed5b8d2aeaf3884c47c1a96b1cba8e263" - integrity sha512-CuoY60alzYfIZapUHqFXqXbj88bbRJu8Fp9okCSHRX2zWIcGz4BXAHXiG7dlCye5nFVrY72psesLuWdusyf2qw== - -esbuild-sunos-64@0.15.6: - version "0.15.6" - resolved "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.15.6.tgz#9668f39e47179f50c0435040904b9c6e10e84a70" - integrity sha512-1ceefLdPWcd1nW/ZLruPEYxeUEAVX0YHbG7w+BB4aYgfknaLGotI/ZvPWUZpzhC8l1EybrVlz++lm3E6ODIJOg== - -esbuild-windows-32@0.15.6: - version "0.15.6" - resolved "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.15.6.tgz#9ddcd56e3c4fb9729a218c713c4e76bdbc1678b4" - integrity sha512-pBqdOsKqCD5LRYiwF29PJRDJZi7/Wgkz46u3d17MRFmrLFcAZDke3nbdDa1c8YgY78RiemudfCeAemN8EBlIpA== - -esbuild-windows-64@0.15.6: - version "0.15.6" - resolved "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.15.6.tgz#1eaadeadfd995e9d065d35cb3e9f02607202f339" - integrity sha512-KpPOh4aTOo//g9Pk2oVAzXMpc9Sz9n5A9sZTmWqDSXCiiachfFhbuFlsKBGATYCVitXfmBIJ4nNYYWSOdz4hQg== - -esbuild-windows-arm64@0.15.6: - version "0.15.6" - resolved "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.6.tgz#e18a778d354fc2ca2306688f3fedad8a3e57819e" - integrity sha512-DB3G2x9OvFEa00jV+OkDBYpufq5x/K7a6VW6E2iM896DG4ZnAvJKQksOsCPiM1DUaa+DrijXAQ/ZOcKAqf/3Hg== - -esbuild@^0.15.6: - version "0.15.6" - resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.15.6.tgz#626e5941b98de506b862047be3c4b33f89278923" - integrity sha512-sgLOv3l4xklvXzzczhRwKRotyrfyZ2i1fCS6PTOLPd9wevDPArGU8HFtHrHCOcsMwTjLjzGm15gvC8uxVzQf+w== +esbuild-android-64@0.15.7: + version "0.15.7" + resolved "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.15.7.tgz#a521604d8c4c6befc7affedc897df8ccde189bea" + integrity sha512-p7rCvdsldhxQr3YHxptf1Jcd86dlhvc3EQmQJaZzzuAxefO9PvcI0GLOa5nCWem1AJ8iMRu9w0r5TG8pHmbi9w== + +esbuild-android-arm64@0.15.7: + version "0.15.7" + resolved "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.15.7.tgz#307b81f1088bf1e81dfe5f3d1d63a2d2a2e3e68e" + integrity sha512-L775l9ynJT7rVqRM5vo+9w5g2ysbOCfsdLV4CWanTZ1k/9Jb3IYlQ06VCI1edhcosTYJRECQFJa3eAvkx72eyQ== + +esbuild-darwin-64@0.15.7: + version "0.15.7" + resolved "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.15.7.tgz#270117b0c4ec6bcbc5cf3a297a7d11954f007e11" + integrity sha512-KGPt3r1c9ww009t2xLB6Vk0YyNOXh7hbjZ3EecHoVDxgtbUlYstMPDaReimKe6eOEfyY4hBEEeTvKwPsiH5WZg== + +esbuild-darwin-arm64@0.15.7: + version "0.15.7" + resolved "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.7.tgz#97851eacd11dacb7719713602e3319e16202fc77" + integrity sha512-kBIHvtVqbSGajN88lYMnR3aIleH3ABZLLFLxwL2stiuIGAjGlQW741NxVTpUHQXUmPzxi6POqc9npkXa8AcSZQ== + +esbuild-freebsd-64@0.15.7: + version "0.15.7" + resolved "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.7.tgz#1de15ffaf5ae916aa925800aa6d02579960dd8c4" + integrity sha512-hESZB91qDLV5MEwNxzMxPfbjAhOmtfsr9Wnuci7pY6TtEh4UDuevmGmkUIjX/b+e/k4tcNBMf7SRQ2mdNuK/HQ== + +esbuild-freebsd-arm64@0.15.7: + version "0.15.7" + resolved "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.7.tgz#0f160dbf5c9a31a1d8dd87acbbcb1a04b7031594" + integrity sha512-dLFR0ChH5t+b3J8w0fVKGvtwSLWCv7GYT2Y2jFGulF1L5HftQLzVGN+6pi1SivuiVSmTh28FwUhi9PwQicXI6Q== + +esbuild-linux-32@0.15.7: + version "0.15.7" + resolved "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.15.7.tgz#422eb853370a5e40bdce8b39525380de11ccadec" + integrity sha512-v3gT/LsONGUZcjbt2swrMjwxo32NJzk+7sAgtxhGx1+ZmOFaTRXBAi1PPfgpeo/J//Un2jIKm/I+qqeo4caJvg== + +esbuild-linux-64@0.15.7: + version "0.15.7" + resolved "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.15.7.tgz#f89c468453bb3194b14f19dc32e0b99612e81d2b" + integrity sha512-LxXEfLAKwOVmm1yecpMmWERBshl+Kv5YJ/1KnyAr6HRHFW8cxOEsEfisD3sVl/RvHyW//lhYUVSuy9jGEfIRAQ== + +esbuild-linux-arm64@0.15.7: + version "0.15.7" + resolved "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.7.tgz#68a79d6eb5e032efb9168a0f340ccfd33d6350a1" + integrity sha512-P3cfhudpzWDkglutWgXcT2S7Ft7o2e3YDMrP1n0z2dlbUZghUkKCyaWw0zhp4KxEEzt/E7lmrtRu/pGWnwb9vw== + +esbuild-linux-arm@0.15.7: + version "0.15.7" + resolved "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.15.7.tgz#2b7c784d0b3339878013dfa82bf5eaf82c7ce7d3" + integrity sha512-JKgAHtMR5f75wJTeuNQbyznZZa+pjiUHV7sRZp42UNdyXC6TiUYMW/8z8yIBAr2Fpad8hM1royZKQisqPABPvQ== + +esbuild-linux-mips64le@0.15.7: + version "0.15.7" + resolved "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.7.tgz#bb8330a50b14aa84673816cb63cc6c8b9beb62cc" + integrity sha512-T7XKuxl0VpeFLCJXub6U+iybiqh0kM/bWOTb4qcPyDDwNVhLUiPcGdG2/0S7F93czUZOKP57YiLV8YQewgLHKw== + +esbuild-linux-ppc64le@0.15.7: + version "0.15.7" + resolved "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.7.tgz#52544e7fa992811eb996674090d0bc41f067a14b" + integrity sha512-6mGuC19WpFN7NYbecMIJjeQgvDb5aMuvyk0PDYBJrqAEMkTwg3Z98kEKuCm6THHRnrgsdr7bp4SruSAxEM4eJw== + +esbuild-linux-riscv64@0.15.7: + version "0.15.7" + resolved "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.7.tgz#a43ae60697992b957e454cbb622f7ee5297e8159" + integrity sha512-uUJsezbswAYo/X7OU/P+PuL/EI9WzxsEQXDekfwpQ23uGiooxqoLFAPmXPcRAt941vjlY9jtITEEikWMBr+F/g== + +esbuild-linux-s390x@0.15.7: + version "0.15.7" + resolved "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.7.tgz#8c76a125dd10a84c166294d77416caaf5e1c7b64" + integrity sha512-+tO+xOyTNMc34rXlSxK7aCwJgvQyffqEM5MMdNDEeMU3ss0S6wKvbBOQfgd5jRPblfwJ6b+bKiz0g5nABpY0QQ== + +esbuild-netbsd-64@0.15.7: + version "0.15.7" + resolved "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.7.tgz#19b2e75449d7d9c32b5d8a222bac2f1e0c3b08fd" + integrity sha512-yVc4Wz+Pu3cP5hzm5kIygNPrjar/v5WCSoRmIjCPWfBVJkZNb5brEGKUlf+0Y759D48BCWa0WHrWXaNy0DULTQ== + +esbuild-openbsd-64@0.15.7: + version "0.15.7" + resolved "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.7.tgz#1357b2bf72fd037d9150e751420a1fe4c8618ad7" + integrity sha512-GsimbwC4FSR4lN3wf8XmTQ+r8/0YSQo21rWDL0XFFhLHKlzEA4SsT1Tl8bPYu00IU6UWSJ+b3fG/8SB69rcuEQ== + +esbuild-sunos-64@0.15.7: + version "0.15.7" + resolved "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.15.7.tgz#87ab2c604592a9c3c763e72969da0d72bcde91d2" + integrity sha512-8CDI1aL/ts0mDGbWzjEOGKXnU7p3rDzggHSBtVryQzkSOsjCHRVe0iFYUuhczlxU1R3LN/E7HgUO4NXzGGP/Ag== + +esbuild-windows-32@0.15.7: + version "0.15.7" + resolved "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.15.7.tgz#c81e688c0457665a8d463a669e5bf60870323e99" + integrity sha512-cOnKXUEPS8EGCzRSFa1x6NQjGhGsFlVgjhqGEbLTPsA7x4RRYiy2RKoArNUU4iR2vHmzqS5Gr84MEumO/wxYKA== + +esbuild-windows-64@0.15.7: + version "0.15.7" + resolved "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.15.7.tgz#2421d1ae34b0561a9d6767346b381961266c4eff" + integrity sha512-7MI08Ec2sTIDv+zH6StNBKO+2hGUYIT42GmFyW6MBBWWtJhTcQLinKS6ldIN1d52MXIbiJ6nXyCJ+LpL4jBm3Q== + +esbuild-windows-arm64@0.15.7: + version "0.15.7" + resolved "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.7.tgz#7d5e9e060a7b454cb2f57f84a3f3c23c8f30b7d2" + integrity sha512-R06nmqBlWjKHddhRJYlqDd3Fabx9LFdKcjoOy08YLimwmsswlFBJV4rXzZCxz/b7ZJXvrZgj8DDv1ewE9+StMw== + +esbuild@^0.15.7: + version "0.15.7" + resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.15.7.tgz#8a1f1aff58671a3199dd24df95314122fc1ddee8" + integrity sha512-7V8tzllIbAQV1M4QoE52ImKu8hT/NLGlGXkiDsbEU5PS6K8Mn09ZnYoS+dcmHxOS9CRsV4IRAMdT3I67IyUNXw== optionalDependencies: - "@esbuild/linux-loong64" "0.15.6" - esbuild-android-64 "0.15.6" - esbuild-android-arm64 "0.15.6" - esbuild-darwin-64 "0.15.6" - esbuild-darwin-arm64 "0.15.6" - esbuild-freebsd-64 "0.15.6" - esbuild-freebsd-arm64 "0.15.6" - esbuild-linux-32 "0.15.6" - esbuild-linux-64 "0.15.6" - esbuild-linux-arm "0.15.6" - esbuild-linux-arm64 "0.15.6" - esbuild-linux-mips64le "0.15.6" - esbuild-linux-ppc64le "0.15.6" - esbuild-linux-riscv64 "0.15.6" - esbuild-linux-s390x "0.15.6" - esbuild-netbsd-64 "0.15.6" - esbuild-openbsd-64 "0.15.6" - esbuild-sunos-64 "0.15.6" - esbuild-windows-32 "0.15.6" - esbuild-windows-64 "0.15.6" - esbuild-windows-arm64 "0.15.6" + "@esbuild/linux-loong64" "0.15.7" + esbuild-android-64 "0.15.7" + esbuild-android-arm64 "0.15.7" + esbuild-darwin-64 "0.15.7" + esbuild-darwin-arm64 "0.15.7" + esbuild-freebsd-64 "0.15.7" + esbuild-freebsd-arm64 "0.15.7" + esbuild-linux-32 "0.15.7" + esbuild-linux-64 "0.15.7" + esbuild-linux-arm "0.15.7" + esbuild-linux-arm64 "0.15.7" + esbuild-linux-mips64le "0.15.7" + esbuild-linux-ppc64le "0.15.7" + esbuild-linux-riscv64 "0.15.7" + esbuild-linux-s390x "0.15.7" + esbuild-netbsd-64 "0.15.7" + esbuild-openbsd-64 "0.15.7" + esbuild-sunos-64 "0.15.7" + esbuild-windows-32 "0.15.7" + esbuild-windows-64 "0.15.7" + esbuild-windows-arm64 "0.15.7" escalade@^3.1.1: version "3.1.1" @@ -5253,7 +5253,7 @@ get-caller-file@^2.0.1, get-caller-file@^2.0.5: resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: +get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1, get-intrinsic@^1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz#336975123e05ad0b7ba41f152ee4aadbea6cf598" integrity sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA== @@ -6799,73 +6799,73 @@ jsesc@^2.5.1: resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== -jsii-diff@^1.66.0: - version "1.66.0" - resolved "https://registry.npmjs.org/jsii-diff/-/jsii-diff-1.66.0.tgz#945f5ad99c747e2079e79a32bd05dab182ca1b32" - integrity sha512-ZxnAhkhDhoYObac0JnOl8YbLD+CESHRr2O7d5Iuoxtm8wZFy2AVQpYrgsy5zroyv0s26g+EcDorT7pzci67Rzw== +jsii-diff@^1.67.0: + version "1.67.0" + resolved "https://registry.npmjs.org/jsii-diff/-/jsii-diff-1.67.0.tgz#b6b516f8c5da9c4d6a50024fbc8fa61ef7b388d8" + integrity sha512-dB9GgYk+g5k7Kbusyun7bgCkbh6xwVomZC8jf6KfauIcWFPeacfe3ZtArUnJ3OvJqId7UJEvfiUQjllxn2KRNQ== dependencies: - "@jsii/check-node" "1.66.0" - "@jsii/spec" "^1.66.0" + "@jsii/check-node" "1.67.0" + "@jsii/spec" "^1.67.0" fs-extra "^10.1.0" - jsii-reflect "^1.66.0" + jsii-reflect "^1.67.0" log4js "^6.6.1" yargs "^16.2.0" -jsii-pacmak@^1.66.0: - version "1.66.0" - resolved "https://registry.npmjs.org/jsii-pacmak/-/jsii-pacmak-1.66.0.tgz#991b9ca38860065f9b673e53175e2873c2007cb0" - integrity sha512-7WRyAzwJ/WvFms5zdO3+UEsOoijTn1/zNbNJMUZ+C3vUgsdUQKyKn+qa/kSSGjNeLnW5JffXWlOF3Ik9sHSXDg== +jsii-pacmak@^1.67.0: + version "1.67.0" + resolved "https://registry.npmjs.org/jsii-pacmak/-/jsii-pacmak-1.67.0.tgz#5b37bcd1e1b6cc56f59a3d0f8b8e9fd40a86bcbf" + integrity sha512-C5Lva1F4tBtZWboQwd3YFG8C7F7/IVhOq8rKHorV2tH6CX6i+L7UqdVdqTdkvBY0o1C+Jvbdca5J3E5O235eDw== dependencies: - "@jsii/check-node" "1.66.0" - "@jsii/spec" "^1.66.0" + "@jsii/check-node" "1.67.0" + "@jsii/spec" "^1.67.0" clone "^2.1.2" - codemaker "^1.66.0" + codemaker "^1.67.0" commonmark "^0.30.0" escape-string-regexp "^4.0.0" fs-extra "^10.1.0" - jsii-reflect "^1.66.0" - jsii-rosetta "^1.66.0" + jsii-reflect "^1.67.0" + jsii-rosetta "^1.67.0" semver "^7.3.7" spdx-license-list "^6.6.0" xmlbuilder "^15.1.1" yargs "^16.2.0" -jsii-reflect@^1.64.0, jsii-reflect@^1.66.0: - version "1.66.0" - resolved "https://registry.npmjs.org/jsii-reflect/-/jsii-reflect-1.66.0.tgz#c737248e68145eea8f586e0f93ca7affeb6de8cc" - integrity sha512-vkETnprRy1Iqa3Tj/cSRcK5I5a/KiVKCOcnR9+fasEqdHeTU28rqpqIEndKBc90ysKSZcldOzH0f3SyoYwEFDg== +jsii-reflect@^1.67.0: + version "1.67.0" + resolved "https://registry.npmjs.org/jsii-reflect/-/jsii-reflect-1.67.0.tgz#49a59aa96e848bb5e7eb327e5f911b1241db76dd" + integrity sha512-/4GCNkOqlo/MZZ6+Ud5iM2Y8TVcBJJMcKouGHkFEFbOrsSLY/yBa5cz1xLESz49VhucXLIzVzENtyi598yIXsg== dependencies: - "@jsii/check-node" "1.66.0" - "@jsii/spec" "^1.66.0" + "@jsii/check-node" "1.67.0" + "@jsii/spec" "^1.67.0" chalk "^4" fs-extra "^10.1.0" - oo-ascii-tree "^1.66.0" + oo-ascii-tree "^1.67.0" yargs "^16.2.0" -jsii-rosetta@^1.64.0, jsii-rosetta@^1.66.0: - version "1.66.0" - resolved "https://registry.npmjs.org/jsii-rosetta/-/jsii-rosetta-1.66.0.tgz#a0c338879a7569b6dd8b91760b05fb19366a5dc5" - integrity sha512-LS1Bdsb7OQ9foa6TxKj2TS+CQL2NXiUo4YUXjy6+c7DfcAU+Dw/9IChyRyq0iesK4JeFM3Vve3ViWzuSAUUYqg== +jsii-rosetta@^1.67.0: + version "1.67.0" + resolved "https://registry.npmjs.org/jsii-rosetta/-/jsii-rosetta-1.67.0.tgz#f2ee67511e29299cb212559340eff68b5522b551" + integrity sha512-hXUwB2NMZCsjDYItuLAoy6GAUDfUHzcPpC5vBjXC3ol33B7CI6OC8FxLj9wX/+aKweTuN1g51JIcYH5hM7jN6A== dependencies: - "@jsii/check-node" "1.66.0" - "@jsii/spec" "1.66.0" + "@jsii/check-node" "1.67.0" + "@jsii/spec" "1.67.0" "@xmldom/xmldom" "^0.8.2" commonmark "^0.30.0" fast-glob "^3.2.11" - jsii "1.66.0" + jsii "1.67.0" semver "^7.3.7" semver-intersect "^1.4.0" typescript "~3.9.10" workerpool "^6.2.1" yargs "^16.2.0" -jsii@1.66.0, jsii@^1.64.0, jsii@^1.66.0: - version "1.66.0" - resolved "https://registry.npmjs.org/jsii/-/jsii-1.66.0.tgz#ce02c20fa28228fadf646fdb15ab0700153b941b" - integrity sha512-xk28Cf+Wj2Ei9+UkWm1f9/Luqg77MpkCqRwx/bkErtI5uMA01kRzwrYwV4ZyjrMY5m5L57GUB4SBYOnVmPOckA== +jsii@1.67.0, jsii@^1.67.0: + version "1.67.0" + resolved "https://registry.npmjs.org/jsii/-/jsii-1.67.0.tgz#e529e24656eac589c59328301d5363742e8ca023" + integrity sha512-CY7q4pmeq65H7bwx5KW0YHoDMgjg/jOXFWNG2juOOasFBzl7DMJpKTP00nj7vMPb4z/LgOJaZJA5y5GBMSCQzQ== dependencies: - "@jsii/check-node" "1.66.0" - "@jsii/spec" "^1.66.0" + "@jsii/check-node" "1.67.0" + "@jsii/spec" "^1.67.0" case "^1.6.3" chalk "^4" fast-deep-equal "^3.1.3" @@ -8289,9 +8289,9 @@ npmlog@^6.0.0: set-blocking "^2.0.0" nwsapi@^2.2.0: - version "2.2.1" - resolved "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.1.tgz#10a9f268fbf4c461249ebcfe38e359aa36e2577c" - integrity sha512-JYOWTeFoS0Z93587vRJgASD5Ut11fYl5NyihP3KrYBvMe1FRRs6RN7m20SA/16GM4P6hTnZjT+UmDOt38UeXNg== + version "2.2.2" + resolved "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.2.tgz#e5418863e7905df67d51ec95938d67bf801f0bb0" + integrity sha512-90yv+6538zuvUMnN+zCr8LuV6bPFdq50304114vJYJ8RDyK8D5O9Phpbd6SZWgI7PwzmmfN1upeOJlvybDSgCw== nyc@^15.1.0: version "15.1.0" @@ -8336,7 +8336,7 @@ object-assign@^4.1.0: resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== -object-inspect@^1.12.0, object-inspect@^1.9.0: +object-inspect@^1.12.2, object-inspect@^1.9.0: version "1.12.2" resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz#c0641f26394532f28ab8d796ab954e43c009a8ea" integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ== @@ -8346,7 +8346,7 @@ object-keys@^1.1.1: resolved "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== -object.assign@^4.1.2: +object.assign@^4.1.4: version "4.1.4" resolved "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz#9673c7c7c351ab8c4d0b516f4343ebf4dfb7799f" integrity sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ== @@ -8394,10 +8394,10 @@ onetime@^5.1.0, onetime@^5.1.2: dependencies: mimic-fn "^2.1.0" -oo-ascii-tree@^1.66.0: - version "1.66.0" - resolved "https://registry.npmjs.org/oo-ascii-tree/-/oo-ascii-tree-1.66.0.tgz#4384daefa449b3e387f5f6de043cb1d79e53e40a" - integrity sha512-qWv4ygUPK2GfX/Pbm72IirXyzxz85bRRIrQQh0BG/kuHjHJk2H3yETL9ypnKP6q87+4179KFlzl740OQzPmosg== +oo-ascii-tree@^1.67.0: + version "1.67.0" + resolved "https://registry.npmjs.org/oo-ascii-tree/-/oo-ascii-tree-1.67.0.tgz#229d3abdeefa5de106acd56c68671d2316227a80" + integrity sha512-qnmzjsmOg8szLSbL3RRUi3bog/t3dDEexcuX4bkSJnvTHJqYUg2vdoTIjkbI67YT231fk7C8PRusMIOgrrBYUg== open@^7.4.2: version "7.4.2" @@ -8987,10 +8987,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.61.37: - version "0.61.37" - resolved "https://registry.npmjs.org/projen/-/projen-0.61.37.tgz#93b66f7e78db56c604670dcd01a38225607447bb" - integrity sha512-Cb83rR7MmAwIBy09X+4209axhpd+4cQdLTLxUEtIxOarYA5Yy4S/e3qGiftnmfMhUH2aw877D2D5IofIeQtNjQ== +projen@^0.61.45: + version "0.61.45" + resolved "https://registry.npmjs.org/projen/-/projen-0.61.45.tgz#057ff0f6077f56f9dfb21d7e73eb841d1da351fd" + integrity sha512-XngLBUdWPYDHx9ZYWineLP4xSMsRceHbiKtcQefJiCj3bEadZ0uH9DvbokFYHJL8c5XtA28UHFqbCnmYdSDfUA== dependencies: "@iarna/toml" "^2.2.5" case "^1.6.3" @@ -10249,9 +10249,9 @@ supports-color@^8.0.0: has-flag "^4.0.0" supports-hyperlinks@^2.0.0: - version "2.2.0" - resolved "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz#4f77b42488765891774b70c79babd87f9bd594bb" - integrity sha512-6sXEzV5+I5j8Bmq9/vUphGRM/RJNT9SCURJLjwfOg51heRtguGWDzcaBlgAzKhQa0EVNpPEKzQuBwZ8S8WaCeQ== + version "2.3.0" + resolved "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.3.0.tgz#3943544347c1ff90b15effb03fc14ae45ec10624" + integrity sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA== dependencies: has-flag "^4.0.0" supports-color "^7.0.0" @@ -10798,9 +10798,9 @@ upath@^2.0.1: integrity sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w== update-browserslist-db@^1.0.5: - version "1.0.5" - resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.5.tgz#be06a5eedd62f107b7c19eb5bcefb194411abf38" - integrity sha512-dteFFpCyvuDdr9S/ff1ISkKt/9YZxKjI9WlRR99c180GaztJtRa/fn18FdxGVKVsnPY7/a/FDN68mcvUmP4U7Q== + version "1.0.7" + resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.7.tgz#16279639cff1d0f800b14792de43d97df2d11b7d" + integrity sha512-iN/XYesmZ2RmmWAiI4Z5rq0YqSiv0brj9Ce9CfhNE4xIW2h+MFxcgkxIzZ+ShkFPUkjU3gQ+3oypadD3RAMtrg== dependencies: escalade "^3.1.1" picocolors "^1.0.0" From 4b37157b47ab38124b62649649d0df9b701cb7fe Mon Sep 17 00:00:00 2001 From: Cory Hall <43035978+corymhall@users.noreply.github.com> Date: Wed, 7 Sep 2022 11:45:25 -0400 Subject: [PATCH 5/9] fix(lambda-python): bundling with poetry is broken (#21945) It looks like something was changed in the base image and there is no longer write access to the `/tmp` directory which causes bundling with poetry to fail (see linked issue). This PR updates the Dockerfile to create a new cache location for both `pip` and `poetry` and switches to using a virtualenv for python so that it is no longer using root. To test this I executed the `integ.function.poetry` integration test both before (to reproduce the error) and after the fix. I'm actually not sure why our integration tests didn't start failing in the pipeline. The only thing I can think of is that we are caching the docker images and it just hasn't pulled down a newer one that has this issue. fixes #21867 ---- ### All Submissions: * [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../@aws-cdk/aws-lambda-python/lib/Dockerfile | 25 +++++++++++++++++++ .../@aws-cdk/aws-lambda-python/package.json | 1 + .../test/integ.function.poetry.ts | 14 ++++++++--- 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/packages/@aws-cdk/aws-lambda-python/lib/Dockerfile b/packages/@aws-cdk/aws-lambda-python/lib/Dockerfile index ac34823b6c3c6..8825095b9f15c 100644 --- a/packages/@aws-cdk/aws-lambda-python/lib/Dockerfile +++ b/packages/@aws-cdk/aws-lambda-python/lib/Dockerfile @@ -7,10 +7,35 @@ ARG PIP_INDEX_URL ARG PIP_EXTRA_INDEX_URL ARG HTTPS_PROXY +# Create a new location for the pip cache +# Ensure all users can write to pip cache +RUN mkdir /tmp/pip-cache && \ + chmod -R 777 /tmp/pip-cache + +# set the cache location +ENV PIP_CACHE_DIR=/tmp/pip-cache + +# create a new virtualenv for python to use +# so that it isn't using root +RUN python -m venv /usr/app/venv +ENV PATH="/usr/app/venv/bin:$PATH" + # Upgrade pip (required by cryptography v3.4 and above, which is a dependency of poetry) RUN pip install --upgrade pip + # pipenv 2022.4.8 is the last version with Python 3.6 support RUN pip install pipenv==2022.4.8 poetry +# Create a new location for the poetry cache +# Ensure all users can write to poetry cache +RUN mkdir /tmp/poetry-cache && \ + chmod -R 777 /tmp/poetry-cache + +# set the poetry cache +ENV POETRY_CACHE_DIR=/tmp/poetry-cache + +# create non root user and change allow execute command for non root user +RUN /sbin/useradd -u 1000 user && chmod 711 / + CMD [ "python" ] diff --git a/packages/@aws-cdk/aws-lambda-python/package.json b/packages/@aws-cdk/aws-lambda-python/package.json index e2692689c15cb..bedfd090075b4 100644 --- a/packages/@aws-cdk/aws-lambda-python/package.json +++ b/packages/@aws-cdk/aws-lambda-python/package.json @@ -75,6 +75,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/pkglint": "0.0.0", "@types/jest": "^27.5.2" }, diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.ts b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.ts index 4d029fca0321b..31af5421fccc8 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.ts +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.ts @@ -1,9 +1,7 @@ -// disabling update workflow because we don't want to include the assets in the snapshot -// python bundling changes the asset hash pretty frequently -/// !cdk-integ pragma:disable-update-workflow import * as path from 'path'; import { Runtime } from '@aws-cdk/aws-lambda'; import { App, CfnOutput, Stack, StackProps } from '@aws-cdk/core'; +import { IntegTest } from '@aws-cdk/integ-tests'; import { Construct } from 'constructs'; import * as lambda from '../lib'; @@ -35,5 +33,13 @@ class TestStack extends Stack { } const app = new App(); -new TestStack(app, 'cdk-integ-lambda-python'); +const testCase = new TestStack(app, 'cdk-integ-lambda-python'); + +new IntegTest(app, 'poetry', { + testCases: [testCase], + // disabling update workflow because we don't want to include the assets in the snapshot + // python bundling changes the asset hash pretty frequently + stackUpdateWorkflow: false, +}); + app.synth(); From 809e1b0d5dc29be02f95ea4361b6f87f94325f3d Mon Sep 17 00:00:00 2001 From: Cory Hall <43035978+corymhall@users.noreply.github.com> Date: Wed, 7 Sep 2022 15:05:29 -0400 Subject: [PATCH 6/9] fix(lambda-python): poetry bundling fails on python3.7 (#21950) For some reason when using the `python3.7` docker image the `useradd` command fails `/bin/sh: /sbin/useradd: No such file or directory`. I'm not sure why it works on 3.8 & 3.9 and not 3.7, but since that is not necessary I'm just removing it. I've added python3.7 to the integration test to confirm that it works for 3.7, 3.8, & 3.9 ---- ### All Submissions: * [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../@aws-cdk/aws-lambda-python/lib/Dockerfile | 3 - .../.ignorefile | 0 .../index.py | 8 - .../poetry.lock | 84 --------- .../pyproject.toml | 15 -- .../requirements.txt | 15 -- .../cdk-integ-lambda-python.assets.json | 31 ++- .../cdk-integ-lambda-python.template.json | 57 +++++- .../function.poetry.integ.snapshot/cdk.out | 2 +- .../function.poetry.integ.snapshot/integ.json | 13 +- .../manifest.json | 63 ++++++- ...efaultTestDeployAssertE9C9CB8F.assets.json | 19 ++ ...aultTestDeployAssertE9C9CB8F.template.json | 36 ++++ .../function.poetry.integ.snapshot/tree.json | 178 ++++++++++++++++-- .../test/integ.function.poetry.ts | 6 + 15 files changed, 369 insertions(+), 161 deletions(-) delete mode 100644 packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/asset.c163659180107f6d900bb5a9138eb6a904d52ba2521d9252291ba353d5c5850a/.ignorefile delete mode 100644 packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/asset.c163659180107f6d900bb5a9138eb6a904d52ba2521d9252291ba353d5c5850a/index.py delete mode 100644 packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/asset.c163659180107f6d900bb5a9138eb6a904d52ba2521d9252291ba353d5c5850a/poetry.lock delete mode 100644 packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/asset.c163659180107f6d900bb5a9138eb6a904d52ba2521d9252291ba353d5c5850a/pyproject.toml delete mode 100644 packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/asset.c163659180107f6d900bb5a9138eb6a904d52ba2521d9252291ba353d5c5850a/requirements.txt create mode 100644 packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.assets.json create mode 100644 packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.template.json diff --git a/packages/@aws-cdk/aws-lambda-python/lib/Dockerfile b/packages/@aws-cdk/aws-lambda-python/lib/Dockerfile index 8825095b9f15c..c2a6aca7829b6 100644 --- a/packages/@aws-cdk/aws-lambda-python/lib/Dockerfile +++ b/packages/@aws-cdk/aws-lambda-python/lib/Dockerfile @@ -35,7 +35,4 @@ RUN mkdir /tmp/poetry-cache && \ # set the poetry cache ENV POETRY_CACHE_DIR=/tmp/poetry-cache -# create non root user and change allow execute command for non root user -RUN /sbin/useradd -u 1000 user && chmod 711 / - CMD [ "python" ] diff --git a/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/asset.c163659180107f6d900bb5a9138eb6a904d52ba2521d9252291ba353d5c5850a/.ignorefile b/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/asset.c163659180107f6d900bb5a9138eb6a904d52ba2521d9252291ba353d5c5850a/.ignorefile deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/asset.c163659180107f6d900bb5a9138eb6a904d52ba2521d9252291ba353d5c5850a/index.py b/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/asset.c163659180107f6d900bb5a9138eb6a904d52ba2521d9252291ba353d5c5850a/index.py deleted file mode 100644 index 04f99eb108b30..0000000000000 --- a/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/asset.c163659180107f6d900bb5a9138eb6a904d52ba2521d9252291ba353d5c5850a/index.py +++ /dev/null @@ -1,8 +0,0 @@ -import requests - -def handler(event, context): - response = requests.get('https://a0.awsstatic.com/main/images/logos/aws_smile-header-desktop-en-white_59x35.png', stream=True) - - print(response.status_code) - - return response.status_code diff --git a/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/asset.c163659180107f6d900bb5a9138eb6a904d52ba2521d9252291ba353d5c5850a/poetry.lock b/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/asset.c163659180107f6d900bb5a9138eb6a904d52ba2521d9252291ba353d5c5850a/poetry.lock deleted file mode 100644 index 6b59241f10c2d..0000000000000 --- a/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/asset.c163659180107f6d900bb5a9138eb6a904d52ba2521d9252291ba353d5c5850a/poetry.lock +++ /dev/null @@ -1,84 +0,0 @@ -[[package]] -name = "certifi" -version = "2021.10.8" -description = "Python package for providing Mozilla's CA Bundle." -category = "main" -optional = false -python-versions = "*" - -[[package]] -name = "charset-normalizer" -version = "2.0.9" -description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." -category = "main" -optional = false -python-versions = ">=3.5.0" - -[package.extras] -unicode_backport = ["unicodedata2"] - -[[package]] -name = "idna" -version = "3.3" -description = "Internationalized Domain Names in Applications (IDNA)" -category = "main" -optional = false -python-versions = ">=3.5" - -[[package]] -name = "requests" -version = "2.26.0" -description = "Python HTTP for Humans." -category = "main" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" - -[package.dependencies] -certifi = ">=2017.4.17" -charset-normalizer = {version = ">=2.0.0,<2.1.0", markers = "python_version >= \"3\""} -idna = {version = ">=2.5,<4", markers = "python_version >= \"3\""} -urllib3 = ">=1.21.1,<1.27" - -[package.extras] -socks = ["PySocks (>=1.5.6,!=1.5.7)", "win-inet-pton"] -use_chardet_on_py3 = ["chardet (>=3.0.2,<5)"] - -[[package]] -name = "urllib3" -version = "1.26.7" -description = "HTTP library with thread-safe connection pooling, file post, and more." -category = "main" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4" - -[package.extras] -brotli = ["brotlipy (>=0.6.0)"] -secure = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "certifi", "ipaddress"] -socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] - -[metadata] -lock-version = "1.1" -python-versions = "^3.6" -content-hash = "cf158be6b11f3c989228cb0acf2bbb120599853ed83b562d267bfc135eed126a" - -[metadata.files] -certifi = [ - {file = "certifi-2021.10.8-py2.py3-none-any.whl", hash = "sha256:d62a0163eb4c2344ac042ab2bdf75399a71a2d8c7d47eac2e2ee91b9d6339569"}, - {file = "certifi-2021.10.8.tar.gz", hash = "sha256:78884e7c1d4b00ce3cea67b44566851c4343c120abd683433ce934a68ea58872"}, -] -charset-normalizer = [ - {file = "charset-normalizer-2.0.9.tar.gz", hash = "sha256:b0b883e8e874edfdece9c28f314e3dd5badf067342e42fb162203335ae61aa2c"}, - {file = "charset_normalizer-2.0.9-py3-none-any.whl", hash = "sha256:1eecaa09422db5be9e29d7fc65664e6c33bd06f9ced7838578ba40d58bdf3721"}, -] -idna = [ - {file = "idna-3.3-py3-none-any.whl", hash = "sha256:84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff"}, - {file = "idna-3.3.tar.gz", hash = "sha256:9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d"}, -] -requests = [ - {file = "requests-2.26.0-py2.py3-none-any.whl", hash = "sha256:6c1246513ecd5ecd4528a0906f910e8f0f9c6b8ec72030dc9fd154dc1a6efd24"}, - {file = "requests-2.26.0.tar.gz", hash = "sha256:b8aa58f8cf793ffd8782d3d8cb19e66ef36f7aba4353eec859e74678b01b07a7"}, -] -urllib3 = [ - {file = "urllib3-1.26.7-py2.py3-none-any.whl", hash = "sha256:c4fdf4019605b6e5423637e01bc9fe4daef873709a7973e195ceba0a62bbc844"}, - {file = "urllib3-1.26.7.tar.gz", hash = "sha256:4987c65554f7a2dbf30c18fd48778ef124af6fab771a377103da0585e2336ece"}, -] diff --git a/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/asset.c163659180107f6d900bb5a9138eb6a904d52ba2521d9252291ba353d5c5850a/pyproject.toml b/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/asset.c163659180107f6d900bb5a9138eb6a904d52ba2521d9252291ba353d5c5850a/pyproject.toml deleted file mode 100644 index 6d90c4b4fec9b..0000000000000 --- a/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/asset.c163659180107f6d900bb5a9138eb6a904d52ba2521d9252291ba353d5c5850a/pyproject.toml +++ /dev/null @@ -1,15 +0,0 @@ -[tool.poetry] -name = "lambda-handler-poetry" -version = "0.1.0" -description = "" -authors = ["Your Name "] - -[tool.poetry.dependencies] -python = "^3.6" -requests = "2.26.0" - -[tool.poetry.dev-dependencies] - -[build-system] -requires = ["poetry-core>=1.0.0"] -build-backend = "poetry.core.masonry.api" diff --git a/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/asset.c163659180107f6d900bb5a9138eb6a904d52ba2521d9252291ba353d5c5850a/requirements.txt b/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/asset.c163659180107f6d900bb5a9138eb6a904d52ba2521d9252291ba353d5c5850a/requirements.txt deleted file mode 100644 index 2d8d3c25d1e8a..0000000000000 --- a/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/asset.c163659180107f6d900bb5a9138eb6a904d52ba2521d9252291ba353d5c5850a/requirements.txt +++ /dev/null @@ -1,15 +0,0 @@ -certifi==2021.10.8; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" \ - --hash=sha256:d62a0163eb4c2344ac042ab2bdf75399a71a2d8c7d47eac2e2ee91b9d6339569 \ - --hash=sha256:78884e7c1d4b00ce3cea67b44566851c4343c120abd683433ce934a68ea58872 -charset-normalizer==2.0.9; python_full_version >= "3.6.0" and python_version >= "3" \ - --hash=sha256:b0b883e8e874edfdece9c28f314e3dd5badf067342e42fb162203335ae61aa2c \ - --hash=sha256:1eecaa09422db5be9e29d7fc65664e6c33bd06f9ced7838578ba40d58bdf3721 -idna==3.3; python_version >= "3.5" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.5" \ - --hash=sha256:84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff \ - --hash=sha256:9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d -requests==2.26.0; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.6.0") \ - --hash=sha256:6c1246513ecd5ecd4528a0906f910e8f0f9c6b8ec72030dc9fd154dc1a6efd24 \ - --hash=sha256:b8aa58f8cf793ffd8782d3d8cb19e66ef36f7aba4353eec859e74678b01b07a7 -urllib3==1.26.7; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version < "4" \ - --hash=sha256:c4fdf4019605b6e5423637e01bc9fe4daef873709a7973e195ceba0a62bbc844 \ - --hash=sha256:4987c65554f7a2dbf30c18fd48778ef124af6fab771a377103da0585e2336ece diff --git a/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/cdk-integ-lambda-python.assets.json b/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/cdk-integ-lambda-python.assets.json index 7a99e7b284073..59b1159d82b6e 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/cdk-integ-lambda-python.assets.json +++ b/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/cdk-integ-lambda-python.assets.json @@ -1,33 +1,46 @@ { - "version": "20.0.0", + "version": "21.0.0", "files": { - "c5ecdc350b1c0ecd1962c18d253a073e9284d01d20377458b71dbce88b3fae0d": { + "377b8c7d7d74049daef959af1f7f0f0f2eaeb6ccb4c85fe80f8c00936183b6ff": { "source": { - "path": "asset.c5ecdc350b1c0ecd1962c18d253a073e9284d01d20377458b71dbce88b3fae0d", + "path": "asset.377b8c7d7d74049daef959af1f7f0f0f2eaeb6ccb4c85fe80f8c00936183b6ff", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "c5ecdc350b1c0ecd1962c18d253a073e9284d01d20377458b71dbce88b3fae0d.zip", + "objectKey": "377b8c7d7d74049daef959af1f7f0f0f2eaeb6ccb4c85fe80f8c00936183b6ff.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "5a96395d40e1786ddf393dfb827b961680519f476484b507011d2745c82ffd78": { + "f27e50ce3e964bd188b2fad96e1819a8e68a7a7a17e1f701b6bdcc054e29503a": { "source": { - "path": "asset.5a96395d40e1786ddf393dfb827b961680519f476484b507011d2745c82ffd78", + "path": "asset.f27e50ce3e964bd188b2fad96e1819a8e68a7a7a17e1f701b6bdcc054e29503a", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "5a96395d40e1786ddf393dfb827b961680519f476484b507011d2745c82ffd78.zip", + "objectKey": "f27e50ce3e964bd188b2fad96e1819a8e68a7a7a17e1f701b6bdcc054e29503a.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "69a465a4b05894359284e409dc3f2cc2208b03b032aa6d6f67b5a327b4b795e3": { + "d165152de494c90bdd8c4aa643a5b1e99b2a5cbacb7f4594319b3b45d6845fd3": { + "source": { + "path": "asset.d165152de494c90bdd8c4aa643a5b1e99b2a5cbacb7f4594319b3b45d6845fd3", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "d165152de494c90bdd8c4aa643a5b1e99b2a5cbacb7f4594319b3b45d6845fd3.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "5187de9a41f36d4b41ca1553d50265326d21791726e2a3dd0a3201910180fc0f": { "source": { "path": "cdk-integ-lambda-python.template.json", "packaging": "file" @@ -35,7 +48,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "69a465a4b05894359284e409dc3f2cc2208b03b032aa6d6f67b5a327b4b795e3.json", + "objectKey": "5187de9a41f36d4b41ca1553d50265326d21791726e2a3dd0a3201910180fc0f.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/cdk-integ-lambda-python.template.json b/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/cdk-integ-lambda-python.template.json index c036611126007..14440fd8aa966 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/cdk-integ-lambda-python.template.json +++ b/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/cdk-integ-lambda-python.template.json @@ -38,7 +38,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "c5ecdc350b1c0ecd1962c18d253a073e9284d01d20377458b71dbce88b3fae0d.zip" + "S3Key": "377b8c7d7d74049daef959af1f7f0f0f2eaeb6ccb4c85fe80f8c00936183b6ff.zip" }, "Role": { "Fn::GetAtt": [ @@ -91,7 +91,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "5a96395d40e1786ddf393dfb827b961680519f476484b507011d2745c82ffd78.zip" + "S3Key": "f27e50ce3e964bd188b2fad96e1819a8e68a7a7a17e1f701b6bdcc054e29503a.zip" }, "Role": { "Fn::GetAtt": [ @@ -105,6 +105,59 @@ "DependsOn": [ "myhandlerpython38ServiceRole2049AFF7" ] + }, + "myhandlerpython37ServiceRole45CBD18D": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "myhandlerpython37C34039A7": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "d165152de494c90bdd8c4aa643a5b1e99b2a5cbacb7f4594319b3b45d6845fd3.zip" + }, + "Role": { + "Fn::GetAtt": [ + "myhandlerpython37ServiceRole45CBD18D", + "Arn" + ] + }, + "Handler": "index.handler", + "Runtime": "python3.7" + }, + "DependsOn": [ + "myhandlerpython37ServiceRole45CBD18D" + ] } }, "Outputs": { diff --git a/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/cdk.out b/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/cdk.out index 588d7b269d34f..8ecc185e9dbee 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/cdk.out @@ -1 +1 @@ -{"version":"20.0.0"} \ No newline at end of file +{"version":"21.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/integ.json b/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/integ.json index 3b3221b39293f..9d43d6f6375d1 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/integ.json +++ b/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/integ.json @@ -1,14 +1,13 @@ { - "version": "20.0.0", + "version": "21.0.0", "testCases": { - "integ.function.poetry": { + "poetry/DefaultTest": { "stacks": [ "cdk-integ-lambda-python" ], - "diffAssets": false, - "stackUpdateWorkflow": false + "stackUpdateWorkflow": false, + "assertionStack": "poetry/DefaultTest/DeployAssert", + "assertionStackName": "poetryDefaultTestDeployAssertE9C9CB8F" } - }, - "synthContext": {}, - "enableLookups": false + } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/manifest.json b/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/manifest.json index eaac7677f55f4..87d4bef76061d 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "20.0.0", + "version": "21.0.0", "artifacts": { "Tree": { "type": "cdk:tree", @@ -23,7 +23,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}/69a465a4b05894359284e409dc3f2cc2208b03b032aa6d6f67b5a327b4b795e3.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/5187de9a41f36d4b41ca1553d50265326d21791726e2a3dd0a3201910180fc0f.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -75,6 +75,18 @@ "data": "Python38FunctionName" } ], + "/cdk-integ-lambda-python/my_handler_python_37/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerpython37ServiceRole45CBD18D" + } + ], + "/cdk-integ-lambda-python/my_handler_python_37/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerpython37C34039A7" + } + ], "/cdk-integ-lambda-python/BootstrapVersion": [ { "type": "aws:cdk:logicalId", @@ -89,6 +101,53 @@ ] }, "displayName": "cdk-integ-lambda-python" + }, + "poetryDefaultTestDeployAssertE9C9CB8F.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "poetryDefaultTestDeployAssertE9C9CB8F.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "poetryDefaultTestDeployAssertE9C9CB8F": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "poetryDefaultTestDeployAssertE9C9CB8F.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": [ + "poetryDefaultTestDeployAssertE9C9CB8F.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": [ + "poetryDefaultTestDeployAssertE9C9CB8F.assets" + ], + "metadata": { + "/poetry/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/poetry/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "poetry/DefaultTest/DeployAssert" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.assets.json b/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.assets.json new file mode 100644 index 0000000000000..d73b790ad18fa --- /dev/null +++ b/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.assets.json @@ -0,0 +1,19 @@ +{ + "version": "21.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "poetryDefaultTestDeployAssertE9C9CB8F.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-lambda-python/test/function.poetry.integ.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.template.json b/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.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-lambda-python/test/function.poetry.integ.snapshot/tree.json b/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/tree.json index 266b2c9664ea3..9e9b09c2a9c47 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/tree.json +++ b/packages/@aws-cdk/aws-lambda-python/test/function.poetry.integ.snapshot/tree.json @@ -9,7 +9,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.85" + "version": "10.1.95" } }, "cdk-integ-lambda-python": { @@ -77,8 +77,8 @@ "id": "Stage", "path": "cdk-integ-lambda-python/my_handler_inline/Code/Stage", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" } }, "AssetBucket": { @@ -105,7 +105,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "c5ecdc350b1c0ecd1962c18d253a073e9284d01d20377458b71dbce88b3fae0d.zip" + "s3Key": "377b8c7d7d74049daef959af1f7f0f0f2eaeb6ccb4c85fe80f8c00936183b6ff.zip" }, "role": { "Fn::GetAtt": [ @@ -132,8 +132,8 @@ "id": "InlineFunctionName", "path": "cdk-integ-lambda-python/InlineFunctionName", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" } }, "my_handler_python_38": { @@ -197,8 +197,8 @@ "id": "Stage", "path": "cdk-integ-lambda-python/my_handler_python_38/Code/Stage", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" } }, "AssetBucket": { @@ -225,7 +225,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "5a96395d40e1786ddf393dfb827b961680519f476484b507011d2745c82ffd78.zip" + "s3Key": "f27e50ce3e964bd188b2fad96e1819a8e68a7a7a17e1f701b6bdcc054e29503a.zip" }, "role": { "Fn::GetAtt": [ @@ -252,20 +252,168 @@ "id": "Python38FunctionName", "path": "cdk-integ-lambda-python/Python38FunctionName", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "my_handler_python_37": { + "id": "my_handler_python_37", + "path": "cdk-integ-lambda-python/my_handler_python_37", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "cdk-integ-lambda-python/my_handler_python_37/ServiceRole", + "children": { + "Resource": { + "id": "Resource", + "path": "cdk-integ-lambda-python/my_handler_python_37/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "cdk-integ-lambda-python/my_handler_python_37/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "cdk-integ-lambda-python/my_handler_python_37/Code/Stage", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "cdk-integ-lambda-python/my_handler_python_37/Code/AssetBucket", + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3-assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "cdk-integ-lambda-python/my_handler_python_37/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "d165152de494c90bdd8c4aa643a5b1e99b2a5cbacb7f4594319b3b45d6845fd3.zip" + }, + "role": { + "Fn::GetAtt": [ + "myhandlerpython37ServiceRole45CBD18D", + "Arn" + ] + }, + "handler": "index.handler", + "runtime": "python3.7" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda-python.PythonFunction", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "poetry": { + "id": "poetry", + "path": "poetry", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "poetry/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "poetry/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.95" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "poetry/DefaultTest/DeployAssert", + "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" } } }, "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-lambda-python/test/integ.function.poetry.ts b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.ts index 31af5421fccc8..3fecb2206eb73 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.ts +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.ts @@ -29,6 +29,12 @@ class TestStack extends Stack { new CfnOutput(this, 'Python38FunctionName', { value: pythonFunction38.functionName, }); + + new lambda.PythonFunction(this, 'my_handler_python_37', { + entry: path.join(__dirname, 'lambda-handler-poetry'), + runtime: Runtime.PYTHON_3_7, + }); + } } From b0ba52e5a0367834c9ed0268041303f9ee61a559 Mon Sep 17 00:00:00 2001 From: Kendra Neil <53584728+TheRealAmazonKendra@users.noreply.github.com> Date: Wed, 7 Sep 2022 14:00:48 -0700 Subject: [PATCH 7/9] chore: remove testLegacyBehavior and update testFutureBehavior tests (#21949) testLegacyBehavior only runs tests in v1 and skips them in v2, so none of these tests were running anyway. testFutureBehavior just runs the tests with the feature-flag as true, which is the default to these in v2 anyway. I'm removing these functions and their uses so that contributors aren't mislead to think they should use them. I also fixed some spacing issues in test packages. The diff on this is kind of hard to follow but the summary of the change is this: - all testLegacyBehavior tests have been deleted - all testFutureBehavior tests have been updated to be standard tests - describe blocks were removed where they wrapped around legacy or future sets of tests - spacing fixed ---- ### All Submissions: * [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../aws-apigateway/test/usage-plan.test.ts | 55 +- .../aws-cloudfront/test/distribution.test.ts | 81 +-- .../test/lambda/lambda-invoke-action.test.ts | 12 +- .../test/s3/s3-deploy-action.test.ts | 292 +++++------ .../aws-dynamodb/test/dynamodb.test.ts | 187 ------- .../aspects/require-imdsv2-aspect.test.ts | 25 +- packages/@aws-cdk/aws-ec2/test/volume.test.ts | 157 +----- .../aws-ecr-assets/test/image-asset.test.ts | 274 +--------- .../aws-ecr-assets/test/tarball-asset.test.ts | 12 +- .../aws-ecs-patterns/test/ec2/l3s.test.ts | 102 ---- .../ec2/queue-processing-ecs-service.test.ts | 61 +-- .../queue-processing-fargate-service.test.ts | 9 +- .../aws-ecs/test/container-definition.test.ts | 158 +----- .../test/ec2/ec2-task-definition.test.ts | 60 +-- .../aws-efs/test/efs-file-system.test.ts | 29 +- .../test/alb/load-balancer.test.ts | 64 +-- .../test/nlb/load-balancer.test.ts | 10 +- packages/@aws-cdk/aws-glue/test/table.test.ts | 12 +- .../@aws-cdk/aws-kinesis/test/stream.test.ts | 470 +----------------- packages/@aws-cdk/aws-kms/test/key.test.ts | 372 +++----------- .../@aws-cdk/aws-lambda/test/code.test.ts | 30 -- .../@aws-cdk/aws-rds/test/cluster.test.ts | 15 +- .../@aws-cdk/aws-rds/test/instance.test.ts | 12 +- .../test/bucket-deployment.test.ts | 12 +- packages/@aws-cdk/aws-s3/test/bucket.test.ts | 201 +------- .../aws-secretsmanager/test/secret.test.ts | 160 +++--- packages/@aws-cdk/core/test/stack.test.ts | 89 ++-- .../@aws-cdk/cx-api/test/features.test.ts | 5 - .../cdk-build-tools/lib/feature-flag.ts | 79 --- tools/@aws-cdk/cdk-build-tools/lib/index.ts | 1 - 30 files changed, 425 insertions(+), 2621 deletions(-) delete mode 100644 tools/@aws-cdk/cdk-build-tools/lib/feature-flag.ts diff --git a/packages/@aws-cdk/aws-apigateway/test/usage-plan.test.ts b/packages/@aws-cdk/aws-apigateway/test/usage-plan.test.ts index ec6267f643d2f..aa56d019ffab2 100644 --- a/packages/@aws-cdk/aws-apigateway/test/usage-plan.test.ts +++ b/packages/@aws-cdk/aws-apigateway/test/usage-plan.test.ts @@ -1,7 +1,5 @@ import { Template } from '@aws-cdk/assertions'; -import { testFutureBehavior } from '@aws-cdk/cdk-build-tools/lib/feature-flag'; import * as cdk from '@aws-cdk/core'; -import * as cxapi from '@aws-cdk/cx-api'; import * as apigateway from '../lib'; const RESOURCE_TYPE = 'AWS::ApiGateway::UsagePlan'; @@ -298,35 +296,32 @@ describe('usage plan', () => { expect(logicalIds).toEqual(['mylogicalid']); }); - describe('future flag: @aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId', () => { - const flags = { [cxapi.APIGATEWAY_USAGEPLANKEY_ORDERINSENSITIVE_ID]: true }; - - testFutureBehavior('UsagePlanKeys have unique logical ids', flags, cdk.App, (app) => { - // GIVEN - const stack = new cdk.Stack(app, 'my-stack'); - const usagePlan = new apigateway.UsagePlan(stack, 'my-usage-plan'); - const apiKey1 = new apigateway.ApiKey(stack, 'my-api-key-1', { - apiKeyName: 'my-api-key-1', - }); - const apiKey2 = new apigateway.ApiKey(stack, 'my-api-key-2', { - apiKeyName: 'my-api-key-2', - }); - - // WHEN - usagePlan.addApiKey(apiKey1); - usagePlan.addApiKey(apiKey2); - - // THEN - const template = app.synth().getStackByName(stack.stackName).template; - const logicalIds = Object.entries(template.Resources) - .filter(([_, v]) => (v as any).Type === 'AWS::ApiGateway::UsagePlanKey') - .map(([k, _]) => k); - - expect(logicalIds).toEqual([ - 'myusageplanUsagePlanKeyResourcemystackmyapikey1EE9AA1B359121274', - 'myusageplanUsagePlanKeyResourcemystackmyapikey2B4E8EB1456DC88E9', - ]); + test('UsagePlanKeys have unique logical ids', () => { + // GIVEN + const app = new cdk.App(); + const stack = new cdk.Stack(app, 'my-stack'); + const usagePlan = new apigateway.UsagePlan(stack, 'my-usage-plan'); + const apiKey1 = new apigateway.ApiKey(stack, 'my-api-key-1', { + apiKeyName: 'my-api-key-1', }); + const apiKey2 = new apigateway.ApiKey(stack, 'my-api-key-2', { + apiKeyName: 'my-api-key-2', + }); + + // WHEN + usagePlan.addApiKey(apiKey1); + usagePlan.addApiKey(apiKey2); + + // THEN + const template = app.synth().getStackByName(stack.stackName).template; + const logicalIds = Object.entries(template.Resources) + .filter(([_, v]) => (v as any).Type === 'AWS::ApiGateway::UsagePlanKey') + .map(([k, _]) => k); + + expect(logicalIds).toEqual([ + 'myusageplanUsagePlanKeyResourcemystackmyapikey1EE9AA1B359121274', + 'myusageplanUsagePlanKeyResourcemystackmyapikey2B4E8EB1456DC88E9', + ]); }); }); }); diff --git a/packages/@aws-cdk/aws-cloudfront/test/distribution.test.ts b/packages/@aws-cdk/aws-cloudfront/test/distribution.test.ts index 148d2ba2a8346..8a4c2503234aa 100644 --- a/packages/@aws-cdk/aws-cloudfront/test/distribution.test.ts +++ b/packages/@aws-cdk/aws-cloudfront/test/distribution.test.ts @@ -2,9 +2,7 @@ import { Match, Template } from '@aws-cdk/assertions'; import * as acm from '@aws-cdk/aws-certificatemanager'; import * as lambda from '@aws-cdk/aws-lambda'; import * as s3 from '@aws-cdk/aws-s3'; -import { testFutureBehavior, testLegacyBehavior } from '@aws-cdk/cdk-build-tools/lib/feature-flag'; import { App, Duration, Stack } from '@aws-cdk/core'; -import { CLOUDFRONT_DEFAULT_SECURITY_POLICY_TLS_V1_2_2021 } from '@aws-cdk/cx-api'; import { CfnDistribution, Distribution, @@ -289,7 +287,6 @@ ellipsis so a user would know there was more to ...`, }); describe('multiple behaviors', () => { - test('a second behavior can\'t be specified with the catch-all path pattern', () => { const origin = defaultOrigin(); @@ -443,7 +440,6 @@ describe('multiple behaviors', () => { }); describe('certificates', () => { - test('should fail if using an imported certificate from outside of us-east-1', () => { const origin = defaultOrigin(); const certificate = acm.Certificate.fromCertificateArn(stack, 'Cert', 'arn:aws:acm:eu-west-1:123456789012:certificate/12345678-1234-1234-1234-123456789012'); @@ -475,61 +471,25 @@ describe('certificates', () => { }).toThrow(/Must specify at least one domain name/); }); - describe('adding a certificate and domain renders the correct ViewerCertificate and Aliases property', () => { - testFutureBehavior( - 'when @aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021 is enabled, use the TLSv1.2_2021 security policy by default', - { [CLOUDFRONT_DEFAULT_SECURITY_POLICY_TLS_V1_2_2021]: true }, - App, - (customApp) => { - const customStack = new Stack(customApp); - - const certificate = acm.Certificate.fromCertificateArn(customStack, 'Cert', 'arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012'); - - new Distribution(customStack, 'Dist', { - defaultBehavior: { origin: defaultOrigin() }, - domainNames: ['example.com', 'www.example.com'], - certificate, - }); - - Template.fromStack(customStack).hasResourceProperties('AWS::CloudFront::Distribution', { - DistributionConfig: { - Aliases: ['example.com', 'www.example.com'], - ViewerCertificate: { - AcmCertificateArn: 'arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012', - SslSupportMethod: 'sni-only', - MinimumProtocolVersion: 'TLSv1.2_2021', - }, - }, - }); - }, - ); - - testLegacyBehavior( - 'when @aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021 is disabled, use the TLSv1.2_2019 security policy by default', - App, - (customApp) => { - const customStack = new Stack(customApp); - - const certificate = acm.Certificate.fromCertificateArn(customStack, 'Cert', 'arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012'); - - new Distribution(customStack, 'Dist', { - defaultBehavior: { origin: defaultOrigin() }, - domainNames: ['example.com', 'www.example.com'], - certificate, - }); - - Template.fromStack(customStack).hasResourceProperties('AWS::CloudFront::Distribution', { - DistributionConfig: { - Aliases: ['example.com', 'www.example.com'], - ViewerCertificate: { - AcmCertificateArn: 'arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012', - SslSupportMethod: 'sni-only', - MinimumProtocolVersion: 'TLSv1.2_2019', - }, - }, - }); + test('use the TLSv1.2_2021 security policy by default', () => { + const certificate = acm.Certificate.fromCertificateArn(stack, 'Cert', 'arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012'); + + new Distribution(stack, 'Dist', { + defaultBehavior: { origin: defaultOrigin() }, + domainNames: ['example.com', 'www.example.com'], + certificate, + }); + + Template.fromStack(stack).hasResourceProperties('AWS::CloudFront::Distribution', { + DistributionConfig: { + Aliases: ['example.com', 'www.example.com'], + ViewerCertificate: { + AcmCertificateArn: 'arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012', + SslSupportMethod: 'sni-only', + MinimumProtocolVersion: 'TLSv1.2_2021', + }, }, - ); + }); }); test('adding a certificate with non default security policy protocol', () => { @@ -552,11 +512,9 @@ describe('certificates', () => { }, }); }); - }); describe('custom error responses', () => { - test('should fail if only the error code is provided', () => { const origin = defaultOrigin(); @@ -611,7 +569,6 @@ describe('custom error responses', () => { }, }); }); - }); describe('logging', () => { @@ -915,7 +872,6 @@ describe('with Lambda@Edge functions', () => { }); describe('with CloudFront functions', () => { - test('can add a CloudFront function to the default behavior', () => { new Distribution(stack, 'MyDist', { defaultBehavior: { @@ -949,7 +905,6 @@ describe('with CloudFront functions', () => { }, }); }); - }); test('price class is included if provided', () => { diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/lambda/lambda-invoke-action.test.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/lambda/lambda-invoke-action.test.ts index 835dc0e0d6819..c62c6519f4301 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/lambda/lambda-invoke-action.test.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/lambda/lambda-invoke-action.test.ts @@ -3,15 +3,11 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as lambda from '@aws-cdk/aws-lambda'; import * as s3 from '@aws-cdk/aws-s3'; import * as sns from '@aws-cdk/aws-sns'; -import { testFutureBehavior } from '@aws-cdk/cdk-build-tools/lib/feature-flag'; import { App, Aws, Lazy, SecretValue, Stack, Token } from '@aws-cdk/core'; -import * as cxapi from '@aws-cdk/cx-api'; import * as cpactions from '../../lib'; /* eslint-disable quote-props */ -const s3GrantWriteCtx = { [cxapi.S3_GRANT_WRITE_WITHOUT_ACL]: true }; - describe('', () => { describe('Lambda invoke Action', () => { test('properly serializes the object passed in userParameters', () => { @@ -160,11 +156,11 @@ describe('', () => { })); }); - testFutureBehavior("assigns the Action's Role with write permissions to the Bucket if it has only outputs", s3GrantWriteCtx, App, (app) => { + test("assigns the Action's Role with write permissions to the Bucket if it has only outputs", () => { const stack = stackIncludingLambdaInvokeCodePipeline({ lambdaOutput: new codepipeline.Artifact(), // no input to the Lambda Action - we want write permissions only in this case - }, app); + }); Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { PolicyName: 'PipelineInvokeLambdaCodePipelineActionRoleDefaultPolicy103F34DA', @@ -205,11 +201,11 @@ describe('', () => { }); }); - testFutureBehavior("assigns the Action's Role with read-write permissions to the Bucket if it has both inputs and outputs", s3GrantWriteCtx, App, (app) => { + test("assigns the Action's Role with read-write permissions to the Bucket if it has both inputs and outputs", () => { const stack = stackIncludingLambdaInvokeCodePipeline({ lambdaInput: new codepipeline.Artifact(), lambdaOutput: new codepipeline.Artifact(), - }, app); + }); Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { PolicyName: 'PipelineInvokeLambdaCodePipelineActionRoleDefaultPolicy103F34DA', diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/s3/s3-deploy-action.test.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/s3/s3-deploy-action.test.ts index 9fbb9ea2d153e..d5b5a0a3db79d 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/s3/s3-deploy-action.test.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/s3/s3-deploy-action.test.ts @@ -1,194 +1,178 @@ import { Template } from '@aws-cdk/assertions'; import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as s3 from '@aws-cdk/aws-s3'; -import { testFutureBehavior } from '@aws-cdk/cdk-build-tools/lib/feature-flag'; import { App, Duration, SecretValue, Stack } from '@aws-cdk/core'; -import * as cxapi from '@aws-cdk/cx-api'; import * as cpactions from '../../lib'; /* eslint-disable quote-props */ -describe('', () => { - describe('S3 Deploy Action', () => { - test('by default extract artifacts', () => { - const stack = new Stack(); - minimalPipeline(stack); +describe('S3 Deploy Action', () => { + test('by default extract artifacts', () => { + const stack = new Stack(); + minimalPipeline(stack); - Template.fromStack(stack).hasResourceProperties('AWS::CodePipeline::Pipeline', { - 'Stages': [ - { - 'Name': 'Source', - 'Actions': [ - { - 'Name': 'Source', - 'ActionTypeId': { - 'Category': 'Source', - 'Owner': 'ThirdParty', - }, - }, - ], - }, - { - 'Name': 'Deploy', - 'Actions': [ - { - 'ActionTypeId': { - 'Category': 'Deploy', - 'Provider': 'S3', - }, - 'Configuration': { - 'Extract': 'true', - }, - 'Name': 'CopyFiles', - }, - ], - }, - ], - }); - - - }); - - testFutureBehavior('grant the pipeline correct access to the target bucket', { [cxapi.S3_GRANT_WRITE_WITHOUT_ACL]: true }, App, (app) => { - const stack = new Stack(app); - minimalPipeline(stack); - - Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { - 'PolicyDocument': { - 'Statement': [ + Template.fromStack(stack).hasResourceProperties('AWS::CodePipeline::Pipeline', { + 'Stages': [ + { + 'Name': 'Source', + 'Actions': [ { - 'Effect': 'Allow', - 'Action': [ - 's3:GetObject*', - 's3:GetBucket*', - 's3:List*', - 's3:DeleteObject*', - 's3:PutObject', - 's3:PutObjectLegalHold', - 's3:PutObjectRetention', - 's3:PutObjectTagging', - 's3:PutObjectVersionTagging', - 's3:Abort*', - ], + 'Name': 'Source', + 'ActionTypeId': { + 'Category': 'Source', + 'Owner': 'ThirdParty', + }, }, - {}, + ], + }, + { + 'Name': 'Deploy', + 'Actions': [ { - 'Effect': 'Allow', - 'Action': 'sts:AssumeRole', + 'ActionTypeId': { + 'Category': 'Deploy', + 'Provider': 'S3', + }, + 'Configuration': { + 'Extract': 'true', + }, + 'Name': 'CopyFiles', }, ], }, - }); - - + ], }); + }); - test('kebab-case CannedACL value', () => { - const stack = new Stack(); - minimalPipeline(stack, { - accessControl: s3.BucketAccessControl.PUBLIC_READ_WRITE, - }); + test('grant the pipeline correct access to the target bucket', () => { + const stack = new Stack(); + minimalPipeline(stack); - Template.fromStack(stack).hasResourceProperties('AWS::CodePipeline::Pipeline', { - 'Stages': [ - {}, + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { + 'PolicyDocument': { + 'Statement': [ { - 'Actions': [ - { - 'Configuration': { - 'CannedACL': 'public-read-write', - }, - }, + 'Effect': 'Allow', + 'Action': [ + 's3:GetObject*', + 's3:GetBucket*', + 's3:List*', + 's3:DeleteObject*', + 's3:PutObject', + 's3:PutObjectLegalHold', + 's3:PutObjectRetention', + 's3:PutObjectTagging', + 's3:PutObjectVersionTagging', + 's3:Abort*', ], }, - ], - }); - - - }); - - test('allow customizing cache-control', () => { - const stack = new Stack(); - minimalPipeline(stack, { - cacheControl: [ - cpactions.CacheControl.setPublic(), - cpactions.CacheControl.maxAge(Duration.hours(12)), - cpactions.CacheControl.sMaxAge(Duration.hours(12)), - ], - }); - - Template.fromStack(stack).hasResourceProperties('AWS::CodePipeline::Pipeline', { - 'Stages': [ {}, { - 'Actions': [ - { - 'Configuration': { - 'CacheControl': 'public, max-age=43200, s-maxage=43200', - }, - }, - ], + 'Effect': 'Allow', + 'Action': 'sts:AssumeRole', }, ], - }); + }, + }); + }); + test('kebab-case CannedACL value', () => { + const stack = new Stack(); + minimalPipeline(stack, { + accessControl: s3.BucketAccessControl.PUBLIC_READ_WRITE, + }); + Template.fromStack(stack).hasResourceProperties('AWS::CodePipeline::Pipeline', { + 'Stages': [ + {}, + { + 'Actions': [ + { + 'Configuration': { + 'CannedACL': 'public-read-write', + }, + }, + ], + }, + ], }); + }); - test('allow customizing objectKey (deployment path on S3)', () => { - const stack = new Stack(); - minimalPipeline(stack, { - objectKey: '/a/b/c', - }); + test('allow customizing cache-control', () => { + const stack = new Stack(); + minimalPipeline(stack, { + cacheControl: [ + cpactions.CacheControl.setPublic(), + cpactions.CacheControl.maxAge(Duration.hours(12)), + cpactions.CacheControl.sMaxAge(Duration.hours(12)), + ], + }); - Template.fromStack(stack).hasResourceProperties('AWS::CodePipeline::Pipeline', { - 'Stages': [ - {}, - { - 'Actions': [ - { - 'Configuration': { - 'ObjectKey': '/a/b/c', - }, + Template.fromStack(stack).hasResourceProperties('AWS::CodePipeline::Pipeline', { + 'Stages': [ + {}, + { + 'Actions': [ + { + 'Configuration': { + 'CacheControl': 'public, max-age=43200, s-maxage=43200', }, - ], - }, - ], - }); - + }, + ], + }, + ], + }); + }); + test('allow customizing objectKey (deployment path on S3)', () => { + const stack = new Stack(); + minimalPipeline(stack, { + objectKey: '/a/b/c', }); - test('correctly makes the action cross-region for a Bucket imported with a different region', () => { - const app = new App(); - const stack = new Stack(app, 'PipelineStack', { - env: { account: '123456789012', region: 'us-west-2' }, - }); - const deployBucket = s3.Bucket.fromBucketAttributes(stack, 'DeployBucket', { - bucketName: 'my-deploy-bucket', - region: 'ap-southeast-1', - }); - - minimalPipeline(stack, { - bucket: deployBucket, - }); - - Template.fromStack(stack).hasResourceProperties('AWS::CodePipeline::Pipeline', { - Stages: [ - {}, - { - Name: 'Deploy', - Actions: [ - { - Name: 'CopyFiles', - Region: 'ap-southeast-1', + Template.fromStack(stack).hasResourceProperties('AWS::CodePipeline::Pipeline', { + 'Stages': [ + {}, + { + 'Actions': [ + { + 'Configuration': { + 'ObjectKey': '/a/b/c', }, - ], - }, - ], - }); + }, + ], + }, + ], + }); + }); + test('correctly makes the action cross-region for a Bucket imported with a different region', () => { + const app = new App(); + const stack = new Stack(app, 'PipelineStack', { + env: { account: '123456789012', region: 'us-west-2' }, + }); + const deployBucket = s3.Bucket.fromBucketAttributes(stack, 'DeployBucket', { + bucketName: 'my-deploy-bucket', + region: 'ap-southeast-1', + }); + + minimalPipeline(stack, { + bucket: deployBucket, + }); + Template.fromStack(stack).hasResourceProperties('AWS::CodePipeline::Pipeline', { + Stages: [ + {}, + { + Name: 'Deploy', + Actions: [ + { + Name: 'CopyFiles', + Region: 'ap-southeast-1', + }, + ], + }, + ], }); }); }); diff --git a/packages/@aws-cdk/aws-dynamodb/test/dynamodb.test.ts b/packages/@aws-cdk/aws-dynamodb/test/dynamodb.test.ts index 09d45edaac057..72a0de9f1491c 100644 --- a/packages/@aws-cdk/aws-dynamodb/test/dynamodb.test.ts +++ b/packages/@aws-cdk/aws-dynamodb/test/dynamodb.test.ts @@ -4,7 +4,6 @@ import * as iam from '@aws-cdk/aws-iam'; import * as kinesis from '@aws-cdk/aws-kinesis'; import * as kms from '@aws-cdk/aws-kms'; import { testDeprecated } from '@aws-cdk/cdk-build-tools'; -import { testLegacyBehavior } from '@aws-cdk/cdk-build-tools/lib/feature-flag'; import { App, Aws, CfnDeletionPolicy, Duration, PhysicalName, RemovalPolicy, Resource, Stack, Tags } from '@aws-cdk/core'; import * as cr from '@aws-cdk/custom-resources'; import { Construct } from 'constructs'; @@ -503,192 +502,6 @@ test('fails if both replication regions used with customer managed CMK', () => { })).toThrow('TableEncryption.CUSTOMER_MANAGED is not supported by DynamoDB Global Tables (where replicationRegions was set)'); }); -// this behaviour is only applicable without the future flag 'aws-kms:defaultKeyPolicies' -// see subsequent test for the updated behaviour -testLegacyBehavior('if an encryption key is included, encrypt/decrypt permissions are also added both ways', App, (app) => { - const stack = new Stack(app); - const table = new Table(stack, 'Table A', { - tableName: TABLE_NAME, - partitionKey: TABLE_PARTITION_KEY, - encryption: TableEncryption.CUSTOMER_MANAGED, - }); - const user = new iam.User(stack, 'MyUser'); - table.grantReadWriteData(user); - Template.fromStack(stack).templateMatches({ - Resources: { - TableAKey07CC09EC: { - Type: 'AWS::KMS::Key', - Properties: { - KeyPolicy: { - Statement: [ - { - Action: [ - 'kms:Create*', - 'kms:Describe*', - 'kms:Enable*', - 'kms:List*', - 'kms:Put*', - 'kms:Update*', - 'kms:Revoke*', - 'kms:Disable*', - 'kms:Get*', - 'kms:Delete*', - 'kms:ScheduleKeyDeletion', - 'kms:CancelKeyDeletion', - 'kms:GenerateDataKey', - 'kms:TagResource', - 'kms:UntagResource', - ], - Effect: 'Allow', - Principal: { - AWS: { - 'Fn::Join': [ - '', - [ - 'arn:', - { - Ref: 'AWS::Partition', - }, - ':iam::', - { - Ref: 'AWS::AccountId', - }, - ':root', - ], - ], - }, - }, - Resource: '*', - }, - { - Action: [ - 'kms:Decrypt', - 'kms:DescribeKey', - 'kms:Encrypt', - 'kms:ReEncrypt*', - 'kms:GenerateDataKey*', - ], - Effect: 'Allow', - Principal: { - AWS: { - 'Fn::GetAtt': [ - 'MyUserDC45028B', - 'Arn', - ], - }, - }, - Resource: '*', - }, - ], - Version: '2012-10-17', - }, - Description: 'Customer-managed key auto-created for encrypting DynamoDB table at Default/Table A', - EnableKeyRotation: true, - }, - UpdateReplacePolicy: 'Retain', - DeletionPolicy: 'Retain', - }, - TableA3D7B5AFA: { - Type: 'AWS::DynamoDB::Table', - Properties: { - KeySchema: [ - { - AttributeName: 'hashKey', - KeyType: 'HASH', - }, - ], - AttributeDefinitions: [ - { - AttributeName: 'hashKey', - AttributeType: 'S', - }, - ], - ProvisionedThroughput: { - ReadCapacityUnits: 5, - WriteCapacityUnits: 5, - }, - SSESpecification: { - KMSMasterKeyId: { - 'Fn::GetAtt': [ - 'TableAKey07CC09EC', - 'Arn', - ], - }, - SSEEnabled: true, - SSEType: 'KMS', - }, - TableName: 'MyTable', - }, - UpdateReplacePolicy: 'Retain', - DeletionPolicy: 'Retain', - }, - MyUserDC45028B: { - Type: 'AWS::IAM::User', - }, - MyUserDefaultPolicy7B897426: { - Type: 'AWS::IAM::Policy', - Properties: { - PolicyDocument: { - Statement: [ - { - Action: [ - 'dynamodb:BatchGetItem', - 'dynamodb:GetRecords', - 'dynamodb:GetShardIterator', - 'dynamodb:Query', - 'dynamodb:GetItem', - 'dynamodb:Scan', - 'dynamodb:ConditionCheckItem', - 'dynamodb:BatchWriteItem', - 'dynamodb:PutItem', - 'dynamodb:UpdateItem', - 'dynamodb:DeleteItem', - 'dynamodb:DescribeTable', - ], - Effect: 'Allow', - Resource: [ - { - 'Fn::GetAtt': [ - 'TableA3D7B5AFA', - 'Arn', - ], - }, - { - Ref: 'AWS::NoValue', - }, - ], - }, - { - Action: [ - 'kms:Decrypt', - 'kms:DescribeKey', - 'kms:Encrypt', - 'kms:ReEncrypt*', - 'kms:GenerateDataKey*', - ], - Effect: 'Allow', - Resource: { - 'Fn::GetAtt': [ - 'TableAKey07CC09EC', - 'Arn', - ], - }, - }, - ], - Version: '2012-10-17', - }, - PolicyName: 'MyUserDefaultPolicy7B897426', - Users: [ - { - Ref: 'MyUserDC45028B', - }, - ], - }, - }, - }, - }); -}); - test('if an encryption key is included, encrypt/decrypt permissions are added to the principal', () => { const stack = new Stack(); const table = new Table(stack, 'Table A', { diff --git a/packages/@aws-cdk/aws-ec2/test/aspects/require-imdsv2-aspect.test.ts b/packages/@aws-cdk/aws-ec2/test/aspects/require-imdsv2-aspect.test.ts index b35e2d33dfd90..80d5a7165391f 100644 --- a/packages/@aws-cdk/aws-ec2/test/aspects/require-imdsv2-aspect.test.ts +++ b/packages/@aws-cdk/aws-ec2/test/aspects/require-imdsv2-aspect.test.ts @@ -1,7 +1,5 @@ import { Annotations, Template, Match } from '@aws-cdk/assertions'; -import { testFutureBehavior, testLegacyBehavior } from '@aws-cdk/cdk-build-tools'; import * as cdk from '@aws-cdk/core'; -import * as cxapi from '@aws-cdk/cx-api'; import { Construct } from 'constructs'; import { CfnLaunchTemplate, @@ -122,8 +120,9 @@ describe('RequireImdsv2Aspect', () => { Annotations.fromStack(stack).hasNoWarning('/Stack/Instance', 'Cannot toggle IMDSv1 because this Instance is associated with an existing Launch Template.'); }); - testFutureBehavior('launch template name is unique with feature flag', { [cxapi.EC2_UNIQUE_IMDSV2_LAUNCH_TEMPLATE_NAME]: true }, cdk.App, (app2) => { + test('launch template name is unique with feature flag', () => { // GIVEN + const app2 = new cdk.App(); const otherStack = new cdk.Stack(app2, 'OtherStack'); const otherVpc = new Vpc(otherStack, 'OtherVpc'); const otherInstance = new Instance(otherStack, 'OtherInstance', { @@ -152,26 +151,6 @@ describe('RequireImdsv2Aspect', () => { expect(otherLaunchTemplate).toBeDefined(); expect(launchTemplate.launchTemplateName !== otherLaunchTemplate.launchTemplateName); }); - - testLegacyBehavior('launch template name uses legacy id without feature flag', cdk.App, (app2) => { - // GIVEN - const imdsv2Stack = new cdk.Stack(app2, 'RequireImdsv2Stack'); - const imdsv2Vpc = new Vpc(imdsv2Stack, 'Vpc'); - const instance = new Instance(imdsv2Stack, 'Instance', { - vpc: imdsv2Vpc, - instanceType: new InstanceType('t2.micro'), - machineImage: MachineImage.latestAmazonLinux(), - }); - const aspect = new InstanceRequireImdsv2Aspect(); - - // WHEN - cdk.Aspects.of(imdsv2Stack).add(aspect); - app2.synth(); - - // THEN - const launchTemplate = instance.node.tryFindChild('LaunchTemplate') as LaunchTemplate; - expect(launchTemplate.launchTemplateName).toEqual(`${instance.node.id}LaunchTemplate`); - }); }); describe('LaunchTemplateRequireImdsv2Aspect', () => { diff --git a/packages/@aws-cdk/aws-ec2/test/volume.test.ts b/packages/@aws-cdk/aws-ec2/test/volume.test.ts index 5e7d3591cd877..a52afe2ad5dc2 100644 --- a/packages/@aws-cdk/aws-ec2/test/volume.test.ts +++ b/packages/@aws-cdk/aws-ec2/test/volume.test.ts @@ -1,12 +1,7 @@ import { Match, Template } from '@aws-cdk/assertions'; -import { - AccountRootPrincipal, - Role, -} from '@aws-cdk/aws-iam'; +import { AccountRootPrincipal, Role } from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; -import { testFutureBehavior, testLegacyBehavior } from '@aws-cdk/cdk-build-tools/lib/feature-flag'; import * as cdk from '@aws-cdk/core'; -import * as cxapi from '@aws-cdk/cx-api'; import { AmazonLinuxGeneration, EbsDeviceVolumeType, @@ -66,7 +61,6 @@ describe('volume', () => { expect(volume.volumeId).toEqual(volumeId); expect(volume.availabilityZone).toEqual(availabilityZone); expect(volume.encryptionKey).toEqual(encryptionKey); - }); test('tagged volume', () => { @@ -91,8 +85,6 @@ describe('volume', () => { Value: 'TagValue', }], }); - - }); test('autoenableIO', () => { @@ -110,8 +102,6 @@ describe('volume', () => { Template.fromStack(stack).hasResourceProperties('AWS::EC2::Volume', { AutoEnableIO: true, }); - - }); test('encryption', () => { @@ -129,8 +119,6 @@ describe('volume', () => { Template.fromStack(stack).hasResourceProperties('AWS::EC2::Volume', { Encrypted: true, }); - - }); test('encryption with kms', () => { @@ -205,40 +193,6 @@ describe('volume', () => { }]), }, }); - - - }); - - // only enable for legacy behaviour - // see https://github.com/aws/aws-cdk/issues/12962 - testLegacyBehavior('encryption with kms from snapshot', cdk.App, (app) => { - // GIVEN - const stack = new cdk.Stack(app); - const encryptionKey = new kms.Key(stack, 'Key'); - - // WHEN - new Volume(stack, 'Volume', { - availabilityZone: 'us-east-1a', - size: cdk.Size.gibibytes(500), - encrypted: true, - encryptionKey, - snapshotId: 'snap-1234567890', - }); - - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::KMS::Key', { - KeyPolicy: { - Statement: Match.arrayWith([Match.objectLike({ - Action: [ - 'kms:DescribeKey', - 'kms:GenerateDataKeyWithoutPlainText', - 'kms:ReEncrypt*', - ], - })]), - }, - }); - - }); test('iops', () => { @@ -258,8 +212,6 @@ describe('volume', () => { Iops: 500, VolumeType: 'io1', }); - - }); test('multi-attach', () => { @@ -279,8 +231,6 @@ describe('volume', () => { Template.fromStack(stack).hasResourceProperties('AWS::EC2::Volume', { MultiAttachEnabled: true, }); - - }); test('snapshotId', () => { @@ -297,8 +247,6 @@ describe('volume', () => { Template.fromStack(stack).hasResourceProperties('AWS::EC2::Volume', { SnapshotId: 'snap-00000000', }); - - }); test('volume: standard', () => { @@ -316,8 +264,6 @@ describe('volume', () => { Template.fromStack(stack).hasResourceProperties('AWS::EC2::Volume', { VolumeType: 'standard', }); - - }); test('volume: io1', () => { @@ -336,8 +282,6 @@ describe('volume', () => { Template.fromStack(stack).hasResourceProperties('AWS::EC2::Volume', { VolumeType: 'io1', }); - - }); test('volume: io2', () => { @@ -356,8 +300,6 @@ describe('volume', () => { Template.fromStack(stack).hasResourceProperties('AWS::EC2::Volume', { VolumeType: 'io2', }); - - }); test('volume: gp2', () => { @@ -375,8 +317,6 @@ describe('volume', () => { Template.fromStack(stack).hasResourceProperties('AWS::EC2::Volume', { VolumeType: 'gp2', }); - - }); test('volume: gp3', () => { @@ -394,8 +334,6 @@ describe('volume', () => { Template.fromStack(stack).hasResourceProperties('AWS::EC2::Volume', { VolumeType: 'gp3', }); - - }); test('volume: st1', () => { @@ -413,8 +351,6 @@ describe('volume', () => { Template.fromStack(stack).hasResourceProperties('AWS::EC2::Volume', { VolumeType: 'st1', }); - - }); test('volume: sc1', () => { @@ -432,8 +368,6 @@ describe('volume', () => { Template.fromStack(stack).hasResourceProperties('AWS::EC2::Volume', { VolumeType: 'sc1', }); - - }); test('grantAttachVolume to any instance', () => { @@ -503,73 +437,12 @@ describe('volume', () => { }], }, }); - }); describe('grantAttachVolume to any instance with encryption', () => { - - // This exact assertions here are only applicable when 'aws-kms:defaultKeyPolicies' feature flag is disabled. - // See subsequent test case for the updated behaviour - testLegacyBehavior('legacy', cdk.App, (app) => { + test('with default key policies', () => { // GIVEN - const stack = new cdk.Stack(app); - const role = new Role(stack, 'Role', { assumedBy: new AccountRootPrincipal() }); - const encryptionKey = new kms.Key(stack, 'Key'); - const volume = new Volume(stack, 'Volume', { - availabilityZone: 'us-east-1a', - size: cdk.Size.gibibytes(8), - encrypted: true, - encryptionKey, - }); - - // WHEN - volume.grantAttachVolume(role); - - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::KMS::Key', { - KeyPolicy: { - Statement: Match.arrayWith([{ - Effect: 'Allow', - Principal: { - AWS: { - 'Fn::GetAtt': [ - 'Role1ABCC5F0', - 'Arn', - ], - }, - }, - Action: 'kms:CreateGrant', - Condition: { - Bool: { - 'kms:GrantIsForAWSResource': true, - }, - StringEquals: { - 'kms:ViaService': { - 'Fn::Join': [ - '', - [ - 'ec2.', - { - Ref: 'AWS::Region', - }, - '.amazonaws.com', - ], - ], - }, - 'kms:GrantConstraintType': 'EncryptionContextSubset', - }, - }, - Resource: '*', - }]), - }, - }); - - - }); - - testFutureBehavior('with future flag aws-kms:defaultKeyPolicies', { [cxapi.KMS_DEFAULT_KEY_POLICIES]: true }, cdk.App, (app) => { - // GIVEN - const stack = new cdk.Stack(app); + const stack = new cdk.Stack(); const role = new Role(stack, 'Role', { assumedBy: new AccountRootPrincipal() }); const encryptionKey = new kms.Key(stack, 'Key'); const volume = new Volume(stack, 'Volume', { @@ -617,10 +490,7 @@ describe('volume', () => { }]), }, }); - - }); - }); test('grantAttachVolume to any instance with KMS.fromKeyArn() encryption', () => { @@ -691,8 +561,6 @@ describe('volume', () => { }]), }, }); - - }); test('grantAttachVolume to specific instances', () => { @@ -776,8 +644,6 @@ describe('volume', () => { }], }, }); - - }); test('grantAttachVolume to instance self', () => { @@ -916,7 +782,6 @@ describe('volume', () => { Value: 'b2376b2bda65cb40f83c290dd844c4aa', }]), }); - }); test('grantDetachVolume to any instance', () => { @@ -986,7 +851,6 @@ describe('volume', () => { }], }, }); - }); test('grantDetachVolume from specific instance', () => { @@ -1070,8 +934,6 @@ describe('volume', () => { }], }, }); - - }); test('grantDetachVolume from instance self', () => { @@ -1212,7 +1074,6 @@ describe('volume', () => { Value: 'b2376b2bda65cb40f83c290dd844c4aa', }]), }); - }); test('validation fromVolumeAttributes', () => { @@ -1249,7 +1110,6 @@ describe('volume', () => { availabilityZone: 'us-east-1a', }); }).toThrow('`volumeId` does not match expected pattern. Expected `vol-` (ex: `vol-05abe246af`) or a Token'); - }); test('validation required props', () => { @@ -1307,8 +1167,6 @@ describe('volume', () => { encryptionKey: key, }); }).not.toThrow(); - - }); test('validation snapshotId', () => { @@ -1346,8 +1204,6 @@ describe('volume', () => { snapshotId: 'snap-1234 ', // trailing extra character(s) }); }).toThrow('`snapshotId` does match expected pattern. Expected `snap-` (ex: `snap-05abe246af`) or Token'); - - }); test('validation iops', () => { @@ -1470,8 +1326,6 @@ describe('volume', () => { }); }).toThrow(/iops has a maximum ratio of/); } - - }); test('validation multi-attach', () => { @@ -1515,8 +1369,6 @@ describe('volume', () => { }).toThrow(/multi-attach is supported exclusively/); } } - - }); test('validation size in range', () => { @@ -1583,8 +1435,5 @@ describe('volume', () => { }); }).toThrow(/volumes must be between/); } - - }); - }); diff --git a/packages/@aws-cdk/aws-ecr-assets/test/image-asset.test.ts b/packages/@aws-cdk/aws-ecr-assets/test/image-asset.test.ts index 133ecaf988ed3..775345b10d3e8 100644 --- a/packages/@aws-cdk/aws-ecr-assets/test/image-asset.test.ts +++ b/packages/@aws-cdk/aws-ecr-assets/test/image-asset.test.ts @@ -1,257 +1,14 @@ import * as fs from 'fs'; import * as path from 'path'; -import { Template } from '@aws-cdk/assertions'; -import * as iam from '@aws-cdk/aws-iam'; -import { describeDeprecated, testDeprecated, testLegacyBehavior, testFutureBehavior } from '@aws-cdk/cdk-build-tools'; +import { describeDeprecated, testDeprecated } from '@aws-cdk/cdk-build-tools'; import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import { App, DefaultStackSynthesizer, IgnoreMode, Lazy, LegacyStackSynthesizer, Stack, Stage } from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; -import { DockerImageAsset, NetworkMode, Platform } from '../lib'; - -/* eslint-disable quote-props */ +import { DockerImageAsset } from '../lib'; const DEMO_IMAGE_ASSET_HASH = '0a3355be12051c9984bf2b0b2bba4e6ea535968e5b6e7396449701732fe5ed14'; -const flags = { [cxapi.DOCKER_IGNORE_SUPPORT]: true }; - -class MyApp extends App { - constructor() { - super({ - context: flags, - }); - } -} - describe('image asset', () => { - testLegacyBehavior('test instantiating Asset Image', MyApp, (app) => { - // WHEN - const stack = new Stack(app); - new DockerImageAsset(stack, 'Image', { - directory: path.join(__dirname, 'demo-image'), - }); - - // THEN - const asm = app.synth(); - const artifact = asm.getStackArtifact(stack.artifactId); - expect(artifact.template).toEqual({}); - expect(artifact.assets).toEqual([ - { - repositoryName: 'aws-cdk/assets', - imageTag: '0a3355be12051c9984bf2b0b2bba4e6ea535968e5b6e7396449701732fe5ed14', - id: '0a3355be12051c9984bf2b0b2bba4e6ea535968e5b6e7396449701732fe5ed14', - packaging: 'container-image', - path: 'asset.0a3355be12051c9984bf2b0b2bba4e6ea535968e5b6e7396449701732fe5ed14', - sourceHash: '0a3355be12051c9984bf2b0b2bba4e6ea535968e5b6e7396449701732fe5ed14', - }, - ]); - - }); - - testLegacyBehavior('with build args', App, (app) => { - // WHEN - const stack = new Stack(app); - new DockerImageAsset(stack, 'Image', { - directory: path.join(__dirname, 'demo-image'), - buildArgs: { - a: 'b', - }, - }); - - // THEN - const assetMetadata = stack.node.metadata.find(({ type }) => type === cxschema.ArtifactMetadataEntryType.ASSET); - expect(assetMetadata && (assetMetadata.data as cxschema.ContainerImageAssetMetadataEntry).buildArgs).toEqual({ a: 'b' }); - - }); - - testLegacyBehavior('with hash options', App, (app) => { - // WHEN - const stack = new Stack(app); - new DockerImageAsset(stack, 'Image1', { - directory: path.join(__dirname, 'demo-image'), - buildArgs: { - a: 'b', - }, - invalidation: { - buildArgs: false, - }, - }); - new DockerImageAsset(stack, 'Image2', { - directory: path.join(__dirname, 'demo-image'), - buildArgs: { - a: 'c', - }, - invalidation: { - buildArgs: false, - }, - }); - new DockerImageAsset(stack, 'Image3', { - directory: path.join(__dirname, 'demo-image'), - buildArgs: { - a: 'b', - }, - }); - - // THEN - const asm = app.synth(); - const artifact = asm.getStackArtifact(stack.artifactId); - expect(artifact.template.Resources).toBeUndefined(); - expect(artifact.assets).toEqual([ - { - buildArgs: { 'a': 'b' }, - id: '0a3355be12051c9984bf2b0b2bba4e6ea535968e5b6e7396449701732fe5ed14', - imageTag: '0a3355be12051c9984bf2b0b2bba4e6ea535968e5b6e7396449701732fe5ed14', - packaging: 'container-image', - path: 'asset.0a3355be12051c9984bf2b0b2bba4e6ea535968e5b6e7396449701732fe5ed14', - repositoryName: 'aws-cdk/assets', - sourceHash: '0a3355be12051c9984bf2b0b2bba4e6ea535968e5b6e7396449701732fe5ed14', - }, - { - buildArgs: { 'a': 'b' }, - id: '7f3aa0a36ecd282884e11463b3fde119d25d1ed424f934300f0c7b9cf6f63947', - imageTag: '7f3aa0a36ecd282884e11463b3fde119d25d1ed424f934300f0c7b9cf6f63947', - packaging: 'container-image', - path: 'asset.7f3aa0a36ecd282884e11463b3fde119d25d1ed424f934300f0c7b9cf6f63947', - repositoryName: 'aws-cdk/assets', - sourceHash: '7f3aa0a36ecd282884e11463b3fde119d25d1ed424f934300f0c7b9cf6f63947', - }, - ]); - }); - - testLegacyBehavior('with target', App, (app) => { - // WHEN - const stack = new Stack(app); - new DockerImageAsset(stack, 'Image', { - directory: path.join(__dirname, 'demo-image'), - buildArgs: { - a: 'b', - }, - target: 'a-target', - }); - - // THEN - const assetMetadata = stack.node.metadata.find(({ type }) => type === cxschema.ArtifactMetadataEntryType.ASSET); - expect(assetMetadata && (assetMetadata.data as cxschema.ContainerImageAssetMetadataEntry).target).toEqual('a-target'); - - }); - - testLegacyBehavior('with file', App, (app) => { - // GIVEN - const stack = new Stack(app); - const directoryPath = path.join(__dirname, 'demo-image-custom-docker-file'); - // WHEN - new DockerImageAsset(stack, 'Image', { - directory: directoryPath, - file: 'Dockerfile.Custom', - }); - - // THEN - const assetMetadata = stack.node.metadata.find(({ type }) => type === cxschema.ArtifactMetadataEntryType.ASSET); - expect(assetMetadata && (assetMetadata.data as cxschema.ContainerImageAssetMetadataEntry).file).toEqual('Dockerfile.Custom'); - }); - - testLegacyBehavior('with networkMode', App, (app) => { - // GIVEN - const stack = new Stack(app); - // WHEN - new DockerImageAsset(stack, 'Image', { - directory: path.join(__dirname, 'demo-image'), - networkMode: NetworkMode.DEFAULT, - }); - - // THEN - const assetMetadata = stack.node.metadata.find(({ type }) => type === cxschema.ArtifactMetadataEntryType.ASSET); - expect(assetMetadata && (assetMetadata.data as cxschema.ContainerImageAssetMetadataEntry).networkMode).toEqual('default'); - }); - - testLegacyBehavior('with platform', App, (app) => { - // GIVEN - const stack = new Stack(app); - // WHEN - new DockerImageAsset(stack, 'Image', { - directory: path.join(__dirname, 'demo-image'), - platform: Platform.LINUX_ARM64, - }); - - // THEN - const assetMetadata = stack.node.metadata.find(({ type }) => type === cxschema.ArtifactMetadataEntryType.ASSET); - expect(assetMetadata && (assetMetadata.data as cxschema.ContainerImageAssetMetadataEntry).platform).toEqual('linux/arm64'); - }); - - testLegacyBehavior('with platform: default synth edition', App, (app) => { - // GIVEN - const stack = new Stack(app, 'Stack', { synthesizer: new DefaultStackSynthesizer() }); - // WHEN - const asset = new DockerImageAsset(stack, 'Image', { - directory: path.join(__dirname, 'demo-image'), - platform: Platform.LINUX_ARM64, - }); - - // THEN - const asm = app.synth(); - const stackAssets = JSON.parse(fs.readFileSync(path.join(asm.directory, 'Stack.assets.json'), { encoding: 'utf-8' })); - const dockerImageAsset = stackAssets.dockerImages[asset.assetHash]; - expect(dockerImageAsset.source.platform).toEqual('linux/arm64'); - }); - testLegacyBehavior('asset.repository.grantPull can be used to grant a principal permissions to use the image', App, (app) => { - // GIVEN - const stack = new Stack(app); - const user = new iam.User(stack, 'MyUser'); - const asset = new DockerImageAsset(stack, 'Image', { - directory: path.join(__dirname, 'demo-image'), - }); - - // WHEN - asset.repository.grantPull(user); - - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { - PolicyDocument: { - 'Statement': [ - { - 'Action': [ - 'ecr:BatchCheckLayerAvailability', - 'ecr:GetDownloadUrlForLayer', - 'ecr:BatchGetImage', - ], - 'Effect': 'Allow', - 'Resource': { - 'Fn::Join': [ - '', - [ - 'arn:', - { - 'Ref': 'AWS::Partition', - }, - ':ecr:', - { - 'Ref': 'AWS::Region', - }, - ':', - { - 'Ref': 'AWS::AccountId', - }, - ':repository/aws-cdk/assets', - ], - ], - }, - }, - { - 'Action': 'ecr:GetAuthorizationToken', - 'Effect': 'Allow', - 'Resource': '*', - }, - ], - 'Version': '2012-10-17', - }, - 'PolicyName': 'MyUserDefaultPolicy7B897426', - 'Users': [ - { - 'Ref': 'MyUserDC45028B', - }, - ], - }); - }); - test('fails if the directory does not exist', () => { const stack = new Stack(); // THEN @@ -286,7 +43,8 @@ describe('image asset', () => { }); - testFutureBehavior('docker directory is staged if asset staging is enabled', flags, App, (app) => { + test('docker directory is staged if asset staging is enabled', () => { + const app = new App(); const stack = new Stack(app); const image = new DockerImageAsset(stack, 'MyAsset', { directory: path.join(__dirname, 'demo-image'), @@ -306,16 +64,19 @@ describe('image asset', () => { // Using a 'describeDeprecated' block here since there's no way to work around this craziness. // When the deprecated property is removed source code, this block can be dropped. - testFutureBehavior('docker directory is staged without files specified in .dockerignore', flags, App, (app) => { + test('docker directory is staged without files specified in .dockerignore', () => { + const app = new App(); testDockerDirectoryIsStagedWithoutFilesSpecifiedInDockerignore(app); }); - testFutureBehavior('docker directory is staged without files specified in .dockerignore with IgnoreMode.GLOB', flags, App, (app) => { + test('docker directory is staged without files specified in .dockerignore with IgnoreMode.GLOB', () => { + const app = new App(); testDockerDirectoryIsStagedWithoutFilesSpecifiedInDockerignore(app, IgnoreMode.GLOB); }); }); - testFutureBehavior('docker directory is staged with allow-listed files specified in .dockerignore', flags, App, (app) => { + test('docker directory is staged with allow-listed files specified in .dockerignore', () => { + const app = new App(); const stack = new Stack(app); const image = new DockerImageAsset(stack, 'MyAsset', { directory: path.join(__dirname, 'allow-listed-image'), @@ -336,11 +97,13 @@ describe('image asset', () => { expect(!fs.existsSync(path.join(session.directory, `asset.${image.assetHash}`, 'node_modules', 'some_dep', 'file'))).toBe(true); }); - testFutureBehavior('docker directory is staged without files specified in exclude option', flags, App, (app) => { + test('docker directory is staged without files specified in exclude option', () => { + const app = new App(); testDockerDirectoryIsStagedWithoutFilesSpecifiedInExcludeOption(app); }); - testFutureBehavior('docker directory is staged without files specified in exclude option with IgnoreMode.GLOB', flags, App, (app) => { + test('docker directory is staged without files specified in exclude option with IgnoreMode.GLOB', () => { + const app = new App(); testDockerDirectoryIsStagedWithoutFilesSpecifiedInExcludeOption(app, IgnoreMode.GLOB); }); @@ -374,8 +137,9 @@ describe('image asset', () => { })).toThrow(/Cannot use Token as value of 'repositoryName'/); }); - testFutureBehavior('docker build options are included in the asset id', flags, App, (app) => { + test('docker build options are included in the asset id', () => { // GIVEN + const app = new App(); const stack = new Stack(app); const directory = path.join(__dirname, 'demo-image-custom-docker-file'); @@ -467,8 +231,9 @@ function testDockerDirectoryIsStagedWithoutFilesSpecifiedInExcludeOption(app: Ap expect(!fs.existsSync(path.join(session.directory, `asset.${image.assetHash}`, 'subdirectory', 'baz.txt'))).toBe(true); } -testFutureBehavior('nested assemblies share assets: legacy synth edition', flags, App, (app) => { +test('nested assemblies share assets: legacy synth edition', () => { // GIVEN + const app = new App(); const stack1 = new Stack(new Stage(app, 'Stage1'), 'Stack', { synthesizer: new LegacyStackSynthesizer() }); const stack2 = new Stack(new Stage(app, 'Stage2'), 'Stack', { synthesizer: new LegacyStackSynthesizer() }); @@ -493,8 +258,9 @@ testFutureBehavior('nested assemblies share assets: legacy synth edition', flags } }); -testFutureBehavior('nested assemblies share assets: default synth edition', flags, App, (app) => { +test('nested assemblies share assets: default synth edition', () => { // GIVEN + const app = new App(); const stack1 = new Stack(new Stage(app, 'Stage1'), 'Stack', { synthesizer: new DefaultStackSynthesizer() }); const stack2 = new Stack(new Stage(app, 'Stage2'), 'Stack', { synthesizer: new DefaultStackSynthesizer() }); diff --git a/packages/@aws-cdk/aws-ecr-assets/test/tarball-asset.test.ts b/packages/@aws-cdk/aws-ecr-assets/test/tarball-asset.test.ts index 553bc2f951f04..1333cc8e5c91b 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 @@ -2,7 +2,6 @@ import * as fs from 'fs'; import * as path from 'path'; import { Template } from '@aws-cdk/assertions'; import * as iam from '@aws-cdk/aws-iam'; -import { testFutureBehavior } from '@aws-cdk/cdk-build-tools/lib/feature-flag'; import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import { App, Stack, DefaultStackSynthesizer } from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; @@ -10,11 +9,11 @@ import { TarballImageAsset } from '../lib'; /* eslint-disable quote-props */ -const flags = { [cxapi.NEW_STYLE_STACK_SYNTHESIS_CONTEXT]: true }; describe('image asset', () => { - testFutureBehavior('test instantiating Asset Image', flags, App, (app) => { + test('test instantiating Asset Image', () => { // GIVEN + const app = new App(); const stack = new Stack(app); const asset = new TarballImageAsset(stack, 'Image', { tarballFile: __dirname + '/demo-tarball/empty.tar', @@ -52,9 +51,9 @@ describe('image asset', () => { expect(asset.node.tryFindChild('Staging')).toBeDefined(); }); - testFutureBehavior('asset.repository.grantPull can be used to grant a principal permissions to use the image', flags, App, (app) => { + test('asset.repository.grantPull can be used to grant a principal permissions to use the image', () => { // GIVEN - const stack = new Stack(app); + const stack = new Stack(); const user = new iam.User(stack, 'MyUser'); const asset = new TarballImageAsset(stack, 'Image', { tarballFile: 'test/demo-tarball/empty.tar', @@ -115,7 +114,8 @@ describe('image asset', () => { }); }); - testFutureBehavior('docker directory is staged if asset staging is enabled', flags, App, (app) => { + test('docker directory is staged if asset staging is enabled', () => { + const app = new App(); const stack = new Stack(app); const image = new TarballImageAsset(stack, 'MyAsset', { tarballFile: 'test/demo-tarball/empty.tar', diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/l3s.test.ts b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/l3s.test.ts index 82086081b299e..6dbdcf417509d 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/l3s.test.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/l3s.test.ts @@ -8,10 +8,8 @@ import { AsgCapacityProvider } from '@aws-cdk/aws-ecs'; import { ApplicationLoadBalancer, ApplicationProtocol, ApplicationProtocolVersion, NetworkLoadBalancer, SslPolicy } from '@aws-cdk/aws-elasticloadbalancingv2'; import { PublicHostedZone } from '@aws-cdk/aws-route53'; import * as cloudmap from '@aws-cdk/aws-servicediscovery'; -import { testLegacyBehavior } from '@aws-cdk/cdk-build-tools'; import * as cdk from '@aws-cdk/core'; import { Duration } from '@aws-cdk/core'; -import * as cxapi from '@aws-cdk/cx-api'; import * as ecsPatterns from '../../lib'; test('test ECS loadbalanced construct', () => { @@ -73,56 +71,6 @@ test('test ECS loadbalanced construct', () => { }); }); -testLegacyBehavior('ApplicationLoadBalancedEc2Service desiredCount can be undefined when feature flag is set', cdk.App, (app) => { - // GIVEN - const stack = new cdk.Stack(app); - stack.node.setContext(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT, true); - - const vpc = new ec2.Vpc(stack, 'VPC'); - const cluster = new ecs.Cluster(stack, 'Cluster', { vpc }); - cluster.addAsgCapacityProvider(new AsgCapacityProvider(stack, 'DefaultAutoScalingGroupProvider', { - autoScalingGroup: new AutoScalingGroup(stack, 'DefaultAutoScalingGroup', { - vpc, - instanceType: new ec2.InstanceType('t2.micro'), - machineImage: MachineImage.latestAmazonLinux(), - }), - })); - - // WHEN - new ecsPatterns.ApplicationLoadBalancedEc2Service(stack, 'Service', { - cluster, - memoryLimitMiB: 1024, - taskImageOptions: { - image: ecs.ContainerImage.fromRegistry('test'), - }, - }); - - Template.fromStack(stack).hasResourceProperties('AWS::ECS::Service', { - DesiredCount: Match.absent(), - }); -}); - -testLegacyBehavior('ApplicationLoadBalancedFargateService desiredCount can be undefined when feature flag is set', cdk.App, (app) => { - // GIVEN - const stack = new cdk.Stack(app); - stack.node.setContext(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT, true); - - const vpc = new ec2.Vpc(stack, 'VPC'); - const cluster = new ecs.Cluster(stack, 'Cluster', { vpc }); - - // WHEN - new ecsPatterns.ApplicationLoadBalancedFargateService(stack, 'Service', { - cluster, - taskImageOptions: { - image: ecs.ContainerImage.fromRegistry('test'), - }, - }); - - Template.fromStack(stack).hasResourceProperties('AWS::ECS::Service', { - DesiredCount: Match.absent(), - }); -}); - test('ApplicationLoadBalancedEc2Service multiple capacity provider strategies are set', () => { // GIVEN const stack = new cdk.Stack(); @@ -241,56 +189,6 @@ test('NetworkLoadBalancedEc2Service multiple capacity provider strategies are se }); }); -testLegacyBehavior('NetworkLoadBalancedEc2Service desiredCount can be undefined when feature flag is set', cdk.App, (app) => { - // GIVEN - const stack = new cdk.Stack(app); - stack.node.setContext(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT, true); - - const vpc = new ec2.Vpc(stack, 'VPC'); - const cluster = new ecs.Cluster(stack, 'Cluster', { vpc }); - cluster.addAsgCapacityProvider(new AsgCapacityProvider(stack, 'DefaultAutoScalingGroupProvider', { - autoScalingGroup: new AutoScalingGroup(stack, 'DefaultAutoScalingGroup', { - vpc, - instanceType: new ec2.InstanceType('t2.micro'), - machineImage: MachineImage.latestAmazonLinux(), - }), - })); - - // WHEN - new ecsPatterns.NetworkLoadBalancedEc2Service(stack, 'Service', { - cluster, - memoryLimitMiB: 1024, - taskImageOptions: { - image: ecs.ContainerImage.fromRegistry('test'), - }, - }); - - Template.fromStack(stack).hasResourceProperties('AWS::ECS::Service', { - DesiredCount: Match.absent(), - }); -}); - -testLegacyBehavior('NetworkLoadBalancedFargateService desiredCount can be undefined when feature flag is set', cdk.App, (app) => { - // GIVEN - const stack = new cdk.Stack(app); - stack.node.setContext(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT, true); - - const vpc = new ec2.Vpc(stack, 'VPC'); - const cluster = new ecs.Cluster(stack, 'Cluster', { vpc }); - - // WHEN - new ecsPatterns.NetworkLoadBalancedFargateService(stack, 'Service', { - cluster, - taskImageOptions: { - image: ecs.ContainerImage.fromRegistry('test'), - }, - }); - - Template.fromStack(stack).hasResourceProperties('AWS::ECS::Service', { - DesiredCount: Match.absent(), - }); -}); - test('setting vpc and cluster throws error', () => { // GIVEN const stack = new cdk.Stack(); diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/queue-processing-ecs-service.test.ts b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/queue-processing-ecs-service.test.ts index 4a9089ccb8c6c..b666e4a277957 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/queue-processing-ecs-service.test.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/queue-processing-ecs-service.test.ts @@ -7,9 +7,8 @@ import { AsgCapacityProvider } from '@aws-cdk/aws-ecs'; import * as ecs from '@aws-cdk/aws-ecs'; import * as sqs from '@aws-cdk/aws-sqs'; import { Queue } from '@aws-cdk/aws-sqs'; -import { testDeprecated, testLegacyBehavior } from '@aws-cdk/cdk-build-tools'; +import { testDeprecated } from '@aws-cdk/cdk-build-tools'; import * as cdk from '@aws-cdk/core'; -import * as cxapi from '@aws-cdk/cx-api'; import * as ecsPatterns from '../../lib'; test('test ECS queue worker service construct - with only required props', () => { @@ -88,35 +87,6 @@ test('test ECS queue worker service construct - with only required props', () => }); }); -testLegacyBehavior('test ECS queue worker service construct - with remove default desiredCount feature flag', cdk.App, (app) => { - // GIVEN - const stack = new cdk.Stack(app); - stack.node.setContext(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT, true); - - const vpc = new ec2.Vpc(stack, 'VPC'); - const cluster = new ecs.Cluster(stack, 'Cluster', { vpc }); - cluster.addAsgCapacityProvider(new AsgCapacityProvider(stack, 'DefaultAutoScalingGroupProvider', { - autoScalingGroup: new AutoScalingGroup(stack, 'DefaultAutoScalingGroup', { - vpc, - instanceType: new ec2.InstanceType('t2.micro'), - machineImage: MachineImage.latestAmazonLinux(), - }), - })); - - // WHEN - new ecsPatterns.QueueProcessingEc2Service(stack, 'Service', { - cluster, - memoryLimitMiB: 512, - image: ecs.ContainerImage.fromRegistry('test'), - }); - - // THEN - QueueWorker is of EC2 launch type, and desiredCount is not defined on the Ec2Service. - Template.fromStack(stack).hasResourceProperties('AWS::ECS::Service', { - DesiredCount: Match.absent(), - LaunchType: 'EC2', - }); -}); - test('test ECS queue worker service construct - with optional props for queues', () => { // GIVEN const stack = new cdk.Stack(); @@ -383,35 +353,6 @@ testDeprecated('test ECS queue worker service construct - with optional props', }); }); -testLegacyBehavior('can set desiredTaskCount to 0', cdk.App, (app) => { - // GIVEN - const stack = new cdk.Stack(app); - const vpc = new ec2.Vpc(stack, 'VPC'); - const cluster = new ecs.Cluster(stack, 'Cluster', { vpc }); - cluster.addAsgCapacityProvider(new AsgCapacityProvider(stack, 'DefaultAutoScalingGroupProvider', { - autoScalingGroup: new AutoScalingGroup(stack, 'DefaultAutoScalingGroup', { - vpc, - instanceType: new ec2.InstanceType('t2.micro'), - machineImage: MachineImage.latestAmazonLinux(), - }), - })); - - // WHEN - new ecsPatterns.QueueProcessingEc2Service(stack, 'Service', { - cluster, - desiredTaskCount: 0, - maxScalingCapacity: 2, - memoryLimitMiB: 512, - image: ecs.ContainerImage.fromRegistry('test'), - }); - - // THEN - QueueWorker is of EC2 launch type, an SQS queue is created and all default properties are set. - Template.fromStack(stack).hasResourceProperties('AWS::ECS::Service', { - DesiredCount: 0, - LaunchType: 'EC2', - }); -}); - testDeprecated('throws if desiredTaskCount and maxScalingCapacity are 0', () => { // GIVEN const stack = new cdk.Stack(); diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/queue-processing-fargate-service.test.ts b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/queue-processing-fargate-service.test.ts index baabcb914289e..8cbb1d579d5b0 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/queue-processing-fargate-service.test.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/queue-processing-fargate-service.test.ts @@ -6,13 +6,10 @@ import * as ecs from '@aws-cdk/aws-ecs'; import { AsgCapacityProvider } from '@aws-cdk/aws-ecs'; import * as sqs from '@aws-cdk/aws-sqs'; import { Queue } from '@aws-cdk/aws-sqs'; -import { testDeprecated, testFutureBehavior } from '@aws-cdk/cdk-build-tools'; +import { testDeprecated } from '@aws-cdk/cdk-build-tools'; import * as cdk from '@aws-cdk/core'; -import * as cxapi from '@aws-cdk/cx-api'; import * as ecsPatterns from '../../lib'; -const flags = { [cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT]: true }; - test('test fargate queue worker service construct - with only required props', () => { // GIVEN const stack = new cdk.Stack(); @@ -111,9 +108,9 @@ test('test fargate queue worker service construct - with only required props', ( }); }); -testFutureBehavior('test fargate queue worker service construct - with remove default desiredCount feature flag', flags, cdk.App, (app) => { +test('test fargate queue worker service construct - with remove default desiredCount feature flag', () => { // GIVEN - const stack = new cdk.Stack(app); + const stack = new cdk.Stack(); const vpc = new ec2.Vpc(stack, 'VPC'); const cluster = new ecs.Cluster(stack, 'Cluster', { vpc }); 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 76c0a7e34f6e0..526d40fbafba7 100644 --- a/packages/@aws-cdk/aws-ecs/test/container-definition.test.ts +++ b/packages/@aws-cdk/aws-ecs/test/container-definition.test.ts @@ -1,10 +1,8 @@ import * as path from 'path'; import { Match, Template } from '@aws-cdk/assertions'; -import * as ecr_assets from '@aws-cdk/aws-ecr-assets'; import * as s3 from '@aws-cdk/aws-s3'; import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; import * as ssm from '@aws-cdk/aws-ssm'; -import { testLegacyBehavior } from '@aws-cdk/cdk-build-tools/lib/feature-flag'; import * as cdk from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; import * as ecs from '../lib'; @@ -33,8 +31,6 @@ describe('container definition', () => { }, ], }); - - }); test('add a container using all props', () => { @@ -236,8 +232,6 @@ describe('container definition', () => { }, ], }); - - }); test('throws when MemoryLimit is less than MemoryReservationLimit', () => { @@ -254,8 +248,6 @@ describe('container definition', () => { memoryReservationMiB: 1024, }); }).toThrow(/MemoryLimitMiB should not be less than MemoryReservationMiB./); - - }); describe('With network mode AwsVpc', () => { @@ -278,8 +270,6 @@ describe('container definition', () => { hostPort: 8081, }); }).toThrow(); - - }); test('Host port is the same as container port', () => { @@ -300,7 +290,6 @@ describe('container definition', () => { }); // THEN no exception raised - }); test('Host port can be empty ', () => { @@ -321,7 +310,6 @@ describe('container definition', () => { }); // THEN no exception raised - }); }); @@ -345,8 +333,6 @@ describe('container definition', () => { hostPort: 8081, }); }).toThrow(); - - }); test('when host port is the same as container port', () => { @@ -367,7 +353,6 @@ describe('container definition', () => { }); // THEN no exception raised - }); test('Host port can be empty ', () => { @@ -388,7 +373,6 @@ describe('container definition', () => { }); // THEN no exception raised - }); test('errors when adding links', () => { @@ -412,8 +396,6 @@ describe('container definition', () => { expect(() => { container.addLink(logger); }).toThrow(); - - }); }); @@ -435,7 +417,6 @@ describe('container definition', () => { }); // THEN no exception raises - }); test('when Host port is not empty ', () => { @@ -456,7 +437,6 @@ describe('container definition', () => { }); // THEN no exception raises - }); test('allows adding links', () => { @@ -478,8 +458,6 @@ describe('container definition', () => { // THEN container.addLink(logger); - - }); }); @@ -528,7 +506,6 @@ describe('container definition', () => { // THEN const expected = 8080; expect(actual).toEqual(expected); - }); test('throws when calling containerPort with no PortMappings', () => { @@ -549,8 +526,6 @@ describe('container definition', () => { const expected = 8080; expect(actual).toEqual(expected); }).toThrow(/Container MyContainer hasn't defined any ports. Call addPortMappings\(\)./); - - }); }); @@ -577,7 +552,6 @@ describe('container definition', () => { // THEN const expected = 8080; expect(actual).toEqual(expected); - }); test('throws when calling ingressPort with no PortMappings', () => { @@ -598,8 +572,6 @@ describe('container definition', () => { const expected = 8080; expect(actual).toEqual(expected); }).toThrow(/Container MyContainer hasn't defined any ports. Call addPortMappings\(\)./); - - }); }); @@ -625,7 +597,6 @@ describe('container definition', () => { // THEN const expected = 8080; expect(actual).toEqual( expected); - }); }); @@ -652,7 +623,6 @@ describe('container definition', () => { // THEN const expected = 8081; expect(actual).toEqual( expected); - }); test('Ingress port should be 0 if not supplied', () => { @@ -676,7 +646,6 @@ describe('container definition', () => { // THEN const expected = 0; expect(actual).toEqual(expected); - }); }); }); @@ -888,8 +857,8 @@ describe('container definition', () => { }), ], }); - }); + test('can add s3 bucket environment file to the container definition', () => { // GIVEN const stack = new cdk.Stack(); @@ -1612,8 +1581,6 @@ describe('container definition', () => { ], }); }).toThrow(/At least one argument must be supplied for health check command./); - - }); test('can specify Health Check values in shell form', () => { @@ -1795,8 +1762,6 @@ describe('container definition', () => { // THEN expect(taskDefinition.defaultContainer).toEqual( undefined); - - }); }); @@ -2014,125 +1979,4 @@ describe('container definition', () => { }); }); }); - - class MyApp extends cdk.App { - constructor() { - super({ - context: { - [cxapi.DOCKER_IGNORE_SUPPORT]: true, - }, - }); - } - } - - testLegacyBehavior('can use a DockerImageAsset directly for a container image', MyApp, (app) => { - // GIVEN - const stack = new cdk.Stack(app, 'Stack'); - const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); - const asset = new ecr_assets.DockerImageAsset(stack, 'MyDockerImage', { - directory: path.join(__dirname, 'demo-image'), - }); - - // WHEN - taskDefinition.addContainer('default', { - image: ecs.ContainerImage.fromDockerImageAsset(asset), - memoryLimitMiB: 1024, - }); - - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::ECS::TaskDefinition', { - ContainerDefinitions: [ - { - Essential: true, - Image: { - 'Fn::Join': [ - '', - [ - { Ref: 'AWS::AccountId' }, - '.dkr.ecr.', - { Ref: 'AWS::Region' }, - '.', - { Ref: 'AWS::URLSuffix' }, - '/aws-cdk/assets:0a3355be12051c9984bf2b0b2bba4e6ea535968e5b6e7396449701732fe5ed14', - ], - ], - }, - Memory: 1024, - Name: 'default', - }, - ], - }); - Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { - PolicyDocument: { - Statement: [ - { - Action: [ - 'ecr:BatchCheckLayerAvailability', - 'ecr:GetDownloadUrlForLayer', - 'ecr:BatchGetImage', - ], - Effect: 'Allow', - Resource: { - 'Fn::Join': [ - '', - ['arn:', { Ref: 'AWS::Partition' }, ':ecr:', { Ref: 'AWS::Region' }, ':', { Ref: 'AWS::AccountId' }, ':repository/aws-cdk/assets'], - ], - }, - }, - { - Action: 'ecr:GetAuthorizationToken', - Effect: 'Allow', - Resource: '*', - }, - ], - Version: '2012-10-17', - }, - }); - - }); - - testLegacyBehavior('docker image asset options can be used when using container image', MyApp, (app) => { - // GIVEN - const stack = new cdk.Stack(app, 'MyStack'); - const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef'); - - // WHEN - taskDefinition.addContainer('default', { - memoryLimitMiB: 1024, - image: ecs.ContainerImage.fromAsset(path.join(__dirname, 'demo-image'), { - file: 'index.py', // just because it's there already - target: 'build-target', - }), - }); - - // THEN - const asm = app.synth(); - expect(asm.getStackArtifact(stack.artifactId).assets[0]).toEqual({ - repositoryName: 'aws-cdk/assets', - imageTag: '8b0801d3f897d960240bf5bf3d5a3e367e50a17e04101717320bfd52ebc9d64a', - id: '8b0801d3f897d960240bf5bf3d5a3e367e50a17e04101717320bfd52ebc9d64a', - packaging: 'container-image', - path: 'asset.8b0801d3f897d960240bf5bf3d5a3e367e50a17e04101717320bfd52ebc9d64a', - sourceHash: '8b0801d3f897d960240bf5bf3d5a3e367e50a17e04101717320bfd52ebc9d64a', - target: 'build-target', - file: 'index.py', - }); - - }); - - testLegacyBehavior('exposes image name', cdk.App, (app) => { - // GIVEN - const stack = new cdk.Stack(app, 'MyStack'); - const taskDefinition = new ecs.FargateTaskDefinition(stack, 'TaskDef'); - - // WHEN - const container = taskDefinition.addContainer('cont', { - image: ecs.ContainerImage.fromAsset(path.join(__dirname, 'demo-image')), - }); - - // THEN - expect(stack.resolve(container.imageName)).toEqual({ - 'Fn::Sub': '${AWS::AccountId}.dkr.ecr.${AWS::Region}.${AWS::URLSuffix}/cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}:aba53d5f05c76afcd7e420dc8cd283ddc31657866bb4ba4ce221e13d8128d92c', - }); - }); }); diff --git a/packages/@aws-cdk/aws-ecs/test/ec2/ec2-task-definition.test.ts b/packages/@aws-cdk/aws-ecs/test/ec2/ec2-task-definition.test.ts index 295bb44679db2..d5aef3f8464b5 100644 --- a/packages/@aws-cdk/aws-ecs/test/ec2/ec2-task-definition.test.ts +++ b/packages/@aws-cdk/aws-ecs/test/ec2/ec2-task-definition.test.ts @@ -5,7 +5,6 @@ import { Repository } from '@aws-cdk/aws-ecr'; import * as iam from '@aws-cdk/aws-iam'; import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; import * as ssm from '@aws-cdk/aws-ssm'; -import { testLegacyBehavior } from '@aws-cdk/cdk-build-tools/lib/feature-flag'; import * as cdk from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; import * as ecs from '../../lib'; @@ -108,7 +107,6 @@ describe('ec2 task definition', () => { Type: 'memberOf', }, ], - }); }); @@ -709,60 +707,6 @@ describe('ec2 task definition', () => { Annotations.fromStack(stack).hasWarning('/Default/Ec2TaskDef/web', "Proper policies need to be attached before pulling from ECR repository, or use 'fromEcrRepository'."); }); - class MyApp extends cdk.App { - constructor() { - super({ - context: { - [cxapi.DOCKER_IGNORE_SUPPORT]: true, - }, - }); - } - } - - testLegacyBehavior('correctly sets containers from asset using default props', MyApp, (app) => { - // GIVEN - const stack = new cdk.Stack(app, 'Stack'); - - const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef'); - - // WHEN - taskDefinition.addContainer('web', { - image: ecs.ContainerImage.fromAsset(path.join(__dirname, '..', 'demo-image')), - memoryLimitMiB: 512, - }); - - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::ECS::TaskDefinition', { - Family: 'StackEc2TaskDefF03698CF', - ContainerDefinitions: [ - { - Essential: true, - Image: { - 'Fn::Join': [ - '', - [ - { - Ref: 'AWS::AccountId', - }, - '.dkr.ecr.', - { - Ref: 'AWS::Region', - }, - '.', - { - Ref: 'AWS::URLSuffix', - }, - '/aws-cdk/assets:0a3355be12051c9984bf2b0b2bba4e6ea535968e5b6e7396449701732fe5ed14', - ], - ], - }, - Memory: 512, - Name: 'web', - }, - ], - }); - }); - test('correctly sets containers from asset using all props', () => { // GIVEN const stack = new cdk.Stack(); @@ -841,8 +785,7 @@ describe('ec2 task definition', () => { { container: dependency2, condition: ecs.ContainerDependencyCondition.SUCCESS, - }, - ); + }); // THEN Template.fromStack(stack).hasResourceProperties('AWS::ECS::TaskDefinition', { @@ -866,6 +809,7 @@ describe('ec2 task definition', () => { })], }); }); + test('correctly sets links', () => { const stack = new cdk.Stack(); diff --git a/packages/@aws-cdk/aws-efs/test/efs-file-system.test.ts b/packages/@aws-cdk/aws-efs/test/efs-file-system.test.ts index d824089f2ee5a..39e172a479867 100644 --- a/packages/@aws-cdk/aws-efs/test/efs-file-system.test.ts +++ b/packages/@aws-cdk/aws-efs/test/efs-file-system.test.ts @@ -2,9 +2,7 @@ import { Template, Match } from '@aws-cdk/assertions'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; -import { testFutureBehavior, testLegacyBehavior } from '@aws-cdk/cdk-build-tools/lib/feature-flag'; -import { App, RemovalPolicy, Size, Stack, Tags } from '@aws-cdk/core'; -import * as cxapi from '@aws-cdk/cx-api'; +import { RemovalPolicy, Size, Stack, Tags } from '@aws-cdk/core'; import { FileSystem, LifecyclePolicy, PerformanceMode, ThroughputMode, OutOfInfrequentAccessPolicy } from '../lib'; let stack = new Stack(); @@ -15,26 +13,8 @@ beforeEach(() => { vpc = new ec2.Vpc(stack, 'VPC'); }); -testFutureBehavior( - 'when @aws-cdk/aws-efs:defaultEncryptionAtRest is enabled, encryption is enabled by default', - { [cxapi.EFS_DEFAULT_ENCRYPTION_AT_REST]: true }, - App, - (app) => { - const customStack = new Stack(app); - - const customVpc = new ec2.Vpc(customStack, 'VPC'); - new FileSystem(customVpc, 'EfsFileSystem', { - vpc: customVpc, - }); - - Template.fromStack(customStack).hasResourceProperties('AWS::EFS::FileSystem', { - Encrypted: true, - }); - - }); - -testLegacyBehavior('when @aws-cdk/aws-efs:defaultEncryptionAtRest is missing, encryption is disabled by default', App, (app) => { - const customStack = new Stack(app); +test('encryption is enabled by default', () => { + const customStack = new Stack(); const customVpc = new ec2.Vpc(customStack, 'VPC'); new FileSystem(customVpc, 'EfsFileSystem', { @@ -42,9 +22,8 @@ testLegacyBehavior('when @aws-cdk/aws-efs:defaultEncryptionAtRest is missing, en }); Template.fromStack(customStack).hasResourceProperties('AWS::EFS::FileSystem', { - Encrypted: Match.absent(), + Encrypted: true, }); - }); test('default file system is created correctly', () => { diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/load-balancer.test.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/load-balancer.test.ts index 99cee4b587323..61c8dc470545f 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/load-balancer.test.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/load-balancer.test.ts @@ -2,12 +2,9 @@ import { Match, Template } from '@aws-cdk/assertions'; import { Metric } from '@aws-cdk/aws-cloudwatch'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as s3 from '@aws-cdk/aws-s3'; -import { testFutureBehavior, testLegacyBehavior } from '@aws-cdk/cdk-build-tools/lib/feature-flag'; import * as cdk from '@aws-cdk/core'; -import * as cxapi from '@aws-cdk/cx-api'; import * as elbv2 from '../../lib'; -const s3GrantWriteCtx = { [cxapi.S3_GRANT_WRITE_WITHOUT_ACL]: true }; describe('tests', () => { test('Trivial construction: internet facing', () => { @@ -150,7 +147,8 @@ describe('tests', () => { describe('logAccessLogs', () => { - function loggingSetup(app: cdk.App): { stack: cdk.Stack, bucket: s3.Bucket, lb: elbv2.ApplicationLoadBalancer } { + function loggingSetup(): { stack: cdk.Stack, bucket: s3.Bucket, lb: elbv2.ApplicationLoadBalancer } { + const app = new cdk.App(); const stack = new cdk.Stack(app, undefined, { env: { region: 'us-east-1' } }); const vpc = new ec2.Vpc(stack, 'Stack'); const bucket = new s3.Bucket(stack, 'AccessLoggingBucket'); @@ -160,8 +158,7 @@ describe('tests', () => { test('sets load balancer attributes', () => { // GIVEN - const app = new cdk.App(); - const { stack, bucket, lb } = loggingSetup(app); + const { stack, bucket, lb } = loggingSetup(); // WHEN lb.logAccessLogs(bucket); @@ -187,8 +184,7 @@ describe('tests', () => { test('adds a dependency on the bucket', () => { // GIVEN - const app = new cdk.App(); - const { stack, bucket, lb } = loggingSetup(app); + const { stack, bucket, lb } = loggingSetup(); // WHEN lb.logAccessLogs(bucket); @@ -200,53 +196,9 @@ describe('tests', () => { }); }); - testLegacyBehavior('legacy bucket permissions', cdk.App, (app) => { - const { stack, bucket, lb } = loggingSetup(app); - - // WHEN - lb.logAccessLogs(bucket); - - // THEN - // verify the bucket policy allows the ALB to put objects in the bucket - Template.fromStack(stack).hasResourceProperties('AWS::S3::BucketPolicy', { - PolicyDocument: { - Version: '2012-10-17', - Statement: [ - { - Action: ['s3:PutObject*', 's3:Abort*'], - Effect: 'Allow', - Principal: { AWS: { 'Fn::Join': ['', ['arn:', { Ref: 'AWS::Partition' }, ':iam::127311923021:root']] } }, - Resource: { - 'Fn::Join': ['', [{ 'Fn::GetAtt': ['AccessLoggingBucketA6D88F29', 'Arn'] }, '/AWSLogs/', - { Ref: 'AWS::AccountId' }, '/*']], - }, - }, - { - Action: 's3:PutObject', - Effect: 'Allow', - Principal: { Service: 'delivery.logs.amazonaws.com' }, - Resource: { - 'Fn::Join': ['', [{ 'Fn::GetAtt': ['AccessLoggingBucketA6D88F29', 'Arn'] }, '/AWSLogs/', - { Ref: 'AWS::AccountId' }, '/*']], - }, - Condition: { StringEquals: { 's3:x-amz-acl': 'bucket-owner-full-control' } }, - }, - { - Action: 's3:GetBucketAcl', - Effect: 'Allow', - Principal: { Service: 'delivery.logs.amazonaws.com' }, - Resource: { - 'Fn::GetAtt': ['AccessLoggingBucketA6D88F29', 'Arn'], - }, - }, - ], - }, - }); - }); - - testFutureBehavior('logging bucket permissions', s3GrantWriteCtx, cdk.App, (app) => { + test('logging bucket permissions', () => { // GIVEN - const { stack, bucket, lb } = loggingSetup(app); + const { stack, bucket, lb } = loggingSetup(); // WHEN lb.logAccessLogs(bucket); @@ -296,9 +248,9 @@ describe('tests', () => { }); }); - testFutureBehavior('access logging with prefix', s3GrantWriteCtx, cdk.App, (app) => { + test('access logging with prefix', () => { // GIVEN - const { stack, bucket, lb } = loggingSetup(app); + const { stack, bucket, lb } = loggingSetup(); // WHEN lb.logAccessLogs(bucket, 'prefix-of-access-logs'); diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/nlb/load-balancer.test.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/nlb/load-balancer.test.ts index 5b9d4f76ce6cd..8b7008ff281ed 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/nlb/load-balancer.test.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/nlb/load-balancer.test.ts @@ -2,13 +2,9 @@ import { Match, Template } from '@aws-cdk/assertions'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as route53 from '@aws-cdk/aws-route53'; import * as s3 from '@aws-cdk/aws-s3'; -import { testFutureBehavior } from '@aws-cdk/cdk-build-tools/lib/feature-flag'; import * as cdk from '@aws-cdk/core'; -import * as cxapi from '@aws-cdk/cx-api'; import * as elbv2 from '../../lib'; -const s3GrantWriteCtx = { [cxapi.S3_GRANT_WRITE_WITHOUT_ACL]: true }; - describe('tests', () => { test('Trivial construction: internet facing', () => { // GIVEN @@ -97,8 +93,9 @@ describe('tests', () => { }); }); - testFutureBehavior('Access logging', s3GrantWriteCtx, cdk.App, (app) => { + test('Access logging', () => { // GIVEN + const app = new cdk.App(); const stack = new cdk.Stack(app, undefined, { env: { region: 'us-east-1' } }); const vpc = new ec2.Vpc(stack, 'Stack'); const bucket = new s3.Bucket(stack, 'AccessLoggingBucket'); @@ -176,8 +173,9 @@ describe('tests', () => { }); }); - testFutureBehavior('access logging with prefix', s3GrantWriteCtx, cdk.App, (app) => { + test('access logging with prefix', () => { // GIVEN + const app = new cdk.App(); const stack = new cdk.Stack(app, undefined, { env: { region: 'us-east-1' } }); const vpc = new ec2.Vpc(stack, 'Stack'); const bucket = new s3.Bucket(stack, 'AccessLoggingBucket'); diff --git a/packages/@aws-cdk/aws-glue/test/table.test.ts b/packages/@aws-cdk/aws-glue/test/table.test.ts index 79920d73e1a81..152c489dd520c 100644 --- a/packages/@aws-cdk/aws-glue/test/table.test.ts +++ b/packages/@aws-cdk/aws-glue/test/table.test.ts @@ -2,15 +2,11 @@ import { Template, Match } from '@aws-cdk/assertions'; import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; import * as s3 from '@aws-cdk/aws-s3'; -import { testFutureBehavior } from '@aws-cdk/cdk-build-tools/lib/feature-flag'; import * as cdk from '@aws-cdk/core'; -import * as cxapi from '@aws-cdk/cx-api'; import * as glue from '../lib'; import { PartitionIndex } from '../lib'; import { CfnTable } from '../lib/glue.generated'; -const s3GrantWriteCtx = { [cxapi.S3_GRANT_WRITE_WITHOUT_ACL]: true }; - test('unpartitioned JSON table', () => { const app = new cdk.App(); const dbStack = new cdk.Stack(app, 'db'); @@ -1217,8 +1213,8 @@ describe('grants', () => { }); }); - testFutureBehavior('write only', s3GrantWriteCtx, cdk.App, (app) => { - const stack = new cdk.Stack(app); + test('write only', () => { + const stack = new cdk.Stack(); const user = new iam.User(stack, 'User'); const database = new glue.Database(stack, 'Database', { databaseName: 'database', @@ -1323,8 +1319,8 @@ describe('grants', () => { }); }); - testFutureBehavior('read and write', s3GrantWriteCtx, cdk.App, (app) => { - const stack = new cdk.Stack(app); + test('read and write', () => { + const stack = new cdk.Stack(); const user = new iam.User(stack, 'User'); const database = new glue.Database(stack, 'Database', { databaseName: 'database', diff --git a/packages/@aws-cdk/aws-kinesis/test/stream.test.ts b/packages/@aws-cdk/aws-kinesis/test/stream.test.ts index e1fce397cce4c..15d7b3cbfabcc 100644 --- a/packages/@aws-cdk/aws-kinesis/test/stream.test.ts +++ b/packages/@aws-cdk/aws-kinesis/test/stream.test.ts @@ -1,18 +1,12 @@ import { Match, Template } from '@aws-cdk/assertions'; import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; -import { testFutureBehavior, testLegacyBehavior } from '@aws-cdk/cdk-build-tools'; import { App, Duration, Stack, CfnParameter } from '@aws-cdk/core'; -import * as cxapi from '@aws-cdk/cx-api'; import { Stream, StreamEncryption, StreamMode } from '../lib'; -/* eslint-disable quote-props */ - describe('Kinesis data streams', () => { - test('default stream', () => { const stack = new Stack(); - new Stream(stack, 'MyStream'); Template.fromStack(stack).templateMatches({ @@ -67,7 +61,6 @@ describe('Kinesis data streams', () => { test('multiple default streams only have one condition for encryption', () => { const stack = new Stack(); - new Stream(stack, 'MyStream'); new Stream(stack, 'MyOtherStream'); @@ -145,7 +138,6 @@ describe('Kinesis data streams', () => { test('stream from attributes', () => { const stack = new Stack(); - const s = Stream.fromStreamAttributes(stack, 'MyStream', { streamArn: 'arn:aws:kinesis:region:account-id:stream/stream-name', }); @@ -155,7 +147,6 @@ describe('Kinesis data streams', () => { test('uses explicit shard count', () => { const stack = new Stack(); - new Stream(stack, 'MyStream', { shardCount: 2, }); @@ -212,7 +203,6 @@ describe('Kinesis data streams', () => { test('uses explicit retention period', () => { const stack = new Stack(); - new Stream(stack, 'MyStream', { retentionPeriod: Duration.hours(168), }); @@ -351,7 +341,6 @@ describe('Kinesis data streams', () => { test('auto-creates KMS key if encryption type is KMS but no key is provided', () => { const stack = new Stack(); - const stream = new Stream(stack, 'MyStream', { encryption: StreamEncryption.KMS, }); @@ -370,11 +359,9 @@ describe('Kinesis data streams', () => { test('uses explicit KMS key if encryption type is KMS and a key is provided', () => { const stack = new Stack(); - const explicitKey = new kms.Key(stack, 'ExplicitKey', { description: 'Explicit Key', }); - new Stream(stack, 'MyStream', { encryption: StreamEncryption.KMS, encryptionKey: explicitKey, @@ -399,7 +386,6 @@ describe('Kinesis data streams', () => { test('uses explicit provisioned streamMode', () => { const stack = new Stack(); - new Stream(stack, 'MyStream', { streamMode: StreamMode.PROVISIONED, }); @@ -456,7 +442,6 @@ describe('Kinesis data streams', () => { test('uses explicit on-demand streamMode', () => { const stack = new Stack(); - new Stream(stack, 'MyStream', { streamMode: StreamMode.ON_DEMAND, }); @@ -526,7 +511,6 @@ describe('Kinesis data streams', () => { const stream = new Stream(stack, 'MyStream', { encryption: StreamEncryption.KMS, }); - const user = new iam.User(stack, 'MyUser'); stream.grantRead(user); @@ -547,302 +531,11 @@ describe('Kinesis data streams', () => { }); }); - // only applicable to legacy behaviour - // With the '@aws-cdk/aws-kms:defaultKeyPolicies' feature flag, KMS key policy is not updated. - testLegacyBehavior('grantRead creates and attaches a policy with read only access to EncryptionKey', App, (app) => { - const stack = new Stack(app); - const stream = new Stream(stack, 'MyStream', { - encryption: StreamEncryption.KMS, - }); - - const user = new iam.User(stack, 'MyUser'); - stream.grantRead(user); - - Template.fromStack(stack).templateMatches({ - Resources: { - MyStreamKey76F3300E: { - Type: 'AWS::KMS::Key', - Properties: { - KeyPolicy: { - Statement: [ - { - Action: [ - 'kms:Create*', - 'kms:Describe*', - 'kms:Enable*', - 'kms:List*', - 'kms:Put*', - 'kms:Update*', - 'kms:Revoke*', - 'kms:Disable*', - 'kms:Get*', - 'kms:Delete*', - 'kms:ScheduleKeyDeletion', - 'kms:CancelKeyDeletion', - 'kms:GenerateDataKey', - 'kms:TagResource', - 'kms:UntagResource', - ], - Effect: 'Allow', - Principal: { - AWS: { - 'Fn::Join': [ - '', - [ - 'arn:', - { - Ref: 'AWS::Partition', - }, - ':iam::', - { - Ref: 'AWS::AccountId', - }, - ':root', - ], - ], - }, - }, - Resource: '*', - }, - { - Action: 'kms:Decrypt', - Effect: 'Allow', - Principal: { - AWS: { - 'Fn::GetAtt': ['MyUserDC45028B', 'Arn'], - }, - }, - Resource: '*', - }, - ], - Version: '2012-10-17', - }, - Description: 'Created by Default/MyStream', - }, - UpdateReplacePolicy: 'Retain', - DeletionPolicy: 'Retain', - }, - MyStream5C050E93: { - Type: 'AWS::Kinesis::Stream', - Properties: { - ShardCount: 1, - StreamModeDetails: { - StreamMode: StreamMode.PROVISIONED, - }, - RetentionPeriodHours: 24, - StreamEncryption: { - EncryptionType: 'KMS', - KeyId: { - 'Fn::GetAtt': ['MyStreamKey76F3300E', 'Arn'], - }, - }, - }, - }, - MyUserDC45028B: { - Type: 'AWS::IAM::User', - }, - MyUserDefaultPolicy7B897426: { - Type: 'AWS::IAM::Policy', - Properties: { - PolicyDocument: { - Statement: [ - { - Action: [ - 'kinesis:DescribeStreamSummary', - 'kinesis:GetRecords', - 'kinesis:GetShardIterator', - 'kinesis:ListShards', - 'kinesis:SubscribeToShard', - 'kinesis:DescribeStream', - 'kinesis:ListStreams', - ], - Effect: 'Allow', - Resource: { - 'Fn::GetAtt': ['MyStream5C050E93', 'Arn'], - }, - }, - { - Action: 'kms:Decrypt', - Effect: 'Allow', - Resource: { - 'Fn::GetAtt': ['MyStreamKey76F3300E', 'Arn'], - }, - }, - ], - Version: '2012-10-17', - }, - PolicyName: 'MyUserDefaultPolicy7B897426', - Users: [ - { - Ref: 'MyUserDC45028B', - }, - ], - }, - }, - }, - }); - }), - - test('grantWrite creates and attaches a policy with write only access to the principal', () => { - const stack = new Stack(); - const stream = new Stream(stack, 'MyStream', { - encryption: StreamEncryption.KMS, - }); - - const user = new iam.User(stack, 'MyUser'); - stream.grantWrite(user); - - Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { - PolicyDocument: { - Statement: Match.arrayWith([{ - Action: ['kms:Encrypt', 'kms:ReEncrypt*', 'kms:GenerateDataKey*'], - Effect: 'Allow', - Resource: stack.resolve(stream.encryptionKey?.keyArn), - }]), - }, - }); - - Template.fromStack(stack).hasResourceProperties('AWS::Kinesis::Stream', { - StreamEncryption: { - KeyId: stack.resolve(stream.encryptionKey?.keyArn), - }, - }); - }); - - // only applicable to legacy behaviour - // With the '@aws-cdk/aws-kms:defaultKeyPolicies' feature flag, KMS key policy is not updated. - testLegacyBehavior('grantWrite creates and attaches a policy with write only access to EncryptionKey', App, (app) => { - const stack = new Stack(app); - const stream = new Stream(stack, 'MyStream', { - encryption: StreamEncryption.KMS, - }); - - const user = new iam.User(stack, 'MyUser'); - stream.grantWrite(user); - - Template.fromStack(stack).templateMatches({ - Resources: { - MyStreamKey76F3300E: { - Type: 'AWS::KMS::Key', - Properties: { - KeyPolicy: { - Statement: [ - { - Action: [ - 'kms:Create*', - 'kms:Describe*', - 'kms:Enable*', - 'kms:List*', - 'kms:Put*', - 'kms:Update*', - 'kms:Revoke*', - 'kms:Disable*', - 'kms:Get*', - 'kms:Delete*', - 'kms:ScheduleKeyDeletion', - 'kms:CancelKeyDeletion', - 'kms:GenerateDataKey', - 'kms:TagResource', - 'kms:UntagResource', - ], - Effect: 'Allow', - Principal: { - AWS: { - 'Fn::Join': [ - '', - [ - 'arn:', - { - Ref: 'AWS::Partition', - }, - ':iam::', - { - Ref: 'AWS::AccountId', - }, - ':root', - ], - ], - }, - }, - Resource: '*', - }, - { - Action: ['kms:Encrypt', 'kms:ReEncrypt*', 'kms:GenerateDataKey*'], - Effect: 'Allow', - Principal: { - AWS: { - 'Fn::GetAtt': ['MyUserDC45028B', 'Arn'], - }, - }, - Resource: '*', - }, - ], - Version: '2012-10-17', - }, - Description: 'Created by Default/MyStream', - }, - UpdateReplacePolicy: 'Retain', - DeletionPolicy: 'Retain', - }, - MyStream5C050E93: { - Type: 'AWS::Kinesis::Stream', - Properties: { - ShardCount: 1, - StreamModeDetails: { - StreamMode: StreamMode.PROVISIONED, - }, - RetentionPeriodHours: 24, - StreamEncryption: { - EncryptionType: 'KMS', - KeyId: { - 'Fn::GetAtt': ['MyStreamKey76F3300E', 'Arn'], - }, - }, - }, - }, - MyUserDC45028B: { - Type: 'AWS::IAM::User', - }, - MyUserDefaultPolicy7B897426: { - Type: 'AWS::IAM::Policy', - Properties: { - PolicyDocument: { - Statement: [ - { - Action: ['kinesis:ListShards', 'kinesis:PutRecord', 'kinesis:PutRecords'], - Effect: 'Allow', - Resource: { - 'Fn::GetAtt': ['MyStream5C050E93', 'Arn'], - }, - }, - { - Action: ['kms:Encrypt', 'kms:ReEncrypt*', 'kms:GenerateDataKey*'], - Effect: 'Allow', - Resource: { - 'Fn::GetAtt': ['MyStreamKey76F3300E', 'Arn'], - }, - }, - ], - Version: '2012-10-17', - }, - PolicyName: 'MyUserDefaultPolicy7B897426', - Users: [ - { - Ref: 'MyUserDC45028B', - }, - ], - }, - }, - }, - }); - }), - test('grantReadWrite creates and attaches a policy to the principal', () => { const stack = new Stack(); const stream = new Stream(stack, 'MyStream', { encryption: StreamEncryption.KMS, }); - const user = new iam.User(stack, 'MyUser'); stream.grantReadWrite(user); @@ -863,148 +556,9 @@ describe('Kinesis data streams', () => { }); }); - // only applicable to legacy behaviour - // With the '@aws-cdk/aws-kms:defaultKeyPolicies' feature flag, KMS key policy is not updated. - testLegacyBehavior('grantReadWrite creates and attaches a policy with access to EncryptionKey', App, (app) => { - const stack = new Stack(app); - const stream = new Stream(stack, 'MyStream', { - encryption: StreamEncryption.KMS, - }); - - const user = new iam.User(stack, 'MyUser'); - stream.grantReadWrite(user); - - Template.fromStack(stack).templateMatches({ - Resources: { - MyStreamKey76F3300E: { - Type: 'AWS::KMS::Key', - Properties: { - Description: 'Created by Default/MyStream', - KeyPolicy: { - Statement: [ - { - Action: [ - 'kms:Create*', - 'kms:Describe*', - 'kms:Enable*', - 'kms:List*', - 'kms:Put*', - 'kms:Update*', - 'kms:Revoke*', - 'kms:Disable*', - 'kms:Get*', - 'kms:Delete*', - 'kms:ScheduleKeyDeletion', - 'kms:CancelKeyDeletion', - 'kms:GenerateDataKey', - 'kms:TagResource', - 'kms:UntagResource', - ], - Effect: 'Allow', - Principal: { - AWS: { - 'Fn::Join': [ - '', - [ - 'arn:', - { - Ref: 'AWS::Partition', - }, - ':iam::', - { - Ref: 'AWS::AccountId', - }, - ':root', - ], - ], - }, - }, - Resource: '*', - }, - { - Action: ['kms:Decrypt', 'kms:Encrypt', 'kms:ReEncrypt*', 'kms:GenerateDataKey*'], - Effect: 'Allow', - Principal: { - AWS: { - 'Fn::GetAtt': ['MyUserDC45028B', 'Arn'], - }, - }, - Resource: '*', - }, - ], - Version: '2012-10-17', - }, - }, - DeletionPolicy: 'Retain', - UpdateReplacePolicy: 'Retain', - }, - MyStream5C050E93: { - Type: 'AWS::Kinesis::Stream', - Properties: { - ShardCount: 1, - StreamModeDetails: { - StreamMode: StreamMode.PROVISIONED, - }, - RetentionPeriodHours: 24, - StreamEncryption: { - EncryptionType: 'KMS', - KeyId: { - 'Fn::GetAtt': ['MyStreamKey76F3300E', 'Arn'], - }, - }, - }, - }, - MyUserDC45028B: { - Type: 'AWS::IAM::User', - }, - MyUserDefaultPolicy7B897426: { - Type: 'AWS::IAM::Policy', - Properties: { - PolicyDocument: { - Statement: [ - { - Action: [ - 'kinesis:DescribeStreamSummary', - 'kinesis:GetRecords', - 'kinesis:GetShardIterator', - 'kinesis:ListShards', - 'kinesis:SubscribeToShard', - 'kinesis:DescribeStream', - 'kinesis:ListStreams', - 'kinesis:PutRecord', - 'kinesis:PutRecords', - ], - Effect: 'Allow', - Resource: { - 'Fn::GetAtt': ['MyStream5C050E93', 'Arn'], - }, - }, - { - Action: ['kms:Decrypt', 'kms:Encrypt', 'kms:ReEncrypt*', 'kms:GenerateDataKey*'], - Effect: 'Allow', - Resource: { - 'Fn::GetAtt': ['MyStreamKey76F3300E', 'Arn'], - }, - }, - ], - Version: '2012-10-17', - }, - PolicyName: 'MyUserDefaultPolicy7B897426', - Users: [ - { - Ref: 'MyUserDC45028B', - }, - ], - }, - }, - }, - }); - }), - test('grantRead creates and associates a policy with read only access to Stream', () => { const stack = new Stack(); const stream = new Stream(stack, 'MyStream'); - const user = new iam.User(stack, 'MyUser'); stream.grantRead(user); @@ -1095,7 +649,6 @@ describe('Kinesis data streams', () => { test('grantWrite creates and attaches a policy with write only access to Stream', () => { const stack = new Stack(); const stream = new Stream(stack, 'MyStream'); - const user = new iam.User(stack, 'MyUser'); stream.grantWrite(user); @@ -1178,7 +731,6 @@ describe('Kinesis data streams', () => { test('grantReadWrite creates and attaches a policy with write only access to Stream', () => { const stack = new Stack(); const stream = new Stream(stack, 'MyStream'); - const user = new iam.User(stack, 'MyUser'); stream.grantReadWrite(user); @@ -1271,7 +823,6 @@ describe('Kinesis data streams', () => { test('grant creates and attaches a policy to Stream which includes supplied permissions', () => { const stack = new Stack(); const stream = new Stream(stack, 'MyStream'); - const user = new iam.User(stack, 'MyUser'); stream.grant(user, 'kinesis:DescribeStream'); @@ -1420,22 +971,8 @@ describe('Kinesis data streams', () => { }); }), - // legacy behaviour as this is fixed with the feature flag. see subsequent test. - testLegacyBehavior('fails with encryption due to cyclic dependency', App, (app) => { - const stackA = new Stack(app, 'stackA'); - const streamFromStackA = new Stream(stackA, 'MyStream', { - encryption: StreamEncryption.KMS, - }); - - const stackB = new Stack(app, 'stackB'); - const user = new iam.User(stackB, 'UserWhoNeedsAccess'); - streamFromStackA.grantRead(user); - expect(() => { - app.synth(); - }).toThrow(/'stack.' depends on 'stack.'/); - }); - - testFutureBehavior('cross stack permissions - with encryption', { [cxapi.KMS_DEFAULT_KEY_POLICIES]: true }, App, (app) => { + test('cross stack permissions - with encryption', () => { + const app = new App(); const stackA = new Stack(app, 'stackA'); const streamFromStackA = new Stream(stackA, 'MyStream', { encryption: StreamEncryption.KMS, @@ -1460,7 +997,6 @@ describe('Kinesis data streams', () => { test('accepts if retentionPeriodHours is a Token', () => { const stack = new Stack(); - const parameter = new CfnParameter(stack, 'my-retention-period', { type: 'Number', default: 48, @@ -1537,7 +1073,6 @@ describe('Kinesis data streams', () => { test('basic stream-level metrics (StreamName dimension only)', () => { // GIVEN const stack = new Stack(); - const fiveMinutes = { amount: 5, unit: { @@ -1684,7 +1219,6 @@ describe('Kinesis data streams', () => { test('allow to overide metric options', () => { // GIVEN const stack = new Stack(); - const fiveMinutes = { amount: 5, unit: { diff --git a/packages/@aws-cdk/aws-kms/test/key.test.ts b/packages/@aws-cdk/aws-kms/test/key.test.ts index 5c4c2adee490d..33e3361e1bf9a 100644 --- a/packages/@aws-cdk/aws-kms/test/key.test.ts +++ b/packages/@aws-cdk/aws-kms/test/key.test.ts @@ -1,8 +1,7 @@ import { Match, Template } from '@aws-cdk/assertions'; import * as iam from '@aws-cdk/aws-iam'; -import { describeDeprecated, testFutureBehavior, testLegacyBehavior } from '@aws-cdk/cdk-build-tools'; +import { describeDeprecated } from '@aws-cdk/cdk-build-tools'; import * as cdk from '@aws-cdk/core'; -import * as cxapi from '@aws-cdk/cx-api'; import * as kms from '../lib'; const ADMIN_ACTIONS: string[] = [ @@ -22,28 +21,8 @@ const ADMIN_ACTIONS: string[] = [ 'kms:CancelKeyDeletion', ]; -const LEGACY_ADMIN_ACTIONS: string[] = [ - 'kms:Create*', - 'kms:Describe*', - 'kms:Enable*', - 'kms:List*', - 'kms:Put*', - 'kms:Update*', - 'kms:Revoke*', - 'kms:Disable*', - 'kms:Get*', - 'kms:Delete*', - 'kms:ScheduleKeyDeletion', - 'kms:CancelKeyDeletion', - 'kms:GenerateDataKey', - 'kms:TagResource', - 'kms:UntagResource', -]; - -const flags = { [cxapi.KMS_DEFAULT_KEY_POLICIES]: true }; - -testFutureBehavior('default key', flags, cdk.App, (app) => { - const stack = new cdk.Stack(app); +test('default key', () => { + const stack = new cdk.Stack(); new kms.Key(stack, 'MyKey'); Template.fromStack(stack).hasResource('AWS::KMS::Key', { @@ -67,16 +46,16 @@ testFutureBehavior('default key', flags, cdk.App, (app) => { }); }); -testFutureBehavior('default with no retention', flags, cdk.App, (app) => { - const stack = new cdk.Stack(app); +test('default with no retention', () => { + const stack = new cdk.Stack(); new kms.Key(stack, 'MyKey', { removalPolicy: cdk.RemovalPolicy.DESTROY }); Template.fromStack(stack).hasResource('AWS::KMS::Key', { DeletionPolicy: 'Delete', UpdateReplacePolicy: 'Delete' }); }); describe('key policies', () => { - testFutureBehavior('can specify a default key policy', flags, cdk.App, (app) => { - const stack = new cdk.Stack(app); + test('can specify a default key policy', () => { + const stack = new cdk.Stack(); const policy = new iam.PolicyDocument(); const statement = new iam.PolicyStatement({ resources: ['*'], actions: ['kms:Put*'] }); statement.addArnPrincipal('arn:aws:iam::111122223333:root'); @@ -101,8 +80,8 @@ describe('key policies', () => { }); }); - testFutureBehavior('can append to the default key policy', flags, cdk.App, (app) => { - const stack = new cdk.Stack(app); + test('can append to the default key policy', () => { + const stack = new cdk.Stack(); const statement = new iam.PolicyStatement({ resources: ['*'], actions: ['kms:Put*'] }); statement.addArnPrincipal('arn:aws:iam::111122223333:root'); @@ -134,9 +113,9 @@ describe('key policies', () => { }); }); - testFutureBehavior('decrypt', flags, cdk.App, (app) => { + test('decrypt', () => { // GIVEN - const stack = new cdk.Stack(app); + const stack = new cdk.Stack(); const key = new kms.Key(stack, 'Key'); const user = new iam.User(stack, 'User'); @@ -173,9 +152,9 @@ describe('key policies', () => { }); }); - testFutureBehavior('encrypt', flags, cdk.App, (app) => { + test('encrypt', () => { // GIVEN - const stack = new cdk.Stack(app); + const stack = new cdk.Stack(); const key = new kms.Key(stack, 'Key'); const user = new iam.User(stack, 'User'); @@ -212,7 +191,8 @@ describe('key policies', () => { }); }); - testFutureBehavior('grant for a principal in a dependent stack works correctly', flags, cdk.App, (app) => { + test('grant for a principal in a dependent stack works correctly', () => { + const app = new cdk.App(); const principalStack = new cdk.Stack(app, 'PrincipalStack'); const principal = new iam.Role(principalStack, 'Role', { assumedBy: new iam.AnyPrincipal(), @@ -245,7 +225,8 @@ describe('key policies', () => { }); }); - testFutureBehavior('grant for a principal in a different region', flags, cdk.App, (app) => { + test('grant for a principal in a different region', () => { + const app = new cdk.App(); const principalStack = new cdk.Stack(app, 'PrincipalStack', { env: { region: 'testregion1' } }); const principal = new iam.Role(principalStack, 'Role', { assumedBy: new iam.AnyPrincipal(), @@ -292,7 +273,8 @@ describe('key policies', () => { }); }); - testFutureBehavior('grant for a principal in a different account', flags, cdk.App, (app) => { + test('grant for a principal in a different account', () => { + const app = new cdk.App(); const principalStack = new cdk.Stack(app, 'PrincipalStack', { env: { account: '0123456789012' } }); const principal = new iam.Role(principalStack, 'Role', { assumedBy: new iam.AnyPrincipal(), @@ -337,7 +319,8 @@ describe('key policies', () => { }); }); - testFutureBehavior('grant for an immutable role', flags, cdk.App, (app) => { + test('grant for an immutable role', () => { + const app = new cdk.App(); const principalStack = new cdk.Stack(app, 'PrincipalStack', { env: { account: '0123456789012' } }); const principal = new iam.Role(principalStack, 'Role', { assumedBy: new iam.AnyPrincipal(), @@ -372,8 +355,8 @@ describe('key policies', () => { }); }); - testFutureBehavior('additional key admins can be specified (with imported/immutable principal)', flags, cdk.App, (app) => { - const stack = new cdk.Stack(app); + test('additional key admins can be specified (with imported/immutable principal)', () => { + const stack = new cdk.Stack(); const adminRole = iam.Role.fromRoleArn(stack, 'Admin', 'arn:aws:iam::123456789012:role/TrustedAdmin'); new kms.Key(stack, 'MyKey', { admins: [adminRole] }); @@ -402,8 +385,8 @@ describe('key policies', () => { }); }); - testFutureBehavior('additional key admins can be specified (with owned/mutable principal)', flags, cdk.App, (app) => { - const stack = new cdk.Stack(app); + test('additional key admins can be specified (with owned/mutable principal)', () => { + const stack = new cdk.Stack(); const adminRole = new iam.Role(stack, 'AdminRole', { assumedBy: new iam.AccountRootPrincipal(), }); @@ -440,8 +423,8 @@ describe('key policies', () => { }); }); -testFutureBehavior('key with some options', flags, cdk.App, (app) => { - const stack = new cdk.Stack(app); +test('key with some options', () => { + const stack = new cdk.Stack(); const key = new kms.Key(stack, 'MyKey', { enableKeyRotation: true, enabled: false, @@ -473,41 +456,22 @@ testFutureBehavior('key with some options', flags, cdk.App, (app) => { }); }); -testFutureBehavior('setting pendingWindow value to not in allowed range will throw', flags, cdk.App, (app) => { - const stack = new cdk.Stack(app); +test('setting pendingWindow value to not in allowed range will throw', () => { + const stack = new cdk.Stack(); expect(() => new kms.Key(stack, 'MyKey', { enableKeyRotation: true, pendingWindow: cdk.Duration.days(6) })) .toThrow('\'pendingWindow\' value must between 7 and 30 days. Received: 6'); }); describeDeprecated('trustAccountIdentities is deprecated', () => { - testFutureBehavior('setting trustAccountIdentities to false will throw (when the defaultKeyPolicies feature flag is enabled)', flags, cdk.App, (app) => { - const stack = new cdk.Stack(app); + test('setting trustAccountIdentities to false will throw (when the defaultKeyPolicies feature flag is enabled)', () => { + const stack = new cdk.Stack(); expect(() => new kms.Key(stack, 'MyKey', { trustAccountIdentities: false })) .toThrow('`trustAccountIdentities` cannot be false if the @aws-cdk/aws-kms:defaultKeyPolicies feature flag is set'); }); - - testLegacyBehavior('trustAccountIdentities changes key policy to allow IAM control', cdk.App, (app) => { - const stack = new cdk.Stack(app); - new kms.Key(stack, 'MyKey', { trustAccountIdentities: true }); - Template.fromStack(stack).hasResourceProperties('AWS::KMS::Key', { - KeyPolicy: { - Statement: [ - { - Action: 'kms:*', - Effect: 'Allow', - Principal: { - AWS: { 'Fn::Join': ['', ['arn:', { Ref: 'AWS::Partition' }, ':iam::', { Ref: 'AWS::AccountId' }, ':root']] }, - }, - Resource: '*', - }, - ], - }, - }); - }); }); -testFutureBehavior('addAlias creates an alias', flags, cdk.App, (app) => { - const stack = new cdk.Stack(app); +test('addAlias creates an alias', () => { + const stack = new cdk.Stack(); const key = new kms.Key(stack, 'MyKey', { enableKeyRotation: true, enabled: false, @@ -528,8 +492,8 @@ testFutureBehavior('addAlias creates an alias', flags, cdk.App, (app) => { }); }); -testFutureBehavior('can run multiple addAlias', flags, cdk.App, (app) => { - const stack = new cdk.Stack(app); +test('can run multiple addAlias', () => { + const stack = new cdk.Stack(); const key = new kms.Key(stack, 'MyKey', { enableKeyRotation: true, enabled: false, @@ -561,8 +525,8 @@ testFutureBehavior('can run multiple addAlias', flags, cdk.App, (app) => { }); }); -testFutureBehavior('keyId resolves to a Ref', flags, cdk.App, (app) => { - const stack = new cdk.Stack(app); +test('keyId resolves to a Ref', () => { + const stack = new cdk.Stack(); const key = new kms.Key(stack, 'MyKey'); new cdk.CfnOutput(stack, 'Out', { @@ -574,7 +538,8 @@ testFutureBehavior('keyId resolves to a Ref', flags, cdk.App, (app) => { }); }); -testFutureBehavior('fails if key policy has no actions', flags, cdk.App, (app) => { +test('fails if key policy has no actions', () => { + const app = new cdk.App(); const stack = new cdk.Stack(app); const key = new kms.Key(stack, 'MyKey'); @@ -586,7 +551,8 @@ testFutureBehavior('fails if key policy has no actions', flags, cdk.App, (app) = expect(() => app.synth()).toThrow(/A PolicyStatement must specify at least one \'action\' or \'notAction\'/); }); -testFutureBehavior('fails if key policy has no IAM principals', flags, cdk.App, (app) => { +test('fails if key policy has no IAM principals', () => { + const app = new cdk.App(); const stack = new cdk.Stack(app); const key = new kms.Key(stack, 'MyKey'); @@ -599,15 +565,16 @@ testFutureBehavior('fails if key policy has no IAM principals', flags, cdk.App, }); describe('imported keys', () => { - testFutureBehavior('throw an error when providing something that is not a valid key ARN', flags, cdk.App, (app) => { - const stack = new cdk.Stack(app); + test('throw an error when providing something that is not a valid key ARN', () => { + const stack = new cdk.Stack(); expect(() => { kms.Key.fromKeyArn(stack, 'Imported', 'arn:aws:kms:us-east-1:123456789012:key'); }).toThrow(/KMS key ARN must be in the format 'arn:aws:kms:::key\/', got: 'arn:aws:kms:us-east-1:123456789012:key'/); }); - testFutureBehavior('can have aliases added to them', flags, cdk.App, (app) => { + test('can have aliases added to them', () => { + const app = new cdk.App(); const stack2 = new cdk.Stack(app, 'Stack2'); const myKeyImported = kms.Key.fromKeyArn(stack2, 'MyKeyImported', 'arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012'); @@ -949,8 +916,8 @@ describe('fromCfnKey()', () => { describe('addToResourcePolicy allowNoOp and there is no policy', () => { // eslint-disable-next-line jest/expect-expect - testFutureBehavior('succeed if set to true (default)', flags, cdk.App, (app) => { - const stack = new cdk.Stack(app); + test('succeed if set to true (default)', () => { + const stack = new cdk.Stack(); const key = kms.Key.fromKeyArn(stack, 'Imported', 'arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012'); @@ -958,8 +925,8 @@ describe('addToResourcePolicy allowNoOp and there is no policy', () => { }); - testFutureBehavior('fails if set to false', flags, cdk.App, (app) => { - const stack = new cdk.Stack(app); + test('fails if set to false', () => { + const stack = new cdk.Stack(); const key = kms.Key.fromKeyArn(stack, 'Imported', 'arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012'); @@ -970,230 +937,9 @@ describe('addToResourcePolicy allowNoOp and there is no policy', () => { }); }); -describe('when the defaultKeyPolicies feature flag is disabled', () => { - testLegacyBehavior('default key policy', cdk.App, (app) => { - const stack = new cdk.Stack(app); - new kms.Key(stack, 'MyKey'); - - Template.fromStack(stack).hasResource('AWS::KMS::Key', { - Properties: { - KeyPolicy: { - Statement: [ - { - Action: LEGACY_ADMIN_ACTIONS, - Effect: 'Allow', - Principal: { - AWS: { 'Fn::Join': ['', ['arn:', { Ref: 'AWS::Partition' }, ':iam::', { Ref: 'AWS::AccountId' }, ':root']] }, - }, - Resource: '*', - }, - ], - Version: '2012-10-17', - }, - }, - DeletionPolicy: 'Retain', - UpdateReplacePolicy: 'Retain', - }); - }); - - testLegacyBehavior('policy if specified appends to the default key policy', cdk.App, (app) => { - const stack = new cdk.Stack(app); - const key = new kms.Key(stack, 'MyKey'); - const p = new iam.PolicyStatement({ resources: ['*'], actions: ['kms:Encrypt'] }); - p.addArnPrincipal('arn:aws:iam::111122223333:root'); - key.addToResourcePolicy(p); - - Template.fromStack(stack).templateMatches({ - Resources: { - MyKey6AB29FA6: { - Type: 'AWS::KMS::Key', - Properties: { - KeyPolicy: { - Statement: [ - { - Action: LEGACY_ADMIN_ACTIONS, - Effect: 'Allow', - Principal: { - AWS: { 'Fn::Join': ['', ['arn:', { Ref: 'AWS::Partition' }, ':iam::', { Ref: 'AWS::AccountId' }, ':root']] }, - }, - Resource: '*', - }, - { - Action: 'kms:Encrypt', - Effect: 'Allow', - Principal: { - AWS: 'arn:aws:iam::111122223333:root', - }, - Resource: '*', - }, - ], - Version: '2012-10-17', - }, - }, - DeletionPolicy: 'Retain', - UpdateReplacePolicy: 'Retain', - }, - }, - }); - }); - - testLegacyBehavior('additional key admins can be specified (with imported/immutable principal)', cdk.App, (app) => { - const stack = new cdk.Stack(app); - const adminRole = iam.Role.fromRoleArn(stack, 'Admin', 'arn:aws:iam::123456789012:role/TrustedAdmin'); - new kms.Key(stack, 'MyKey', { admins: [adminRole] }); - - Template.fromStack(stack).hasResourceProperties('AWS::KMS::Key', { - KeyPolicy: { - Statement: [ - { - Action: LEGACY_ADMIN_ACTIONS, - Effect: 'Allow', - Principal: { - AWS: { 'Fn::Join': ['', ['arn:', { Ref: 'AWS::Partition' }, ':iam::', { Ref: 'AWS::AccountId' }, ':root']] }, - }, - Resource: '*', - }, - { - Action: ADMIN_ACTIONS, - Effect: 'Allow', - Principal: { - AWS: 'arn:aws:iam::123456789012:role/TrustedAdmin', - }, - Resource: '*', - }, - ], - Version: '2012-10-17', - }, - }); - }); - - testLegacyBehavior('additional key admins can be specified (with owned/mutable principal)', cdk.App, (app) => { - const stack = new cdk.Stack(app); - const adminRole = new iam.Role(stack, 'AdminRole', { - assumedBy: new iam.AccountRootPrincipal(), - }); - new kms.Key(stack, 'MyKey', { admins: [adminRole] }); - - Template.fromStack(stack).hasResourceProperties('AWS::KMS::Key', { - KeyPolicy: { - Statement: [ - { - Action: LEGACY_ADMIN_ACTIONS, - Effect: 'Allow', - Principal: { - AWS: { 'Fn::Join': ['', ['arn:', { Ref: 'AWS::Partition' }, ':iam::', { Ref: 'AWS::AccountId' }, ':root']] }, - }, - Resource: '*', - }, - { - Action: ADMIN_ACTIONS, - Effect: 'Allow', - Principal: { - AWS: { 'Fn::GetAtt': ['AdminRole38563C57', 'Arn'] }, - }, - Resource: '*', - }, - ], - Version: '2012-10-17', - }, - }); - Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { - PolicyDocument: { - Statement: [ - { - Action: ADMIN_ACTIONS, - Effect: 'Allow', - Resource: { 'Fn::GetAtt': ['MyKey6AB29FA6', 'Arn'] }, - }, - ], - Version: '2012-10-17', - }, - }); - }); - - describe('grants', () => { - testLegacyBehavior('grant decrypt on a key', cdk.App, (app) => { - // GIVEN - const stack = new cdk.Stack(app); - const key = new kms.Key(stack, 'Key'); - const user = new iam.User(stack, 'User'); - - // WHEN - key.grantDecrypt(user); - - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::KMS::Key', { - KeyPolicy: { - Statement: [ - // This one is there by default - { - Action: LEGACY_ADMIN_ACTIONS, - Effect: 'Allow', - Principal: { AWS: { 'Fn::Join': ['', ['arn:', { Ref: 'AWS::Partition' }, ':iam::', { Ref: 'AWS::AccountId' }, ':root']] } }, - Resource: '*', - }, - // This is the interesting one - { - Action: 'kms:Decrypt', - Effect: 'Allow', - Principal: { AWS: { 'Fn::GetAtt': ['User00B015A1', 'Arn'] } }, - Resource: '*', - }, - ], - Version: '2012-10-17', - }, - }); - - Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { - PolicyDocument: { - Statement: [ - { - Action: 'kms:Decrypt', - Effect: 'Allow', - Resource: { 'Fn::GetAtt': ['Key961B73FD', 'Arn'] }, - }, - ], - Version: '2012-10-17', - }, - }); - }); - - testLegacyBehavior('grant for a principal in a dependent stack works correctly', cdk.App, (app) => { - const principalStack = new cdk.Stack(app, 'PrincipalStack'); - const principal = new iam.Role(principalStack, 'Role', { - assumedBy: new iam.AnyPrincipal(), - }); - - const keyStack = new cdk.Stack(app, 'KeyStack'); - const key = new kms.Key(keyStack, 'Key'); - - principalStack.addDependency(keyStack); - - key.grantEncrypt(principal); - - Template.fromStack(keyStack).hasResourceProperties('AWS::KMS::Key', { - KeyPolicy: { - Statement: Match.arrayWith([{ - Action: [ - 'kms:Encrypt', - 'kms:ReEncrypt*', - 'kms:GenerateDataKey*', - ], - Effect: 'Allow', - Principal: { - AWS: { 'Fn::Join': ['', ['arn:', { Ref: 'AWS::Partition' }, ':iam::', { Ref: 'AWS::AccountId' }, ':root']] }, - }, - Resource: '*', - }]), - }, - }); - }); - }); -}); - describe('key specs and key usages', () => { - testFutureBehavior('both usage and spec are specified', flags, cdk.App, (app) => { - const stack = new cdk.Stack(app); + test('both usage and spec are specified', () => { + const stack = new cdk.Stack(); new kms.Key(stack, 'Key', { keySpec: kms.KeySpec.ECC_SECG_P256K1, keyUsage: kms.KeyUsage.SIGN_VERIFY }); Template.fromStack(stack).hasResourceProperties('AWS::KMS::Key', { @@ -1202,8 +948,8 @@ describe('key specs and key usages', () => { }); }); - testFutureBehavior('only key usage is specified', flags, cdk.App, (app) => { - const stack = new cdk.Stack(app); + test('only key usage is specified', () => { + const stack = new cdk.Stack(); new kms.Key(stack, 'Key', { keyUsage: kms.KeyUsage.ENCRYPT_DECRYPT }); Template.fromStack(stack).hasResourceProperties('AWS::KMS::Key', { @@ -1211,8 +957,8 @@ describe('key specs and key usages', () => { }); }); - testFutureBehavior('only key spec is specified', flags, cdk.App, (app) => { - const stack = new cdk.Stack(app); + test('only key spec is specified', () => { + const stack = new cdk.Stack(); new kms.Key(stack, 'Key', { keySpec: kms.KeySpec.RSA_4096 }); Template.fromStack(stack).hasResourceProperties('AWS::KMS::Key', { @@ -1220,8 +966,8 @@ describe('key specs and key usages', () => { }); }); - testFutureBehavior('invalid combinations of key specs and key usages', flags, cdk.App, (app) => { - const stack = new cdk.Stack(app); + test('invalid combinations of key specs and key usages', () => { + const stack = new cdk.Stack(); expect(() => new kms.Key(stack, 'Key1', { keySpec: kms.KeySpec.ECC_NIST_P256 })) .toThrow('key spec \'ECC_NIST_P256\' is not valid with usage \'ENCRYPT_DECRYPT\''); @@ -1233,8 +979,8 @@ describe('key specs and key usages', () => { .toThrow('key spec \'SYMMETRIC_DEFAULT\' is not valid with usage \'SIGN_VERIFY\''); }); - testFutureBehavior('fails if key rotation enabled on asymmetric key', flags, cdk.App, (app) => { - const stack = new cdk.Stack(app); + test('fails if key rotation enabled on asymmetric key', () => { + const stack = new cdk.Stack(); expect(() => new kms.Key(stack, 'Key', { enableKeyRotation: true, keySpec: kms.KeySpec.RSA_3072 })) .toThrow('key rotation cannot be enabled on asymmetric keys'); diff --git a/packages/@aws-cdk/aws-lambda/test/code.test.ts b/packages/@aws-cdk/aws-lambda/test/code.test.ts index ed7767e488045..f8ed89d1aceba 100644 --- a/packages/@aws-cdk/aws-lambda/test/code.test.ts +++ b/packages/@aws-cdk/aws-lambda/test/code.test.ts @@ -1,7 +1,6 @@ import * as path from 'path'; import { Match, Template } from '@aws-cdk/assertions'; import * as ecr from '@aws-cdk/aws-ecr'; -import { testLegacyBehavior } from '@aws-cdk/cdk-build-tools'; import * as cdk from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; import * as lambda from '../lib'; @@ -302,35 +301,6 @@ describe('code', () => { }); describe('lambda.Code.fromImageAsset', () => { - testLegacyBehavior('repository uri is correctly identified', cdk.App, (app) => { - // given - const stack = new cdk.Stack(app); - - // when - new lambda.Function(stack, 'Fn', { - code: lambda.Code.fromAssetImage(path.join(__dirname, 'docker-lambda-handler')), - handler: lambda.Handler.FROM_IMAGE, - runtime: lambda.Runtime.FROM_IMAGE, - }); - - // then - Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { - Code: { - ImageUri: { - 'Fn::Join': ['', [ - { Ref: 'AWS::AccountId' }, - '.dkr.ecr.', - { Ref: 'AWS::Region' }, - '.', - { Ref: 'AWS::URLSuffix' }, - '/aws-cdk/assets:768d7b6c1d41b85135f498fe0cca69fea410be3c3322c69cf08690aaad29a610', - ]], - }, - }, - ImageConfig: Match.absent(), - }); - }); - test('props are correctly resolved', () => { // given const stack = new cdk.Stack(); diff --git a/packages/@aws-cdk/aws-rds/test/cluster.test.ts b/packages/@aws-cdk/aws-rds/test/cluster.test.ts index 863798c87ae65..35bd5af905f5c 100644 --- a/packages/@aws-cdk/aws-rds/test/cluster.test.ts +++ b/packages/@aws-cdk/aws-rds/test/cluster.test.ts @@ -4,9 +4,7 @@ import { ManagedPolicy, Role, ServicePrincipal } from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; import * as logs from '@aws-cdk/aws-logs'; import * as s3 from '@aws-cdk/aws-s3'; -import { testFutureBehavior } from '@aws-cdk/cdk-build-tools'; import * as cdk from '@aws-cdk/core'; -import * as cxapi from '@aws-cdk/cx-api'; import { AuroraEngineVersion, AuroraMysqlEngineVersion, AuroraPostgresEngineVersion, CfnDBCluster, Credentials, DatabaseCluster, DatabaseClusterEngine, DatabaseClusterFromSnapshot, ParameterGroup, PerformanceInsightRetention, SubnetGroup, DatabaseSecret, @@ -734,7 +732,7 @@ describe('cluster', () => { const vpc = new ec2.Vpc(stack, 'VPC'); const cluster = new DatabaseCluster(stack, 'Database', { - engine: DatabaseClusterEngine.auroraMysql({ version: AuroraMysqlEngineVersion.VER_5_7_12 }), + engine: DatabaseClusterEngine.auroraMysql({ version: AuroraMysqlEngineVersion.VER_3_02_0 }), credentials: { username: 'admin', password: cdk.SecretValue.unsafePlainText('tooshort'), @@ -1424,9 +1422,9 @@ describe('cluster', () => { }); }); - testFutureBehavior('create a cluster with s3 export buckets', { [cxapi.S3_GRANT_WRITE_WITHOUT_ACL]: true }, cdk.App, (app) => { + test('create a cluster with s3 export buckets', () => { // GIVEN - const stack = testStack(app); + const stack = testStack(); const vpc = new ec2.Vpc(stack, 'VPC'); const bucket = new s3.Bucket(stack, 'Bucket'); @@ -2484,12 +2482,9 @@ describe('cluster', () => { }); }); - test('changes the case of the cluster identifier if the lowercaseDbIdentifier feature flag is enabled', () => { + test('changes the case of the cluster identifier', () => { // GIVEN - const app = new cdk.App({ - context: { [cxapi.RDS_LOWERCASE_DB_IDENTIFIER]: true }, - }); - const stack = testStack(app); + const stack = testStack(); const vpc = new ec2.Vpc(stack, 'VPC'); // WHEN diff --git a/packages/@aws-cdk/aws-rds/test/instance.test.ts b/packages/@aws-cdk/aws-rds/test/instance.test.ts index 1b5efc9961f4c..a6d61e829884a 100644 --- a/packages/@aws-cdk/aws-rds/test/instance.test.ts +++ b/packages/@aws-cdk/aws-rds/test/instance.test.ts @@ -6,9 +6,7 @@ import * as kms from '@aws-cdk/aws-kms'; import * as lambda from '@aws-cdk/aws-lambda'; import * as logs from '@aws-cdk/aws-logs'; import * as s3 from '@aws-cdk/aws-s3'; -import { testFutureBehavior } from '@aws-cdk/cdk-build-tools'; import * as cdk from '@aws-cdk/core'; -import * as cxapi from '@aws-cdk/cx-api'; import * as rds from '../lib'; let stack: cdk.Stack; @@ -1276,8 +1274,8 @@ describe('instance', () => { }); describe('S3 Import/Export', () => { - testFutureBehavior('instance with s3 import and export buckets', { [cxapi.S3_GRANT_WRITE_WITHOUT_ACL]: true }, cdk.App, (app) => { - stack = new cdk.Stack(app); + test('instance with s3 import and export buckets', () => { + stack = new cdk.Stack(); vpc = new ec2.Vpc(stack, 'VPC'); new rds.DatabaseInstance(stack, 'DB', { engine: rds.DatabaseInstanceEngine.sqlServerSe({ version: rds.SqlServerEngineVersion.VER_14_00_3192_2_V1 }), @@ -1529,11 +1527,9 @@ describe('instance', () => { }); }); - test('changes the case of the cluster identifier if the lowercaseDbIdentifier feature flag is enabled', () => { + test('changes the case of the cluster identifier', () => { // GIVEN - const app = new cdk.App({ - context: { [cxapi.RDS_LOWERCASE_DB_IDENTIFIER]: true }, - }); + const app = new cdk.App(); stack = new cdk.Stack( app ); vpc = new ec2.Vpc( stack, 'VPC' ); diff --git a/packages/@aws-cdk/aws-s3-deployment/test/bucket-deployment.test.ts b/packages/@aws-cdk/aws-s3-deployment/test/bucket-deployment.test.ts index c2b3873dd35e7..4c2bcc57d3f7d 100644 --- a/packages/@aws-cdk/aws-s3-deployment/test/bucket-deployment.test.ts +++ b/packages/@aws-cdk/aws-s3-deployment/test/bucket-deployment.test.ts @@ -6,15 +6,13 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import * as logs from '@aws-cdk/aws-logs'; import * as s3 from '@aws-cdk/aws-s3'; -import { testDeprecated, testFutureBehavior } from '@aws-cdk/cdk-build-tools'; +import { testDeprecated } from '@aws-cdk/cdk-build-tools'; import * as cdk from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; import * as s3deploy from '../lib'; /* eslint-disable max-len */ -const s3GrantWriteCtx = { [cxapi.S3_GRANT_WRITE_WITHOUT_ACL]: true }; - test('deploy from local directory asset', () => { // GIVEN const app = new cdk.App({ context: { [cxapi.NEW_STYLE_STACK_SYNTHESIS_CONTEXT]: false } }); @@ -616,9 +614,9 @@ test('fails if distribution paths don\'t start with "/"', () => { })).toThrow(/Distribution paths must start with "\/"/); }); -testFutureBehavior('lambda execution role gets permissions to read from the source bucket and read/write in destination', s3GrantWriteCtx, cdk.App, (app) => { +test('lambda execution role gets permissions to read from the source bucket and read/write in destination', () => { // GIVEN - const stack = new cdk.Stack(app); + const stack = new cdk.Stack(); const source = new s3.Bucket(stack, 'Source'); const bucket = new s3.Bucket(stack, 'Dest'); @@ -711,9 +709,9 @@ testFutureBehavior('lambda execution role gets permissions to read from the sour }); }); -testFutureBehavior('lambda execution role gets putObjectAcl permission when deploying with accessControl', s3GrantWriteCtx, cdk.App, (app) => { +test('lambda execution role gets putObjectAcl permission when deploying with accessControl', () => { // GIVEN - const stack = new cdk.Stack(app); + const stack = new cdk.Stack(); const source = new s3.Bucket(stack, 'Source'); const bucket = new s3.Bucket(stack, 'Dest'); diff --git a/packages/@aws-cdk/aws-s3/test/bucket.test.ts b/packages/@aws-cdk/aws-s3/test/bucket.test.ts index 482ed6614d28d..5396f6504d585 100644 --- a/packages/@aws-cdk/aws-s3/test/bucket.test.ts +++ b/packages/@aws-cdk/aws-s3/test/bucket.test.ts @@ -2,16 +2,12 @@ import { EOL } from 'os'; import { Match, Template } from '@aws-cdk/assertions'; import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; -import { testFutureBehavior, testLegacyBehavior } from '@aws-cdk/cdk-build-tools/lib/feature-flag'; import * as cdk from '@aws-cdk/core'; -import * as cxapi from '@aws-cdk/cx-api'; import * as s3 from '../lib'; // to make it easy to copy & paste from output: /* eslint-disable quote-props */ -const s3GrantWriteCtx = { [cxapi.S3_GRANT_WRITE_WITHOUT_ACL]: true }; - describe('bucket', () => { test('default bucket', () => { const stack = new cdk.Stack(); @@ -949,8 +945,8 @@ describe('bucket', () => { }); describe('grantReadWrite', () => { - testFutureBehavior('can be used to grant reciprocal permissions to an identity', s3GrantWriteCtx, cdk.App, (app) => { - const stack = new cdk.Stack(app); + test('can be used to grant reciprocal permissions to an identity', () => { + const stack = new cdk.Stack(); const bucket = new s3.Bucket(stack, 'MyBucket'); const user = new iam.User(stack, 'MyUser'); bucket.grantReadWrite(user); @@ -1066,181 +1062,8 @@ describe('bucket', () => { }); }); - testLegacyBehavior('if an encryption key is included, encrypt/decrypt permissions are also added both ways', cdk.App, (app) => { - const stack = new cdk.Stack(app); - const bucket = new s3.Bucket(stack, 'MyBucket', { encryption: s3.BucketEncryption.KMS }); - const user = new iam.User(stack, 'MyUser'); - bucket.grantReadWrite(user); - - Template.fromStack(stack).templateMatches({ - 'Resources': { - 'MyBucketKeyC17130CF': { - 'Type': 'AWS::KMS::Key', - 'Properties': { - 'Description': 'Created by Default/MyBucket', - 'KeyPolicy': { - 'Statement': [ - { - 'Action': [ - 'kms:Create*', - 'kms:Describe*', - 'kms:Enable*', - 'kms:List*', - 'kms:Put*', - 'kms:Update*', - 'kms:Revoke*', - 'kms:Disable*', - 'kms:Get*', - 'kms:Delete*', - 'kms:ScheduleKeyDeletion', - 'kms:CancelKeyDeletion', - 'kms:GenerateDataKey', - 'kms:TagResource', - 'kms:UntagResource', - ], - 'Effect': 'Allow', - 'Principal': { - 'AWS': { - 'Fn::Join': [ - '', - [ - 'arn:', - { - 'Ref': 'AWS::Partition', - }, - ':iam::', - { - 'Ref': 'AWS::AccountId', - }, - ':root', - ], - ], - }, - }, - 'Resource': '*', - }, - { - 'Action': [ - 'kms:Decrypt', - 'kms:DescribeKey', - 'kms:Encrypt', - 'kms:ReEncrypt*', - 'kms:GenerateDataKey*', - ], - 'Effect': 'Allow', - 'Principal': { - 'AWS': { - 'Fn::GetAtt': [ - 'MyUserDC45028B', - 'Arn', - ], - }, - }, - 'Resource': '*', - }, - ], - 'Version': '2012-10-17', - }, - }, - 'DeletionPolicy': 'Retain', - 'UpdateReplacePolicy': 'Retain', - }, - 'MyBucketF68F3FF0': { - 'Type': 'AWS::S3::Bucket', - 'DeletionPolicy': 'Retain', - 'UpdateReplacePolicy': 'Retain', - 'Properties': { - 'BucketEncryption': { - 'ServerSideEncryptionConfiguration': [ - { - 'ServerSideEncryptionByDefault': { - 'KMSMasterKeyID': { - 'Fn::GetAtt': [ - 'MyBucketKeyC17130CF', - 'Arn', - ], - }, - 'SSEAlgorithm': 'aws:kms', - }, - }, - ], - }, - }, - }, - 'MyUserDC45028B': { - 'Type': 'AWS::IAM::User', - }, - 'MyUserDefaultPolicy7B897426': { - 'Type': 'AWS::IAM::Policy', - 'Properties': { - 'PolicyDocument': { - 'Statement': [ - { - 'Action': [ - 's3:GetObject*', - 's3:GetBucket*', - 's3:List*', - 's3:DeleteObject*', - 's3:PutObject*', - 's3:Abort*', - ], - 'Effect': 'Allow', - 'Resource': [ - { - 'Fn::GetAtt': [ - 'MyBucketF68F3FF0', - 'Arn', - ], - }, - { - 'Fn::Join': [ - '', - [ - { - 'Fn::GetAtt': [ - 'MyBucketF68F3FF0', - 'Arn', - ], - }, - '/*', - ], - ], - }, - ], - }, - { - 'Action': [ - 'kms:Decrypt', - 'kms:DescribeKey', - 'kms:Encrypt', - 'kms:ReEncrypt*', - 'kms:GenerateDataKey*', - ], - 'Effect': 'Allow', - 'Resource': { - 'Fn::GetAtt': [ - 'MyBucketKeyC17130CF', - 'Arn', - ], - }, - }, - ], - 'Version': '2012-10-17', - }, - 'PolicyName': 'MyUserDefaultPolicy7B897426', - 'Users': [ - { - 'Ref': 'MyUserDC45028B', - }, - ], - }, - }, - }, - }); - }); - - testFutureBehavior('does not grant PutObjectAcl when the S3_GRANT_WRITE_WITHOUT_ACL feature is enabled', s3GrantWriteCtx, cdk.App, (app) => { - const stack = new cdk.Stack(app, 'Stack'); + test('does not grant PutObjectAcl when the S3_GRANT_WRITE_WITHOUT_ACL feature is enabled', () => { + const stack = new cdk.Stack(); const bucket = new s3.Bucket(stack, 'MyBucket'); const user = new iam.User(stack, 'MyUser'); @@ -1280,8 +1103,8 @@ describe('bucket', () => { }); describe('grantWrite', () => { - testFutureBehavior('with KMS key has appropriate permissions for multipart uploads', s3GrantWriteCtx, cdk.App, (app) => { - const stack = new cdk.Stack(app); + test('with KMS key has appropriate permissions for multipart uploads', () => { + const stack = new cdk.Stack(); const bucket = new s3.Bucket(stack, 'MyBucket', { encryption: s3.BucketEncryption.KMS }); const user = new iam.User(stack, 'MyUser'); bucket.grantWrite(user); @@ -1350,8 +1173,8 @@ describe('bucket', () => { }); }); - testFutureBehavior('does not grant PutObjectAcl when the S3_GRANT_WRITE_WITHOUT_ACL feature is enabled', s3GrantWriteCtx, cdk.App, (app) => { - const stack = new cdk.Stack(app, 'Stack'); + test('does not grant PutObjectAcl when the S3_GRANT_WRITE_WITHOUT_ACL feature is enabled', () => { + const stack = new cdk.Stack(); const bucket = new s3.Bucket(stack, 'MyBucket'); const user = new iam.User(stack, 'MyUser'); @@ -1388,8 +1211,8 @@ describe('bucket', () => { }); describe('grantPut', () => { - testFutureBehavior('does not grant PutObjectAcl when the S3_GRANT_WRITE_WITHOUT_ACL feature is enabled', s3GrantWriteCtx, cdk.App, (app) => { - const stack = new cdk.Stack(app, 'Stack'); + test('does not grant PutObjectAcl when the S3_GRANT_WRITE_WITHOUT_ACL feature is enabled', () => { + const stack = new cdk.Stack(); const bucket = new s3.Bucket(stack, 'MyBucket'); const user = new iam.User(stack, 'MyUser'); @@ -1421,8 +1244,8 @@ describe('bucket', () => { }); }); - testFutureBehavior('more grants', s3GrantWriteCtx, cdk.App, (app) => { - const stack = new cdk.Stack(app); + test('more grants', () => { + const stack = new cdk.Stack(); const bucket = new s3.Bucket(stack, 'MyBucket', { encryption: s3.BucketEncryption.KMS }); const putter = new iam.User(stack, 'Putter'); const writer = new iam.User(stack, 'Writer'); diff --git a/packages/@aws-cdk/aws-secretsmanager/test/secret.test.ts b/packages/@aws-cdk/aws-secretsmanager/test/secret.test.ts index af98a771f7ff6..8380d14abc10d 100644 --- a/packages/@aws-cdk/aws-secretsmanager/test/secret.test.ts +++ b/packages/@aws-cdk/aws-secretsmanager/test/secret.test.ts @@ -2,7 +2,7 @@ import { Match, Template } from '@aws-cdk/assertions'; import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; import * as lambda from '@aws-cdk/aws-lambda'; -import { testDeprecated, testFutureBehavior, testLegacyBehavior } from '@aws-cdk/cdk-build-tools'; +import { testDeprecated } from '@aws-cdk/cdk-build-tools'; import * as cdk from '@aws-cdk/core'; import * as secretsmanager from '../lib'; @@ -649,123 +649,91 @@ test('secretValue', () => { }); describe('secretName', () => { - describe('without @aws-cdk/aws-secretsmanager:parseOwnedSecretName set', () => { - function assertSecretParsing(secret: secretsmanager.Secret) { - new cdk.CfnOutput(stack, 'MySecretName', { - value: secret.secretName, - }); - - // Creates secret name by parsing ARN. - Template.fromStack(stack).hasOutput('*', { - Value: { 'Fn::Select': [6, { 'Fn::Split': [':', { Ref: 'SecretA720EF05' }] }] }, - }); - } + test('selects the first two parts of the resource name when the name is auto-generated', () => { + stack = new cdk.Stack(); - testLegacyBehavior('when secretName is undefined', cdk.App, (cdkApp) => { - stack = new cdk.Stack(cdkApp); - const secret = new secretsmanager.Secret(stack, 'Secret', { - secretName: undefined, - }); - assertSecretParsing(secret); + const secret = new secretsmanager.Secret(stack, 'Secret'); + new cdk.CfnOutput(stack, 'MySecretName', { + value: secret.secretName, }); - testLegacyBehavior('when secretName is defined', cdk.App, (cdkApp) => { - stack = new cdk.Stack(cdkApp); - const secret = new secretsmanager.Secret(stack, 'Secret', { - secretName: 'mySecret', - }); - assertSecretParsing(secret); + const resourceName = { 'Fn::Select': [6, { 'Fn::Split': [':', { Ref: 'SecretA720EF05' }] }] }; + + Template.fromStack(stack).hasOutput('MySecretName', { + Value: { + 'Fn::Join': ['-', [ + { 'Fn::Select': [0, { 'Fn::Split': ['-', resourceName] }] }, + { 'Fn::Select': [1, { 'Fn::Split': ['-', resourceName] }] }, + ]], + }, }); }); - describe('with @aws-cdk/aws-secretsmanager:parseOwnedSecretName set', () => { - const flags = { '@aws-cdk/aws-secretsmanager:parseOwnedSecretName': 'true' }; - testFutureBehavior('selects the first two parts of the resource name when the name is auto-generated', flags, cdk.App, (cdkApp) => { - stack = new cdk.Stack(cdkApp); + test('is simply the first segment when the provided secret name has no hyphens', () => { + stack = new cdk.Stack(); - const secret = new secretsmanager.Secret(stack, 'Secret'); - new cdk.CfnOutput(stack, 'MySecretName', { - value: secret.secretName, - }); + const secret = new secretsmanager.Secret(stack, 'Secret', { secretName: 'mySecret' }); + new cdk.CfnOutput(stack, 'MySecretName', { + value: secret.secretName, + }); - const resourceName = { 'Fn::Select': [6, { 'Fn::Split': [':', { Ref: 'SecretA720EF05' }] }] }; + const resourceName = { 'Fn::Select': [6, { 'Fn::Split': [':', { Ref: 'SecretA720EF05' }] }] }; - Template.fromStack(stack).hasOutput('MySecretName', { - Value: { - 'Fn::Join': ['-', [ - { 'Fn::Select': [0, { 'Fn::Split': ['-', resourceName] }] }, - { 'Fn::Select': [1, { 'Fn::Split': ['-', resourceName] }] }, - ]], - }, - }); + Template.fromStack(stack).hasOutput('MySecretName', { + Value: { 'Fn::Select': [0, { 'Fn::Split': ['-', resourceName] }] }, }); + }); - testFutureBehavior('is simply the first segment when the provided secret name has no hyphens', flags, cdk.App, (cdkApp) => { - stack = new cdk.Stack(cdkApp); - - const secret = new secretsmanager.Secret(stack, 'Secret', { secretName: 'mySecret' }); - new cdk.CfnOutput(stack, 'MySecretName', { - value: secret.secretName, - }); + function assertSegments(secret: secretsmanager.Secret, segments: number) { + new cdk.CfnOutput(stack, 'MySecretName', { + value: secret.secretName, + }); - const resourceName = { 'Fn::Select': [6, { 'Fn::Split': [':', { Ref: 'SecretA720EF05' }] }] }; + const resourceName = { 'Fn::Select': [6, { 'Fn::Split': [':', { Ref: 'SecretA720EF05' }] }] }; + const secretNameSegments = []; + for (let i = 0; i < segments; i++) { + secretNameSegments.push({ 'Fn::Select': [i, { 'Fn::Split': ['-', resourceName] }] }); + } - Template.fromStack(stack).hasOutput('MySecretName', { - Value: { 'Fn::Select': [0, { 'Fn::Split': ['-', resourceName] }] }, - }); + Template.fromStack(stack).hasOutput('MySecretName', { + Value: { 'Fn::Join': ['-', secretNameSegments] }, }); + } - function assertSegments(secret: secretsmanager.Secret, segments: number) { - new cdk.CfnOutput(stack, 'MySecretName', { - value: secret.secretName, - }); + test('selects the 2 parts of the resource name when the secret name is provided', () => { + stack = new cdk.Stack(); + const secret = new secretsmanager.Secret(stack, 'Secret', { secretName: 'my-secret' }); + assertSegments(secret, 2); + }); - const resourceName = { 'Fn::Select': [6, { 'Fn::Split': [':', { Ref: 'SecretA720EF05' }] }] }; - const secretNameSegments = []; - for (let i = 0; i < segments; i++) { - secretNameSegments.push({ 'Fn::Select': [i, { 'Fn::Split': ['-', resourceName] }] }); - } + test('selects the 3 parts of the resource name when the secret name is provided', () => { + stack = new cdk.Stack(); + const secret = new secretsmanager.Secret(stack, 'Secret', { secretName: 'my-secret-hyphenated' }); + assertSegments(secret, 3); + }); - Template.fromStack(stack).hasOutput('MySecretName', { - Value: { 'Fn::Join': ['-', secretNameSegments] }, - }); - } + test('selects the 4 parts of the resource name when the secret name is provided', () => { + stack = new cdk.Stack(); + const secret = new secretsmanager.Secret(stack, 'Secret', { secretName: 'my-secret-with-hyphens' }); + assertSegments(secret, 4); + }); - testFutureBehavior('selects the 2 parts of the resource name when the secret name is provided', flags, cdk.App, (cdkApp) => { - stack = new cdk.Stack(cdkApp); - const secret = new secretsmanager.Secret(stack, 'Secret', { secretName: 'my-secret' }); - assertSegments(secret, 2); - }); + test('uses existing Tokens as secret names as-is', () => { + stack = new cdk.Stack(); - testFutureBehavior('selects the 3 parts of the resource name when the secret name is provided', flags, cdk.App, (cdkApp) => { - stack = new cdk.Stack(cdkApp); - const secret = new secretsmanager.Secret(stack, 'Secret', { secretName: 'my-secret-hyphenated' }); - assertSegments(secret, 3); + const secret1 = new secretsmanager.Secret(stack, 'Secret1'); + const secret2 = new secretsmanager.Secret(stack, 'Secret2', { + secretName: secret1.secretName, }); - - testFutureBehavior('selects the 4 parts of the resource name when the secret name is provided', flags, cdk.App, (cdkApp) => { - stack = new cdk.Stack(cdkApp); - const secret = new secretsmanager.Secret(stack, 'Secret', { secretName: 'my-secret-with-hyphens' }); - assertSegments(secret, 4); + new cdk.CfnOutput(stack, 'MySecretName1', { + value: secret1.secretName, }); - - testFutureBehavior('uses existing Tokens as secret names as-is', flags, cdk.App, (cdkApp) => { - stack = new cdk.Stack(cdkApp); - - const secret1 = new secretsmanager.Secret(stack, 'Secret1'); - const secret2 = new secretsmanager.Secret(stack, 'Secret2', { - secretName: secret1.secretName, - }); - new cdk.CfnOutput(stack, 'MySecretName1', { - value: secret1.secretName, - }); - new cdk.CfnOutput(stack, 'MySecretName2', { - value: secret2.secretName, - }); - - const outputs = Template.fromStack(stack).findOutputs('*'); - expect(outputs.MySecretName1).toEqual(outputs.MySecretName2); + new cdk.CfnOutput(stack, 'MySecretName2', { + value: secret2.secretName, }); + + const outputs = Template.fromStack(stack).findOutputs('*'); + expect(outputs.MySecretName1).toEqual(outputs.MySecretName2); }); }); diff --git a/packages/@aws-cdk/core/test/stack.test.ts b/packages/@aws-cdk/core/test/stack.test.ts index 9ad8464723bea..b2fc01b337a87 100644 --- a/packages/@aws-cdk/core/test/stack.test.ts +++ b/packages/@aws-cdk/core/test/stack.test.ts @@ -1,4 +1,4 @@ -import { testDeprecated, testFutureBehavior, testLegacyBehavior } from '@aws-cdk/cdk-build-tools'; +import { testDeprecated } from '@aws-cdk/cdk-build-tools'; import * as cxapi from '@aws-cdk/cx-api'; import { Fact, RegionInfo } from '@aws-cdk/region-info'; import { Construct, Node } from 'constructs'; @@ -1039,69 +1039,42 @@ describe('stack', () => { ]); }); - describe('@aws-cdk/core:enableStackNameDuplicates', () => { - describe('disabled (default)', () => { - - testLegacyBehavior('stack.templateFile is the name of the template file emitted to the cloud assembly (default is to use the stack name)', App, (app) => { - // WHEN - const stack1 = new Stack(app, 'MyStack1'); - const stack2 = new Stack(app, 'MyStack2', { stackName: 'MyRealStack2' }); - - // THEN - expect(stack1.templateFile).toEqual('MyStack1.template.json'); - expect(stack2.templateFile).toEqual('MyRealStack2.template.json'); - - }); - - testLegacyBehavior('artifactId and templateFile use the stack name', App, (app) => { - // WHEN - const stack1 = new Stack(app, 'MyStack1', { stackName: 'thestack' }); - const assembly = app.synth(); - - // THEN - expect(stack1.artifactId).toEqual('thestack'); - expect(stack1.templateFile).toEqual('thestack.template.json'); - expect(assembly.getStackArtifact(stack1.artifactId).templateFile).toEqual('thestack.template.json'); - }); - }); + test('allows using the same stack name for two stacks (i.e. in different regions)', () => { + // WHEN + const app = new App(); + const stack1 = new Stack(app, 'MyStack1', { stackName: 'thestack' }); + const stack2 = new Stack(app, 'MyStack2', { stackName: 'thestack' }); + const assembly = app.synth(); - describe('enabled', () => { - const flags = { [cxapi.ENABLE_STACK_NAME_DUPLICATES_CONTEXT]: 'true' }; - testFutureBehavior('allows using the same stack name for two stacks (i.e. in different regions)', flags, App, (app) => { - // WHEN - const stack1 = new Stack(app, 'MyStack1', { stackName: 'thestack' }); - const stack2 = new Stack(app, 'MyStack2', { stackName: 'thestack' }); - const assembly = app.synth(); - - // THEN - expect(assembly.getStackArtifact(stack1.artifactId).templateFile).toEqual('MyStack1.template.json'); - expect(assembly.getStackArtifact(stack2.artifactId).templateFile).toEqual('MyStack2.template.json'); - expect(stack1.templateFile).toEqual('MyStack1.template.json'); - expect(stack2.templateFile).toEqual('MyStack2.template.json'); - }); + // THEN + expect(assembly.getStackArtifact(stack1.artifactId).templateFile).toEqual('MyStack1.template.json'); + expect(assembly.getStackArtifact(stack2.artifactId).templateFile).toEqual('MyStack2.template.json'); + expect(stack1.templateFile).toEqual('MyStack1.template.json'); + expect(stack2.templateFile).toEqual('MyStack2.template.json'); + }); - testFutureBehavior('artifactId and templateFile use the unique id and not the stack name', flags, App, (app) => { - // WHEN - const stack1 = new Stack(app, 'MyStack1', { stackName: 'thestack' }); - const assembly = app.synth(); + test('artifactId and templateFile use the unique id and not the stack name', () => { + // WHEN + const app = new App(); + const stack1 = new Stack(app, 'MyStack1', { stackName: 'thestack' }); + const assembly = app.synth(); - // THEN - expect(stack1.artifactId).toEqual('MyStack1'); - expect(stack1.templateFile).toEqual('MyStack1.template.json'); - expect(assembly.getStackArtifact(stack1.artifactId).templateFile).toEqual('MyStack1.template.json'); - }); + // THEN + expect(stack1.artifactId).toEqual('MyStack1'); + expect(stack1.templateFile).toEqual('MyStack1.template.json'); + expect(assembly.getStackArtifact(stack1.artifactId).templateFile).toEqual('MyStack1.template.json'); + }); - testFutureBehavior('when feature flag is enabled we will use the artifact id as the template name', flags, App, (app) => { - // WHEN - const stack1 = new Stack(app, 'MyStack1'); - const stack2 = new Stack(app, 'MyStack2', { stackName: 'MyRealStack2' }); + test('use the artifact id as the template name', () => { + // WHEN + const app = new App(); + const stack1 = new Stack(app, 'MyStack1'); + const stack2 = new Stack(app, 'MyStack2', { stackName: 'MyRealStack2' }); - // THEN - expect(stack1.templateFile).toEqual('MyStack1.template.json'); - expect(stack2.templateFile).toEqual('MyStack2.template.json'); - }); - }); + // THEN + expect(stack1.templateFile).toEqual('MyStack1.template.json'); + expect(stack2.templateFile).toEqual('MyStack2.template.json'); }); test('metadata is collected at the stack boundary', () => { diff --git a/packages/@aws-cdk/cx-api/test/features.test.ts b/packages/@aws-cdk/cx-api/test/features.test.ts index b71927bfeeffd..c370f24415730 100644 --- a/packages/@aws-cdk/cx-api/test/features.test.ts +++ b/packages/@aws-cdk/cx-api/test/features.test.ts @@ -1,4 +1,3 @@ -import { testLegacyBehavior } from '@aws-cdk/cdk-build-tools/lib/feature-flag'; import * as feats from '../lib/features'; test('all future flags have defaults configured', () => { @@ -10,7 +9,3 @@ test('all future flags have defaults configured', () => { test('futureFlagDefault returns false if non existent flag was given', () => { expect(feats.futureFlagDefault('non-existent-flag')).toEqual(false); }); - -testLegacyBehavior('FUTURE_FLAGS_EXPIRED must be empty in CDKv1', Object, () => { - expect(feats.FUTURE_FLAGS_EXPIRED.length).toEqual(0); -}); diff --git a/tools/@aws-cdk/cdk-build-tools/lib/feature-flag.ts b/tools/@aws-cdk/cdk-build-tools/lib/feature-flag.ts deleted file mode 100644 index 36b22588288aa..0000000000000 --- a/tools/@aws-cdk/cdk-build-tools/lib/feature-flag.ts +++ /dev/null @@ -1,79 +0,0 @@ -import * as path from 'path'; -import * as fs from 'fs-extra'; -import * as semver from 'semver'; - -/* eslint-disable jest/no-export */ - -type Flags = {[key: string]: any}; - -/** - * jest helper function to be used when testing future flags. Twin function of the `testLegacyBehavior()`. - * This should be used for testing future flags that will be removed in CDKv2, and updated such that these - * will be the default behaviour. - * - * This function is specifically for unit tests that verify the behaviour when future flags are enabled. - * - * The version of CDK is determined by running `scripts/resolve-version.js`, and the logic is as follows: - * - * When run in CDKv1, the specified 'flags' parameter are passed into the CDK App's context, and then - * the test is executed. - * - * When run in CDKv2, the specified 'flags' parameter is ignored, since the default behaviour should be as if - * they are enabled, and then the test is executed. - */ -export function testFutureBehavior( - name: string, - flags: Flags, - cdkApp: new (props?: { context: Flags }) => T, - fn: (app: T) => void, - repoRoot: string = path.join(process.cwd(), '..', '..', '..')) { - - const major = cdkMajorVersion(repoRoot); - if (major === 2) { - const app = new cdkApp(); - return test(name, async () => fn(app)); - } - const app = new cdkApp({ context: flags }); - return test(name, () => fn(app)); -} - -/** - * jest helper function to be used when testing future flags. Twin function of the `testFutureBehavior()`. - * This should be used for testing future flags that will be removed in CDKv2, and updated such that these - * will be the default behaviour. - * - * This function is specifically for unit tests that verify the behaviour when future flags are disabled. - * - * The version of CDK is determined by running `scripts/resolve-version.js`, and the logic is as follows: - * - * When run in CDKv1, the test is executed as normal. - * - * When run in CDKv2, the test is skipped, since the feature flag usage is unsupported and blocked. - */ -export function testLegacyBehavior( - name: string, - cdkApp: new () => T, - fn: (app: T) => void, - repoRoot: string = path.join(process.cwd(), '..', '..', '..')) { - - const major = cdkMajorVersion(repoRoot); - if (major === 2) { - return; - } - const app = new cdkApp(); - return test(name, () => fn(app)); -} - -function cdkMajorVersion(repoRoot: string) { - const resolveVersionPath = path.join(repoRoot, 'scripts', 'resolve-version.js'); - if (!fs.existsSync(resolveVersionPath)) { - throw new Error(`file not present at path ${resolveVersionPath}. You will likely need to set 'repoRoot'.`); - } - // eslint-disable-next-line @typescript-eslint/no-require-imports - const ver = require(resolveVersionPath).version; - const sem = semver.parse(ver); - if (!sem) { - throw new Error(`version ${ver} is not a semver`); - } - return sem.major; -} diff --git a/tools/@aws-cdk/cdk-build-tools/lib/index.ts b/tools/@aws-cdk/cdk-build-tools/lib/index.ts index bfac1b81c127e..dff88eb689ea6 100644 --- a/tools/@aws-cdk/cdk-build-tools/lib/index.ts +++ b/tools/@aws-cdk/cdk-build-tools/lib/index.ts @@ -1,3 +1,2 @@ export { shell } from './os'; -export * from './feature-flag'; export * from './deprecated-symbols'; From 28e080aa458364de7570c28ee9318ba62341b34b Mon Sep 17 00:00:00 2001 From: AWS CDK Team Date: Wed, 7 Sep 2022 21:35:18 +0000 Subject: [PATCH 8/9] chore(release): 2.41.0 --- CHANGELOG.v2.alpha.md | 13 +++++++++++++ CHANGELOG.v2.md | 22 ++++++++++++++++++++++ version.v2.json | 4 ++-- 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.v2.alpha.md b/CHANGELOG.v2.alpha.md index 49d8f1c164d6c..5084c29762b84 100644 --- a/CHANGELOG.v2.alpha.md +++ b/CHANGELOG.v2.alpha.md @@ -2,6 +2,19 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [2.41.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.40.0-alpha.0...v2.41.0-alpha.0) (2022-09-07) + + +### Features + +* **batch:** add propagate tags prop in job definition ([#21904](https://github.com/aws/aws-cdk/issues/21904)) ([1bc4526](https://github.com/aws/aws-cdk/commit/1bc4526261c2fbdd6ce6c371ba1d9da2f79e07bd)), closes [#21740](https://github.com/aws/aws-cdk/issues/21740) + + +### Bug Fixes + +* **lambda-python:** bundling with poetry is broken ([#21945](https://github.com/aws/aws-cdk/issues/21945)) ([4b37157](https://github.com/aws/aws-cdk/commit/4b37157b47ab38124b62649649d0df9b701cb7fe)), closes [#21867](https://github.com/aws/aws-cdk/issues/21867) +* **lambda-python:** poetry bundling fails on python3.7 ([#21950](https://github.com/aws/aws-cdk/issues/21950)) ([809e1b0](https://github.com/aws/aws-cdk/commit/809e1b0d5dc29be02f95ea4361b6f87f94325f3d)) + ## [2.40.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.39.1-alpha.0...v2.40.0-alpha.0) (2022-08-31) diff --git a/CHANGELOG.v2.md b/CHANGELOG.v2.md index 0a562f22785bc..7cfb0cab8d9f3 100644 --- a/CHANGELOG.v2.md +++ b/CHANGELOG.v2.md @@ -2,6 +2,28 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [2.41.0](https://github.com/aws/aws-cdk/compare/v2.40.0...v2.41.0) (2022-09-07) + + +### Features + +* **assertions:** add function for verifying the number of matching resource properties ([#21707](https://github.com/aws/aws-cdk/issues/21707)) ([80cb527](https://github.com/aws/aws-cdk/commit/80cb527c01173a060064606b8fe286d5510f145e)) +* **custom-resource:** allow AwsCustomResource to be placed in vpc ([#21357](https://github.com/aws/aws-cdk/issues/21357)) ([62d7bf8](https://github.com/aws/aws-cdk/commit/62d7bf83b4bfe6358e86ecf1c332e51a3909bd8a)) +* **ec2:** allow private non-nat subnets ([#21699](https://github.com/aws/aws-cdk/issues/21699)) ([e1794e3](https://github.com/aws/aws-cdk/commit/e1794e346c2a04bf8f2e5f63138095a79f512cfe)) +* **ecs:** add `maxSwap` and `swappiness` properties to LinuxParameters ([#18703](https://github.com/aws/aws-cdk/issues/18703)) ([08eb1d6](https://github.com/aws/aws-cdk/commit/08eb1d66ae9caa6589c3ee66c4040a4e116adf52)), closes [#18460](https://github.com/aws/aws-cdk/issues/18460) +* **lambda-event-sources:** add kafka consumerGroupId support ([#21791](https://github.com/aws/aws-cdk/issues/21791)) ([b36bc11](https://github.com/aws/aws-cdk/commit/b36bc1146d06c7b9decface9f4ed9edeca61aa56)) +* compress aws-cdk-lib tablet file ([#21854](https://github.com/aws/aws-cdk/issues/21854)) ([5a3db2d](https://github.com/aws/aws-cdk/commit/5a3db2d19dc5525bfef568f17fffa09657b6ef21)) +* **ecs:** add function for adding secrets to containers after instantiating them ([#21826](https://github.com/aws/aws-cdk/issues/21826)) ([572f781](https://github.com/aws/aws-cdk/commit/572f7815cc5447aac9413b374ebbfd92bfa610a6)), closes [#18959](https://github.com/aws/aws-cdk/issues/18959) + + +### Bug Fixes + +* **aws-cdk:** cdk bootstrap print JSON template when using --json option ([#21852](https://github.com/aws/aws-cdk/issues/21852)) ([7bc3d18](https://github.com/aws/aws-cdk/commit/7bc3d18ff742140a35238af0241b5dc4c2cf73ee)), closes [#21456](https://github.com/aws/aws-cdk/issues/21456) [#21456](https://github.com/aws/aws-cdk/issues/21456) +* **core:** `--debug` doesn't record stack traces ([#21931](https://github.com/aws/aws-cdk/issues/21931)) ([9f2ea45](https://github.com/aws/aws-cdk/commit/9f2ea458609b29a91eb792165be6de596ce1aea9)) +* **events:** additional plaintext header are not set on eventbridge connection ([#21857](https://github.com/aws/aws-cdk/issues/21857)) ([f3f4814](https://github.com/aws/aws-cdk/commit/f3f4814b66ef2b0070fb6b25af9f6566bc1783a0)) +* **events-targets:** cannot set retry policy to 0 retry attempts ([#21900](https://github.com/aws/aws-cdk/issues/21900)) ([5549f16](https://github.com/aws/aws-cdk/commit/5549f1692270bce06a1d9cde952f9cd23a04204b)), closes [40aws-cdk/aws-events-targets/lib/util.ts#L54-L59](https://github.com/40aws-cdk/aws-events-targets/lib/util.ts/issues/L54-L59) [#21864](https://github.com/aws/aws-cdk/issues/21864) +* **stepfunctions:** cfnSpec breaks definitionSubstitutions prop ([#21887](https://github.com/aws/aws-cdk/issues/21887)) ([3adf841](https://github.com/aws/aws-cdk/commit/3adf84188947eb2fde6171f70d0d9c2dcdb78563)), closes [#21653](https://github.com/aws/aws-cdk/issues/21653) + ## [2.40.0](https://github.com/aws/aws-cdk/compare/v2.39.1...v2.40.0) (2022-08-31) diff --git a/version.v2.json b/version.v2.json index 35a6cf30c0ef3..28f99995ef4d8 100644 --- a/version.v2.json +++ b/version.v2.json @@ -1,4 +1,4 @@ { - "version": "2.40.0", - "alphaVersion": "2.40.0-alpha.0" + "version": "2.41.0", + "alphaVersion": "2.41.0-alpha.0" } \ No newline at end of file From aedc8883bfb7ec85b4d3392b3f589bcbfe22e4e0 Mon Sep 17 00:00:00 2001 From: Joshua Weber <57131123+daschaa@users.noreply.github.com> Date: Thu, 8 Sep 2022 00:15:46 +0200 Subject: [PATCH 9/9] fix(route53): vpc region in template overridden by stack region (#20530) Fixes #20496 This PR implements the proposed change in #20496 - When a region is set in the vpc it is used in the CloudFormation template. Otherwise the region from the respective stack is used. ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)? * [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-ec2/lib/vpc.ts | 17 +- .../@aws-cdk/aws-ec2/test/integ.vpc-lookup.ts | 48 ++ ...efaultTestDeployAssert3405726A.assets.json | 19 + ...aultTestDeployAssert3405726A.template.json | 36 ++ .../StackUnderTest.assets.json | 20 + .../StackUnderTest.template.json | 44 ++ .../StackWithVpc.assets.json | 20 + .../StackWithVpc.template.json | 564 ++++++++++++++++++ .../test/vpc-lookup.integ.snapshot/cdk.out | 1 + .../test/vpc-lookup.integ.snapshot/integ.json | 12 + .../vpc-lookup.integ.snapshot/manifest.json | 117 ++++ .../test/vpc-lookup.integ.snapshot/tree.json | 91 +++ .../aws-ec2/test/vpc.from-lookup.test.ts | 20 + packages/@aws-cdk/aws-ec2/test/vpc.test.ts | 17 + .../@aws-cdk/aws-route53/lib/hosted-zone.ts | 2 +- .../aws-route53/test/hosted-zone.test.ts | 35 +- packages/@aws-cdk/cx-api/lib/context/vpc.ts | 7 + 17 files changed, 1064 insertions(+), 6 deletions(-) create mode 100644 packages/@aws-cdk/aws-ec2/test/integ.vpc-lookup.ts create mode 100644 packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/ArchiveTestDefaultTestDeployAssert3405726A.assets.json create mode 100644 packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/ArchiveTestDefaultTestDeployAssert3405726A.template.json create mode 100644 packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/StackUnderTest.assets.json create mode 100644 packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/StackUnderTest.template.json create mode 100644 packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/StackWithVpc.assets.json create mode 100644 packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/StackWithVpc.template.json create mode 100644 packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/cdk.out create mode 100644 packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/integ.json create mode 100644 packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/manifest.json create mode 100644 packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/tree.json diff --git a/packages/@aws-cdk/aws-ec2/lib/vpc.ts b/packages/@aws-cdk/aws-ec2/lib/vpc.ts index c607ab434f112..8ac0472755643 100644 --- a/packages/@aws-cdk/aws-ec2/lib/vpc.ts +++ b/packages/@aws-cdk/aws-ec2/lib/vpc.ts @@ -763,6 +763,13 @@ export interface VpcAttributes { * VPN gateway's identifier */ readonly vpnGatewayId?: string; + + /** + * The region the VPC is in + * + * @default - The region of the stack where the VPC belongs to + */ + readonly region?: string; } export interface SubnetAttributes { @@ -1203,7 +1210,7 @@ export class Vpc extends VpcBase { dummyValue: undefined, }).value; - return new LookedUpVpc(scope, id, attributes || DUMMY_VPC_PROPS, attributes === undefined); + return new LookedUpVpc(scope, id, attributes ?? DUMMY_VPC_PROPS, attributes === undefined); /** * Prefixes all keys in the argument with `tag:`.` @@ -2008,7 +2015,9 @@ class ImportedVpc extends VpcBase { private readonly cidr?: string | undefined; constructor(scope: Construct, id: string, props: VpcAttributes, isIncomplete: boolean) { - super(scope, id); + super(scope, id, { + region: props.region, + }); this.vpcId = props.vpcId; this.vpcArn = Arn.format({ @@ -2058,7 +2067,9 @@ class LookedUpVpc extends VpcBase { private readonly cidr?: string | undefined; constructor(scope: Construct, id: string, props: cxapi.VpcContextResponse, isIncomplete: boolean) { - super(scope, id); + super(scope, id, { + region: props.region, + }); this.vpcId = props.vpcId; this.vpcArn = Arn.format({ diff --git a/packages/@aws-cdk/aws-ec2/test/integ.vpc-lookup.ts b/packages/@aws-cdk/aws-ec2/test/integ.vpc-lookup.ts new file mode 100644 index 0000000000000..3ce324f2a1e08 --- /dev/null +++ b/packages/@aws-cdk/aws-ec2/test/integ.vpc-lookup.ts @@ -0,0 +1,48 @@ +import * as cdk from '@aws-cdk/core'; +import { IntegTest } from '@aws-cdk/integ-tests'; +import * as ec2 from '../lib'; + +const appWithVpc = new cdk.App(); +const stack = new cdk.Stack(appWithVpc, 'StackWithVpc', { + env: { + region: 'eu-west-1', + account: '123456', + }, +}); + +const testVpc = new ec2.Vpc(stack, 'MyVpc', { + vpcName: 'my-vpc-name', +}); + +const appUnderTest = new cdk.App(); +const stackLookup = new cdk.Stack(appUnderTest, 'StackUnderTest', { + env: { + region: 'us-east-2', + account: '123456', + }, +}); + +const vpcFromVpcAttributes = ec2.Vpc.fromVpcAttributes(stackLookup, 'VpcFromVpcAttributes', { + region: 'eu-west-1', + availabilityZones: ['eu-west-1a'], + vpcId: testVpc.vpcId, +}); + +const vpcFromLookup = ec2.Vpc.fromLookup(stack, 'VpcFromLookup', { + region: 'eu-west-1', + vpcName: 'my-vpc-name', +}); + +new cdk.CfnOutput(stackLookup, 'OutputFromVpcAttributes', { + value: `Region fromVpcAttributes: ${vpcFromVpcAttributes.env.region}`, +}); + +new cdk.CfnOutput(stackLookup, 'OutputFromLookup', { + value: `Region fromLookup: ${vpcFromLookup.env.region}`, +}); + +new IntegTest(appUnderTest, 'ArchiveTest', { + testCases: [stackLookup], +}); +appWithVpc.synth(); +appUnderTest.synth(); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/ArchiveTestDefaultTestDeployAssert3405726A.assets.json b/packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/ArchiveTestDefaultTestDeployAssert3405726A.assets.json new file mode 100644 index 0000000000000..c18c34e7e9601 --- /dev/null +++ b/packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/ArchiveTestDefaultTestDeployAssert3405726A.assets.json @@ -0,0 +1,19 @@ +{ + "version": "21.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "ArchiveTestDefaultTestDeployAssert3405726A.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-ec2/test/vpc-lookup.integ.snapshot/ArchiveTestDefaultTestDeployAssert3405726A.template.json b/packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/ArchiveTestDefaultTestDeployAssert3405726A.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/ArchiveTestDefaultTestDeployAssert3405726A.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-ec2/test/vpc-lookup.integ.snapshot/StackUnderTest.assets.json b/packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/StackUnderTest.assets.json new file mode 100644 index 0000000000000..62e4b8863c352 --- /dev/null +++ b/packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/StackUnderTest.assets.json @@ -0,0 +1,20 @@ +{ + "version": "21.0.0", + "files": { + "cfac1423efb7c99cadc3f40367c753fe5b1527d9a6950c096ba326fabac4c89f": { + "source": { + "path": "StackUnderTest.template.json", + "packaging": "file" + }, + "destinations": { + "123456-us-east-2": { + "bucketName": "cdk-hnb659fds-assets-123456-us-east-2", + "objectKey": "cfac1423efb7c99cadc3f40367c753fe5b1527d9a6950c096ba326fabac4c89f.json", + "region": "us-east-2", + "assumeRoleArn": "arn:${AWS::Partition}:iam::123456:role/cdk-hnb659fds-file-publishing-role-123456-us-east-2" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/StackUnderTest.template.json b/packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/StackUnderTest.template.json new file mode 100644 index 0000000000000..6215386397ad3 --- /dev/null +++ b/packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/StackUnderTest.template.json @@ -0,0 +1,44 @@ +{ + "Outputs": { + "OutputFromVpcAttributes": { + "Value": "Region fromVpcAttributes: eu-west-1" + }, + "OutputFromLookup": { + "Value": "Region fromLookup: eu-west-1" + } + }, + "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/vpc-lookup.integ.snapshot/StackWithVpc.assets.json b/packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/StackWithVpc.assets.json new file mode 100644 index 0000000000000..502d2f22aa209 --- /dev/null +++ b/packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/StackWithVpc.assets.json @@ -0,0 +1,20 @@ +{ + "version": "21.0.0", + "files": { + "628a32283150d3af24efb3a11967996306884a3835ac731ab35822da2ce7e9ff": { + "source": { + "path": "StackWithVpc.template.json", + "packaging": "file" + }, + "destinations": { + "123456-eu-west-1": { + "bucketName": "cdk-hnb659fds-assets-123456-eu-west-1", + "objectKey": "628a32283150d3af24efb3a11967996306884a3835ac731ab35822da2ce7e9ff.json", + "region": "eu-west-1", + "assumeRoleArn": "arn:${AWS::Partition}:iam::123456:role/cdk-hnb659fds-file-publishing-role-123456-eu-west-1" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/StackWithVpc.template.json b/packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/StackWithVpc.template.json new file mode 100644 index 0000000000000..6c194bc628b8f --- /dev/null +++ b/packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/StackWithVpc.template.json @@ -0,0 +1,564 @@ +{ + "Resources": { + "MyVpcF9F0CA6F": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "my-vpc-name" + } + ] + } + }, + "MyVpcPublicSubnet1SubnetF6608456": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "AvailabilityZone": "dummy1a", + "CidrBlock": "10.0.0.0/19", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PublicSubnet1" + } + ] + } + }, + "MyVpcPublicSubnet1RouteTableC46AB2F4": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "Tags": [ + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PublicSubnet1" + } + ] + } + }, + "MyVpcPublicSubnet1RouteTableAssociation2ECEE1CB": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "MyVpcPublicSubnet1RouteTableC46AB2F4" + }, + "SubnetId": { + "Ref": "MyVpcPublicSubnet1SubnetF6608456" + } + } + }, + "MyVpcPublicSubnet1DefaultRoute95FDF9EB": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "MyVpcPublicSubnet1RouteTableC46AB2F4" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "MyVpcIGW5C4A4F63" + } + }, + "DependsOn": [ + "MyVpcVPCGW488ACE0D" + ] + }, + "MyVpcPublicSubnet1EIP096967CB": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PublicSubnet1" + } + ] + } + }, + "MyVpcPublicSubnet1NATGatewayAD3400C1": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "SubnetId": { + "Ref": "MyVpcPublicSubnet1SubnetF6608456" + }, + "AllocationId": { + "Fn::GetAtt": [ + "MyVpcPublicSubnet1EIP096967CB", + "AllocationId" + ] + }, + "Tags": [ + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PublicSubnet1" + } + ] + }, + "DependsOn": [ + "MyVpcPublicSubnet1DefaultRoute95FDF9EB", + "MyVpcPublicSubnet1RouteTableAssociation2ECEE1CB" + ] + }, + "MyVpcPublicSubnet2Subnet492B6BFB": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "AvailabilityZone": "dummy1b", + "CidrBlock": "10.0.32.0/19", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PublicSubnet2" + } + ] + } + }, + "MyVpcPublicSubnet2RouteTable1DF17386": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "Tags": [ + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PublicSubnet2" + } + ] + } + }, + "MyVpcPublicSubnet2RouteTableAssociation227DE78D": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "MyVpcPublicSubnet2RouteTable1DF17386" + }, + "SubnetId": { + "Ref": "MyVpcPublicSubnet2Subnet492B6BFB" + } + } + }, + "MyVpcPublicSubnet2DefaultRoute052936F6": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "MyVpcPublicSubnet2RouteTable1DF17386" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "MyVpcIGW5C4A4F63" + } + }, + "DependsOn": [ + "MyVpcVPCGW488ACE0D" + ] + }, + "MyVpcPublicSubnet2EIP8CCBA239": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PublicSubnet2" + } + ] + } + }, + "MyVpcPublicSubnet2NATGateway91BFBEC9": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "SubnetId": { + "Ref": "MyVpcPublicSubnet2Subnet492B6BFB" + }, + "AllocationId": { + "Fn::GetAtt": [ + "MyVpcPublicSubnet2EIP8CCBA239", + "AllocationId" + ] + }, + "Tags": [ + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PublicSubnet2" + } + ] + }, + "DependsOn": [ + "MyVpcPublicSubnet2DefaultRoute052936F6", + "MyVpcPublicSubnet2RouteTableAssociation227DE78D" + ] + }, + "MyVpcPublicSubnet3Subnet57EEE236": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "AvailabilityZone": "dummy1c", + "CidrBlock": "10.0.64.0/19", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PublicSubnet3" + } + ] + } + }, + "MyVpcPublicSubnet3RouteTable15028F08": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "Tags": [ + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PublicSubnet3" + } + ] + } + }, + "MyVpcPublicSubnet3RouteTableAssociation5C27DDA4": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "MyVpcPublicSubnet3RouteTable15028F08" + }, + "SubnetId": { + "Ref": "MyVpcPublicSubnet3Subnet57EEE236" + } + } + }, + "MyVpcPublicSubnet3DefaultRoute3A83AB36": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "MyVpcPublicSubnet3RouteTable15028F08" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "MyVpcIGW5C4A4F63" + } + }, + "DependsOn": [ + "MyVpcVPCGW488ACE0D" + ] + }, + "MyVpcPublicSubnet3EIPC5ACADAB": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PublicSubnet3" + } + ] + } + }, + "MyVpcPublicSubnet3NATGatewayD4B50EBE": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "SubnetId": { + "Ref": "MyVpcPublicSubnet3Subnet57EEE236" + }, + "AllocationId": { + "Fn::GetAtt": [ + "MyVpcPublicSubnet3EIPC5ACADAB", + "AllocationId" + ] + }, + "Tags": [ + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PublicSubnet3" + } + ] + }, + "DependsOn": [ + "MyVpcPublicSubnet3DefaultRoute3A83AB36", + "MyVpcPublicSubnet3RouteTableAssociation5C27DDA4" + ] + }, + "MyVpcPrivateSubnet1Subnet5057CF7E": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "AvailabilityZone": "dummy1a", + "CidrBlock": "10.0.96.0/19", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PrivateSubnet1" + } + ] + } + }, + "MyVpcPrivateSubnet1RouteTable8819E6E2": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "Tags": [ + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PrivateSubnet1" + } + ] + } + }, + "MyVpcPrivateSubnet1RouteTableAssociation56D38C7E": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "MyVpcPrivateSubnet1RouteTable8819E6E2" + }, + "SubnetId": { + "Ref": "MyVpcPrivateSubnet1Subnet5057CF7E" + } + } + }, + "MyVpcPrivateSubnet1DefaultRouteA8CDE2FA": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "MyVpcPrivateSubnet1RouteTable8819E6E2" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "MyVpcPublicSubnet1NATGatewayAD3400C1" + } + } + }, + "MyVpcPrivateSubnet2Subnet0040C983": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "AvailabilityZone": "dummy1b", + "CidrBlock": "10.0.128.0/19", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PrivateSubnet2" + } + ] + } + }, + "MyVpcPrivateSubnet2RouteTableCEDCEECE": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "Tags": [ + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PrivateSubnet2" + } + ] + } + }, + "MyVpcPrivateSubnet2RouteTableAssociation86A610DA": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "MyVpcPrivateSubnet2RouteTableCEDCEECE" + }, + "SubnetId": { + "Ref": "MyVpcPrivateSubnet2Subnet0040C983" + } + } + }, + "MyVpcPrivateSubnet2DefaultRoute9CE96294": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "MyVpcPrivateSubnet2RouteTableCEDCEECE" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "MyVpcPublicSubnet2NATGateway91BFBEC9" + } + } + }, + "MyVpcPrivateSubnet3Subnet772D6AD7": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "AvailabilityZone": "dummy1c", + "CidrBlock": "10.0.160.0/19", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PrivateSubnet3" + } + ] + } + }, + "MyVpcPrivateSubnet3RouteTableB790927C": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "Tags": [ + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PrivateSubnet3" + } + ] + } + }, + "MyVpcPrivateSubnet3RouteTableAssociationD951741C": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "MyVpcPrivateSubnet3RouteTableB790927C" + }, + "SubnetId": { + "Ref": "MyVpcPrivateSubnet3Subnet772D6AD7" + } + } + }, + "MyVpcPrivateSubnet3DefaultRouteEC11C0C5": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "MyVpcPrivateSubnet3RouteTableB790927C" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "MyVpcPublicSubnet3NATGatewayD4B50EBE" + } + } + }, + "MyVpcIGW5C4A4F63": { + "Type": "AWS::EC2::InternetGateway", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "my-vpc-name" + } + ] + } + }, + "MyVpcVPCGW488ACE0D": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "InternetGatewayId": { + "Ref": "MyVpcIGW5C4A4F63" + } + } + } + }, + "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/vpc-lookup.integ.snapshot/cdk.out b/packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/cdk.out new file mode 100644 index 0000000000000..8ecc185e9dbee --- /dev/null +++ b/packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"21.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/integ.json b/packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/integ.json new file mode 100644 index 0000000000000..8d00f60c22e15 --- /dev/null +++ b/packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "21.0.0", + "testCases": { + "ArchiveTest/DefaultTest": { + "stacks": [ + "StackUnderTest" + ], + "assertionStack": "ArchiveTest/DefaultTest/DeployAssert", + "assertionStackName": "ArchiveTestDefaultTestDeployAssert3405726A" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/manifest.json b/packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/manifest.json new file mode 100644 index 0000000000000..fbf4ce0e2ea74 --- /dev/null +++ b/packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/manifest.json @@ -0,0 +1,117 @@ +{ + "version": "21.0.0", + "artifacts": { + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + }, + "StackUnderTest.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "StackUnderTest.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "StackUnderTest": { + "type": "aws:cloudformation:stack", + "environment": "aws://123456/us-east-2", + "properties": { + "templateFile": "StackUnderTest.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::123456:role/cdk-hnb659fds-deploy-role-123456-us-east-2", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::123456:role/cdk-hnb659fds-cfn-exec-role-123456-us-east-2", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-123456-us-east-2/cfac1423efb7c99cadc3f40367c753fe5b1527d9a6950c096ba326fabac4c89f.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "StackUnderTest.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::123456:role/cdk-hnb659fds-lookup-role-123456-us-east-2", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "StackUnderTest.assets" + ], + "metadata": { + "/StackUnderTest/OutputFromVpcAttributes": [ + { + "type": "aws:cdk:logicalId", + "data": "OutputFromVpcAttributes" + } + ], + "/StackUnderTest/OutputFromLookup": [ + { + "type": "aws:cdk:logicalId", + "data": "OutputFromLookup" + } + ], + "/StackUnderTest/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/StackUnderTest/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "StackUnderTest" + }, + "ArchiveTestDefaultTestDeployAssert3405726A.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "ArchiveTestDefaultTestDeployAssert3405726A.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "ArchiveTestDefaultTestDeployAssert3405726A": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "ArchiveTestDefaultTestDeployAssert3405726A.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": [ + "ArchiveTestDefaultTestDeployAssert3405726A.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": [ + "ArchiveTestDefaultTestDeployAssert3405726A.assets" + ], + "metadata": { + "/ArchiveTest/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/ArchiveTest/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "ArchiveTest/DefaultTest/DeployAssert" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/tree.json b/packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/tree.json new file mode 100644 index 0000000000000..cf1089e7c66cc --- /dev/null +++ b/packages/@aws-cdk/aws-ec2/test/vpc-lookup.integ.snapshot/tree.json @@ -0,0 +1,91 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.92" + } + }, + "StackUnderTest": { + "id": "StackUnderTest", + "path": "StackUnderTest", + "children": { + "VpcFromVpcAttributes": { + "id": "VpcFromVpcAttributes", + "path": "StackUnderTest/VpcFromVpcAttributes", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "OutputFromVpcAttributes": { + "id": "OutputFromVpcAttributes", + "path": "StackUnderTest/OutputFromVpcAttributes", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "OutputFromLookup": { + "id": "OutputFromLookup", + "path": "StackUnderTest/OutputFromLookup", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "ArchiveTest": { + "id": "ArchiveTest", + "path": "ArchiveTest", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "ArchiveTest/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "ArchiveTest/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.92" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "ArchiveTest/DefaultTest/DeployAssert", + "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" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ec2/test/vpc.from-lookup.test.ts b/packages/@aws-cdk/aws-ec2/test/vpc.from-lookup.test.ts index 0d133e9673fb2..ba439b8d68211 100644 --- a/packages/@aws-cdk/aws-ec2/test/vpc.from-lookup.test.ts +++ b/packages/@aws-cdk/aws-ec2/test/vpc.from-lookup.test.ts @@ -268,12 +268,32 @@ describe('vpc from lookup', () => { restoreContextProvider(previous); }); + + test('passes region to LookedUpVpc correctly', () => { + const previous = mockVpcContextProviderWith({ + vpcId: 'vpc-1234', + subnetGroups: [], + region: 'region-1234', + }, options => { + expect(options.region).toEqual('region-1234'); + }); + + const stack = new Stack(); + const vpc = Vpc.fromLookup(stack, 'Vpc', { + vpcId: 'vpc-1234', + region: 'region-1234', + }); + + expect(vpc.env.region).toEqual('region-1234'); + restoreContextProvider(previous); + }); }); }); interface MockVcpContextResponse { readonly vpcId: string; readonly subnetGroups: cxapi.VpcSubnetGroup[]; + readonly region?: string; } function mockVpcContextProviderWith( diff --git a/packages/@aws-cdk/aws-ec2/test/vpc.test.ts b/packages/@aws-cdk/aws-ec2/test/vpc.test.ts index b12eb7c788b07..a509aed7d062e 100644 --- a/packages/@aws-cdk/aws-ec2/test/vpc.test.ts +++ b/packages/@aws-cdk/aws-ec2/test/vpc.test.ts @@ -1220,6 +1220,23 @@ describe('vpc', () => { }); + + test('fromVpcAttributes passes region correctly', () => { + // GIVEN + const stack = getTestStack(); + + const vpcId = Fn.importValue('myVpcId'); + + // WHEN + const vpc = Vpc.fromVpcAttributes(stack, 'VPC', { + vpcId, + availabilityZones: ['region-12345a', 'region-12345b', 'region-12345c'], + region: 'region-12345', + }); + + // THEN + expect(vpc.env.region).toEqual('region-12345'); + }); }); describe('NAT instances', () => { diff --git a/packages/@aws-cdk/aws-route53/lib/hosted-zone.ts b/packages/@aws-cdk/aws-route53/lib/hosted-zone.ts index c965021665b52..1fb05d111d822 100644 --- a/packages/@aws-cdk/aws-route53/lib/hosted-zone.ts +++ b/packages/@aws-cdk/aws-route53/lib/hosted-zone.ts @@ -181,7 +181,7 @@ export class HostedZone extends Resource implements IHostedZone { * @param vpc the other VPC to add. */ public addVpc(vpc: ec2.IVpc) { - this.vpcs.push({ vpcId: vpc.vpcId, vpcRegion: Stack.of(vpc).region }); + this.vpcs.push({ vpcId: vpc.vpcId, vpcRegion: vpc.env.region ?? Stack.of(vpc).region }); } } diff --git a/packages/@aws-cdk/aws-route53/test/hosted-zone.test.ts b/packages/@aws-cdk/aws-route53/test/hosted-zone.test.ts index b659e41446d75..70af6f1c802ae 100644 --- a/packages/@aws-cdk/aws-route53/test/hosted-zone.test.ts +++ b/packages/@aws-cdk/aws-route53/test/hosted-zone.test.ts @@ -1,7 +1,8 @@ -import { Template } from '@aws-cdk/assertions'; +import { Match, Template } from '@aws-cdk/assertions'; +import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import * as cdk from '@aws-cdk/core'; -import { HostedZone, PublicHostedZone } from '../lib'; +import { HostedZone, PrivateHostedZone, PublicHostedZone } from '../lib'; describe('hosted zone', () => { describe('Hosted Zone', () => { @@ -192,3 +193,33 @@ describe('hosted zone', () => { }).toThrow(/Cannot use undefined value for attribute `domainName`/); }); }); + +describe('Vpc', () => { + test('different region in vpc and hosted zone', () => { + // GIVEN + const stack = new cdk.Stack(undefined, 'TestStack', { + env: { account: '123456789012', region: 'us-east-1' }, + }); + + // WHEN + new PrivateHostedZone(stack, 'HostedZone', { + vpc: ec2.Vpc.fromVpcAttributes(stack, 'Vpc', { + vpcId: '1234', + availabilityZones: ['region-12345a', 'region-12345b', 'region-12345c'], + region: 'region-12345', + }), + zoneName: 'SomeZone', + }); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::Route53::HostedZone', { + VPCs: [ + { + VPCId: '1234', + VPCRegion: 'region-12345', + }, + ], + Name: Match.anyValue(), + }); + }); +}); \ No newline at end of file diff --git a/packages/@aws-cdk/cx-api/lib/context/vpc.ts b/packages/@aws-cdk/cx-api/lib/context/vpc.ts index 8d7bbf34f28ea..3a4adc0910303 100644 --- a/packages/@aws-cdk/cx-api/lib/context/vpc.ts +++ b/packages/@aws-cdk/cx-api/lib/context/vpc.ts @@ -161,4 +161,11 @@ export interface VpcContextResponse { * @default - no subnet groups will be returned unless {@link VpcContextQuery.returnAsymmetricSubnets} is true */ readonly subnetGroups?: VpcSubnetGroup[]; + + /** + * The region in which the VPC is in. + * + * @default - Region of the parent stack + */ + readonly region?: string; }