From 440ca35cf0f0e9f6f86bef445bd9aa6ef05ff9be Mon Sep 17 00:00:00 2001 From: Julian Michel Date: Mon, 2 Aug 2021 18:47:32 +0200 Subject: [PATCH 01/47] fix(chatbot): ARN validation in fromSlackChannelConfigurationArn fails for tokenized values (#15849) A SlackChannelConfiguration can be imported using `fromSlackChannelConfigurationArn`. In this method, the given ARN will be validated. However, the validation failed for tokenized values. The validation was enhanced. The ARN validation will be only executed if the ARN can be resolved. For unresolved tokens, the validation will be skipped. Closes #15842. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../lib/slack-channel-configuration.ts | 14 +++++++++++--- .../test/slack-channel-configuration.test.ts | 18 ++++++++++++++++++ 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/packages/@aws-cdk/aws-chatbot/lib/slack-channel-configuration.ts b/packages/@aws-cdk/aws-chatbot/lib/slack-channel-configuration.ts index 69646e783ebd7..690bb95c9bffd 100644 --- a/packages/@aws-cdk/aws-chatbot/lib/slack-channel-configuration.ts +++ b/packages/@aws-cdk/aws-chatbot/lib/slack-channel-configuration.ts @@ -204,9 +204,9 @@ export class SlackChannelConfiguration extends SlackChannelConfigurationBase { */ public static fromSlackChannelConfigurationArn(scope: Construct, id: string, slackChannelConfigurationArn: string): ISlackChannelConfiguration { const re = /^slack-channel\//; - const resourceName = cdk.Stack.of(scope).parseArn(slackChannelConfigurationArn).resourceName as string; + const resourceName = cdk.Arn.extractResourceName(slackChannelConfigurationArn, 'chat-configuration'); - if (!re.test(resourceName)) { + if (!cdk.Token.isUnresolved(slackChannelConfigurationArn) && !re.test(resourceName)) { throw new Error('The ARN of a Slack integration must be in the form: arn:aws:chatbot:{region}:{account}:chat-configuration/slack-channel/{slackChannelName}'); } @@ -227,11 +227,19 @@ export class SlackChannelConfiguration extends SlackChannelConfigurationBase { * The ArnComponents API will return `slack-channel/my-slack` * It need to handle that to gets a correct name.`my-slack` */ - readonly slackChannelConfigurationName = resourceName.substring('slack-channel/'.length); + readonly slackChannelConfigurationName: string; constructor(s: Construct, i: string) { super(s, i); this.grantPrincipal = new iam.UnknownPrincipal({ resource: this }); + + // handle slackChannelConfigurationName as specified above + if (cdk.Token.isUnresolved(slackChannelConfigurationArn)) { + this.slackChannelConfigurationName = cdk.Fn.select(1, cdk.Fn.split('slack-channel/', resourceName)); + } else { + this.slackChannelConfigurationName = resourceName.substring('slack-channel/'.length); + } + } } diff --git a/packages/@aws-cdk/aws-chatbot/test/slack-channel-configuration.test.ts b/packages/@aws-cdk/aws-chatbot/test/slack-channel-configuration.test.ts index 21d530bfd839a..63bf61b46d21c 100644 --- a/packages/@aws-cdk/aws-chatbot/test/slack-channel-configuration.test.ts +++ b/packages/@aws-cdk/aws-chatbot/test/slack-channel-configuration.test.ts @@ -245,4 +245,22 @@ describe('SlackChannelConfiguration', () => { expect(imported.slackChannelConfigurationName).toEqual('my-slack'); expect(imported.slackChannelConfigurationArn).toEqual('arn:aws:chatbot::1234567890:chat-configuration/slack-channel/my-slack'); }); + + test('skip validation for tokenized values', () => { + // invalid ARN because of underscores, no error because tokenized value + expect(() => chatbot.SlackChannelConfiguration.fromSlackChannelConfigurationArn(stack, 'MySlackChannel', + cdk.Lazy.string({ produce: () => 'arn:aws:chatbot::1234567890:chat-configuration/slack_channel/my_slack' }))).not.toThrow(); + }); + + test('test name and ARN from slack channel configuration ARN', () => { + const imported = chatbot.SlackChannelConfiguration.fromSlackChannelConfigurationArn(stack, 'MySlackChannel', cdk.Token.asString({ Ref: 'ARN' })); + + // THEN + expect(stack.resolve(imported.slackChannelConfigurationName)).toStrictEqual({ + 'Fn::Select': [1, { 'Fn::Split': ['slack-channel/', { 'Fn::Select': [1, { 'Fn::Split': [':chat-configuration/', { Ref: 'ARN' }] }] }] }], + }); + expect(stack.resolve(imported.slackChannelConfigurationArn)).toStrictEqual({ + Ref: 'ARN', + }); + }); }); \ No newline at end of file From d77e9dc927e193a8f8fcecb92ae3af9498509086 Mon Sep 17 00:00:00 2001 From: Otavio Macedo Date: Tue, 3 Aug 2021 15:06:13 +0100 Subject: [PATCH 02/47] chore(lambda): lambda insights incorrectly accesses non-exported files (#15870) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-lambda/lib/lambda-insights.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/@aws-cdk/aws-lambda/lib/lambda-insights.ts b/packages/@aws-cdk/aws-lambda/lib/lambda-insights.ts index 7a95dc18ea15c..2d2b88511786e 100644 --- a/packages/@aws-cdk/aws-lambda/lib/lambda-insights.ts +++ b/packages/@aws-cdk/aws-lambda/lib/lambda-insights.ts @@ -1,6 +1,5 @@ import { Aws, CfnMapping, Fn, IResolveContext, Lazy, Stack, Token } from '@aws-cdk/core'; import { FactName, RegionInfo } from '@aws-cdk/region-info'; -import { CLOUDWATCH_LAMBDA_INSIGHTS_ARNS } from '@aws-cdk/region-info/build-tools/fact-tables'; // This is the name of the mapping that will be added to the CloudFormation template, if a stack is region agnostic const DEFAULT_MAPPING_PREFIX = 'LambdaInsightsVersions'; @@ -49,8 +48,9 @@ export abstract class LambdaInsightsVersion { private static fromInsightsVersion(insightsVersion: string): LambdaInsightsVersion { // Check if insights version is valid. This should only happen if one of the public static readonly versions are set incorrectly - if (!(insightsVersion in CLOUDWATCH_LAMBDA_INSIGHTS_ARNS)) { - throw new Error(`Insights version ${insightsVersion} does not exist. Available versions are ${CLOUDWATCH_LAMBDA_INSIGHTS_ARNS.keys()}`); + const versionExists = RegionInfo.regions.some(regionInfo => regionInfo.cloudwatchLambdaInsightsArn(insightsVersion)); + if (!versionExists) { + throw new Error(`Insights version ${insightsVersion} does not exist.`); } class InsightsVersion extends LambdaInsightsVersion { From 45b484cdff115a0893f7eed2b0c1d6424c2751e4 Mon Sep 17 00:00:00 2001 From: Niranjan Jayakar Date: Tue, 3 Aug 2021 16:25:10 +0100 Subject: [PATCH 03/47] chore(assertions): migrate more modules to use assertions (#15857) Added a method `Template.toJSON()` to get the object representation of the CloudFormation template. This is most useful for snapshot testing. BREAKING CHANGE: `Template.fromTemplate()` is now renamed to `Template.fromJSON()` to provide clarity. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/assertions/README.md | 11 ++ packages/@aws-cdk/assertions/lib/template.ts | 20 +- .../@aws-cdk/assertions/test/template.test.ts | 42 +++++ packages/@aws-cdk/aws-amplify/package.json | 4 +- .../@aws-cdk/aws-amplify/test/app.test.ts | 30 +-- .../@aws-cdk/aws-amplify/test/branch.test.ts | 10 +- .../@aws-cdk/aws-amplify/test/domain.test.ts | 12 +- .../aws-apigatewayv2-authorizers/package.json | 4 +- .../test/http/jwt.test.ts | 6 +- .../test/http/lambda.test.ts | 17 +- .../test/http/user-pool.test.ts | 6 +- .../package.json | 4 +- .../test/http/alb.test.ts | 10 +- .../test/http/http-proxy.test.ts | 10 +- .../test/http/lambda.test.ts | 6 +- .../test/http/nlb.test.ts | 10 +- .../test/http/private/integration.test.ts | 1 - .../test/http/service-discovery.test.ts | 8 +- .../test/websocket/lambda.test.ts | 4 +- .../@aws-cdk/aws-apigatewayv2/package.json | 4 +- .../test/common/api-mapping.test.ts | 6 +- .../aws-apigatewayv2/test/http/api.test.ts | 71 ++++---- .../test/http/authorizer.test.ts | 10 +- .../test/http/domain-name.test.ts | 13 +- .../aws-apigatewayv2/test/http/route.test.ts | 30 +-- .../aws-apigatewayv2/test/http/stage.test.ts | 4 +- .../test/http/vpc-link.test.ts | 12 +- .../test/websocket/api.test.ts | 18 +- .../test/websocket/route.test.ts | 6 +- .../test/websocket/stage.test.ts | 4 +- packages/@aws-cdk/aws-appsync/package.json | 6 +- .../aws-appsync/test/appsync-auth.test.ts | 40 ++-- .../test/appsync-code-first.test.ts | 26 +-- .../test/appsync-directives.test.ts | 6 +- .../aws-appsync/test/appsync-dynamodb.test.ts | 12 +- .../test/appsync-elasticsearch.test.ts | 16 +- .../test/appsync-enum-type.test.ts | 10 +- .../aws-appsync/test/appsync-grant.test.ts | 47 +++-- .../aws-appsync/test/appsync-http.test.ts | 16 +- .../test/appsync-input-types.test.ts | 10 +- .../test/appsync-interface-type.test.ts | 18 +- .../aws-appsync/test/appsync-lambda.test.ts | 14 +- .../test/appsync-mapping-template.test.ts | 6 +- .../aws-appsync/test/appsync-none.test.ts | 12 +- .../test/appsync-object-type.test.ts | 24 +-- .../aws-appsync/test/appsync-rds.test.ts | 18 +- .../test/appsync-scalar-type.test.ts | 30 +-- .../aws-appsync/test/appsync-schema.test.ts | 22 +-- .../test/appsync-union-types.test.ts | 10 +- .../@aws-cdk/aws-appsync/test/appsync.test.ts | 14 +- packages/@aws-cdk/aws-batch/package.json | 4 +- .../@aws-cdk/aws-batch/test/batch.test.ts | 6 - .../test/compute-environment.test.ts | 35 ++-- .../aws-batch/test/job-definition.test.ts | 19 +- .../@aws-cdk/aws-batch/test/job-queue.test.ts | 11 +- packages/@aws-cdk/aws-cloud9/package.json | 6 +- .../test/cloud9.environment.test.ts | 12 +- .../@aws-cdk/aws-cloud9/test/cloud9.test.ts | 6 - packages/@aws-cdk/aws-codestar/package.json | 4 +- .../aws-codestar/test/codestar.test.ts | 6 +- packages/@aws-cdk/aws-glue/package.json | 4 +- .../@aws-cdk/aws-glue/test/connection.test.ts | 27 ++- .../@aws-cdk/aws-glue/test/database.test.ts | 24 ++- .../@aws-cdk/aws-glue/test/schema.test.ts | 146 ++++++++------- .../test/security-configuration.test.ts | 19 +- packages/@aws-cdk/aws-glue/test/table.test.ts | 172 +++++++++--------- packages/@aws-cdk/aws-ivs/package.json | 4 +- packages/@aws-cdk/aws-ivs/test/ivs.test.ts | 23 ++- .../aws-kinesisanalytics-flink/package.json | 4 +- .../test/application.test.ts | 77 ++++---- .../package.json | 2 +- .../test/s3-bucket.test.ts | 116 ++++++------ packages/@aws-cdk/aws-lambda-go/package.json | 2 +- .../aws-lambda-go/test/function.test.ts | 12 +- .../@aws-cdk/aws-lambda-python/package.json | 4 +- .../aws-lambda-python/test/function.test.ts | 12 +- .../aws-lambda-python/test/layer.test.ts | 1 - packages/@aws-cdk/aws-msk/package.json | 4 +- .../@aws-cdk/aws-msk/test/cluster.test.ts | 42 ++--- packages/@aws-cdk/aws-redshift/package.json | 4 +- .../aws-redshift/test/cluster.test.ts | 67 ++++--- .../aws-redshift/test/parameter-group.test.ts | 6 +- .../aws-redshift/test/subnet-group.test.ts | 8 +- packages/@aws-cdk/aws-sam/package.json | 2 +- packages/@aws-cdk/aws-sam/test/api.test.ts | 6 +- .../@aws-cdk/aws-sam/test/application.test.ts | 4 +- .../@aws-cdk/aws-sam/test/function.test.ts | 4 +- .../@aws-cdk/aws-servicecatalog/package.json | 4 +- .../aws-servicecatalog/test/portfolio.test.ts | 68 +++---- .../aws-servicecatalog/test/product.test.ts | 16 +- .../package.json | 2 +- .../test/application.test.ts | 22 +-- .../test/attribute-group.test.ts | 14 +- .../test/servicecatalogappregistry.test.ts | 6 - 94 files changed, 911 insertions(+), 876 deletions(-) delete mode 100644 packages/@aws-cdk/aws-batch/test/batch.test.ts delete mode 100644 packages/@aws-cdk/aws-cloud9/test/cloud9.test.ts delete mode 100644 packages/@aws-cdk/aws-servicecatalogappregistry/test/servicecatalogappregistry.test.ts diff --git a/packages/@aws-cdk/assertions/README.md b/packages/@aws-cdk/assertions/README.md index 386accc3c8f71..bfeb893417c31 100644 --- a/packages/@aws-cdk/assertions/README.md +++ b/packages/@aws-cdk/assertions/README.md @@ -53,6 +53,17 @@ assert.templateMatches({ }); ``` +The `Template` class also supports [snapshot +testing](https://jestjs.io/docs/snapshot-testing) using jest. + +```ts +// using jest +expect(Template.fromStack(stack)).toMatchSnapshot(); +``` + +For non-javascript languages, the `toJSON()` can be called to get an in-memory object +of the template. + ## Counting Resources This module allows asserting the number of resources of a specific type found diff --git a/packages/@aws-cdk/assertions/lib/template.ts b/packages/@aws-cdk/assertions/lib/template.ts index 9631eddbe3680..480290bc45b04 100644 --- a/packages/@aws-cdk/assertions/lib/template.ts +++ b/packages/@aws-cdk/assertions/lib/template.ts @@ -20,28 +20,38 @@ export class Template { } /** - * Base your assertions from an existing CloudFormation template formatted as a - * nested set of records. + * Base your assertions from an existing CloudFormation template formatted as an in-memory + * JSON object. * @param template the CloudFormation template formatted as a nested set of records */ - public static fromTemplate(template: { [key: string] : any }): Template { + public static fromJSON(template: { [key: string] : any }): Template { return new Template(template); } /** - * Base your assertions from an existing CloudFormation template formatted as a string. + * Base your assertions from an existing CloudFormation template formatted as a + * JSON string. * @param template the CloudFormation template in */ public static fromString(template: string): Template { return new Template(JSON.parse(template)); } + private readonly template: { [key: string]: any }; private readonly inspector: assert.StackInspector; - private constructor(template: any) { + private constructor(template: { [key: string]: any }) { + this.template = template; this.inspector = new assert.StackInspector(template); } + /** + * The CloudFormation template deserialized into an object. + */ + public toJSON(): { [key: string]: any } { + return this.template; + } + /** * Assert that the given number of resources of the given type exist in the * template. diff --git a/packages/@aws-cdk/assertions/test/template.test.ts b/packages/@aws-cdk/assertions/test/template.test.ts index 00cd695cd7634..0fe308e68e5be 100644 --- a/packages/@aws-cdk/assertions/test/template.test.ts +++ b/packages/@aws-cdk/assertions/test/template.test.ts @@ -3,6 +3,48 @@ import { Construct } from 'constructs'; import { Match, Template } from '../lib'; describe('Template', () => { + describe('asObject', () => { + test('fromString', () => { + const template = Template.fromString(`{ + "Resources": { + "Foo": { + "Type": "Baz::Qux", + "Properties": { "Fred": "Waldo" } + } + } + }`); + + expect(template.toJSON()).toEqual({ + Resources: { + Foo: { + Type: 'Baz::Qux', + Properties: { Fred: 'Waldo' }, + }, + }, + }); + }); + + test('fromStack', () => { + const stack = new Stack(); + new CfnResource(stack, 'Foo', { + type: 'Foo::Bar', + properties: { + Baz: 'Qux', + }, + }); + const template = Template.fromStack(stack); + + expect(template.toJSON()).toEqual({ + Resources: { + Foo: { + Type: 'Foo::Bar', + Properties: { Baz: 'Qux' }, + }, + }, + }); + }); + }); + describe('fromString', () => { test('default', () => { const assertions = Template.fromString(`{ diff --git a/packages/@aws-cdk/aws-amplify/package.json b/packages/@aws-cdk/aws-amplify/package.json index 35a569393b9c0..dad425ea592f2 100644 --- a/packages/@aws-cdk/aws-amplify/package.json +++ b/packages/@aws-cdk/aws-amplify/package.json @@ -75,12 +75,12 @@ }, "license": "Apache-2.0", "devDependencies": { + "@aws-cdk/assertions": "0.0.0", "@types/jest": "^26.0.24", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "cfn2ts": "0.0.0", - "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "pkglint": "0.0.0" }, "dependencies": { "@aws-cdk/aws-iam": "0.0.0", diff --git a/packages/@aws-cdk/aws-amplify/test/app.test.ts b/packages/@aws-cdk/aws-amplify/test/app.test.ts index f4e4468708a76..76b6830bec1c5 100644 --- a/packages/@aws-cdk/aws-amplify/test/app.test.ts +++ b/packages/@aws-cdk/aws-amplify/test/app.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import * as codebuild from '@aws-cdk/aws-codebuild'; import * as codecommit from '@aws-cdk/aws-codecommit'; import { SecretValue, Stack } from '@aws-cdk/core'; @@ -32,7 +32,7 @@ test('create an app connected to a GitHub repository', () => { }); // THEN - expect(stack).toHaveResource('AWS::Amplify::App', { + Template.fromStack(stack).hasResourceProperties('AWS::Amplify::App', { Name: 'App', BuildSpec: 'version: \"1.0\"\nfrontend:\n phases:\n build:\n commands:\n - npm run build\n', IAMServiceRole: { @@ -48,7 +48,7 @@ test('create an app connected to a GitHub repository', () => { }, }); - expect(stack).toHaveResource('AWS::IAM::Role', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Role', { AssumeRolePolicyDocument: { Statement: [ { @@ -87,7 +87,7 @@ test('create an app connected to a GitLab repository', () => { }); // THEN - expect(stack).toHaveResource('AWS::Amplify::App', { + Template.fromStack(stack).hasResourceProperties('AWS::Amplify::App', { Name: 'App', BuildSpec: '{\n \"version\": \"1.0\",\n \"frontend\": {\n \"phases\": {\n \"build\": {\n \"commands\": [\n \"npm run build\"\n ]\n }\n }\n }\n}', IAMServiceRole: { @@ -100,7 +100,7 @@ test('create an app connected to a GitLab repository', () => { Repository: 'https://gitlab.com/aws/aws-cdk', }); - expect(stack).toHaveResource('AWS::IAM::Role', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Role', { AssumeRolePolicyDocument: { Statement: [ { @@ -125,7 +125,7 @@ test('create an app connected to a CodeCommit repository', () => { }); // THEN - expect(stack).toHaveResource('AWS::Amplify::App', { + Template.fromStack(stack).hasResourceProperties('AWS::Amplify::App', { IAMServiceRole: { 'Fn::GetAtt': [ 'AppRole1AF9B530', @@ -150,7 +150,7 @@ test('create an app connected to a CodeCommit repository', () => { }, }); - expect(stack).toHaveResource('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { PolicyDocument: { Statement: [ { @@ -200,7 +200,7 @@ test('with basic auth from credentials', () => { }); // THEN - expect(stack).toHaveResource('AWS::Amplify::App', { + Template.fromStack(stack).hasResourceProperties('AWS::Amplify::App', { BasicAuthConfig: { EnableBasicAuth: true, Password: 'password', @@ -221,7 +221,7 @@ test('with basic auth from generated password', () => { }); // THEN - expect(stack).toHaveResource('AWS::Amplify::App', { + Template.fromStack(stack).hasResourceProperties('AWS::Amplify::App', { BasicAuthConfig: { EnableBasicAuth: true, Password: { @@ -240,7 +240,7 @@ test('with basic auth from generated password', () => { }, }); - expect(stack).toHaveResource('AWS::SecretsManager::Secret', { + Template.fromStack(stack).hasResourceProperties('AWS::SecretsManager::Secret', { GenerateSecretString: { GenerateStringKey: 'password', SecretStringTemplate: '{\"username\":\"username\"}', @@ -263,7 +263,7 @@ test('with env vars', () => { app.addEnvironment('key2', 'value2'); // THEN - expect(stack).toHaveResource('AWS::Amplify::App', { + Template.fromStack(stack).hasResourceProperties('AWS::Amplify::App', { EnvironmentVariables: [ { Name: 'key1', @@ -300,7 +300,7 @@ test('with custom rules', () => { }); // THEN - expect(stack).toHaveResource('AWS::Amplify::App', { + Template.fromStack(stack).hasResourceProperties('AWS::Amplify::App', { CustomRules: [ { Source: '/source1', @@ -328,7 +328,7 @@ test('with SPA redirect', () => { }); // THEN - expect(stack).toHaveResource('AWS::Amplify::App', { + Template.fromStack(stack).hasResourceProperties('AWS::Amplify::App', { CustomRules: [ { Source: '', @@ -356,7 +356,7 @@ test('with auto branch creation', () => { app.addAutoBranchEnvironment('key2', 'value2'); // THEN - expect(stack).toHaveResource('AWS::Amplify::App', { + Template.fromStack(stack).hasResourceProperties('AWS::Amplify::App', { AutoBranchCreationConfig: { BasicAuthConfig: { EnableBasicAuth: false, @@ -390,7 +390,7 @@ test('with auto branch deletion', () => { }); // THEN - expect(stack).toHaveResource('AWS::Amplify::App', { + Template.fromStack(stack).hasResourceProperties('AWS::Amplify::App', { EnableBranchAutoDeletion: true, }); }); diff --git a/packages/@aws-cdk/aws-amplify/test/branch.test.ts b/packages/@aws-cdk/aws-amplify/test/branch.test.ts index 6844d9f952d10..1638157eb4b14 100644 --- a/packages/@aws-cdk/aws-amplify/test/branch.test.ts +++ b/packages/@aws-cdk/aws-amplify/test/branch.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import { SecretValue, Stack } from '@aws-cdk/core'; import * as amplify from '../lib'; @@ -20,7 +20,7 @@ test('create a branch', () => { app.addBranch('dev'); // THEN - expect(stack).toHaveResource('AWS::Amplify::Branch', { + Template.fromStack(stack).hasResourceProperties('AWS::Amplify::Branch', { AppId: { 'Fn::GetAtt': [ 'AppF1B96344', @@ -40,7 +40,7 @@ test('with basic auth from credentials', () => { }); // THEN - expect(stack).toHaveResource('AWS::Amplify::Branch', { + Template.fromStack(stack).hasResourceProperties('AWS::Amplify::Branch', { BasicAuthConfig: { EnableBasicAuth: true, Password: 'password', @@ -56,7 +56,7 @@ test('with basic auth from generated password', () => { }); // THEN - expect(stack).toHaveResource('AWS::Amplify::Branch', { + Template.fromStack(stack).hasResourceProperties('AWS::Amplify::Branch', { BasicAuthConfig: { EnableBasicAuth: true, Password: { @@ -86,7 +86,7 @@ test('with env vars', () => { branch.addEnvironment('key2', 'value2'); // THEN - expect(stack).toHaveResource('AWS::Amplify::Branch', { + Template.fromStack(stack).hasResourceProperties('AWS::Amplify::Branch', { EnvironmentVariables: [ { Name: 'key1', diff --git a/packages/@aws-cdk/aws-amplify/test/domain.test.ts b/packages/@aws-cdk/aws-amplify/test/domain.test.ts index 13311a93abaec..2188de34ef23d 100644 --- a/packages/@aws-cdk/aws-amplify/test/domain.test.ts +++ b/packages/@aws-cdk/aws-amplify/test/domain.test.ts @@ -1,5 +1,5 @@ +import { Template } from '@aws-cdk/assertions'; import * as iam from '@aws-cdk/aws-iam'; -import '@aws-cdk/assert-internal/jest'; import { App, SecretValue, Stack } from '@aws-cdk/core'; import * as amplify from '../lib'; @@ -28,7 +28,7 @@ test('create a domain', () => { domain.mapSubDomain(devBranch); // THEN - expect(stack).toHaveResource('AWS::Amplify::Domain', { + Template.fromStack(stack).hasResourceProperties('AWS::Amplify::Domain', { AppId: { 'Fn::GetAtt': [ 'AppF1B96344', @@ -81,7 +81,7 @@ test('map a branch to the domain root', () => { domain.mapRoot(prodBranch); // THEN - expect(stack).toHaveResource('AWS::Amplify::Domain', { + Template.fromStack(stack).hasResourceProperties('AWS::Amplify::Domain', { AppId: { 'Fn::GetAtt': [ 'AppF1B96344', @@ -141,7 +141,7 @@ test('auto subdomain all branches', () => { domain.mapRoot(prodBranch); // THEN - expect(stack).toHaveResource('AWS::Amplify::Domain', { + Template.fromStack(stack).hasResourceProperties('AWS::Amplify::Domain', { EnableAutoSubDomain: true, AutoSubDomainCreationPatterns: [ '*', @@ -176,7 +176,7 @@ test('auto subdomain some branches', () => { domain.mapRoot(prodBranch); // THEN - expect(stack).toHaveResource('AWS::Amplify::Domain', { + Template.fromStack(stack).hasResourceProperties('AWS::Amplify::Domain', { EnableAutoSubDomain: true, AutoSubDomainCreationPatterns: ['features/**'], AutoSubDomainIAMRole: { @@ -214,7 +214,7 @@ test('auto subdomain with IAM role', () => { domain.mapRoot(prodBranch); // THEN - expect(stack).toHaveResource('AWS::Amplify::Domain', { + Template.fromStack(stack).hasResourceProperties('AWS::Amplify::Domain', { EnableAutoSubDomain: true, AutoSubDomainCreationPatterns: ['features/**'], AutoSubDomainIAMRole: { diff --git a/packages/@aws-cdk/aws-apigatewayv2-authorizers/package.json b/packages/@aws-cdk/aws-apigatewayv2-authorizers/package.json index 748efa7077158..8466c95ddc9da 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-authorizers/package.json +++ b/packages/@aws-cdk/aws-apigatewayv2-authorizers/package.json @@ -73,14 +73,14 @@ }, "license": "Apache-2.0", "devDependencies": { + "@aws-cdk/assertions": "0.0.0", "@types/jest": "^26.0.24", "@types/aws-lambda": "^8.10.79", "@aws-cdk/aws-apigatewayv2-integrations": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", - "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "pkglint": "0.0.0" }, "dependencies": { "@aws-cdk/aws-apigatewayv2": "0.0.0", diff --git a/packages/@aws-cdk/aws-apigatewayv2-authorizers/test/http/jwt.test.ts b/packages/@aws-cdk/aws-apigatewayv2-authorizers/test/http/jwt.test.ts index 469a0d6aa4ece..f97e3d4c24d74 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-authorizers/test/http/jwt.test.ts +++ b/packages/@aws-cdk/aws-apigatewayv2-authorizers/test/http/jwt.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import { HttpApi, HttpIntegrationType, HttpRouteIntegrationBindOptions, IHttpRouteIntegration, PayloadFormatVersion } from '@aws-cdk/aws-apigatewayv2'; import { Stack } from '@aws-cdk/core'; import { HttpJwtAuthorizer } from '../../lib'; @@ -22,7 +22,7 @@ describe('HttpJwtAuthorizer', () => { }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::Authorizer', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Authorizer', { AuthorizerType: 'JWT', IdentitySource: ['$request.header.Authorization'], JwtConfiguration: { @@ -55,7 +55,7 @@ describe('HttpJwtAuthorizer', () => { }); // THEN - expect(stack).toCountResources('AWS::ApiGatewayV2::Authorizer', 1); + Template.fromStack(stack).resourceCountIs('AWS::ApiGatewayV2::Authorizer', 1); }); }); diff --git a/packages/@aws-cdk/aws-apigatewayv2-authorizers/test/http/lambda.test.ts b/packages/@aws-cdk/aws-apigatewayv2-authorizers/test/http/lambda.test.ts index a9efd500e6bf1..1f62ad76867b0 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-authorizers/test/http/lambda.test.ts +++ b/packages/@aws-cdk/aws-apigatewayv2-authorizers/test/http/lambda.test.ts @@ -1,5 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; -import { ABSENT } from '@aws-cdk/assert-internal'; +import { Match, Template } from '@aws-cdk/assertions'; import { HttpApi, HttpIntegrationType, HttpRouteIntegrationBindOptions, IHttpRouteIntegration, PayloadFormatVersion } from '@aws-cdk/aws-apigatewayv2'; import { Code, Function, Runtime } from '@aws-cdk/aws-lambda'; import { Duration, Stack } from '@aws-cdk/core'; @@ -31,7 +30,7 @@ describe('HttpLambdaAuthorizer', () => { }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::Authorizer', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Authorizer', { Name: 'default-authorizer', AuthorizerType: 'REQUEST', AuthorizerResultTtlInSeconds: 300, @@ -41,7 +40,7 @@ describe('HttpLambdaAuthorizer', () => { ], }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Route', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Route', { AuthorizationType: 'CUSTOM', }); }); @@ -71,7 +70,7 @@ describe('HttpLambdaAuthorizer', () => { }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::Authorizer', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Authorizer', { AuthorizerPayloadFormatVersion: '2.0', EnableSimpleResponses: true, }); @@ -102,9 +101,9 @@ describe('HttpLambdaAuthorizer', () => { }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::Authorizer', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Authorizer', { AuthorizerPayloadFormatVersion: '1.0', - EnableSimpleResponses: ABSENT, + EnableSimpleResponses: Match.absentProperty(), }); }); @@ -133,7 +132,7 @@ describe('HttpLambdaAuthorizer', () => { }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::Authorizer', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Authorizer', { AuthorizerPayloadFormatVersion: '2.0', EnableSimpleResponses: true, }); @@ -165,7 +164,7 @@ describe('HttpLambdaAuthorizer', () => { }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::Authorizer', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Authorizer', { AuthorizerResultTtlInSeconds: 600, }); }); diff --git a/packages/@aws-cdk/aws-apigatewayv2-authorizers/test/http/user-pool.test.ts b/packages/@aws-cdk/aws-apigatewayv2-authorizers/test/http/user-pool.test.ts index 33086eab5ff4a..0e3c339e7f744 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-authorizers/test/http/user-pool.test.ts +++ b/packages/@aws-cdk/aws-apigatewayv2-authorizers/test/http/user-pool.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import { HttpApi, HttpIntegrationType, HttpRouteIntegrationBindOptions, IHttpRouteIntegration, PayloadFormatVersion } from '@aws-cdk/aws-apigatewayv2'; import { UserPool } from '@aws-cdk/aws-cognito'; import { Stack } from '@aws-cdk/core'; @@ -24,7 +24,7 @@ describe('HttpUserPoolAuthorizer', () => { }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::Authorizer', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Authorizer', { AuthorizerType: 'JWT', IdentitySource: ['$request.header.Authorization'], JwtConfiguration: { @@ -68,7 +68,7 @@ describe('HttpUserPoolAuthorizer', () => { }); // THEN - expect(stack).toCountResources('AWS::ApiGatewayV2::Authorizer', 1); + Template.fromStack(stack).resourceCountIs('AWS::ApiGatewayV2::Authorizer', 1); }); }); diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations/package.json b/packages/@aws-cdk/aws-apigatewayv2-integrations/package.json index 77e37b1fd5d0d..f857a94bc93f4 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-integrations/package.json +++ b/packages/@aws-cdk/aws-apigatewayv2-integrations/package.json @@ -71,11 +71,11 @@ }, "license": "Apache-2.0", "devDependencies": { + "@aws-cdk/assertions": "0.0.0", "@types/jest": "^26.0.24", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", - "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "pkglint": "0.0.0" }, "dependencies": { "@aws-cdk/aws-apigatewayv2": "0.0.0", diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations/test/http/alb.test.ts b/packages/@aws-cdk/aws-apigatewayv2-integrations/test/http/alb.test.ts index 95ece74cf7e93..e5871da260bc2 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-integrations/test/http/alb.test.ts +++ b/packages/@aws-cdk/aws-apigatewayv2-integrations/test/http/alb.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import { HttpApi, HttpMethod, HttpRoute, HttpRouteKey, VpcLink } from '@aws-cdk/aws-apigatewayv2'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as elbv2 from '@aws-cdk/aws-elasticloadbalancingv2'; @@ -25,7 +25,7 @@ describe('HttpAlbIntegration', () => { }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::Integration', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Integration', { IntegrationType: 'HTTP_PROXY', ConnectionId: { Ref: 'HttpApiVpcLink159804837', @@ -60,7 +60,7 @@ describe('HttpAlbIntegration', () => { }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::Integration', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Integration', { IntegrationType: 'HTTP_PROXY', ConnectionId: { Ref: 'VpcLink42ED6FF0', @@ -94,7 +94,7 @@ describe('HttpAlbIntegration', () => { }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::Integration', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Integration', { IntegrationMethod: 'PATCH', }); }); @@ -137,7 +137,7 @@ describe('HttpAlbIntegration', () => { }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::Integration', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Integration', { TlsConfig: { ServerNameToVerify: 'name-to-verify', }, diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations/test/http/http-proxy.test.ts b/packages/@aws-cdk/aws-apigatewayv2-integrations/test/http/http-proxy.test.ts index 9c3b09ddcfbd6..0c76996fe7867 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-integrations/test/http/http-proxy.test.ts +++ b/packages/@aws-cdk/aws-apigatewayv2-integrations/test/http/http-proxy.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import { HttpApi, HttpIntegration, HttpIntegrationType, HttpMethod, HttpRoute, HttpRouteKey, PayloadFormatVersion } from '@aws-cdk/aws-apigatewayv2'; import { Stack } from '@aws-cdk/core'; import { HttpProxyIntegration } from '../../lib'; @@ -15,7 +15,7 @@ describe('HttpProxyIntegration', () => { routeKey: HttpRouteKey.with('/pets'), }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Integration', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Integration', { IntegrationType: 'HTTP_PROXY', IntegrationUri: 'some-target-url', PayloadFormatVersion: '1.0', @@ -35,7 +35,7 @@ describe('HttpProxyIntegration', () => { routeKey: HttpRouteKey.with('/pets'), }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Integration', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Integration', { IntegrationMethod: 'PATCH', }); }); @@ -50,7 +50,7 @@ describe('HttpProxyIntegration', () => { integrationUri: 'some-target-url', }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Integration', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Integration', { IntegrationType: 'HTTP_PROXY', IntegrationUri: 'some-target-url', PayloadFormatVersion: '99.99', @@ -66,7 +66,7 @@ describe('HttpProxyIntegration', () => { integrationUri: 'some-target-url', }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Integration', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Integration', { IntegrationType: 'HTTP_PROXY', IntegrationUri: 'some-target-url', }); diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations/test/http/lambda.test.ts b/packages/@aws-cdk/aws-apigatewayv2-integrations/test/http/lambda.test.ts index 6414869f66f66..d0ead43945ec4 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-integrations/test/http/lambda.test.ts +++ b/packages/@aws-cdk/aws-apigatewayv2-integrations/test/http/lambda.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import { HttpApi, HttpRoute, HttpRouteKey, PayloadFormatVersion } from '@aws-cdk/aws-apigatewayv2'; import { Code, Function, Runtime } from '@aws-cdk/aws-lambda'; import { App, Stack } from '@aws-cdk/core'; @@ -17,7 +17,7 @@ describe('LambdaProxyIntegration', () => { routeKey: HttpRouteKey.with('/pets'), }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Integration', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Integration', { IntegrationType: 'AWS_PROXY', IntegrationUri: stack.resolve(fooFn.functionArn), PayloadFormatVersion: '2.0', @@ -36,7 +36,7 @@ describe('LambdaProxyIntegration', () => { routeKey: HttpRouteKey.with('/pets'), }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Integration', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Integration', { PayloadFormatVersion: '1.0', }); }); diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations/test/http/nlb.test.ts b/packages/@aws-cdk/aws-apigatewayv2-integrations/test/http/nlb.test.ts index 2b7120ea33582..a32d448d8e448 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-integrations/test/http/nlb.test.ts +++ b/packages/@aws-cdk/aws-apigatewayv2-integrations/test/http/nlb.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import { HttpApi, HttpMethod, HttpRoute, HttpRouteKey, VpcLink } from '@aws-cdk/aws-apigatewayv2'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as elbv2 from '@aws-cdk/aws-elasticloadbalancingv2'; @@ -25,7 +25,7 @@ describe('HttpNlbIntegration', () => { }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::Integration', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Integration', { IntegrationType: 'HTTP_PROXY', ConnectionId: { Ref: 'HttpApiVpcLink159804837', @@ -60,7 +60,7 @@ describe('HttpNlbIntegration', () => { }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::Integration', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Integration', { IntegrationType: 'HTTP_PROXY', ConnectionId: { Ref: 'VpcLink42ED6FF0', @@ -94,7 +94,7 @@ describe('HttpNlbIntegration', () => { }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::Integration', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Integration', { IntegrationMethod: 'PATCH', }); }); @@ -134,7 +134,7 @@ describe('HttpNlbIntegration', () => { }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::Integration', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Integration', { TlsConfig: { ServerNameToVerify: 'name-to-verify', }, diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations/test/http/private/integration.test.ts b/packages/@aws-cdk/aws-apigatewayv2-integrations/test/http/private/integration.test.ts index fb6c4ab082b53..8cda89e3d2390 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-integrations/test/http/private/integration.test.ts +++ b/packages/@aws-cdk/aws-apigatewayv2-integrations/test/http/private/integration.test.ts @@ -1,4 +1,3 @@ -import '@aws-cdk/assert-internal/jest'; import { HttpApi, HttpRoute, HttpRouteIntegrationBindOptions, HttpRouteIntegrationConfig, HttpRouteKey } from '@aws-cdk/aws-apigatewayv2'; import { Stack } from '@aws-cdk/core'; import { HttpPrivateIntegration } from '../../../lib/http/private/integration'; diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations/test/http/service-discovery.test.ts b/packages/@aws-cdk/aws-apigatewayv2-integrations/test/http/service-discovery.test.ts index 83d2b47252598..4d3bef328a637 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-integrations/test/http/service-discovery.test.ts +++ b/packages/@aws-cdk/aws-apigatewayv2-integrations/test/http/service-discovery.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import { HttpApi, HttpMethod, HttpRoute, HttpRouteKey, VpcLink } from '@aws-cdk/aws-apigatewayv2'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as servicediscovery from '@aws-cdk/aws-servicediscovery'; @@ -29,7 +29,7 @@ describe('HttpServiceDiscoveryIntegration', () => { }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::Integration', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Integration', { IntegrationType: 'HTTP_PROXY', ConnectionId: { Ref: 'VpcLink42ED6FF0', @@ -70,7 +70,7 @@ describe('HttpServiceDiscoveryIntegration', () => { }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::Integration', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Integration', { IntegrationMethod: 'PATCH', }); }); @@ -119,7 +119,7 @@ describe('HttpServiceDiscoveryIntegration', () => { }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::Integration', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Integration', { TlsConfig: { ServerNameToVerify: 'name-to-verify', }, diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations/test/websocket/lambda.test.ts b/packages/@aws-cdk/aws-apigatewayv2-integrations/test/websocket/lambda.test.ts index d5d7e4079db2d..e12b09f75ed50 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-integrations/test/websocket/lambda.test.ts +++ b/packages/@aws-cdk/aws-apigatewayv2-integrations/test/websocket/lambda.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import { WebSocketApi } from '@aws-cdk/aws-apigatewayv2'; import { Code, Function, Runtime } from '@aws-cdk/aws-lambda'; import { Stack } from '@aws-cdk/core'; @@ -19,7 +19,7 @@ describe('LambdaWebSocketIntegration', () => { }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::Integration', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Integration', { IntegrationType: 'AWS_PROXY', IntegrationUri: { 'Fn::Join': [ diff --git a/packages/@aws-cdk/aws-apigatewayv2/package.json b/packages/@aws-cdk/aws-apigatewayv2/package.json index 20d03097c4ae7..d0f2d3b6288c2 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/package.json +++ b/packages/@aws-cdk/aws-apigatewayv2/package.json @@ -78,12 +78,12 @@ }, "license": "Apache-2.0", "devDependencies": { + "@aws-cdk/assertions": "0.0.0", "@types/jest": "^26.0.24", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "cfn2ts": "0.0.0", - "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "pkglint": "0.0.0" }, "dependencies": { "@aws-cdk/aws-certificatemanager": "0.0.0", diff --git a/packages/@aws-cdk/aws-apigatewayv2/test/common/api-mapping.test.ts b/packages/@aws-cdk/aws-apigatewayv2/test/common/api-mapping.test.ts index 705f3ca6a4371..607afb5f8238f 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/test/common/api-mapping.test.ts +++ b/packages/@aws-cdk/aws-apigatewayv2/test/common/api-mapping.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import { Certificate } from '@aws-cdk/aws-certificatemanager'; import { Stack } from '@aws-cdk/core'; import { DomainName, HttpApi, ApiMapping, WebSocketApi } from '../../lib'; @@ -22,7 +22,7 @@ describe('ApiMapping', () => { domainName: dn, }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::ApiMapping', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::ApiMapping', { ApiId: { Ref: 'ApiF70053CD', }, @@ -54,7 +54,7 @@ describe('ApiMapping', () => { apiMappingKey: 'beta', }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::ApiMapping', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::ApiMapping', { ApiId: { Ref: 'ApiF70053CD', }, diff --git a/packages/@aws-cdk/aws-apigatewayv2/test/http/api.test.ts b/packages/@aws-cdk/aws-apigatewayv2/test/http/api.test.ts index c2324412d3396..a4e880bac742d 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/test/http/api.test.ts +++ b/packages/@aws-cdk/aws-apigatewayv2/test/http/api.test.ts @@ -1,5 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; -import { ABSENT } from '@aws-cdk/assert-internal'; +import { Match, Template } from '@aws-cdk/assertions'; import { Metric } from '@aws-cdk/aws-cloudwatch'; import * as ec2 from '@aws-cdk/aws-ec2'; import { Duration, Stack } from '@aws-cdk/core'; @@ -14,19 +13,19 @@ describe('HttpApi', () => { const stack = new Stack(); const api = new HttpApi(stack, 'api'); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Api', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Api', { Name: 'api', ProtocolType: 'HTTP', }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Stage', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Stage', { ApiId: stack.resolve(api.apiId), StageName: '$default', AutoDeploy: true, }); - expect(stack).not.toHaveResource('AWS::ApiGatewayV2::Route'); - expect(stack).not.toHaveResource('AWS::ApiGatewayV2::Integration'); + Template.fromStack(stack).resourceCountIs('AWS::ApiGatewayV2::Route', 0); + Template.fromStack(stack).resourceCountIs('AWS::ApiGatewayV2::Integration', 0); expect(api.url).toBeDefined(); }); @@ -45,7 +44,7 @@ describe('HttpApi', () => { createDefaultStage: false, }); - expect(stack).not.toHaveResource('AWS::ApiGatewayV2::Stage'); + Template.fromStack(stack).resourceCountIs('AWS::ApiGatewayV2::Stage', 0); expect(api.url).toBeUndefined(); }); @@ -55,12 +54,12 @@ describe('HttpApi', () => { defaultIntegration: new DummyRouteIntegration(), }); - expect(stack).toHaveResourceLike('AWS::ApiGatewayV2::Route', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Route', { ApiId: stack.resolve(httpApi.apiId), RouteKey: '$default', }); - expect(stack).toHaveResourceLike('AWS::ApiGatewayV2::Integration', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Integration', { ApiId: stack.resolve(httpApi.apiId), }); }); @@ -75,12 +74,12 @@ describe('HttpApi', () => { integration: new DummyRouteIntegration(), }); - expect(stack).toHaveResourceLike('AWS::ApiGatewayV2::Route', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Route', { ApiId: stack.resolve(httpApi.apiId), RouteKey: 'GET /pets', }); - expect(stack).toHaveResourceLike('AWS::ApiGatewayV2::Route', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Route', { ApiId: stack.resolve(httpApi.apiId), RouteKey: 'PATCH /pets', }); @@ -95,7 +94,7 @@ describe('HttpApi', () => { integration: new DummyRouteIntegration(), }); - expect(stack).toHaveResourceLike('AWS::ApiGatewayV2::Route', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Route', { ApiId: stack.resolve(httpApi.apiId), RouteKey: 'ANY /pets', }); @@ -113,7 +112,7 @@ describe('HttpApi', () => { }, }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Api', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Api', { CorsConfiguration: { AllowHeaders: ['Authorization'], AllowMethods: ['GET', 'HEAD', 'OPTIONS', 'POST', '*'], @@ -127,8 +126,8 @@ describe('HttpApi', () => { const stack = new Stack(); new HttpApi(stack, 'HttpApi'); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Api', { - CorsConfiguration: ABSENT, + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Api', { + CorsConfiguration: Match.absentProperty(), }); }); @@ -214,7 +213,7 @@ describe('HttpApi', () => { description: 'My Api', }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Api', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Api', { Name: 'api', ProtocolType: 'HTTP', Description: 'My Api', @@ -227,7 +226,7 @@ describe('HttpApi', () => { disableExecuteApiEndpoint: true, }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Api', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Api', { Name: 'api', ProtocolType: 'HTTP', DisableExecuteApiEndpoint: true, @@ -246,10 +245,10 @@ describe('HttpApi', () => { api.addVpcLink({ vpc: vpc2, vpcLinkName: 'Link-2' }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::VpcLink', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::VpcLink', { Name: 'Link-1', }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::VpcLink', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::VpcLink', { Name: 'Link-2', }); }); @@ -265,12 +264,12 @@ describe('HttpApi', () => { api.addVpcLink({ vpc, vpcLinkName: 'Link-2' }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::VpcLink', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::VpcLink', { Name: 'Link-1', }); - expect(stack).not.toHaveResource('AWS::ApiGatewayV2::VpcLink', { + expect(Template.fromStack(stack).findResources('AWS::ApiGatewayV2::VpcLink', { Name: 'Link-2', - }); + }).length).toEqual(0); }); test('apiEndpoint is exported', () => { @@ -292,12 +291,12 @@ describe('HttpApi', () => { authorizer, }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Api', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Api', { Name: 'api', ProtocolType: 'HTTP', }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Route', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Route', { AuthorizerId: 'auth-1234', AuthorizationType: 'JWT', }); @@ -327,7 +326,7 @@ describe('HttpApi', () => { }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::Route', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Route', { AuthorizerId: '12345', }); }); @@ -345,12 +344,12 @@ describe('HttpApi', () => { authorizationScopes: ['read:scopes'], }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Api', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Api', { Name: 'api', ProtocolType: 'HTTP', }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Route', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Route', { AuthorizerId: 'auth-1234', AuthorizationType: 'JWT', AuthorizationScopes: ['read:scopes'], @@ -393,7 +392,7 @@ describe('HttpApi', () => { integration: new DummyRouteIntegration(), }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Route', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Route', { AuthorizerId: 'auth-1234', AuthorizationType: 'JWT', AuthorizationScopes: ['read:pets'], @@ -411,7 +410,7 @@ describe('HttpApi', () => { defaultAuthorizationScopes: ['read:pets'], }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Route', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Route', { AuthorizerId: 'auth-1234', AuthorizationType: 'JWT', AuthorizationScopes: ['read:pets'], @@ -440,15 +439,15 @@ describe('HttpApi', () => { authorizer: new HttpNoneAuthorizer(), }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Route', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Route', { RouteKey: 'GET /pets', AuthorizerId: 'auth-1234', }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Route', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Route', { RouteKey: 'GET /chickens', AuthorizationType: 'NONE', - AuthorizerId: ABSENT, + AuthorizerId: Match.absentProperty(), }); }); @@ -469,8 +468,8 @@ describe('HttpApi', () => { authorizationScopes: [], }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Route', { - AuthorizationScopes: ABSENT, + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Route', { + AuthorizationScopes: Match.absentProperty(), }); }); @@ -497,12 +496,12 @@ describe('HttpApi', () => { authorizationScopes: ['read:chickens'], }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Route', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Route', { RouteKey: 'GET /pets', AuthorizationScopes: ['read:pets'], }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Route', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Route', { RouteKey: 'GET /chickens', AuthorizationScopes: ['read:chickens'], }); diff --git a/packages/@aws-cdk/aws-apigatewayv2/test/http/authorizer.test.ts b/packages/@aws-cdk/aws-apigatewayv2/test/http/authorizer.test.ts index 92c0ee0422c17..8cdca389cad00 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/test/http/authorizer.test.ts +++ b/packages/@aws-cdk/aws-apigatewayv2/test/http/authorizer.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import { Stack } from '@aws-cdk/core'; import { HttpApi, HttpAuthorizer, HttpAuthorizerType, @@ -17,7 +17,7 @@ describe('HttpAuthorizer', () => { jwtIssuer: 'issuer', }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Authorizer', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Authorizer', { ApiId: stack.resolve(httpApi.apiId), Name: 'HttpAuthorizer', AuthorizerType: 'JWT', @@ -38,7 +38,7 @@ describe('HttpAuthorizer', () => { jwtIssuer: 'issuer', }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Authorizer', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Authorizer', { Name: 'my-authorizer', }); }); @@ -56,7 +56,7 @@ describe('HttpAuthorizer', () => { jwtIssuer: 'issuer', }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Authorizer', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Authorizer', { JwtConfiguration: { Audience: ['audience.1', 'audience.2'], Issuer: 'issuer', @@ -77,7 +77,7 @@ describe('HttpAuthorizer', () => { authorizerUri: 'arn:cool-lambda-arn', }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Authorizer', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Authorizer', { AuthorizerType: 'REQUEST', AuthorizerPayloadFormatVersion: '2.0', AuthorizerUri: 'arn:cool-lambda-arn', diff --git a/packages/@aws-cdk/aws-apigatewayv2/test/http/domain-name.test.ts b/packages/@aws-cdk/aws-apigatewayv2/test/http/domain-name.test.ts index c0074ac464d63..dc64fbf5bf7c9 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/test/http/domain-name.test.ts +++ b/packages/@aws-cdk/aws-apigatewayv2/test/http/domain-name.test.ts @@ -1,5 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; -// import { expect, haveResource, haveResourceLike } from '@aws-cdk/assert-internal'; +import { Template } from '@aws-cdk/assertions'; import { Certificate } from '@aws-cdk/aws-certificatemanager'; import { Stack } from '@aws-cdk/core'; import { DomainName, HttpApi } from '../../lib'; @@ -19,7 +18,7 @@ describe('DomainName', () => { }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::DomainName', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::DomainName', { DomainName: 'example.com', DomainNameConfigurations: [ { @@ -74,7 +73,7 @@ describe('DomainName', () => { }, }); - expect(stack).toHaveResourceLike('AWS::ApiGatewayV2::DomainName', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::DomainName', { DomainName: 'example.com', DomainNameConfigurations: [ { @@ -83,7 +82,7 @@ describe('DomainName', () => { }, ], }); - expect(stack).toHaveResourceLike('AWS::ApiGatewayV2::ApiMapping', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::ApiMapping', { ApiId: { Ref: 'ApiF70053CD', }, @@ -110,7 +109,7 @@ describe('DomainName', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::ApiGatewayV2::DomainName', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::DomainName', { DomainName: 'example.com', DomainNameConfigurations: [ { @@ -120,7 +119,7 @@ describe('DomainName', () => { ], }); - expect(stack).toHaveResourceLike('AWS::ApiGatewayV2::ApiMapping', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::ApiMapping', { ApiId: { Ref: 'ApiF70053CD', }, diff --git a/packages/@aws-cdk/aws-apigatewayv2/test/http/route.test.ts b/packages/@aws-cdk/aws-apigatewayv2/test/http/route.test.ts index 748ec8cb68d41..9f64cfdfbd123 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/test/http/route.test.ts +++ b/packages/@aws-cdk/aws-apigatewayv2/test/http/route.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import { Stack, App } from '@aws-cdk/core'; import { HttpApi, HttpAuthorizer, HttpAuthorizerType, HttpConnectionType, HttpIntegrationType, HttpMethod, HttpRoute, HttpRouteAuthorizerBindOptions, @@ -16,7 +16,7 @@ describe('HttpRoute', () => { routeKey: HttpRouteKey.with('/books', HttpMethod.GET), }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Route', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Route', { ApiId: stack.resolve(httpApi.apiId), RouteKey: 'GET /books', Target: { @@ -33,7 +33,7 @@ describe('HttpRoute', () => { AuthorizationType: 'NONE', }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Integration', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Integration', { ApiId: stack.resolve(httpApi.apiId), }); }); @@ -48,7 +48,7 @@ describe('HttpRoute', () => { routeKey: HttpRouteKey.with('/books', HttpMethod.GET), }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Integration', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Integration', { ApiId: stack.resolve(httpApi.apiId), IntegrationType: 'HTTP_PROXY', PayloadFormatVersion: '2.0', @@ -75,7 +75,7 @@ describe('HttpRoute', () => { }); // THEN - expect(stack).toCountResources('AWS::ApiGatewayV2::Integration', 1); + Template.fromStack(stack).resourceCountIs('AWS::ApiGatewayV2::Integration', 1); }); test('integration can be used across HttpApis', () => { @@ -112,8 +112,8 @@ describe('HttpRoute', () => { }); // THEN - expect(stack1).toCountResources('AWS::ApiGatewayV2::Integration', 1); - expect(stack2).toCountResources('AWS::ApiGatewayV2::Integration', 1); + Template.fromStack(stack1).resourceCountIs('AWS::ApiGatewayV2::Integration', 1); + Template.fromStack(stack2).resourceCountIs('AWS::ApiGatewayV2::Integration', 1); }); test('route defined in a separate stack does not create cycles', () => { @@ -133,8 +133,8 @@ describe('HttpRoute', () => { }); // THEN - expect(stack1).toCountResources('AWS::ApiGatewayV2::Integration', 0); - expect(stack2).toCountResources('AWS::ApiGatewayV2::Integration', 1); + Template.fromStack(stack1).resourceCountIs('AWS::ApiGatewayV2::Integration', 0); + Template.fromStack(stack2).resourceCountIs('AWS::ApiGatewayV2::Integration', 1); }); test('throws when path not start with /', () => { @@ -186,7 +186,7 @@ describe('HttpRoute', () => { }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::Integration', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Integration', { IntegrationType: 'HTTP_PROXY', ConnectionId: 'some-connection-id', ConnectionType: 'VPC_LINK', @@ -198,7 +198,7 @@ describe('HttpRoute', () => { }, }); - expect(stack).not.toHaveResource('AWS::ApiGatewayV2::VpcLink'); + Template.fromStack(stack).resourceCountIs('AWS::ApiGatewayV2::VpcLink', 0); }); test('can create route with an authorizer attached', () => { @@ -214,16 +214,16 @@ describe('HttpRoute', () => { authorizer, }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Integration', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Integration', { ApiId: stack.resolve(httpApi.apiId), IntegrationType: 'HTTP_PROXY', PayloadFormatVersion: '2.0', IntegrationUri: 'some-uri', }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Authorizer'); + Template.fromStack(stack).resourceCountIs('AWS::ApiGatewayV2::Authorizer', 1); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Route', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Route', { AuthorizerId: stack.resolve(authorizer.bind({ scope: stack, route: route }).authorizerId), AuthorizationType: 'JWT', }); @@ -243,7 +243,7 @@ describe('HttpRoute', () => { authorizationScopes: ['read:books'], }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Route', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Route', { AuthorizationScopes: ['read:books'], }); }); diff --git a/packages/@aws-cdk/aws-apigatewayv2/test/http/stage.test.ts b/packages/@aws-cdk/aws-apigatewayv2/test/http/stage.test.ts index e3758183c68ff..c56c2ded5d48b 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/test/http/stage.test.ts +++ b/packages/@aws-cdk/aws-apigatewayv2/test/http/stage.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import { Metric } from '@aws-cdk/aws-cloudwatch'; import { Stack } from '@aws-cdk/core'; import { HttpApi, HttpStage } from '../../lib'; @@ -15,7 +15,7 @@ describe('HttpStage', () => { httpApi: api, }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Stage', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Stage', { ApiId: stack.resolve(api.apiId), StageName: '$default', }); diff --git a/packages/@aws-cdk/aws-apigatewayv2/test/http/vpc-link.test.ts b/packages/@aws-cdk/aws-apigatewayv2/test/http/vpc-link.test.ts index 134c70b653ce6..99f7d480da63b 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/test/http/vpc-link.test.ts +++ b/packages/@aws-cdk/aws-apigatewayv2/test/http/vpc-link.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import * as ec2 from '@aws-cdk/aws-ec2'; import { Stack } from '@aws-cdk/core'; import { VpcLink } from '../../lib'; @@ -16,7 +16,7 @@ describe('VpcLink', () => { }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::VpcLink', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::VpcLink', { Name: 'MyLink', SubnetIds: [ { @@ -56,7 +56,7 @@ describe('VpcLink', () => { }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::VpcLink', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::VpcLink', { Name: 'VpcLink', SubnetIds: [ { @@ -104,7 +104,7 @@ describe('VpcLink', () => { vpcLink.addSubnets(subnet); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::VpcLink', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::VpcLink', { Name: 'VpcLink', SubnetIds: [ { @@ -136,7 +136,7 @@ describe('VpcLink', () => { vpcLink.addSecurityGroups(sg1, sg2, sg3); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::VpcLink', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::VpcLink', { Name: 'VpcLink', SubnetIds: [ { @@ -183,6 +183,6 @@ describe('VpcLink', () => { }); // THEN - expect(stack).not.toHaveResource('AWS::ApiGatewayV2::VpcLink'); + Template.fromStack(stack).resourceCountIs('AWS::ApiGatewayV2::VpcLink', 0); }); }); diff --git a/packages/@aws-cdk/aws-apigatewayv2/test/websocket/api.test.ts b/packages/@aws-cdk/aws-apigatewayv2/test/websocket/api.test.ts index 8a387941cad6f..959555a5c2b7a 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/test/websocket/api.test.ts +++ b/packages/@aws-cdk/aws-apigatewayv2/test/websocket/api.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import { Stack } from '@aws-cdk/core'; import { IWebSocketRouteIntegration, WebSocketApi, WebSocketIntegrationType, @@ -14,14 +14,14 @@ describe('WebSocketApi', () => { new WebSocketApi(stack, 'api'); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::Api', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Api', { Name: 'api', ProtocolType: 'WEBSOCKET', }); - expect(stack).not.toHaveResource('AWS::ApiGatewayV2::Stage'); - expect(stack).not.toHaveResource('AWS::ApiGatewayV2::Route'); - expect(stack).not.toHaveResource('AWS::ApiGatewayV2::Integration'); + Template.fromStack(stack).resourceCountIs('AWS::ApiGatewayV2::Stage', 0); + Template.fromStack(stack).resourceCountIs('AWS::ApiGatewayV2::Route', 0); + Template.fromStack(stack).resourceCountIs('AWS::ApiGatewayV2::Integration', 0); }); test('addRoute: adds a route with passed key', () => { @@ -33,7 +33,7 @@ describe('WebSocketApi', () => { api.addRoute('myroute', { integration: new DummyIntegration() }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::Route', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Route', { ApiId: stack.resolve(api.apiId), RouteKey: 'myroute', }); @@ -47,7 +47,7 @@ describe('WebSocketApi', () => { }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::Route', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Route', { ApiId: stack.resolve(api.apiId), RouteKey: '$connect', }); @@ -61,7 +61,7 @@ describe('WebSocketApi', () => { }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::Route', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Route', { ApiId: stack.resolve(api.apiId), RouteKey: '$disconnect', }); @@ -75,7 +75,7 @@ describe('WebSocketApi', () => { }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::Route', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Route', { ApiId: stack.resolve(api.apiId), RouteKey: '$default', }); diff --git a/packages/@aws-cdk/aws-apigatewayv2/test/websocket/route.test.ts b/packages/@aws-cdk/aws-apigatewayv2/test/websocket/route.test.ts index ae73fd7e6cba0..07eadc5300a85 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/test/websocket/route.test.ts +++ b/packages/@aws-cdk/aws-apigatewayv2/test/websocket/route.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import { Stack } from '@aws-cdk/core'; import { IWebSocketRouteIntegration, WebSocketApi, WebSocketIntegrationType, @@ -19,7 +19,7 @@ describe('WebSocketRoute', () => { }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::Route', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Route', { ApiId: stack.resolve(webSocketApi.apiId), RouteKey: 'message', Target: { @@ -35,7 +35,7 @@ describe('WebSocketRoute', () => { }, }); - expect(stack).toHaveResource('AWS::ApiGatewayV2::Integration', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Integration', { ApiId: stack.resolve(webSocketApi.apiId), IntegrationType: 'AWS_PROXY', IntegrationUri: 'some-uri', diff --git a/packages/@aws-cdk/aws-apigatewayv2/test/websocket/stage.test.ts b/packages/@aws-cdk/aws-apigatewayv2/test/websocket/stage.test.ts index bec3e34e5d4fb..d942eb6dc7a4e 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/test/websocket/stage.test.ts +++ b/packages/@aws-cdk/aws-apigatewayv2/test/websocket/stage.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import { Stack } from '@aws-cdk/core'; import { WebSocketApi, WebSocketStage } from '../../lib'; @@ -15,7 +15,7 @@ describe('WebSocketStage', () => { }); // THEN - expect(stack).toHaveResource('AWS::ApiGatewayV2::Stage', { + Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Stage', { ApiId: stack.resolve(api.apiId), StageName: 'dev', }); diff --git a/packages/@aws-cdk/aws-appsync/package.json b/packages/@aws-cdk/aws-appsync/package.json index 13267c04844cc..bc2dc7796af93 100644 --- a/packages/@aws-cdk/aws-appsync/package.json +++ b/packages/@aws-cdk/aws-appsync/package.json @@ -73,14 +73,14 @@ }, "license": "Apache-2.0", "devDependencies": { + "@aws-cdk/assertions": "0.0.0", + "@aws-cdk/aws-stepfunctions": "0.0.0", "@types/jest": "^26.0.24", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "cfn2ts": "0.0.0", "jest": "^26.6.3", - "pkglint": "0.0.0", - "@aws-cdk/aws-stepfunctions": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "pkglint": "0.0.0" }, "dependencies": { "@aws-cdk/aws-cognito": "0.0.0", diff --git a/packages/@aws-cdk/aws-appsync/test/appsync-auth.test.ts b/packages/@aws-cdk/aws-appsync/test/appsync-auth.test.ts index c0d7ce0ac8796..a137e54b0423f 100644 --- a/packages/@aws-cdk/aws-appsync/test/appsync-auth.test.ts +++ b/packages/@aws-cdk/aws-appsync/test/appsync-auth.test.ts @@ -1,5 +1,5 @@ -import '@aws-cdk/assert-internal/jest'; import * as path from 'path'; +import { Template } from '@aws-cdk/assertions'; import * as cognito from '@aws-cdk/aws-cognito'; import * as cdk from '@aws-cdk/core'; import * as appsync from '../lib'; @@ -19,7 +19,7 @@ describe('AppSync API Key Authorization', () => { }); // THEN - expect(stack).toHaveResource('AWS::AppSync::ApiKey'); + Template.fromStack(stack).resourceCountIs('AWS::AppSync::ApiKey', 1); }); test('AppSync creates api key from additionalAuthorizationModes', () => { @@ -36,7 +36,7 @@ describe('AppSync API Key Authorization', () => { }); // THEN - expect(stack).toHaveResource('AWS::AppSync::ApiKey'); + Template.fromStack(stack).resourceCountIs('AWS::AppSync::ApiKey', 1); }); test('AppSync does not create unspecified api key from additionalAuthorizationModes', () => { @@ -50,7 +50,7 @@ describe('AppSync API Key Authorization', () => { }); // THEN - expect(stack).not.toHaveResource('AWS::AppSync::ApiKey'); + Template.fromStack(stack).resourceCountIs('AWS::AppSync::ApiKey', 0); }); test('appsync does not create unspecified api key with empty additionalAuthorizationModes', () => { @@ -65,7 +65,7 @@ describe('AppSync API Key Authorization', () => { }); // THEN - expect(stack).not.toHaveResource('AWS::AppSync::ApiKey'); + Template.fromStack(stack).resourceCountIs('AWS::AppSync::ApiKey', 0); }); test('appsync creates configured api key with additionalAuthorizationModes', () => { @@ -83,7 +83,7 @@ describe('AppSync API Key Authorization', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::ApiKey', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::ApiKey', { Description: 'Custom Description', }); }); @@ -105,7 +105,7 @@ describe('AppSync API Key Authorization', () => { }, }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::ApiKey', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::ApiKey', { ApiId: { 'Fn::GetAtt': ['API62EA1CFF', 'ApiId'] }, Expires: expirationDate, }); @@ -174,7 +174,7 @@ describe('AppSync API Key Authorization', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::ApiKey', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::ApiKey', { Description: 'Custom Description', }); }); @@ -240,7 +240,7 @@ describe('AppSync IAM Authorization', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLApi', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLApi', { AuthenticationType: 'AWS_IAM', }); }); @@ -256,7 +256,7 @@ describe('AppSync IAM Authorization', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLApi', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLApi', { AdditionalAuthenticationProviders: [{ AuthenticationType: 'AWS_IAM' }], }); }); @@ -311,7 +311,7 @@ describe('AppSync User Pool Authorization', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLApi', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLApi', { AuthenticationType: 'AMAZON_COGNITO_USER_POOLS', UserPoolConfig: { AwsRegion: { Ref: 'AWS::Region' }, @@ -339,7 +339,7 @@ describe('AppSync User Pool Authorization', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLApi', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLApi', { AuthenticationType: 'AMAZON_COGNITO_USER_POOLS', UserPoolConfig: { AwsRegion: { Ref: 'AWS::Region' }, @@ -364,7 +364,7 @@ describe('AppSync User Pool Authorization', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLApi', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLApi', { AdditionalAuthenticationProviders: [{ AuthenticationType: 'AMAZON_COGNITO_USER_POOLS', UserPoolConfig: { @@ -393,7 +393,7 @@ describe('AppSync User Pool Authorization', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLApi', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLApi', { AdditionalAuthenticationProviders: [{ AuthenticationType: 'AMAZON_COGNITO_USER_POOLS', UserPoolConfig: { @@ -433,7 +433,7 @@ describe('AppSync User Pool Authorization', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLApi', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLApi', { AuthenticationType: 'AMAZON_COGNITO_USER_POOLS', UserPoolConfig: { AwsRegion: { Ref: 'AWS::Region' }, @@ -476,7 +476,7 @@ describe('AppSync OIDC Authorization', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLApi', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLApi', { AuthenticationType: 'OPENID_CONNECT', OpenIDConnectConfig: { Issuer: 'test', @@ -503,7 +503,7 @@ describe('AppSync OIDC Authorization', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLApi', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLApi', { AuthenticationType: 'OPENID_CONNECT', OpenIDConnectConfig: { AuthTTL: 1, @@ -528,7 +528,7 @@ describe('AppSync OIDC Authorization', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLApi', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLApi', { AdditionalAuthenticationProviders: [{ AuthenticationType: 'OPENID_CONNECT', OpenIDConnectConfig: { @@ -557,7 +557,7 @@ describe('AppSync OIDC Authorization', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLApi', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLApi', { AdditionalAuthenticationProviders: [{ AuthenticationType: 'OPENID_CONNECT', OpenIDConnectConfig: { @@ -604,7 +604,7 @@ describe('AppSync OIDC Authorization', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLApi', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLApi', { AuthenticationType: 'OPENID_CONNECT', OpenIDConnectConfig: { Issuer: 'test' }, AdditionalAuthenticationProviders: [ diff --git a/packages/@aws-cdk/aws-appsync/test/appsync-code-first.test.ts b/packages/@aws-cdk/aws-appsync/test/appsync-code-first.test.ts index 5abe04434496a..d904186f4f07b 100644 --- a/packages/@aws-cdk/aws-appsync/test/appsync-code-first.test.ts +++ b/packages/@aws-cdk/aws-appsync/test/appsync-code-first.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import * as cdk from '@aws-cdk/core'; import * as appsync from '../lib'; import * as t from './scalar-type-defintions'; @@ -34,7 +34,7 @@ describe('code-first implementation through GraphQL Api functions`', () => { const out = 'interface Test {\n id: ID\n lid: [ID]\n rid: ID!\n rlid: [ID]!\n rlrid: [ID!]!\n dupid: [ID!]!\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -55,7 +55,7 @@ describe('code-first implementation through GraphQL Api functions`', () => { const out = 'type Test {\n id: ID\n lid: [ID]\n rid: ID!\n rlid: [ID]!\n rlrid: [ID!]!\n dupid: [ID!]!\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -75,7 +75,7 @@ describe('code-first implementation through GraphQL Api functions`', () => { const out = 'type Test {\n id: ID\n lid: [ID]\n rid: ID!\n rlid: [ID]!\n rlrid: [ID!]!\n dupid: [ID!]!\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -96,7 +96,7 @@ describe('code-first implementation through GraphQL Api functions`', () => { const out = 'type Test {\n id: ID\n lid: [ID]\n rid: ID!\n rlid: [ID]!\n rlrid: [ID!]!\n dupid: [ID!]!\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -116,7 +116,7 @@ describe('code-first implementation through GraphQL Api functions`', () => { const out = 'interface Test {\n id: ID\n lid: [ID]\n rid: ID!\n rlid: [ID]!\n rlrid: [ID!]!\n dupid: [ID!]!\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -137,7 +137,7 @@ describe('code-first implementation through GraphQL Api functions`', () => { const out = 'interface Test {\n id: ID\n lid: [ID]\n rid: ID!\n rlid: [ID]!\n rlrid: [ID!]!\n dupid: [ID!]!\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -171,7 +171,7 @@ describe('code-first implementation through Schema functions`', () => { const out = 'interface Test {\n id: ID\n lid: [ID]\n rid: ID!\n rlid: [ID]!\n rlrid: [ID!]!\n dupid: [ID!]!\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -197,7 +197,7 @@ describe('code-first implementation through Schema functions`', () => { const out = 'type Test {\n id: ID\n lid: [ID]\n rid: ID!\n rlid: [ID]!\n rlrid: [ID!]!\n dupid: [ID!]!\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -223,7 +223,7 @@ describe('code-first implementation through Schema functions`', () => { const out = 'type Test {\n id: ID\n lid: [ID]\n rid: ID!\n rlid: [ID]!\n rlrid: [ID!]!\n dupid: [ID!]!\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -248,7 +248,7 @@ describe('code-first implementation through Schema functions`', () => { const out = 'type Test {\n id: ID\n lid: [ID]\n rid: ID!\n rlid: [ID]!\n rlrid: [ID!]!\n dupid: [ID!]!\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -272,7 +272,7 @@ describe('code-first implementation through Schema functions`', () => { const out = 'interface Test {\n id: ID\n lid: [ID]\n rid: ID!\n rlid: [ID]!\n rlrid: [ID!]!\n dupid: [ID!]!\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -297,7 +297,7 @@ describe('code-first implementation through Schema functions`', () => { const out = 'interface Test {\n id: ID\n lid: [ID]\n rid: ID!\n rlid: [ID]!\n rlrid: [ID!]!\n dupid: [ID!]!\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); diff --git a/packages/@aws-cdk/aws-appsync/test/appsync-directives.test.ts b/packages/@aws-cdk/aws-appsync/test/appsync-directives.test.ts index 1d4d211ac8289..de2ce5d864813 100644 --- a/packages/@aws-cdk/aws-appsync/test/appsync-directives.test.ts +++ b/packages/@aws-cdk/aws-appsync/test/appsync-directives.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import * as cognito from '@aws-cdk/aws-cognito'; import * as cdk from '@aws-cdk/core'; import * as appsync from '../lib'; @@ -85,7 +85,7 @@ const testObjectType = (IApi: appsync.GraphqlApi, directives: appsync.Directive[ directives: directives, })); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `type Test ${tag} {\n field: String\n ${tag}\n rfield: String\n ${tag}\n}\n`, }); }; @@ -100,7 +100,7 @@ const testInterfaceType = (IApi: appsync.GraphqlApi, directives: appsync.Directi directives: directives, })); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `interface Test ${tag} {\n field: String\n ${tag}\n rfield: String\n ${tag}\n}\n`, }); }; diff --git a/packages/@aws-cdk/aws-appsync/test/appsync-dynamodb.test.ts b/packages/@aws-cdk/aws-appsync/test/appsync-dynamodb.test.ts index ffc36ddabd276..657eecd9f9064 100644 --- a/packages/@aws-cdk/aws-appsync/test/appsync-dynamodb.test.ts +++ b/packages/@aws-cdk/aws-appsync/test/appsync-dynamodb.test.ts @@ -1,5 +1,5 @@ -import '@aws-cdk/assert-internal/jest'; import * as path from 'path'; +import { Template } from '@aws-cdk/assertions'; import * as db from '@aws-cdk/aws-dynamodb'; import * as cdk from '@aws-cdk/core'; import * as appsync from '../lib'; @@ -36,7 +36,7 @@ describe('DynamoDb Data Source configuration', () => { api.addDynamoDbDataSource('ds', table); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'AMAZON_DYNAMODB', Name: 'ds', }); @@ -49,7 +49,7 @@ describe('DynamoDb Data Source configuration', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'AMAZON_DYNAMODB', Name: 'custom', }); @@ -63,7 +63,7 @@ describe('DynamoDb Data Source configuration', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'AMAZON_DYNAMODB', Name: 'custom', Description: 'custom description', @@ -166,7 +166,7 @@ describe('adding DynamoDb data source from imported api', () => { importedApi.addDynamoDbDataSource('ds', table); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'AMAZON_DYNAMODB', ApiId: { 'Fn::GetAtt': ['baseApiCDA4D43A', 'ApiId'] }, }); @@ -181,7 +181,7 @@ describe('adding DynamoDb data source from imported api', () => { importedApi.addDynamoDbDataSource('ds', table); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'AMAZON_DYNAMODB', ApiId: { 'Fn::GetAtt': ['baseApiCDA4D43A', 'ApiId'] }, }); diff --git a/packages/@aws-cdk/aws-appsync/test/appsync-elasticsearch.test.ts b/packages/@aws-cdk/aws-appsync/test/appsync-elasticsearch.test.ts index 1a974f982b61f..89199d65ca629 100644 --- a/packages/@aws-cdk/aws-appsync/test/appsync-elasticsearch.test.ts +++ b/packages/@aws-cdk/aws-appsync/test/appsync-elasticsearch.test.ts @@ -1,5 +1,5 @@ -import '@aws-cdk/assert-internal/jest'; import * as path from 'path'; +import { Template } from '@aws-cdk/assertions'; import * as es from '@aws-cdk/aws-elasticsearch'; import * as cdk from '@aws-cdk/core'; import * as appsync from '../lib'; @@ -25,7 +25,7 @@ describe('Elasticsearch Data Source Configuration', () => { api.addElasticsearchDataSource('ds', domain); // THEN - expect(stack).toHaveResourceLike('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { PolicyDocument: { Version: '2012-10-17', Statement: [{ @@ -56,7 +56,7 @@ describe('Elasticsearch Data Source Configuration', () => { api.addElasticsearchDataSource('ds', domain); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { ElasticsearchConfig: { Endpoint: { 'Fn::Join': ['', ['https://', { @@ -72,7 +72,7 @@ describe('Elasticsearch Data Source Configuration', () => { api.addElasticsearchDataSource('ds', domain); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'AMAZON_ELASTICSEARCH', Name: 'ds', }); @@ -85,7 +85,7 @@ describe('Elasticsearch Data Source Configuration', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'AMAZON_ELASTICSEARCH', Name: 'custom', }); @@ -99,7 +99,7 @@ describe('Elasticsearch Data Source Configuration', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'AMAZON_ELASTICSEARCH', Name: 'custom', Description: 'custom description', @@ -127,7 +127,7 @@ describe('adding elasticsearch data source from imported api', () => { importedApi.addElasticsearchDataSource('ds', domain); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'AMAZON_ELASTICSEARCH', ApiId: { 'Fn::GetAtt': ['baseApiCDA4D43A', 'ApiId'] }, }); @@ -142,7 +142,7 @@ describe('adding elasticsearch data source from imported api', () => { importedApi.addElasticsearchDataSource('ds', domain); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'AMAZON_ELASTICSEARCH', ApiId: { 'Fn::GetAtt': ['baseApiCDA4D43A', 'ApiId'] }, }); diff --git a/packages/@aws-cdk/aws-appsync/test/appsync-enum-type.test.ts b/packages/@aws-cdk/aws-appsync/test/appsync-enum-type.test.ts index 82551e354d1a0..a04e9a5c89d82 100644 --- a/packages/@aws-cdk/aws-appsync/test/appsync-enum-type.test.ts +++ b/packages/@aws-cdk/aws-appsync/test/appsync-enum-type.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import * as cdk from '@aws-cdk/core'; import * as appsync from '../lib'; import * as t from './scalar-type-defintions'; @@ -23,10 +23,10 @@ describe('testing Enum Type properties', () => { api.addType(test); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); - expect(stack).not.toHaveResource('AWS::AppSync::Resolver'); + Template.fromStack(stack).resourceCountIs('AWS::AppSync::Resolver', 0); }); test('EnumType can addField', () => { @@ -38,7 +38,7 @@ describe('testing Enum Type properties', () => { test.addField({ fieldName: 'test3' }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -57,7 +57,7 @@ describe('testing Enum Type properties', () => { const obj = 'type Test2 {\n enum: Test\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}${obj}`, }); }); diff --git a/packages/@aws-cdk/aws-appsync/test/appsync-grant.test.ts b/packages/@aws-cdk/aws-appsync/test/appsync-grant.test.ts index 904c19b7dafd6..fb23df6e8ec74 100644 --- a/packages/@aws-cdk/aws-appsync/test/appsync-grant.test.ts +++ b/packages/@aws-cdk/aws-appsync/test/appsync-grant.test.ts @@ -1,5 +1,5 @@ import { join } from 'path'; -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import * as iam from '@aws-cdk/aws-iam'; import * as cdk from '@aws-cdk/core'; import * as appsync from '../lib'; @@ -38,11 +38,12 @@ describe('grant Permissions', () => { api.grant(role, appsync.IamResource.custom('types/Mutation/fields/addTest'), 'appsync:GraphQL'); // THEN - expect(stack).toHaveResourceLike('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { PolicyDocument: { Statement: [ { Action: 'appsync:GraphQL', + Effect: 'Allow', Resource: { 'Fn::Join': ['', [ 'arn:', @@ -67,11 +68,12 @@ describe('grant Permissions', () => { api.grant(role, appsync.IamResource.ofType('Mutation'), 'appsync:GraphQL'); // THEN - expect(stack).toHaveResourceLike('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { PolicyDocument: { Statement: [ { Action: 'appsync:GraphQL', + Effect: 'Allow', Resource: { 'Fn::Join': ['', [ 'arn:', @@ -96,11 +98,12 @@ describe('grant Permissions', () => { api.grant(role, appsync.IamResource.ofType('Mutation', 'addTest'), 'appsync:GraphQL'); // THEN - expect(stack).toHaveResourceLike('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { PolicyDocument: { Statement: [ { Action: 'appsync:GraphQL', + Effect: 'Allow', Resource: { 'Fn::Join': ['', [ 'arn:', @@ -125,11 +128,12 @@ describe('grant Permissions', () => { api.grant(role, appsync.IamResource.all(), 'appsync:GraphQL'); // THEN - expect(stack).toHaveResourceLike('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { PolicyDocument: { Statement: [ { Action: 'appsync:GraphQL', + Effect: 'Allow', Resource: { 'Fn::Join': ['', [ 'arn:', @@ -154,11 +158,12 @@ describe('grant Permissions', () => { api.grant(role, appsync.IamResource.custom('I', 'am', 'custom'), 'appsync:GraphQL'); // THEN - expect(stack).toHaveResourceLike('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { PolicyDocument: { Statement: [ { Action: 'appsync:GraphQL', + Effect: 'Allow', Resource: [ { 'Fn::Join': ['', [ @@ -211,11 +216,12 @@ describe('grant Permissions', () => { api.grant(role, appsync.IamResource.ofType('I', 'am', 'custom'), 'appsync:GraphQL'); // THEN - expect(stack).toHaveResourceLike('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { PolicyDocument: { Statement: [ { Action: 'appsync:GraphQL', + Effect: 'Allow', Resource: [ { 'Fn::Join': ['', [ @@ -258,11 +264,12 @@ describe('grantMutation Permissions', () => { api.grantMutation(role); // THEN - expect(stack).toHaveResourceLike('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { PolicyDocument: { Statement: [ { Action: 'appsync:GraphQL', + Effect: 'Allow', Resource: { 'Fn::Join': ['', [ 'arn:', @@ -287,11 +294,12 @@ describe('grantMutation Permissions', () => { api.grantMutation(role, 'addTest'); // THEN - expect(stack).toHaveResourceLike('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { PolicyDocument: { Statement: [ { Action: 'appsync:GraphQL', + Effect: 'Allow', Resource: { 'Fn::Join': ['', [ 'arn:', @@ -316,11 +324,12 @@ describe('grantMutation Permissions', () => { api.grantMutation(role, 'addTest', 'removeTest'); // THEN - expect(stack).toHaveResourceLike('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { PolicyDocument: { Statement: [ { Action: 'appsync:GraphQL', + Effect: 'Allow', Resource: [ { 'Fn::Join': ['', [ @@ -363,11 +372,12 @@ describe('grantQuery Permissions', () => { api.grantQuery(role); // THEN - expect(stack).toHaveResourceLike('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { PolicyDocument: { Statement: [ { Action: 'appsync:GraphQL', + Effect: 'Allow', Resource: { 'Fn::Join': ['', [ 'arn:', @@ -392,11 +402,12 @@ describe('grantQuery Permissions', () => { api.grantQuery(role, 'getTest'); // THEN - expect(stack).toHaveResourceLike('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { PolicyDocument: { Statement: [ { Action: 'appsync:GraphQL', + Effect: 'Allow', Resource: { 'Fn::Join': ['', [ 'arn:', @@ -421,11 +432,12 @@ describe('grantQuery Permissions', () => { api.grantQuery(role, 'getTests', 'getTest'); // THEN - expect(stack).toHaveResourceLike('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { PolicyDocument: { Statement: [ { Action: 'appsync:GraphQL', + Effect: 'Allow', Resource: [ { 'Fn::Join': ['', [ @@ -468,11 +480,12 @@ describe('grantSubscription Permissions', () => { api.grantSubscription(role); // THEN - expect(stack).toHaveResourceLike('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { PolicyDocument: { Statement: [ { Action: 'appsync:GraphQL', + Effect: 'Allow', Resource: { 'Fn::Join': ['', [ 'arn:', @@ -496,11 +509,12 @@ describe('grantSubscription Permissions', () => { api.grantSubscription(role, 'subscribe'); // THEN - expect(stack).toHaveResourceLike('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { PolicyDocument: { Statement: [ { Action: 'appsync:GraphQL', + Effect: 'Allow', Resource: { 'Fn::Join': ['', [ 'arn:', @@ -525,11 +539,12 @@ describe('grantSubscription Permissions', () => { api.grantSubscription(role, 'subscribe', 'custom'); // THEN - expect(stack).toHaveResourceLike('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { PolicyDocument: { Statement: [ { Action: 'appsync:GraphQL', + Effect: 'Allow', Resource: [ { 'Fn::Join': ['', [ diff --git a/packages/@aws-cdk/aws-appsync/test/appsync-http.test.ts b/packages/@aws-cdk/aws-appsync/test/appsync-http.test.ts index 8023412c78a55..2f380b028c592 100644 --- a/packages/@aws-cdk/aws-appsync/test/appsync-http.test.ts +++ b/packages/@aws-cdk/aws-appsync/test/appsync-http.test.ts @@ -1,5 +1,5 @@ -import '@aws-cdk/assert-internal/jest'; import * as path from 'path'; +import { Template } from '@aws-cdk/assertions'; import * as sfn from '@aws-cdk/aws-stepfunctions'; import * as cdk from '@aws-cdk/core'; import * as appsync from '../lib'; @@ -24,7 +24,7 @@ describe('Http Data Source configuration', () => { api.addHttpDataSource('ds', endpoint); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'HTTP', Name: 'ds', }); @@ -37,7 +37,7 @@ describe('Http Data Source configuration', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'HTTP', Name: 'custom', }); @@ -51,7 +51,7 @@ describe('Http Data Source configuration', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'HTTP', Name: 'custom', Description: 'custom description', @@ -70,7 +70,7 @@ describe('Http Data Source configuration', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'HTTP', Name: 'custom', Description: 'custom description', @@ -103,7 +103,7 @@ describe('Http Data Source configuration', () => { // THEN - expect(stack).toHaveResourceLike('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { PolicyDocument: { Statement: [ { @@ -176,7 +176,7 @@ describe('adding http data source from imported api', () => { importedApi.addHttpDataSource('ds', endpoint); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'HTTP', ApiId: { 'Fn::GetAtt': ['baseApiCDA4D43A', 'ApiId'] }, }); @@ -191,7 +191,7 @@ describe('adding http data source from imported api', () => { importedApi.addHttpDataSource('ds', endpoint); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'HTTP', ApiId: { 'Fn::GetAtt': ['baseApiCDA4D43A', 'ApiId'] }, }); diff --git a/packages/@aws-cdk/aws-appsync/test/appsync-input-types.test.ts b/packages/@aws-cdk/aws-appsync/test/appsync-input-types.test.ts index bfc391aeaf0f3..f58196e43cd31 100644 --- a/packages/@aws-cdk/aws-appsync/test/appsync-input-types.test.ts +++ b/packages/@aws-cdk/aws-appsync/test/appsync-input-types.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import * as cdk from '@aws-cdk/core'; import * as appsync from '../lib'; import * as t from './scalar-type-defintions'; @@ -23,10 +23,10 @@ describe('testing Input Type properties', () => { api.addType(test); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); - expect(stack).not.toHaveResource('AWS::AppSync::Resolver'); + Template.fromStack(stack).resourceCountIs('AWS::AppSync::Resolver', 0); }); test('InputType can addField', () => { @@ -36,7 +36,7 @@ describe('testing Input Type properties', () => { test.addField({ fieldName: 'test', field: t.string }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -88,7 +88,7 @@ describe('testing Input Type properties', () => { const obj = 'type Test2 {\n input: Test\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}${obj}`, }); }); diff --git a/packages/@aws-cdk/aws-appsync/test/appsync-interface-type.test.ts b/packages/@aws-cdk/aws-appsync/test/appsync-interface-type.test.ts index 4061a2e69a0f9..f94400fab6ea3 100644 --- a/packages/@aws-cdk/aws-appsync/test/appsync-interface-type.test.ts +++ b/packages/@aws-cdk/aws-appsync/test/appsync-interface-type.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import * as cdk from '@aws-cdk/core'; import * as appsync from '../lib'; import * as t from './scalar-type-defintions'; @@ -28,7 +28,7 @@ describe('testing InterfaceType properties', () => { const out = 'interface baseTest {\n id: ID\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -46,7 +46,7 @@ describe('testing InterfaceType properties', () => { const out = 'interface baseTest {\n id: ID\n test(success: Int): String\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -65,10 +65,10 @@ describe('testing InterfaceType properties', () => { const out = 'interface baseTest {\n id: ID\n test(success: Int): String\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); - expect(stack).not.toHaveResource('AWS::AppSync::Resolver'); + Template.fromStack(stack).resourceCountIs('AWS::AppSync::Resolver', 0); }); test('Interface Type can be a Graphql Type', () => { @@ -84,7 +84,7 @@ describe('testing InterfaceType properties', () => { const out = 'type Test {\n test: baseTest\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -108,7 +108,7 @@ describe('testing InterfaceType properties', () => { const out = 'interface Test {\n test: String\n resolve: String\n @aws_api_key\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -133,10 +133,10 @@ describe('testing InterfaceType properties', () => { const out = 'interface Test {\n test: String\n resolve: String\n @aws_api_key\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); - expect(stack).not.toHaveResource('AWS::AppSync::Resolver'); + Template.fromStack(stack).resourceCountIs('AWS::AppSync::Resolver', 0); }); test('appsync fails addField with InterfaceType missing fieldName', () => { diff --git a/packages/@aws-cdk/aws-appsync/test/appsync-lambda.test.ts b/packages/@aws-cdk/aws-appsync/test/appsync-lambda.test.ts index 55c2ec0f132eb..b714b0f28cef9 100644 --- a/packages/@aws-cdk/aws-appsync/test/appsync-lambda.test.ts +++ b/packages/@aws-cdk/aws-appsync/test/appsync-lambda.test.ts @@ -1,5 +1,5 @@ -import '@aws-cdk/assert-internal/jest'; import * as path from 'path'; +import { Template } from '@aws-cdk/assertions'; import * as lambda from '@aws-cdk/aws-lambda'; import * as cdk from '@aws-cdk/core'; import * as appsync from '../lib'; @@ -31,7 +31,7 @@ describe('Lambda Data Source configuration', () => { api.addLambdaDataSource('ds', func); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'AWS_LAMBDA', Name: 'ds', }); @@ -44,7 +44,7 @@ describe('Lambda Data Source configuration', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'AWS_LAMBDA', Name: 'custom', }); @@ -58,7 +58,7 @@ describe('Lambda Data Source configuration', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'AWS_LAMBDA', Name: 'custom', Description: 'custom description', @@ -86,7 +86,7 @@ describe('Lambda Data Source configuration', () => { }); // THEN - expect(stack).toHaveResource('AWS::AppSync::Resolver'); + Template.fromStack(stack).resourceCountIs('AWS::AppSync::Resolver', 1); }); }); @@ -108,7 +108,7 @@ describe('adding lambda data source from imported api', () => { importedApi.addLambdaDataSource('ds', func); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'AWS_LAMBDA', ApiId: { 'Fn::GetAtt': ['baseApiCDA4D43A', 'ApiId'] }, }); @@ -123,7 +123,7 @@ describe('adding lambda data source from imported api', () => { importedApi.addLambdaDataSource('ds', func); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'AWS_LAMBDA', ApiId: { 'Fn::GetAtt': ['baseApiCDA4D43A', 'ApiId'] }, }); diff --git a/packages/@aws-cdk/aws-appsync/test/appsync-mapping-template.test.ts b/packages/@aws-cdk/aws-appsync/test/appsync-mapping-template.test.ts index d19b07d196b21..2259cbb4c48df 100644 --- a/packages/@aws-cdk/aws-appsync/test/appsync-mapping-template.test.ts +++ b/packages/@aws-cdk/aws-appsync/test/appsync-mapping-template.test.ts @@ -1,5 +1,5 @@ -import '@aws-cdk/assert-internal/jest'; import * as path from 'path'; +import { Template } from '@aws-cdk/assertions'; import * as lambda from '@aws-cdk/aws-lambda'; import * as cdk from '@aws-cdk/core'; import * as appsync from '../lib'; @@ -42,7 +42,7 @@ describe('Lambda Mapping Templates', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::Resolver', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::Resolver', { FieldName: 'allPosts', RequestMappingTemplate: invokeMT, }); @@ -60,7 +60,7 @@ describe('Lambda Mapping Templates', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::Resolver', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::Resolver', { FieldName: 'relatedPosts', RequestMappingTemplate: batchMT, }); diff --git a/packages/@aws-cdk/aws-appsync/test/appsync-none.test.ts b/packages/@aws-cdk/aws-appsync/test/appsync-none.test.ts index 6dc1e0ad9273f..5dec58aa5b726 100644 --- a/packages/@aws-cdk/aws-appsync/test/appsync-none.test.ts +++ b/packages/@aws-cdk/aws-appsync/test/appsync-none.test.ts @@ -1,5 +1,5 @@ -import '@aws-cdk/assert-internal/jest'; import * as path from 'path'; +import { Template } from '@aws-cdk/assertions'; import * as cdk from '@aws-cdk/core'; import * as appsync from '../lib'; @@ -21,7 +21,7 @@ describe('None Data Source configuration', () => { api.addNoneDataSource('ds'); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'NONE', Name: 'ds', }); @@ -34,7 +34,7 @@ describe('None Data Source configuration', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'NONE', Name: 'custom', }); @@ -48,7 +48,7 @@ describe('None Data Source configuration', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'NONE', Name: 'custom', Description: 'custom description', @@ -81,7 +81,7 @@ describe('adding none data source from imported api', () => { importedApi.addNoneDataSource('none'); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'NONE', ApiId: { 'Fn::GetAtt': ['baseApiCDA4D43A', 'ApiId'] }, }); @@ -96,7 +96,7 @@ describe('adding none data source from imported api', () => { importedApi.addNoneDataSource('none'); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'NONE', ApiId: { 'Fn::GetAtt': ['baseApiCDA4D43A', 'ApiId'] }, }); diff --git a/packages/@aws-cdk/aws-appsync/test/appsync-object-type.test.ts b/packages/@aws-cdk/aws-appsync/test/appsync-object-type.test.ts index 03e2bb411bbe9..4180ec9d30dad 100644 --- a/packages/@aws-cdk/aws-appsync/test/appsync-object-type.test.ts +++ b/packages/@aws-cdk/aws-appsync/test/appsync-object-type.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import * as cdk from '@aws-cdk/core'; import * as appsync from '../lib'; import * as t from './scalar-type-defintions'; @@ -36,7 +36,7 @@ describe('testing Object Type properties', () => { const out = `${gql_interface}${gql_object}`; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -65,7 +65,7 @@ describe('testing Object Type properties', () => { const out = `${gql_interface}${gql_object}`; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -87,7 +87,7 @@ describe('testing Object Type properties', () => { const out = 'type Test {\n test: baseTest\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -112,7 +112,7 @@ describe('testing Object Type properties', () => { const out = 'type Test {\n test: String\n resolve(arg: Int): String\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -137,7 +137,7 @@ describe('testing Object Type properties', () => { const out = 'type Test {\n test: String\n resolve(arg: Int): String\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -171,7 +171,7 @@ describe('testing Object Type properties', () => { api.addType(test); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::Resolver', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::Resolver', { Kind: 'PIPELINE', PipelineConfig: { Functions: [ @@ -202,10 +202,10 @@ describe('testing Object Type properties', () => { const out = 'type Test {\n test: String\n resolve(arg: Int): String\n dynamic: String\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); - expect(stack).toHaveResource('AWS::AppSync::Resolver'); + Template.fromStack(stack).resourceCountIs('AWS::AppSync::Resolver', 1); }); test('Object Type can generate Fields with Directives', () => { @@ -227,7 +227,7 @@ describe('testing Object Type properties', () => { const out = 'type Test {\n test: String\n resolve: String\n @aws_api_key\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -254,10 +254,10 @@ describe('testing Object Type properties', () => { const out = 'type Test {\n test: String\n resolve(arg: String): String\n @aws_api_key\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); - expect(stack).toHaveResource('AWS::AppSync::Resolver'); + Template.fromStack(stack).resourceCountIs('AWS::AppSync::Resolver', 1); }); test('appsync fails addField with ObjectType missing fieldName', () => { diff --git a/packages/@aws-cdk/aws-appsync/test/appsync-rds.test.ts b/packages/@aws-cdk/aws-appsync/test/appsync-rds.test.ts index 9a328b0fe65a0..cc7329344b84e 100644 --- a/packages/@aws-cdk/aws-appsync/test/appsync-rds.test.ts +++ b/packages/@aws-cdk/aws-appsync/test/appsync-rds.test.ts @@ -1,5 +1,5 @@ -import '@aws-cdk/assert-internal/jest'; import * as path from 'path'; +import { Template } from '@aws-cdk/assertions'; import { Vpc, SecurityGroup, SubnetType } from '@aws-cdk/aws-ec2'; import { DatabaseSecret, DatabaseClusterEngine, AuroraMysqlEngineVersion, ServerlessCluster } from '@aws-cdk/aws-rds'; import * as cdk from '@aws-cdk/core'; @@ -47,7 +47,7 @@ describe('Rds Data Source configuration', () => { api.addRdsDataSource('ds', cluster, secret); // THEN - expect(stack).toHaveResourceLike('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { PolicyDocument: { Version: '2012-10-17', Statement: [{ @@ -117,7 +117,7 @@ describe('Rds Data Source configuration', () => { api.addRdsDataSource('ds', cluster, secret); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'RELATIONAL_DATABASE', RelationalDatabaseConfig: { RdsHttpEndpointConfig: { @@ -144,7 +144,7 @@ describe('Rds Data Source configuration', () => { api.addRdsDataSource('ds', cluster, secret, testDatabaseName); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'RELATIONAL_DATABASE', RelationalDatabaseConfig: { RdsHttpEndpointConfig: { @@ -171,7 +171,7 @@ describe('Rds Data Source configuration', () => { api.addRdsDataSource('ds', cluster, secret); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'RELATIONAL_DATABASE', Name: 'ds', }); @@ -184,7 +184,7 @@ describe('Rds Data Source configuration', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'RELATIONAL_DATABASE', Name: 'custom', }); @@ -198,7 +198,7 @@ describe('Rds Data Source configuration', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'RELATIONAL_DATABASE', Name: 'custom', Description: 'custom description', @@ -249,7 +249,7 @@ describe('adding rds data source from imported api', () => { importedApi.addRdsDataSource('ds', cluster, secret); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'RELATIONAL_DATABASE', ApiId: { 'Fn::GetAtt': ['baseApiCDA4D43A', 'ApiId'] }, }); @@ -264,7 +264,7 @@ describe('adding rds data source from imported api', () => { importedApi.addRdsDataSource('ds', cluster, secret); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::DataSource', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', { Type: 'RELATIONAL_DATABASE', ApiId: { 'Fn::GetAtt': ['baseApiCDA4D43A', 'ApiId'] }, }); diff --git a/packages/@aws-cdk/aws-appsync/test/appsync-scalar-type.test.ts b/packages/@aws-cdk/aws-appsync/test/appsync-scalar-type.test.ts index 150b45e747006..01cf50bd8904b 100644 --- a/packages/@aws-cdk/aws-appsync/test/appsync-scalar-type.test.ts +++ b/packages/@aws-cdk/aws-appsync/test/appsync-scalar-type.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import * as cdk from '@aws-cdk/core'; import * as appsync from '../lib'; import * as t from './scalar-type-defintions'; @@ -24,7 +24,7 @@ describe('testing all GraphQL Types', () => { const out = 'type Test {\n id: ID\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -39,7 +39,7 @@ describe('testing all GraphQL Types', () => { const out = 'type Test {\n id: String\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -54,7 +54,7 @@ describe('testing all GraphQL Types', () => { const out = 'type Test {\n id: Int\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -69,7 +69,7 @@ describe('testing all GraphQL Types', () => { const out = 'type Test {\n id: Float\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -84,7 +84,7 @@ describe('testing all GraphQL Types', () => { const out = 'type Test {\n id: Boolean\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -99,7 +99,7 @@ describe('testing all GraphQL Types', () => { const out = 'type Test {\n id: AWSDate\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -114,7 +114,7 @@ describe('testing all GraphQL Types', () => { const out = 'type Test {\n id: AWSTime\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -129,7 +129,7 @@ describe('testing all GraphQL Types', () => { const out = 'type Test {\n id: AWSDateTime\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -144,7 +144,7 @@ describe('testing all GraphQL Types', () => { const out = 'type Test {\n id: AWSTimestamp\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -159,7 +159,7 @@ describe('testing all GraphQL Types', () => { const out = 'type Test {\n id: AWSEmail\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -174,7 +174,7 @@ describe('testing all GraphQL Types', () => { const out = 'type Test {\n id: AWSJSON\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -190,7 +190,7 @@ describe('testing all GraphQL Types', () => { const out = 'type Test {\n id: AWSURL\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -205,7 +205,7 @@ describe('testing all GraphQL Types', () => { const out = 'type Test {\n id: AWSPhone\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -220,7 +220,7 @@ describe('testing all GraphQL Types', () => { const out = 'type Test {\n id: AWSIPAddress\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); diff --git a/packages/@aws-cdk/aws-appsync/test/appsync-schema.test.ts b/packages/@aws-cdk/aws-appsync/test/appsync-schema.test.ts index 37db685807139..9e3c5d951d807 100644 --- a/packages/@aws-cdk/aws-appsync/test/appsync-schema.test.ts +++ b/packages/@aws-cdk/aws-appsync/test/appsync-schema.test.ts @@ -1,5 +1,5 @@ import { join } from 'path'; -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import * as cdk from '@aws-cdk/core'; import * as appsync from '../lib'; import * as t from './scalar-type-defintions'; @@ -41,7 +41,7 @@ describe('basic testing schema definition mode `code`', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: '', }); }); @@ -56,7 +56,7 @@ describe('basic testing schema definition mode `code`', () => { api.addType(mutation); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${type.toString()}\n${query.toString()}\n${mutation.toString()}\n`, }); }); @@ -71,7 +71,7 @@ describe('basic testing schema definition mode `code`', () => { })); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: 'schema {\n query: Query\n}\ntype Query {\n test: String\n}\n', }); }); @@ -88,7 +88,7 @@ describe('basic testing schema definition mode `code`', () => { })); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: 'schema {\n query: Query\n}\ntype Query {\n test: String\n}\n', }); }); @@ -103,7 +103,7 @@ describe('basic testing schema definition mode `code`', () => { })); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: 'schema {\n mutation: Mutation\n}\ntype Mutation {\n test: String\n}\n', }); }); @@ -120,7 +120,7 @@ describe('basic testing schema definition mode `code`', () => { })); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: 'schema {\n mutation: Mutation\n}\ntype Mutation {\n test: String\n}\n', }); }); @@ -135,7 +135,7 @@ describe('basic testing schema definition mode `code`', () => { })); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: 'schema {\n subscription: Subscription\n}\ntype Subscription {\n test: String\n}\n', }); }); @@ -152,7 +152,7 @@ describe('basic testing schema definition mode `code`', () => { })); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: 'schema {\n subscription: Subscription\n}\ntype Subscription {\n test: String\n}\n', }); }); @@ -170,7 +170,7 @@ describe('basic testing schema definition mode `code`', () => { const out = 'schema {\n subscription: Subscription\n}\ntype Subscription {\n test: String\n @aws_subscribe(mutations: ["test1"])\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: out, }); }); @@ -186,7 +186,7 @@ describe('testing schema definition mode `file`', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${type.toString()}\n${query.toString()}\n${mutation.toString()}\n`, }); }); diff --git a/packages/@aws-cdk/aws-appsync/test/appsync-union-types.test.ts b/packages/@aws-cdk/aws-appsync/test/appsync-union-types.test.ts index a2f0e6f47a41a..b84099b93e68f 100644 --- a/packages/@aws-cdk/aws-appsync/test/appsync-union-types.test.ts +++ b/packages/@aws-cdk/aws-appsync/test/appsync-union-types.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import * as cdk from '@aws-cdk/core'; import * as appsync from '../lib'; import * as t from './scalar-type-defintions'; @@ -30,10 +30,10 @@ describe('testing Union Type properties', () => { }); api.addType(union); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); - expect(stack).not.toHaveResource('AWS::AppSync::Resolver'); + Template.fromStack(stack).resourceCountIs('AWS::AppSync::Resolver', 0); }); test('UnionType can addField', () => { @@ -45,7 +45,7 @@ describe('testing Union Type properties', () => { union.addField({ field: test2.attribute() }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}`, }); }); @@ -90,7 +90,7 @@ describe('testing Union Type properties', () => { const obj = 'type Test2 {\n union: UnionTest\n}\n'; // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLSchema', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLSchema', { Definition: `${out}${obj}`, }); }); diff --git a/packages/@aws-cdk/aws-appsync/test/appsync.test.ts b/packages/@aws-cdk/aws-appsync/test/appsync.test.ts index 773b1142b0917..9c75c0c7a28c9 100644 --- a/packages/@aws-cdk/aws-appsync/test/appsync.test.ts +++ b/packages/@aws-cdk/aws-appsync/test/appsync.test.ts @@ -1,5 +1,5 @@ import * as path from 'path'; -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import * as iam from '@aws-cdk/aws-iam'; import * as cdk from '@aws-cdk/core'; import * as appsync from '../lib'; @@ -32,7 +32,7 @@ test('appsync should configure pipeline when pipelineConfig has contents', () => }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::Resolver', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::Resolver', { Kind: 'PIPELINE', PipelineConfig: { Functions: [ @@ -74,7 +74,7 @@ test('appsync should configure resolver as unit when pipelineConfig is empty', ( }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::Resolver', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::Resolver', { Kind: 'UNIT', }); }); @@ -88,7 +88,7 @@ test('appsync should configure resolver as unit when pipelineConfig is empty arr }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::Resolver', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::Resolver', { Kind: 'UNIT', }); }); @@ -103,7 +103,7 @@ test('when xray is enabled should not throw an Error', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLApi', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLApi', { XrayEnabled: true, }); }); @@ -128,7 +128,7 @@ test('appsync GraphqlApi should be configured with custom CloudWatch Logs role w }); // THEN - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLApi', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLApi', { Name: 'apiWithCustomRole', LogConfig: { CloudWatchLogsRoleArn: { @@ -143,7 +143,7 @@ test('appsync GraphqlApi should be configured with custom CloudWatch Logs role w test('appsync GraphqlApi should not use custom role for CW Logs when not specified', () => { // EXPECT - expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLApi', { + Template.fromStack(stack).hasResourceProperties('AWS::AppSync::GraphQLApi', { Name: 'api', LogConfig: { CloudWatchLogsRoleArn: { diff --git a/packages/@aws-cdk/aws-batch/package.json b/packages/@aws-cdk/aws-batch/package.json index 158edc9ff76ff..bc9cbf389cd8c 100644 --- a/packages/@aws-cdk/aws-batch/package.json +++ b/packages/@aws-cdk/aws-batch/package.json @@ -73,13 +73,13 @@ }, "license": "Apache-2.0", "devDependencies": { + "@aws-cdk/assertions": "0.0.0", "@types/jest": "^26.0.24", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "cfn2ts": "0.0.0", "jest": "^26.6.3", - "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "pkglint": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-batch/test/batch.test.ts b/packages/@aws-cdk/aws-batch/test/batch.test.ts deleted file mode 100644 index c4505ad966984..0000000000000 --- a/packages/@aws-cdk/aws-batch/test/batch.test.ts +++ /dev/null @@ -1,6 +0,0 @@ -import '@aws-cdk/assert-internal/jest'; -import {} from '../lib'; - -test('No tests are specified for this package', () => { - expect(true).toBe(true); -}); diff --git a/packages/@aws-cdk/aws-batch/test/compute-environment.test.ts b/packages/@aws-cdk/aws-batch/test/compute-environment.test.ts index dd18be3f1496c..c7ead4cd47de8 100644 --- a/packages/@aws-cdk/aws-batch/test/compute-environment.test.ts +++ b/packages/@aws-cdk/aws-batch/test/compute-environment.test.ts @@ -1,6 +1,5 @@ import { throws } from 'assert'; -import { expect, haveResource, haveResourceLike, ResourcePart } from '@aws-cdk/assert-internal'; -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as ecs from '@aws-cdk/aws-ecs'; import * as iam from '@aws-cdk/aws-iam'; @@ -96,7 +95,7 @@ describe('Batch Compute Evironment', () => { }); // THEN - expect(stack).to(haveResourceLike('AWS::Batch::ComputeEnvironment', { + Template.fromStack(stack).hasResourceProperties('AWS::Batch::ComputeEnvironment', { Type: 'MANAGED', ...expectedManagedDefaultComputeProps({ Type: batch.ComputeResourceType.SPOT, @@ -117,7 +116,7 @@ describe('Batch Compute Evironment', () => { ], }, }), - }, ResourcePart.Properties)); + }); }); describe('with a bid percentage', () => { @@ -200,7 +199,7 @@ describe('Batch Compute Evironment', () => { new batch.ComputeEnvironment(stack, 'test-compute-env', props); // THEN - expect(stack).to(haveResourceLike('AWS::Batch::ComputeEnvironment', { + Template.fromStack(stack).hasResourceProperties('AWS::Batch::ComputeEnvironment', { ComputeEnvironmentName: 'my-test-compute-env', Type: 'MANAGED', State: 'DISABLED', @@ -251,7 +250,7 @@ describe('Batch Compute Evironment', () => { }, Type: 'EC2', }, - }, ResourcePart.Properties)); + }); }); describe('with no allocation strategy specified', () => { @@ -265,7 +264,7 @@ describe('Batch Compute Evironment', () => { }); // THEN - expect(stack).to(haveResourceLike('AWS::Batch::ComputeEnvironment', { + Template.fromStack(stack).hasResourceProperties('AWS::Batch::ComputeEnvironment', { Type: 'MANAGED', ServiceRole: { 'Fn::GetAtt': [ @@ -273,7 +272,7 @@ describe('Batch Compute Evironment', () => { 'Arn', ], }, - }, ResourcePart.Properties)); + }); }); }); @@ -317,12 +316,12 @@ describe('Batch Compute Evironment', () => { }); // THEN - expect(stack).to(haveResourceLike('AWS::Batch::ComputeEnvironment', { + Template.fromStack(stack).hasResourceProperties('AWS::Batch::ComputeEnvironment', { ...defaultServiceRole, ...expectedManagedDefaultComputeProps({ MinvCpus: 0, }), - }, ResourcePart.Properties)); + }); }); }); @@ -337,11 +336,11 @@ describe('Batch Compute Evironment', () => { }); // THEN - expect(stack).to(haveResourceLike('AWS::Batch::ComputeEnvironment', { + Template.fromStack(stack).hasResourceProperties('AWS::Batch::ComputeEnvironment', { ...expectedManagedDefaultComputeProps({ MaxvCpus: 256, }), - }, ResourcePart.Properties)); + }); }); }); @@ -356,8 +355,8 @@ describe('Batch Compute Evironment', () => { }); // THEN - expect(stack).to(haveResource('AWS::Batch::ComputeEnvironment')); - expect(stack).to(haveResource('AWS::IAM::Role')); + Template.fromStack(stack).resourceCountIs('AWS::Batch::ComputeEnvironment', 1); + Template.fromStack(stack).resourceCountIs('AWS::IAM::Role', 2); }); }); @@ -372,11 +371,11 @@ describe('Batch Compute Evironment', () => { }); // THEN - expect(stack).to(haveResourceLike('AWS::Batch::ComputeEnvironment', { + Template.fromStack(stack).hasResourceProperties('AWS::Batch::ComputeEnvironment', { ...expectedManagedDefaultComputeProps({ InstanceTypes: ['optimal'], }), - }, ResourcePart.Properties)); + }); }); }); @@ -391,11 +390,11 @@ describe('Batch Compute Evironment', () => { }); // THEN - expect(stack).to(haveResourceLike('AWS::Batch::ComputeEnvironment', { + Template.fromStack(stack).hasResourceProperties('AWS::Batch::ComputeEnvironment', { ...expectedManagedDefaultComputeProps({ Type: batch.ComputeResourceType.ON_DEMAND, }), - }, ResourcePart.Properties)); + }); }); }); }); diff --git a/packages/@aws-cdk/aws-batch/test/job-definition.test.ts b/packages/@aws-cdk/aws-batch/test/job-definition.test.ts index 2761611e063bb..ed9bffb7a90bc 100644 --- a/packages/@aws-cdk/aws-batch/test/job-definition.test.ts +++ b/packages/@aws-cdk/aws-batch/test/job-definition.test.ts @@ -1,5 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; -import { ResourcePart } from '@aws-cdk/assert-internal/lib/assertions/have-resource'; +import { Template } from '@aws-cdk/assertions'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as ecr from '@aws-cdk/aws-ecr'; import * as ecs from '@aws-cdk/aws-ecs'; @@ -70,7 +69,7 @@ describe('Batch Job Definition', () => { new batch.JobDefinition(stack, 'job-def', jobDefProps); // THEN - expect(stack).toHaveResourceLike('AWS::Batch::JobDefinition', { + Template.fromStack(stack).hasResourceProperties('AWS::Batch::JobDefinition', { JobDefinitionName: jobDefProps.jobDefinitionName, ContainerProperties: jobDefProps.container ? { Command: jobDefProps.container.command, @@ -113,7 +112,7 @@ describe('Batch Job Definition', () => { AttemptDurationSeconds: jobDefProps.timeout ? jobDefProps.timeout.toSeconds() : -1, }, Type: 'container', - }, ResourcePart.Properties); + }); }); test('can use an ecr image', () => { // WHEN @@ -126,7 +125,7 @@ describe('Batch Job Definition', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::Batch::JobDefinition', { + Template.fromStack(stack).hasResourceProperties('AWS::Batch::JobDefinition', { ContainerProperties: { Image: { 'Fn::Join': [ @@ -182,7 +181,7 @@ describe('Batch Job Definition', () => { ReadonlyRootFilesystem: false, Vcpus: 1, }, - }, ResourcePart.Properties); + }); }); test('can use a registry image', () => { @@ -194,7 +193,7 @@ describe('Batch Job Definition', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::Batch::JobDefinition', { + Template.fromStack(stack).hasResourceProperties('AWS::Batch::JobDefinition', { ContainerProperties: { Image: 'docker/whalesay', Memory: 4, @@ -202,7 +201,7 @@ describe('Batch Job Definition', () => { ReadonlyRootFilesystem: false, Vcpus: 1, }, - }, ResourcePart.Properties); + }); }); test('can be imported from an ARN', () => { @@ -247,7 +246,7 @@ describe('Batch Job Definition', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::Batch::JobDefinition', { + Template.fromStack(stack).hasResourceProperties('AWS::Batch::JobDefinition', { ContainerProperties: { LogConfiguration: { LogDriver: 'awslogs', @@ -285,6 +284,6 @@ describe('Batch Job Definition', () => { ], }, }, - }, ResourcePart.Properties); + }); }); }); diff --git a/packages/@aws-cdk/aws-batch/test/job-queue.test.ts b/packages/@aws-cdk/aws-batch/test/job-queue.test.ts index 0bec27b20899a..94fe03c5e93f0 100644 --- a/packages/@aws-cdk/aws-batch/test/job-queue.test.ts +++ b/packages/@aws-cdk/aws-batch/test/job-queue.test.ts @@ -1,5 +1,4 @@ -import { ResourcePart } from '@aws-cdk/assert-internal'; -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import * as cdk from '@aws-cdk/core'; import * as batch from '../lib'; @@ -48,7 +47,7 @@ describe('Batch Job Queue', () => { new batch.JobQueue(stack, 'test-job-queue', props); // THEN - expect(stack).toHaveResourceLike('AWS::Batch::JobQueue', { + Template.fromStack(stack).hasResourceProperties('AWS::Batch::JobQueue', { JobQueueName: props.jobQueueName, State: props.enabled ? 'ENABLED' : 'DISABLED', Priority: props.priority, @@ -60,7 +59,7 @@ describe('Batch Job Queue', () => { Order: 1, }, ], - }, ResourcePart.Properties); + }); }); it('should have a default queue priority of 1', () => { @@ -76,8 +75,8 @@ describe('Batch Job Queue', () => { }); // THEN - expect(stack).toHaveResourceLike('AWS::Batch::JobQueue', { + Template.fromStack(stack).hasResourceProperties('AWS::Batch::JobQueue', { Priority: 1, - }, ResourcePart.Properties); + }); }); }); diff --git a/packages/@aws-cdk/aws-cloud9/package.json b/packages/@aws-cdk/aws-cloud9/package.json index 8aac346d87398..452002a0e5dde 100644 --- a/packages/@aws-cdk/aws-cloud9/package.json +++ b/packages/@aws-cdk/aws-cloud9/package.json @@ -73,13 +73,13 @@ }, "license": "Apache-2.0", "devDependencies": { - "@types/jest": "^26.0.24", + "@aws-cdk/assertions": "0.0.0", "@aws-cdk/aws-codecommit": "0.0.0", + "@types/jest": "^26.0.24", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "cfn2ts": "0.0.0", - "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "pkglint": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-cloud9/test/cloud9.environment.test.ts b/packages/@aws-cdk/aws-cloud9/test/cloud9.environment.test.ts index 231484ea26ffb..079fe546d0a4f 100644 --- a/packages/@aws-cdk/aws-cloud9/test/cloud9.environment.test.ts +++ b/packages/@aws-cdk/aws-cloud9/test/cloud9.environment.test.ts @@ -1,4 +1,4 @@ -import { expect as expectCDK, haveResource, haveResourceLike } from '@aws-cdk/assert-internal'; +import { Template } from '@aws-cdk/assertions'; import * as codecommit from '@aws-cdk/aws-codecommit'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as cdk from '@aws-cdk/core'; @@ -16,7 +16,7 @@ test('create resource correctly with only vpc provide', () => { // WHEN new cloud9.Ec2Environment(stack, 'C9Env', { vpc }); // THEN - expectCDK(stack).to(haveResource('AWS::Cloud9::EnvironmentEC2')); + Template.fromStack(stack).resourceCountIs('AWS::Cloud9::EnvironmentEC2', 1); }); test('create resource correctly with both vpc and subnetSelectio', () => { @@ -28,7 +28,7 @@ test('create resource correctly with both vpc and subnetSelectio', () => { }, }); // THEN - expectCDK(stack).to(haveResource('AWS::Cloud9::EnvironmentEC2')); + Template.fromStack(stack).resourceCountIs('AWS::Cloud9::EnvironmentEC2', 1); }); test('import correctly from existing environment', () => { @@ -45,7 +45,7 @@ test('create correctly with instanceType specified', () => { instanceType: ec2.InstanceType.of(ec2.InstanceClass.C5, ec2.InstanceSize.LARGE), }); // THEN - expectCDK(stack).to(haveResource('AWS::Cloud9::EnvironmentEC2')); + Template.fromStack(stack).resourceCountIs('AWS::Cloud9::EnvironmentEC2', 1); }); test('throw error when subnetSelection not specified and the provided VPC has no public subnets', () => { @@ -80,7 +80,7 @@ test('can use CodeCommit repositories', () => { ], }); // THEN - expectCDK(stack).to(haveResourceLike('AWS::Cloud9::EnvironmentEC2', { + Template.fromStack(stack).hasResourceProperties('AWS::Cloud9::EnvironmentEC2', { InstanceType: 't2.micro', Repositories: [ { @@ -103,5 +103,5 @@ test('can use CodeCommit repositories', () => { }, }, ], - })); + }); }); diff --git a/packages/@aws-cdk/aws-cloud9/test/cloud9.test.ts b/packages/@aws-cdk/aws-cloud9/test/cloud9.test.ts deleted file mode 100644 index c4505ad966984..0000000000000 --- a/packages/@aws-cdk/aws-cloud9/test/cloud9.test.ts +++ /dev/null @@ -1,6 +0,0 @@ -import '@aws-cdk/assert-internal/jest'; -import {} from '../lib'; - -test('No tests are specified for this package', () => { - expect(true).toBe(true); -}); diff --git a/packages/@aws-cdk/aws-codestar/package.json b/packages/@aws-cdk/aws-codestar/package.json index 8b943f821668d..7740100ab9d29 100644 --- a/packages/@aws-cdk/aws-codestar/package.json +++ b/packages/@aws-cdk/aws-codestar/package.json @@ -75,12 +75,12 @@ }, "license": "Apache-2.0", "devDependencies": { + "@aws-cdk/assertions": "0.0.0", "@types/jest": "^26.0.24", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "cfn2ts": "0.0.0", - "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "pkglint": "0.0.0" }, "dependencies": { "@aws-cdk/aws-s3": "0.0.0", diff --git a/packages/@aws-cdk/aws-codestar/test/codestar.test.ts b/packages/@aws-cdk/aws-codestar/test/codestar.test.ts index 7b142a03ac221..c1af7348d849c 100644 --- a/packages/@aws-cdk/aws-codestar/test/codestar.test.ts +++ b/packages/@aws-cdk/aws-codestar/test/codestar.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import { Bucket } from '@aws-cdk/aws-s3'; import * as cdk from '@aws-cdk/core'; import { GitHubRepository, RepositoryVisibility } from '../lib'; @@ -22,7 +22,7 @@ describe('GitHub Repository', () => { contentsKey: 'import.zip', }); - expect(stack).toHaveResource('AWS::CodeStar::GitHubRepository', { + Template.fromStack(stack).hasResourceProperties('AWS::CodeStar::GitHubRepository', { RepositoryAccessToken: '{{resolve:secretsmanager:my-github-token:SecretString:token::}}', RepositoryName: 'bar', RepositoryOwner: 'foo', @@ -48,7 +48,7 @@ describe('GitHub Repository', () => { visibility: RepositoryVisibility.PRIVATE, }); - expect(stack).toHaveResourceLike('AWS::CodeStar::GitHubRepository', { + Template.fromStack(stack).hasResourceProperties('AWS::CodeStar::GitHubRepository', { EnableIssues: true, IsPrivate: true, }); diff --git a/packages/@aws-cdk/aws-glue/package.json b/packages/@aws-cdk/aws-glue/package.json index f489c1955478e..5f11a3895db92 100644 --- a/packages/@aws-cdk/aws-glue/package.json +++ b/packages/@aws-cdk/aws-glue/package.json @@ -74,14 +74,14 @@ "license": "Apache-2.0", "devDependencies": { "@types/jest": "^26.0.24", + "@aws-cdk/assertions": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "@types/nodeunit": "^0.0.32", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "cfn2ts": "0.0.0", "jest": "^26.6.3", - "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "pkglint": "0.0.0" }, "dependencies": { "@aws-cdk/aws-ec2": "0.0.0", diff --git a/packages/@aws-cdk/aws-glue/test/connection.test.ts b/packages/@aws-cdk/aws-glue/test/connection.test.ts index c61cc6197130d..b4fdaa2988cde 100644 --- a/packages/@aws-cdk/aws-glue/test/connection.test.ts +++ b/packages/@aws-cdk/aws-glue/test/connection.test.ts @@ -1,7 +1,6 @@ -import * as cdkassert from '@aws-cdk/assert-internal'; +import { Template } from '@aws-cdk/assertions'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as cdk from '@aws-cdk/core'; -import '@aws-cdk/assert-internal/jest'; import * as glue from '../lib'; test('a connection with connection properties', () => { @@ -15,7 +14,7 @@ test('a connection with connection properties', () => { }, }); - cdkassert.expect(stack).to(cdkassert.haveResource('AWS::Glue::Connection', { + Template.fromStack(stack).hasResourceProperties('AWS::Glue::Connection', { CatalogId: { Ref: 'AWS::AccountId', }, @@ -27,7 +26,7 @@ test('a connection with connection properties', () => { }, ConnectionType: 'JDBC', }, - })); + }); }); test('a connection with a subnet and security group', () => { @@ -43,7 +42,7 @@ test('a connection with a subnet and security group', () => { subnet, }); - cdkassert.expect(stack).to(cdkassert.haveResource('AWS::Glue::Connection', { + Template.fromStack(stack).hasResourceProperties('AWS::Glue::Connection', { CatalogId: { Ref: 'AWS::AccountId', }, @@ -55,7 +54,7 @@ test('a connection with a subnet and security group', () => { SecurityGroupIdList: ['sgId'], }, }, - })); + }); }); test('a connection with a name and description', () => { @@ -66,7 +65,7 @@ test('a connection with a name and description', () => { type: glue.ConnectionType.NETWORK, }); - cdkassert.expect(stack).to(cdkassert.haveResource('AWS::Glue::Connection', { + Template.fromStack(stack).hasResourceProperties('AWS::Glue::Connection', { CatalogId: { Ref: 'AWS::AccountId', }, @@ -75,7 +74,7 @@ test('a connection with a name and description', () => { Name: 'name', Description: 'description', }, - })); + }); }); test('a connection with a custom type', () => { @@ -86,7 +85,7 @@ test('a connection with a custom type', () => { type: new glue.ConnectionType('CUSTOM_TYPE'), }); - cdkassert.expect(stack).to(cdkassert.haveResource('AWS::Glue::Connection', { + Template.fromStack(stack).hasResourceProperties('AWS::Glue::Connection', { CatalogId: { Ref: 'AWS::AccountId', }, @@ -95,7 +94,7 @@ test('a connection with a custom type', () => { Name: 'name', Description: 'description', }, - })); + }); }); test('a connection with match criteria', () => { @@ -105,7 +104,7 @@ test('a connection with match criteria', () => { matchCriteria: ['c1', 'c2'], }); - cdkassert.expect(stack).to(cdkassert.haveResource('AWS::Glue::Connection', { + Template.fromStack(stack).hasResourceProperties('AWS::Glue::Connection', { CatalogId: { Ref: 'AWS::AccountId', }, @@ -113,7 +112,7 @@ test('a connection with match criteria', () => { ConnectionType: 'NETWORK', MatchCriteria: ['c1', 'c2'], }, - })); + }); }); test('addProperty', () => { @@ -123,7 +122,7 @@ test('addProperty', () => { }); connection.addProperty('SomeKey', 'SomeValue'); - cdkassert.expect(stack).to(cdkassert.haveResource('AWS::Glue::Connection', { + Template.fromStack(stack).hasResourceProperties('AWS::Glue::Connection', { CatalogId: { Ref: 'AWS::AccountId', }, @@ -133,7 +132,7 @@ test('addProperty', () => { SomeKey: 'SomeValue', }, }, - })); + }); }); test('fromConnectionName', () => { diff --git a/packages/@aws-cdk/aws-glue/test/database.test.ts b/packages/@aws-cdk/aws-glue/test/database.test.ts index f5ad6461ee190..6c8171df3547c 100644 --- a/packages/@aws-cdk/aws-glue/test/database.test.ts +++ b/packages/@aws-cdk/aws-glue/test/database.test.ts @@ -1,6 +1,4 @@ -import { deepEqual, throws } from 'assert'; -import { expect } from '@aws-cdk/assert-internal'; -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import { Stack } from '@aws-cdk/core'; import * as glue from '../lib'; @@ -11,7 +9,7 @@ test('default database does not create a bucket', () => { databaseName: 'test_database', }); - expect(stack).toMatch({ + Template.fromStack(stack).templateMatches({ Resources: { DatabaseB269D8BB: { Type: 'AWS::Glue::Database', @@ -37,7 +35,7 @@ test('explicit locationURI', () => { locationUri: 's3://my-uri/', }); - expect(stack).toMatch({ + Template.fromStack(stack).templateMatches({ Resources: { DatabaseB269D8BB: { Type: 'AWS::Glue::Database', @@ -64,31 +62,31 @@ test('fromDatabase', () => { const database = glue.Database.fromDatabaseArn(stack, 'import', 'arn:aws:glue:us-east-1:123456789012:database/db1'); // THEN - deepEqual(database.databaseArn, 'arn:aws:glue:us-east-1:123456789012:database/db1'); - deepEqual(database.databaseName, 'db1'); - deepEqual(stack.resolve(database.catalogArn), { + expect(database.databaseArn).toEqual('arn:aws:glue:us-east-1:123456789012:database/db1'); + expect(database.databaseName).toEqual('db1'); + expect(stack.resolve(database.catalogArn)).toEqual({ 'Fn::Join': ['', ['arn:', { Ref: 'AWS::Partition' }, ':glue:', { Ref: 'AWS::Region' }, ':', { Ref: 'AWS::AccountId' }, ':catalog']], }); - deepEqual(stack.resolve(database.catalogId), { Ref: 'AWS::AccountId' }); + expect(stack.resolve(database.catalogId)).toEqual({ Ref: 'AWS::AccountId' }); }); test('locationUri length must be >= 1', () => { const stack = new Stack(); - throws(() => + expect(() => new glue.Database(stack, 'Database', { databaseName: 'test_database', locationUri: '', }), - ); + ).toThrow(); }); test('locationUri length must be <= 1024', () => { const stack = new Stack(); - throws(() => + expect(() => new glue.Database(stack, 'Database', { databaseName: 'test_database', locationUri: 'a'.repeat(1025), }), - ); + ).toThrow(); }); diff --git a/packages/@aws-cdk/aws-glue/test/schema.test.ts b/packages/@aws-cdk/aws-glue/test/schema.test.ts index 2155655e27e6d..dcb6b731a0e27 100644 --- a/packages/@aws-cdk/aws-glue/test/schema.test.ts +++ b/packages/@aws-cdk/aws-glue/test/schema.test.ts @@ -1,126 +1,124 @@ -import '@aws-cdk/assert-internal/jest'; -import { doesNotThrow, equal, throws } from 'assert'; import { Schema } from '../lib'; test('boolean type', () => { - equal(Schema.BOOLEAN.inputString, 'boolean'); - equal(Schema.BOOLEAN.isPrimitive, true); + expect(Schema.BOOLEAN.inputString).toEqual('boolean'); + expect(Schema.BOOLEAN.isPrimitive).toEqual(true); }); test('binary type', () => { - equal(Schema.BINARY.inputString, 'binary'); - equal(Schema.BINARY.isPrimitive, true); + expect(Schema.BINARY.inputString).toEqual('binary'); + expect(Schema.BINARY.isPrimitive).toEqual(true); }); test('bigint type', () => { - equal(Schema.BIG_INT.inputString, 'bigint'); - equal(Schema.BIG_INT.isPrimitive, true); + expect(Schema.BIG_INT.inputString).toEqual('bigint'); + expect(Schema.BIG_INT.isPrimitive).toEqual(true); }); test('double type', () => { - equal(Schema.DOUBLE.inputString, 'double'); - equal(Schema.DOUBLE.isPrimitive, true); + expect(Schema.DOUBLE.inputString).toEqual('double'); + expect(Schema.DOUBLE.isPrimitive).toEqual(true); }); test('float type', () => { - equal(Schema.FLOAT.inputString, 'float'); - equal(Schema.FLOAT.isPrimitive, true); + expect(Schema.FLOAT.inputString).toEqual('float'); + expect(Schema.FLOAT.isPrimitive).toEqual(true); }); test('integer type', () => { - equal(Schema.INTEGER.inputString, 'int'); - equal(Schema.INTEGER.isPrimitive, true); + expect(Schema.INTEGER.inputString).toEqual('int'); + expect(Schema.INTEGER.isPrimitive).toEqual(true); }); test('smallint type', () => { - equal(Schema.SMALL_INT.inputString, 'smallint'); - equal(Schema.SMALL_INT.isPrimitive, true); + expect(Schema.SMALL_INT.inputString).toEqual('smallint'); + expect(Schema.SMALL_INT.isPrimitive).toEqual(true); }); test('tinyint type', () => { - equal(Schema.TINY_INT.inputString, 'tinyint'); - equal(Schema.TINY_INT.isPrimitive, true); + expect(Schema.TINY_INT.inputString).toEqual('tinyint'); + expect(Schema.TINY_INT.isPrimitive).toEqual(true); }); test('decimal type', () => { - equal(Schema.decimal(16).inputString, 'decimal(16)'); - equal(Schema.decimal(16, 1).inputString, 'decimal(16,1)'); - equal(Schema.decimal(16).isPrimitive, true); - equal(Schema.decimal(16, 1).isPrimitive, true); + expect(Schema.decimal(16).inputString).toEqual('decimal(16)'); + expect(Schema.decimal(16, 1).inputString).toEqual('decimal(16,1)'); + expect(Schema.decimal(16).isPrimitive).toEqual(true); + expect(Schema.decimal(16, 1).isPrimitive).toEqual(true); }); // TODO: decimal bounds test('date type', () => { - equal(Schema.DATE.inputString, 'date'); - equal(Schema.DATE.isPrimitive, true); + expect(Schema.DATE.inputString).toEqual('date'); + expect(Schema.DATE.isPrimitive).toEqual(true); }); test('timestamp type', () => { - equal(Schema.TIMESTAMP.inputString, 'timestamp'); - equal(Schema.TIMESTAMP.isPrimitive, true); + expect(Schema.TIMESTAMP.inputString).toEqual('timestamp'); + expect(Schema.TIMESTAMP.isPrimitive).toEqual(true); }); test('string type', () => { - equal(Schema.STRING.inputString, 'string'); - equal(Schema.STRING.isPrimitive, true); + expect(Schema.STRING.inputString).toEqual('string'); + expect(Schema.STRING.isPrimitive).toEqual(true); }); test('char type', () => { - equal(Schema.char(1).inputString, 'char(1)'); - equal(Schema.char(1).isPrimitive, true); + expect(Schema.char(1).inputString).toEqual('char(1)'); + expect(Schema.char(1).isPrimitive).toEqual(true); }); test('char length must be test(at least 1', () => { - doesNotThrow(() => Schema.char(1)); - throws(() => Schema.char(0)); - throws(() => Schema.char(-1)); + expect(() => Schema.char(1)).not.toThrow(); + expect(() => Schema.char(0)).toThrow(); + expect(() => Schema.char(-1)).toThrow(); }); test('char length must test(be <= 255', () => { - doesNotThrow(() => Schema.char(255)); - throws(() => Schema.char(256)); + expect(() => Schema.char(255)).not.toThrow(); + expect(() => Schema.char(256)).toThrow(); }); test('varchar type', () => { - equal(Schema.varchar(1).inputString, 'varchar(1)'); - equal(Schema.varchar(1).isPrimitive, true); + expect(Schema.varchar(1).inputString).toEqual('varchar(1)'); + expect(Schema.varchar(1).isPrimitive).toEqual(true); }); test('varchar length must be test(at least 1', () => { - doesNotThrow(() => Schema.varchar(1)); - throws(() => Schema.varchar(0)); - throws(() => Schema.varchar(-1)); + expect(() => Schema.varchar(1)).not.toThrow(); + expect(() => Schema.varchar(0)).toThrow(); + expect(() => Schema.varchar(-1)).toThrow(); }); test('varchar length must test(be <= 65535', () => { - doesNotThrow(() => Schema.varchar(65535)); - throws(() => Schema.varchar(65536)); + expect(() => Schema.varchar(65535)).not.toThrow(); + expect(() => Schema.varchar(65536)).toThrow(); }); test('test(array', () => { const type = Schema.array(Schema.STRING); - equal(type.inputString, 'array'); - equal(type.isPrimitive, false); + expect(type.inputString).toEqual('array'); + expect(type.isPrimitive).toEqual(false); }); test('array', () => { const type = Schema.array(Schema.char(1)); - equal(type.inputString, 'array'); - equal(type.isPrimitive, false); + expect(type.inputString).toEqual('array'); + expect(type.isPrimitive).toEqual(false); }); test('test(array', () => { const type = Schema.array( Schema.array(Schema.STRING)); - equal(type.inputString, 'array>'); - equal(type.isPrimitive, false); + expect(type.inputString).toEqual('array>'); + expect(type.isPrimitive).toEqual(false); }); test('test(array', () => { const type = Schema.array( Schema.map(Schema.STRING, Schema.STRING)); - equal(type.inputString, 'array>'); - equal(type.isPrimitive, false); + expect(type.inputString).toEqual('array>'); + expect(type.isPrimitive).toEqual(false); }); test('test(array', () => { @@ -129,8 +127,8 @@ test('test(array', () => { name: 'key', type: Schema.STRING, }])); - equal(type.inputString, 'array>'); - equal(type.isPrimitive, false); + expect(type.inputString).toEqual('array>'); + expect(type.isPrimitive).toEqual(false); }); test('map', () => { @@ -138,8 +136,8 @@ test('map', () => { Schema.STRING, Schema.STRING, ); - equal(type.inputString, 'map'); - equal(type.isPrimitive, false); + expect(type.inputString).toEqual('map'); + expect(type.isPrimitive).toEqual(false); }); test('map', () => { @@ -147,8 +145,8 @@ test('map', () => { Schema.INTEGER, Schema.STRING, ); - equal(type.inputString, 'map'); - equal(type.isPrimitive, false); + expect(type.inputString).toEqual('map'); + expect(type.isPrimitive).toEqual(false); }); test('map', () => { @@ -156,8 +154,8 @@ test('map', () => { Schema.char(1), Schema.char(1), ); - equal(type.inputString, 'map'); - equal(type.isPrimitive, false); + expect(type.inputString).toEqual('map'); + expect(type.isPrimitive).toEqual(false); }); test('map', () => { @@ -165,8 +163,8 @@ test('map', () => { Schema.char(1), Schema.array(Schema.STRING), ); - equal(type.inputString, 'map>'); - equal(type.isPrimitive, false); + expect(type.inputString).toEqual('map>'); + expect(type.isPrimitive).toEqual(false); }); test('map', () => { @@ -176,8 +174,8 @@ test('map', () => { Schema.STRING, Schema.STRING), ); - equal(type.inputString, 'map>'); - equal(type.isPrimitive, false); + expect(type.inputString).toEqual('map>'); + expect(type.isPrimitive).toEqual(false); }); test('map', () => { @@ -188,26 +186,26 @@ test('map', () => { type: Schema.STRING, }]), ); - equal(type.inputString, 'map>'); - equal(type.isPrimitive, false); + expect(type.inputString).toEqual('map>'); + expect(type.isPrimitive).toEqual(false); }); test('map throws if keyType is test(non-primitive', () => { - throws(() => Schema.map( + expect(() => Schema.map( Schema.array(Schema.STRING), Schema.STRING, - )); - throws(() => Schema.map( + )).toThrow(); + expect(() => Schema.map( Schema.map(Schema.STRING, Schema.STRING), Schema.STRING, - )); - throws(() => Schema.map( + )).toThrow(); + expect(() => Schema.map( Schema.struct([{ name: 'key', type: Schema.STRING, }]), Schema.STRING, - )); + )).toThrow(); }); test('struct type', () => { @@ -233,9 +231,9 @@ test('struct type', () => { }]), }]); - equal(type.isPrimitive, false); - equal( - type.inputString, + expect(type.isPrimitive).toEqual(false); + expect(type.inputString).toEqual( // eslint-disable-next-line max-len - 'struct,map:map,nested_struct:struct>'); + 'struct,map:map,nested_struct:struct>', + ); }); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-glue/test/security-configuration.test.ts b/packages/@aws-cdk/aws-glue/test/security-configuration.test.ts index ce89c393e5301..ca42a4eb53453 100644 --- a/packages/@aws-cdk/aws-glue/test/security-configuration.test.ts +++ b/packages/@aws-cdk/aws-glue/test/security-configuration.test.ts @@ -1,7 +1,6 @@ -import * as cdkassert from '@aws-cdk/assert-internal'; +import { Template } from '@aws-cdk/assertions'; import * as kms from '@aws-cdk/aws-kms'; import * as cdk from '@aws-cdk/core'; -import '@aws-cdk/assert-internal/jest'; import * as glue from '../lib'; test('throws when a security configuration has no encryption config', () => { @@ -29,7 +28,7 @@ test('a security configuration with encryption configuration requiring kms key a expect(securityConfiguration.jobBookmarksEncryptionKey).toBeUndefined(); expect(securityConfiguration.s3EncryptionKey).toBeUndefined(); - cdkassert.expect(stack).to(cdkassert.haveResource('AWS::Glue::SecurityConfiguration', { + Template.fromStack(stack).hasResourceProperties('AWS::Glue::SecurityConfiguration', { Name: 'name', EncryptionConfiguration: { CloudWatchEncryption: { @@ -37,7 +36,7 @@ test('a security configuration with encryption configuration requiring kms key a KmsKeyArn: keyArn, }, }, - })); + }); }); test('a security configuration with an encryption configuration requiring kms key but not providing an explicit one', () => { @@ -54,9 +53,9 @@ test('a security configuration with an encryption configuration requiring kms ke expect(securityConfiguration.jobBookmarksEncryptionKey).toBeUndefined(); expect(securityConfiguration.s3EncryptionKey).toBeUndefined(); - cdkassert.expect(stack).to(cdkassert.haveResource('AWS::KMS::Key')); + Template.fromStack(stack).resourceCountIs('AWS::KMS::Key', 1); - cdkassert.expect(stack).to(cdkassert.haveResource('AWS::Glue::SecurityConfiguration', { + Template.fromStack(stack).hasResourceProperties('AWS::Glue::SecurityConfiguration', { Name: 'name', EncryptionConfiguration: { CloudWatchEncryption: { @@ -64,7 +63,7 @@ test('a security configuration with an encryption configuration requiring kms ke KmsKeyArn: stack.resolve(securityConfiguration.cloudWatchEncryptionKey?.keyArn), }, }, - })); + }); }); test('a security configuration with all encryption configs and mixed kms key inputs', () => { @@ -90,9 +89,9 @@ test('a security configuration with all encryption configs and mixed kms key inp expect(securityConfiguration.jobBookmarksEncryptionKey?.keyArn).toEqual(keyArn); expect(securityConfiguration.s3EncryptionKey).toBeUndefined(); - cdkassert.expect(stack).to(cdkassert.haveResource('AWS::KMS::Key')); + Template.fromStack(stack).resourceCountIs('AWS::KMS::Key', 1); - cdkassert.expect(stack).to(cdkassert.haveResource('AWS::Glue::SecurityConfiguration', { + Template.fromStack(stack).hasResourceProperties('AWS::Glue::SecurityConfiguration', { Name: 'name', EncryptionConfiguration: { CloudWatchEncryption: { @@ -109,7 +108,7 @@ test('a security configuration with all encryption configs and mixed kms key inp S3EncryptionMode: 'SSE-S3', }], }, - })); + }); }); test('fromSecurityConfigurationName', () => { diff --git a/packages/@aws-cdk/aws-glue/test/table.test.ts b/packages/@aws-cdk/aws-glue/test/table.test.ts index 084eaa67ab564..fbb1424f766c1 100644 --- a/packages/@aws-cdk/aws-glue/test/table.test.ts +++ b/packages/@aws-cdk/aws-glue/test/table.test.ts @@ -1,6 +1,4 @@ -import { deepEqual, doesNotThrow, equal, notEqual, ok } from 'assert'; -import { expect as cdkExpect, haveResource, ResourcePart } from '@aws-cdk/assert-internal'; -import '@aws-cdk/assert-internal/jest'; +import { Template } 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'; @@ -28,15 +26,15 @@ test('unpartitioned JSON table', () => { }], dataFormat: glue.DataFormat.JSON, }); - equal(table.encryption, glue.TableEncryption.UNENCRYPTED); + expect(table.encryption).toEqual(glue.TableEncryption.UNENCRYPTED); - cdkExpect(tableStack).to(haveResource('AWS::S3::Bucket', { + Template.fromStack(tableStack).hasResource('AWS::S3::Bucket', { Type: 'AWS::S3::Bucket', DeletionPolicy: 'Retain', UpdateReplacePolicy: 'Retain', - }, ResourcePart.CompleteDefinition)); + }); - cdkExpect(tableStack).to(haveResource('AWS::Glue::Table', { + Template.fromStack(tableStack).hasResourceProperties('AWS::Glue::Table', { CatalogId: { Ref: 'AWS::AccountId', }, @@ -79,7 +77,7 @@ test('unpartitioned JSON table', () => { }, TableType: 'EXTERNAL_TABLE', }, - })); + }); }); @@ -104,11 +102,11 @@ test('partitioned JSON table', () => { }], dataFormat: glue.DataFormat.JSON, }); - equal(table.encryption, glue.TableEncryption.UNENCRYPTED); - equal(table.encryptionKey, undefined); - equal(table.bucket.encryptionKey, undefined); + expect(table.encryption).toEqual(glue.TableEncryption.UNENCRYPTED); + expect(table.encryptionKey).toEqual(undefined); + expect(table.bucket.encryptionKey).toEqual(undefined); - cdkExpect(tableStack).to(haveResource('AWS::Glue::Table', { + Template.fromStack(tableStack).hasResourceProperties('AWS::Glue::Table', { CatalogId: { Ref: 'AWS::AccountId', }, @@ -157,7 +155,7 @@ test('partitioned JSON table', () => { }, TableType: 'EXTERNAL_TABLE', }, - })); + }); }); @@ -177,10 +175,10 @@ test('compressed table', () => { compressed: true, dataFormat: glue.DataFormat.JSON, }); - equal(table.encryptionKey, undefined); - equal(table.bucket.encryptionKey, undefined); + expect(table.encryptionKey).toEqual(undefined); + expect(table.bucket.encryptionKey).toEqual(undefined); - cdkExpect(stack).to(haveResource('AWS::Glue::Table', { + Template.fromStack(stack).hasResourceProperties('AWS::Glue::Table', { CatalogId: { Ref: 'AWS::AccountId', }, @@ -223,7 +221,7 @@ test('compressed table', () => { }, TableType: 'EXTERNAL_TABLE', }, - })); + }); }); @@ -247,7 +245,7 @@ test('table.node.defaultChild', () => { }); // THEN - ok(table.node.defaultChild instanceof glue.CfnTable); + expect(table.node.defaultChild instanceof glue.CfnTable).toEqual(true); }); test('encrypted table: SSE-S3', () => { @@ -266,11 +264,11 @@ test('encrypted table: SSE-S3', () => { encryption: glue.TableEncryption.S3_MANAGED, dataFormat: glue.DataFormat.JSON, }); - equal(table.encryption, glue.TableEncryption.S3_MANAGED); - equal(table.encryptionKey, undefined); - equal(table.bucket.encryptionKey, undefined); + expect(table.encryption).toEqual(glue.TableEncryption.S3_MANAGED); + expect(table.encryptionKey).toEqual(undefined); + expect(table.bucket.encryptionKey).toEqual(undefined); - cdkExpect(stack).to(haveResource('AWS::Glue::Table', { + Template.fromStack(stack).hasResourceProperties('AWS::Glue::Table', { CatalogId: { Ref: 'AWS::AccountId', }, @@ -313,9 +311,9 @@ test('encrypted table: SSE-S3', () => { }, TableType: 'EXTERNAL_TABLE', }, - })); + }); - cdkExpect(stack).to(haveResource('AWS::S3::Bucket', { + Template.fromStack(stack).hasResourceProperties('AWS::S3::Bucket', { BucketEncryption: { ServerSideEncryptionConfiguration: [ { @@ -325,7 +323,7 @@ test('encrypted table: SSE-S3', () => { }, ], }, - })); + }); }); @@ -345,14 +343,14 @@ test('encrypted table: SSE-KMS (implicitly created key)', () => { encryption: glue.TableEncryption.KMS, dataFormat: glue.DataFormat.JSON, }); - equal(table.encryption, glue.TableEncryption.KMS); - equal(table.encryptionKey, table.bucket.encryptionKey); + expect(table.encryption).toEqual(glue.TableEncryption.KMS); + expect(table.encryptionKey).toEqual(table.bucket.encryptionKey); - cdkExpect(stack).to(haveResource('AWS::KMS::Key', { + Template.fromStack(stack).hasResourceProperties('AWS::KMS::Key', { Description: 'Created by Default/Table/Bucket', - })); + }); - cdkExpect(stack).to(haveResource('AWS::S3::Bucket', { + Template.fromStack(stack).hasResourceProperties('AWS::S3::Bucket', { BucketEncryption: { ServerSideEncryptionConfiguration: [ { @@ -368,9 +366,9 @@ test('encrypted table: SSE-KMS (implicitly created key)', () => { }, ], }, - })); + }); - cdkExpect(stack).to(haveResource('AWS::Glue::Table', { + Template.fromStack(stack).hasResourceProperties('AWS::Glue::Table', { CatalogId: { Ref: 'AWS::AccountId', }, @@ -413,7 +411,7 @@ test('encrypted table: SSE-KMS (implicitly created key)', () => { }, TableType: 'EXTERNAL_TABLE', }, - })); + }); }); @@ -437,15 +435,15 @@ test('encrypted table: SSE-KMS (explicitly created key)', () => { encryptionKey, dataFormat: glue.DataFormat.JSON, }); - equal(table.encryption, glue.TableEncryption.KMS); - equal(table.encryptionKey, table.bucket.encryptionKey); - notEqual(table.encryptionKey, undefined); + expect(table.encryption).toEqual(glue.TableEncryption.KMS); + expect(table.encryptionKey).toEqual(table.bucket.encryptionKey); + expect(table.encryptionKey).not.toEqual(undefined); - cdkExpect(stack).to(haveResource('AWS::KMS::Key', { + Template.fromStack(stack).hasResourceProperties('AWS::KMS::Key', { Description: 'OurKey', - })); + }); - cdkExpect(stack).to(haveResource('AWS::S3::Bucket', { + Template.fromStack(stack).hasResourceProperties('AWS::S3::Bucket', { BucketEncryption: { ServerSideEncryptionConfiguration: [ { @@ -461,9 +459,9 @@ test('encrypted table: SSE-KMS (explicitly created key)', () => { }, ], }, - })); + }); - cdkExpect(stack).to(haveResource('AWS::Glue::Table', { + Template.fromStack(stack).hasResourceProperties('AWS::Glue::Table', { CatalogId: { Ref: 'AWS::AccountId', }, @@ -506,7 +504,7 @@ test('encrypted table: SSE-KMS (explicitly created key)', () => { }, TableType: 'EXTERNAL_TABLE', }, - })); + }); }); @@ -526,11 +524,11 @@ test('encrypted table: SSE-KMS_MANAGED', () => { encryption: glue.TableEncryption.KMS_MANAGED, dataFormat: glue.DataFormat.JSON, }); - equal(table.encryption, glue.TableEncryption.KMS_MANAGED); - equal(table.encryptionKey, undefined); - equal(table.bucket.encryptionKey, undefined); + expect(table.encryption).toEqual(glue.TableEncryption.KMS_MANAGED); + expect(table.encryptionKey).toEqual(undefined); + expect(table.bucket.encryptionKey).toEqual(undefined); - cdkExpect(stack).to(haveResource('AWS::S3::Bucket', { + Template.fromStack(stack).hasResourceProperties('AWS::S3::Bucket', { BucketEncryption: { ServerSideEncryptionConfiguration: [ { @@ -540,9 +538,9 @@ test('encrypted table: SSE-KMS_MANAGED', () => { }, ], }, - })); + }); - cdkExpect(stack).to(haveResource('AWS::Glue::Table', { + Template.fromStack(stack).hasResourceProperties('AWS::Glue::Table', { CatalogId: { Ref: 'AWS::AccountId', }, @@ -585,7 +583,7 @@ test('encrypted table: SSE-KMS_MANAGED', () => { }, TableType: 'EXTERNAL_TABLE', }, - })); + }); }); @@ -605,13 +603,13 @@ test('encrypted table: CSE-KMS (implicitly created key)', () => { encryption: glue.TableEncryption.CLIENT_SIDE_KMS, dataFormat: glue.DataFormat.JSON, }); - equal(table.encryption, glue.TableEncryption.CLIENT_SIDE_KMS); - notEqual(table.encryptionKey, undefined); - equal(table.bucket.encryptionKey, undefined); + expect(table.encryption).toEqual(glue.TableEncryption.CLIENT_SIDE_KMS); + expect(table.encryptionKey).not.toEqual(undefined); + expect(table.bucket.encryptionKey).toEqual(undefined); - cdkExpect(stack).to(haveResource('AWS::KMS::Key')); + Template.fromStack(stack).resourceCountIs('AWS::KMS::Key', 1); - cdkExpect(stack).to(haveResource('AWS::Glue::Table', { + Template.fromStack(stack).hasResourceProperties('AWS::Glue::Table', { CatalogId: { Ref: 'AWS::AccountId', }, @@ -654,7 +652,7 @@ test('encrypted table: CSE-KMS (implicitly created key)', () => { }, TableType: 'EXTERNAL_TABLE', }, - })); + }); }); @@ -678,15 +676,15 @@ test('encrypted table: CSE-KMS (explicitly created key)', () => { encryptionKey, dataFormat: glue.DataFormat.JSON, }); - equal(table.encryption, glue.TableEncryption.CLIENT_SIDE_KMS); - notEqual(table.encryptionKey, undefined); - equal(table.bucket.encryptionKey, undefined); + expect(table.encryption).toEqual(glue.TableEncryption.CLIENT_SIDE_KMS); + expect(table.encryptionKey).not.toEqual(undefined); + expect(table.bucket.encryptionKey).toEqual(undefined); - cdkExpect(stack).to(haveResource('AWS::KMS::Key', { + Template.fromStack(stack).hasResourceProperties('AWS::KMS::Key', { Description: 'MyKey', - })); + }); - cdkExpect(stack).to(haveResource('AWS::Glue::Table', { + Template.fromStack(stack).hasResourceProperties('AWS::Glue::Table', { CatalogId: { Ref: 'AWS::AccountId', }, @@ -729,7 +727,7 @@ test('encrypted table: CSE-KMS (explicitly created key)', () => { }, TableType: 'EXTERNAL_TABLE', }, - })); + }); }); @@ -755,15 +753,15 @@ test('encrypted table: CSE-KMS (explicitly passed bucket and key)', () => { encryptionKey, dataFormat: glue.DataFormat.JSON, }); - equal(table.encryption, glue.TableEncryption.CLIENT_SIDE_KMS); - notEqual(table.encryptionKey, undefined); - equal(table.bucket.encryptionKey, undefined); + expect(table.encryption).toEqual(glue.TableEncryption.CLIENT_SIDE_KMS); + expect(table.encryptionKey).not.toEqual(undefined); + expect(table.bucket.encryptionKey).toEqual(undefined); - cdkExpect(stack).to(haveResource('AWS::KMS::Key', { + Template.fromStack(stack).hasResourceProperties('AWS::KMS::Key', { Description: 'MyKey', - })); + }); - cdkExpect(stack).to(haveResource('AWS::Glue::Table', { + Template.fromStack(stack).hasResourceProperties('AWS::Glue::Table', { CatalogId: { Ref: 'AWS::AccountId', }, @@ -806,7 +804,7 @@ test('encrypted table: CSE-KMS (explicitly passed bucket and key)', () => { }, TableType: 'EXTERNAL_TABLE', }, - })); + }); }); @@ -831,7 +829,7 @@ test('explicit s3 bucket and prefix', () => { dataFormat: glue.DataFormat.JSON, }); - cdkExpect(stack).to(haveResource('AWS::Glue::Table', { + Template.fromStack(stack).hasResourceProperties('AWS::Glue::Table', { CatalogId: { Ref: 'AWS::AccountId', }, @@ -874,7 +872,7 @@ test('explicit s3 bucket and prefix', () => { }, TableType: 'EXTERNAL_TABLE', }, - })); + }); }); @@ -899,7 +897,7 @@ test('explicit s3 bucket and with empty prefix', () => { dataFormat: glue.DataFormat.JSON, }); - cdkExpect(stack).to(haveResource('AWS::Glue::Table', { + Template.fromStack(stack).hasResourceProperties('AWS::Glue::Table', { CatalogId: { Ref: 'AWS::AccountId', }, @@ -942,7 +940,7 @@ test('explicit s3 bucket and with empty prefix', () => { }, TableType: 'EXTERNAL_TABLE', }, - })); + }); }); @@ -966,7 +964,7 @@ test('grants: read only', () => { table.grantRead(user); - cdkExpect(stack).to(haveResource('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { PolicyDocument: { Statement: [ { @@ -1048,7 +1046,7 @@ test('grants: read only', () => { Ref: 'User00B015A1', }, ], - })); + }); }); @@ -1072,7 +1070,7 @@ testFutureBehavior('grants: write only', s3GrantWriteCtx, cdk.App, (app) => { table.grantWrite(user); - cdkExpect(stack).to(haveResource('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { PolicyDocument: { Statement: [ { @@ -1151,7 +1149,7 @@ testFutureBehavior('grants: write only', s3GrantWriteCtx, cdk.App, (app) => { Ref: 'User00B015A1', }, ], - })); + }); }); @@ -1175,7 +1173,7 @@ testFutureBehavior('grants: read and write', s3GrantWriteCtx, cdk.App, (app) => table.grantReadWrite(user); - cdkExpect(stack).to(haveResource('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { PolicyDocument: { Statement: [ { @@ -1264,7 +1262,7 @@ testFutureBehavior('grants: read and write', s3GrantWriteCtx, cdk.App, (app) => Ref: 'User00B015A1', }, ], - })); + }); }); @@ -1346,7 +1344,7 @@ test('validate: can not specify an explicit bucket and encryption', () => { }); test('validate: can explicitly pass bucket if Encryption undefined', () => { - doesNotThrow(() => createTable({ + expect(() => createTable({ tableName: 'name', columns: [{ name: 'col1', @@ -1354,11 +1352,11 @@ test('validate: can explicitly pass bucket if Encryption undefined', () => { }], bucket: new s3.Bucket(new cdk.Stack(), 'Bucket'), encryption: undefined, - })); + })).not.toThrow(); }); test('validate: can explicitly pass bucket if Unencrypted', () => { - doesNotThrow(() => createTable({ + expect(() => createTable({ tableName: 'name', columns: [{ name: 'col1', @@ -1366,11 +1364,11 @@ test('validate: can explicitly pass bucket if Unencrypted', () => { }], bucket: new s3.Bucket(new cdk.Stack(), 'Bucket'), encryption: undefined, - })); + })).not.toThrow(); }); test('validate: can explicitly pass bucket if ClientSideKms', () => { - doesNotThrow(() => createTable({ + expect(() => createTable({ tableName: 'name', columns: [{ name: 'col1', @@ -1378,7 +1376,7 @@ test('validate: can explicitly pass bucket if ClientSideKms', () => { }], bucket: new s3.Bucket(new cdk.Stack(), 'Bucket'), encryption: glue.TableEncryption.CLIENT_SIDE_KMS, - })); + })).not.toThrow(); }); test('Table.fromTableArn', () => { @@ -1389,8 +1387,8 @@ test('Table.fromTableArn', () => { const table = glue.Table.fromTableArn(stack, 'boom', 'arn:aws:glue:us-east-1:123456789012:table/db1/tbl1'); // THEN - deepEqual(table.tableArn, 'arn:aws:glue:us-east-1:123456789012:table/db1/tbl1'); - deepEqual(table.tableName, 'tbl1'); + expect(table.tableArn).toEqual('arn:aws:glue:us-east-1:123456789012:table/db1/tbl1'); + expect(table.tableName).toEqual('tbl1'); }); function createTable(props: Pick>): void { diff --git a/packages/@aws-cdk/aws-ivs/package.json b/packages/@aws-cdk/aws-ivs/package.json index 31a2a63490f4d..b199d66182db2 100644 --- a/packages/@aws-cdk/aws-ivs/package.json +++ b/packages/@aws-cdk/aws-ivs/package.json @@ -85,12 +85,12 @@ }, "license": "Apache-2.0", "devDependencies": { + "@aws-cdk/assertions": "0.0.0", "@types/jest": "^26.0.24", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "cfn2ts": "0.0.0", - "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "pkglint": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-ivs/test/ivs.test.ts b/packages/@aws-cdk/aws-ivs/test/ivs.test.ts index 5f4f29e833df7..0e5efd63d5b2a 100644 --- a/packages/@aws-cdk/aws-ivs/test/ivs.test.ts +++ b/packages/@aws-cdk/aws-ivs/test/ivs.test.ts @@ -1,5 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; -import { expect as expectStack } from '@aws-cdk/assert-internal'; +import { Template } from '@aws-cdk/assertions'; import { Stack } from '@aws-cdk/core'; import * as ivs from '../lib'; @@ -13,7 +12,7 @@ test('channel default properties', () => { const stack = new Stack(); new ivs.Channel(stack, 'Channel'); - expectStack(stack).toMatch({ + Template.fromStack(stack).templateMatches({ Resources: { Channel4048F119: { Type: 'AWS::IVS::Channel', @@ -28,7 +27,7 @@ test('channel name', () => { name: 'CarrotsAreTasty', }); - expectStack(stack).toMatch({ + Template.fromStack(stack).templateMatches({ Resources: { Channel4048F119: { Type: 'AWS::IVS::Channel', @@ -46,7 +45,7 @@ test('channel is authorized', () => { authorized: true, }); - expectStack(stack).toMatch({ + Template.fromStack(stack).templateMatches({ Resources: { Channel4048F119: { Type: 'AWS::IVS::Channel', @@ -64,7 +63,7 @@ test('channel type', () => { type: ivs.ChannelType.BASIC, }); - expectStack(stack).toMatch({ + Template.fromStack(stack).templateMatches({ Resources: { Channel4048F119: { Type: 'AWS::IVS::Channel', @@ -82,7 +81,7 @@ test('channel latency mode', () => { latencyMode: ivs.LatencyMode.NORMAL, }); - expectStack(stack).toMatch({ + Template.fromStack(stack).templateMatches({ Resources: { Channel4048F119: { Type: 'AWS::IVS::Channel', @@ -115,7 +114,7 @@ test('playback key pair mandatory properties', () => { publicKeyMaterial: publicKey, }); - expectStack(stack).toMatch({ + Template.fromStack(stack).templateMatches({ Resources: { PlaybackKeyPairBE17315B: { Type: 'AWS::IVS::PlaybackKeyPair', @@ -134,7 +133,7 @@ test('playback key pair name', () => { name: 'CarrotsAreNutritious', }); - expectStack(stack).toMatch({ + Template.fromStack(stack).templateMatches({ Resources: { PlaybackKeyPairBE17315B: { Type: 'AWS::IVS::PlaybackKeyPair', @@ -162,7 +161,7 @@ test('stream key mandatory properties', () => { channel: ivs.Channel.fromChannelArn(stack, 'ChannelRef', 'arn:aws:ivs:us-west-2:123456789012:channel/abcdABCDefgh'), }); - expectStack(stack).toMatch({ + Template.fromStack(stack).templateMatches({ Resources: { StreamKey9F296F4F: { Type: 'AWS::IVS::StreamKey', @@ -179,7 +178,7 @@ test('channel and stream key.. at the same time', () => { const channel = new ivs.Channel(stack, 'Channel'); channel.addStreamKey('StreamKey'); - expectStack(stack).toMatch({ + Template.fromStack(stack).templateMatches({ Resources: { Channel4048F119: { Type: 'AWS::IVS::Channel', @@ -199,7 +198,7 @@ test('stream key from channel reference', () => { const channel = ivs.Channel.fromChannelArn(stack, 'Channel', 'arn:aws:ivs:us-west-2:123456789012:channel/abcdABCDefgh'); channel.addStreamKey('StreamKey'); - expectStack(stack).toMatch({ + Template.fromStack(stack).templateMatches({ Resources: { ChannelStreamKey60BDC2BE: { Type: 'AWS::IVS::StreamKey', diff --git a/packages/@aws-cdk/aws-kinesisanalytics-flink/package.json b/packages/@aws-cdk/aws-kinesisanalytics-flink/package.json index 02ffcb62439e7..d9ee895e0ed29 100644 --- a/packages/@aws-cdk/aws-kinesisanalytics-flink/package.json +++ b/packages/@aws-cdk/aws-kinesisanalytics-flink/package.json @@ -66,12 +66,12 @@ }, "license": "Apache-2.0", "devDependencies": { + "@aws-cdk/assertions": "0.0.0", "@types/jest": "^26.0.24", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "jest": "^26.6.3", - "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "pkglint": "0.0.0" }, "dependencies": { "@aws-cdk/assets": "0.0.0", diff --git a/packages/@aws-cdk/aws-kinesisanalytics-flink/test/application.test.ts b/packages/@aws-cdk/aws-kinesisanalytics-flink/test/application.test.ts index 09ccedef9bc83..a4546a5fa9423 100644 --- a/packages/@aws-cdk/aws-kinesisanalytics-flink/test/application.test.ts +++ b/packages/@aws-cdk/aws-kinesisanalytics-flink/test/application.test.ts @@ -1,10 +1,9 @@ -import { arrayWith, objectLike, ResourcePart } from '@aws-cdk/assert-internal'; -import '@aws-cdk/assert-internal/jest'; +import * as path from 'path'; +import { Match, Template } from '@aws-cdk/assertions'; 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 * as core from '@aws-cdk/core'; -import * as path from 'path'; import * as flink from '../lib'; describe('Application', () => { @@ -31,7 +30,7 @@ describe('Application', () => { applicationName: 'MyFlinkApplication', }); - expect(stack).toHaveResource('AWS::KinesisAnalyticsV2::Application', { + Template.fromStack(stack).hasResourceProperties('AWS::KinesisAnalyticsV2::Application', { ApplicationName: 'MyFlinkApplication', RuntimeEnvironment: 'FLINK-1_11', ServiceExecutionRole: { @@ -56,11 +55,11 @@ describe('Application', () => { }, }); - expect(stack).toHaveResourceLike('AWS::KinesisAnalyticsV2::Application', { + Template.fromStack(stack).hasResource('AWS::KinesisAnalyticsV2::Application', { DeletionPolicy: 'Delete', - }, ResourcePart.CompleteDefinition); + }); - expect(stack).toHaveResource('AWS::IAM::Role', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Role', { AssumeRolePolicyDocument: { Statement: [{ Action: 'sts:AssumeRole', @@ -73,9 +72,9 @@ describe('Application', () => { }, }); - expect(stack).toHaveResourceLike('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { PolicyDocument: { - Statement: arrayWith( + Statement: Match.arrayWith([ { Action: 'cloudwatch:PutMetricData', Effect: 'Allow', Resource: '*' }, { Action: 'logs:DescribeLogGroups', @@ -119,7 +118,7 @@ describe('Application', () => { ]], }, }, - ), + ]), }, }); }); @@ -132,7 +131,7 @@ describe('Application', () => { }), }); - expect(stack).toHaveResource('AWS::IAM::Role', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Role', { AssumeRolePolicyDocument: { Statement: [ { @@ -158,11 +157,11 @@ describe('Application', () => { resources: ['*'], })); - expect(stack).toHaveResourceLike('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { PolicyDocument: { - Statement: arrayWith( - objectLike({ Action: 'custom:action', Effect: 'Allow', Resource: '*' }), - ), + Statement: Match.arrayWith([ + Match.objectLike({ Action: 'custom:action', Effect: 'Allow', Resource: '*' }), + ]), }, }); }); @@ -173,7 +172,7 @@ describe('Application', () => { runtime: flink.Runtime.of('custom'), }); - expect(stack).toHaveResourceLike('AWS::KinesisAnalyticsV2::Application', { + Template.fromStack(stack).hasResourceProperties('AWS::KinesisAnalyticsV2::Application', { RuntimeEnvironment: 'custom', }); }); @@ -184,9 +183,9 @@ describe('Application', () => { removalPolicy: core.RemovalPolicy.RETAIN, }); - expect(stack).toHaveResourceLike('AWS::KinesisAnalyticsV2::Application', { + Template.fromStack(stack).hasResource('AWS::KinesisAnalyticsV2::Application', { DeletionPolicy: 'Retain', - }, ResourcePart.CompleteDefinition); + }); }); test('granting permissions to resources', () => { @@ -197,12 +196,12 @@ describe('Application', () => { const dataBucket = new s3.Bucket(stack, 'DataBucket'); dataBucket.grantRead(app); - expect(stack).toHaveResourceLike('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { PolicyDocument: { Version: '2012-10-17', - Statement: arrayWith( - objectLike({ Action: ['s3:GetObject*', 's3:GetBucket*', 's3:List*'] }), - ), + Statement: Match.arrayWith([ + Match.objectLike({ Action: ['s3:GetObject*', 's3:GetBucket*', 's3:List*'] }), + ]), }, }); }); @@ -216,7 +215,7 @@ describe('Application', () => { const assetRef = 'AssetParameters8be9e0b5f53d41e9a3b1d51c9572c65f24f8170a7188d0ed57fb7d571de4d577S3BucketEBA17A67'; const versionKeyRef = 'AssetParameters8be9e0b5f53d41e9a3b1d51c9572c65f24f8170a7188d0ed57fb7d571de4d577S3VersionKey5922697E'; - expect(stack).toHaveResourceLike('AWS::KinesisAnalyticsV2::Application', { + Template.fromStack(stack).hasResourceProperties('AWS::KinesisAnalyticsV2::Application', { ApplicationConfiguration: { ApplicationCodeConfiguration: { CodeContent: { @@ -253,7 +252,7 @@ describe('Application', () => { }, }); - expect(stack).toHaveResourceLike('AWS::KinesisAnalyticsV2::Application', { + Template.fromStack(stack).hasResourceProperties('AWS::KinesisAnalyticsV2::Application', { ApplicationConfiguration: { EnvironmentProperties: { PropertyGroups: [ @@ -275,7 +274,7 @@ describe('Application', () => { checkpointingEnabled: false, }); - expect(stack).toHaveResourceLike('AWS::KinesisAnalyticsV2::Application', { + Template.fromStack(stack).hasResourceProperties('AWS::KinesisAnalyticsV2::Application', { ApplicationConfiguration: { FlinkApplicationConfiguration: { CheckpointConfiguration: { @@ -293,7 +292,7 @@ describe('Application', () => { checkpointInterval: core.Duration.minutes(5), }); - expect(stack).toHaveResourceLike('AWS::KinesisAnalyticsV2::Application', { + Template.fromStack(stack).hasResourceProperties('AWS::KinesisAnalyticsV2::Application', { ApplicationConfiguration: { FlinkApplicationConfiguration: { CheckpointConfiguration: { @@ -311,7 +310,7 @@ describe('Application', () => { minPauseBetweenCheckpoints: core.Duration.seconds(10), }); - expect(stack).toHaveResourceLike('AWS::KinesisAnalyticsV2::Application', { + Template.fromStack(stack).hasResourceProperties('AWS::KinesisAnalyticsV2::Application', { ApplicationConfiguration: { FlinkApplicationConfiguration: { CheckpointConfiguration: { @@ -329,7 +328,7 @@ describe('Application', () => { logLevel: flink.LogLevel.DEBUG, }); - expect(stack).toHaveResourceLike('AWS::KinesisAnalyticsV2::Application', { + Template.fromStack(stack).hasResourceProperties('AWS::KinesisAnalyticsV2::Application', { ApplicationConfiguration: { FlinkApplicationConfiguration: { MonitoringConfiguration: { @@ -347,7 +346,7 @@ describe('Application', () => { metricsLevel: flink.MetricsLevel.PARALLELISM, }); - expect(stack).toHaveResourceLike('AWS::KinesisAnalyticsV2::Application', { + Template.fromStack(stack).hasResourceProperties('AWS::KinesisAnalyticsV2::Application', { ApplicationConfiguration: { FlinkApplicationConfiguration: { MonitoringConfiguration: { @@ -365,7 +364,7 @@ describe('Application', () => { autoScalingEnabled: false, }); - expect(stack).toHaveResourceLike('AWS::KinesisAnalyticsV2::Application', { + Template.fromStack(stack).hasResourceProperties('AWS::KinesisAnalyticsV2::Application', { ApplicationConfiguration: { FlinkApplicationConfiguration: { ParallelismConfiguration: { @@ -383,7 +382,7 @@ describe('Application', () => { parallelism: 2, }); - expect(stack).toHaveResourceLike('AWS::KinesisAnalyticsV2::Application', { + Template.fromStack(stack).hasResourceProperties('AWS::KinesisAnalyticsV2::Application', { ApplicationConfiguration: { FlinkApplicationConfiguration: { ParallelismConfiguration: { @@ -401,7 +400,7 @@ describe('Application', () => { parallelismPerKpu: 2, }); - expect(stack).toHaveResourceLike('AWS::KinesisAnalyticsV2::Application', { + Template.fromStack(stack).hasResourceProperties('AWS::KinesisAnalyticsV2::Application', { ApplicationConfiguration: { FlinkApplicationConfiguration: { ParallelismConfiguration: { @@ -419,7 +418,7 @@ describe('Application', () => { snapshotsEnabled: false, }); - expect(stack).toHaveResourceLike('AWS::KinesisAnalyticsV2::Application', { + Template.fromStack(stack).hasResourceProperties('AWS::KinesisAnalyticsV2::Application', { ApplicationConfiguration: { ApplicationSnapshotConfiguration: { SnapshotsEnabled: false, @@ -434,7 +433,7 @@ describe('Application', () => { snapshotsEnabled: false, }); - expect(stack).toHaveResource('AWS::KinesisAnalyticsV2::ApplicationCloudWatchLoggingOption', { + Template.fromStack(stack).hasResourceProperties('AWS::KinesisAnalyticsV2::ApplicationCloudWatchLoggingOption', { ApplicationName: { Ref: 'FlinkApplicationC5836815', }, @@ -469,18 +468,18 @@ describe('Application', () => { }, }); - expect(stack).toHaveResource('AWS::Logs::LogGroup', { + Template.fromStack(stack).hasResource('AWS::Logs::LogGroup', { Properties: { RetentionInDays: 731, }, UpdateReplacePolicy: 'Retain', DeletionPolicy: 'Retain', - }, ResourcePart.CompleteDefinition); + }); - expect(stack).toHaveResource('AWS::Logs::LogStream', { + Template.fromStack(stack).hasResource('AWS::Logs::LogStream', { UpdateReplacePolicy: 'Retain', DeletionPolicy: 'Retain', - }, ResourcePart.CompleteDefinition); + }); }); test('logGroup setting', () => { @@ -491,7 +490,7 @@ describe('Application', () => { }), }); - expect(stack).toHaveResource('AWS::Logs::LogGroup', { + Template.fromStack(stack).hasResourceProperties('AWS::Logs::LogGroup', { LogGroupName: 'custom', }); }); diff --git a/packages/@aws-cdk/aws-kinesisfirehose-destinations/package.json b/packages/@aws-cdk/aws-kinesisfirehose-destinations/package.json index 1d158b0d08d75..6633645989caf 100644 --- a/packages/@aws-cdk/aws-kinesisfirehose-destinations/package.json +++ b/packages/@aws-cdk/aws-kinesisfirehose-destinations/package.json @@ -71,13 +71,13 @@ }, "license": "Apache-2.0", "devDependencies": { + "@aws-cdk/assertions": "0.0.0", "@types/jest": "^26.0.24", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "cfn2ts": "0.0.0", "jest": "^26.6.3", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-lambda-nodejs": "0.0.0" }, diff --git a/packages/@aws-cdk/aws-kinesisfirehose-destinations/test/s3-bucket.test.ts b/packages/@aws-cdk/aws-kinesisfirehose-destinations/test/s3-bucket.test.ts index dce9a250cbd43..448d0b8efcf40 100644 --- a/packages/@aws-cdk/aws-kinesisfirehose-destinations/test/s3-bucket.test.ts +++ b/packages/@aws-cdk/aws-kinesisfirehose-destinations/test/s3-bucket.test.ts @@ -1,5 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; -import { ABSENT, MatchStyle, ResourcePart, anything, arrayWith } from '@aws-cdk/assert-internal'; +import { Match, Template } from '@aws-cdk/assertions'; import * as iam from '@aws-cdk/aws-iam'; import * as firehose from '@aws-cdk/aws-kinesisfirehose'; import * as kms from '@aws-cdk/aws-kms'; @@ -27,19 +26,17 @@ describe('S3 destination', () => { destinations: [new firehosedestinations.S3Bucket(bucket, { role: destinationRole })], }); - expect(stack).toHaveResource('AWS::KinesisFirehose::DeliveryStream', { + Template.fromStack(stack).hasResourceProperties('AWS::KinesisFirehose::DeliveryStream', { ExtendedS3DestinationConfiguration: { BucketARN: stack.resolve(bucket.bucketArn), CloudWatchLoggingOptions: { Enabled: true, - LogGroupName: anything(), - LogStreamName: anything(), }, RoleARN: stack.resolve(destinationRole.roleArn), }, }); - expect(stack).toHaveResource('AWS::Logs::LogGroup'); - expect(stack).toHaveResource('AWS::Logs::LogStream'); + Template.fromStack(stack).resourceCountIs('AWS::Logs::LogGroup', 1); + Template.fromStack(stack).resourceCountIs('AWS::Logs::LogStream', 1); }); it('creates a role when none is provided', () => { @@ -48,7 +45,7 @@ describe('S3 destination', () => { destinations: [new firehosedestinations.S3Bucket(bucket)], }); - expect(stack).toHaveResourceLike('AWS::KinesisFirehose::DeliveryStream', { + Template.fromStack(stack).hasResourceProperties('AWS::KinesisFirehose::DeliveryStream', { ExtendedS3DestinationConfiguration: { RoleARN: { 'Fn::GetAtt': [ @@ -58,11 +55,19 @@ describe('S3 destination', () => { }, }, }); - expect(stack).toMatchTemplate({ - ['DeliveryStreamS3DestinationRoleD96B8345']: { - Type: 'AWS::IAM::Role', + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Role', { + AssumeRolePolicyDocument: { + Statement: [ + { + Effect: 'Allow', + Principal: { + Service: 'firehose.amazonaws.com', + }, + Action: 'sts:AssumeRole', + }, + ], }, - }, MatchStyle.SUPERSET); + }); }); it('grants read/write access to the bucket', () => { @@ -72,10 +77,10 @@ describe('S3 destination', () => { destinations: [destination], }); - expect(stack).toHaveResourceLike('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { Roles: [stack.resolve(destinationRole.roleName)], PolicyDocument: { - Statement: [ + Statement: Match.arrayWith([ { Action: [ 's3:GetObject*', @@ -91,7 +96,7 @@ describe('S3 destination', () => { { 'Fn::Join': ['', [stack.resolve(bucket.bucketArn), '/*']] }, ], }, - ], + ]), }, }); }); @@ -103,7 +108,7 @@ describe('S3 destination', () => { destinations: [destination], }); - expect(stack).toHaveResourceLike('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { PolicyName: 'DestinationRoleDefaultPolicy1185C75D', Roles: [stack.resolve(destinationRole.roleName)], PolicyDocument: { @@ -134,9 +139,9 @@ describe('S3 destination', () => { ], }, }); - expect(stack).toHaveResourceLike('AWS::KinesisFirehose::DeliveryStream', { + Template.fromStack(stack).hasResource('AWS::KinesisFirehose::DeliveryStream', { DependsOn: ['DestinationRoleDefaultPolicy1185C75D'], - }, ResourcePart.CompleteDefinition); + }); }); describe('logging', () => { @@ -145,14 +150,12 @@ describe('S3 destination', () => { destinations: [new firehosedestinations.S3Bucket(bucket)], }); - expect(stack).toHaveResource('AWS::Logs::LogGroup'); - expect(stack).toHaveResource('AWS::Logs::LogStream'); - expect(stack).toHaveResourceLike('AWS::KinesisFirehose::DeliveryStream', { + Template.fromStack(stack).resourceCountIs('AWS::Logs::LogGroup', 1); + Template.fromStack(stack).resourceCountIs('AWS::Logs::LogStream', 1); + Template.fromStack(stack).hasResourceProperties('AWS::KinesisFirehose::DeliveryStream', { ExtendedS3DestinationConfiguration: { CloudWatchLoggingOptions: { Enabled: true, - LogGroupName: anything(), - LogStreamName: anything(), }, }, }); @@ -163,10 +166,10 @@ describe('S3 destination', () => { destinations: [new firehosedestinations.S3Bucket(bucket, { logging: false })], }); - expect(stack).not.toHaveResource('AWS::Logs::LogGroup'); - expect(stack).toHaveResourceLike('AWS::KinesisFirehose::DeliveryStream', { + Template.fromStack(stack).resourceCountIs('AWS::Logs::LogGroup', 0); + Template.fromStack(stack).hasResourceProperties('AWS::KinesisFirehose::DeliveryStream', { ExtendedS3DestinationConfiguration: { - CloudWatchLoggingOptions: ABSENT, + CloudWatchLoggingOptions: Match.absentProperty(), }, }); }); @@ -178,13 +181,12 @@ describe('S3 destination', () => { destinations: [new firehosedestinations.S3Bucket(bucket, { logGroup })], }); - expect(stack).toCountResources('AWS::Logs::LogGroup', 1); - expect(stack).toHaveResourceLike('AWS::KinesisFirehose::DeliveryStream', { + Template.fromStack(stack).resourceCountIs('AWS::Logs::LogGroup', 1); + Template.fromStack(stack).hasResourceProperties('AWS::KinesisFirehose::DeliveryStream', { ExtendedS3DestinationConfiguration: { CloudWatchLoggingOptions: { Enabled: true, LogGroupName: stack.resolve(logGroup.logGroupName), - LogStreamName: anything(), }, }, }); @@ -205,10 +207,10 @@ describe('S3 destination', () => { destinations: [new firehosedestinations.S3Bucket(bucket, { logGroup, role: destinationRole })], }); - expect(stack).toHaveResourceLike('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { Roles: [stack.resolve(destinationRole.roleName)], PolicyDocument: { - Statement: arrayWith( + Statement: Match.arrayWith([ { Action: [ 'logs:CreateLogStream', @@ -217,7 +219,7 @@ describe('S3 destination', () => { Effect: 'Allow', Resource: stack.resolve(logGroup.logGroupArn), }, - ), + ]), }, }); }); @@ -246,8 +248,8 @@ describe('S3 destination', () => { destinations: [destinationWithBasicLambdaProcessor], }); - expect(stack).toHaveResource('AWS::Lambda::Function'); - expect(stack).toHaveResourceLike('AWS::KinesisFirehose::DeliveryStream', { + Template.fromStack(stack).resourceCountIs('AWS::Lambda::Function', 1); + Template.fromStack(stack).hasResourceProperties('AWS::KinesisFirehose::DeliveryStream', { ExtendedS3DestinationConfiguration: { ProcessingConfiguration: { Enabled: true, @@ -283,8 +285,8 @@ describe('S3 destination', () => { destinations: [destination], }); - expect(stack).toHaveResource('AWS::Lambda::Function'); - expect(stack).toHaveResourceLike('AWS::KinesisFirehose::DeliveryStream', { + Template.fromStack(stack).resourceCountIs('AWS::Lambda::Function', 1); + Template.fromStack(stack).hasResourceProperties('AWS::KinesisFirehose::DeliveryStream', { ExtendedS3DestinationConfiguration: { ProcessingConfiguration: { Enabled: true, @@ -323,22 +325,22 @@ describe('S3 destination', () => { destinations: [destinationWithBasicLambdaProcessor], }); - expect(stack).toHaveResourceLike('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { PolicyName: 'DestinationRoleDefaultPolicy1185C75D', Roles: [stack.resolve(destinationRole.roleName)], PolicyDocument: { - Statement: arrayWith( + Statement: Match.arrayWith([ { Action: 'lambda:InvokeFunction', Effect: 'Allow', Resource: stack.resolve(lambdaFunction.functionArn), }, - ), + ]), }, }); - expect(stack).toHaveResourceLike('AWS::KinesisFirehose::DeliveryStream', { + Template.fromStack(stack).hasResource('AWS::KinesisFirehose::DeliveryStream', { DependsOn: ['DestinationRoleDefaultPolicy1185C75D'], - }, ResourcePart.CompleteDefinition); + }); }); }); @@ -351,7 +353,7 @@ describe('S3 destination', () => { destinations: [destination], }); - expect(stack).toHaveResourceLike('AWS::KinesisFirehose::DeliveryStream', { + Template.fromStack(stack).hasResourceProperties('AWS::KinesisFirehose::DeliveryStream', { ExtendedS3DestinationConfiguration: { CompressionFormat: 'GZIP', }, @@ -366,7 +368,7 @@ describe('S3 destination', () => { destinations: [destination], }); - expect(stack).toHaveResourceLike('AWS::KinesisFirehose::DeliveryStream', { + Template.fromStack(stack).hasResourceProperties('AWS::KinesisFirehose::DeliveryStream', { ExtendedS3DestinationConfiguration: { CompressionFormat: 'SNAZZY', }, @@ -383,7 +385,7 @@ describe('S3 destination', () => { })], }); - expect(stack).toHaveResourceLike('AWS::KinesisFirehose::DeliveryStream', { + Template.fromStack(stack).hasResourceProperties('AWS::KinesisFirehose::DeliveryStream', { ExtendedS3DestinationConfiguration: { BufferingHints: { IntervalInSeconds: 60, @@ -438,7 +440,7 @@ describe('S3 destination', () => { })], }); - expect(stack).toHaveResourceLike('AWS::KinesisFirehose::DeliveryStream', { + Template.fromStack(stack).hasResourceProperties('AWS::KinesisFirehose::DeliveryStream', { ExtendedS3DestinationConfiguration: { EncryptionConfiguration: { KMSEncryptionConfig: { @@ -459,10 +461,10 @@ describe('S3 destination', () => { })], }); - expect(stack).toHaveResourceLike('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { Roles: [stack.resolve(destinationRole.roleName)], PolicyDocument: { - Statement: arrayWith({ + Statement: Match.arrayWith([{ Action: [ 'kms:Decrypt', 'kms:Encrypt', @@ -471,7 +473,7 @@ describe('S3 destination', () => { ], Effect: 'Allow', Resource: stack.resolve(key.keyArn), - }), + }]), }, }); }); @@ -489,14 +491,11 @@ describe('S3 destination', () => { destinations: [destination], }); - expect(stack).toHaveResourceLike('AWS::KinesisFirehose::DeliveryStream', { + Template.fromStack(stack).hasResourceProperties('AWS::KinesisFirehose::DeliveryStream', { ExtendedS3DestinationConfiguration: { S3BackupConfiguration: { - BucketARN: anything(), CloudWatchLoggingOptions: { Enabled: true, - LogGroupName: anything(), - LogStreamName: anything(), }, RoleARN: stack.resolve(destinationRole.roleArn), }, @@ -517,14 +516,12 @@ describe('S3 destination', () => { destinations: [destination], }); - expect(stack).toHaveResourceLike('AWS::KinesisFirehose::DeliveryStream', { + Template.fromStack(stack).hasResourceProperties('AWS::KinesisFirehose::DeliveryStream', { ExtendedS3DestinationConfiguration: { S3BackupConfiguration: { BucketARN: stack.resolve(backupBucket.bucketArn), CloudWatchLoggingOptions: { Enabled: true, - LogGroupName: anything(), - LogStreamName: anything(), }, RoleARN: stack.resolve(destinationRole.roleArn), }, @@ -548,10 +545,10 @@ describe('S3 destination', () => { destinations: [destination], }); - expect(stack).toHaveResource('AWS::S3::Bucket', 1); - expect(stack).toHaveResourceLike('AWS::KinesisFirehose::DeliveryStream', { + Template.fromStack(stack).resourceCountIs('AWS::S3::Bucket', 1); + Template.fromStack(stack).hasResourceProperties('AWS::KinesisFirehose::DeliveryStream', { ExtendedS3DestinationConfiguration: { - S3BackupConfiguration: ABSENT, + S3BackupConfiguration: Match.absentProperty(), }, }); }); @@ -579,14 +576,13 @@ describe('S3 destination', () => { destinations: [destination], }); - expect(stack).toHaveResourceLike('AWS::KinesisFirehose::DeliveryStream', { + Template.fromStack(stack).hasResourceProperties('AWS::KinesisFirehose::DeliveryStream', { ExtendedS3DestinationConfiguration: { S3BackupConfiguration: { BucketARN: stack.resolve(backupBucket.bucketArn), CloudWatchLoggingOptions: { Enabled: true, LogGroupName: stack.resolve(logGroup.logGroupName), - LogStreamName: anything(), }, RoleARN: stack.resolve(destinationRole.roleArn), EncryptionConfiguration: { diff --git a/packages/@aws-cdk/aws-lambda-go/package.json b/packages/@aws-cdk/aws-lambda-go/package.json index 9f83f91c15963..5ab8238df938e 100644 --- a/packages/@aws-cdk/aws-lambda-go/package.json +++ b/packages/@aws-cdk/aws-lambda-go/package.json @@ -66,7 +66,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert-internal": "0.0.0", + "@aws-cdk/assertions": "0.0.0", "@types/jest": "^26.0.24", "@aws-cdk/aws-ec2": "0.0.0", "cdk-build-tools": "0.0.0", diff --git a/packages/@aws-cdk/aws-lambda-go/test/function.test.ts b/packages/@aws-cdk/aws-lambda-go/test/function.test.ts index 0251a49ea498c..1feb0db637ade 100644 --- a/packages/@aws-cdk/aws-lambda-go/test/function.test.ts +++ b/packages/@aws-cdk/aws-lambda-go/test/function.test.ts @@ -1,5 +1,5 @@ -import '@aws-cdk/assert-internal/jest'; import * as path from 'path'; +import { Template } from '@aws-cdk/assertions'; import { Runtime } from '@aws-cdk/aws-lambda'; import { Stack } from '@aws-cdk/core'; import { GoFunction } from '../lib'; @@ -34,7 +34,7 @@ test('GoFunction with defaults', () => { entry: expect.stringMatching(/aws-lambda-go\/test\/lambda-handler-vendor\/cmd\/api$/), })); - expect(stack).toHaveResource('AWS::Lambda::Function', { + Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { Handler: 'bootstrap', Runtime: 'provided.al2', }); @@ -51,7 +51,7 @@ test('GoFunction with using provided runtime', () => { entry: expect.stringMatching(/aws-lambda-go\/test\/lambda-handler-vendor\/cmd\/api$/), })); - expect(stack).toHaveResource('AWS::Lambda::Function', { + Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { Handler: 'bootstrap', Runtime: 'provided', }); @@ -68,7 +68,7 @@ test('GoFunction with using golang runtime', () => { entry: expect.stringMatching(/aws-lambda-go\/test\/lambda-handler-vendor\/cmd\/api$/), })); - expect(stack).toHaveResource('AWS::Lambda::Function', { + Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { Handler: 'bootstrap', Runtime: 'go1.x', }); @@ -130,7 +130,7 @@ test('custom moduleDir can be used', () => { moduleDir: 'test/lambda-handler-vendor', }); - expect(stack).toHaveResource('AWS::Lambda::Function', { + Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { Handler: 'bootstrap', }); }); @@ -141,7 +141,7 @@ test('custom moduleDir with file path can be used', () => { moduleDir: 'test/lambda-handler-vendor/go.mod', }); - expect(stack).toHaveResource('AWS::Lambda::Function', { + Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { Handler: 'bootstrap', }); }); diff --git a/packages/@aws-cdk/aws-lambda-python/package.json b/packages/@aws-cdk/aws-lambda-python/package.json index 814ec44de6c69..72e5a12de703a 100644 --- a/packages/@aws-cdk/aws-lambda-python/package.json +++ b/packages/@aws-cdk/aws-lambda-python/package.json @@ -64,11 +64,11 @@ }, "license": "Apache-2.0", "devDependencies": { + "@aws-cdk/assertions": "0.0.0", "@types/jest": "^26.0.24", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", - "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "pkglint": "0.0.0" }, "dependencies": { "@aws-cdk/aws-lambda": "0.0.0", diff --git a/packages/@aws-cdk/aws-lambda-python/test/function.test.ts b/packages/@aws-cdk/aws-lambda-python/test/function.test.ts index a6bc4778e14f2..0eda2a419e97c 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/function.test.ts +++ b/packages/@aws-cdk/aws-lambda-python/test/function.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import { Code, Runtime } from '@aws-cdk/aws-lambda'; import { AssetHashType, AssetOptions, Stack } from '@aws-cdk/core'; import { PythonFunction } from '../lib'; @@ -52,7 +52,7 @@ test('PythonFunction with defaults', () => { outputPathSuffix: '.', })); - expect(stack).toHaveResource('AWS::Lambda::Function', { + Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { Handler: 'index.handler', }); }); @@ -69,7 +69,7 @@ test('PythonFunction with index in a subdirectory', () => { outputPathSuffix: '.', })); - expect(stack).toHaveResource('AWS::Lambda::Function', { + Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { Handler: 'inner/custom_index.custom_handler', }); }); @@ -122,21 +122,21 @@ test('allows specifying hash type', () => { assetHash: 'MY_CUSTOM_HASH', }); - expect(stack).toHaveResource('AWS::Lambda::Function', { + Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { Code: { S3Bucket: 'mock-bucket-name', S3Key: 'SOURCE_MOCK', }, }); - expect(stack).toHaveResource('AWS::Lambda::Function', { + Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { Code: { S3Bucket: 'mock-bucket-name', S3Key: 'OUTPUT_MOCK', }, }); - expect(stack).toHaveResource('AWS::Lambda::Function', { + Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { Code: { S3Bucket: 'mock-bucket-name', S3Key: 'MY_CUSTOM_HASH', diff --git a/packages/@aws-cdk/aws-lambda-python/test/layer.test.ts b/packages/@aws-cdk/aws-lambda-python/test/layer.test.ts index ff828301ee7f3..4f0199878a205 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/layer.test.ts +++ b/packages/@aws-cdk/aws-lambda-python/test/layer.test.ts @@ -1,4 +1,3 @@ -import '@aws-cdk/assert-internal/jest'; import * as path from 'path'; import { Runtime } from '@aws-cdk/aws-lambda'; import { Stack } from '@aws-cdk/core'; diff --git a/packages/@aws-cdk/aws-msk/package.json b/packages/@aws-cdk/aws-msk/package.json index 7309920e959ac..dd1523cffaf01 100644 --- a/packages/@aws-cdk/aws-msk/package.json +++ b/packages/@aws-cdk/aws-msk/package.json @@ -75,13 +75,13 @@ }, "license": "Apache-2.0", "devDependencies": { + "@aws-cdk/assertions": "0.0.0", "@types/jest": "^26.0.24", "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "cdk-integ-tools": "0.0.0", "pkglint": "0.0.0", - "jest": "^26.6.3", - "@aws-cdk/assert-internal": "0.0.0" + "jest": "^26.6.3" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-msk/test/cluster.test.ts b/packages/@aws-cdk/aws-msk/test/cluster.test.ts index 86b15c099f2a5..a990895e16d9c 100644 --- a/packages/@aws-cdk/aws-msk/test/cluster.test.ts +++ b/packages/@aws-cdk/aws-msk/test/cluster.test.ts @@ -1,6 +1,4 @@ -import { ResourcePart, SynthUtils } from '@aws-cdk/assert-internal'; -import '@aws-cdk/assert-internal/jest'; - +import { Template } from '@aws-cdk/assertions'; import * as acmpca from '@aws-cdk/aws-acmpca'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as kms from '@aws-cdk/aws-kms'; @@ -26,32 +24,31 @@ describe('MSK Cluster', () => { vpc, }); - expect(stack).toHaveResourceLike( + Template.fromStack(stack).hasResource( 'AWS::MSK::Cluster', { DeletionPolicy: 'Retain', UpdateReplacePolicy: 'Retain', }, - ResourcePart.CompleteDefinition, ); - expect(stack).toHaveResourceLike('AWS::MSK::Cluster', { + Template.fromStack(stack).hasResourceProperties('AWS::MSK::Cluster', { KafkaVersion: '2.6.1', }); - expect(stack).toHaveResourceLike('AWS::MSK::Cluster', { + Template.fromStack(stack).hasResourceProperties('AWS::MSK::Cluster', { EncryptionInfo: { EncryptionInTransit: { ClientBroker: 'TLS', InCluster: true }, }, }); - expect(stack).toHaveResourceLike('AWS::MSK::Cluster', { + Template.fromStack(stack).hasResourceProperties('AWS::MSK::Cluster', { NumberOfBrokerNodes: 2, }); - expect(stack).toHaveResourceLike('AWS::MSK::Cluster', { + Template.fromStack(stack).hasResourceProperties('AWS::MSK::Cluster', { BrokerNodeGroupInfo: { StorageInfo: { EBSStorageInfo: { VolumeSize: 1000 } }, }, }); - expect(stack).toHaveResource('AWS::EC2::SecurityGroup'); - expect(stack).toHaveResourceLike('AWS::MSK::Cluster', { + Template.fromStack(stack).resourceCountIs('AWS::EC2::SecurityGroup', 1); + Template.fromStack(stack).hasResourceProperties('AWS::MSK::Cluster', { BrokerNodeGroupInfo: { SecurityGroups: [ { @@ -141,7 +138,7 @@ describe('MSK Cluster', () => { iam: true, }), }); - expect(stack).toHaveResourceLike('AWS::MSK::Cluster', { + Template.fromStack(stack).hasResourceProperties('AWS::MSK::Cluster', { ClientAuthentication: { Sasl: { Iam: { Enabled: true } }, }, @@ -202,13 +199,13 @@ describe('MSK Cluster', () => { }); test('with alias msk/${clusterName}/sasl/scram', () => { - expect(stack).toHaveResourceLike('AWS::KMS::Alias', { + Template.fromStack(stack).hasResourceProperties('AWS::KMS::Alias', { AliasName: 'alias/msk/cluster/sasl/scram', }); }); test('with a policy allowing the secrets manager service to use the key', () => { - expect(stack).toHaveResourceLike('AWS::KMS::Key', { + Template.fromStack(stack).hasResourceProperties('AWS::KMS::Key', { KeyPolicy: { Statement: [ { @@ -281,6 +278,7 @@ describe('MSK Cluster', () => { Effect: 'Allow', Principal: { AWS: '*' }, Resource: '*', + Sid: 'Allow access through AWS Secrets Manager for all principals in the account that are authorized to use AWS Secrets Manager', }, ], }, @@ -319,7 +317,7 @@ describe('MSK Cluster', () => { ), }); - expect(stack).toHaveResourceLike('AWS::MSK::Cluster', { + Template.fromStack(stack).hasResourceProperties('AWS::MSK::Cluster', { BrokerNodeGroupInfo: { InstanceType: 'kafka.m5.xlarge' }, }); }); @@ -336,7 +334,7 @@ describe('MSK Cluster', () => { ), }); - expect(stack).toHaveResourceLike('AWS::MSK::Cluster', { + Template.fromStack(stack).hasResourceProperties('AWS::MSK::Cluster', { BrokerNodeGroupInfo: { InstanceType: 'kafka.m5.xlarge' }, }); }); @@ -352,7 +350,7 @@ describe('MSK Cluster', () => { }, }); - expect(stack).toHaveResourceLike('AWS::MSK::Cluster', { + Template.fromStack(stack).hasResourceProperties('AWS::MSK::Cluster', { LoggingInfo: { BrokerLogs: { CloudWatchLogs: { @@ -376,7 +374,7 @@ describe('MSK Cluster', () => { }, }); - expect(stack).toHaveResourceLike('AWS::MSK::Cluster', { + Template.fromStack(stack).hasResourceProperties('AWS::MSK::Cluster', { LoggingInfo: { BrokerLogs: { S3: { @@ -400,7 +398,7 @@ describe('MSK Cluster', () => { }, }); - expect(stack).toHaveResourceLike('AWS::MSK::Cluster', { + Template.fromStack(stack).hasResourceProperties('AWS::MSK::Cluster', { LoggingInfo: { BrokerLogs: { Firehose: { @@ -445,7 +443,7 @@ describe('MSK Cluster', () => { ebsStorageInfo: { encryptionKey: new kms.Key(stack, 'Key') }, }); - expect(stack).toHaveResourceLike('AWS::MSK::Cluster', { + Template.fromStack(stack).hasResourceProperties('AWS::MSK::Cluster', { EncryptionInfo: { EncryptionAtRest: { DataVolumeKMSKeyId: { @@ -526,7 +524,7 @@ describe('MSK Cluster', () => { ); // THEN - expect(SynthUtils.toCloudFormation(stack)).toMatchSnapshot(); + expect(Template.fromStack(stack)).toMatchSnapshot(); }); describe('when creating sasl/scram users', () => { @@ -555,7 +553,7 @@ describe('MSK Cluster', () => { const username = 'my-user'; cluster.addUser(username); - expect(stack).toHaveResourceLike('AWS::SecretsManager::Secret', { + Template.fromStack(stack).hasResourceProperties('AWS::SecretsManager::Secret', { 'Name': { 'Fn::Join': [ '', diff --git a/packages/@aws-cdk/aws-redshift/package.json b/packages/@aws-cdk/aws-redshift/package.json index 5ccccb2f4f2df..3bf492f83ee7b 100644 --- a/packages/@aws-cdk/aws-redshift/package.json +++ b/packages/@aws-cdk/aws-redshift/package.json @@ -73,12 +73,12 @@ }, "license": "Apache-2.0", "devDependencies": { + "@aws-cdk/assertions": "0.0.0", "@types/jest": "^26.0.24", "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "jest": "^26.6.3", - "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "pkglint": "0.0.0" }, "dependencies": { "@aws-cdk/aws-ec2": "0.0.0", diff --git a/packages/@aws-cdk/aws-redshift/test/cluster.test.ts b/packages/@aws-cdk/aws-redshift/test/cluster.test.ts index 7731320e8756c..28f2fbfd4655b 100644 --- a/packages/@aws-cdk/aws-redshift/test/cluster.test.ts +++ b/packages/@aws-cdk/aws-redshift/test/cluster.test.ts @@ -1,5 +1,4 @@ -import { ABSENT, expect as cdkExpect, haveResource, ResourcePart } from '@aws-cdk/assert-internal'; -import '@aws-cdk/assert-internal/jest'; +import { Match, Template } from '@aws-cdk/assertions'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as kms from '@aws-cdk/aws-kms'; import * as s3 from '@aws-cdk/aws-s3'; @@ -25,7 +24,7 @@ test('check that instantiation works', () => { }); // THEN - cdkExpect(stack).to(haveResource('AWS::Redshift::Cluster', { + Template.fromStack(stack).hasResource('AWS::Redshift::Cluster', { Properties: { AllowVersionUpgrade: true, MasterUsername: 'admin', @@ -42,9 +41,9 @@ test('check that instantiation works', () => { }, DeletionPolicy: 'Retain', UpdateReplacePolicy: 'Retain', - }, ResourcePart.CompleteDefinition)); + }); - cdkExpect(stack).to(haveResource('AWS::Redshift::ClusterSubnetGroup', { + Template.fromStack(stack).hasResource('AWS::Redshift::ClusterSubnetGroup', { Properties: { Description: 'Subnets for Redshift Redshift cluster', SubnetIds: [ @@ -55,7 +54,7 @@ test('check that instantiation works', () => { }, DeletionPolicy: 'Retain', UpdateReplacePolicy: 'Retain', - }, ResourcePart.CompleteDefinition)); + }); }); test('can create a cluster with imported vpc and security group', () => { @@ -76,12 +75,12 @@ test('can create a cluster with imported vpc and security group', () => { }); // THEN - cdkExpect(stack).to(haveResource('AWS::Redshift::Cluster', { + Template.fromStack(stack).hasResourceProperties('AWS::Redshift::Cluster', { ClusterSubnetGroupName: { Ref: 'RedshiftSubnetsDFE70E0A' }, MasterUsername: 'admin', MasterUserPassword: 'tooshort', VpcSecurityGroupIds: ['SecurityGroupId12345'], - })); + }); }); test('creates a secret when master credentials are not specified', () => { @@ -94,7 +93,7 @@ test('creates a secret when master credentials are not specified', () => { }); // THEN - cdkExpect(stack).to(haveResource('AWS::Redshift::Cluster', { + Template.fromStack(stack).hasResourceProperties('AWS::Redshift::Cluster', { MasterUsername: { 'Fn::Join': [ '', @@ -119,16 +118,16 @@ test('creates a secret when master credentials are not specified', () => { ], ], }, - })); + }); - cdkExpect(stack).to(haveResource('AWS::SecretsManager::Secret', { + Template.fromStack(stack).hasResourceProperties('AWS::SecretsManager::Secret', { GenerateSecretString: { ExcludeCharacters: '"@/\\\ \'', GenerateStringKey: 'password', PasswordLength: 30, SecretStringTemplate: '{"username":"admin"}', }, - })); + }); }); describe('node count', () => { @@ -144,10 +143,10 @@ describe('node count', () => { }); // THEN - cdkExpect(stack).to(haveResource('AWS::Redshift::Cluster', { + Template.fromStack(stack).hasResourceProperties('AWS::Redshift::Cluster', { ClusterType: 'single-node', - NumberOfNodes: ABSENT, - })); + NumberOfNodes: Match.absentProperty(), + }); }); test('Single Node Clusters treat 1 node as undefined', () => { @@ -162,10 +161,10 @@ describe('node count', () => { }); // THEN - cdkExpect(stack).to(haveResource('AWS::Redshift::Cluster', { + Template.fromStack(stack).hasResourceProperties('AWS::Redshift::Cluster', { ClusterType: 'single-node', - NumberOfNodes: ABSENT, - })); + NumberOfNodes: Match.absentProperty(), + }); }); test('Single Node Clusters throw if any other node count is specified', () => { @@ -192,10 +191,10 @@ describe('node count', () => { }); // THEN - cdkExpect(stack).to(haveResource('AWS::Redshift::Cluster', { + Template.fromStack(stack).hasResourceProperties('AWS::Redshift::Cluster', { ClusterType: 'multi-node', NumberOfNodes: 2, - })); + }); }); test.each([0, 1, -1, 101])('Multi-Node Clusters throw with %s nodes', (numberOfNodes: number) => { @@ -227,12 +226,12 @@ describe('node count', () => { }); // THEN - cdkExpect(stack).to(haveResource('AWS::Redshift::Cluster', { + Template.fromStack(stack).hasResourceProperties('AWS::Redshift::Cluster', { ClusterType: 'multi-node', NumberOfNodes: { Ref: 'numberOfNodes', }, - })); + }); }); }); @@ -247,14 +246,14 @@ test('create an encrypted cluster with custom KMS key', () => { }); // THEN - cdkExpect(stack).to(haveResource('AWS::Redshift::Cluster', { + Template.fromStack(stack).hasResourceProperties('AWS::Redshift::Cluster', { KmsKeyId: { 'Fn::GetAtt': [ 'Key961B73FD', 'Arn', ], }, - })); + }); }); test('cluster with parameter group', () => { @@ -275,9 +274,9 @@ test('cluster with parameter group', () => { }); // THEN - cdkExpect(stack).to(haveResource('AWS::Redshift::Cluster', { + Template.fromStack(stack).hasResourceProperties('AWS::Redshift::Cluster', { ClusterParameterGroupName: { Ref: 'ParamsA8366201' }, - })); + }); }); @@ -292,9 +291,9 @@ test('publicly accessible cluster', () => { }); // THEN - cdkExpect(stack).to(haveResource('AWS::Redshift::Cluster', { + Template.fromStack(stack).hasResourceProperties('AWS::Redshift::Cluster', { PubliclyAccessible: true, - })); + }); }); test('imported cluster with imported security group honors allowAllOutbound', () => { @@ -314,9 +313,9 @@ test('imported cluster with imported security group honors allowAllOutbound', () cluster.connections.allowToAnyIpv4(ec2.Port.tcp(443)); // THEN - cdkExpect(stack).to(haveResource('AWS::EC2::SecurityGroupEgress', { + Template.fromStack(stack).hasResourceProperties('AWS::EC2::SecurityGroupEgress', { GroupId: 'sg-123456789', - })); + }); }); test('can create a cluster with logging enabled', () => { @@ -334,12 +333,12 @@ test('can create a cluster with logging enabled', () => { }); // THEN - cdkExpect(stack).to(haveResource('AWS::Redshift::Cluster', { + Template.fromStack(stack).hasResourceProperties('AWS::Redshift::Cluster', { LoggingProperties: { BucketName: 'logging-bucket', S3KeyPrefix: 'prefix', }, - })); + }); }); test('throws when trying to add rotation to a cluster without secret', () => { @@ -408,8 +407,8 @@ test('can use existing cluster subnet group', () => { subnetGroup: ClusterSubnetGroup.fromClusterSubnetGroupName(stack, 'Group', 'my-existing-cluster-subnet-group'), }); - expect(stack).not.toHaveResource('AWS::Redshift::ClusterSubnetGroup'); - expect(stack).toHaveResourceLike('AWS::Redshift::Cluster', { + Template.fromStack(stack).resourceCountIs('AWS::Redshift::ClusterSubnetGroup', 0); + Template.fromStack(stack).hasResourceProperties('AWS::Redshift::Cluster', { ClusterSubnetGroupName: 'my-existing-cluster-subnet-group', }); }); diff --git a/packages/@aws-cdk/aws-redshift/test/parameter-group.test.ts b/packages/@aws-cdk/aws-redshift/test/parameter-group.test.ts index c49708b8eb557..1853fc0f5baf5 100644 --- a/packages/@aws-cdk/aws-redshift/test/parameter-group.test.ts +++ b/packages/@aws-cdk/aws-redshift/test/parameter-group.test.ts @@ -1,4 +1,4 @@ -import { expect as cdkExpect, haveResource } from '@aws-cdk/assert-internal'; +import { Template } from '@aws-cdk/assertions'; import * as cdk from '@aws-cdk/core'; import { ClusterParameterGroup } from '../lib'; @@ -15,7 +15,7 @@ test('create a cluster parameter group', () => { }); // THEN - cdkExpect(stack).to(haveResource('AWS::Redshift::ClusterParameterGroup', { + Template.fromStack(stack).hasResourceProperties('AWS::Redshift::ClusterParameterGroup', { Description: 'desc', ParameterGroupFamily: 'redshift-1.0', Parameters: [ @@ -24,6 +24,6 @@ test('create a cluster parameter group', () => { ParameterValue: 'value', }, ], - })); + }); }); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/subnet-group.test.ts b/packages/@aws-cdk/aws-redshift/test/subnet-group.test.ts index c27a4998ce76e..0fb5c6b17f21d 100644 --- a/packages/@aws-cdk/aws-redshift/test/subnet-group.test.ts +++ b/packages/@aws-cdk/aws-redshift/test/subnet-group.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import * as ec2 from '@aws-cdk/aws-ec2'; import { Stack } from '@aws-cdk/core'; import { ClusterSubnetGroup } from '../lib'; @@ -17,7 +17,7 @@ test('creates a subnet group from minimal properties', () => { vpc, }); - expect(stack).toHaveResource('AWS::Redshift::ClusterSubnetGroup', { + Template.fromStack(stack).hasResourceProperties('AWS::Redshift::ClusterSubnetGroup', { Description: 'MyGroup', SubnetIds: [ { Ref: 'VPCPrivateSubnet1Subnet8BCA10E0' }, @@ -33,7 +33,7 @@ describe('subnet selection', () => { vpc, }); - expect(stack).toHaveResource('AWS::Redshift::ClusterSubnetGroup', { + Template.fromStack(stack).hasResourceProperties('AWS::Redshift::ClusterSubnetGroup', { Description: 'MyGroup', SubnetIds: [ { Ref: 'VPCPrivateSubnet1Subnet8BCA10E0' }, @@ -49,7 +49,7 @@ describe('subnet selection', () => { vpcSubnets: { subnetType: ec2.SubnetType.PUBLIC }, }); - expect(stack).toHaveResource('AWS::Redshift::ClusterSubnetGroup', { + Template.fromStack(stack).hasResourceProperties('AWS::Redshift::ClusterSubnetGroup', { Description: 'MyGroup', SubnetIds: [ { Ref: 'VPCPublicSubnet1SubnetB4246D30' }, diff --git a/packages/@aws-cdk/aws-sam/package.json b/packages/@aws-cdk/aws-sam/package.json index 0fa097ffba069..9083b5b5d83bf 100644 --- a/packages/@aws-cdk/aws-sam/package.json +++ b/packages/@aws-cdk/aws-sam/package.json @@ -80,7 +80,7 @@ "jest": "^26.6.3", "pkglint": "0.0.0", "ts-jest": "^26.5.6", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-sam/test/api.test.ts b/packages/@aws-cdk/aws-sam/test/api.test.ts index bed8a90ae4e57..6b2fd6853ba8a 100644 --- a/packages/@aws-cdk/aws-sam/test/api.test.ts +++ b/packages/@aws-cdk/aws-sam/test/api.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import * as cdk from '@aws-cdk/core'; import * as sam from '../lib'; @@ -19,7 +19,7 @@ describe('AWS::Serverless::Api', () => { }, }); - expect(stack).toHaveResourceLike('AWS::Serverless::Api', { + Template.fromStack(stack).hasResourceProperties('AWS::Serverless::Api', { StageName: 'prod', EndpointConfiguration: { Type: 'GLOBAL', @@ -36,7 +36,7 @@ describe('AWS::Serverless::Api', () => { endpointConfiguration: 'GLOBAL', }); - expect(stack).toHaveResourceLike('AWS::Serverless::Api', { + Template.fromStack(stack).hasResourceProperties('AWS::Serverless::Api', { StageName: 'prod', EndpointConfiguration: 'GLOBAL', }); diff --git a/packages/@aws-cdk/aws-sam/test/application.test.ts b/packages/@aws-cdk/aws-sam/test/application.test.ts index 748eaf75732e9..5ba6e59a186ed 100644 --- a/packages/@aws-cdk/aws-sam/test/application.test.ts +++ b/packages/@aws-cdk/aws-sam/test/application.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import * as cdk from '@aws-cdk/core'; import { CfnApplication } from '../lib'; @@ -16,7 +16,7 @@ test('construct an AWS::Serverless::Application', () => { }, }); - expect(stack).toMatchTemplate({ + Template.fromStack(stack).templateMatches({ Transform: 'AWS::Serverless-2016-10-31', Resources: { App: { diff --git a/packages/@aws-cdk/aws-sam/test/function.test.ts b/packages/@aws-cdk/aws-sam/test/function.test.ts index 2633c1ea46af3..889e3366549ec 100644 --- a/packages/@aws-cdk/aws-sam/test/function.test.ts +++ b/packages/@aws-cdk/aws-sam/test/function.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import * as cdk from '@aws-cdk/core'; import * as sam from '../lib'; @@ -15,7 +15,7 @@ test("correctly chooses a string array from the type unions of the 'policies' pr policies: ['AWSLambdaExecute'], }); - expect(stack).toHaveResourceLike('AWS::Serverless::Function', { + Template.fromStack(stack).hasResourceProperties('AWS::Serverless::Function', { CodeUri: { Bucket: 'my-bucket', Key: 'my-key', diff --git a/packages/@aws-cdk/aws-servicecatalog/package.json b/packages/@aws-cdk/aws-servicecatalog/package.json index 442fdbe8eb5c8..bc482eedff82e 100644 --- a/packages/@aws-cdk/aws-servicecatalog/package.json +++ b/packages/@aws-cdk/aws-servicecatalog/package.json @@ -73,12 +73,12 @@ }, "license": "Apache-2.0", "devDependencies": { + "@aws-cdk/assertions": "0.0.0", "@types/jest": "^26.0.24", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "cfn2ts": "0.0.0", - "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "pkglint": "0.0.0" }, "dependencies": { "@aws-cdk/aws-iam": "0.0.0", diff --git a/packages/@aws-cdk/aws-servicecatalog/test/portfolio.test.ts b/packages/@aws-cdk/aws-servicecatalog/test/portfolio.test.ts index bf6ef2c09b0ed..216c34295cab2 100644 --- a/packages/@aws-cdk/aws-servicecatalog/test/portfolio.test.ts +++ b/packages/@aws-cdk/aws-servicecatalog/test/portfolio.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import * as iam from '@aws-cdk/aws-iam'; import * as sns from '@aws-cdk/aws-sns'; import * as cdk from '@aws-cdk/core'; @@ -18,7 +18,7 @@ describe('Portfolio', () => { providerName: 'testProvider', }); - expect(stack).toMatchTemplate({ + Template.fromStack(stack).templateMatches({ Resources: { MyPortfolio59CCA9C9: { Type: 'AWS::ServiceCatalog::Portfolio', @@ -39,7 +39,7 @@ describe('Portfolio', () => { messageLanguage: servicecatalog.MessageLanguage.ZH, }); - expect(stack).toHaveResourceLike('AWS::ServiceCatalog::Portfolio', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalog::Portfolio', { Description: 'test portfolio description', AcceptLanguage: servicecatalog.MessageLanguage.ZH, }); @@ -105,7 +105,7 @@ describe('Portfolio', () => { description: tokenDescription.valueAsString, }); - expect(stack).toHaveResourceLike('AWS::ServiceCatalog::Portfolio', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalog::Portfolio', { Description: { Ref: 'Description', }, @@ -120,7 +120,7 @@ describe('Portfolio', () => { providerName: 'testProvider', }); - expect(stack).toHaveResourceLike('AWS::ServiceCatalog::Portfolio', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalog::Portfolio', { DisplayName: { Ref: 'DisplayName', }, @@ -135,7 +135,7 @@ describe('Portfolio', () => { providerName: tokenProviderName.valueAsString, }); - expect(stack).toHaveResourceLike('AWS::ServiceCatalog::Portfolio', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalog::Portfolio', { ProviderName: { Ref: 'ProviderName', }, @@ -157,7 +157,7 @@ describe('Portfolio', () => { cdk.Tags.of(portfolio).add('myTestKey1', 'myTestKeyValue1'); cdk.Tags.of(portfolio).add('myTestKey2', 'myTestKeyValue2'); - expect(stack).toHaveResourceLike('AWS::ServiceCatalog::Portfolio', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalog::Portfolio', { Tags: [ { Key: 'myTestKey1', @@ -176,7 +176,7 @@ describe('Portfolio', () => { portfolio.shareWithAccount(shareAccountId); - expect(stack).toHaveResourceLike('AWS::ServiceCatalog::PortfolioShare', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalog::PortfolioShare', { AccountId: shareAccountId, }); }), @@ -189,7 +189,7 @@ describe('Portfolio', () => { messageLanguage: servicecatalog.MessageLanguage.EN, }); - expect(stack).toHaveResourceLike('AWS::ServiceCatalog::PortfolioShare', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalog::PortfolioShare', { AccountId: shareAccountId, ShareTagOptions: true, AcceptLanguage: 'en', @@ -201,7 +201,7 @@ describe('Portfolio', () => { portfolio.shareWithAccount(shareAccountId, { shareTagOptions: false }); - expect(stack).toHaveResourceLike('AWS::ServiceCatalog::PortfolioShare', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalog::PortfolioShare', { AccountId: shareAccountId, ShareTagOptions: false, }); @@ -212,7 +212,7 @@ describe('Portfolio', () => { portfolio.shareWithAccount(shareAccountId); - expect(stack).toHaveResourceLike('AWS::ServiceCatalog::PortfolioShare', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalog::PortfolioShare', { AccountId: shareAccountId, }); }), @@ -224,7 +224,7 @@ describe('Portfolio', () => { portfolio.giveAccessToRole(role); - expect(stack).toHaveResourceLike('AWS::ServiceCatalog::PortfolioPrincipalAssociation', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalog::PortfolioPrincipalAssociation', { PrincipalARN: { 'Fn::GetAtt': ['TestRole6C9272DF', 'Arn'] }, }); }), @@ -234,7 +234,7 @@ describe('Portfolio', () => { portfolio.giveAccessToUser(user); - expect(stack).toHaveResourceLike('AWS::ServiceCatalog::PortfolioPrincipalAssociation', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalog::PortfolioPrincipalAssociation', { PrincipalARN: { 'Fn::GetAtt': ['TestUser6A619381', 'Arn'] }, }); }), @@ -244,7 +244,7 @@ describe('Portfolio', () => { portfolio.giveAccessToGroup(group); - expect(stack).toHaveResourceLike('AWS::ServiceCatalog::PortfolioPrincipalAssociation', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalog::PortfolioPrincipalAssociation', { PrincipalARN: { 'Fn::GetAtt': ['TestGroupAF88660E', 'Arn'] }, }); }), @@ -288,14 +288,14 @@ describe('portfolio associations and product constraints', () => { test('basic portfolio product association', () => { portfolio.addProduct(product); - expect(stack).toHaveResource('AWS::ServiceCatalog::PortfolioProductAssociation'); + Template.fromStack(stack).resourceCountIs('AWS::ServiceCatalog::PortfolioProductAssociation', 1); }); test('portfolio product associations are idempotent', () => { portfolio.addProduct(product); portfolio.addProduct(product); // If not idempotent these calls should fail - expect(stack).toCountResources('AWS::ServiceCatalog::PortfolioProductAssociation', 1); //check anyway + Template.fromStack(stack).resourceCountIs('AWS::ServiceCatalog::PortfolioProductAssociation', 1); //check anyway }), test('add tag options to portfolio', () => { @@ -306,8 +306,8 @@ describe('portfolio associations and product constraints', () => { portfolio.associateTagOptions(tagOptions); - expect(stack).toCountResources('AWS::ServiceCatalog::TagOption', 3); //Generates a resource for each unique key-value pair - expect(stack).toHaveResource('AWS::ServiceCatalog::TagOptionAssociation'); + Template.fromStack(stack).resourceCountIs('AWS::ServiceCatalog::TagOption', 3); //Generates a resource for each unique key-value pair + Template.fromStack(stack).resourceCountIs('AWS::ServiceCatalog::TagOptionAssociation', 3); }), test('add tag options to portfolio as prop', () => { @@ -322,8 +322,8 @@ describe('portfolio associations and product constraints', () => { tagOptions: tagOptions, }); - expect(stack).toCountResources('AWS::ServiceCatalog::TagOption', 3); //Generates a resource for each unique key-value pair - expect(stack).toHaveResource('AWS::ServiceCatalog::TagOptionAssociation'); + Template.fromStack(stack).resourceCountIs('AWS::ServiceCatalog::TagOption', 3); //Generates a resource for each unique key-value pair + Template.fromStack(stack).resourceCountIs('AWS::ServiceCatalog::TagOptionAssociation', 3); }), test('adding identical tag options to portfolio is idempotent', () => { @@ -339,8 +339,8 @@ describe('portfolio associations and product constraints', () => { portfolio.associateTagOptions(tagOptions1); portfolio.associateTagOptions(tagOptions2); // If not idempotent this would fail - expect(stack).toCountResources('AWS::ServiceCatalog::TagOption', 3); //Generates a resource for each unique key-value pair - expect(stack).toHaveResource('AWS::ServiceCatalog::TagOptionAssociation'); + Template.fromStack(stack).resourceCountIs('AWS::ServiceCatalog::TagOption', 3); //Generates a resource for each unique key-value pair + Template.fromStack(stack).resourceCountIs('AWS::ServiceCatalog::TagOptionAssociation', 3); }), test('fails to add tag options with invalid minimum key length', () => { @@ -379,7 +379,7 @@ describe('portfolio associations and product constraints', () => { allow: true, }); - expect(stack).toHaveResourceLike('AWS::ServiceCatalog::ResourceUpdateConstraint', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalog::ResourceUpdateConstraint', { TagUpdateOnProvisionedProduct: 'ALLOWED', }); }); @@ -391,7 +391,7 @@ describe('portfolio associations and product constraints', () => { allow: false, }); - expect(stack).toHaveResourceLike('AWS::ServiceCatalog::ResourceUpdateConstraint', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalog::ResourceUpdateConstraint', { AcceptLanguage: servicecatalog.MessageLanguage.EN, Description: 'test constraint description', TagUpdateOnProvisionedProduct: 'NOT_ALLOWED', @@ -421,7 +421,7 @@ describe('portfolio associations and product constraints', () => { description: description, }); - expect(stack).toHaveResource('AWS::ServiceCatalog::LaunchNotificationConstraint', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalog::LaunchNotificationConstraint', { NotificationArns: [{ Ref: 'TopicBFC7AF6E' }], Description: description, PortfolioId: { Ref: 'MyPortfolio59CCA9C9' }, @@ -434,7 +434,7 @@ describe('portfolio associations and product constraints', () => { portfolio.notifyOnStackEvents(product, topic); - expect(stack).toCountResources('AWS::ServiceCatalog::LaunchNotificationConstraint', 1); + Template.fromStack(stack).resourceCountIs('AWS::ServiceCatalog::LaunchNotificationConstraint', 1); }), test('can add multiple notifications', () => { @@ -446,7 +446,7 @@ describe('portfolio associations and product constraints', () => { portfolio.notifyOnStackEvents(product, topic2); portfolio.notifyOnStackEvents(product, topic3); - expect(stack).toCountResources('AWS::ServiceCatalog::LaunchNotificationConstraint', 3); + Template.fromStack(stack).resourceCountIs('AWS::ServiceCatalog::LaunchNotificationConstraint', 3); }), test('fails to add same topic multiple times in event notification constraint', () => { @@ -473,7 +473,7 @@ describe('portfolio associations and product constraints', () => { }, }); - expect(stack).toHaveResourceLike('AWS::ServiceCatalog::LaunchTemplateConstraint', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalog::LaunchTemplateConstraint', { PortfolioId: { Ref: 'MyPortfolio59CCA9C9' }, ProductId: { Ref: 'MyProduct49A3C587' }, Rules: JSON.stringify( { @@ -505,7 +505,7 @@ describe('portfolio associations and product constraints', () => { messageLanguage: servicecatalog.MessageLanguage.EN, }); - expect(stack).toHaveResourceLike('AWS::ServiceCatalog::LaunchTemplateConstraint'); + Template.fromStack(stack).resourceCountIs('AWS::ServiceCatalog::LaunchTemplateConstraint', 1); }), test('set multiple CloudFormation parameters constraints', () => { @@ -529,7 +529,7 @@ describe('portfolio associations and product constraints', () => { }, }); - expect(stack).toCountResources('AWS::ServiceCatalog::LaunchTemplateConstraint', 2); + Template.fromStack(stack).resourceCountIs('AWS::ServiceCatalog::LaunchTemplateConstraint', 2); }), test('fails to set a duplicate CloudFormation parameters constraint', () => { @@ -575,7 +575,7 @@ describe('portfolio associations and product constraints', () => { messageLanguage: servicecatalog.MessageLanguage.EN, }); - expect(stack).toHaveResourceLike('AWS::ServiceCatalog::LaunchRoleConstraint', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalog::LaunchRoleConstraint', { PortfolioId: { Ref: 'MyPortfolio59CCA9C9' }, ProductId: { Ref: 'MyProduct49A3C587' }, Description: 'set launch role description', @@ -589,7 +589,7 @@ describe('portfolio associations and product constraints', () => { test('set launch role constraint still adds without explicit association', () => { portfolio.setLaunchRole(product, launchRole); - expect(stack).toHaveResourceLike('AWS::ServiceCatalog::LaunchRoleConstraint'); + Template.fromStack(stack).resourceCountIs('AWS::ServiceCatalog::LaunchRoleConstraint', 1); }), test('fails to add multiple set launch roles', () => { @@ -631,7 +631,7 @@ describe('portfolio associations and product constraints', () => { messageLanguage: servicecatalog.MessageLanguage.JP, }); - expect(stack).toHaveResourceLike('AWS::ServiceCatalog::StackSetConstraint', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalog::StackSetConstraint', { PortfolioId: { Ref: 'MyPortfolio59CCA9C9' }, ProductId: { Ref: 'MyProduct49A3C587' }, AdminRole: { @@ -658,7 +658,7 @@ describe('portfolio associations and product constraints', () => { allowStackSetInstanceOperations: true, }); - expect(stack).toHaveResourceLike('AWS::ServiceCatalog::StackSetConstraint'); + Template.fromStack(stack).resourceCountIs('AWS::ServiceCatalog::StackSetConstraint', 1); }), test('fails to add multiple deploy with stackset constraints', () => { diff --git a/packages/@aws-cdk/aws-servicecatalog/test/product.test.ts b/packages/@aws-cdk/aws-servicecatalog/test/product.test.ts index 7325549db63d3..57f4e50bda0c0 100644 --- a/packages/@aws-cdk/aws-servicecatalog/test/product.test.ts +++ b/packages/@aws-cdk/aws-servicecatalog/test/product.test.ts @@ -1,5 +1,5 @@ -import '@aws-cdk/assert-internal/jest'; import * as path from 'path'; +import { Match, Template } from '@aws-cdk/assertions'; import * as cdk from '@aws-cdk/core'; import * as servicecatalog from '../lib'; @@ -24,7 +24,7 @@ describe('Product', () => { ], }); - expect(stack).toHaveResourceLike('AWS::ServiceCatalog::CloudFormationProduct', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalog::CloudFormationProduct', { Name: 'testProduct', Owner: 'testOwner', ProvisioningArtifactParameters: [ @@ -50,7 +50,7 @@ describe('Product', () => { ], }); - expect(stack).toHaveResourceLike('AWS::ServiceCatalog::CloudFormationProduct', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalog::CloudFormationProduct', { Name: 'testProduct', Owner: 'testOwner', ProvisioningArtifactParameters: [ @@ -100,16 +100,16 @@ describe('Product', () => { ], }); - expect(stack).toHaveResourceLike('AWS::ServiceCatalog::CloudFormationProduct', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalog::CloudFormationProduct', { Name: 'testProduct', Owner: 'testOwner', - ProvisioningArtifactParameters: [ - { + ProvisioningArtifactParameters: Match.arrayWith([ + Match.objectLike({ 'Info': { 'LoadTemplateFromURL': 'https://awsdocs.s3.amazonaws.com/servicecatalog/development-environment.template', }, - }, - ], + }), + ]), }); }), diff --git a/packages/@aws-cdk/aws-servicecatalogappregistry/package.json b/packages/@aws-cdk/aws-servicecatalogappregistry/package.json index ecf6b6990c3ad..921cb1fd4de60 100644 --- a/packages/@aws-cdk/aws-servicecatalogappregistry/package.json +++ b/packages/@aws-cdk/aws-servicecatalogappregistry/package.json @@ -77,7 +77,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert-internal": "0.0.0", + "@aws-cdk/assertions": "0.0.0", "@types/jest": "^26.0.24", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", diff --git a/packages/@aws-cdk/aws-servicecatalogappregistry/test/application.test.ts b/packages/@aws-cdk/aws-servicecatalogappregistry/test/application.test.ts index bdd4e26af2616..2cd30da1b5eb8 100644 --- a/packages/@aws-cdk/aws-servicecatalogappregistry/test/application.test.ts +++ b/packages/@aws-cdk/aws-servicecatalogappregistry/test/application.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import * as cdk from '@aws-cdk/core'; import * as appreg from '../lib'; @@ -14,7 +14,7 @@ describe('Application', () => { applicationName: 'testApplication', }); - expect(stack).toMatchTemplate({ + Template.fromStack(stack).templateMatches({ Resources: { MyApplication5C63EC1D: { Type: 'AWS::ServiceCatalogAppRegistry::Application', @@ -33,7 +33,7 @@ describe('Application', () => { description: description, }); - expect(stack).toHaveResourceLike('AWS::ServiceCatalogAppRegistry::Application', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalogAppRegistry::Application', { Description: description, }); }), @@ -46,7 +46,7 @@ describe('Application', () => { cdk.Tags.of(application).add('key1', 'value1'); cdk.Tags.of(application).add('key2', 'value2'); - expect(stack).toHaveResourceLike('AWS::ServiceCatalogAppRegistry::Application', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalogAppRegistry::Application', { Tags: { key1: 'value1', key2: 'value2', @@ -76,7 +76,7 @@ describe('Application', () => { description: tokenDescription.valueAsString, }); - expect(stack).toHaveResourceLike('AWS::ServiceCatalogAppRegistry::Application', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalogAppRegistry::Application', { Description: { Ref: 'Description', }, @@ -90,7 +90,7 @@ describe('Application', () => { applicationName: tokenApplicationName.valueAsString, }); - expect(stack).toHaveResourceLike('AWS::ServiceCatalogAppRegistry::Application', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalogAppRegistry::Application', { Name: { Ref: 'ApplicationName', }, @@ -147,7 +147,7 @@ describe('Application', () => { application.associateAttributeGroup(attributeGroup); - expect(stack).toHaveResourceLike('AWS::ServiceCatalogAppRegistry::AttributeGroupAssociation', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalogAppRegistry::AttributeGroupAssociation', { Application: { 'Fn::GetAtt': ['MyApplication5C63EC1D', 'Id'] }, AttributeGroup: { 'Fn::GetAtt': ['AttributeGroup409C6335', 'Id'] }, }); @@ -163,7 +163,7 @@ describe('Application', () => { application.associateAttributeGroup(attributeGroup); application.associateAttributeGroup(attributeGroup); - expect(stack).toCountResources('AWS::ServiceCatalogAppRegistry::AttributeGroupAssociation', 1); + Template.fromStack(stack).resourceCountIs('AWS::ServiceCatalogAppRegistry::AttributeGroupAssociation', 1); }), test('multiple applications and attribute groups can associate', () => { @@ -187,7 +187,7 @@ describe('Application', () => { application2.associateAttributeGroup(attributeGroup1); application2.associateAttributeGroup(attributeGroup2); - expect(stack).toCountResources('AWS::ServiceCatalogAppRegistry::AttributeGroupAssociation', 4); + Template.fromStack(stack).resourceCountIs('AWS::ServiceCatalogAppRegistry::AttributeGroupAssociation', 4); }), test('associate resource', () => { @@ -195,7 +195,7 @@ describe('Application', () => { application.associateStack(resource); - expect(stack).toHaveResourceLike('AWS::ServiceCatalogAppRegistry::ResourceAssociation', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalogAppRegistry::ResourceAssociation', { Application: { 'Fn::GetAtt': ['MyApplication5C63EC1D', 'Id'] }, Resource: { 'Fn::ImportValue': 'MyStack:MyStackExportsOutputRefAWSStackId23D778D8' }, }); @@ -208,7 +208,7 @@ describe('Application', () => { application.associateStack(resource); application.associateStack(resource); - expect(stack).toCountResources('AWS::ServiceCatalogAppRegistry::ResourceAssociation', 1); + Template.fromStack(stack).resourceCountIs('AWS::ServiceCatalogAppRegistry::ResourceAssociation', 1); }); }); }); diff --git a/packages/@aws-cdk/aws-servicecatalogappregistry/test/attribute-group.test.ts b/packages/@aws-cdk/aws-servicecatalogappregistry/test/attribute-group.test.ts index 35bce4b8c5e29..728ee04976623 100644 --- a/packages/@aws-cdk/aws-servicecatalogappregistry/test/attribute-group.test.ts +++ b/packages/@aws-cdk/aws-servicecatalogappregistry/test/attribute-group.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import { Template } from '@aws-cdk/assertions'; import * as cdk from '@aws-cdk/core'; import * as appreg from '../lib'; @@ -17,7 +17,7 @@ describe('Attribute Group', () => { }, }); - expect(stack).toMatchTemplate({ + Template.fromStack(stack).templateMatches({ Resources: { MyAttributeGroup99099500: { Type: 'AWS::ServiceCatalogAppRegistry::AttributeGroup', @@ -42,7 +42,7 @@ describe('Attribute Group', () => { description: description, }); - expect(stack).toHaveResourceLike('AWS::ServiceCatalogAppRegistry::AttributeGroup', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalogAppRegistry::AttributeGroup', { Description: description, }); }), @@ -58,7 +58,7 @@ describe('Attribute Group', () => { cdk.Tags.of(attributeGroup).add('key1', 'value1'); cdk.Tags.of(attributeGroup).add('key2', 'value2'); - expect(stack).toHaveResourceLike('AWS::ServiceCatalogAppRegistry::AttributeGroup', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalogAppRegistry::AttributeGroup', { Tags: { key1: 'value1', key2: 'value2', @@ -90,7 +90,7 @@ describe('Attribute Group', () => { description: tokenDescription.valueAsString, }); - expect(stack).toHaveResourceLike('AWS::ServiceCatalogAppRegistry::AttributeGroup', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalogAppRegistry::AttributeGroup', { Description: { Ref: 'Description', }, @@ -107,7 +107,7 @@ describe('Attribute Group', () => { }, }); - expect(stack).toHaveResourceLike('AWS::ServiceCatalogAppRegistry::AttributeGroup', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalogAppRegistry::AttributeGroup', { Name: { Ref: 'AttributeGroupName', }, @@ -165,7 +165,7 @@ describe('Attribute Group', () => { attributes: {}, }); - expect(stack).toHaveResourceLike('AWS::ServiceCatalogAppRegistry::AttributeGroup', { + Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalogAppRegistry::AttributeGroup', { Attributes: {}, }); }); diff --git a/packages/@aws-cdk/aws-servicecatalogappregistry/test/servicecatalogappregistry.test.ts b/packages/@aws-cdk/aws-servicecatalogappregistry/test/servicecatalogappregistry.test.ts deleted file mode 100644 index c4505ad966984..0000000000000 --- a/packages/@aws-cdk/aws-servicecatalogappregistry/test/servicecatalogappregistry.test.ts +++ /dev/null @@ -1,6 +0,0 @@ -import '@aws-cdk/assert-internal/jest'; -import {} from '../lib'; - -test('No tests are specified for this package', () => { - expect(true).toBe(true); -}); From 4d9196012f5dc0d863bca71063ae1a524cac05b0 Mon Sep 17 00:00:00 2001 From: Niranjan Jayakar Date: Tue, 3 Aug 2021 17:42:49 +0100 Subject: [PATCH 04/47] chore: switch cfn only modules to assertions (#15869) Switch all current cfn-only packages to depend on `assertions` instead of `assert`. Update `example-construct-library` to showcase using the `assertions` module. Update `cfnspec` so that new packages are created with the `assertions` module. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/alexa-ask/package.json | 2 +- packages/@aws-cdk/alexa-ask/test/ask.test.ts | 2 +- .../@aws-cdk/aws-accessanalyzer/package.json | 2 +- .../test/accessanalyzer.test.ts | 2 +- packages/@aws-cdk/aws-amazonmq/package.json | 2 +- .../aws-amazonmq/test/amazonmq.test.ts | 2 +- packages/@aws-cdk/aws-appconfig/package.json | 2 +- .../aws-appconfig/test/appconfig.test.ts | 2 +- packages/@aws-cdk/aws-appflow/package.json | 2 +- .../@aws-cdk/aws-appflow/test/appflow.test.ts | 2 +- .../@aws-cdk/aws-appintegrations/package.json | 2 +- .../test/appintegrations.test.ts | 2 +- .../aws-applicationinsights/package.json | 2 +- .../test/applicationinsights.test.ts | 2 +- packages/@aws-cdk/aws-apprunner/package.json | 2 +- .../aws-apprunner/test/apprunner.test.ts | 2 +- packages/@aws-cdk/aws-appstream/package.json | 2 +- .../aws-appstream/test/appstream.test.ts | 2 +- packages/@aws-cdk/aws-athena/package.json | 2 +- .../@aws-cdk/aws-athena/test/athena.test.ts | 11 ++++----- .../@aws-cdk/aws-auditmanager/package.json | 2 +- .../test/auditmanager.test.ts | 2 +- .../aws-autoscalingplans/package.json | 2 +- .../test/autoscalingplans.test.ts | 2 +- packages/@aws-cdk/aws-budgets/package.json | 2 +- .../@aws-cdk/aws-budgets/test/budgets.test.ts | 2 +- packages/@aws-cdk/aws-cassandra/package.json | 2 +- .../aws-cassandra/test/cassandra.test.ts | 2 +- packages/@aws-cdk/aws-ce/package.json | 2 +- packages/@aws-cdk/aws-ce/test/ce.test.ts | 2 +- .../@aws-cdk/aws-codeartifact/package.json | 2 +- .../test/codeartifact.test.ts | 2 +- .../aws-codegurureviewer/package.json | 2 +- .../test/codegurureviewer.test.ts | 2 +- .../aws-codestarconnections/package.json | 2 +- .../test/codestarconnections.test.ts | 2 +- packages/@aws-cdk/aws-connect/package.json | 2 +- .../@aws-cdk/aws-connect/test/connect.test.ts | 2 +- packages/@aws-cdk/aws-cur/package.json | 2 +- packages/@aws-cdk/aws-cur/test/cur.test.ts | 2 +- .../aws-customerprofiles/package.json | 2 +- .../test/customerprofiles.test.ts | 2 +- packages/@aws-cdk/aws-databrew/package.json | 2 +- .../aws-databrew/test/databrew.test.ts | 2 +- .../@aws-cdk/aws-datapipeline/package.json | 2 +- .../test/datapipeline.test.ts | 2 +- packages/@aws-cdk/aws-datasync/package.json | 2 +- .../aws-datasync/test/datasync.test.ts | 2 +- packages/@aws-cdk/aws-dax/package.json | 2 +- packages/@aws-cdk/aws-dax/test/dax.test.ts | 2 +- packages/@aws-cdk/aws-detective/package.json | 2 +- .../aws-detective/test/detective.test.ts | 2 +- packages/@aws-cdk/aws-devopsguru/package.json | 2 +- .../aws-devopsguru/test/devopsguru.test.ts | 2 +- .../aws-directoryservice/package.json | 2 +- .../test/directoryservice.test.ts | 2 +- packages/@aws-cdk/aws-dlm/package.json | 2 +- packages/@aws-cdk/aws-dlm/test/dlm.test.ts | 2 +- packages/@aws-cdk/aws-dms/package.json | 2 +- packages/@aws-cdk/aws-dms/test/dms.test.ts | 2 +- .../@aws-cdk/aws-elasticache/package.json | 2 +- .../aws-elasticache/test/elasticache.test.ts | 2 +- .../aws-elasticbeanstalk/package.json | 2 +- .../test/elasticbeanstalk.test.ts | 2 +- packages/@aws-cdk/aws-emr/package.json | 2 +- packages/@aws-cdk/aws-emr/test/emr.test.ts | 2 +- .../@aws-cdk/aws-emrcontainers/package.json | 2 +- .../test/emrcontainers.test.ts | 2 +- .../@aws-cdk/aws-eventschemas/package.json | 2 +- .../test/eventschemas.test.ts | 2 +- packages/@aws-cdk/aws-finspace/package.json | 2 +- .../aws-finspace/test/finspace.test.ts | 2 +- packages/@aws-cdk/aws-fis/package.json | 2 +- packages/@aws-cdk/aws-fis/test/fis.test.ts | 2 +- packages/@aws-cdk/aws-fms/package.json | 2 +- packages/@aws-cdk/aws-fms/test/fms.test.ts | 2 +- .../@aws-cdk/aws-frauddetector/package.json | 2 +- .../test/frauddetector.test.ts | 2 +- packages/@aws-cdk/aws-gamelift/package.json | 2 +- .../aws-gamelift/test/gamelift.test.ts | 2 +- packages/@aws-cdk/aws-greengrass/package.json | 2 +- .../aws-greengrass/test/greengrass.test.ts | 2 +- .../@aws-cdk/aws-greengrassv2/package.json | 2 +- .../aws-greengrassv2/test/greengrass.test.ts | 2 +- .../@aws-cdk/aws-groundstation/package.json | 2 +- .../test/groundstation.test.ts | 2 +- packages/@aws-cdk/aws-guardduty/package.json | 2 +- .../aws-guardduty/test/guardduty.test.ts | 2 +- .../@aws-cdk/aws-imagebuilder/package.json | 2 +- .../test/imagebuilder.test.ts | 2 +- packages/@aws-cdk/aws-inspector/package.json | 2 +- .../aws-inspector/test/inspector.test.ts | 2 +- packages/@aws-cdk/aws-iot/package.json | 2 +- packages/@aws-cdk/aws-iot/test/iot.test.ts | 2 +- packages/@aws-cdk/aws-iot1click/package.json | 2 +- .../aws-iot1click/test/iot1click.test.ts | 2 +- .../@aws-cdk/aws-iotanalytics/package.json | 2 +- .../test/iotanalytics.test.ts | 2 +- .../aws-iotcoredeviceadvisor/package.json | 2 +- .../test/iotcoredeviceadvisor.test.ts | 2 +- packages/@aws-cdk/aws-iotevents/package.json | 2 +- .../aws-iotevents/test/iotevents.test.ts | 2 +- .../@aws-cdk/aws-iotfleethub/package.json | 2 +- .../aws-iotfleethub/test/iotfleethub.test.ts | 2 +- .../@aws-cdk/aws-iotsitewise/package.json | 2 +- .../aws-iotsitewise/test/iotsitewise.test.ts | 2 +- .../@aws-cdk/aws-iotthingsgraph/package.json | 2 +- .../test/iotthingsgraph.test.ts | 2 +- .../@aws-cdk/aws-iotwireless/package.json | 2 +- .../aws-iotwireless/test/iotwireless.test.ts | 2 +- packages/@aws-cdk/aws-kendra/package.json | 2 +- .../@aws-cdk/aws-kendra/test/kendra.test.ts | 2 +- .../aws-kinesisanalytics/package.json | 2 +- .../test/kinesisanalytics.test.ts | 2 +- .../@aws-cdk/aws-lakeformation/package.json | 2 +- .../test/lakeformation.test.ts | 2 +- .../@aws-cdk/aws-licensemanager/package.json | 2 +- .../test/licensemanager.test.ts | 2 +- packages/@aws-cdk/aws-location/package.json | 2 +- .../aws-location/test/location.test.ts | 2 +- .../aws-lookoutequipment/package.json | 2 +- .../test/lookoutequipment.test.ts | 2 +- .../@aws-cdk/aws-lookoutmetrics/package.json | 2 +- .../test/lookoutmetrics.test.ts | 2 +- .../@aws-cdk/aws-lookoutvision/package.json | 2 +- .../test/lookoutvision.test.ts | 2 +- packages/@aws-cdk/aws-macie/package.json | 2 +- .../@aws-cdk/aws-macie/test/macie.test.ts | 2 +- .../aws-managedblockchain/package.json | 2 +- .../test/managedblockchain.test.ts | 2 +- .../@aws-cdk/aws-mediaconnect/package.json | 2 +- .../test/mediaconnect.test.ts | 2 +- .../@aws-cdk/aws-mediaconvert/package.json | 2 +- .../test/mediaconvert.test.ts | 2 +- packages/@aws-cdk/aws-medialive/package.json | 2 +- .../aws-medialive/test/medialive.test.ts | 2 +- .../@aws-cdk/aws-mediapackage/package.json | 2 +- .../test/mediapackage.test.ts | 2 +- packages/@aws-cdk/aws-mediastore/package.json | 2 +- .../aws-mediastore/test/mediastore.test.ts | 2 +- packages/@aws-cdk/aws-mwaa/package.json | 2 +- packages/@aws-cdk/aws-mwaa/test/mwaa.test.ts | 2 +- .../@aws-cdk/aws-networkfirewall/package.json | 2 +- .../test/networkfirewall.test.ts | 2 +- .../@aws-cdk/aws-networkmanager/package.json | 2 +- .../test/networkmanager.test.ts | 2 +- .../@aws-cdk/aws-nimblestudio/package.json | 2 +- .../test/nimblestudio.test.ts | 2 +- packages/@aws-cdk/aws-opsworks/package.json | 2 +- .../aws-opsworks/test/opsworks.test.ts | 2 +- packages/@aws-cdk/aws-opsworkscm/package.json | 2 +- .../aws-opsworkscm/test/opsworkscm.test.ts | 2 +- packages/@aws-cdk/aws-pinpoint/package.json | 2 +- .../aws-pinpoint/test/pinpoint.test.ts | 2 +- .../@aws-cdk/aws-pinpointemail/package.json | 2 +- .../test/pinpointemail.test.ts | 2 +- packages/@aws-cdk/aws-qldb/package.json | 2 +- packages/@aws-cdk/aws-qldb/test/qldb.test.ts | 2 +- packages/@aws-cdk/aws-quicksight/package.json | 2 +- .../aws-quicksight/test/quicksight.test.ts | 2 +- packages/@aws-cdk/aws-ram/package.json | 2 +- packages/@aws-cdk/aws-ram/test/ram.test.ts | 2 +- .../@aws-cdk/aws-resourcegroups/package.json | 2 +- .../test/resourcegroups.test.ts | 2 +- packages/@aws-cdk/aws-robomaker/package.json | 2 +- .../aws-robomaker/test/robomaker.test.ts | 2 +- .../@aws-cdk/aws-route53resolver/package.json | 2 +- .../test/route53resolver.test.ts | 2 +- .../@aws-cdk/aws-s3objectlambda/package.json | 2 +- .../test/s3objectlambda.test.ts | 2 +- packages/@aws-cdk/aws-s3outposts/package.json | 2 +- .../aws-s3outposts/test/s3outposts.test.ts | 2 +- packages/@aws-cdk/aws-sagemaker/package.json | 2 +- .../aws-sagemaker/test/sagemaker.test.ts | 2 +- packages/@aws-cdk/aws-sdb/package.json | 2 +- packages/@aws-cdk/aws-sdb/test/sdb.test.ts | 2 +- .../@aws-cdk/aws-securityhub/package.json | 2 +- .../aws-securityhub/test/securityhub.test.ts | 2 +- .../@aws-cdk/aws-ssmcontacts/package.json | 2 +- .../aws-ssmcontacts/test/ssmcontacts.test.ts | 2 +- .../@aws-cdk/aws-ssmincidents/package.json | 2 +- .../test/ssmincidents.test.ts | 2 +- packages/@aws-cdk/aws-sso/package.json | 2 +- packages/@aws-cdk/aws-sso/test/sso.test.ts | 2 +- packages/@aws-cdk/aws-timestream/package.json | 2 +- .../aws-timestream/test/timestream.test.ts | 2 +- packages/@aws-cdk/aws-transfer/package.json | 2 +- .../aws-transfer/test/transfer.test.ts | 2 +- packages/@aws-cdk/aws-waf/package.json | 2 +- packages/@aws-cdk/aws-waf/test/waf.test.ts | 2 +- .../@aws-cdk/aws-wafregional/package.json | 2 +- .../aws-wafregional/test/wafregional.test.ts | 2 +- packages/@aws-cdk/aws-wafv2/package.json | 2 +- .../@aws-cdk/aws-wafv2/test/wafv2.test.ts | 2 +- packages/@aws-cdk/aws-workspaces/package.json | 2 +- .../aws-workspaces/test/workspaces.test.ts | 2 +- packages/@aws-cdk/aws-xray/package.json | 2 +- packages/@aws-cdk/aws-xray/test/xray.test.ts | 2 +- .../build-tools/create-missing-libraries.ts | 4 ++-- .../example-construct-library/package.json | 4 ++-- .../test/example-resource.test.ts | 24 +++++++++---------- 201 files changed, 217 insertions(+), 220 deletions(-) diff --git a/packages/@aws-cdk/alexa-ask/package.json b/packages/@aws-cdk/alexa-ask/package.json index 6462fd3fcc4ee..cf42ce0ff70cd 100644 --- a/packages/@aws-cdk/alexa-ask/package.json +++ b/packages/@aws-cdk/alexa-ask/package.json @@ -78,7 +78,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/alexa-ask/test/ask.test.ts b/packages/@aws-cdk/alexa-ask/test/ask.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/alexa-ask/test/ask.test.ts +++ b/packages/@aws-cdk/alexa-ask/test/ask.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-accessanalyzer/package.json b/packages/@aws-cdk/aws-accessanalyzer/package.json index dd207f1859f38..ef5d378f88205 100644 --- a/packages/@aws-cdk/aws-accessanalyzer/package.json +++ b/packages/@aws-cdk/aws-accessanalyzer/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-accessanalyzer/test/accessanalyzer.test.ts b/packages/@aws-cdk/aws-accessanalyzer/test/accessanalyzer.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-accessanalyzer/test/accessanalyzer.test.ts +++ b/packages/@aws-cdk/aws-accessanalyzer/test/accessanalyzer.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-amazonmq/package.json b/packages/@aws-cdk/aws-amazonmq/package.json index 4cdda66e3dbf4..393ef14b15326 100644 --- a/packages/@aws-cdk/aws-amazonmq/package.json +++ b/packages/@aws-cdk/aws-amazonmq/package.json @@ -78,7 +78,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-amazonmq/test/amazonmq.test.ts b/packages/@aws-cdk/aws-amazonmq/test/amazonmq.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-amazonmq/test/amazonmq.test.ts +++ b/packages/@aws-cdk/aws-amazonmq/test/amazonmq.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-appconfig/package.json b/packages/@aws-cdk/aws-appconfig/package.json index 7ae2918e7a24a..87877e48cadd7 100644 --- a/packages/@aws-cdk/aws-appconfig/package.json +++ b/packages/@aws-cdk/aws-appconfig/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-appconfig/test/appconfig.test.ts b/packages/@aws-cdk/aws-appconfig/test/appconfig.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-appconfig/test/appconfig.test.ts +++ b/packages/@aws-cdk/aws-appconfig/test/appconfig.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-appflow/package.json b/packages/@aws-cdk/aws-appflow/package.json index d3892bc22a18e..3c1164cb36e44 100644 --- a/packages/@aws-cdk/aws-appflow/package.json +++ b/packages/@aws-cdk/aws-appflow/package.json @@ -76,7 +76,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-appflow/test/appflow.test.ts b/packages/@aws-cdk/aws-appflow/test/appflow.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-appflow/test/appflow.test.ts +++ b/packages/@aws-cdk/aws-appflow/test/appflow.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-appintegrations/package.json b/packages/@aws-cdk/aws-appintegrations/package.json index cc372cc4fb1f7..df834c9675083 100644 --- a/packages/@aws-cdk/aws-appintegrations/package.json +++ b/packages/@aws-cdk/aws-appintegrations/package.json @@ -78,7 +78,7 @@ "license": "Apache-2.0", "devDependencies": { "@types/jest": "^26.0.24", - "@aws-cdk/assert-internal": "0.0.0", + "@aws-cdk/assertions": "0.0.0", "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0" diff --git a/packages/@aws-cdk/aws-appintegrations/test/appintegrations.test.ts b/packages/@aws-cdk/aws-appintegrations/test/appintegrations.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-appintegrations/test/appintegrations.test.ts +++ b/packages/@aws-cdk/aws-appintegrations/test/appintegrations.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-applicationinsights/package.json b/packages/@aws-cdk/aws-applicationinsights/package.json index 0dcc760a0ef2b..3b0b998051313 100644 --- a/packages/@aws-cdk/aws-applicationinsights/package.json +++ b/packages/@aws-cdk/aws-applicationinsights/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-applicationinsights/test/applicationinsights.test.ts b/packages/@aws-cdk/aws-applicationinsights/test/applicationinsights.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-applicationinsights/test/applicationinsights.test.ts +++ b/packages/@aws-cdk/aws-applicationinsights/test/applicationinsights.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-apprunner/package.json b/packages/@aws-cdk/aws-apprunner/package.json index 20db35c7a3264..ffbecdc004aa6 100644 --- a/packages/@aws-cdk/aws-apprunner/package.json +++ b/packages/@aws-cdk/aws-apprunner/package.json @@ -78,7 +78,7 @@ "license": "Apache-2.0", "devDependencies": { "@types/jest": "^26.0.24", - "@aws-cdk/assert-internal": "0.0.0", + "@aws-cdk/assertions": "0.0.0", "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0" diff --git a/packages/@aws-cdk/aws-apprunner/test/apprunner.test.ts b/packages/@aws-cdk/aws-apprunner/test/apprunner.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-apprunner/test/apprunner.test.ts +++ b/packages/@aws-cdk/aws-apprunner/test/apprunner.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-appstream/package.json b/packages/@aws-cdk/aws-appstream/package.json index 2bdd6def0c6f8..3605b0f0e9ccf 100644 --- a/packages/@aws-cdk/aws-appstream/package.json +++ b/packages/@aws-cdk/aws-appstream/package.json @@ -78,7 +78,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-appstream/test/appstream.test.ts b/packages/@aws-cdk/aws-appstream/test/appstream.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-appstream/test/appstream.test.ts +++ b/packages/@aws-cdk/aws-appstream/test/appstream.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-athena/package.json b/packages/@aws-cdk/aws-athena/package.json index 0170da3267a71..4248daf56fb68 100644 --- a/packages/@aws-cdk/aws-athena/package.json +++ b/packages/@aws-cdk/aws-athena/package.json @@ -79,7 +79,7 @@ "nodeunit-shim": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-athena/test/athena.test.ts b/packages/@aws-cdk/aws-athena/test/athena.test.ts index 3e954a5b6c39b..5e84a85f5e1cf 100644 --- a/packages/@aws-cdk/aws-athena/test/athena.test.ts +++ b/packages/@aws-cdk/aws-athena/test/athena.test.ts @@ -1,5 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; -import { expect, haveResource } from '@aws-cdk/assert-internal'; +import { Template } from '@aws-cdk/assertions'; import * as cdk from '@aws-cdk/core'; import { CfnWorkGroup } from '../lib'; @@ -28,7 +27,7 @@ describe('Athena Workgroup Tags', () => { }, }, }); - expect(stack).to(haveResource('AWS::Athena::WorkGroup', { + Template.fromStack(stack).hasResourceProperties('AWS::Athena::WorkGroup', { Tags: [ { Key: 'key1', @@ -39,7 +38,7 @@ describe('Athena Workgroup Tags', () => { Value: 'value2', }, ], - })); + }); }); test('test tag aspect spec correction', () => { const stack = new cdk.Stack(); @@ -57,7 +56,7 @@ describe('Athena Workgroup Tags', () => { }, }, }); - expect(stack).to(haveResource('AWS::Athena::WorkGroup', { + Template.fromStack(stack).hasResourceProperties('AWS::Athena::WorkGroup', { Tags: [ { Key: 'key1', @@ -68,6 +67,6 @@ describe('Athena Workgroup Tags', () => { Value: 'value2', }, ], - })); + }); }); }); diff --git a/packages/@aws-cdk/aws-auditmanager/package.json b/packages/@aws-cdk/aws-auditmanager/package.json index e1c4d99497507..f667b4c12c375 100644 --- a/packages/@aws-cdk/aws-auditmanager/package.json +++ b/packages/@aws-cdk/aws-auditmanager/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-auditmanager/test/auditmanager.test.ts b/packages/@aws-cdk/aws-auditmanager/test/auditmanager.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-auditmanager/test/auditmanager.test.ts +++ b/packages/@aws-cdk/aws-auditmanager/test/auditmanager.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-autoscalingplans/package.json b/packages/@aws-cdk/aws-autoscalingplans/package.json index e665150f6b980..653b5457f3c97 100644 --- a/packages/@aws-cdk/aws-autoscalingplans/package.json +++ b/packages/@aws-cdk/aws-autoscalingplans/package.json @@ -77,7 +77,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-autoscalingplans/test/autoscalingplans.test.ts b/packages/@aws-cdk/aws-autoscalingplans/test/autoscalingplans.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-autoscalingplans/test/autoscalingplans.test.ts +++ b/packages/@aws-cdk/aws-autoscalingplans/test/autoscalingplans.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-budgets/package.json b/packages/@aws-cdk/aws-budgets/package.json index b3d03d5d5d194..37c92a04ef9cc 100644 --- a/packages/@aws-cdk/aws-budgets/package.json +++ b/packages/@aws-cdk/aws-budgets/package.json @@ -77,7 +77,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-budgets/test/budgets.test.ts b/packages/@aws-cdk/aws-budgets/test/budgets.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-budgets/test/budgets.test.ts +++ b/packages/@aws-cdk/aws-budgets/test/budgets.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-cassandra/package.json b/packages/@aws-cdk/aws-cassandra/package.json index 94d5a49670f90..1515c0f8cbebe 100644 --- a/packages/@aws-cdk/aws-cassandra/package.json +++ b/packages/@aws-cdk/aws-cassandra/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-cassandra/test/cassandra.test.ts b/packages/@aws-cdk/aws-cassandra/test/cassandra.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-cassandra/test/cassandra.test.ts +++ b/packages/@aws-cdk/aws-cassandra/test/cassandra.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-ce/package.json b/packages/@aws-cdk/aws-ce/package.json index 1e0345dc6fb9c..8148d2c5f2dd2 100644 --- a/packages/@aws-cdk/aws-ce/package.json +++ b/packages/@aws-cdk/aws-ce/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-ce/test/ce.test.ts b/packages/@aws-cdk/aws-ce/test/ce.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-ce/test/ce.test.ts +++ b/packages/@aws-cdk/aws-ce/test/ce.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-codeartifact/package.json b/packages/@aws-cdk/aws-codeartifact/package.json index b1d8e76ef79d4..3dc1f03908775 100644 --- a/packages/@aws-cdk/aws-codeartifact/package.json +++ b/packages/@aws-cdk/aws-codeartifact/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-codeartifact/test/codeartifact.test.ts b/packages/@aws-cdk/aws-codeartifact/test/codeartifact.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-codeartifact/test/codeartifact.test.ts +++ b/packages/@aws-cdk/aws-codeartifact/test/codeartifact.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-codegurureviewer/package.json b/packages/@aws-cdk/aws-codegurureviewer/package.json index f7a900d2aef8b..c0619789ea414 100644 --- a/packages/@aws-cdk/aws-codegurureviewer/package.json +++ b/packages/@aws-cdk/aws-codegurureviewer/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-codegurureviewer/test/codegurureviewer.test.ts b/packages/@aws-cdk/aws-codegurureviewer/test/codegurureviewer.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-codegurureviewer/test/codegurureviewer.test.ts +++ b/packages/@aws-cdk/aws-codegurureviewer/test/codegurureviewer.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-codestarconnections/package.json b/packages/@aws-cdk/aws-codestarconnections/package.json index d45abecfe6ccd..76e45df893762 100644 --- a/packages/@aws-cdk/aws-codestarconnections/package.json +++ b/packages/@aws-cdk/aws-codestarconnections/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-codestarconnections/test/codestarconnections.test.ts b/packages/@aws-cdk/aws-codestarconnections/test/codestarconnections.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-codestarconnections/test/codestarconnections.test.ts +++ b/packages/@aws-cdk/aws-codestarconnections/test/codestarconnections.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-connect/package.json b/packages/@aws-cdk/aws-connect/package.json index 02e16855e466b..93d08397cf375 100644 --- a/packages/@aws-cdk/aws-connect/package.json +++ b/packages/@aws-cdk/aws-connect/package.json @@ -78,7 +78,7 @@ "license": "Apache-2.0", "devDependencies": { "@types/jest": "^26.0.24", - "@aws-cdk/assert-internal": "0.0.0", + "@aws-cdk/assertions": "0.0.0", "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0" diff --git a/packages/@aws-cdk/aws-connect/test/connect.test.ts b/packages/@aws-cdk/aws-connect/test/connect.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-connect/test/connect.test.ts +++ b/packages/@aws-cdk/aws-connect/test/connect.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-cur/package.json b/packages/@aws-cdk/aws-cur/package.json index ec2fb98a0d60c..8969e73dc4399 100644 --- a/packages/@aws-cdk/aws-cur/package.json +++ b/packages/@aws-cdk/aws-cur/package.json @@ -78,7 +78,7 @@ "license": "Apache-2.0", "devDependencies": { "@types/jest": "^26.0.24", - "@aws-cdk/assert-internal": "0.0.0", + "@aws-cdk/assertions": "0.0.0", "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0" diff --git a/packages/@aws-cdk/aws-cur/test/cur.test.ts b/packages/@aws-cdk/aws-cur/test/cur.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-cur/test/cur.test.ts +++ b/packages/@aws-cdk/aws-cur/test/cur.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-customerprofiles/package.json b/packages/@aws-cdk/aws-customerprofiles/package.json index 387a792b7a373..36ccdda69b39d 100644 --- a/packages/@aws-cdk/aws-customerprofiles/package.json +++ b/packages/@aws-cdk/aws-customerprofiles/package.json @@ -77,7 +77,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert-internal": "0.0.0", + "@aws-cdk/assertions": "0.0.0", "@types/jest": "^26.0.24", "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", diff --git a/packages/@aws-cdk/aws-customerprofiles/test/customerprofiles.test.ts b/packages/@aws-cdk/aws-customerprofiles/test/customerprofiles.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-customerprofiles/test/customerprofiles.test.ts +++ b/packages/@aws-cdk/aws-customerprofiles/test/customerprofiles.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-databrew/package.json b/packages/@aws-cdk/aws-databrew/package.json index 9f36870538f10..bf710a7394d74 100644 --- a/packages/@aws-cdk/aws-databrew/package.json +++ b/packages/@aws-cdk/aws-databrew/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-databrew/test/databrew.test.ts b/packages/@aws-cdk/aws-databrew/test/databrew.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-databrew/test/databrew.test.ts +++ b/packages/@aws-cdk/aws-databrew/test/databrew.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-datapipeline/package.json b/packages/@aws-cdk/aws-datapipeline/package.json index f368c68baa360..b0c4cf9bf3218 100644 --- a/packages/@aws-cdk/aws-datapipeline/package.json +++ b/packages/@aws-cdk/aws-datapipeline/package.json @@ -77,7 +77,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-datapipeline/test/datapipeline.test.ts b/packages/@aws-cdk/aws-datapipeline/test/datapipeline.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-datapipeline/test/datapipeline.test.ts +++ b/packages/@aws-cdk/aws-datapipeline/test/datapipeline.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-datasync/package.json b/packages/@aws-cdk/aws-datasync/package.json index d63f373cfeef8..3ec205f0d6ee1 100644 --- a/packages/@aws-cdk/aws-datasync/package.json +++ b/packages/@aws-cdk/aws-datasync/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-datasync/test/datasync.test.ts b/packages/@aws-cdk/aws-datasync/test/datasync.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-datasync/test/datasync.test.ts +++ b/packages/@aws-cdk/aws-datasync/test/datasync.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-dax/package.json b/packages/@aws-cdk/aws-dax/package.json index bd4d0c94dc3d3..82d88fd70d8d1 100644 --- a/packages/@aws-cdk/aws-dax/package.json +++ b/packages/@aws-cdk/aws-dax/package.json @@ -77,7 +77,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-dax/test/dax.test.ts b/packages/@aws-cdk/aws-dax/test/dax.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-dax/test/dax.test.ts +++ b/packages/@aws-cdk/aws-dax/test/dax.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-detective/package.json b/packages/@aws-cdk/aws-detective/package.json index b5bd1c2a903df..3955b883cb2bf 100644 --- a/packages/@aws-cdk/aws-detective/package.json +++ b/packages/@aws-cdk/aws-detective/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-detective/test/detective.test.ts b/packages/@aws-cdk/aws-detective/test/detective.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-detective/test/detective.test.ts +++ b/packages/@aws-cdk/aws-detective/test/detective.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-devopsguru/package.json b/packages/@aws-cdk/aws-devopsguru/package.json index 6fc91c263db06..9c9ff7fdb0228 100644 --- a/packages/@aws-cdk/aws-devopsguru/package.json +++ b/packages/@aws-cdk/aws-devopsguru/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-devopsguru/test/devopsguru.test.ts b/packages/@aws-cdk/aws-devopsguru/test/devopsguru.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-devopsguru/test/devopsguru.test.ts +++ b/packages/@aws-cdk/aws-devopsguru/test/devopsguru.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-directoryservice/package.json b/packages/@aws-cdk/aws-directoryservice/package.json index 179e72a6a4a2a..1396430e3a34a 100644 --- a/packages/@aws-cdk/aws-directoryservice/package.json +++ b/packages/@aws-cdk/aws-directoryservice/package.json @@ -77,7 +77,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-directoryservice/test/directoryservice.test.ts b/packages/@aws-cdk/aws-directoryservice/test/directoryservice.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-directoryservice/test/directoryservice.test.ts +++ b/packages/@aws-cdk/aws-directoryservice/test/directoryservice.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-dlm/package.json b/packages/@aws-cdk/aws-dlm/package.json index 09d10c116da40..84fd44d939683 100644 --- a/packages/@aws-cdk/aws-dlm/package.json +++ b/packages/@aws-cdk/aws-dlm/package.json @@ -78,7 +78,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-dlm/test/dlm.test.ts b/packages/@aws-cdk/aws-dlm/test/dlm.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-dlm/test/dlm.test.ts +++ b/packages/@aws-cdk/aws-dlm/test/dlm.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-dms/package.json b/packages/@aws-cdk/aws-dms/package.json index 7e06f8859e421..d1ba735745e55 100644 --- a/packages/@aws-cdk/aws-dms/package.json +++ b/packages/@aws-cdk/aws-dms/package.json @@ -77,7 +77,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-dms/test/dms.test.ts b/packages/@aws-cdk/aws-dms/test/dms.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-dms/test/dms.test.ts +++ b/packages/@aws-cdk/aws-dms/test/dms.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-elasticache/package.json b/packages/@aws-cdk/aws-elasticache/package.json index c0b500a42f22d..8a8a5a70c6c16 100644 --- a/packages/@aws-cdk/aws-elasticache/package.json +++ b/packages/@aws-cdk/aws-elasticache/package.json @@ -77,7 +77,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-elasticache/test/elasticache.test.ts b/packages/@aws-cdk/aws-elasticache/test/elasticache.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-elasticache/test/elasticache.test.ts +++ b/packages/@aws-cdk/aws-elasticache/test/elasticache.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-elasticbeanstalk/package.json b/packages/@aws-cdk/aws-elasticbeanstalk/package.json index 80d5033ecc931..a9bde94b14589 100644 --- a/packages/@aws-cdk/aws-elasticbeanstalk/package.json +++ b/packages/@aws-cdk/aws-elasticbeanstalk/package.json @@ -77,7 +77,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-elasticbeanstalk/test/elasticbeanstalk.test.ts b/packages/@aws-cdk/aws-elasticbeanstalk/test/elasticbeanstalk.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-elasticbeanstalk/test/elasticbeanstalk.test.ts +++ b/packages/@aws-cdk/aws-elasticbeanstalk/test/elasticbeanstalk.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-emr/package.json b/packages/@aws-cdk/aws-emr/package.json index f216a69bdf839..337790cd07b03 100644 --- a/packages/@aws-cdk/aws-emr/package.json +++ b/packages/@aws-cdk/aws-emr/package.json @@ -77,7 +77,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-emr/test/emr.test.ts b/packages/@aws-cdk/aws-emr/test/emr.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-emr/test/emr.test.ts +++ b/packages/@aws-cdk/aws-emr/test/emr.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-emrcontainers/package.json b/packages/@aws-cdk/aws-emrcontainers/package.json index bf2a7fbe9a627..8ea1659c08e57 100644 --- a/packages/@aws-cdk/aws-emrcontainers/package.json +++ b/packages/@aws-cdk/aws-emrcontainers/package.json @@ -81,7 +81,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-emrcontainers/test/emrcontainers.test.ts b/packages/@aws-cdk/aws-emrcontainers/test/emrcontainers.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-emrcontainers/test/emrcontainers.test.ts +++ b/packages/@aws-cdk/aws-emrcontainers/test/emrcontainers.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-eventschemas/package.json b/packages/@aws-cdk/aws-eventschemas/package.json index 0e16baa12d4f4..2d9ea8b2602d6 100644 --- a/packages/@aws-cdk/aws-eventschemas/package.json +++ b/packages/@aws-cdk/aws-eventschemas/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-eventschemas/test/eventschemas.test.ts b/packages/@aws-cdk/aws-eventschemas/test/eventschemas.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-eventschemas/test/eventschemas.test.ts +++ b/packages/@aws-cdk/aws-eventschemas/test/eventschemas.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-finspace/package.json b/packages/@aws-cdk/aws-finspace/package.json index 8b70bc5443455..1886725b8d68e 100644 --- a/packages/@aws-cdk/aws-finspace/package.json +++ b/packages/@aws-cdk/aws-finspace/package.json @@ -78,7 +78,7 @@ "license": "Apache-2.0", "devDependencies": { "@types/jest": "^26.0.24", - "@aws-cdk/assert-internal": "0.0.0", + "@aws-cdk/assertions": "0.0.0", "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0" diff --git a/packages/@aws-cdk/aws-finspace/test/finspace.test.ts b/packages/@aws-cdk/aws-finspace/test/finspace.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-finspace/test/finspace.test.ts +++ b/packages/@aws-cdk/aws-finspace/test/finspace.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-fis/package.json b/packages/@aws-cdk/aws-fis/package.json index 7412ed44a10fc..ba17edd8f186f 100644 --- a/packages/@aws-cdk/aws-fis/package.json +++ b/packages/@aws-cdk/aws-fis/package.json @@ -81,7 +81,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-fis/test/fis.test.ts b/packages/@aws-cdk/aws-fis/test/fis.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-fis/test/fis.test.ts +++ b/packages/@aws-cdk/aws-fis/test/fis.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-fms/package.json b/packages/@aws-cdk/aws-fms/package.json index 5ed725a88b4cc..d9056b520b7f1 100644 --- a/packages/@aws-cdk/aws-fms/package.json +++ b/packages/@aws-cdk/aws-fms/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-fms/test/fms.test.ts b/packages/@aws-cdk/aws-fms/test/fms.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-fms/test/fms.test.ts +++ b/packages/@aws-cdk/aws-fms/test/fms.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-frauddetector/package.json b/packages/@aws-cdk/aws-frauddetector/package.json index fbf05f78a7640..84cfc1ce40738 100644 --- a/packages/@aws-cdk/aws-frauddetector/package.json +++ b/packages/@aws-cdk/aws-frauddetector/package.json @@ -78,7 +78,7 @@ "license": "Apache-2.0", "devDependencies": { "@types/jest": "^26.0.24", - "@aws-cdk/assert-internal": "0.0.0", + "@aws-cdk/assertions": "0.0.0", "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0" diff --git a/packages/@aws-cdk/aws-frauddetector/test/frauddetector.test.ts b/packages/@aws-cdk/aws-frauddetector/test/frauddetector.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-frauddetector/test/frauddetector.test.ts +++ b/packages/@aws-cdk/aws-frauddetector/test/frauddetector.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-gamelift/package.json b/packages/@aws-cdk/aws-gamelift/package.json index 07774ebf11293..299bf7e8ca563 100644 --- a/packages/@aws-cdk/aws-gamelift/package.json +++ b/packages/@aws-cdk/aws-gamelift/package.json @@ -77,7 +77,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-gamelift/test/gamelift.test.ts b/packages/@aws-cdk/aws-gamelift/test/gamelift.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-gamelift/test/gamelift.test.ts +++ b/packages/@aws-cdk/aws-gamelift/test/gamelift.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-greengrass/package.json b/packages/@aws-cdk/aws-greengrass/package.json index 9fa8de9238ee2..e5909de8cf591 100644 --- a/packages/@aws-cdk/aws-greengrass/package.json +++ b/packages/@aws-cdk/aws-greengrass/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-greengrass/test/greengrass.test.ts b/packages/@aws-cdk/aws-greengrass/test/greengrass.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-greengrass/test/greengrass.test.ts +++ b/packages/@aws-cdk/aws-greengrass/test/greengrass.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-greengrassv2/package.json b/packages/@aws-cdk/aws-greengrassv2/package.json index 8096e3269ac30..4c21e7594e26b 100644 --- a/packages/@aws-cdk/aws-greengrassv2/package.json +++ b/packages/@aws-cdk/aws-greengrassv2/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-greengrassv2/test/greengrass.test.ts b/packages/@aws-cdk/aws-greengrassv2/test/greengrass.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-greengrassv2/test/greengrass.test.ts +++ b/packages/@aws-cdk/aws-greengrassv2/test/greengrass.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-groundstation/package.json b/packages/@aws-cdk/aws-groundstation/package.json index f337bfd5dc79e..f24da08699f70 100644 --- a/packages/@aws-cdk/aws-groundstation/package.json +++ b/packages/@aws-cdk/aws-groundstation/package.json @@ -78,7 +78,7 @@ "license": "Apache-2.0", "devDependencies": { "@types/jest": "^26.0.24", - "@aws-cdk/assert-internal": "0.0.0", + "@aws-cdk/assertions": "0.0.0", "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0" diff --git a/packages/@aws-cdk/aws-groundstation/test/groundstation.test.ts b/packages/@aws-cdk/aws-groundstation/test/groundstation.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-groundstation/test/groundstation.test.ts +++ b/packages/@aws-cdk/aws-groundstation/test/groundstation.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-guardduty/package.json b/packages/@aws-cdk/aws-guardduty/package.json index 671cd3e85044c..0fb30da82ef61 100644 --- a/packages/@aws-cdk/aws-guardduty/package.json +++ b/packages/@aws-cdk/aws-guardduty/package.json @@ -77,7 +77,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-guardduty/test/guardduty.test.ts b/packages/@aws-cdk/aws-guardduty/test/guardduty.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-guardduty/test/guardduty.test.ts +++ b/packages/@aws-cdk/aws-guardduty/test/guardduty.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-imagebuilder/package.json b/packages/@aws-cdk/aws-imagebuilder/package.json index 0f37220e9e269..64537f6b27401 100644 --- a/packages/@aws-cdk/aws-imagebuilder/package.json +++ b/packages/@aws-cdk/aws-imagebuilder/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-imagebuilder/test/imagebuilder.test.ts b/packages/@aws-cdk/aws-imagebuilder/test/imagebuilder.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-imagebuilder/test/imagebuilder.test.ts +++ b/packages/@aws-cdk/aws-imagebuilder/test/imagebuilder.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-inspector/package.json b/packages/@aws-cdk/aws-inspector/package.json index 489f584c5b6e8..dad54ff5b2e51 100644 --- a/packages/@aws-cdk/aws-inspector/package.json +++ b/packages/@aws-cdk/aws-inspector/package.json @@ -77,7 +77,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-inspector/test/inspector.test.ts b/packages/@aws-cdk/aws-inspector/test/inspector.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-inspector/test/inspector.test.ts +++ b/packages/@aws-cdk/aws-inspector/test/inspector.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-iot/package.json b/packages/@aws-cdk/aws-iot/package.json index 1e83190d4b532..f816d5f680164 100644 --- a/packages/@aws-cdk/aws-iot/package.json +++ b/packages/@aws-cdk/aws-iot/package.json @@ -77,7 +77,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-iot/test/iot.test.ts b/packages/@aws-cdk/aws-iot/test/iot.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-iot/test/iot.test.ts +++ b/packages/@aws-cdk/aws-iot/test/iot.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-iot1click/package.json b/packages/@aws-cdk/aws-iot1click/package.json index b1821fe309430..17ad106a288f2 100644 --- a/packages/@aws-cdk/aws-iot1click/package.json +++ b/packages/@aws-cdk/aws-iot1click/package.json @@ -78,7 +78,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-iot1click/test/iot1click.test.ts b/packages/@aws-cdk/aws-iot1click/test/iot1click.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-iot1click/test/iot1click.test.ts +++ b/packages/@aws-cdk/aws-iot1click/test/iot1click.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-iotanalytics/package.json b/packages/@aws-cdk/aws-iotanalytics/package.json index 97acc44632e9b..66434d4db2d33 100644 --- a/packages/@aws-cdk/aws-iotanalytics/package.json +++ b/packages/@aws-cdk/aws-iotanalytics/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-iotanalytics/test/iotanalytics.test.ts b/packages/@aws-cdk/aws-iotanalytics/test/iotanalytics.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-iotanalytics/test/iotanalytics.test.ts +++ b/packages/@aws-cdk/aws-iotanalytics/test/iotanalytics.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-iotcoredeviceadvisor/package.json b/packages/@aws-cdk/aws-iotcoredeviceadvisor/package.json index ca500daa21d26..80fc81f75a022 100644 --- a/packages/@aws-cdk/aws-iotcoredeviceadvisor/package.json +++ b/packages/@aws-cdk/aws-iotcoredeviceadvisor/package.json @@ -78,7 +78,7 @@ "license": "Apache-2.0", "devDependencies": { "@types/jest": "^26.0.24", - "@aws-cdk/assert-internal": "0.0.0", + "@aws-cdk/assertions": "0.0.0", "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0" diff --git a/packages/@aws-cdk/aws-iotcoredeviceadvisor/test/iotcoredeviceadvisor.test.ts b/packages/@aws-cdk/aws-iotcoredeviceadvisor/test/iotcoredeviceadvisor.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-iotcoredeviceadvisor/test/iotcoredeviceadvisor.test.ts +++ b/packages/@aws-cdk/aws-iotcoredeviceadvisor/test/iotcoredeviceadvisor.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-iotevents/package.json b/packages/@aws-cdk/aws-iotevents/package.json index e6e819bba2aed..9125c6a9a05b1 100644 --- a/packages/@aws-cdk/aws-iotevents/package.json +++ b/packages/@aws-cdk/aws-iotevents/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-iotevents/test/iotevents.test.ts b/packages/@aws-cdk/aws-iotevents/test/iotevents.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-iotevents/test/iotevents.test.ts +++ b/packages/@aws-cdk/aws-iotevents/test/iotevents.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-iotfleethub/package.json b/packages/@aws-cdk/aws-iotfleethub/package.json index f873c33b08634..69891556a7f4b 100644 --- a/packages/@aws-cdk/aws-iotfleethub/package.json +++ b/packages/@aws-cdk/aws-iotfleethub/package.json @@ -78,7 +78,7 @@ "license": "Apache-2.0", "devDependencies": { "@types/jest": "^26.0.24", - "@aws-cdk/assert-internal": "0.0.0", + "@aws-cdk/assertions": "0.0.0", "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0" diff --git a/packages/@aws-cdk/aws-iotfleethub/test/iotfleethub.test.ts b/packages/@aws-cdk/aws-iotfleethub/test/iotfleethub.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-iotfleethub/test/iotfleethub.test.ts +++ b/packages/@aws-cdk/aws-iotfleethub/test/iotfleethub.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-iotsitewise/package.json b/packages/@aws-cdk/aws-iotsitewise/package.json index 81750ea6c4221..9c86ba4bcd889 100644 --- a/packages/@aws-cdk/aws-iotsitewise/package.json +++ b/packages/@aws-cdk/aws-iotsitewise/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-iotsitewise/test/iotsitewise.test.ts b/packages/@aws-cdk/aws-iotsitewise/test/iotsitewise.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-iotsitewise/test/iotsitewise.test.ts +++ b/packages/@aws-cdk/aws-iotsitewise/test/iotsitewise.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-iotthingsgraph/package.json b/packages/@aws-cdk/aws-iotthingsgraph/package.json index 39dee778b632f..a00fc435787fe 100644 --- a/packages/@aws-cdk/aws-iotthingsgraph/package.json +++ b/packages/@aws-cdk/aws-iotthingsgraph/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-iotthingsgraph/test/iotthingsgraph.test.ts b/packages/@aws-cdk/aws-iotthingsgraph/test/iotthingsgraph.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-iotthingsgraph/test/iotthingsgraph.test.ts +++ b/packages/@aws-cdk/aws-iotthingsgraph/test/iotthingsgraph.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-iotwireless/package.json b/packages/@aws-cdk/aws-iotwireless/package.json index 176941dd97bb4..ee46fc9ca58ec 100644 --- a/packages/@aws-cdk/aws-iotwireless/package.json +++ b/packages/@aws-cdk/aws-iotwireless/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-iotwireless/test/iotwireless.test.ts b/packages/@aws-cdk/aws-iotwireless/test/iotwireless.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-iotwireless/test/iotwireless.test.ts +++ b/packages/@aws-cdk/aws-iotwireless/test/iotwireless.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-kendra/package.json b/packages/@aws-cdk/aws-kendra/package.json index c78e48ea705e7..33ab4f2afa7f2 100644 --- a/packages/@aws-cdk/aws-kendra/package.json +++ b/packages/@aws-cdk/aws-kendra/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-kendra/test/kendra.test.ts b/packages/@aws-cdk/aws-kendra/test/kendra.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-kendra/test/kendra.test.ts +++ b/packages/@aws-cdk/aws-kendra/test/kendra.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-kinesisanalytics/package.json b/packages/@aws-cdk/aws-kinesisanalytics/package.json index 3a3933d62d655..db7c571c963c8 100644 --- a/packages/@aws-cdk/aws-kinesisanalytics/package.json +++ b/packages/@aws-cdk/aws-kinesisanalytics/package.json @@ -80,7 +80,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-kinesisanalytics/test/kinesisanalytics.test.ts b/packages/@aws-cdk/aws-kinesisanalytics/test/kinesisanalytics.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-kinesisanalytics/test/kinesisanalytics.test.ts +++ b/packages/@aws-cdk/aws-kinesisanalytics/test/kinesisanalytics.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-lakeformation/package.json b/packages/@aws-cdk/aws-lakeformation/package.json index a374c0d9627da..87af67a50de81 100644 --- a/packages/@aws-cdk/aws-lakeformation/package.json +++ b/packages/@aws-cdk/aws-lakeformation/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-lakeformation/test/lakeformation.test.ts b/packages/@aws-cdk/aws-lakeformation/test/lakeformation.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-lakeformation/test/lakeformation.test.ts +++ b/packages/@aws-cdk/aws-lakeformation/test/lakeformation.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-licensemanager/package.json b/packages/@aws-cdk/aws-licensemanager/package.json index eb66089eae974..0219ff3d93dc0 100644 --- a/packages/@aws-cdk/aws-licensemanager/package.json +++ b/packages/@aws-cdk/aws-licensemanager/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-licensemanager/test/licensemanager.test.ts b/packages/@aws-cdk/aws-licensemanager/test/licensemanager.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-licensemanager/test/licensemanager.test.ts +++ b/packages/@aws-cdk/aws-licensemanager/test/licensemanager.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-location/package.json b/packages/@aws-cdk/aws-location/package.json index dedff67266046..5a9473d0d22dd 100644 --- a/packages/@aws-cdk/aws-location/package.json +++ b/packages/@aws-cdk/aws-location/package.json @@ -78,7 +78,7 @@ "license": "Apache-2.0", "devDependencies": { "@types/jest": "^26.0.24", - "@aws-cdk/assert-internal": "0.0.0", + "@aws-cdk/assertions": "0.0.0", "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0" diff --git a/packages/@aws-cdk/aws-location/test/location.test.ts b/packages/@aws-cdk/aws-location/test/location.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-location/test/location.test.ts +++ b/packages/@aws-cdk/aws-location/test/location.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-lookoutequipment/package.json b/packages/@aws-cdk/aws-lookoutequipment/package.json index e34187a2c7e57..3d3d93d1a9bb4 100644 --- a/packages/@aws-cdk/aws-lookoutequipment/package.json +++ b/packages/@aws-cdk/aws-lookoutequipment/package.json @@ -78,7 +78,7 @@ "license": "Apache-2.0", "devDependencies": { "@types/jest": "^26.0.22", - "@aws-cdk/assert-internal": "0.0.0", + "@aws-cdk/assertions": "0.0.0", "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0" diff --git a/packages/@aws-cdk/aws-lookoutequipment/test/lookoutequipment.test.ts b/packages/@aws-cdk/aws-lookoutequipment/test/lookoutequipment.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-lookoutequipment/test/lookoutequipment.test.ts +++ b/packages/@aws-cdk/aws-lookoutequipment/test/lookoutequipment.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-lookoutmetrics/package.json b/packages/@aws-cdk/aws-lookoutmetrics/package.json index 93c04870c0f5d..f79a8e599ed12 100644 --- a/packages/@aws-cdk/aws-lookoutmetrics/package.json +++ b/packages/@aws-cdk/aws-lookoutmetrics/package.json @@ -78,7 +78,7 @@ "license": "Apache-2.0", "devDependencies": { "@types/jest": "^26.0.24", - "@aws-cdk/assert-internal": "0.0.0", + "@aws-cdk/assertions": "0.0.0", "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0" diff --git a/packages/@aws-cdk/aws-lookoutmetrics/test/lookoutmetrics.test.ts b/packages/@aws-cdk/aws-lookoutmetrics/test/lookoutmetrics.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-lookoutmetrics/test/lookoutmetrics.test.ts +++ b/packages/@aws-cdk/aws-lookoutmetrics/test/lookoutmetrics.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-lookoutvision/package.json b/packages/@aws-cdk/aws-lookoutvision/package.json index d55a122cb7624..33ede00a2af8c 100644 --- a/packages/@aws-cdk/aws-lookoutvision/package.json +++ b/packages/@aws-cdk/aws-lookoutvision/package.json @@ -81,7 +81,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-lookoutvision/test/lookoutvision.test.ts b/packages/@aws-cdk/aws-lookoutvision/test/lookoutvision.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-lookoutvision/test/lookoutvision.test.ts +++ b/packages/@aws-cdk/aws-lookoutvision/test/lookoutvision.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-macie/package.json b/packages/@aws-cdk/aws-macie/package.json index 1cbdb49f09399..cd1d450bd73b6 100644 --- a/packages/@aws-cdk/aws-macie/package.json +++ b/packages/@aws-cdk/aws-macie/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-macie/test/macie.test.ts b/packages/@aws-cdk/aws-macie/test/macie.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-macie/test/macie.test.ts +++ b/packages/@aws-cdk/aws-macie/test/macie.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-managedblockchain/package.json b/packages/@aws-cdk/aws-managedblockchain/package.json index 675de2f297c20..09d5ad7a954ea 100644 --- a/packages/@aws-cdk/aws-managedblockchain/package.json +++ b/packages/@aws-cdk/aws-managedblockchain/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-managedblockchain/test/managedblockchain.test.ts b/packages/@aws-cdk/aws-managedblockchain/test/managedblockchain.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-managedblockchain/test/managedblockchain.test.ts +++ b/packages/@aws-cdk/aws-managedblockchain/test/managedblockchain.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-mediaconnect/package.json b/packages/@aws-cdk/aws-mediaconnect/package.json index b67436e9224aa..d0f29ba806f03 100644 --- a/packages/@aws-cdk/aws-mediaconnect/package.json +++ b/packages/@aws-cdk/aws-mediaconnect/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-mediaconnect/test/mediaconnect.test.ts b/packages/@aws-cdk/aws-mediaconnect/test/mediaconnect.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-mediaconnect/test/mediaconnect.test.ts +++ b/packages/@aws-cdk/aws-mediaconnect/test/mediaconnect.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-mediaconvert/package.json b/packages/@aws-cdk/aws-mediaconvert/package.json index 4808bc6dda2ff..725541270f71b 100644 --- a/packages/@aws-cdk/aws-mediaconvert/package.json +++ b/packages/@aws-cdk/aws-mediaconvert/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-mediaconvert/test/mediaconvert.test.ts b/packages/@aws-cdk/aws-mediaconvert/test/mediaconvert.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-mediaconvert/test/mediaconvert.test.ts +++ b/packages/@aws-cdk/aws-mediaconvert/test/mediaconvert.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-medialive/package.json b/packages/@aws-cdk/aws-medialive/package.json index 3e1e7088f1f0c..dd9f764f06d1b 100644 --- a/packages/@aws-cdk/aws-medialive/package.json +++ b/packages/@aws-cdk/aws-medialive/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-medialive/test/medialive.test.ts b/packages/@aws-cdk/aws-medialive/test/medialive.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-medialive/test/medialive.test.ts +++ b/packages/@aws-cdk/aws-medialive/test/medialive.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-mediapackage/package.json b/packages/@aws-cdk/aws-mediapackage/package.json index 84077872af4d5..9910b1dc2f864 100644 --- a/packages/@aws-cdk/aws-mediapackage/package.json +++ b/packages/@aws-cdk/aws-mediapackage/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-mediapackage/test/mediapackage.test.ts b/packages/@aws-cdk/aws-mediapackage/test/mediapackage.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-mediapackage/test/mediapackage.test.ts +++ b/packages/@aws-cdk/aws-mediapackage/test/mediapackage.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-mediastore/package.json b/packages/@aws-cdk/aws-mediastore/package.json index 20e9b4057dbe5..5a5ec1ff16709 100644 --- a/packages/@aws-cdk/aws-mediastore/package.json +++ b/packages/@aws-cdk/aws-mediastore/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-mediastore/test/mediastore.test.ts b/packages/@aws-cdk/aws-mediastore/test/mediastore.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-mediastore/test/mediastore.test.ts +++ b/packages/@aws-cdk/aws-mediastore/test/mediastore.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-mwaa/package.json b/packages/@aws-cdk/aws-mwaa/package.json index 07fbbab350909..0a784d8121200 100644 --- a/packages/@aws-cdk/aws-mwaa/package.json +++ b/packages/@aws-cdk/aws-mwaa/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-mwaa/test/mwaa.test.ts b/packages/@aws-cdk/aws-mwaa/test/mwaa.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-mwaa/test/mwaa.test.ts +++ b/packages/@aws-cdk/aws-mwaa/test/mwaa.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-networkfirewall/package.json b/packages/@aws-cdk/aws-networkfirewall/package.json index 27b3aa04a7136..3b6617b2582c5 100644 --- a/packages/@aws-cdk/aws-networkfirewall/package.json +++ b/packages/@aws-cdk/aws-networkfirewall/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-networkfirewall/test/networkfirewall.test.ts b/packages/@aws-cdk/aws-networkfirewall/test/networkfirewall.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-networkfirewall/test/networkfirewall.test.ts +++ b/packages/@aws-cdk/aws-networkfirewall/test/networkfirewall.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-networkmanager/package.json b/packages/@aws-cdk/aws-networkmanager/package.json index f0666a1e676cc..dd671b4ffd623 100644 --- a/packages/@aws-cdk/aws-networkmanager/package.json +++ b/packages/@aws-cdk/aws-networkmanager/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-networkmanager/test/networkmanager.test.ts b/packages/@aws-cdk/aws-networkmanager/test/networkmanager.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-networkmanager/test/networkmanager.test.ts +++ b/packages/@aws-cdk/aws-networkmanager/test/networkmanager.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-nimblestudio/package.json b/packages/@aws-cdk/aws-nimblestudio/package.json index 5f9f77d2f58b2..8270304b555fa 100644 --- a/packages/@aws-cdk/aws-nimblestudio/package.json +++ b/packages/@aws-cdk/aws-nimblestudio/package.json @@ -78,7 +78,7 @@ "license": "Apache-2.0", "devDependencies": { "@types/jest": "^26.0.24", - "@aws-cdk/assert-internal": "0.0.0", + "@aws-cdk/assertions": "0.0.0", "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0" diff --git a/packages/@aws-cdk/aws-nimblestudio/test/nimblestudio.test.ts b/packages/@aws-cdk/aws-nimblestudio/test/nimblestudio.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-nimblestudio/test/nimblestudio.test.ts +++ b/packages/@aws-cdk/aws-nimblestudio/test/nimblestudio.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-opsworks/package.json b/packages/@aws-cdk/aws-opsworks/package.json index 978dd2b2b07c5..5d6f8b77a7d04 100644 --- a/packages/@aws-cdk/aws-opsworks/package.json +++ b/packages/@aws-cdk/aws-opsworks/package.json @@ -77,7 +77,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-opsworks/test/opsworks.test.ts b/packages/@aws-cdk/aws-opsworks/test/opsworks.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-opsworks/test/opsworks.test.ts +++ b/packages/@aws-cdk/aws-opsworks/test/opsworks.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-opsworkscm/package.json b/packages/@aws-cdk/aws-opsworkscm/package.json index 42c0e014301cb..03870f42fa5a0 100644 --- a/packages/@aws-cdk/aws-opsworkscm/package.json +++ b/packages/@aws-cdk/aws-opsworkscm/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-opsworkscm/test/opsworkscm.test.ts b/packages/@aws-cdk/aws-opsworkscm/test/opsworkscm.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-opsworkscm/test/opsworkscm.test.ts +++ b/packages/@aws-cdk/aws-opsworkscm/test/opsworkscm.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-pinpoint/package.json b/packages/@aws-cdk/aws-pinpoint/package.json index 0f5b7b48a84cf..8475739eaa6f7 100644 --- a/packages/@aws-cdk/aws-pinpoint/package.json +++ b/packages/@aws-cdk/aws-pinpoint/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-pinpoint/test/pinpoint.test.ts b/packages/@aws-cdk/aws-pinpoint/test/pinpoint.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-pinpoint/test/pinpoint.test.ts +++ b/packages/@aws-cdk/aws-pinpoint/test/pinpoint.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-pinpointemail/package.json b/packages/@aws-cdk/aws-pinpointemail/package.json index 7659ce4025b4a..d57fe0f9ac922 100644 --- a/packages/@aws-cdk/aws-pinpointemail/package.json +++ b/packages/@aws-cdk/aws-pinpointemail/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-pinpointemail/test/pinpointemail.test.ts b/packages/@aws-cdk/aws-pinpointemail/test/pinpointemail.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-pinpointemail/test/pinpointemail.test.ts +++ b/packages/@aws-cdk/aws-pinpointemail/test/pinpointemail.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-qldb/package.json b/packages/@aws-cdk/aws-qldb/package.json index ac50a35b7c1aa..3922e74b5a384 100644 --- a/packages/@aws-cdk/aws-qldb/package.json +++ b/packages/@aws-cdk/aws-qldb/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-qldb/test/qldb.test.ts b/packages/@aws-cdk/aws-qldb/test/qldb.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-qldb/test/qldb.test.ts +++ b/packages/@aws-cdk/aws-qldb/test/qldb.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-quicksight/package.json b/packages/@aws-cdk/aws-quicksight/package.json index 3d55f0052512b..00f42d396c801 100644 --- a/packages/@aws-cdk/aws-quicksight/package.json +++ b/packages/@aws-cdk/aws-quicksight/package.json @@ -81,7 +81,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-quicksight/test/quicksight.test.ts b/packages/@aws-cdk/aws-quicksight/test/quicksight.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-quicksight/test/quicksight.test.ts +++ b/packages/@aws-cdk/aws-quicksight/test/quicksight.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-ram/package.json b/packages/@aws-cdk/aws-ram/package.json index 6383a8a7ce1a1..6f817b0f45b4b 100644 --- a/packages/@aws-cdk/aws-ram/package.json +++ b/packages/@aws-cdk/aws-ram/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-ram/test/ram.test.ts b/packages/@aws-cdk/aws-ram/test/ram.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-ram/test/ram.test.ts +++ b/packages/@aws-cdk/aws-ram/test/ram.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-resourcegroups/package.json b/packages/@aws-cdk/aws-resourcegroups/package.json index 611c01ef93ae8..88e73e2bd2426 100644 --- a/packages/@aws-cdk/aws-resourcegroups/package.json +++ b/packages/@aws-cdk/aws-resourcegroups/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-resourcegroups/test/resourcegroups.test.ts b/packages/@aws-cdk/aws-resourcegroups/test/resourcegroups.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-resourcegroups/test/resourcegroups.test.ts +++ b/packages/@aws-cdk/aws-resourcegroups/test/resourcegroups.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-robomaker/package.json b/packages/@aws-cdk/aws-robomaker/package.json index 8f4f5c4350cc7..124451f52e67b 100644 --- a/packages/@aws-cdk/aws-robomaker/package.json +++ b/packages/@aws-cdk/aws-robomaker/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-robomaker/test/robomaker.test.ts b/packages/@aws-cdk/aws-robomaker/test/robomaker.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-robomaker/test/robomaker.test.ts +++ b/packages/@aws-cdk/aws-robomaker/test/robomaker.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-route53resolver/package.json b/packages/@aws-cdk/aws-route53resolver/package.json index ab96545ce6345..a515fecb3c120 100644 --- a/packages/@aws-cdk/aws-route53resolver/package.json +++ b/packages/@aws-cdk/aws-route53resolver/package.json @@ -78,7 +78,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-route53resolver/test/route53resolver.test.ts b/packages/@aws-cdk/aws-route53resolver/test/route53resolver.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-route53resolver/test/route53resolver.test.ts +++ b/packages/@aws-cdk/aws-route53resolver/test/route53resolver.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-s3objectlambda/package.json b/packages/@aws-cdk/aws-s3objectlambda/package.json index 7818c261a21bc..f8e0d0986fe8a 100644 --- a/packages/@aws-cdk/aws-s3objectlambda/package.json +++ b/packages/@aws-cdk/aws-s3objectlambda/package.json @@ -81,7 +81,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-s3objectlambda/test/s3objectlambda.test.ts b/packages/@aws-cdk/aws-s3objectlambda/test/s3objectlambda.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-s3objectlambda/test/s3objectlambda.test.ts +++ b/packages/@aws-cdk/aws-s3objectlambda/test/s3objectlambda.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-s3outposts/package.json b/packages/@aws-cdk/aws-s3outposts/package.json index 4645c65189333..da5317e14e7b3 100644 --- a/packages/@aws-cdk/aws-s3outposts/package.json +++ b/packages/@aws-cdk/aws-s3outposts/package.json @@ -81,7 +81,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-s3outposts/test/s3outposts.test.ts b/packages/@aws-cdk/aws-s3outposts/test/s3outposts.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-s3outposts/test/s3outposts.test.ts +++ b/packages/@aws-cdk/aws-s3outposts/test/s3outposts.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-sagemaker/package.json b/packages/@aws-cdk/aws-sagemaker/package.json index 3f2fa9d8ab857..136d5ad52ea25 100644 --- a/packages/@aws-cdk/aws-sagemaker/package.json +++ b/packages/@aws-cdk/aws-sagemaker/package.json @@ -78,7 +78,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-sagemaker/test/sagemaker.test.ts b/packages/@aws-cdk/aws-sagemaker/test/sagemaker.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-sagemaker/test/sagemaker.test.ts +++ b/packages/@aws-cdk/aws-sagemaker/test/sagemaker.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-sdb/package.json b/packages/@aws-cdk/aws-sdb/package.json index b1773cf5a3907..9863fe0333e24 100644 --- a/packages/@aws-cdk/aws-sdb/package.json +++ b/packages/@aws-cdk/aws-sdb/package.json @@ -77,7 +77,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-sdb/test/sdb.test.ts b/packages/@aws-cdk/aws-sdb/test/sdb.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-sdb/test/sdb.test.ts +++ b/packages/@aws-cdk/aws-sdb/test/sdb.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-securityhub/package.json b/packages/@aws-cdk/aws-securityhub/package.json index ad2e1abf1e401..e71153d4822ad 100644 --- a/packages/@aws-cdk/aws-securityhub/package.json +++ b/packages/@aws-cdk/aws-securityhub/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-securityhub/test/securityhub.test.ts b/packages/@aws-cdk/aws-securityhub/test/securityhub.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-securityhub/test/securityhub.test.ts +++ b/packages/@aws-cdk/aws-securityhub/test/securityhub.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-ssmcontacts/package.json b/packages/@aws-cdk/aws-ssmcontacts/package.json index fb7c8defd4291..350d243514340 100644 --- a/packages/@aws-cdk/aws-ssmcontacts/package.json +++ b/packages/@aws-cdk/aws-ssmcontacts/package.json @@ -78,7 +78,7 @@ "license": "Apache-2.0", "devDependencies": { "@types/jest": "^26.0.24", - "@aws-cdk/assert-internal": "0.0.0", + "@aws-cdk/assertions": "0.0.0", "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0" diff --git a/packages/@aws-cdk/aws-ssmcontacts/test/ssmcontacts.test.ts b/packages/@aws-cdk/aws-ssmcontacts/test/ssmcontacts.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-ssmcontacts/test/ssmcontacts.test.ts +++ b/packages/@aws-cdk/aws-ssmcontacts/test/ssmcontacts.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-ssmincidents/package.json b/packages/@aws-cdk/aws-ssmincidents/package.json index 1ef3f6cc287f7..668f68e02fd64 100644 --- a/packages/@aws-cdk/aws-ssmincidents/package.json +++ b/packages/@aws-cdk/aws-ssmincidents/package.json @@ -78,7 +78,7 @@ "license": "Apache-2.0", "devDependencies": { "@types/jest": "^26.0.24", - "@aws-cdk/assert-internal": "0.0.0", + "@aws-cdk/assertions": "0.0.0", "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0" diff --git a/packages/@aws-cdk/aws-ssmincidents/test/ssmincidents.test.ts b/packages/@aws-cdk/aws-ssmincidents/test/ssmincidents.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-ssmincidents/test/ssmincidents.test.ts +++ b/packages/@aws-cdk/aws-ssmincidents/test/ssmincidents.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-sso/package.json b/packages/@aws-cdk/aws-sso/package.json index 9eae6cfdc23a0..b6361b2336306 100644 --- a/packages/@aws-cdk/aws-sso/package.json +++ b/packages/@aws-cdk/aws-sso/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-sso/test/sso.test.ts b/packages/@aws-cdk/aws-sso/test/sso.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-sso/test/sso.test.ts +++ b/packages/@aws-cdk/aws-sso/test/sso.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-timestream/package.json b/packages/@aws-cdk/aws-timestream/package.json index 7a00e4fcb5c84..82e1fb198680b 100644 --- a/packages/@aws-cdk/aws-timestream/package.json +++ b/packages/@aws-cdk/aws-timestream/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0" diff --git a/packages/@aws-cdk/aws-timestream/test/timestream.test.ts b/packages/@aws-cdk/aws-timestream/test/timestream.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-timestream/test/timestream.test.ts +++ b/packages/@aws-cdk/aws-timestream/test/timestream.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-transfer/package.json b/packages/@aws-cdk/aws-transfer/package.json index 45fc2b0164fc1..4d8e05fab19f5 100644 --- a/packages/@aws-cdk/aws-transfer/package.json +++ b/packages/@aws-cdk/aws-transfer/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-transfer/test/transfer.test.ts b/packages/@aws-cdk/aws-transfer/test/transfer.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-transfer/test/transfer.test.ts +++ b/packages/@aws-cdk/aws-transfer/test/transfer.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-waf/package.json b/packages/@aws-cdk/aws-waf/package.json index ec2e3ec379265..8c4f85f3402b7 100644 --- a/packages/@aws-cdk/aws-waf/package.json +++ b/packages/@aws-cdk/aws-waf/package.json @@ -77,7 +77,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-waf/test/waf.test.ts b/packages/@aws-cdk/aws-waf/test/waf.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-waf/test/waf.test.ts +++ b/packages/@aws-cdk/aws-waf/test/waf.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-wafregional/package.json b/packages/@aws-cdk/aws-wafregional/package.json index 4003f4ff7b0f0..e82afe0e25e4a 100644 --- a/packages/@aws-cdk/aws-wafregional/package.json +++ b/packages/@aws-cdk/aws-wafregional/package.json @@ -77,7 +77,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-wafregional/test/wafregional.test.ts b/packages/@aws-cdk/aws-wafregional/test/wafregional.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-wafregional/test/wafregional.test.ts +++ b/packages/@aws-cdk/aws-wafregional/test/wafregional.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-wafv2/package.json b/packages/@aws-cdk/aws-wafv2/package.json index f7c5ae3b14798..c46028b894625 100644 --- a/packages/@aws-cdk/aws-wafv2/package.json +++ b/packages/@aws-cdk/aws-wafv2/package.json @@ -79,7 +79,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-wafv2/test/wafv2.test.ts b/packages/@aws-cdk/aws-wafv2/test/wafv2.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-wafv2/test/wafv2.test.ts +++ b/packages/@aws-cdk/aws-wafv2/test/wafv2.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-workspaces/package.json b/packages/@aws-cdk/aws-workspaces/package.json index ab45c38ed0fbd..84f7406237f45 100644 --- a/packages/@aws-cdk/aws-workspaces/package.json +++ b/packages/@aws-cdk/aws-workspaces/package.json @@ -77,7 +77,7 @@ "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "@aws-cdk/assertions": "0.0.0" }, "dependencies": { "@aws-cdk/core": "0.0.0", diff --git a/packages/@aws-cdk/aws-workspaces/test/workspaces.test.ts b/packages/@aws-cdk/aws-workspaces/test/workspaces.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-workspaces/test/workspaces.test.ts +++ b/packages/@aws-cdk/aws-workspaces/test/workspaces.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/aws-xray/package.json b/packages/@aws-cdk/aws-xray/package.json index 1d63e8fa740b3..e5ec9ff9da5fa 100644 --- a/packages/@aws-cdk/aws-xray/package.json +++ b/packages/@aws-cdk/aws-xray/package.json @@ -78,7 +78,7 @@ "license": "Apache-2.0", "devDependencies": { "@types/jest": "^26.0.24", - "@aws-cdk/assert-internal": "0.0.0", + "@aws-cdk/assertions": "0.0.0", "cdk-build-tools": "0.0.0", "cfn2ts": "0.0.0", "pkglint": "0.0.0" diff --git a/packages/@aws-cdk/aws-xray/test/xray.test.ts b/packages/@aws-cdk/aws-xray/test/xray.test.ts index c4505ad966984..465c7bdea0693 100644 --- a/packages/@aws-cdk/aws-xray/test/xray.test.ts +++ b/packages/@aws-cdk/aws-xray/test/xray.test.ts @@ -1,4 +1,4 @@ -import '@aws-cdk/assert-internal/jest'; +import '@aws-cdk/assertions'; import {} from '../lib'; test('No tests are specified for this package', () => { diff --git a/packages/@aws-cdk/cfnspec/build-tools/create-missing-libraries.ts b/packages/@aws-cdk/cfnspec/build-tools/create-missing-libraries.ts index 8a62868591119..db1edab50e8a4 100644 --- a/packages/@aws-cdk/cfnspec/build-tools/create-missing-libraries.ts +++ b/packages/@aws-cdk/cfnspec/build-tools/create-missing-libraries.ts @@ -179,7 +179,7 @@ async function main() { license: 'Apache-2.0', devDependencies: { '@types/jest': '^26.0.22', - '@aws-cdk/assert-internal': version, + '@aws-cdk/assertions': version, 'cdk-build-tools': version, 'cfn2ts': version, 'pkglint': version, @@ -263,7 +263,7 @@ async function main() { ]); await write(`test/${lowcaseModuleName}.test.ts`, [ - "import '@aws-cdk/assert-internal/jest';", + "import '@aws-cdk/assertions';", "import {} from '../lib';", '', "test('No tests are specified for this package', () => {", diff --git a/packages/@aws-cdk/example-construct-library/package.json b/packages/@aws-cdk/example-construct-library/package.json index 9eb248eba276e..7f66f7c22ee55 100644 --- a/packages/@aws-cdk/example-construct-library/package.json +++ b/packages/@aws-cdk/example-construct-library/package.json @@ -66,12 +66,12 @@ }, "license": "Apache-2.0", "devDependencies": { + "@aws-cdk/assertions": "0.0.0", "@types/jest": "^26.0.24", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "jest": "^26.6.3", - "pkglint": "0.0.0", - "@aws-cdk/assert-internal": "0.0.0" + "pkglint": "0.0.0" }, "dependencies": { "@aws-cdk/aws-cloudwatch": "0.0.0", diff --git a/packages/@aws-cdk/example-construct-library/test/example-resource.test.ts b/packages/@aws-cdk/example-construct-library/test/example-resource.test.ts index 8145feddb307d..091c0c7d1f65a 100644 --- a/packages/@aws-cdk/example-construct-library/test/example-resource.test.ts +++ b/packages/@aws-cdk/example-construct-library/test/example-resource.test.ts @@ -4,10 +4,7 @@ * but it's considered Names, and we want to migrate to Jest). */ -// import the various CDK assertion helpers -import { ABSENT, ResourcePart } from '@aws-cdk/assert-internal'; -// always import our Jest-specific helpers -import '@aws-cdk/assert-internal/jest'; +import { Match, Template } from '@aws-cdk/assertions'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; @@ -40,13 +37,13 @@ describe('Example Resource', () => { test('creates a CFN WaitConditionHandle resource', () => { // you can simply assert that a resource of a given type // was generated in the resulting template - expect(stack).toHaveResource('AWS::CloudFormation::WaitConditionHandle'); + Template.fromStack(stack).resourceCountIs('AWS::CloudFormation::WaitConditionHandle', 1); }); describe('creates a CFN WaitCondition resource', () => { test('with count = 0 and timeout = 10', () => { // you can also assert the properties of the resulting resource - expect(stack).toHaveResource('AWS::CloudFormation::WaitCondition', { + Template.fromStack(stack).hasResourceProperties('AWS::CloudFormation::WaitCondition', { 'Count': 0, 'Timeout': '10', 'Handle': { @@ -59,19 +56,19 @@ describe('Example Resource', () => { 'Ref': 'ExampleResourceWaitConditionHandle9C53A8D3', }, // this is how you can check a given property is _not_ set - 'RandomProperty': ABSENT, + 'RandomProperty': Match.absentProperty(), }); }); test('with retention policy = Retain', () => { - // haveResource asserts _all_ properties of a resource, - // while haveResourceLike only those that you provide - expect(stack).toHaveResourceLike('AWS::CloudFormation::WaitCondition', { + // hasResource asserts _all_ properties of a resource, + // while hasResourceProperties only those within the 'Property' block + Template.fromStack(stack).hasResource('AWS::CloudFormation::WaitCondition', { 'DeletionPolicy': 'Retain', 'UpdateReplacePolicy': 'Retain', // by default, haveResource and haveResourceLike only assert the properties of a resource - // here's how you make them look at the entire resource definition - }, ResourcePart.CompleteDefinition); + }); }); }); @@ -91,11 +88,12 @@ describe('Example Resource', () => { exampleResource.grantRead(role); - expect(stack).toHaveResourceLike('AWS::IAM::Policy', { + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { 'PolicyDocument': { 'Statement': [ { 'Action': 's3:Get*', + 'Effect': 'Allow', 'Resource': { 'Fn::Join': ['', [ 'arn:', @@ -131,7 +129,7 @@ describe('Example Resource', () => { }); test('correctly fills out the subnetIds property of the created VPC endpoint', () => { - expect(stack).toHaveResourceLike('AWS::EC2::VPCEndpoint', { + Template.fromStack(stack).hasResourceProperties('AWS::EC2::VPCEndpoint', { 'SubnetIds': [ { 'Ref': 'VpcPrivateSubnet1Subnet536B997A' }, { 'Ref': 'VpcPrivateSubnet2Subnet3788AAA1' }, From 77dfa2f8546d03671b3304d2910a9c7e387ff6a8 Mon Sep 17 00:00:00 2001 From: Ben Chaimberg Date: Tue, 3 Aug 2021 11:11:26 -0700 Subject: [PATCH 05/47] chore: temporarily transfer @skinny85 module ownership (#15872) --- .github/workflows/issue-label-assign.yml | 116 +++++++++++------------ 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/.github/workflows/issue-label-assign.yml b/.github/workflows/issue-label-assign.yml index fe09e74b25e2e..bcf12f04a1ec6 100644 --- a/.github/workflows/issue-label-assign.yml +++ b/.github/workflows/issue-label-assign.yml @@ -21,23 +21,23 @@ jobs: [ {"keywords":["(cli)","(command line)"],"labels":["package/tools"],"assignees":["rix0rrr"]}, {"keywords":["(@aws-cdk/alexa-ask)","(alexa-ask)","(alexa ask)"],"labels":["@aws-cdk/alexa-ask"],"assignees":["madeline-k"]}, - {"keywords":["(@aws-cdk/app-delivery)","(app-delivery)","(app delivery)"],"labels":["@aws-cdk/app-delivery"],"assignees":["skinny85"]}, + {"keywords":["(@aws-cdk/app-delivery)","(app-delivery)","(app delivery)"],"labels":["@aws-cdk/app-delivery"],"assignees":["madeline-k"]}, {"keywords":["(@aws-cdk/assert)","(assert)"],"labels":["@aws-cdk/assert"],"assignees":["nija-at"]}, {"keywords":["(@aws-cdk/assets)","(assets)"],"labels":["@aws-cdk/assets"],"assignees":["eladb"]}, - {"keywords":["(@aws-cdk/aws-accessanalyzer)","(aws-accessanalyzer)","(accessanalyzer)","(access analyzer)"],"labels":["@aws-cdk/aws-accessanalyzer"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-acmpca)","(aws-acmpca)","(acmpca)"],"labels":["@aws-cdk/aws-acmpca"],"assignees":["skinny85"]}, + {"keywords":["(@aws-cdk/aws-accessanalyzer)","(aws-accessanalyzer)","(accessanalyzer)","(access analyzer)"],"labels":["@aws-cdk/aws-accessanalyzer"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-acmpca)","(aws-acmpca)","(acmpca)"],"labels":["@aws-cdk/aws-acmpca"],"assignees":["BenChaimberg"]}, {"keywords":["(@aws-cdk/aws-amazonmq)","(aws-amazonmq)","(amazonmq)","(amazon mq)","(amazon-mq)"],"labels":["@aws-cdk/aws-amazonmq"],"assignees":["otaviomacedo"]}, - {"keywords":["(@aws-cdk/aws-amplify)","(aws-amplify)","(amplify)"],"labels":["@aws-cdk/aws-amplify"],"assignees":["skinny85"]}, + {"keywords":["(@aws-cdk/aws-amplify)","(aws-amplify)","(amplify)"],"labels":["@aws-cdk/aws-amplify"],"assignees":["madeline-k"]}, {"keywords":["(@aws-cdk/aws-apigateway)","(aws-apigateway)","(apigateway)","(api gateway)","(api-gateway)"],"labels":["@aws-cdk/aws-apigateway"],"assignees":["nija-at"]}, {"keywords":["(@aws-cdk/aws-apigatewayv2)","(aws-apigatewayv2)","(apigatewayv2)","(apigateway v2)","(api-gateway-v2)"],"labels":["@aws-cdk/aws-apigatewayv2"],"assignees":["nija-at"]}, {"keywords":["(@aws-cdk/aws-apigatewayv2-authorizers)","(aws-apigatewayv2-authorizers)","(apigatewayv2-authorizers)"],"labels":["@aws-cdk/aws-apigatewayv2-authorizers"],"assignees":["nija-at"]}, {"keywords":["(@aws-cdk/aws-apigatewayv2-integrations)","(aws-apigatewayv2-integrations)","(apigatewayv2-integrations)","(apigateway v2 integrations)","(api-gateway-v2-integrations)"],"labels":["@aws-cdk/aws-apigatewayv2-integrations"],"assignees":["nija-at"]}, {"keywords":["(@aws-cdk/aws-appconfig)","(aws-appconfig)","(appconfig)","(app config)","(app-config)"],"labels":["@aws-cdk/aws-appconfig"],"assignees":["rix0rrr"]}, - {"keywords":["(@aws-cdk/aws-appflow)","(aws-appflow)","(appflow)","(app flow)","(app-flow)"],"labels":["@aws-cdk/aws-appflow"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-appintegrations)","(aws-appintegrations)","(appintegrations)"],"labels":["@aws-cdk/aws-appintegrations"],"assignees":["skinny85"]}, + {"keywords":["(@aws-cdk/aws-appflow)","(aws-appflow)","(appflow)","(app flow)","(app-flow)"],"labels":["@aws-cdk/aws-appflow"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-appintegrations)","(aws-appintegrations)","(appintegrations)"],"labels":["@aws-cdk/aws-appintegrations"],"assignees":["BenChaimberg"]}, {"keywords":["(@aws-cdk/aws-applicationautoscaling)","(aws-applicationautoscaling)","(applicationautoscaling)","(application autoscaling)","(application-autoscaling)"],"labels":["@aws-cdk/aws-applicationautoscaling"],"assignees":["rix0rrr"]}, {"keywords":["(@aws-cdk/aws-applicationinsights)","(aws-applicationinsights)","(applicationinsights)","(application insights)","(application-insights)"],"labels":["@aws-cdk/aws-applicationinsights"],"assignees":["njlynch"]}, - {"keywords":["(@aws-cdk/aws-appmesh)","(aws-appmesh)","(appmesh)","(app mesh)","(app-mesh)"],"labels":["@aws-cdk/aws-appmesh"],"assignees":["skinny85"]}, + {"keywords":["(@aws-cdk/aws-appmesh)","(aws-appmesh)","(appmesh)","(app mesh)","(app-mesh)"],"labels":["@aws-cdk/aws-appmesh"],"assignees":["BenChaimberg"]}, {"keywords":["(@aws-cdk/aws-appstream)","(aws-appstream)","(appstream)","(app stream)","(app-stream)"],"labels":["@aws-cdk/aws-appstream"],"assignees":["madeline-k"]}, {"keywords":["(@aws-cdk/aws-appsync)","(aws-appsync)","(appsync)","(app sync)","(app-sync)"],"labels":["@aws-cdk/aws-appsync"],"assignees":["otaviomacedo"]}, {"keywords":["(@aws-cdk/aws-athena)","(aws-athena)","(athena)"],"labels":["@aws-cdk/aws-athena"],"assignees":["BenChaimberg"]}, @@ -54,7 +54,7 @@ jobs: {"keywords":["(@aws-cdk/aws-ce)","(aws-ce)","(ce)"],"labels":["@aws-cdk/aws-ce"],"assignees":["njlynch"]}, {"keywords":["(@aws-cdk/aws-certificatemanager)","(aws-certificatemanager)","(certificatemanager)","(certificate manager)","(certificate-manager)","(acm)"],"labels":["@aws-cdk/aws-certificatemanager"],"assignees":["njlynch"]}, {"keywords":["(@aws-cdk/aws-chatbot)","(aws-chatbot)","(chatbot)"],"labels":["@aws-cdk/aws-chatbot"],"assignees":["BenChaimberg"]}, - {"keywords":["(@aws-cdk/aws-cloud9)","(aws-cloud9)","(cloud9)","(cloud 9)"],"labels":["@aws-cdk/aws-cloud9"],"assignees":["skinny85"]}, + {"keywords":["(@aws-cdk/aws-cloud9)","(aws-cloud9)","(cloud9)","(cloud 9)"],"labels":["@aws-cdk/aws-cloud9"],"assignees":["BenChaimberg"]}, {"keywords":["(@aws-cdk/aws-cloudformation)","(aws-cloudformation)","(cloudformation)","(cloud formation)"],"labels":["@aws-cdk/aws-cloudformation"],"assignees":["rix0rrr"]}, {"keywords":["(@aws-cdk/aws-cloudfront)","(aws-cloudfront)","(cloudfront)","(cloud front)"],"labels":["@aws-cdk/aws-cloudfront"],"assignees":["njlynch"]}, {"keywords":["(@aws-cdk/aws-cloudfront-origins)","(aws-cloudfront-origins)","(cloudfront-origins)","(cloudfront origins)"],"labels":["@aws-cdk/aws-cloudfront-origins"],"assignees":["njlynch"]}, @@ -62,31 +62,31 @@ jobs: {"keywords":["(@aws-cdk/aws-cloudwatch)","(aws-cloudwatch)","(cloudwatch)","(cloud watch)"],"labels":["@aws-cdk/aws-cloudwatch"],"assignees":["madeline-k"]}, {"keywords":["(@aws-cdk/aws-cloudwatch-actions)","(aws-cloudwatch-actions)","(cloudwatch-actions)","(cloudwatch actions)"],"labels":["@aws-cdk/aws-cloudwatch-actions"],"assignees":["madeline-k"]}, {"keywords":["(@aws-cdk/aws-codeartifact)","(aws-codeartifact)","(codeartifact)","(code artifact)","(code-artifact)"],"labels":["@aws-cdk/aws-codeartifact"],"assignees":["njlynch"]}, - {"keywords":["(@aws-cdk/aws-codebuild)","(aws-codebuild)","(codebuild)","(code build)","(code-build)"],"labels":["@aws-cdk/aws-codebuild"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-codecommit)","(aws-codecommit)","(codecommit)","(code commit)", "(code-commit)"],"labels":["@aws-cdk/aws-codecommit"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-codedeploy)","(aws-codedeploy)","(codedeploy)","(code deploy)","(code-deploy)"],"labels":["@aws-cdk/aws-codedeploy"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-codeguruprofiler)","(aws-codeguruprofiler)","(codeguruprofiler)","(codeguru profiler)","(codeguru-profiler)"],"labels":["@aws-cdk/aws-codeguruprofiler"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-codegurureviewer)","(aws-codegurureviewer)","(codegurureviewer)","(codeguru reviewer)","(codeguru-reviewer)"],"labels":["@aws-cdk/aws-codegurureviewer"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-codepipeline)","(aws-codepipeline)","(codepipeline)","(code pipeline)","(code-pipeline)"],"labels":["@aws-cdk/aws-codepipeline"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-codepipeline-actions)","(aws-codepipeline-actions)","(codepipeline-actions)","(codepipeline actions)"],"labels":["@aws-cdk/aws-codepipeline-actions"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-codestar)","(aws-codestar)","(codestar)"],"labels":["@aws-cdk/aws-codestar"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-codestarconnections)","(aws-codestarconnections)","(codestarconnections)","(codestar connections)","(codestar-connections)"],"labels":["@aws-cdk/aws-codestarconnections"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-codestarnotifications)","(aws-codestarnotifications)","(codestarnotifications)","(codestar notifications)","(codestar-notifications)"],"labels":["@aws-cdk/aws-codestarnotifications"],"assignees":["skinny85"]}, + {"keywords":["(@aws-cdk/aws-codebuild)","(aws-codebuild)","(codebuild)","(code build)","(code-build)"],"labels":["@aws-cdk/aws-codebuild"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-codecommit)","(aws-codecommit)","(codecommit)","(code commit)", "(code-commit)"],"labels":["@aws-cdk/aws-codecommit"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-codedeploy)","(aws-codedeploy)","(codedeploy)","(code deploy)","(code-deploy)"],"labels":["@aws-cdk/aws-codedeploy"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-codeguruprofiler)","(aws-codeguruprofiler)","(codeguruprofiler)","(codeguru profiler)","(codeguru-profiler)"],"labels":["@aws-cdk/aws-codeguruprofiler"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-codegurureviewer)","(aws-codegurureviewer)","(codegurureviewer)","(codeguru reviewer)","(codeguru-reviewer)"],"labels":["@aws-cdk/aws-codegurureviewer"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-codepipeline)","(aws-codepipeline)","(codepipeline)","(code pipeline)","(code-pipeline)"],"labels":["@aws-cdk/aws-codepipeline"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-codepipeline-actions)","(aws-codepipeline-actions)","(codepipeline-actions)","(codepipeline actions)"],"labels":["@aws-cdk/aws-codepipeline-actions"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-codestar)","(aws-codestar)","(codestar)"],"labels":["@aws-cdk/aws-codestar"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-codestarconnections)","(aws-codestarconnections)","(codestarconnections)","(codestar connections)","(codestar-connections)"],"labels":["@aws-cdk/aws-codestarconnections"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-codestarnotifications)","(aws-codestarnotifications)","(codestarnotifications)","(codestar notifications)","(codestar-notifications)"],"labels":["@aws-cdk/aws-codestarnotifications"],"assignees":["BenChaimberg"]}, {"keywords":["(@aws-cdk/aws-cognito)","(aws-cognito)","(cognito)"],"labels":["@aws-cdk/aws-cognito"],"assignees":["nija-at"]}, {"keywords":["(@aws-cdk/aws-config)","(aws-config)","(config)"],"labels":["@aws-cdk/aws-config"],"assignees":["rix0rrr"]}, {"keywords":["(@aws-cdk/aws-customerprofiles)","(aws-customerprofiles)","(customerprofiles)"],"labels":["@aws-cdk/aws-customerprofiles"],"assignees":["otaviomacedo"]}, {"keywords":["(@aws-cdk/aws-databrew)","(aws-databrew)","(databrew)"],"labels":["@aws-cdk/aws-databrew"],"assignees":["BenChaimberg"]}, {"keywords":["(@aws-cdk/aws-datapipeline)","(aws-datapipeline)","(datapipeline)","(data pipeline)","(data-pipeline)"],"labels":["@aws-cdk/aws-datapipeline"],"assignees":["BenChaimberg"]}, {"keywords":["(@aws-cdk/aws-datasync)","(aws-datasync)","(datasync)"],"labels":["@aws-cdk/aws-datasync"],"assignees":["BenChaimberg"]}, - {"keywords":["(@aws-cdk/aws-dax)","(aws-dax)","(dax)"],"labels":["@aws-cdk/aws-dax"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-detective)","(aws-detective)","(detective)"],"labels":["@aws-cdk/aws-detective"],"assignees":["skinny85"]}, + {"keywords":["(@aws-cdk/aws-dax)","(aws-dax)","(dax)"],"labels":["@aws-cdk/aws-dax"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-detective)","(aws-detective)","(detective)"],"labels":["@aws-cdk/aws-detective"],"assignees":["BenChaimberg"]}, {"keywords":["(@aws-cdk/aws-devopsguru)","(aws-devopsguru)","(devopsguru)"],"labels":["@aws-cdk/aws-devopsguru"],"assignees":["nija-at"]}, {"keywords":["(@aws-cdk/aws-directoryservice)","(aws-directoryservice)","(directoryservice)","(directory service)","(directory-service)"],"labels":["@aws-cdk/aws-directoryservice"],"assignees":["rix0rrr"]}, {"keywords":["(@aws-cdk/aws-dlm)","(aws-dlm)","(dlm)"],"labels":["@aws-cdk/aws-dlm"],"assignees":["njlynch"]}, {"keywords":["(@aws-cdk/aws-dms)","(aws-dms)","(dms)"],"labels":["@aws-cdk/aws-dms"],"assignees":["njlynch"]}, - {"keywords":["(@aws-cdk/aws-docdb)","(aws-docdb)","(docdb)","(doc db)","(doc-db)"],"labels":["@aws-cdk/aws-docdb"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-dynamodb)","(aws-dynamodb)","(dynamodb)","(dynamo db)","(dynamo-db)"],"labels":["@aws-cdk/aws-dynamodb"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-dynamodb-global)","(aws-dynamodb-global)","(dynamodb-global)","(dynamodb global)"],"labels":["@aws-cdk/aws-dynamodb-global"],"assignees":["skinny85"]}, + {"keywords":["(@aws-cdk/aws-docdb)","(aws-docdb)","(docdb)","(doc db)","(doc-db)"],"labels":["@aws-cdk/aws-docdb"],"assignees":["madeline-k"]}, + {"keywords":["(@aws-cdk/aws-dynamodb)","(aws-dynamodb)","(dynamodb)","(dynamo db)","(dynamo-db)"],"labels":["@aws-cdk/aws-dynamodb"],"assignees":["madeline-k"]}, + {"keywords":["(@aws-cdk/aws-dynamodb-global)","(aws-dynamodb-global)","(dynamodb-global)","(dynamodb global)"],"labels":["@aws-cdk/aws-dynamodb-global"],"assignees":["madeline-k"]}, {"keywords":["(@aws-cdk/aws-ec2)","(aws-ec2)","(ec2)","(vpc)"],"labels":["@aws-cdk/aws-ec2"],"assignees":["njlynch"]}, {"keywords":["(@aws-cdk/aws-ecr)","(aws-ecr)","(ecr)"],"labels":["@aws-cdk/aws-ecr"],"assignees":["madeline-k"]}, {"keywords":["(@aws-cdk/aws-ecr-assets)","(aws-ecr-assets)","(ecr-assets)","(ecr assets)","(ecrassets)"],"labels":["@aws-cdk/aws-ecr-assets"],"assignees":["eladb"]}, @@ -96,7 +96,7 @@ jobs: {"keywords":["(@aws-cdk/aws-eks)","(aws-eks)","(eks)"],"labels":["@aws-cdk/aws-eks"],"assignees":["otaviomacedo"]}, {"keywords":["(@aws-cdk/aws-eks-legacy)","(aws-eks-legacy)","(eks-legacy)"],"labels":["@aws-cdk/aws-eks-legacy"],"assignees":["otaviomacedo"]}, {"keywords":["(@aws-cdk/aws-elasticache)","(aws-elasticache)","(elasticache)","(elastic cache)","(elastic-cache)"],"labels":["@aws-cdk/aws-elasticache"],"assignees":["otaviomacedo"]}, - {"keywords":["(@aws-cdk/aws-elasticbeanstalk)","(aws-elasticbeanstalk)","(elasticbeanstalk)","(elastic beanstalk)","(elastic-beanstalk)"],"labels":["@aws-cdk/aws-elasticbeanstalk"],"assignees":["skinny85"]}, + {"keywords":["(@aws-cdk/aws-elasticbeanstalk)","(aws-elasticbeanstalk)","(elasticbeanstalk)","(elastic beanstalk)","(elastic-beanstalk)"],"labels":["@aws-cdk/aws-elasticbeanstalk"],"assignees":["madeline-k"]}, {"keywords":["(@aws-cdk/aws-elasticloadbalancing)","(aws-elasticloadbalancing)","(elasticloadbalancing)","(elastic loadbalancing)","(elastic-loadbalancing)","(elb)"],"labels":["@aws-cdk/aws-elasticloadbalancing"],"assignees":["njlynch"]}, {"keywords":["(@aws-cdk/aws-elasticloadbalancingv2)","(aws-elasticloadbalancingv2)","(elasticloadbalancingv2)","(elastic-loadbalancing-v2)","(elbv2)","(elb v2)"],"labels":["@aws-cdk/aws-elasticloadbalancingv2"],"assignees":["njlynch"]}, {"keywords":["(@aws-cdk/aws-elasticloadbalancingv2-actions)","(aws-elasticloadbalancingv2-actions)","(elasticloadbalancingv2-actions)"],"labels":["@aws-cdk/aws-elasticloadbalancingv2-actions"],"assignees":["njlynch"]}, @@ -106,7 +106,7 @@ jobs: {"keywords":["(@aws-cdk/aws-emrcontainers)","(aws-emrcontainers)","(emrcontainers)"],"labels":["@aws-cdk/aws-emrcontainers"],"assignees":["BenChaimberg"]}, {"keywords":["(@aws-cdk/aws-events)","(aws-events)","(events)","(eventbridge)","(event-bridge)"],"labels":["@aws-cdk/aws-events"],"assignees":["rix0rrr"]}, {"keywords":["(@aws-cdk/aws-events-targets)","(aws-events-targets)","(events-targets)","(events targets)"],"labels":["@aws-cdk/aws-events-targets"],"assignees":["rix0rrr"]}, - {"keywords":["(@aws-cdk/aws-eventschemas)","(aws-eventschemas)","(eventschemas)","(event schemas)"],"labels":["@aws-cdk/aws-eventschemas"],"assignees":["skinny85"]}, + {"keywords":["(@aws-cdk/aws-eventschemas)","(aws-eventschemas)","(eventschemas)","(event schemas)"],"labels":["@aws-cdk/aws-eventschemas"],"assignees":["BenChaimberg"]}, {"keywords":["(@aws-cdk/aws-finspace)","(aws-finspace)","(finspace)"],"labels":["@aws-cdk/aws-finspace"],"assignees":["njlynch"]}, {"keywords":["(@aws-cdk/aws-fis)","(aws-fis)","(fis)"],"labels":["@aws-cdk/aws-fis"],"assignees":["njlynch"]}, {"keywords":["(@aws-cdk/aws-fms)","(aws-fms)","(fms)"],"labels":["@aws-cdk/aws-fms"],"assignees":["rix0rrr"]}, @@ -116,23 +116,23 @@ jobs: {"keywords":["(@aws-cdk/aws-globalaccelerator)","(aws-globalaccelerator)","(globalaccelerator)","(global accelerator)","(global-accelerator)"],"labels":["@aws-cdk/aws-globalaccelerator"],"assignees":["rix0rrr"]}, {"keywords":["(@aws-cdk/aws-globalaccelerator-endpoints)","(aws-globalaccelerator-endpoints)","(globalaccelerator-endpoints)"],"labels":["@aws-cdk/aws-globalaccelerator-endpoints"],"assignees":["rix0rrr"]}, {"keywords":["(@aws-cdk/aws-glue)","(aws-glue)","(glue)"],"labels":["@aws-cdk/aws-glue"],"assignees":["BenChaimberg"]}, - {"keywords":["(@aws-cdk/aws-greengrass)","(aws-greengrass)","(greengrass)","(green grass)","(green-grass)"],"labels":["@aws-cdk/aws-greengrass"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-greengrassv2)","(aws-greengrassv2)","(greengrassv2)"],"labels":["@aws-cdk/aws-greengrassv2"],"assignees":["skinny85"]}, + {"keywords":["(@aws-cdk/aws-greengrass)","(aws-greengrass)","(greengrass)","(green grass)","(green-grass)"],"labels":["@aws-cdk/aws-greengrass"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-greengrassv2)","(aws-greengrassv2)","(greengrassv2)"],"labels":["@aws-cdk/aws-greengrassv2"],"assignees":["BenChaimberg"]}, {"keywords":["(@aws-cdk/aws-groundstation)","(aws-groundstation)","(groundstation)"],"labels":["@aws-cdk/aws-groundstation"],"assignees":["rix0rrr"]}, {"keywords":["(@aws-cdk/aws-guardduty)","(aws-guardduty)","(guardduty)","(guard duty)","(guard-duty)"],"labels":["@aws-cdk/aws-guardduty"],"assignees":["rix0rrr"]}, {"keywords":["(@aws-cdk/aws-iam)","(aws-iam)","(iam)"],"labels":["@aws-cdk/aws-iam"],"assignees":["rix0rrr"]}, - {"keywords":["(@aws-cdk/aws-imagebuilder)","(aws-imagebuilder)","(imagebuilder)","(image builder)","(image-builder)"],"labels":["@aws-cdk/aws-imagebuilder"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-inspector)","(aws-inspector)","(inspector)"],"labels":["@aws-cdk/aws-inspector"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-iot)","(aws-iot)","(iot)"],"labels":["@aws-cdk/aws-iot"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-iot1click)","(aws-iot1click)","(iot1click)","(iot 1click)"],"labels":["@aws-cdk/aws-iot1click"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-iotanalytics)","(aws-iotanalytics)","(iotanalytics)","(iot analytics)","(iot-analytics)"],"labels":["@aws-cdk/aws-iotanalytics"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-iotevents)","(aws-iotevents)","(iotevents)","(iot events)","(iot-events)"],"labels":["@aws-cdk/aws-iotevents"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-iotfleethub)","(aws-iotfleethub)","(iotfleethub)"],"labels":["@aws-cdk/aws-iotfleethub"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-iotsitewise)","(aws-iotsitewise)","(iotsitewise)","(iot sitewise)","(iot-sitewise)","(iot-site-wise)","(iot site wise)"],"labels":["@aws-cdk/aws-iotsitewise"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-iotthingsgraph)","(aws-iotthingsgraph)","(iotthingsgraph)","(iot things graph)","(iot-things-graph)"],"labels":["@aws-cdk/aws-iotthingsgraph"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-iotwireless)","(aws-iotwireless)","(iotwireless)"],"labels":["@aws-cdk/aws-iotwireless"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-ivs)","(aws-ivs)","(Interactive Video Service)","(ivs)"],"labels":["@aws-cdk/aws-ivs"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-kendra)","(aws-kendra)","(kendra)"],"labels":["@aws-cdk/aws-kendra"],"assignees":["skinny85"]}, + {"keywords":["(@aws-cdk/aws-imagebuilder)","(aws-imagebuilder)","(imagebuilder)","(image builder)","(image-builder)"],"labels":["@aws-cdk/aws-imagebuilder"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-inspector)","(aws-inspector)","(inspector)"],"labels":["@aws-cdk/aws-inspector"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-iot)","(aws-iot)","(iot)"],"labels":["@aws-cdk/aws-iot"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-iot1click)","(aws-iot1click)","(iot1click)","(iot 1click)"],"labels":["@aws-cdk/aws-iot1click"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-iotanalytics)","(aws-iotanalytics)","(iotanalytics)","(iot analytics)","(iot-analytics)"],"labels":["@aws-cdk/aws-iotanalytics"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-iotevents)","(aws-iotevents)","(iotevents)","(iot events)","(iot-events)"],"labels":["@aws-cdk/aws-iotevents"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-iotfleethub)","(aws-iotfleethub)","(iotfleethub)"],"labels":["@aws-cdk/aws-iotfleethub"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-iotsitewise)","(aws-iotsitewise)","(iotsitewise)","(iot sitewise)","(iot-sitewise)","(iot-site-wise)","(iot site wise)"],"labels":["@aws-cdk/aws-iotsitewise"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-iotthingsgraph)","(aws-iotthingsgraph)","(iotthingsgraph)","(iot things graph)","(iot-things-graph)"],"labels":["@aws-cdk/aws-iotthingsgraph"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-iotwireless)","(aws-iotwireless)","(iotwireless)"],"labels":["@aws-cdk/aws-iotwireless"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-ivs)","(aws-ivs)","(Interactive Video Service)","(ivs)"],"labels":["@aws-cdk/aws-ivs"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-kendra)","(aws-kendra)","(kendra)"],"labels":["@aws-cdk/aws-kendra"],"assignees":["BenChaimberg"]}, {"keywords":["(@aws-cdk/aws-kinesis)","(aws-kinesis)","(kinesis)"],"labels":["@aws-cdk/aws-kinesis"],"assignees":["otaviomacedo"]}, {"keywords":["(@aws-cdk/aws-kinesisanalytics)","(aws-kinesisanalytics)","(kinesisanalytics)","(kinesis analytics)","(kinesis-analytics)"],"labels":["@aws-cdk/aws-kinesisanalytics"],"assignees":["otaviomacedo"]}, {"keywords":["(@aws-cdk/aws-kinesisanalytics-flink)","(aws-kinesisanalytics-flink)","(kinesisanalytics-flink)"],"labels":["@aws-cdk/aws-kinesisanalytics-flink"],"assignees":["otaviomacedo"]}, @@ -151,27 +151,27 @@ jobs: {"keywords":["(@aws-cdk/aws-lookoutmetrics)","(aws-lookoutmetrics)","(lookoutmetrics)"],"labels":["@aws-cdk/aws-lookoutmetrics"],"assignees":["BenChaimberg"]}, {"keywords":["(@aws-cdk/aws-lookoutvision)","(aws-lookoutvision)","(lookoutvision)"],"labels":["@aws-cdk/aws-lookoutvision"],"assignees":["BenChaimberg"]}, {"keywords":["(@aws-cdk/aws-macie)","(aws-macie)","(macie)"],"labels":["@aws-cdk/aws-macie"],"assignees":["njlynch"]}, - {"keywords":["(@aws-cdk/aws-managedblockchain)","(aws-managedblockchain)","(managedblockchain)","(managed blockchain)","(managed-blockchain)"],"labels":["@aws-cdk/aws-managedblockchain"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-mediaconnect)","(aws-mediaconnect)","(mediaconnect)"],"labels":["@aws-cdk/aws-mediaconnect"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-mediaconvert)","(aws-mediaconvert)","(mediaconvert)","(media convert)","(media-convert)"],"labels":["@aws-cdk/aws-mediaconvert"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-medialive)","(aws-medialive)","(medialive)","(media live)","(media-live)"],"labels":["@aws-cdk/aws-medialive"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-mediastore)","(aws-mediastore)","(mediastore)","(media store)","(media-store)"],"labels":["@aws-cdk/aws-mediastore"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-mediapackage)","(aws-mediapackage)","(mediapackage)","(media package)","(media-package)"],"labels":["@aws-cdk/aws-mediapackage"],"assignees":["skinny85"]}, + {"keywords":["(@aws-cdk/aws-managedblockchain)","(aws-managedblockchain)","(managedblockchain)","(managed blockchain)","(managed-blockchain)"],"labels":["@aws-cdk/aws-managedblockchain"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-mediaconnect)","(aws-mediaconnect)","(mediaconnect)"],"labels":["@aws-cdk/aws-mediaconnect"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-mediaconvert)","(aws-mediaconvert)","(mediaconvert)","(media convert)","(media-convert)"],"labels":["@aws-cdk/aws-mediaconvert"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-medialive)","(aws-medialive)","(medialive)","(media live)","(media-live)"],"labels":["@aws-cdk/aws-medialive"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-mediastore)","(aws-mediastore)","(mediastore)","(media store)","(media-store)"],"labels":["@aws-cdk/aws-mediastore"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-mediapackage)","(aws-mediapackage)","(mediapackage)","(media package)","(media-package)"],"labels":["@aws-cdk/aws-mediapackage"],"assignees":["BenChaimberg"]}, {"keywords":["(@aws-cdk/aws-msk)","(aws-msk)","(msk)"],"labels":["@aws-cdk/aws-msk"],"assignees":["otaviomacedo"]}, {"keywords":["(@aws-cdk/aws-mwaa)","(aws-mwaa)","(mwaa)"],"labels":["@aws-cdk/aws-mwaa"],"assignees":["rix0rrr"]}, {"keywords":["(@aws-cdk/aws-neptune)","(aws-neptune)","(neptune)"],"labels":["@aws-cdk/aws-neptune"],"assignees":["njlynch"]}, - {"keywords":["(@aws-cdk/aws-networkfirewall)","(aws-networkfirewall)","(networkfirewall)"],"labels":["@aws-cdk/aws-networkfirewall"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-networkmanager)","(aws-networkmanager)","(networkmanager)","(network manager)","(network-manager)"],"labels":["@aws-cdk/aws-networkmanager"],"assignees":["skinny85"]}, + {"keywords":["(@aws-cdk/aws-networkfirewall)","(aws-networkfirewall)","(networkfirewall)"],"labels":["@aws-cdk/aws-networkfirewall"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-networkmanager)","(aws-networkmanager)","(networkmanager)","(network manager)","(network-manager)"],"labels":["@aws-cdk/aws-networkmanager"],"assignees":["BenChaimberg"]}, {"keywords":["(@aws-cdk/aws-nimblestudio)","(aws-nimblestudio)","(nimblestudio)"],"labels":["@aws-cdk/aws-nimblestudio"],"assignees":["madeline-k"]}, {"keywords":["(@aws-cdk/aws-opsworks)","(aws-opsworks)","(opsworks)","(ops works)","(ops-works)"],"labels":["@aws-cdk/aws-opsworks"],"assignees":["madeline-k"]}, {"keywords":["(@aws-cdk/aws-opsworkscm)","(aws-opsworkscm)","(opsworkscm)","(opsworks cm)","(opsworks-cm)"],"labels":["@aws-cdk/aws-opsworkscm"],"assignees":["madeline-k"]}, {"keywords":["(@aws-cdk/aws-personalize)","(aws-personalize)","(personalize)"],"labels":["@aws-cdk/aws-personalize"],"assignees":["njlynch"]}, {"keywords":["(@aws-cdk/aws-pinpoint)","(aws-pinpoint)","(pinpoint)"],"labels":["@aws-cdk/aws-pinpoint"],"assignees":["otaviomacedo"]}, {"keywords":["(@aws-cdk/aws-pinpointemail)","(aws-pinpointemail)","(pinpointemail)","(pinpoint email)","(pinpoint-email)"],"labels":["@aws-cdk/aws-pinpointemail"],"assignees":["otaviomacedo"]}, - {"keywords":["(@aws-cdk/aws-qldb)","(aws-qldb)","(qldb)"],"labels":["@aws-cdk/aws-qldb"],"assignees":["skinny85"]}, + {"keywords":["(@aws-cdk/aws-qldb)","(aws-qldb)","(qldb)"],"labels":["@aws-cdk/aws-qldb"],"assignees":["BenChaimberg"]}, {"keywords":["(@aws-cdk/aws-quicksight)","(aws-quicksight)","(quicksight)"],"labels":["@aws-cdk/aws-quicksight"],"assignees":["BenChaimberg"]}, {"keywords":["(@aws-cdk/aws-ram)","(aws-ram)","(ram)"],"labels":["@aws-cdk/aws-ram"],"assignees":["madeline-k"]}, - {"keywords":["(@aws-cdk/aws-rds)","(aws-rds)","(rds)"],"labels":["@aws-cdk/aws-rds"],"assignees":["skinny85"]}, + {"keywords":["(@aws-cdk/aws-rds)","(aws-rds)","(rds)"],"labels":["@aws-cdk/aws-rds"],"assignees":["BenChaimberg"]}, {"keywords":["(@aws-cdk/aws-redshift)","(aws-redshift)","(redshift)","(red shift)","(red-shift)"],"labels":["@aws-cdk/aws-redshift"],"assignees":["njlynch"]}, {"keywords":["(@aws-cdk/aws-resourcegroups)","(aws-resourcegroups)","(resourcegroups)","(resource groups)","(resource-groups)"],"labels":["@aws-cdk/aws-resourcegroups"],"assignees":["madeline-k"]}, {"keywords":["(@aws-cdk/aws-robomaker)","(aws-robomaker)","(robomaker)","(robo maker)","(robo-maker)"],"labels":["@aws-cdk/aws-robomaker"],"assignees":["njlynch"]}, @@ -189,9 +189,9 @@ jobs: {"keywords":["(@aws-cdk/aws-sam)","(aws-sam)","(sam)"],"labels":["@aws-cdk/aws-sam"],"assignees":["njlynch"]}, {"keywords":["(@aws-cdk/aws-sdb)","(aws-sdb)","(sdb)"],"labels":["@aws-cdk/aws-sdb"],"assignees":["njlynch"]}, {"keywords":["(@aws-cdk/aws-secretsmanager)","(aws-secretsmanager)","(secretsmanager)","(secrets manager)","(secrets-manager)"],"labels":["@aws-cdk/aws-secretsmanager"],"assignees":["njlynch"]}, - {"keywords":["(@aws-cdk/aws-securityhub)","(aws-securityhub)","(securityhub)","(security hub)","(security-hub)"],"labels":["@aws-cdk/aws-securityhub"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-servicecatalog)","(aws-servicecatalog)","(servicecatalog)","(service catalog)","(service-catalog)"],"labels":["@aws-cdk/aws-servicecatalog"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/aws-servicecatalogappregistry)","(aws-servicecatalogappregistry)","(servicecatalogappregistry)"],"labels":["@aws-cdk/aws-servicecatalogappregistry"],"assignees":["skinny85"]}, + {"keywords":["(@aws-cdk/aws-securityhub)","(aws-securityhub)","(securityhub)","(security hub)","(security-hub)"],"labels":["@aws-cdk/aws-securityhub"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-servicecatalog)","(aws-servicecatalog)","(servicecatalog)","(service catalog)","(service-catalog)"],"labels":["@aws-cdk/aws-servicecatalog"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/aws-servicecatalogappregistry)","(aws-servicecatalogappregistry)","(servicecatalogappregistry)"],"labels":["@aws-cdk/aws-servicecatalogappregistry"],"assignees":["BenChaimberg"]}, {"keywords":["(@aws-cdk/aws-servicediscovery)","(aws-servicediscovery)","(servicediscovery)","(service discovery)","(service-discovery)"],"labels":["@aws-cdk/aws-servicediscovery"],"assignees":["madeline-k"]}, {"keywords":["(@aws-cdk/aws-ses)","(aws-ses)","(ses)"],"labels":["@aws-cdk/aws-ses"],"assignees":["otaviomacedo"]}, {"keywords":["(@aws-cdk/aws-ses-actions)","(aws-ses-actions)","(ses-actions)","(ses actions)"],"labels":["@aws-cdk/aws-ses-actions"],"assignees":["otaviomacedo"]}, @@ -200,11 +200,11 @@ jobs: {"keywords":["(@aws-cdk/aws-sns-subscriptions)","(aws-sns-subscriptions)","(sns-subscriptions)","(sns subscriptions)"],"labels":["@aws-cdk/aws-sns-subscriptions"],"assignees":["njlynch"]}, {"keywords":["(@aws-cdk/aws-sqs)","(aws-sqs)","(sqs)"],"labels":["@aws-cdk/aws-sqs"],"assignees":["njlynch"]}, {"keywords":["(@aws-cdk/aws-ssm)","(aws-ssm)","(ssm)"],"labels":["@aws-cdk/aws-ssm"],"assignees":["njlynch"]}, - {"keywords":["(@aws-cdk/aws-sso)","(aws-sso)","(sso)"],"labels":["@aws-cdk/aws-sso"],"assignees":["skinny85"]}, + {"keywords":["(@aws-cdk/aws-sso)","(aws-sso)","(sso)"],"labels":["@aws-cdk/aws-sso"],"assignees":["BenChaimberg"]}, {"keywords":["(@aws-cdk/aws-stepfunctions)","(aws-stepfunctions)","(stepfunctions)","(step functions)","(step-functions)"],"labels":["@aws-cdk/aws-stepfunctions"],"assignees":["BenChaimberg"]}, {"keywords":["(@aws-cdk/aws-stepfunctions-tasks)","(aws-stepfunctions-tasks)","(stepfunctions-tasks)","(stepfunctions tasks)"],"labels":["@aws-cdk/aws-stepfunctions-tasks"],"assignees":["BenChaimberg"]}, {"keywords":["(@aws-cdk/aws-synthetics)","(aws-synthetics)","(synthetics)"],"labels":["@aws-cdk/aws-synthetics"],"assignees":["BenChaimberg"]}, - {"keywords":["(@aws-cdk/aws-timestream)","(aws-timestream)","(timestream)"],"labels":["@aws-cdk/aws-timestream"],"assignees":["skinny85"]}, + {"keywords":["(@aws-cdk/aws-timestream)","(aws-timestream)","(timestream)"],"labels":["@aws-cdk/aws-timestream"],"assignees":["BenChaimberg"]}, {"keywords":["(@aws-cdk/aws-transfer)","(aws-transfer)","(transfer)"],"labels":["@aws-cdk/aws-transfer"],"assignees":["otaviomacedo"]}, {"keywords":["(@aws-cdk/aws-waf)","(aws-waf)","(waf)"],"labels":["@aws-cdk/aws-waf"],"assignees":["njlynch"]}, {"keywords":["(@aws-cdk/aws-wafregional)","(aws-wafregional)","(wafregional)","(waf regional)","(waf-regional)"],"labels":["@aws-cdk/aws-wafregional"],"assignees":["njlynch"]}, @@ -213,16 +213,16 @@ jobs: {"keywords":["(@aws-cdk/aws-xray)","(aws-xray)","(xray)"],"labels":["@aws-cdk/aws-xray"],"assignees":["nija-at"]}, {"keywords":["(@aws-cdk/cfnspec)","(cfnspec)","(cfn spec)","(cfn-spec)"],"labels":["@aws-cdk/cfnspec"],"assignees":["rix0rrr"]}, {"keywords":["(@aws-cdk/cloud-assembly-schema)","(cloud-assembly-schema)","(cloud assembly schema)"],"labels":["@aws-cdk/cloud-assembly-schema"],"assignees":["rix0rrr"]}, - {"keywords":["(@aws-cdk/cloudformation-diff)","(cloudformation-diff)","(cloudformation diff)","(cfn diff)"],"labels":["@aws-cdk/cloudformation-diff"],"assignees":["skinny85"]}, - {"keywords":["(@aws-cdk/cloudformation-include)","(cloudformation-include)","(cloudformation include)","(cfn include)","(cfn-include)"],"labels":["@aws-cdk/cloudformation-include"],"assignees":["skinny85"]}, + {"keywords":["(@aws-cdk/cloudformation-diff)","(cloudformation-diff)","(cloudformation diff)","(cfn diff)"],"labels":["@aws-cdk/cloudformation-diff"],"assignees":["BenChaimberg"]}, + {"keywords":["(@aws-cdk/cloudformation-include)","(cloudformation-include)","(cloudformation include)","(cfn include)","(cfn-include)"],"labels":["@aws-cdk/cloudformation-include"],"assignees":["BenChaimberg"]}, {"keywords":["(@aws-cdk/core)","(core)"],"labels":["@aws-cdk/core"],"assignees":["rix0rrr"]}, {"keywords":["(@aws-cdk/custom-resources)","(custom-resources)","(custom resources)"],"labels":["@aws-cdk/custom-resources"],"assignees":["rix0rrr"]}, {"keywords":["(@aws-cdk/cx-api)","(cx-api)","(cx api)"],"labels":["@aws-cdk/cx-api"],"assignees":["rix0rrr"]}, {"keywords":["(@aws-cdk/aws-lambda-layer-awscli)","(aws-lambda-layer-awscli)","(lambda-layer-awscli)"],"labels":["@aws-cdk/aws-lambda-layer-awscli"],"assignees":["rix0rrr"]}, {"keywords":["(@aws-cdk/aws-lambda-layer-kubectl)","(aws-lambda-layer-kubectl)","(lambda-layer-kubectl)"],"labels":["@aws-cdk/aws-lambda-layer-kubectl"],"assignees":["eladb"]}, {"keywords":["(@aws-cdk/pipelines)","(pipelines)","(cdk pipelines)","(cdk-pipelines)"],"labels":["@aws-cdk/pipelines"],"assignees":["rix0rrr"]}, - {"keywords":["(@aws-cdk/region-info)","(region-info)","(region info)"],"labels":["@aws-cdk/region-info"],"assignees":["skinny85"]}, + {"keywords":["(@aws-cdk/region-info)","(region-info)","(region info)"],"labels":["@aws-cdk/region-info"],"assignees":["BenChaimberg"]}, {"keywords":["(aws-cdk-lib)","(cdk-v2)", "(v2)", "(ubergen)"],"labels":["aws-cdk-lib"],"assignees":["nija-at"]}, {"keywords":["(monocdk)","(monocdk-experiment)"],"labels":["monocdk"],"assignees":["nija-at"]}, - {"keywords":["(@aws-cdk/yaml-cfn)","(aws-yaml-cfn)","(yaml-cfn)"],"labels":["@aws-cdk/aws-yaml-cfn"],"assignees":["skinny85"]} + {"keywords":["(@aws-cdk/yaml-cfn)","(aws-yaml-cfn)","(yaml-cfn)"],"labels":["@aws-cdk/aws-yaml-cfn"],"assignees":["BenChaimberg"]} ] From ee191961a8b057a0585e731a67c15a7edd59c79e Mon Sep 17 00:00:00 2001 From: Otavio Macedo Date: Wed, 4 Aug 2021 10:26:15 +0100 Subject: [PATCH 06/47] fix(s3): notifications are broken in some regions (#15884) Happens because `python3.8` doesn't support inline code (i.e `ZipFile`) in some regions. ---- *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/test/integ.s3.expected.json | 2 +- .../aws-s3-notifications/test/integ.notifications.expected.json | 2 +- .../test/lambda/integ.bucket-notifications.expected.json | 2 +- .../test/sns/integ.sns-bucket-notifications.expected.json | 2 +- .../test/sqs/integ.bucket-notifications.expected.json | 2 +- .../notifications-resource/notifications-resource-handler.ts | 2 +- .../aws-s3/test/notifications-resource-handler/Dockerfile | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/integ.s3.expected.json b/packages/@aws-cdk/aws-lambda-event-sources/test/integ.s3.expected.json index 7425814364cff..ff71167d19f9e 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/test/integ.s3.expected.json +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/integ.s3.expected.json @@ -186,7 +186,7 @@ "Arn" ] }, - "Runtime": "python3.8", + "Runtime": "python3.7", "Timeout": 300 }, "DependsOn": [ diff --git a/packages/@aws-cdk/aws-s3-notifications/test/integ.notifications.expected.json b/packages/@aws-cdk/aws-s3-notifications/test/integ.notifications.expected.json index c24d991f31ed5..9026931306ab4 100644 --- a/packages/@aws-cdk/aws-s3-notifications/test/integ.notifications.expected.json +++ b/packages/@aws-cdk/aws-s3-notifications/test/integ.notifications.expected.json @@ -256,7 +256,7 @@ "Arn" ] }, - "Runtime": "python3.8", + "Runtime": "python3.7", "Timeout": 300 }, "DependsOn": [ diff --git a/packages/@aws-cdk/aws-s3-notifications/test/lambda/integ.bucket-notifications.expected.json b/packages/@aws-cdk/aws-s3-notifications/test/lambda/integ.bucket-notifications.expected.json index 42d6d71d603bc..731effea95a53 100644 --- a/packages/@aws-cdk/aws-s3-notifications/test/lambda/integ.bucket-notifications.expected.json +++ b/packages/@aws-cdk/aws-s3-notifications/test/lambda/integ.bucket-notifications.expected.json @@ -246,7 +246,7 @@ "Arn" ] }, - "Runtime": "python3.8", + "Runtime": "python3.7", "Timeout": 300 }, "DependsOn": [ diff --git a/packages/@aws-cdk/aws-s3-notifications/test/sns/integ.sns-bucket-notifications.expected.json b/packages/@aws-cdk/aws-s3-notifications/test/sns/integ.sns-bucket-notifications.expected.json index 74d8086ffe175..47f2a8ea6e0ce 100644 --- a/packages/@aws-cdk/aws-s3-notifications/test/sns/integ.sns-bucket-notifications.expected.json +++ b/packages/@aws-cdk/aws-s3-notifications/test/sns/integ.sns-bucket-notifications.expected.json @@ -204,7 +204,7 @@ "Arn" ] }, - "Runtime": "python3.8", + "Runtime": "python3.7", "Timeout": 300 }, "DependsOn": [ diff --git a/packages/@aws-cdk/aws-s3-notifications/test/sqs/integ.bucket-notifications.expected.json b/packages/@aws-cdk/aws-s3-notifications/test/sqs/integ.bucket-notifications.expected.json index dee0ec6922ed7..229b916beac4b 100644 --- a/packages/@aws-cdk/aws-s3-notifications/test/sqs/integ.bucket-notifications.expected.json +++ b/packages/@aws-cdk/aws-s3-notifications/test/sqs/integ.bucket-notifications.expected.json @@ -193,7 +193,7 @@ "Arn" ] }, - "Runtime": "python3.8", + "Runtime": "python3.7", "Timeout": 300 }, "DependsOn": [ diff --git a/packages/@aws-cdk/aws-s3/lib/notifications-resource/notifications-resource-handler.ts b/packages/@aws-cdk/aws-s3/lib/notifications-resource/notifications-resource-handler.ts index 296bebe265374..c093487a8f105 100644 --- a/packages/@aws-cdk/aws-s3/lib/notifications-resource/notifications-resource-handler.ts +++ b/packages/@aws-cdk/aws-s3/lib/notifications-resource/notifications-resource-handler.ts @@ -87,7 +87,7 @@ export class NotificationsResourceHandler extends Construct { Code: { ZipFile: fs.readFileSync(path.join(__dirname, 'lambda/index.py'), 'utf8') }, Handler: 'index.handler', Role: this.role.roleArn, - Runtime: 'python3.8', + Runtime: 'python3.7', Timeout: 300, }, }); diff --git a/packages/@aws-cdk/aws-s3/test/notifications-resource-handler/Dockerfile b/packages/@aws-cdk/aws-s3/test/notifications-resource-handler/Dockerfile index 916f369bcd353..50dc41b3e6722 100644 --- a/packages/@aws-cdk/aws-s3/test/notifications-resource-handler/Dockerfile +++ b/packages/@aws-cdk/aws-s3/test/notifications-resource-handler/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/python:3.8 +FROM public.ecr.aws/lambda/python:3.7 ADD . /opt/lambda WORKDIR /opt/lambda From 60e6b4186680af98b538a21e82146fb0a0e84f33 Mon Sep 17 00:00:00 2001 From: AWS CDK Automation <43080478+aws-cdk-automation@users.noreply.github.com> Date: Wed, 4 Aug 2021 13:25:47 +0300 Subject: [PATCH 07/47] feat(cfnspec): cloudformation spec v39.8.0 (#15885) Co-authored-by: AWS CDK Team Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- .../aws-route53recoverycontrol/.eslintrc.js | 3 + .../aws-route53recoverycontrol/.gitignore | 19 + .../aws-route53recoverycontrol/.npmignore | 29 + .../aws-route53recoverycontrol/LICENSE | 201 +++++ .../aws-route53recoverycontrol/NOTICE | 2 + .../aws-route53recoverycontrol/README.md | 20 + .../aws-route53recoverycontrol/jest.config.js | 2 + .../aws-route53recoverycontrol/lib/index.ts | 2 + .../aws-route53recoverycontrol/package.json | 103 +++ .../test/route53recoverycontrol.test.ts | 6 + .../aws-route53recoveryreadiness/.eslintrc.js | 3 + .../aws-route53recoveryreadiness/.gitignore | 19 + .../aws-route53recoveryreadiness/.npmignore | 29 + .../aws-route53recoveryreadiness/LICENSE | 201 +++++ .../aws-route53recoveryreadiness/NOTICE | 2 + .../aws-route53recoveryreadiness/README.md | 20 + .../jest.config.js | 2 + .../aws-route53recoveryreadiness/lib/index.ts | 2 + .../aws-route53recoveryreadiness/package.json | 103 +++ .../test/route53recoveryreadiness.test.ts | 6 + packages/@aws-cdk/cfnspec/CHANGELOG.md | 95 +++ packages/@aws-cdk/cfnspec/cfn.version | 2 +- ...0_CloudFormationResourceSpecification.json | 722 +++++++++++++++++- .../cloudformation-include/package.json | 4 + packages/aws-cdk-lib/package.json | 2 + packages/decdk/package.json | 2 + packages/monocdk/package.json | 2 + 27 files changed, 1583 insertions(+), 20 deletions(-) create mode 100644 packages/@aws-cdk/aws-route53recoverycontrol/.eslintrc.js create mode 100644 packages/@aws-cdk/aws-route53recoverycontrol/.gitignore create mode 100644 packages/@aws-cdk/aws-route53recoverycontrol/.npmignore create mode 100644 packages/@aws-cdk/aws-route53recoverycontrol/LICENSE create mode 100644 packages/@aws-cdk/aws-route53recoverycontrol/NOTICE create mode 100644 packages/@aws-cdk/aws-route53recoverycontrol/README.md create mode 100644 packages/@aws-cdk/aws-route53recoverycontrol/jest.config.js create mode 100644 packages/@aws-cdk/aws-route53recoverycontrol/lib/index.ts create mode 100644 packages/@aws-cdk/aws-route53recoverycontrol/package.json create mode 100644 packages/@aws-cdk/aws-route53recoverycontrol/test/route53recoverycontrol.test.ts create mode 100644 packages/@aws-cdk/aws-route53recoveryreadiness/.eslintrc.js create mode 100644 packages/@aws-cdk/aws-route53recoveryreadiness/.gitignore create mode 100644 packages/@aws-cdk/aws-route53recoveryreadiness/.npmignore create mode 100644 packages/@aws-cdk/aws-route53recoveryreadiness/LICENSE create mode 100644 packages/@aws-cdk/aws-route53recoveryreadiness/NOTICE create mode 100644 packages/@aws-cdk/aws-route53recoveryreadiness/README.md create mode 100644 packages/@aws-cdk/aws-route53recoveryreadiness/jest.config.js create mode 100644 packages/@aws-cdk/aws-route53recoveryreadiness/lib/index.ts create mode 100644 packages/@aws-cdk/aws-route53recoveryreadiness/package.json create mode 100644 packages/@aws-cdk/aws-route53recoveryreadiness/test/route53recoveryreadiness.test.ts diff --git a/packages/@aws-cdk/aws-route53recoverycontrol/.eslintrc.js b/packages/@aws-cdk/aws-route53recoverycontrol/.eslintrc.js new file mode 100644 index 0000000000000..61dd8dd001f63 --- /dev/null +++ b/packages/@aws-cdk/aws-route53recoverycontrol/.eslintrc.js @@ -0,0 +1,3 @@ +const baseConfig = require('cdk-build-tools/config/eslintrc'); +baseConfig.parserOptions.project = __dirname + '/tsconfig.json'; +module.exports = baseConfig; diff --git a/packages/@aws-cdk/aws-route53recoverycontrol/.gitignore b/packages/@aws-cdk/aws-route53recoverycontrol/.gitignore new file mode 100644 index 0000000000000..62ebc95d75ce6 --- /dev/null +++ b/packages/@aws-cdk/aws-route53recoverycontrol/.gitignore @@ -0,0 +1,19 @@ +*.js +*.js.map +*.d.ts +tsconfig.json +node_modules +*.generated.ts +dist +.jsii + +.LAST_BUILD +.nyc_output +coverage +.nycrc +.LAST_PACKAGE +*.snk +nyc.config.js +!.eslintrc.js +!jest.config.js +junit.xml diff --git a/packages/@aws-cdk/aws-route53recoverycontrol/.npmignore b/packages/@aws-cdk/aws-route53recoverycontrol/.npmignore new file mode 100644 index 0000000000000..f931fede67c44 --- /dev/null +++ b/packages/@aws-cdk/aws-route53recoverycontrol/.npmignore @@ -0,0 +1,29 @@ +# Don't include original .ts files when doing `npm pack` +*.ts +!*.d.ts +coverage +.nyc_output +*.tgz + +dist +.LAST_PACKAGE +.LAST_BUILD +!*.js + +# Include .jsii +!.jsii + +*.snk + +*.tsbuildinfo + +tsconfig.json + +.eslintrc.js +jest.config.js + +# exclude cdk artifacts +**/cdk.out +junit.xml +test/ +!*.lit.ts diff --git a/packages/@aws-cdk/aws-route53recoverycontrol/LICENSE b/packages/@aws-cdk/aws-route53recoverycontrol/LICENSE new file mode 100644 index 0000000000000..28e4bdcec77ec --- /dev/null +++ b/packages/@aws-cdk/aws-route53recoverycontrol/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/@aws-cdk/aws-route53recoverycontrol/NOTICE b/packages/@aws-cdk/aws-route53recoverycontrol/NOTICE new file mode 100644 index 0000000000000..5fc3826926b5b --- /dev/null +++ b/packages/@aws-cdk/aws-route53recoverycontrol/NOTICE @@ -0,0 +1,2 @@ +AWS Cloud Development Kit (AWS CDK) +Copyright 2018-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/packages/@aws-cdk/aws-route53recoverycontrol/README.md b/packages/@aws-cdk/aws-route53recoverycontrol/README.md new file mode 100644 index 0000000000000..9a4113847129c --- /dev/null +++ b/packages/@aws-cdk/aws-route53recoverycontrol/README.md @@ -0,0 +1,20 @@ +# AWS::Route53RecoveryControl Construct Library + + +--- + +![cfn-resources: Stable](https://img.shields.io/badge/cfn--resources-stable-success.svg?style=for-the-badge) + +> All classes with the `Cfn` prefix in this module ([CFN Resources]) are always stable and safe to use. +> +> [CFN Resources]: https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib + +--- + + + +This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project. + +```ts +import route53recoverycontrol = require('@aws-cdk/aws-route53recoverycontrol'); +``` diff --git a/packages/@aws-cdk/aws-route53recoverycontrol/jest.config.js b/packages/@aws-cdk/aws-route53recoverycontrol/jest.config.js new file mode 100644 index 0000000000000..54e28beb9798b --- /dev/null +++ b/packages/@aws-cdk/aws-route53recoverycontrol/jest.config.js @@ -0,0 +1,2 @@ +const baseConfig = require('cdk-build-tools/config/jest.config'); +module.exports = baseConfig; diff --git a/packages/@aws-cdk/aws-route53recoverycontrol/lib/index.ts b/packages/@aws-cdk/aws-route53recoverycontrol/lib/index.ts new file mode 100644 index 0000000000000..ca032e47c0b98 --- /dev/null +++ b/packages/@aws-cdk/aws-route53recoverycontrol/lib/index.ts @@ -0,0 +1,2 @@ +// AWS::Route53RecoveryControl CloudFormation Resources: +export * from './route53recoverycontrol.generated'; diff --git a/packages/@aws-cdk/aws-route53recoverycontrol/package.json b/packages/@aws-cdk/aws-route53recoverycontrol/package.json new file mode 100644 index 0000000000000..8ceaa50512b21 --- /dev/null +++ b/packages/@aws-cdk/aws-route53recoverycontrol/package.json @@ -0,0 +1,103 @@ +{ + "name": "@aws-cdk/aws-route53recoverycontrol", + "version": "0.0.0", + "description": "The CDK Construct Library for AWS::Route53RecoveryControl", + "main": "lib/index.js", + "types": "lib/index.d.ts", + "jsii": { + "outdir": "dist", + "projectReferences": true, + "targets": { + "dotnet": { + "namespace": "Amazon.CDK.AWS.Route53RecoveryControl", + "packageId": "Amazon.CDK.AWS.Route53RecoveryControl", + "signAssembly": true, + "assemblyOriginatorKeyFile": "../../key.snk", + "iconUrl": "https://raw.githubusercontent.com/aws/aws-cdk/master/logo/default-256-dark.png" + }, + "java": { + "package": "software.amazon.awscdk.services.route53recoverycontrol", + "maven": { + "groupId": "software.amazon.awscdk", + "artifactId": "route53recoverycontrol" + } + }, + "python": { + "classifiers": [ + "Framework :: AWS CDK", + "Framework :: AWS CDK :: 1" + ], + "distName": "aws-cdk.aws-route53recoverycontrol", + "module": "aws_cdk.aws_route53recoverycontrol" + } + } + }, + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-cdk.git", + "directory": "packages/@aws-cdk/aws-route53recoverycontrol" + }, + "homepage": "https://github.com/aws/aws-cdk", + "scripts": { + "build": "cdk-build", + "watch": "cdk-watch", + "lint": "cdk-lint", + "test": "cdk-test", + "integ": "cdk-integ", + "pkglint": "pkglint -f", + "package": "cdk-package", + "awslint": "cdk-awslint", + "cfn2ts": "cfn2ts", + "build+test": "yarn build && yarn test", + "build+test+package": "yarn build+test && yarn package", + "compat": "cdk-compat", + "gen": "cfn2ts", + "rosetta:extract": "yarn --silent jsii-rosetta extract", + "build+extract": "yarn build && yarn rosetta:extract", + "build+test+extract": "yarn build+test && yarn rosetta:extract" + }, + "cdk-build": { + "cloudformation": "AWS::Route53RecoveryControl", + "jest": true, + "env": { + "AWSLINT_BASE_CONSTRUCT": "true" + } + }, + "keywords": [ + "aws", + "cdk", + "constructs", + "AWS::Route53RecoveryControl", + "aws-route53recoverycontrol" + ], + "author": { + "name": "Amazon Web Services", + "url": "https://aws.amazon.com", + "organization": true + }, + "license": "Apache-2.0", + "devDependencies": { + "@types/jest": "^26.0.22", + "@aws-cdk/assertions": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" + }, + "dependencies": { + "@aws-cdk/core": "0.0.0" + }, + "peerDependencies": { + "@aws-cdk/core": "0.0.0" + }, + "engines": { + "node": ">= 10.13.0 <13 || >=13.7.0" + }, + "stability": "experimental", + "maturity": "cfn-only", + "awscdkio": { + "announce": false + }, + "publishConfig": { + "tag": "latest" + } +} diff --git a/packages/@aws-cdk/aws-route53recoverycontrol/test/route53recoverycontrol.test.ts b/packages/@aws-cdk/aws-route53recoverycontrol/test/route53recoverycontrol.test.ts new file mode 100644 index 0000000000000..465c7bdea0693 --- /dev/null +++ b/packages/@aws-cdk/aws-route53recoverycontrol/test/route53recoverycontrol.test.ts @@ -0,0 +1,6 @@ +import '@aws-cdk/assertions'; +import {} from '../lib'; + +test('No tests are specified for this package', () => { + expect(true).toBe(true); +}); diff --git a/packages/@aws-cdk/aws-route53recoveryreadiness/.eslintrc.js b/packages/@aws-cdk/aws-route53recoveryreadiness/.eslintrc.js new file mode 100644 index 0000000000000..61dd8dd001f63 --- /dev/null +++ b/packages/@aws-cdk/aws-route53recoveryreadiness/.eslintrc.js @@ -0,0 +1,3 @@ +const baseConfig = require('cdk-build-tools/config/eslintrc'); +baseConfig.parserOptions.project = __dirname + '/tsconfig.json'; +module.exports = baseConfig; diff --git a/packages/@aws-cdk/aws-route53recoveryreadiness/.gitignore b/packages/@aws-cdk/aws-route53recoveryreadiness/.gitignore new file mode 100644 index 0000000000000..62ebc95d75ce6 --- /dev/null +++ b/packages/@aws-cdk/aws-route53recoveryreadiness/.gitignore @@ -0,0 +1,19 @@ +*.js +*.js.map +*.d.ts +tsconfig.json +node_modules +*.generated.ts +dist +.jsii + +.LAST_BUILD +.nyc_output +coverage +.nycrc +.LAST_PACKAGE +*.snk +nyc.config.js +!.eslintrc.js +!jest.config.js +junit.xml diff --git a/packages/@aws-cdk/aws-route53recoveryreadiness/.npmignore b/packages/@aws-cdk/aws-route53recoveryreadiness/.npmignore new file mode 100644 index 0000000000000..f931fede67c44 --- /dev/null +++ b/packages/@aws-cdk/aws-route53recoveryreadiness/.npmignore @@ -0,0 +1,29 @@ +# Don't include original .ts files when doing `npm pack` +*.ts +!*.d.ts +coverage +.nyc_output +*.tgz + +dist +.LAST_PACKAGE +.LAST_BUILD +!*.js + +# Include .jsii +!.jsii + +*.snk + +*.tsbuildinfo + +tsconfig.json + +.eslintrc.js +jest.config.js + +# exclude cdk artifacts +**/cdk.out +junit.xml +test/ +!*.lit.ts diff --git a/packages/@aws-cdk/aws-route53recoveryreadiness/LICENSE b/packages/@aws-cdk/aws-route53recoveryreadiness/LICENSE new file mode 100644 index 0000000000000..28e4bdcec77ec --- /dev/null +++ b/packages/@aws-cdk/aws-route53recoveryreadiness/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/@aws-cdk/aws-route53recoveryreadiness/NOTICE b/packages/@aws-cdk/aws-route53recoveryreadiness/NOTICE new file mode 100644 index 0000000000000..5fc3826926b5b --- /dev/null +++ b/packages/@aws-cdk/aws-route53recoveryreadiness/NOTICE @@ -0,0 +1,2 @@ +AWS Cloud Development Kit (AWS CDK) +Copyright 2018-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/packages/@aws-cdk/aws-route53recoveryreadiness/README.md b/packages/@aws-cdk/aws-route53recoveryreadiness/README.md new file mode 100644 index 0000000000000..fd92f9a6d4954 --- /dev/null +++ b/packages/@aws-cdk/aws-route53recoveryreadiness/README.md @@ -0,0 +1,20 @@ +# AWS::Route53RecoveryReadiness Construct Library + + +--- + +![cfn-resources: Stable](https://img.shields.io/badge/cfn--resources-stable-success.svg?style=for-the-badge) + +> All classes with the `Cfn` prefix in this module ([CFN Resources]) are always stable and safe to use. +> +> [CFN Resources]: https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib + +--- + + + +This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project. + +```ts +import route53recoveryreadiness = require('@aws-cdk/aws-route53recoveryreadiness'); +``` diff --git a/packages/@aws-cdk/aws-route53recoveryreadiness/jest.config.js b/packages/@aws-cdk/aws-route53recoveryreadiness/jest.config.js new file mode 100644 index 0000000000000..54e28beb9798b --- /dev/null +++ b/packages/@aws-cdk/aws-route53recoveryreadiness/jest.config.js @@ -0,0 +1,2 @@ +const baseConfig = require('cdk-build-tools/config/jest.config'); +module.exports = baseConfig; diff --git a/packages/@aws-cdk/aws-route53recoveryreadiness/lib/index.ts b/packages/@aws-cdk/aws-route53recoveryreadiness/lib/index.ts new file mode 100644 index 0000000000000..92d4e5587a6c6 --- /dev/null +++ b/packages/@aws-cdk/aws-route53recoveryreadiness/lib/index.ts @@ -0,0 +1,2 @@ +// AWS::Route53RecoveryReadiness CloudFormation Resources: +export * from './route53recoveryreadiness.generated'; diff --git a/packages/@aws-cdk/aws-route53recoveryreadiness/package.json b/packages/@aws-cdk/aws-route53recoveryreadiness/package.json new file mode 100644 index 0000000000000..afa6c384f2f7b --- /dev/null +++ b/packages/@aws-cdk/aws-route53recoveryreadiness/package.json @@ -0,0 +1,103 @@ +{ + "name": "@aws-cdk/aws-route53recoveryreadiness", + "version": "0.0.0", + "description": "The CDK Construct Library for AWS::Route53RecoveryReadiness", + "main": "lib/index.js", + "types": "lib/index.d.ts", + "jsii": { + "outdir": "dist", + "projectReferences": true, + "targets": { + "dotnet": { + "namespace": "Amazon.CDK.AWS.Route53RecoveryReadiness", + "packageId": "Amazon.CDK.AWS.Route53RecoveryReadiness", + "signAssembly": true, + "assemblyOriginatorKeyFile": "../../key.snk", + "iconUrl": "https://raw.githubusercontent.com/aws/aws-cdk/master/logo/default-256-dark.png" + }, + "java": { + "package": "software.amazon.awscdk.services.route53recoveryreadiness", + "maven": { + "groupId": "software.amazon.awscdk", + "artifactId": "route53recoveryreadiness" + } + }, + "python": { + "classifiers": [ + "Framework :: AWS CDK", + "Framework :: AWS CDK :: 1" + ], + "distName": "aws-cdk.aws-route53recoveryreadiness", + "module": "aws_cdk.aws_route53recoveryreadiness" + } + } + }, + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-cdk.git", + "directory": "packages/@aws-cdk/aws-route53recoveryreadiness" + }, + "homepage": "https://github.com/aws/aws-cdk", + "scripts": { + "build": "cdk-build", + "watch": "cdk-watch", + "lint": "cdk-lint", + "test": "cdk-test", + "integ": "cdk-integ", + "pkglint": "pkglint -f", + "package": "cdk-package", + "awslint": "cdk-awslint", + "cfn2ts": "cfn2ts", + "build+test": "yarn build && yarn test", + "build+test+package": "yarn build+test && yarn package", + "compat": "cdk-compat", + "gen": "cfn2ts", + "rosetta:extract": "yarn --silent jsii-rosetta extract", + "build+extract": "yarn build && yarn rosetta:extract", + "build+test+extract": "yarn build+test && yarn rosetta:extract" + }, + "cdk-build": { + "cloudformation": "AWS::Route53RecoveryReadiness", + "jest": true, + "env": { + "AWSLINT_BASE_CONSTRUCT": "true" + } + }, + "keywords": [ + "aws", + "cdk", + "constructs", + "AWS::Route53RecoveryReadiness", + "aws-route53recoveryreadiness" + ], + "author": { + "name": "Amazon Web Services", + "url": "https://aws.amazon.com", + "organization": true + }, + "license": "Apache-2.0", + "devDependencies": { + "@types/jest": "^26.0.22", + "@aws-cdk/assertions": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" + }, + "dependencies": { + "@aws-cdk/core": "0.0.0" + }, + "peerDependencies": { + "@aws-cdk/core": "0.0.0" + }, + "engines": { + "node": ">= 10.13.0 <13 || >=13.7.0" + }, + "stability": "experimental", + "maturity": "cfn-only", + "awscdkio": { + "announce": false + }, + "publishConfig": { + "tag": "latest" + } +} diff --git a/packages/@aws-cdk/aws-route53recoveryreadiness/test/route53recoveryreadiness.test.ts b/packages/@aws-cdk/aws-route53recoveryreadiness/test/route53recoveryreadiness.test.ts new file mode 100644 index 0000000000000..465c7bdea0693 --- /dev/null +++ b/packages/@aws-cdk/aws-route53recoveryreadiness/test/route53recoveryreadiness.test.ts @@ -0,0 +1,6 @@ +import '@aws-cdk/assertions'; +import {} from '../lib'; + +test('No tests are specified for this package', () => { + expect(true).toBe(true); +}); diff --git a/packages/@aws-cdk/cfnspec/CHANGELOG.md b/packages/@aws-cdk/cfnspec/CHANGELOG.md index 2e7ba5e22bf56..cbadd0a7eda90 100644 --- a/packages/@aws-cdk/cfnspec/CHANGELOG.md +++ b/packages/@aws-cdk/cfnspec/CHANGELOG.md @@ -1,3 +1,98 @@ +# CloudFormation Resource Specification v39.8.0 + +## New Resource Types + +* AWS::Route53RecoveryControl::Cluster +* AWS::Route53RecoveryControl::ControlPanel +* AWS::Route53RecoveryControl::RoutingControl +* AWS::Route53RecoveryControl::SafetyRule +* AWS::Route53RecoveryReadiness::Cell +* AWS::Route53RecoveryReadiness::ReadinessCheck +* AWS::Route53RecoveryReadiness::RecoveryGroup +* AWS::Route53RecoveryReadiness::ResourceSet + +## Attribute Changes + + +## Property Changes + +* AWS::DataBrew::Job DatabaseOutputs (__added__) +* AWS::DataBrew::Job ProfileConfiguration (__added__) +* AWS::DataSync::LocationNFS MountOptions.UpdateType (__changed__) + * Old: Immutable + * New: Mutable +* AWS::DataSync::LocationNFS OnPremConfig.UpdateType (__changed__) + * Old: Immutable + * New: Mutable +* AWS::DataSync::LocationNFS Subdirectory.UpdateType (__changed__) + * Old: Immutable + * New: Mutable +* AWS::DataSync::LocationObjectStorage AccessKey.UpdateType (__changed__) + * Old: Immutable + * New: Mutable +* AWS::DataSync::LocationObjectStorage AgentArns.UpdateType (__changed__) + * Old: Immutable + * New: Mutable +* AWS::DataSync::LocationObjectStorage SecretKey.UpdateType (__changed__) + * Old: Immutable + * New: Mutable +* AWS::DataSync::LocationObjectStorage ServerPort.UpdateType (__changed__) + * Old: Immutable + * New: Mutable +* AWS::DataSync::LocationObjectStorage ServerProtocol.UpdateType (__changed__) + * Old: Immutable + * New: Mutable +* AWS::DataSync::LocationObjectStorage Subdirectory.UpdateType (__changed__) + * Old: Immutable + * New: Mutable +* AWS::DataSync::LocationSMB AgentArns.UpdateType (__changed__) + * Old: Immutable + * New: Mutable +* AWS::DataSync::LocationSMB Domain.UpdateType (__changed__) + * Old: Immutable + * New: Mutable +* AWS::DataSync::LocationSMB MountOptions.UpdateType (__changed__) + * Old: Immutable + * New: Mutable +* AWS::DataSync::LocationSMB Password.UpdateType (__changed__) + * Old: Immutable + * New: Mutable +* AWS::DataSync::LocationSMB Subdirectory.UpdateType (__changed__) + * Old: Immutable + * New: Mutable +* AWS::DataSync::LocationSMB User.UpdateType (__changed__) + * Old: Immutable + * New: Mutable +* AWS::S3Outposts::Endpoint AccessType (__added__) +* AWS::S3Outposts::Endpoint CustomerOwnedIpv4Pool (__added__) + +## Property Type Changes + +* AWS::DLM::LifecyclePolicy.CrossRegionCopyDeprecateRule (__added__) +* AWS::DLM::LifecyclePolicy.DeprecateRule (__added__) +* AWS::DataBrew::Job.ColumnSelector (__added__) +* AWS::DataBrew::Job.ColumnStatisticsConfiguration (__added__) +* AWS::DataBrew::Job.DatabaseOutput (__added__) +* AWS::DataBrew::Job.ParameterMap (__added__) +* AWS::DataBrew::Job.ProfileConfiguration (__added__) +* AWS::DataBrew::Job.StatisticOverride (__added__) +* AWS::DataBrew::Job.StatisticsConfiguration (__added__) +* AWS::FSx::FileSystem.AuditLogConfiguration (__added__) +* AWS::DLM::LifecyclePolicy.CrossRegionCopyRule DeprecateRule (__added__) +* AWS::DLM::LifecyclePolicy.Schedule DeprecateRule (__added__) +* AWS::DataSync::LocationNFS.MountOptions Version.UpdateType (__changed__) + * Old: Immutable + * New: Mutable +* AWS::DataSync::LocationNFS.OnPremConfig AgentArns.UpdateType (__changed__) + * Old: Immutable + * New: Mutable +* AWS::DataSync::LocationSMB.MountOptions Version.UpdateType (__changed__) + * Old: Immutable + * New: Mutable +* AWS::DataSync::Task.Options SecurityDescriptorCopyFlags (__added__) +* AWS::FSx::FileSystem.WindowsConfiguration AuditLogConfiguration (__added__) + + # CloudFormation Resource Specification v39.7.0 ## New Resource Types diff --git a/packages/@aws-cdk/cfnspec/cfn.version b/packages/@aws-cdk/cfnspec/cfn.version index ac8cf4b235806..212ba4596ef15 100644 --- a/packages/@aws-cdk/cfnspec/cfn.version +++ b/packages/@aws-cdk/cfnspec/cfn.version @@ -1 +1 @@ -39.7.0 +39.8.0 diff --git a/packages/@aws-cdk/cfnspec/spec-source/000_CloudFormationResourceSpecification.json b/packages/@aws-cdk/cfnspec/spec-source/000_CloudFormationResourceSpecification.json index 7ea26213ba6ce..5e6a900098e55 100644 --- a/packages/@aws-cdk/cfnspec/spec-source/000_CloudFormationResourceSpecification.json +++ b/packages/@aws-cdk/cfnspec/spec-source/000_CloudFormationResourceSpecification.json @@ -15572,6 +15572,23 @@ } } }, + "AWS::DLM::LifecyclePolicy.CrossRegionCopyDeprecateRule": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-crossregioncopydeprecaterule.html", + "Properties": { + "Interval": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-crossregioncopydeprecaterule.html#cfn-dlm-lifecyclepolicy-crossregioncopydeprecaterule-interval", + "PrimitiveType": "Integer", + "Required": true, + "UpdateType": "Mutable" + }, + "IntervalUnit": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-crossregioncopydeprecaterule.html#cfn-dlm-lifecyclepolicy-crossregioncopydeprecaterule-intervalunit", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + } + } + }, "AWS::DLM::LifecyclePolicy.CrossRegionCopyRetainRule": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-crossregioncopyretainrule.html", "Properties": { @@ -15604,6 +15621,12 @@ "Required": false, "UpdateType": "Mutable" }, + "DeprecateRule": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-crossregioncopyrule.html#cfn-dlm-lifecyclepolicy-crossregioncopyrule-deprecaterule", + "Required": false, + "Type": "CrossRegionCopyDeprecateRule", + "UpdateType": "Mutable" + }, "Encrypted": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-crossregioncopyrule.html#cfn-dlm-lifecyclepolicy-crossregioncopyrule-encrypted", "PrimitiveType": "Boolean", @@ -15630,6 +15653,29 @@ } } }, + "AWS::DLM::LifecyclePolicy.DeprecateRule": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-deprecaterule.html", + "Properties": { + "Count": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-deprecaterule.html#cfn-dlm-lifecyclepolicy-deprecaterule-count", + "PrimitiveType": "Integer", + "Required": false, + "UpdateType": "Mutable" + }, + "Interval": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-deprecaterule.html#cfn-dlm-lifecyclepolicy-deprecaterule-interval", + "PrimitiveType": "Integer", + "Required": false, + "UpdateType": "Mutable" + }, + "IntervalUnit": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-deprecaterule.html#cfn-dlm-lifecyclepolicy-deprecaterule-intervalunit", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + } + } + }, "AWS::DLM::LifecyclePolicy.EncryptionConfiguration": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-encryptionconfiguration.html", "Properties": { @@ -15838,6 +15884,12 @@ "Type": "List", "UpdateType": "Mutable" }, + "DeprecateRule": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html#cfn-dlm-lifecyclepolicy-schedule-deprecaterule", + "Required": false, + "Type": "DeprecateRule", + "UpdateType": "Mutable" + }, "FastRestoreRule": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html#cfn-dlm-lifecyclepolicy-schedule-fastrestorerule", "Required": false, @@ -16633,6 +16685,41 @@ } } }, + "AWS::DataBrew::Job.ColumnSelector": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-job-columnselector.html", + "Properties": { + "Name": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-job-columnselector.html#cfn-databrew-job-columnselector-name", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "Regex": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-job-columnselector.html#cfn-databrew-job-columnselector-regex", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + } + } + }, + "AWS::DataBrew::Job.ColumnStatisticsConfiguration": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-job-columnstatisticsconfiguration.html", + "Properties": { + "Selectors": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-job-columnstatisticsconfiguration.html#cfn-databrew-job-columnstatisticsconfiguration-selectors", + "ItemType": "ColumnSelector", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + }, + "Statistics": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-job-columnstatisticsconfiguration.html#cfn-databrew-job-columnstatisticsconfiguration-statistics", + "Required": true, + "Type": "StatisticsConfiguration", + "UpdateType": "Mutable" + } + } + }, "AWS::DataBrew::Job.CsvOutputOptions": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-job-csvoutputoptions.html", "Properties": { @@ -16685,6 +16772,29 @@ } } }, + "AWS::DataBrew::Job.DatabaseOutput": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-job-databaseoutput.html", + "Properties": { + "DatabaseOptions": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-job-databaseoutput.html#cfn-databrew-job-databaseoutput-databaseoptions", + "Required": true, + "Type": "DatabaseTableOutputOptions", + "UpdateType": "Mutable" + }, + "DatabaseOutputMode": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-job-databaseoutput.html#cfn-databrew-job-databaseoutput-databaseoutputmode", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "GlueConnectionName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-job-databaseoutput.html#cfn-databrew-job-databaseoutput-glueconnectionname", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + } + } + }, "AWS::DataBrew::Job.DatabaseTableOutputOptions": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-job-databasetableoutputoptions.html", "Properties": { @@ -16790,6 +16900,34 @@ } } }, + "AWS::DataBrew::Job.ParameterMap": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-job-parametermap.html" + }, + "AWS::DataBrew::Job.ProfileConfiguration": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-job-profileconfiguration.html", + "Properties": { + "ColumnStatisticsConfigurations": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-job-profileconfiguration.html#cfn-databrew-job-profileconfiguration-columnstatisticsconfigurations", + "ItemType": "ColumnStatisticsConfiguration", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + }, + "DatasetStatisticsConfiguration": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-job-profileconfiguration.html#cfn-databrew-job-profileconfiguration-datasetstatisticsconfiguration", + "Required": false, + "Type": "StatisticsConfiguration", + "UpdateType": "Mutable" + }, + "ProfileColumns": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-job-profileconfiguration.html#cfn-databrew-job-profileconfiguration-profilecolumns", + "ItemType": "ColumnSelector", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + } + } + }, "AWS::DataBrew::Job.Recipe": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-job-recipe.html", "Properties": { @@ -16835,6 +16973,42 @@ } } }, + "AWS::DataBrew::Job.StatisticOverride": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-job-statisticoverride.html", + "Properties": { + "Parameters": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-job-statisticoverride.html#cfn-databrew-job-statisticoverride-parameters", + "Required": true, + "Type": "ParameterMap", + "UpdateType": "Mutable" + }, + "Statistic": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-job-statisticoverride.html#cfn-databrew-job-statisticoverride-statistic", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + } + } + }, + "AWS::DataBrew::Job.StatisticsConfiguration": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-job-statisticsconfiguration.html", + "Properties": { + "IncludedStatistics": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-job-statisticsconfiguration.html#cfn-databrew-job-statisticsconfiguration-includedstatistics", + "PrimitiveItemType": "String", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + }, + "Overrides": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-job-statisticsconfiguration.html#cfn-databrew-job-statisticsconfiguration-overrides", + "ItemType": "StatisticOverride", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + } + } + }, "AWS::DataBrew::Project.Sample": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-project-sample.html", "Properties": { @@ -17734,7 +17908,7 @@ "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datasync-locationnfs-mountoptions.html#cfn-datasync-locationnfs-mountoptions-version", "PrimitiveType": "String", "Required": false, - "UpdateType": "Immutable" + "UpdateType": "Mutable" } } }, @@ -17746,7 +17920,7 @@ "PrimitiveItemType": "String", "Required": true, "Type": "List", - "UpdateType": "Immutable" + "UpdateType": "Mutable" } } }, @@ -17768,7 +17942,7 @@ "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datasync-locationsmb-mountoptions.html#cfn-datasync-locationsmb-mountoptions-version", "PrimitiveType": "String", "Required": false, - "UpdateType": "Immutable" + "UpdateType": "Mutable" } } }, @@ -17846,6 +18020,12 @@ "Required": false, "UpdateType": "Mutable" }, + "SecurityDescriptorCopyFlags": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datasync-task-options.html#cfn-datasync-task-options-securitydescriptorcopyflags", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, "TaskQueueing": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datasync-task-options.html#cfn-datasync-task-options-taskqueueing", "PrimitiveType": "String", @@ -27165,6 +27345,29 @@ } } }, + "AWS::FSx::FileSystem.AuditLogConfiguration": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-fsx-filesystem-windowsconfiguration-auditlogconfiguration.html", + "Properties": { + "AuditLogDestination": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-fsx-filesystem-windowsconfiguration-auditlogconfiguration.html#cfn-fsx-filesystem-windowsconfiguration-auditlogconfiguration-auditlogdestination", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "FileAccessAuditLogLevel": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-fsx-filesystem-windowsconfiguration-auditlogconfiguration.html#cfn-fsx-filesystem-windowsconfiguration-auditlogconfiguration-fileaccessauditloglevel", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + }, + "FileShareAccessAuditLogLevel": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-fsx-filesystem-windowsconfiguration-auditlogconfiguration.html#cfn-fsx-filesystem-windowsconfiguration-auditlogconfiguration-fileshareaccessauditloglevel", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + } + } + }, "AWS::FSx::FileSystem.LustreConfiguration": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-fsx-filesystem-lustreconfiguration.html", "Properties": { @@ -27300,6 +27503,12 @@ "Type": "List", "UpdateType": "Mutable" }, + "AuditLogConfiguration": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-fsx-filesystem-windowsconfiguration.html#cfn-fsx-filesystem-windowsconfiguration-auditlogconfiguration", + "Required": false, + "Type": "AuditLogConfiguration", + "UpdateType": "Mutable" + }, "AutomaticBackupRetentionDays": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-fsx-filesystem-windowsconfiguration.html#cfn-fsx-filesystem-windowsconfiguration-automaticbackupretentiondays", "PrimitiveType": "Integer", @@ -52866,6 +53075,199 @@ } } }, + "AWS::Route53RecoveryControl::Cluster.ClusterEndpoint": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoverycontrol-cluster-clusterendpoint.html", + "Properties": { + "Endpoint": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoverycontrol-cluster-clusterendpoint.html#cfn-route53recoverycontrol-cluster-clusterendpoint-endpoint", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "Region": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoverycontrol-cluster-clusterendpoint.html#cfn-route53recoverycontrol-cluster-clusterendpoint-region", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + } + } + }, + "AWS::Route53RecoveryControl::SafetyRule.AssertionRule": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoverycontrol-safetyrule-assertionrule.html", + "Properties": { + "AssertedControls": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoverycontrol-safetyrule-assertionrule.html#cfn-route53recoverycontrol-safetyrule-assertionrule-assertedcontrols", + "PrimitiveItemType": "String", + "Required": true, + "Type": "List", + "UpdateType": "Mutable" + }, + "WaitPeriodMs": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoverycontrol-safetyrule-assertionrule.html#cfn-route53recoverycontrol-safetyrule-assertionrule-waitperiodms", + "PrimitiveType": "Integer", + "Required": true, + "UpdateType": "Mutable" + } + } + }, + "AWS::Route53RecoveryControl::SafetyRule.GatingRule": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoverycontrol-safetyrule-gatingrule.html", + "Properties": { + "GatingControls": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoverycontrol-safetyrule-gatingrule.html#cfn-route53recoverycontrol-safetyrule-gatingrule-gatingcontrols", + "PrimitiveItemType": "String", + "Required": true, + "Type": "List", + "UpdateType": "Mutable" + }, + "TargetControls": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoverycontrol-safetyrule-gatingrule.html#cfn-route53recoverycontrol-safetyrule-gatingrule-targetcontrols", + "PrimitiveItemType": "String", + "Required": true, + "Type": "List", + "UpdateType": "Mutable" + }, + "WaitPeriodMs": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoverycontrol-safetyrule-gatingrule.html#cfn-route53recoverycontrol-safetyrule-gatingrule-waitperiodms", + "PrimitiveType": "Integer", + "Required": true, + "UpdateType": "Mutable" + } + } + }, + "AWS::Route53RecoveryControl::SafetyRule.RuleConfig": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoverycontrol-safetyrule-ruleconfig.html", + "Properties": { + "Inverted": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoverycontrol-safetyrule-ruleconfig.html#cfn-route53recoverycontrol-safetyrule-ruleconfig-inverted", + "PrimitiveType": "Boolean", + "Required": true, + "UpdateType": "Immutable" + }, + "Threshold": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoverycontrol-safetyrule-ruleconfig.html#cfn-route53recoverycontrol-safetyrule-ruleconfig-threshold", + "PrimitiveType": "Integer", + "Required": true, + "UpdateType": "Immutable" + }, + "Type": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoverycontrol-safetyrule-ruleconfig.html#cfn-route53recoverycontrol-safetyrule-ruleconfig-type", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + } + } + }, + "AWS::Route53RecoveryReadiness::ResourceSet.DNSTargetResource": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoveryreadiness-resourceset-dnstargetresource.html", + "Properties": { + "DomainName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoveryreadiness-resourceset-dnstargetresource.html#cfn-route53recoveryreadiness-resourceset-dnstargetresource-domainname", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "HostedZoneArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoveryreadiness-resourceset-dnstargetresource.html#cfn-route53recoveryreadiness-resourceset-dnstargetresource-hostedzonearn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "RecordSetId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoveryreadiness-resourceset-dnstargetresource.html#cfn-route53recoveryreadiness-resourceset-dnstargetresource-recordsetid", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "RecordType": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoveryreadiness-resourceset-dnstargetresource.html#cfn-route53recoveryreadiness-resourceset-dnstargetresource-recordtype", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "TargetResource": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoveryreadiness-resourceset-dnstargetresource.html#cfn-route53recoveryreadiness-resourceset-dnstargetresource-targetresource", + "Required": false, + "Type": "TargetResource", + "UpdateType": "Mutable" + } + } + }, + "AWS::Route53RecoveryReadiness::ResourceSet.NLBResource": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoveryreadiness-resourceset-nlbresource.html", + "Properties": { + "Arn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoveryreadiness-resourceset-nlbresource.html#cfn-route53recoveryreadiness-resourceset-nlbresource-arn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + } + } + }, + "AWS::Route53RecoveryReadiness::ResourceSet.R53ResourceRecord": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoveryreadiness-resourceset-r53resourcerecord.html", + "Properties": { + "DomainName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoveryreadiness-resourceset-r53resourcerecord.html#cfn-route53recoveryreadiness-resourceset-r53resourcerecord-domainname", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "RecordSetId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoveryreadiness-resourceset-r53resourcerecord.html#cfn-route53recoveryreadiness-resourceset-r53resourcerecord-recordsetid", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + } + } + }, + "AWS::Route53RecoveryReadiness::ResourceSet.Resource": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoveryreadiness-resourceset-resource.html", + "Properties": { + "ComponentId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoveryreadiness-resourceset-resource.html#cfn-route53recoveryreadiness-resourceset-resource-componentid", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "DnsTargetResource": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoveryreadiness-resourceset-resource.html#cfn-route53recoveryreadiness-resourceset-resource-dnstargetresource", + "Required": false, + "Type": "DNSTargetResource", + "UpdateType": "Mutable" + }, + "ReadinessScopes": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoveryreadiness-resourceset-resource.html#cfn-route53recoveryreadiness-resourceset-resource-readinessscopes", + "PrimitiveItemType": "String", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + }, + "ResourceArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoveryreadiness-resourceset-resource.html#cfn-route53recoveryreadiness-resourceset-resource-resourcearn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + } + } + }, + "AWS::Route53RecoveryReadiness::ResourceSet.TargetResource": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoveryreadiness-resourceset-targetresource.html", + "Properties": { + "NLBResource": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoveryreadiness-resourceset-targetresource.html#cfn-route53recoveryreadiness-resourceset-targetresource-nlbresource", + "Required": false, + "Type": "NLBResource", + "UpdateType": "Mutable" + }, + "R53Resource": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53recoveryreadiness-resourceset-targetresource.html#cfn-route53recoveryreadiness-resourceset-targetresource-r53resource", + "Required": false, + "Type": "R53ResourceRecord", + "UpdateType": "Mutable" + } + } + }, "AWS::Route53Resolver::FirewallRuleGroup.FirewallRule": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53resolver-firewallrulegroup-firewallrule.html", "Properties": { @@ -61123,7 +61525,7 @@ } } }, - "ResourceSpecificationVersion": "39.7.0", + "ResourceSpecificationVersion": "39.8.0", "ResourceTypes": { "AWS::ACMPCA::Certificate": { "Attributes": { @@ -70946,6 +71348,13 @@ "Type": "List", "UpdateType": "Mutable" }, + "DatabaseOutputs": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-databrew-job.html#cfn-databrew-job-databaseoutputs", + "ItemType": "DatabaseOutput", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + }, "DatasetName": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-databrew-job.html#cfn-databrew-job-datasetname", "PrimitiveType": "String", @@ -71007,6 +71416,12 @@ "Type": "List", "UpdateType": "Mutable" }, + "ProfileConfiguration": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-databrew-job.html#cfn-databrew-job-profileconfiguration", + "Required": false, + "Type": "ProfileConfiguration", + "UpdateType": "Mutable" + }, "ProjectName": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-databrew-job.html#cfn-databrew-job-projectname", "PrimitiveType": "String", @@ -71376,13 +71791,13 @@ "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-locationnfs.html#cfn-datasync-locationnfs-mountoptions", "Required": false, "Type": "MountOptions", - "UpdateType": "Immutable" + "UpdateType": "Mutable" }, "OnPremConfig": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-locationnfs.html#cfn-datasync-locationnfs-onpremconfig", "Required": true, "Type": "OnPremConfig", - "UpdateType": "Immutable" + "UpdateType": "Mutable" }, "ServerHostname": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-locationnfs.html#cfn-datasync-locationnfs-serverhostname", @@ -71394,7 +71809,7 @@ "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-locationnfs.html#cfn-datasync-locationnfs-subdirectory", "PrimitiveType": "String", "Required": true, - "UpdateType": "Immutable" + "UpdateType": "Mutable" }, "Tags": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-locationnfs.html#cfn-datasync-locationnfs-tags", @@ -71421,14 +71836,14 @@ "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-locationobjectstorage.html#cfn-datasync-locationobjectstorage-accesskey", "PrimitiveType": "String", "Required": false, - "UpdateType": "Immutable" + "UpdateType": "Mutable" }, "AgentArns": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-locationobjectstorage.html#cfn-datasync-locationobjectstorage-agentarns", "PrimitiveItemType": "String", "Required": true, "Type": "List", - "UpdateType": "Immutable" + "UpdateType": "Mutable" }, "BucketName": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-locationobjectstorage.html#cfn-datasync-locationobjectstorage-bucketname", @@ -71440,7 +71855,7 @@ "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-locationobjectstorage.html#cfn-datasync-locationobjectstorage-secretkey", "PrimitiveType": "String", "Required": false, - "UpdateType": "Immutable" + "UpdateType": "Mutable" }, "ServerHostname": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-locationobjectstorage.html#cfn-datasync-locationobjectstorage-serverhostname", @@ -71452,19 +71867,19 @@ "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-locationobjectstorage.html#cfn-datasync-locationobjectstorage-serverport", "PrimitiveType": "Integer", "Required": false, - "UpdateType": "Immutable" + "UpdateType": "Mutable" }, "ServerProtocol": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-locationobjectstorage.html#cfn-datasync-locationobjectstorage-serverprotocol", "PrimitiveType": "String", "Required": false, - "UpdateType": "Immutable" + "UpdateType": "Mutable" }, "Subdirectory": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-locationobjectstorage.html#cfn-datasync-locationobjectstorage-subdirectory", "PrimitiveType": "String", "Required": false, - "UpdateType": "Immutable" + "UpdateType": "Mutable" }, "Tags": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-locationobjectstorage.html#cfn-datasync-locationobjectstorage-tags", @@ -71537,25 +71952,25 @@ "PrimitiveItemType": "String", "Required": true, "Type": "List", - "UpdateType": "Immutable" + "UpdateType": "Mutable" }, "Domain": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-locationsmb.html#cfn-datasync-locationsmb-domain", "PrimitiveType": "String", "Required": false, - "UpdateType": "Immutable" + "UpdateType": "Mutable" }, "MountOptions": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-locationsmb.html#cfn-datasync-locationsmb-mountoptions", "Required": false, "Type": "MountOptions", - "UpdateType": "Immutable" + "UpdateType": "Mutable" }, "Password": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-locationsmb.html#cfn-datasync-locationsmb-password", "PrimitiveType": "String", "Required": true, - "UpdateType": "Immutable" + "UpdateType": "Mutable" }, "ServerHostname": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-locationsmb.html#cfn-datasync-locationsmb-serverhostname", @@ -71567,7 +71982,7 @@ "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-locationsmb.html#cfn-datasync-locationsmb-subdirectory", "PrimitiveType": "String", "Required": true, - "UpdateType": "Immutable" + "UpdateType": "Mutable" }, "Tags": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-locationsmb.html#cfn-datasync-locationsmb-tags", @@ -71581,7 +71996,7 @@ "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-locationsmb.html#cfn-datasync-locationsmb-user", "PrimitiveType": "String", "Required": true, - "UpdateType": "Immutable" + "UpdateType": "Mutable" } } }, @@ -93167,6 +93582,263 @@ } } }, + "AWS::Route53RecoveryControl::Cluster": { + "Attributes": { + "ClusterArn": { + "PrimitiveType": "String" + }, + "ClusterEndpoints": { + "ItemType": "ClusterEndpoint", + "Type": "List" + }, + "Status": { + "PrimitiveType": "String" + } + }, + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoverycontrol-cluster.html", + "Properties": { + "Name": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoverycontrol-cluster.html#cfn-route53recoverycontrol-cluster-name", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + } + } + }, + "AWS::Route53RecoveryControl::ControlPanel": { + "Attributes": { + "ControlPanelArn": { + "PrimitiveType": "String" + }, + "DefaultControlPanel": { + "PrimitiveType": "Boolean" + }, + "RoutingControlCount": { + "PrimitiveType": "Integer" + }, + "Status": { + "PrimitiveType": "String" + } + }, + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoverycontrol-controlpanel.html", + "Properties": { + "ClusterArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoverycontrol-controlpanel.html#cfn-route53recoverycontrol-controlpanel-clusterarn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + }, + "Name": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoverycontrol-controlpanel.html#cfn-route53recoverycontrol-controlpanel-name", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + } + } + }, + "AWS::Route53RecoveryControl::RoutingControl": { + "Attributes": { + "RoutingControlArn": { + "PrimitiveType": "String" + }, + "Status": { + "PrimitiveType": "String" + } + }, + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoverycontrol-routingcontrol.html", + "Properties": { + "ClusterArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoverycontrol-routingcontrol.html#cfn-route53recoverycontrol-routingcontrol-clusterarn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + }, + "ControlPanelArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoverycontrol-routingcontrol.html#cfn-route53recoverycontrol-routingcontrol-controlpanelarn", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + }, + "Name": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoverycontrol-routingcontrol.html#cfn-route53recoverycontrol-routingcontrol-name", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + } + } + }, + "AWS::Route53RecoveryControl::SafetyRule": { + "Attributes": { + "SafetyRuleArn": { + "PrimitiveType": "String" + }, + "Status": { + "PrimitiveType": "String" + } + }, + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoverycontrol-safetyrule.html", + "Properties": { + "AssertionRule": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoverycontrol-safetyrule.html#cfn-route53recoverycontrol-safetyrule-assertionrule", + "Required": false, + "Type": "AssertionRule", + "UpdateType": "Mutable" + }, + "ControlPanelArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoverycontrol-safetyrule.html#cfn-route53recoverycontrol-safetyrule-controlpanelarn", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "GatingRule": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoverycontrol-safetyrule.html#cfn-route53recoverycontrol-safetyrule-gatingrule", + "Required": false, + "Type": "GatingRule", + "UpdateType": "Mutable" + }, + "Name": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoverycontrol-safetyrule.html#cfn-route53recoverycontrol-safetyrule-name", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + }, + "RuleConfig": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoverycontrol-safetyrule.html#cfn-route53recoverycontrol-safetyrule-ruleconfig", + "Required": true, + "Type": "RuleConfig", + "UpdateType": "Immutable" + } + } + }, + "AWS::Route53RecoveryReadiness::Cell": { + "Attributes": { + "CellArn": { + "PrimitiveType": "String" + }, + "ParentReadinessScopes": { + "PrimitiveItemType": "String", + "Type": "List" + } + }, + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoveryreadiness-cell.html", + "Properties": { + "CellName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoveryreadiness-cell.html#cfn-route53recoveryreadiness-cell-cellname", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "Cells": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoveryreadiness-cell.html#cfn-route53recoveryreadiness-cell-cells", + "PrimitiveItemType": "String", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + }, + "Tags": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoveryreadiness-cell.html#cfn-route53recoveryreadiness-cell-tags", + "ItemType": "Tag", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + } + } + }, + "AWS::Route53RecoveryReadiness::ReadinessCheck": { + "Attributes": { + "ReadinessCheckArn": { + "PrimitiveType": "String" + } + }, + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoveryreadiness-readinesscheck.html", + "Properties": { + "ReadinessCheckName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoveryreadiness-readinesscheck.html#cfn-route53recoveryreadiness-readinesscheck-readinesscheckname", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "ResourceSetName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoveryreadiness-readinesscheck.html#cfn-route53recoveryreadiness-readinesscheck-resourcesetname", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "Tags": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoveryreadiness-readinesscheck.html#cfn-route53recoveryreadiness-readinesscheck-tags", + "ItemType": "Tag", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + } + } + }, + "AWS::Route53RecoveryReadiness::RecoveryGroup": { + "Attributes": { + "RecoveryGroupArn": { + "PrimitiveType": "String" + } + }, + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoveryreadiness-recoverygroup.html", + "Properties": { + "Cells": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoveryreadiness-recoverygroup.html#cfn-route53recoveryreadiness-recoverygroup-cells", + "PrimitiveItemType": "String", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + }, + "RecoveryGroupName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoveryreadiness-recoverygroup.html#cfn-route53recoveryreadiness-recoverygroup-recoverygroupname", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "Tags": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoveryreadiness-recoverygroup.html#cfn-route53recoveryreadiness-recoverygroup-tags", + "ItemType": "Tag", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + } + } + }, + "AWS::Route53RecoveryReadiness::ResourceSet": { + "Attributes": { + "ResourceSetArn": { + "PrimitiveType": "String" + } + }, + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoveryreadiness-resourceset.html", + "Properties": { + "ResourceSetName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoveryreadiness-resourceset.html#cfn-route53recoveryreadiness-resourceset-resourcesetname", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "ResourceSetType": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoveryreadiness-resourceset.html#cfn-route53recoveryreadiness-resourceset-resourcesettype", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "Resources": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoveryreadiness-resourceset.html#cfn-route53recoveryreadiness-resourceset-resources", + "ItemType": "Resource", + "Required": true, + "Type": "List", + "UpdateType": "Mutable" + }, + "Tags": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoveryreadiness-resourceset.html#cfn-route53recoveryreadiness-resourceset-tags", + "ItemType": "Tag", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + } + } + }, "AWS::Route53Resolver::FirewallDomainList": { "Attributes": { "Arn": { @@ -94007,6 +94679,18 @@ }, "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3outposts-endpoint.html", "Properties": { + "AccessType": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3outposts-endpoint.html#cfn-s3outposts-endpoint-accesstype", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + }, + "CustomerOwnedIpv4Pool": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3outposts-endpoint.html#cfn-s3outposts-endpoint-customerownedipv4pool", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + }, "OutpostId": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3outposts-endpoint.html#cfn-s3outposts-endpoint-outpostid", "PrimitiveType": "String", diff --git a/packages/@aws-cdk/cloudformation-include/package.json b/packages/@aws-cdk/cloudformation-include/package.json index f8c09b12fc8ea..71fcc718b4e3d 100644 --- a/packages/@aws-cdk/cloudformation-include/package.json +++ b/packages/@aws-cdk/cloudformation-include/package.json @@ -201,6 +201,8 @@ "@aws-cdk/aws-resourcegroups": "0.0.0", "@aws-cdk/aws-robomaker": "0.0.0", "@aws-cdk/aws-route53": "0.0.0", + "@aws-cdk/aws-route53recoverycontrol": "0.0.0", + "@aws-cdk/aws-route53recoveryreadiness": "0.0.0", "@aws-cdk/aws-route53resolver": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-s3objectlambda": "0.0.0", @@ -369,6 +371,8 @@ "@aws-cdk/aws-resourcegroups": "0.0.0", "@aws-cdk/aws-robomaker": "0.0.0", "@aws-cdk/aws-route53": "0.0.0", + "@aws-cdk/aws-route53recoverycontrol": "0.0.0", + "@aws-cdk/aws-route53recoveryreadiness": "0.0.0", "@aws-cdk/aws-route53resolver": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-s3objectlambda": "0.0.0", diff --git a/packages/aws-cdk-lib/package.json b/packages/aws-cdk-lib/package.json index 411d6eed9a312..e3b5cfb83db95 100644 --- a/packages/aws-cdk-lib/package.json +++ b/packages/aws-cdk-lib/package.json @@ -282,6 +282,8 @@ "@aws-cdk/aws-route53": "0.0.0", "@aws-cdk/aws-route53-patterns": "0.0.0", "@aws-cdk/aws-route53-targets": "0.0.0", + "@aws-cdk/aws-route53recoverycontrol": "0.0.0", + "@aws-cdk/aws-route53recoveryreadiness": "0.0.0", "@aws-cdk/aws-route53resolver": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-s3-assets": "0.0.0", diff --git a/packages/decdk/package.json b/packages/decdk/package.json index 73c670cec466d..f386bef25c9e5 100644 --- a/packages/decdk/package.json +++ b/packages/decdk/package.json @@ -189,6 +189,8 @@ "@aws-cdk/aws-route53": "0.0.0", "@aws-cdk/aws-route53-patterns": "0.0.0", "@aws-cdk/aws-route53-targets": "0.0.0", + "@aws-cdk/aws-route53recoverycontrol": "0.0.0", + "@aws-cdk/aws-route53recoveryreadiness": "0.0.0", "@aws-cdk/aws-route53resolver": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-s3-assets": "0.0.0", diff --git a/packages/monocdk/package.json b/packages/monocdk/package.json index 43227b31a4041..10c0235667470 100644 --- a/packages/monocdk/package.json +++ b/packages/monocdk/package.json @@ -283,6 +283,8 @@ "@aws-cdk/aws-route53": "0.0.0", "@aws-cdk/aws-route53-patterns": "0.0.0", "@aws-cdk/aws-route53-targets": "0.0.0", + "@aws-cdk/aws-route53recoverycontrol": "0.0.0", + "@aws-cdk/aws-route53recoveryreadiness": "0.0.0", "@aws-cdk/aws-route53resolver": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-s3-assets": "0.0.0", From 6bd1ff863e5720259878a46b82ca236bbef1a1b3 Mon Sep 17 00:00:00 2001 From: Otavio Macedo Date: Wed, 4 Aug 2021 12:23:18 +0100 Subject: [PATCH 08/47] chore(assert): set only lower bound of the jest dependency (#15887) Setting the lower and upper bound breaks the build on Windows. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/assert/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/assert/package.json b/packages/@aws-cdk/assert/package.json index 7398412939102..a4366c4372345 100644 --- a/packages/@aws-cdk/assert/package.json +++ b/packages/@aws-cdk/assert/package.json @@ -53,7 +53,7 @@ "peerDependencies": { "@aws-cdk/core": "0.0.0", "constructs": "^3.3.69", - "jest": ">=26.6.3 <28.0.0" + "jest": ">=26.6.3" }, "repository": { "url": "https://github.com/aws/aws-cdk.git", From afd5bf768a280cd11b4e72db841af36df2268ccf Mon Sep 17 00:00:00 2001 From: Ben Chaimberg Date: Wed, 4 Aug 2021 13:13:28 -0700 Subject: [PATCH 09/47] feat(kinesisfirehose): supports Kinesis data stream source for delivery stream (#15836) closes #15500 closes #10783 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../@aws-cdk/aws-kinesisfirehose/README.md | 18 +- .../lib/delivery-stream.ts | 34 ++- .../@aws-cdk/aws-kinesisfirehose/package.json | 2 + .../test/delivery-stream.test.ts | 58 ++++ ...elivery-stream.source-stream.expected.json | 283 ++++++++++++++++++ .../integ.delivery-stream.source-stream.ts | 41 +++ 6 files changed, 434 insertions(+), 2 deletions(-) create mode 100644 packages/@aws-cdk/aws-kinesisfirehose/test/integ.delivery-stream.source-stream.expected.json create mode 100644 packages/@aws-cdk/aws-kinesisfirehose/test/integ.delivery-stream.source-stream.ts diff --git a/packages/@aws-cdk/aws-kinesisfirehose/README.md b/packages/@aws-cdk/aws-kinesisfirehose/README.md index b8ec936b46901..936fcdc881a86 100644 --- a/packages/@aws-cdk/aws-kinesisfirehose/README.md +++ b/packages/@aws-cdk/aws-kinesisfirehose/README.md @@ -63,11 +63,27 @@ The above example defines the following resources: ## Sources There are two main methods of sourcing input data: Kinesis Data Streams and via a "direct -put". This construct library currently only supports "direct put". See [#15500](https://github.com/aws/aws-cdk/issues/15500) to track the status of adding support for Kinesis Data Streams. +put". See: [Sending Data to a Delivery Stream](https://docs.aws.amazon.com/firehose/latest/dev/basic-write.html) in the *Kinesis Data Firehose Developer Guide*. +### Kinesis Data Stream + +A delivery stream can read directly from a Kinesis data stream as a consumer of the data +stream. Configure this behaviour by providing a data stream in the `sourceStream` +property when constructing a delivery stream: + +```ts fixture=with-destination +import * as kinesis from '@aws-cdk/aws-kinesis'; + +const sourceStream = new kinesis.Stream(this, 'Source Stream'); +new DeliveryStream(this, 'Delivery Stream', { + sourceStream: sourceStream, + destinations: [destination], +}); +``` + ### Direct Put Data must be provided via "direct put", ie., by using a `PutRecord` or `PutRecordBatch` API call. There are a number of ways of doing diff --git a/packages/@aws-cdk/aws-kinesisfirehose/lib/delivery-stream.ts b/packages/@aws-cdk/aws-kinesisfirehose/lib/delivery-stream.ts index bd40240e05409..7dfaed8eb384b 100644 --- a/packages/@aws-cdk/aws-kinesisfirehose/lib/delivery-stream.ts +++ b/packages/@aws-cdk/aws-kinesisfirehose/lib/delivery-stream.ts @@ -1,6 +1,7 @@ import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; import * as ec2 from '@aws-cdk/aws-ec2'; 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 * as cdk from '@aws-cdk/core'; import { RegionInfo } from '@aws-cdk/region-info'; @@ -196,6 +197,13 @@ export interface DeliveryStreamProps { */ readonly deliveryStreamName?: string; + /** + * The Kinesis data stream to use as a source for this delivery stream. + * + * @default - data must be written to the delivery stream via a direct put. + */ + readonly sourceStream?: kinesis.IStream; + /** * The IAM role associated with this delivery stream. * @@ -319,6 +327,12 @@ export class DeliveryStream extends DeliveryStreamBase { }); this.grantPrincipal = role; + if ( + props.sourceStream && + (props.encryption === StreamEncryption.AWS_OWNED || props.encryption === StreamEncryption.CUSTOMER_MANAGED || props.encryptionKey) + ) { + throw new Error('Requested server-side encryption but delivery stream source is a Kinesis data stream. Specify server-side encryption on the data stream instead.'); + } if ((props.encryption === StreamEncryption.AWS_OWNED || props.encryption === StreamEncryption.UNENCRYPTED) && props.encryptionKey) { throw new Error(`Specified stream encryption as ${StreamEncryption[props.encryption]} but provided a customer-managed key`); } @@ -339,15 +353,33 @@ export class DeliveryStream extends DeliveryStreamBase { */ encryptionKey?.grantEncryptDecrypt(role); + const sourceStreamConfig = props.sourceStream ? { + kinesisStreamArn: props.sourceStream.streamArn, + roleArn: role.roleArn, + } : undefined; + const readStreamGrant = props.sourceStream?.grantRead(role); + /* + * Firehose still uses the deprecated DescribeStream API instead of the modern DescribeStreamSummary API. + * kinesis.IStream.grantRead does not provide DescribeStream permissions so we add it manually here. + */ + if (readStreamGrant && readStreamGrant.principalStatement) { + readStreamGrant.principalStatement.addActions('kinesis:DescribeStream'); + } + const destinationConfig = props.destinations[0].bind(this, {}); const resource = new CfnDeliveryStream(this, 'Resource', { deliveryStreamEncryptionConfigurationInput: encryptionConfig, deliveryStreamName: props.deliveryStreamName, - deliveryStreamType: 'DirectPut', + deliveryStreamType: props.sourceStream ? 'KinesisStreamAsSource' : 'DirectPut', + kinesisStreamSourceConfiguration: sourceStreamConfig, ...destinationConfig, }); + destinationConfig.dependables?.forEach(dependable => resource.node.addDependency(dependable)); + if (readStreamGrant) { + resource.node.addDependency(readStreamGrant); + } this.deliveryStreamArn = this.getResourceArnAttribute(resource.attrArn, { service: 'kinesis', diff --git a/packages/@aws-cdk/aws-kinesisfirehose/package.json b/packages/@aws-cdk/aws-kinesisfirehose/package.json index 1328b98adce32..58c5568c8c299 100644 --- a/packages/@aws-cdk/aws-kinesisfirehose/package.json +++ b/packages/@aws-cdk/aws-kinesisfirehose/package.json @@ -85,6 +85,7 @@ "@aws-cdk/aws-cloudwatch": "0.0.0", "@aws-cdk/aws-ec2": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kinesis": "0.0.0", "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-logs": "0.0.0", @@ -98,6 +99,7 @@ "@aws-cdk/aws-cloudwatch": "0.0.0", "@aws-cdk/aws-ec2": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kinesis": "0.0.0", "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-logs": "0.0.0", diff --git a/packages/@aws-cdk/aws-kinesisfirehose/test/delivery-stream.test.ts b/packages/@aws-cdk/aws-kinesisfirehose/test/delivery-stream.test.ts index 857391cc07a23..345e7feb0774a 100644 --- a/packages/@aws-cdk/aws-kinesisfirehose/test/delivery-stream.test.ts +++ b/packages/@aws-cdk/aws-kinesisfirehose/test/delivery-stream.test.ts @@ -3,6 +3,7 @@ import { ABSENT, ResourcePart, SynthUtils, anything, arrayWith } from '@aws-cdk/ import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; import * as ec2 from '@aws-cdk/aws-ec2'; 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 * as cdk from '@aws-cdk/core'; import { Construct, Node } from 'constructs'; @@ -89,6 +90,43 @@ describe('delivery stream', () => { }); }); + test('providing source stream creates configuration and grants permission', () => { + const sourceStream = new kinesis.Stream(stack, 'Source Stream'); + + new firehose.DeliveryStream(stack, 'Delivery Stream', { + destinations: [mockS3Destination], + sourceStream: sourceStream, + role: deliveryStreamRole, + }); + + expect(stack).toHaveResourceLike('AWS::IAM::Policy', { + PolicyDocument: { + Statement: [ + { + Action: arrayWith( + 'kinesis:DescribeStream', + 'kinesis:GetRecords', + 'kinesis:GetShardIterator', + 'kinesis:ListShards', + ), + Resource: stack.resolve(sourceStream.streamArn), + }, + ], + }, + Roles: [stack.resolve(deliveryStreamRole.roleName)], + }); + expect(stack).toHaveResource('AWS::KinesisFirehose::DeliveryStream', { + DeliveryStreamType: 'KinesisStreamAsSource', + KinesisStreamSourceConfiguration: { + KinesisStreamARN: stack.resolve(sourceStream.streamArn), + RoleARN: stack.resolve(deliveryStreamRole.roleArn), + }, + }); + expect(stack).toHaveResourceLike('AWS::KinesisFirehose::DeliveryStream', { + DependsOn: arrayWith('DeliveryStreamRoleDefaultPolicy2759968B'), + }, ResourcePart.CompleteDefinition); + }); + test('requesting customer-owned encryption creates key and configuration', () => { new firehose.DeliveryStream(stack, 'Delivery Stream', { destinations: [mockS3Destination], @@ -232,6 +270,26 @@ describe('delivery stream', () => { })).toThrowError('Specified stream encryption as UNENCRYPTED but provided a customer-managed key'); }); + test('requesting encryption or providing a key when source is a stream throws an error', () => { + const sourceStream = new kinesis.Stream(stack, 'Source Stream'); + + expect(() => new firehose.DeliveryStream(stack, 'Delivery Stream 1', { + destinations: [mockS3Destination], + encryption: firehose.StreamEncryption.AWS_OWNED, + sourceStream, + })).toThrowError('Requested server-side encryption but delivery stream source is a Kinesis data stream. Specify server-side encryption on the data stream instead.'); + expect(() => new firehose.DeliveryStream(stack, 'Delivery Stream 2', { + destinations: [mockS3Destination], + encryption: firehose.StreamEncryption.CUSTOMER_MANAGED, + sourceStream, + })).toThrowError('Requested server-side encryption but delivery stream source is a Kinesis data stream. Specify server-side encryption on the data stream instead.'); + expect(() => new firehose.DeliveryStream(stack, 'Delivery Stream 3', { + destinations: [mockS3Destination], + encryptionKey: new kms.Key(stack, 'Key'), + sourceStream, + })).toThrowError('Requested server-side encryption but delivery stream source is a Kinesis data stream. Specify server-side encryption on the data stream instead.'); + }); + test('grant provides access to stream', () => { const role = new iam.Role(stack, 'Role', { assumedBy: new iam.ServicePrincipal('lambda.amazonaws.com'), diff --git a/packages/@aws-cdk/aws-kinesisfirehose/test/integ.delivery-stream.source-stream.expected.json b/packages/@aws-cdk/aws-kinesisfirehose/test/integ.delivery-stream.source-stream.expected.json new file mode 100644 index 0000000000000..eb46541a1cdf2 --- /dev/null +++ b/packages/@aws-cdk/aws-kinesisfirehose/test/integ.delivery-stream.source-stream.expected.json @@ -0,0 +1,283 @@ +{ + "Resources": { + "Bucket83908E77": { + "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "Role1ABCC5F0": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "firehose.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "RoleDefaultPolicy5FFB7DAB": { + "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": [ + "Bucket83908E77", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "Bucket83908E77", + "Arn" + ] + }, + "/*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "RoleDefaultPolicy5FFB7DAB", + "Roles": [ + { + "Ref": "Role1ABCC5F0" + } + ] + } + }, + "SourceStream95FF52BE": { + "Type": "AWS::Kinesis::Stream", + "Properties": { + "ShardCount": 1, + "RetentionPeriodHours": 24, + "StreamEncryption": { + "Fn::If": [ + "AwsCdkKinesisEncryptedStreamsUnsupportedRegions", + { + "Ref": "AWS::NoValue" + }, + { + "EncryptionType": "KMS", + "KeyId": "alias/aws/kinesis" + } + ] + } + } + }, + "DeliveryStreamServiceRole964EEBCC": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "firehose.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "DeliveryStreamServiceRoleDefaultPolicyB87D9ACF": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "kinesis:DescribeStreamSummary", + "kinesis:GetRecords", + "kinesis:GetShardIterator", + "kinesis:ListShards", + "kinesis:SubscribeToShard", + "kinesis:DescribeStream" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "SourceStream95FF52BE", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "DeliveryStreamServiceRoleDefaultPolicyB87D9ACF", + "Roles": [ + { + "Ref": "DeliveryStreamServiceRole964EEBCC" + } + ] + } + }, + "DeliveryStreamF6D5572D": { + "Type": "AWS::KinesisFirehose::DeliveryStream", + "Properties": { + "DeliveryStreamType": "KinesisStreamAsSource", + "ExtendedS3DestinationConfiguration": { + "BucketARN": { + "Fn::GetAtt": [ + "Bucket83908E77", + "Arn" + ] + }, + "RoleARN": { + "Fn::GetAtt": [ + "Role1ABCC5F0", + "Arn" + ] + } + }, + "KinesisStreamSourceConfiguration": { + "KinesisStreamARN": { + "Fn::GetAtt": [ + "SourceStream95FF52BE", + "Arn" + ] + }, + "RoleARN": { + "Fn::GetAtt": [ + "DeliveryStreamServiceRole964EEBCC", + "Arn" + ] + } + } + }, + "DependsOn": [ + "DeliveryStreamServiceRoleDefaultPolicyB87D9ACF", + "RoleDefaultPolicy5FFB7DAB" + ] + } + }, + "Conditions": { + "AwsCdkKinesisEncryptedStreamsUnsupportedRegions": { + "Fn::Or": [ + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "cn-north-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "cn-northwest-1" + ] + } + ] + } + }, + "Mappings": { + "awscdkawskinesisfirehoseCidrBlocks": { + "af-south-1": { + "FirehoseCidrBlock": "13.244.121.224/27" + }, + "ap-east-1": { + "FirehoseCidrBlock": "18.162.221.32/27" + }, + "ap-northeast-1": { + "FirehoseCidrBlock": "13.113.196.224/27" + }, + "ap-northeast-2": { + "FirehoseCidrBlock": "13.209.1.64/27" + }, + "ap-northeast-3": { + "FirehoseCidrBlock": "13.208.177.192/27" + }, + "ap-south-1": { + "FirehoseCidrBlock": "13.232.67.32/27" + }, + "ap-southeast-1": { + "FirehoseCidrBlock": "13.228.64.192/27" + }, + "ap-southeast-2": { + "FirehoseCidrBlock": "13.210.67.224/27" + }, + "ca-central-1": { + "FirehoseCidrBlock": "35.183.92.128/27" + }, + "cn-north-1": { + "FirehoseCidrBlock": "52.81.151.32/27" + }, + "cn-northwest-1": { + "FirehoseCidrBlock": "161.189.23.64/27" + }, + "eu-central-1": { + "FirehoseCidrBlock": "35.158.127.160/27" + }, + "eu-north-1": { + "FirehoseCidrBlock": "13.53.63.224/27" + }, + "eu-south-1": { + "FirehoseCidrBlock": "15.161.135.128/27" + }, + "eu-west-1": { + "FirehoseCidrBlock": "52.19.239.192/27" + }, + "eu-west-2": { + "FirehoseCidrBlock": "18.130.1.96/27" + }, + "eu-west-3": { + "FirehoseCidrBlock": "35.180.1.96/27" + }, + "me-south-1": { + "FirehoseCidrBlock": "15.185.91.0/27" + }, + "sa-east-1": { + "FirehoseCidrBlock": "18.228.1.128/27" + }, + "us-east-1": { + "FirehoseCidrBlock": "52.70.63.192/27" + }, + "us-east-2": { + "FirehoseCidrBlock": "13.58.135.96/27" + }, + "us-gov-east-1": { + "FirehoseCidrBlock": "18.253.138.96/27" + }, + "us-gov-west-1": { + "FirehoseCidrBlock": "52.61.204.160/27" + }, + "us-west-1": { + "FirehoseCidrBlock": "13.57.135.192/27" + }, + "us-west-2": { + "FirehoseCidrBlock": "52.89.255.224/27" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-kinesisfirehose/test/integ.delivery-stream.source-stream.ts b/packages/@aws-cdk/aws-kinesisfirehose/test/integ.delivery-stream.source-stream.ts new file mode 100644 index 0000000000000..f39510a74322b --- /dev/null +++ b/packages/@aws-cdk/aws-kinesisfirehose/test/integ.delivery-stream.source-stream.ts @@ -0,0 +1,41 @@ +#!/usr/bin/env node +import * as iam from '@aws-cdk/aws-iam'; +import * as kinesis from '@aws-cdk/aws-kinesis'; +import * as s3 from '@aws-cdk/aws-s3'; +import * as cdk from '@aws-cdk/core'; +import * as constructs from 'constructs'; +import * as firehose from '../lib'; + +const app = new cdk.App(); + +const stack = new cdk.Stack(app, 'aws-cdk-firehose-delivery-stream-source-stream'); + +const bucket = new s3.Bucket(stack, 'Bucket', { + removalPolicy: cdk.RemovalPolicy.DESTROY, +}); + +const role = new iam.Role(stack, 'Role', { + assumedBy: new iam.ServicePrincipal('firehose.amazonaws.com'), +}); + +const mockS3Destination: firehose.IDestination = { + bind(_scope: constructs.Construct, _options: firehose.DestinationBindOptions): firehose.DestinationConfig { + const bucketGrant = bucket.grantReadWrite(role); + return { + extendedS3DestinationConfiguration: { + bucketArn: bucket.bucketArn, + roleArn: role.roleArn, + }, + dependables: [bucketGrant], + }; + }, +}; + +const sourceStream = new kinesis.Stream(stack, 'Source Stream'); + +new firehose.DeliveryStream(stack, 'Delivery Stream', { + destinations: [mockS3Destination], + sourceStream, +}); + +app.synth(); From de97179facc77663779ae8c630f44293f6c8ada6 Mon Sep 17 00:00:00 2001 From: Madeline Kusters <80541297+madeline-k@users.noreply.github.com> Date: Wed, 4 Aug 2021 17:52:19 -0700 Subject: [PATCH 10/47] chore(docs): update doc strings in DestinationS3BackupProps (#15896) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../@aws-cdk/aws-kinesisfirehose-destinations/lib/common.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/@aws-cdk/aws-kinesisfirehose-destinations/lib/common.ts b/packages/@aws-cdk/aws-kinesisfirehose-destinations/lib/common.ts index 9155346f06b09..81e53e8288a73 100644 --- a/packages/@aws-cdk/aws-kinesisfirehose-destinations/lib/common.ts +++ b/packages/@aws-cdk/aws-kinesisfirehose-destinations/lib/common.ts @@ -153,16 +153,16 @@ export interface DestinationS3BackupProps extends DestinationLoggingProps, Commo /** * The S3 bucket that will store data and failed records. * - * @default - If `backup` is set to `BackupMode.ALL` or `BackupMode.FAILED`, a bucket will be created for you. + * @default - If `mode` is set to `BackupMode.ALL` or `BackupMode.FAILED`, a bucket will be created for you. */ readonly bucket?: s3.IBucket; /** * Indicates the mode by which incoming records should be backed up to S3, if any. * - * If `backupBucket ` is provided, this will be implicitly set to `BackupMode.ALL`. + * If `bucket` is provided, this will be implicitly set to `BackupMode.ALL`. * - * @default - If `backupBucket` is provided, the default will be `BackupMode.ALL`. Otherwise, + * @default - If `bucket` is provided, the default will be `BackupMode.ALL`. Otherwise, * source records are not backed up to S3. */ readonly mode?: BackupMode; From a3b4911e13c73361fda6a808f5818ef737bf00d2 Mon Sep 17 00:00:00 2001 From: AWS CDK Team Date: Thu, 5 Aug 2021 08:06:21 +0000 Subject: [PATCH 11/47] chore(release): 1.117.0 --- CHANGELOG.md | 54 +++++++++++++++++++++++++++++++++++++++++++++++++ version.v1.json | 2 +- 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21264b7582645..82d0f58d6868c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,60 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [1.117.0](https://github.com/aws/aws-cdk/compare/v1.116.0...v1.117.0) (2021-08-05) + + +### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES + +* **assertions:** `Template.fromTemplate()` is now +renamed to `Template.fromJSON()` to provide clarity. +* **assertions:** `TemplateAssertions` is now renamed to +`Template`. + +### Features + +* **aws-cloudfront:** add enabled to web distribution ([#15433](https://github.com/aws/aws-cdk/issues/15433)) ([7ad9348](https://github.com/aws/aws-cdk/commit/7ad9348b49ab3b9dde1b4f1db3d888ddec423a9f)) +* **aws-ec2:** Add SubnetFilter for Id and CIDR netmask ([#15373](https://github.com/aws/aws-cdk/issues/15373)) ([407b02d](https://github.com/aws/aws-cdk/commit/407b02d62bd8b3eb77e53fc74197b64148640b5a)), closes [#15228](https://github.com/aws/aws-cdk/issues/15228) +* **aws-kinesisfirehose:** support for S3 destination encryption on DeliveryStream ([#15558](https://github.com/aws/aws-cdk/issues/15558)) ([3888773](https://github.com/aws/aws-cdk/commit/388877300e460e23cd69d67a16a00f7c57630649)), closes [#15555](https://github.com/aws/aws-cdk/issues/15555) +* **cfnspec:** cloudformation spec v39.8.0 ([#15885](https://github.com/aws/aws-cdk/issues/15885)) ([60e6b41](https://github.com/aws/aws-cdk/commit/60e6b4186680af98b538a21e82146fb0a0e84f33)) +* **cloudfront:** Origin Shield support ([#15453](https://github.com/aws/aws-cdk/issues/15453)) ([08ebbae](https://github.com/aws/aws-cdk/commit/08ebbae4cffdf85a66775f4e8f5ea9d7400bf358)), closes [#12872](https://github.com/aws/aws-cdk/issues/12872) [/github.com/aws/aws-cdk/issues/12872#issuecomment-775873384](https://github.com/aws//github.com/aws/aws-cdk/issues/12872/issues/issuecomment-775873384) +* **cloudfront:** use TLS_V1_2_2021 SecurityPolicy as default version (under feature flag) ([#15477](https://github.com/aws/aws-cdk/issues/15477)) ([7b64abf](https://github.com/aws/aws-cdk/commit/7b64abf51c52cd2f6f585d7fd9201030fdba8163)) +* **ec2:** Add Transcribe interface endpoint ([#15465](https://github.com/aws/aws-cdk/issues/15465)) ([929d6ae](https://github.com/aws/aws-cdk/commit/929d6aef84eb21aea0d9a4fff953a0f39246288e)) +* **eks:** support Kubernetes 1.21 ([#15774](https://github.com/aws/aws-cdk/issues/15774)) ([83dd318](https://github.com/aws/aws-cdk/commit/83dd318959b1b1e5f94b5a31030d03379638c9ad)), closes [#15758](https://github.com/aws/aws-cdk/issues/15758) +* **kinesisfirehose:** add metrics functions to IDeliveryStream ([#15618](https://github.com/aws/aws-cdk/issues/15618)) ([33909ed](https://github.com/aws/aws-cdk/commit/33909ed2144ede58e5e503f3f220f610dbd89675)), closes [#15543](https://github.com/aws/aws-cdk/issues/15543) +* **kinesisfirehose:** add support for backing up source records to S3 ([#15725](https://github.com/aws/aws-cdk/issues/15725)) ([b86062f](https://github.com/aws/aws-cdk/commit/b86062ff6215384b5def76e07586e94cc6ecc9c1)), closes [#15724](https://github.com/aws/aws-cdk/issues/15724) +* **kinesisfirehose:** add support for BufferingHints ([#15557](https://github.com/aws/aws-cdk/issues/15557)) ([099b584](https://github.com/aws/aws-cdk/commit/099b5840cc5b45bad987b7e797e6009d6383a3a7)), closes [#15554](https://github.com/aws/aws-cdk/issues/15554) +* **kinesisfirehose:** add support for Lambda data processors ([#15704](https://github.com/aws/aws-cdk/issues/15704)) ([6244a81](https://github.com/aws/aws-cdk/commit/6244a81af17ec823df409437c4a33ef5fb13a1c5)), closes [#15703](https://github.com/aws/aws-cdk/issues/15703) +* **kinesisfirehose:** add support for server-side encryption on DeliveryStream ([#15547](https://github.com/aws/aws-cdk/issues/15547)) ([74f3cda](https://github.com/aws/aws-cdk/commit/74f3cda53de7e8b5cd1d144e79cf9f5bb28e1938)), closes [#15546](https://github.com/aws/aws-cdk/issues/15546) +* **kinesisfirehose:** supports Kinesis data stream source for delivery stream ([#15836](https://github.com/aws/aws-cdk/issues/15836)) ([afd5bf7](https://github.com/aws/aws-cdk/commit/afd5bf768a280cd11b4e72db841af36df2268ccf)), closes [#15500](https://github.com/aws/aws-cdk/issues/15500) [#10783](https://github.com/aws/aws-cdk/issues/10783) +* **kinesisfirehose-destinations:** add support for compression on S3 delivery stream destinations ([#15550](https://github.com/aws/aws-cdk/issues/15550)) ([1eb56a0](https://github.com/aws/aws-cdk/commit/1eb56a025f728b7596f57b1289c2fc4c1c20e7f4)), closes [#15548](https://github.com/aws/aws-cdk/issues/15548) +* **kinesisfirehose-destinations:** add support for prefixes in the S3 destination ([#15552](https://github.com/aws/aws-cdk/issues/15552)) ([d227e48](https://github.com/aws/aws-cdk/commit/d227e48458832ff85d2d575e5462e45d29f49a6c)), closes [#15551](https://github.com/aws/aws-cdk/issues/15551) +* **lambda:** cloudwatch lambda insights ([#15439](https://github.com/aws/aws-cdk/issues/15439)) ([9efd800](https://github.com/aws/aws-cdk/commit/9efd800b4eea3a849edc5710975e4d70ec14a5cd)) +* **Route53:** add support for RemovalPolicy in CrossAccountZoneDelegationRecord ([#15782](https://github.com/aws/aws-cdk/issues/15782)) ([9eea4b8](https://github.com/aws/aws-cdk/commit/9eea4b8d454f7bc23930e6254651029b1a348a2c)), closes [#15211](https://github.com/aws/aws-cdk/issues/15211) +* **s3-deployment:** control object access ([#15730](https://github.com/aws/aws-cdk/issues/15730)) ([f58cf3c](https://github.com/aws/aws-cdk/commit/f58cf3c95eb32e9a4dc797665160e1b508ace2e1)) +* **servicecatalog:** add CloudFormation Parameter constraint ([#15770](https://github.com/aws/aws-cdk/issues/15770)) ([58fda91](https://github.com/aws/aws-cdk/commit/58fda9104ad884026d578dc0602f7d64dd533f6d)) +* **stepfunctions-tasks:** add sns publish with message attributes ([#14817](https://github.com/aws/aws-cdk/issues/14817)) ([bc99e82](https://github.com/aws/aws-cdk/commit/bc99e8271d443b10928d99437593c52efd763d7c)), closes [#4702](https://github.com/aws/aws-cdk/issues/4702) + + +### Bug Fixes + +* **assert:** module is incompatible with jest@27 ([#15666](https://github.com/aws/aws-cdk/issues/15666)) ([f446566](https://github.com/aws/aws-cdk/commit/f446566bd26ca024aed0a88da08a82a261c0dac6)) +* **aws-appsync:** graphqlapi throws incorrect error message for authorizationConfig ([#15830](https://github.com/aws/aws-cdk/issues/15830)) ([1f23313](https://github.com/aws/aws-cdk/commit/1f23313e889a00d85e7cbc56a64242d6e7762835)), closes [#15039](https://github.com/aws/aws-cdk/issues/15039) +* **aws-eks:** Allow desiredsize minsize and maxsize to accept CfnParameters. ([#15487](https://github.com/aws/aws-cdk/issues/15487)) ([fb43769](https://github.com/aws/aws-cdk/commit/fb437693c0f1568ddc53e9a198e54be3b9a01592)) +* **chatbot:** ARN validation in fromSlackChannelConfigurationArn fails for tokenized values ([#15849](https://github.com/aws/aws-cdk/issues/15849)) ([440ca35](https://github.com/aws/aws-cdk/commit/440ca35cf0f0e9f6f86bef445bd9aa6ef05ff9be)), closes [#15842](https://github.com/aws/aws-cdk/issues/15842) +* **cli:** move fail option into the diff command ([#15829](https://github.com/aws/aws-cdk/issues/15829)) ([473c1d8](https://github.com/aws/aws-cdk/commit/473c1d8248ae84bd8b4bb3863334e05e5328fddc)) +* **ec2:** volumename doesn't set name of volume ([#15832](https://github.com/aws/aws-cdk/issues/15832)) ([b842702](https://github.com/aws/aws-cdk/commit/b842702cbb7aa6632dd2fc4b4981abdd3a773826)), closes [#15831](https://github.com/aws/aws-cdk/issues/15831) +* **elbv2:** unresolved listener priority throws error ([#15804](https://github.com/aws/aws-cdk/issues/15804)) ([fce9ac7](https://github.com/aws/aws-cdk/commit/fce9ac73fe6da5e604f0659d9f101001dcef830a)) +* **pipelines:** Prepare stage doesn't have AUTO_EXPAND capability ([#15819](https://github.com/aws/aws-cdk/issues/15819)) ([a6fac49](https://github.com/aws/aws-cdk/commit/a6fac4974fa17949b836c72d04e1cc4504bc920a)), closes [#15711](https://github.com/aws/aws-cdk/issues/15711) +* **s3:** notifications are broken in some regions ([#15884](https://github.com/aws/aws-cdk/issues/15884)) ([ee19196](https://github.com/aws/aws-cdk/commit/ee191961a8b057a0585e731a67c15a7edd59c79e)) +* **stepfunctions-tasks:** Stage field not included in CallApiGatewayHttpApiEndpoint task definition ([#15755](https://github.com/aws/aws-cdk/issues/15755)) ([4f38fe1](https://github.com/aws/aws-cdk/commit/4f38fe1c3e5515ae22f2820712644ed763dbc248)), closes [#14242](https://github.com/aws/aws-cdk/issues/14242) + + +### Miscellaneous Chores + +* **assertions:** migrate more modules to use assertions ([#15857](https://github.com/aws/aws-cdk/issues/15857)) ([45b484c](https://github.com/aws/aws-cdk/commit/45b484cdff115a0893f7eed2b0c1d6424c2751e4)) +* **assertions:** rename TemplateAssertions to Template ([#15823](https://github.com/aws/aws-cdk/issues/15823)) ([823dfda](https://github.com/aws/aws-cdk/commit/823dfda76f39f0eff51d792b28aafcc5568f3db1)) + ## [1.116.0](https://github.com/aws/aws-cdk/compare/v1.115.0...v1.116.0) (2021-07-28) diff --git a/version.v1.json b/version.v1.json index 63c5030d06ef4..95b9ca9e3c2f0 100644 --- a/version.v1.json +++ b/version.v1.json @@ -1,3 +1,3 @@ { - "version": "1.116.0" + "version": "1.117.0" } From 90d5e03ddfcb961dd82967b5f0f9d38e27cb376f Mon Sep 17 00:00:00 2001 From: Otavio Macedo Date: Thu, 5 Aug 2021 09:12:31 +0100 Subject: [PATCH 12/47] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 82d0f58d6868c..91e3148260153 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ renamed to `Template.fromJSON()` to provide clarity. * **aws-ec2:** Add SubnetFilter for Id and CIDR netmask ([#15373](https://github.com/aws/aws-cdk/issues/15373)) ([407b02d](https://github.com/aws/aws-cdk/commit/407b02d62bd8b3eb77e53fc74197b64148640b5a)), closes [#15228](https://github.com/aws/aws-cdk/issues/15228) * **aws-kinesisfirehose:** support for S3 destination encryption on DeliveryStream ([#15558](https://github.com/aws/aws-cdk/issues/15558)) ([3888773](https://github.com/aws/aws-cdk/commit/388877300e460e23cd69d67a16a00f7c57630649)), closes [#15555](https://github.com/aws/aws-cdk/issues/15555) * **cfnspec:** cloudformation spec v39.8.0 ([#15885](https://github.com/aws/aws-cdk/issues/15885)) ([60e6b41](https://github.com/aws/aws-cdk/commit/60e6b4186680af98b538a21e82146fb0a0e84f33)) -* **cloudfront:** Origin Shield support ([#15453](https://github.com/aws/aws-cdk/issues/15453)) ([08ebbae](https://github.com/aws/aws-cdk/commit/08ebbae4cffdf85a66775f4e8f5ea9d7400bf358)), closes [#12872](https://github.com/aws/aws-cdk/issues/12872) [/github.com/aws/aws-cdk/issues/12872#issuecomment-775873384](https://github.com/aws//github.com/aws/aws-cdk/issues/12872/issues/issuecomment-775873384) +* **cloudfront:** Origin Shield support ([#15453](https://github.com/aws/aws-cdk/issues/15453)) ([08ebbae](https://github.com/aws/aws-cdk/commit/08ebbae4cffdf85a66775f4e8f5ea9d7400bf358)), closes [#12872](https://github.com/aws/aws-cdk/issues/12872) * **cloudfront:** use TLS_V1_2_2021 SecurityPolicy as default version (under feature flag) ([#15477](https://github.com/aws/aws-cdk/issues/15477)) ([7b64abf](https://github.com/aws/aws-cdk/commit/7b64abf51c52cd2f6f585d7fd9201030fdba8163)) * **ec2:** Add Transcribe interface endpoint ([#15465](https://github.com/aws/aws-cdk/issues/15465)) ([929d6ae](https://github.com/aws/aws-cdk/commit/929d6aef84eb21aea0d9a4fff953a0f39246288e)) * **eks:** support Kubernetes 1.21 ([#15774](https://github.com/aws/aws-cdk/issues/15774)) ([83dd318](https://github.com/aws/aws-cdk/commit/83dd318959b1b1e5f94b5a31030d03379638c9ad)), closes [#15758](https://github.com/aws/aws-cdk/issues/15758) From 00b916a752e0251118c852dc257c10a879abd1fb Mon Sep 17 00:00:00 2001 From: Otavio Macedo Date: Thu, 5 Aug 2021 10:05:30 +0100 Subject: [PATCH 13/47] Update CHANGELOG.md Co-authored-by: Niranjan Jayakar --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91e3148260153..4476f44135495 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,7 +39,6 @@ renamed to `Template.fromJSON()` to provide clarity. ### Bug Fixes -* **assert:** module is incompatible with jest@27 ([#15666](https://github.com/aws/aws-cdk/issues/15666)) ([f446566](https://github.com/aws/aws-cdk/commit/f446566bd26ca024aed0a88da08a82a261c0dac6)) * **aws-appsync:** graphqlapi throws incorrect error message for authorizationConfig ([#15830](https://github.com/aws/aws-cdk/issues/15830)) ([1f23313](https://github.com/aws/aws-cdk/commit/1f23313e889a00d85e7cbc56a64242d6e7762835)), closes [#15039](https://github.com/aws/aws-cdk/issues/15039) * **aws-eks:** Allow desiredsize minsize and maxsize to accept CfnParameters. ([#15487](https://github.com/aws/aws-cdk/issues/15487)) ([fb43769](https://github.com/aws/aws-cdk/commit/fb437693c0f1568ddc53e9a198e54be3b9a01592)) * **chatbot:** ARN validation in fromSlackChannelConfigurationArn fails for tokenized values ([#15849](https://github.com/aws/aws-cdk/issues/15849)) ([440ca35](https://github.com/aws/aws-cdk/commit/440ca35cf0f0e9f6f86bef445bd9aa6ef05ff9be)), closes [#15842](https://github.com/aws/aws-cdk/issues/15842) From de07ba27c3df551e86dbb8aedc260b23b292edb8 Mon Sep 17 00:00:00 2001 From: Otavio Macedo Date: Thu, 5 Aug 2021 10:05:39 +0100 Subject: [PATCH 14/47] Update CHANGELOG.md Co-authored-by: Niranjan Jayakar --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4476f44135495..1488e8702a7da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,8 +39,8 @@ renamed to `Template.fromJSON()` to provide clarity. ### Bug Fixes -* **aws-appsync:** graphqlapi throws incorrect error message for authorizationConfig ([#15830](https://github.com/aws/aws-cdk/issues/15830)) ([1f23313](https://github.com/aws/aws-cdk/commit/1f23313e889a00d85e7cbc56a64242d6e7762835)), closes [#15039](https://github.com/aws/aws-cdk/issues/15039) -* **aws-eks:** Allow desiredsize minsize and maxsize to accept CfnParameters. ([#15487](https://github.com/aws/aws-cdk/issues/15487)) ([fb43769](https://github.com/aws/aws-cdk/commit/fb437693c0f1568ddc53e9a198e54be3b9a01592)) +* **appsync:** graphqlapi throws incorrect error message for authorizationConfig ([#15830](https://github.com/aws/aws-cdk/issues/15830)) ([1f23313](https://github.com/aws/aws-cdk/commit/1f23313e889a00d85e7cbc56a64242d6e7762835)), closes [#15039](https://github.com/aws/aws-cdk/issues/15039) +* **eks:** Allow desiredsize minsize and maxsize to accept CfnParameters. ([#15487](https://github.com/aws/aws-cdk/issues/15487)) ([fb43769](https://github.com/aws/aws-cdk/commit/fb437693c0f1568ddc53e9a198e54be3b9a01592)) * **chatbot:** ARN validation in fromSlackChannelConfigurationArn fails for tokenized values ([#15849](https://github.com/aws/aws-cdk/issues/15849)) ([440ca35](https://github.com/aws/aws-cdk/commit/440ca35cf0f0e9f6f86bef445bd9aa6ef05ff9be)), closes [#15842](https://github.com/aws/aws-cdk/issues/15842) * **cli:** move fail option into the diff command ([#15829](https://github.com/aws/aws-cdk/issues/15829)) ([473c1d8](https://github.com/aws/aws-cdk/commit/473c1d8248ae84bd8b4bb3863334e05e5328fddc)) * **ec2:** volumename doesn't set name of volume ([#15832](https://github.com/aws/aws-cdk/issues/15832)) ([b842702](https://github.com/aws/aws-cdk/commit/b842702cbb7aa6632dd2fc4b4981abdd3a773826)), closes [#15831](https://github.com/aws/aws-cdk/issues/15831) From 275e6b61aea97aa85a64e062f211792b01adb7cd Mon Sep 17 00:00:00 2001 From: Otavio Macedo Date: Thu, 5 Aug 2021 10:46:49 +0100 Subject: [PATCH 15/47] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1488e8702a7da..ef046c0c53529 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ renamed to `Template.fromJSON()` to provide clarity. ### Bug Fixes +* **assert:** module is incompatible with jest@27 ([#15666](https://github.com/aws/aws-cdk/issues/15666)) ([f446566](https://github.com/aws/aws-cdk/commit/f446566bd26ca024aed0a88da08a82a261c0dac6)) * **appsync:** graphqlapi throws incorrect error message for authorizationConfig ([#15830](https://github.com/aws/aws-cdk/issues/15830)) ([1f23313](https://github.com/aws/aws-cdk/commit/1f23313e889a00d85e7cbc56a64242d6e7762835)), closes [#15039](https://github.com/aws/aws-cdk/issues/15039) * **eks:** Allow desiredsize minsize and maxsize to accept CfnParameters. ([#15487](https://github.com/aws/aws-cdk/issues/15487)) ([fb43769](https://github.com/aws/aws-cdk/commit/fb437693c0f1568ddc53e9a198e54be3b9a01592)) * **chatbot:** ARN validation in fromSlackChannelConfigurationArn fails for tokenized values ([#15849](https://github.com/aws/aws-cdk/issues/15849)) ([440ca35](https://github.com/aws/aws-cdk/commit/440ca35cf0f0e9f6f86bef445bd9aa6ef05ff9be)), closes [#15842](https://github.com/aws/aws-cdk/issues/15842) From cc33466742e9589daa83a65aa351d513d1f60a22 Mon Sep 17 00:00:00 2001 From: kaizen3031593 Date: Thu, 5 Aug 2021 20:13:44 +0000 Subject: [PATCH 16/47] chore: add kaizen3031593 to mergify --- .mergify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mergify.yml b/.mergify.yml index 1616f92196fd8..18f6ee0bb2555 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -6,7 +6,7 @@ pull_request_rules: label: add: [ contribution/core ] conditions: - - author~=^(eladb|RomainMuller|garnaat|nija-at|skinny85|rix0rrr|NGL321|Jerry-AWS|MrArnoldPalmer|NetaNir|iliapolo|njlynch|ericzbeard|ccfife|fulghum|pkandasamy91|SoManyHs|uttarasridhar|otaviomacedo|BenChaimberg|madeline-k|BryanPan342)$ + - author~=^(eladb|RomainMuller|garnaat|nija-at|skinny85|rix0rrr|NGL321|Jerry-AWS|MrArnoldPalmer|NetaNir|iliapolo|njlynch|ericzbeard|ccfife|fulghum|pkandasamy91|SoManyHs|uttarasridhar|otaviomacedo|BenChaimberg|madeline-k|BryanPan342|kaizen3031593)$ - -label~="contribution/core" - name: automatic merge actions: From 4f65bd89dcb2c32a38550627f2479d0464eef8bd Mon Sep 17 00:00:00 2001 From: Nick Lynch Date: Fri, 6 Aug 2021 12:55:22 +0100 Subject: [PATCH 17/47] test(aws-lambda-python): remove hard-coded references to @aws-cdk/aws-lambda (#15921) Remove the hard coded reference to the @aws-cdk/aws-lambda packages from the test, which should fix the issue that prevent building the aws-cdk-lib package. Copied from (and kudos to!) #15826 Related #15586 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-lambda-python/test/bundling.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-lambda-python/test/bundling.test.ts b/packages/@aws-cdk/aws-lambda-python/test/bundling.test.ts index d6de4ee23aedd..712852023a367 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/bundling.test.ts +++ b/packages/@aws-cdk/aws-lambda-python/test/bundling.test.ts @@ -4,7 +4,7 @@ import { Code, Runtime } from '@aws-cdk/aws-lambda'; import { FileSystem } from '@aws-cdk/core'; import { stageDependencies, bundle } from '../lib/bundling'; -jest.mock('@aws-cdk/aws-lambda'); +jest.spyOn(Code, 'fromAsset'); jest.mock('child_process', () => ({ spawnSync: jest.fn(() => { From 4ce318224453cebcf817b7683e5020780ab5df87 Mon Sep 17 00:00:00 2001 From: Otavio Macedo Date: Fri, 6 Aug 2021 15:57:16 +0100 Subject: [PATCH 18/47] chore(assertions): explicit feature flags to produce a consistent template during tests (#15924) In v1, the default value of the `@aws-cdk/core:newStyleStackSynthesis` flag is `false`. As a consequence, `Template.fromStack()` generates, by default, a template without the rule and parameter related to bootstrap versions. In v2, the default value of this flag is `true`. So this test fails in the v2 branch. By explicitly setting the flag to `false`, we ensure that the tests passes on both v1 and v2, regardless of the default values. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/assertions/test/template.test.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/assertions/test/template.test.ts b/packages/@aws-cdk/assertions/test/template.test.ts index 0fe308e68e5be..fcbc199f1f2da 100644 --- a/packages/@aws-cdk/assertions/test/template.test.ts +++ b/packages/@aws-cdk/assertions/test/template.test.ts @@ -1,4 +1,4 @@ -import { CfnResource, Stack } from '@aws-cdk/core'; +import { App, CfnResource, Stack } from '@aws-cdk/core'; import { Construct } from 'constructs'; import { Match, Template } from '../lib'; @@ -25,7 +25,12 @@ describe('Template', () => { }); test('fromStack', () => { - const stack = new Stack(); + const app = new App({ + context: { + '@aws-cdk/core:newStyleStackSynthesis': false, + }, + }); + const stack = new Stack(app); new CfnResource(stack, 'Foo', { type: 'Foo::Bar', properties: { From 891f111705f58e1c1e93fdd76659ca0bfbbcf2d5 Mon Sep 17 00:00:00 2001 From: Seiya6329 Date: Fri, 6 Aug 2021 13:40:58 -0700 Subject: [PATCH 19/47] docs(appmesh): comprehensive App Mesh readme review (#15877) Conducting comprehensive review on `README` file. ---- *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-appmesh/README.md | 272 ++++++++++++------------ 1 file changed, 137 insertions(+), 135 deletions(-) diff --git a/packages/@aws-cdk/aws-appmesh/README.md b/packages/@aws-cdk/aws-appmesh/README.md index 1b04f9dd93cb9..b1779dffe6f8a 100644 --- a/packages/@aws-cdk/aws-appmesh/README.md +++ b/packages/@aws-cdk/aws-appmesh/README.md @@ -36,7 +36,7 @@ The following example creates the `AppMesh` service mesh with the default egress ```ts const mesh = new Mesh(stack, 'AppMesh', { - meshName: 'myAwsmMesh', + meshName: 'myAwsMesh', }); ``` @@ -44,7 +44,7 @@ The mesh can instead be created with the `ALLOW_ALL` egress filter by providing ```ts const mesh = new Mesh(stack, 'AppMesh', { - meshName: 'myAwsmMesh', + meshName: 'myAwsMesh', egressFilter: MeshFilterType.ALLOW_ALL, }); ``` @@ -58,7 +58,7 @@ After you create a virtual router, you can create and associate routes to your v ```ts const router = mesh.addVirtualRouter('router', { - listeners: [ appmesh.VirtualRouterListener.http(8080) ], + listeners: [ VirtualRouterListener.http(8080) ], }); ``` @@ -69,15 +69,15 @@ This is particularly useful when splitting your resources between many stacks: f ```ts const mesh = new Mesh(infraStack, 'AppMesh', { - meshName: 'myAwsmMesh', + meshName: 'myAwsMesh', egressFilter: MeshFilterType.ALLOW_ALL, }); // the VirtualRouter will belong to 'appStack', // even though the Mesh belongs to 'infraStack' const router = new VirtualRouter(appStack, 'router', { - mesh: mesh, // notice that mesh is a required property when creating a router with the 'new' statement - listeners: [appmesh.VirtualRouterListener.http(8081)], + mesh, // notice that mesh is a required property when creating a router with the 'new' statement + listeners: [VirtualRouterListener.http(8081)], }); ``` @@ -102,18 +102,18 @@ When creating a virtual service: Adding a virtual router as the provider: ```ts -new appmesh.VirtualService('virtual-service', { +new VirtualService(stack, 'virtual-service', { virtualServiceName: 'my-service.default.svc.cluster.local', // optional - virtualServiceProvider: appmesh.VirtualServiceProvider.virtualRouter(router), + virtualServiceProvider: VirtualServiceProvider.virtualRouter(router), }); ``` Adding a virtual node as the provider: ```ts -new appmesh.VirtualService('virtual-service', { +new VirtualService(stack, 'virtual-service', { virtualServiceName: `my-service.default.svc.cluster.local`, // optional - virtualServiceProvider: appmesh.VirtualServiceProvider.virtualNode(node), + virtualServiceProvider: VirtualServiceProvider.virtualNode(node), }); ``` @@ -130,41 +130,41 @@ The response metadata for your new virtual node contains the Amazon Resource Nam ```ts const vpc = new ec2.Vpc(stack, 'vpc'); -const namespace = new servicediscovery.PrivateDnsNamespace(this, 'test-namespace', { +const namespace = new servicediscovery.PrivateDnsNamespace(stack, 'test-namespace', { vpc, name: 'domain.local', }); const service = namespace.createService('Svc'); const node = mesh.addVirtualNode('virtual-node', { - serviceDiscovery: appmesh.ServiceDiscovery.cloudMap(service), - listeners: [appmesh.VirtualNodeListener.httpNodeListener({ + serviceDiscovery: ServiceDiscovery.cloudMap(service), + listeners: [VirtualNodeListener.http({ port: 8081, - healthCheck: appmesh.HealthCheck.http({ + healthCheck: HealthCheck.http({ healthyThreshold: 3, - interval: Duration.seconds(5), // minimum - path: `/health-check-path`, - timeout: Duration.seconds(2), // minimum + interval: cdk.Duration.seconds(5), // minimum + path: '/health-check-path', + timeout: cdk.Duration.seconds(2), // minimum unhealthyThreshold: 2, }), })], - accessLog: appmesh.AccessLog.fromFilePath('/dev/stdout'), + accessLog: AccessLog.fromFilePath('/dev/stdout'), }); ``` Create a `VirtualNode` with the constructor and add tags. ```ts -const node = new VirtualNode(this, 'node', { +const node = new VirtualNode(stack, 'node', { mesh, - serviceDiscovery: appmesh.ServiceDiscovery.cloudMap(service), - listeners: [appmesh.VirtualNodeListener.http({ + serviceDiscovery: ServiceDiscovery.cloudMap(service), + listeners: [VirtualNodeListener.http({ port: 8080, - healthCheck: appmesh.HealthCheck.http({ + healthCheck: HealthCheck.http({ healthyThreshold: 3, - interval: Duration.seconds(5), // min + interval: cdk.Duration.seconds(5), path: '/ping', - timeout: Duration.seconds(2), // min + timeout: cdk.Duration.seconds(2), unhealthyThreshold: 2, }), timeout: { @@ -174,44 +174,44 @@ const node = new VirtualNode(this, 'node', { backendDefaults: { tlsClientPolicy: { validation: { - trust: appmesh.TlsValidationTrust.file('/keys/local_cert_chain.pem'), + trust: TlsValidationTrust.file('/keys/local_cert_chain.pem'), }, }, }, - accessLog: appmesh.AccessLog.fromFilePath('/dev/stdout'), + accessLog: AccessLog.fromFilePath('/dev/stdout'), }); -cdk.Tag.add(node, 'Environment', 'Dev'); +cdk.Tags.of(node).add('Environment', 'Dev'); ``` Create a `VirtualNode` with the constructor and add backend virtual service. ```ts -const node = new VirtualNode(this, 'node', { +const node = new VirtualNode(stack, 'node', { mesh, - serviceDiscovery: appmesh.ServiceDiscovery.cloudMap(service), - listeners: [appmesh.VirtualNodeListener.httpNodeListener({ + serviceDiscovery: ServiceDiscovery.cloudMap(service), + listeners: [VirtualNodeListener.http({ port: 8080, - healthCheck: appmesh.HealthCheck.http({ + healthCheck: HealthCheck.http({ healthyThreshold: 3, - interval: Duration.seconds(5), // min + interval: cdk.Duration.seconds(5), path: '/ping', - timeout: Duration.seconds(2), // min + timeout: cdk.Duration.seconds(2), unhealthyThreshold: 2, }), timeout: { idle: cdk.Duration.seconds(5), }, })], - accessLog: appmesh.AccessLog.fromFilePath('/dev/stdout'), + accessLog: AccessLog.fromFilePath('/dev/stdout'), }); -const virtualService = new appmesh.VirtualService(stack, 'service-1', { - virtualServiceProvider: appmesh.VirtualServiceProvider.virtualRouter(router), +const virtualService = new VirtualService(stack, 'service-1', { + virtualServiceProvider: VirtualServiceProvider.virtualRouter(router), virtualServiceName: 'service1.domain.local', }); -node.addBackend(appmesh.Backend.virtualService(virtualService)); +node.addBackend(Backend.virtualService(virtualService)); ``` The `listeners` property can be left blank and added later with the `node.addListener()` method. The `serviceDiscovery` property must be specified when specifying a listener. @@ -220,7 +220,7 @@ The `backends` property can be added with `node.addBackend()`. In the example, w The `backendDefaults` property is added to the node while creating the virtual node. These are the virtual node's default settings for all backends. -## Adding TLS to a listener +### Adding TLS to a listener The `tls` property specifies TLS configuration when creating a listener for a virtual node or a virtual gateway. Provide the TLS certificate to the proxy in one of the following ways: @@ -237,46 +237,46 @@ import * as certificatemanager from '@aws-cdk/aws-certificatemanager'; // A Virtual Node with listener TLS from an ACM provided certificate const cert = new certificatemanager.Certificate(this, 'cert', {...}); -const node = new appmesh.VirtualNode(stack, 'node', { +const node = new VirtualNode(stack, 'node', { mesh, - serviceDiscovery: appmesh.ServiceDiscovery.dns('node'), - listeners: [appmesh.VirtualNodeListener.grpc({ + serviceDiscovery: ServiceDiscovery.dns('node'), + listeners: [VirtualNodeListener.grpc({ port: 80, tls: { - mode: appmesh.TlsMode.STRICT, - certificate: appmesh.TlsCertificate.acm(cert), + mode: TlsMode.STRICT, + certificate: TlsCertificate.acm(cert), }, })], }); // A Virtual Gateway with listener TLS from a customer provided file certificate -const gateway = new appmesh.VirtualGateway(this, 'gateway', { +const gateway = new VirtualGateway(this, 'gateway', { mesh: mesh, - listeners: [appmesh.VirtualGatewayListener.grpc({ + listeners: [VirtualGatewayListener.grpc({ port: 8080, tls: { - mode: appmesh.TlsMode.STRICT, - certificate: appmesh.TlsCertificate.file('path/to/certChain', 'path/to/privateKey'), + mode: TlsMode.STRICT, + certificate: TlsCertificate.file('path/to/certChain', 'path/to/privateKey'), }, })], virtualGatewayName: 'gateway', }); // A Virtual Gateway with listener TLS from a SDS provided certificate -const gateway2 = new appmesh.VirtualGateway(this, 'gateway2', { +const gateway2 = new VirtualGateway(this, 'gateway2', { mesh: mesh, - listeners: [appmesh.VirtualGatewayListener.http2({ + listeners: [VirtualGatewayListener.http2({ port: 8080, tls: { - mode: appmesh.TlsMode.STRICT, - certificate: appmesh.TlsCertificate.sds('secrete_certificate'), + mode: TlsMode.STRICT, + certificate: TlsCertificate.sds('secrete_certificate'), }, })], virtualGatewayName: 'gateway2', }); ``` -## Adding mutual TLS authentication +### Adding mutual TLS authentication Mutual TLS authentication is an optional component of TLS that offers two-way peer authentication. To enable mutual TLS authentication, add the `mutualTlsCertificate` property to TLS client policy and/or the `mutualTlsValidation` property to your TLS listener. @@ -293,41 +293,41 @@ To enable mutual TLS authentication, add the `mutualTlsCertificate` property to ```typescript import * as certificatemanager from '@aws-cdk/aws-certificatemanager'; -const node1 = new appmesh.VirtualNode(stack, 'node1', { +const node1 = new VirtualNode(stack, 'node1', { mesh, - serviceDiscovery: appmesh.ServiceDiscovery.dns('node'), - listeners: [appmesh.VirtualNodeListener.grpc({ + serviceDiscovery: ServiceDiscovery.dns('node'), + listeners: [VirtualNodeListener.grpc({ port: 80, tls: { - mode: appmesh.TlsMode.STRICT, - certificate: appmesh.TlsCertificate.file('path/to/certChain', 'path/to/privateKey'), + mode: TlsMode.STRICT, + certificate: TlsCertificate.file('path/to/certChain', 'path/to/privateKey'), // Validate a file client certificates to enable mutual TLS authentication when a client provides a certificate. mutualTlsValidation: { - trust: appmesh.TlsValidationTrust.file('path-to-certificate'), + trust: TlsValidationTrust.file('path-to-certificate'), }, }, })], }); -const node2 = new appmesh.VirtualNode(stack, 'node2', { +const node2 = new VirtualNode(stack, 'node2', { mesh, - serviceDiscovery: appmesh.ServiceDiscovery.dns('node2'), + serviceDiscovery: ServiceDiscovery.dns('node2'), backendDefaults: { tlsClientPolicy: { ports: [8080, 8081], validation: { - subjectAlternativeNames: appmesh.SubjectAlternativeNames.matchingExactly('mesh-endpoint.apps.local'), - trust: appmesh.TlsValidationTrust.acm([ + subjectAlternativeNames: SubjectAlternativeNames.matchingExactly('mesh-endpoint.apps.local'), + trust: TlsValidationTrust.acm([ acmpca.CertificateAuthority.fromCertificateAuthorityArn(stack, 'certificate', certificateAuthorityArn)]), }, // Provide a SDS client certificate when a server requests it and enable mutual TLS authentication. - mutualTlsCertificate: appmesh.TlsCertificate.sds('secret_certificate'), + mutualTlsCertificate: TlsCertificate.sds('secret_certificate'), }, }, }); ``` -## Adding outlier detection to a Virtual Node listener +### Adding outlier detection to a Virtual Node listener The `outlierDetection` property adds outlier detection to a Virtual Node listener. The properties `baseEjectionDuration`, `interval`, `maxEjectionPercent`, and `maxServerErrors` are required. @@ -342,30 +342,32 @@ const namespace = new servicediscovery.PrivateDnsNamespace(this, 'test-namespace const service = namespace.createService('Svc'); const node = mesh.addVirtualNode('virtual-node', { - serviceDiscovery: appmesh.ServiceDiscovery.cloudMap(service), - outlierDetection: { - baseEjectionDuration: cdk.Duration.seconds(10), - interval: cdk.Duration.seconds(30), - maxEjectionPercent: 50, - maxServerErrors: 5, - }, + serviceDiscovery: ServiceDiscovery.cloudMap(service), + listeners: [VirtualNodeListener.http({ + outlierDetection: { + baseEjectionDuration: cdk.Duration.seconds(10), + interval: cdk.Duration.seconds(30), + maxEjectionPercent: 50, + maxServerErrors: 5, + }, + })], }); ``` -## Adding a connection pool to a listener +### Adding a connection pool to a listener The `connectionPool` property can be added to a Virtual Node listener or Virtual Gateway listener to add a request connection pool. Each listener protocol type has its own connection pool properties. ```typescript // A Virtual Node with a gRPC listener with a connection pool set -const node = new appmesh.VirtualNode(stack, 'node', { +const node = new VirtualNode(stack, 'node', { mesh, // DNS service discovery can optionally specify the DNS response type as either LOAD_BALANCER or ENDPOINTS. - // LOAD_BALANCER means that the DNS resolver returns a loadbalanced set of endpoints, + // LOAD_BALANCER means that the DNS resolver returns a loadbalanced set of endpoints, // whereas ENDPOINTS means that the DNS resolver is returning all the endpoints. // By default, the response type is assumed to be LOAD_BALANCER - serviceDiscovery: appmesh.ServiceDiscovery.dns('node', appmesh.ResponseType.ENDPOINTS), - listeners: [appmesh.VirtualNodeListener.http({ + serviceDiscovery: ServiceDiscovery.dns('node', DnsResponseType.ENDPOINTS), + listeners: [VirtualNodeListener.http({ port: 80, connectionPool: { maxConnections: 100, @@ -375,9 +377,9 @@ const node = new appmesh.VirtualNode(stack, 'node', { }); // A Virtual Gateway with a gRPC listener with a connection pool set -const gateway = new appmesh.VirtualGateway(this, 'gateway', { - mesh: mesh, - listeners: [appmesh.VirtualGatewayListener.grpc({ +const gateway = new VirtualGateway(stack, 'gateway', { + mesh, + listeners: [VirtualGatewayListener.grpc({ port: 8080, connectionPool: { maxRequests: 10, @@ -405,7 +407,7 @@ For example, here's how to add an HTTP route that matches based on a prefix of t ```ts router.addRoute('route-http', { - routeSpec: appmesh.RouteSpec.http({ + routeSpec: RouteSpec.http({ weightedTargets: [ { virtualNode: node, @@ -413,7 +415,7 @@ router.addRoute('route-http', { ], match: { // Path that is passed to this method must start with '/'. - path: appmesh.HttpRoutePathMatch.startsWith('/path-to-app'), + path: HttpRoutePathMatch.startsWith('/path-to-app'), }, }), }); @@ -423,24 +425,24 @@ Add an HTTP2 route that matches based on exact path, method, scheme, headers, an ```ts router.addRoute('route-http2', { - routeSpec: appmesh.RouteSpec.http2({ + routeSpec: RouteSpec.http2({ weightedTargets: [ { virtualNode: node, }, ], match: { - path: appmesh.HttpRoutePathMatch.exactly('/exact'), - method: appmesh.HttpRouteMethod.POST, - protocol: appmesh.HttpRouteProtocol.HTTPS, + path: HttpRoutePathMatch.exactly('/exact'), + method: HttpRouteMethod.POST, + protocol: HttpRouteProtocol.HTTPS, headers: [ // All specified headers must match for the route to match. - appmesh.HeaderMatch.valueIs('Content-Type', 'application/json'), - appmesh.HeaderMatch.valueIsNot('Content-Type', 'application/json'), + HeaderMatch.valueIs('Content-Type', 'application/json'), + HeaderMatch.valueIsNot('Content-Type', 'application/json'), ], queryParameters: [ // All specified query parameters must match for the route to match. - appmesh.QueryParameterMatch.valueIs('query-field', 'value') + QueryParameterMatch.valueIs('query-field', 'value') ], }, }), @@ -451,7 +453,7 @@ Add a single route with two targets and split traffic 50/50: ```ts router.addRoute('route-http', { - routeSpec: appmesh.RouteSpec.http({ + routeSpec: RouteSpec.http({ weightedTargets: [ { virtualNode: node, @@ -463,7 +465,7 @@ router.addRoute('route-http', { }, ], match: { - path: appmesh.HttpRoutePathMatch.startsWith('/path-to-app'), + path: HttpRoutePathMatch.startsWith('/path-to-app'), }, }), }); @@ -473,13 +475,13 @@ Add an http2 route with retries: ```ts router.addRoute('route-http2-retry', { - routeSpec: appmesh.RouteSpec.http2({ + routeSpec: RouteSpec.http2({ weightedTargets: [{ virtualNode: node }], retryPolicy: { // Retry if the connection failed - tcpRetryEvents: [appmesh.TcpRetryEvent.CONNECTION_ERROR], + tcpRetryEvents: [TcpRetryEvent.CONNECTION_ERROR], // Retry if HTTP responds with a gateway error (502, 503, 504) - httpRetryEvents: [appmesh.HttpRetryEvent.GATEWAY_ERROR], + httpRetryEvents: [HttpRetryEvent.GATEWAY_ERROR], // Retry five times retryAttempts: 5, // Use a 1 second timeout per retry @@ -493,18 +495,18 @@ Add a gRPC route with retries: ```ts router.addRoute('route-grpc-retry', { - routeSpec: appmesh.RouteSpec.grpc({ + routeSpec: RouteSpec.grpc({ weightedTargets: [{ virtualNode: node }], match: { serviceName: 'servicename' }, retryPolicy: { - tcpRetryEvents: [appmesh.TcpRetryEvent.CONNECTION_ERROR], - httpRetryEvents: [appmesh.HttpRetryEvent.GATEWAY_ERROR], + tcpRetryEvents: [TcpRetryEvent.CONNECTION_ERROR], + httpRetryEvents: [HttpRetryEvent.GATEWAY_ERROR], // Retry if gRPC responds that the request was cancelled, a resource // was exhausted, or if the service is unavailable grpcRetryEvents: [ - appmesh.GrpcRetryEvent.CANCELLED, - appmesh.GrpcRetryEvent.RESOURCE_EXHAUSTED, - appmesh.GrpcRetryEvent.UNAVAILABLE, + GrpcRetryEvent.CANCELLED, + GrpcRetryEvent.RESOURCE_EXHAUSTED, + GrpcRetryEvent.UNAVAILABLE, ], retryAttempts: 5, retryTimeout: cdk.Duration.seconds(1), @@ -517,7 +519,7 @@ Add an gRPC route that matches based on method name and metadata: ```ts router.addRoute('route-grpc-retry', { - routeSpec: appmesh.RouteSpec.grpc({ + routeSpec: RouteSpec.grpc({ weightedTargets: [{ virtualNode: node }], match: { // When method name is specified, service name must be also specified. @@ -525,8 +527,8 @@ router.addRoute('route-grpc-retry', { serviceName: 'servicename', metadata: [ // All specified metadata must match for the route to match. - appmesh.HeaderMatch.valueStartsWith('Content-Type', 'application/'), - appmesh.HeaderMatch.valueDoesNotStartWith('Content-Type', 'text/'), + HeaderMatch.valueStartsWith('Content-Type', 'application/'), + HeaderMatch.valueDoesNotStartWith('Content-Type', 'text/'), ], }, }), @@ -537,7 +539,7 @@ Add a gRPC route with timeout: ```ts router.addRoute('route-http', { - routeSpec: appmesh.RouteSpec.grpc({ + routeSpec: RouteSpec.grpc({ weightedTargets: [ { virtualNode: node, @@ -547,8 +549,8 @@ router.addRoute('route-http', { serviceName: 'my-service.default.svc.cluster.local', }, timeout: { - idle : Duration.seconds(2), - perRequest: Duration.seconds(1), + idle : cdk.Duration.seconds(2), + perRequest: cdk.Duration.seconds(1), }, }), }); @@ -560,7 +562,7 @@ A _virtual gateway_ allows resources outside your mesh to communicate with resou The virtual gateway represents an Envoy proxy running in an Amazon ECS task, in a Kubernetes service, or on an Amazon EC2 instance. Unlike a virtual node, which represents Envoy running with an application, a virtual gateway represents Envoy deployed by itself. -A virtual gateway is similar to a virtual node in that it has a listener that accepts traffic for a particular port and protocol (HTTP, HTTP2, GRPC). +A virtual gateway is similar to a virtual node in that it has a listener that accepts traffic for a particular port and protocol (HTTP, HTTP2, gRPC). Traffic received by the virtual gateway is directed to other services in your mesh using rules defined in gateway routes which can be added to your virtual gateway. @@ -569,11 +571,11 @@ Create a virtual gateway with the constructor: ```ts const certificateAuthorityArn = 'arn:aws:acm-pca:us-east-1:123456789012:certificate-authority/12345678-1234-1234-1234-123456789012'; -const gateway = new appmesh.VirtualGateway(stack, 'gateway', { +const gateway = new VirtualGateway(stack, 'gateway', { mesh: mesh, - listeners: [appmesh.VirtualGatewayListener.http({ + listeners: [VirtualGatewayListener.http({ port: 443, - healthCheck: appmesh.HealthCheck.http({ + healthCheck: HealthCheck.http({ interval: cdk.Duration.seconds(10), }), })], @@ -581,12 +583,12 @@ const gateway = new appmesh.VirtualGateway(stack, 'gateway', { tlsClientPolicy: { ports: [8080, 8081], validation: { - trust: appmesh.TlsValidationTrust.acm([ + trust: TlsValidationTrust.acm([ acmpca.CertificateAuthority.fromCertificateAuthorityArn(stack, 'certificate', certificateAuthorityArn)]), }, }, }, - accessLog: appmesh.AccessLog.fromFilePath('/dev/stdout'), + accessLog: AccessLog.fromFilePath('/dev/stdout'), virtualGatewayName: 'virtualGateway', }); ``` @@ -595,11 +597,11 @@ Add a virtual gateway directly to the mesh: ```ts const gateway = mesh.addVirtualGateway('gateway', { - accessLog: appmesh.AccessLog.fromFilePath('/dev/stdout'), + accessLog: AccessLog.fromFilePath('/dev/stdout'), virtualGatewayName: 'virtualGateway', - listeners: [appmesh.VirtualGatewayListener.http({ + listeners: [VirtualGatewayListener.http({ port: 443, - healthCheck: appmesh.HealthCheck.http({ + healthCheck: HealthCheck.http({ interval: cdk.Duration.seconds(10), }), })], @@ -621,10 +623,10 @@ By default, HTTP-based gateway routes match all requests. ```ts gateway.addGatewayRoute('gateway-route-http', { - routeSpec: appmesh.GatewayRouteSpec.http({ + routeSpec: GatewayRouteSpec.http({ routeTarget: virtualService, match: { - path: appmesh.HttpGatewayRoutePathMatch.regex('regex'), + path: HttpGatewayRoutePathMatch.regex('regex'), }, }), }); @@ -634,10 +636,10 @@ For gRPC-based gateway routes, the `match` field can be used to match on service ```ts gateway.addGatewayRoute('gateway-route-grpc', { - routeSpec: appmesh.GatewayRouteSpec.grpc({ + routeSpec: GatewayRouteSpec.grpc({ routeTarget: virtualService, match: { - hostname: appmesh.GatewayRouteHostnameMatch.endsWith('.example.com'), + hostname: GatewayRouteHostnameMatch.endsWith('.example.com'), }, }), }); @@ -648,22 +650,22 @@ This automatic rewrite configuration can be overwritten in following ways: ```ts gateway.addGatewayRoute('gateway-route-http', { - routeSpec: appmesh.GatewayRouteSpec.http({ + routeSpec: GatewayRouteSpec.http({ routeTarget: virtualService, match: { // This disables the default rewrite to '/', and retains original path. - path: appmesh.HttpGatewayRoutePathMatch.startsWith('/path-to-app/', ''), + path: HttpGatewayRoutePathMatch.startsWith('/path-to-app/', ''), }, }), }); gateway.addGatewayRoute('gateway-route-http-1', { - routeSpec: appmesh.GatewayRouteSpec.http({ + routeSpec: GatewayRouteSpec.http({ routeTarget: virtualService, match: { // If the request full path is '/path-to-app/xxxxx', this rewrites the path to '/rewrittenUri/xxxxx'. // Please note both `prefixPathMatch` and `rewriteTo` must start and end with the `/` character. - path: appmesh.HttpGatewayRoutePathMatch.startsWith('/path-to-app/', '/rewrittenUri/'), + path: HttpGatewayRoutePathMatch.startsWith('/path-to-app/', '/rewrittenUri/'), }, }), }); @@ -674,11 +676,11 @@ Unlike `startsWith()` method above, no default rewrite is performed. ```ts gateway.addGatewayRoute('gateway-route-http-2', { - routeSpec: appmesh.GatewayRouteSpec.http({ + routeSpec: GatewayRouteSpec.http({ routeTarget: virtualService, match: { // This rewrites the path from '/test' to '/rewrittenPath'. - path: appmesh.HttpGatewayRoutePathMatch.exactly('/test', '/rewrittenPath'), + path: HttpGatewayRoutePathMatch.exactly('/test', '/rewrittenPath'), }, }), }); @@ -690,10 +692,10 @@ This default host name rewrite can be configured by specifying the rewrite rule ```ts gateway.addGatewayRoute('gateway-route-grpc', { - routeSpec: appmesh.GatewayRouteSpec.grpc({ + routeSpec: GatewayRouteSpec.grpc({ routeTarget: virtualService, match: { - hostname: appmesh.GatewayRouteHostnameMatch.exactly('example.com'), + hostname: GatewayRouteHostnameMatch.exactly('example.com'), // This disables the default rewrite to virtual service name and retain original request. rewriteRequestHostname: false, }, @@ -707,13 +709,13 @@ Each App Mesh resource class comes with two static methods, `fromArn` These imported resources can be used with other resources in your mesh as if they were defined directly in your CDK application. ```ts -const arn = "arn:aws:appmesh:us-east-1:123456789012:mesh/testMesh/virtualNode/testNode"; -appmesh.VirtualNode.fromVirtualNodeArn(stack, 'importedVirtualNode', arn); +const arn = 'arn:aws:appmesh:us-east-1:123456789012:mesh/testMesh/virtualNode/testNode'; +VirtualNode.fromVirtualNodeArn(stack, 'importedVirtualNode', arn); ``` ```ts -appmesh.VirtualNode.fromVirtualNodeAttributes(stack, 'imported-virtual-node', { - mesh: appmesh.Mesh.fromMeshName(stack, 'Mesh', 'testMesh'), +VirtualNode.fromVirtualNodeAttributes(stack, 'imported-virtual-node', { + mesh: Mesh.fromMeshName(stack, 'Mesh', 'testMesh'), virtualNodeName: virtualNodeName, }); ``` @@ -722,11 +724,11 @@ To import a mesh, again there are two static methods, `fromMeshArn` and `fromMes ```ts const arn = 'arn:aws:appmesh:us-east-1:123456789012:mesh/testMesh'; -appmesh.Mesh.fromMeshArn(stack, 'imported-mesh', arn); +Mesh.fromMeshArn(stack, 'imported-mesh', arn); ``` ```ts -appmesh.Mesh.fromMeshName(stack, 'imported-mesh', 'abc'); +Mesh.fromMeshName(stack, 'imported-mesh', 'abc'); ``` ## IAM Grants @@ -735,7 +737,7 @@ appmesh.Mesh.fromMeshName(stack, 'imported-mesh', 'abc'); Envoy access to stream generated config from App Mesh. ```ts -const gateway = new appmesh.VirtualGateway(stack, 'testGateway', { mesh: mesh }); +const gateway = new VirtualGateway(stack, 'testGateway', { mesh: mesh }); const envoyUser = new iam.User(stack, 'envoyUser'); /** @@ -752,10 +754,10 @@ A shared mesh allows resources created by different accounts to communicate with // This is the ARN for the mesh from different AWS IAM account ID. // Ensure mesh is properly shared with your account. For more details, see: https://github.com/aws/aws-cdk/issues/15404 const arn = 'arn:aws:appmesh:us-east-1:123456789012:mesh/testMesh'; -sharedMesh = appmesh.Mesh.fromMeshArn(stack, 'imported-mesh', arn); +sharedMesh = Mesh.fromMeshArn(stack, 'imported-mesh', arn); // This VirtualNode resource can communicate with the resources in the mesh from different AWS IAM account ID. -new appmesh.VirtualNode(stack, 'test-node', { +new VirtualNode(stack, 'test-node', { mesh: sharedMesh, }); ``` From a04c017323130cb6f88a530e192e9e0e86fb137a Mon Sep 17 00:00:00 2001 From: Jordan Brough Date: Fri, 6 Aug 2021 15:53:18 -0600 Subject: [PATCH 20/47] docs(ecs): Add missing word ("permission") in comment (#15889) To match the description just below that says: "grants containers in the task permission to call" ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-ecs/lib/base/task-definition.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-ecs/lib/base/task-definition.ts b/packages/@aws-cdk/aws-ecs/lib/base/task-definition.ts index 1861098e1395b..91c019d9fa1f1 100644 --- a/packages/@aws-cdk/aws-ecs/lib/base/task-definition.ts +++ b/packages/@aws-cdk/aws-ecs/lib/base/task-definition.ts @@ -70,7 +70,7 @@ export interface CommonTaskDefinitionProps { readonly family?: string; /** - * The name of the IAM task execution role that grants the ECS agent to call AWS APIs on your behalf. + * The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf. * * The role will be used to retrieve container images from ECR and create CloudWatch log groups. * From e85c444137af6a708015eeba11692ff90b34a1ee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Aug 2021 09:26:18 -0700 Subject: [PATCH 21/47] chore(deps): bump actions/setup-node from 2.3.0 to 2.4.0 (#15942) Bumps [actions/setup-node](https://github.com/actions/setup-node) from 2.3.0 to 2.4.0. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v2.3.0...v2.4.0) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/yarn-upgrade.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/yarn-upgrade.yml b/.github/workflows/yarn-upgrade.yml index 918b691544287..2b5737a13ec1b 100644 --- a/.github/workflows/yarn-upgrade.yml +++ b/.github/workflows/yarn-upgrade.yml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v2 - name: Set up Node - uses: actions/setup-node@v2.3.0 + uses: actions/setup-node@v2.4.0 with: node-version: 10 From c2d89761cda38932a590a49f40ec5546bd46d9bc Mon Sep 17 00:00:00 2001 From: Madeline Kusters <80541297+madeline-k@users.noreply.github.com> Date: Mon, 9 Aug 2021 12:22:42 -0700 Subject: [PATCH 22/47] chore(sam): explicit feature flags to produce a consistent template during tests (#15953) In v1, the default value of the @aws-cdk/core:newStyleStackSynthesis flag is false. As a consequence, Template.fromStack() generates, by default, a template without the rule and parameter related to bootstrap versions. In v2, the default value of this flag is true. So this test fails in the v2 branch. By explicitly setting the flag to false, we ensure that the tests passes on both v1 and v2, regardless of the default values. ---- *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-sam/test/application.test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-sam/test/application.test.ts b/packages/@aws-cdk/aws-sam/test/application.test.ts index 5ba6e59a186ed..760c485ae6130 100644 --- a/packages/@aws-cdk/aws-sam/test/application.test.ts +++ b/packages/@aws-cdk/aws-sam/test/application.test.ts @@ -3,7 +3,12 @@ import * as cdk from '@aws-cdk/core'; import { CfnApplication } from '../lib'; test('construct an AWS::Serverless::Application', () => { - const stack = new cdk.Stack(); + const app = new cdk.App({ + context: { + '@aws-cdk/core:newStyleStackSynthesis': false, + }, + }); + const stack = new cdk.Stack(app); new CfnApplication(stack, 'App', { location: { From 6dc9d3e50d90143d4f455528b233dade9641e02e Mon Sep 17 00:00:00 2001 From: Madeline Kusters <80541297+madeline-k@users.noreply.github.com> Date: Mon, 9 Aug 2021 13:26:11 -0700 Subject: [PATCH 23/47] chore(servicecatalogappregistry): explicit feature flags to produce a consistent template during tests (#15955) In v1, the default value of the `@aws-cdk/core:newStyleStackSynthesis` flag is `false`. As a consequence, `Template.fromStack()` generates, by default, a template without the rule and parameter related to bootstrap versions. In v2, the default value of this flag is `true`. So this test fails in the v2 branch. By explicitly setting the flag to `false`, we ensure that the tests passes on both v1 and v2, regardless of the default values. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../aws-servicecatalogappregistry/test/application.test.ts | 7 ++++++- .../test/attribute-group.test.ts | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/aws-servicecatalogappregistry/test/application.test.ts b/packages/@aws-cdk/aws-servicecatalogappregistry/test/application.test.ts index 2cd30da1b5eb8..18b7b55884522 100644 --- a/packages/@aws-cdk/aws-servicecatalogappregistry/test/application.test.ts +++ b/packages/@aws-cdk/aws-servicecatalogappregistry/test/application.test.ts @@ -6,7 +6,12 @@ describe('Application', () => { let stack: cdk.Stack; beforeEach(() => { - stack = new cdk.Stack(); + const app = new cdk.App({ + context: { + '@aws-cdk/core:newStyleStackSynthesis': false, + }, + }); + stack = new cdk.Stack(app); }); test('default application creation', () => { diff --git a/packages/@aws-cdk/aws-servicecatalogappregistry/test/attribute-group.test.ts b/packages/@aws-cdk/aws-servicecatalogappregistry/test/attribute-group.test.ts index 728ee04976623..b94ff8411afdd 100644 --- a/packages/@aws-cdk/aws-servicecatalogappregistry/test/attribute-group.test.ts +++ b/packages/@aws-cdk/aws-servicecatalogappregistry/test/attribute-group.test.ts @@ -6,7 +6,12 @@ describe('Attribute Group', () => { let stack: cdk.Stack; beforeEach(() => { - stack = new cdk.Stack(); + const app = new cdk.App({ + context: { + '@aws-cdk/core:newStyleStackSynthesis': false, + }, + }); + stack = new cdk.Stack(app); }); test('default attribute group creation', () => { From d3df03add2d704d6e33c94bc9b2178a58db63421 Mon Sep 17 00:00:00 2001 From: Madeline Kusters <80541297+madeline-k@users.noreply.github.com> Date: Mon, 9 Aug 2021 16:00:22 -0700 Subject: [PATCH 24/47] chore(glue, ivs, msk, servicecatalog): explicit feature flags to produce a consistent template during tests (#15960) In v1, the default value of the `@aws-cdk/core:newStyleStackSynthesis` flag is `false`. As a consequence, `Template.fromStack()` generates, by default, a template without the rule and parameter related to bootstrap versions. In v2, the default value of this flag is `true`. So this test fails in the v2 branch. By explicitly setting the flag to `false`, we ensure that the tests passes on both v1 and v2, regardless of the default values. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../@aws-cdk/aws-glue/test/database.test.ts | 22 +++++++------ packages/@aws-cdk/aws-ivs/test/ivs.test.ts | 31 +++++++------------ .../@aws-cdk/aws-msk/test/cluster.test.ts | 7 ++++- .../aws-servicecatalog/test/portfolio.test.ts | 7 ++++- 4 files changed, 36 insertions(+), 31 deletions(-) diff --git a/packages/@aws-cdk/aws-glue/test/database.test.ts b/packages/@aws-cdk/aws-glue/test/database.test.ts index 6c8171df3547c..6d94eb710131a 100644 --- a/packages/@aws-cdk/aws-glue/test/database.test.ts +++ b/packages/@aws-cdk/aws-glue/test/database.test.ts @@ -1,10 +1,19 @@ import { Template } from '@aws-cdk/assertions'; -import { Stack } from '@aws-cdk/core'; +import { App, Stack } from '@aws-cdk/core'; import * as glue from '../lib'; -test('default database does not create a bucket', () => { - const stack = new Stack(); +let stack: Stack; + +beforeEach( () => { + const app = new App({ + context: { + '@aws-cdk/core:newStyleStackSynthesis': false, + }, + }); + stack = new Stack(app); +}); +test('default database does not create a bucket', () => { new glue.Database(stack, 'Database', { databaseName: 'test_database', }); @@ -28,8 +37,6 @@ test('default database does not create a bucket', () => { }); test('explicit locationURI', () => { - const stack = new Stack(); - new glue.Database(stack, 'Database', { databaseName: 'test_database', locationUri: 's3://my-uri/', @@ -55,9 +62,6 @@ test('explicit locationURI', () => { }); test('fromDatabase', () => { - // GIVEN - const stack = new Stack(); - // WHEN const database = glue.Database.fromDatabaseArn(stack, 'import', 'arn:aws:glue:us-east-1:123456789012:database/db1'); @@ -72,7 +76,6 @@ test('fromDatabase', () => { }); test('locationUri length must be >= 1', () => { - const stack = new Stack(); expect(() => new glue.Database(stack, 'Database', { databaseName: 'test_database', @@ -82,7 +85,6 @@ test('locationUri length must be >= 1', () => { }); test('locationUri length must be <= 1024', () => { - const stack = new Stack(); expect(() => new glue.Database(stack, 'Database', { databaseName: 'test_database', diff --git a/packages/@aws-cdk/aws-ivs/test/ivs.test.ts b/packages/@aws-cdk/aws-ivs/test/ivs.test.ts index 0e5efd63d5b2a..82e3b41e79e64 100644 --- a/packages/@aws-cdk/aws-ivs/test/ivs.test.ts +++ b/packages/@aws-cdk/aws-ivs/test/ivs.test.ts @@ -1,5 +1,5 @@ import { Template } from '@aws-cdk/assertions'; -import { Stack } from '@aws-cdk/core'; +import { App, Stack } from '@aws-cdk/core'; import * as ivs from '../lib'; const publicKey = `-----BEGIN PUBLIC KEY----- @@ -8,8 +8,18 @@ Yfo83eX0GJCKxJ8fr09h9LP9HDGof8/bo66P+SGHeAARGF/O9WPAQVUgSlm/KMFX EPtPtOm1s0GR9k1ydU5hkI++f9CoZ5lM -----END PUBLIC KEY-----`; +let stack: Stack; + +beforeEach( () => { + const app = new App({ + context: { + '@aws-cdk/core:newStyleStackSynthesis': false, + }, + }); + stack = new Stack(app); +}); + test('channel default properties', () => { - const stack = new Stack(); new ivs.Channel(stack, 'Channel'); Template.fromStack(stack).templateMatches({ @@ -22,7 +32,6 @@ test('channel default properties', () => { }); test('channel name', () => { - const stack = new Stack(); new ivs.Channel(stack, 'Channel', { name: 'CarrotsAreTasty', }); @@ -40,7 +49,6 @@ test('channel name', () => { }); test('channel is authorized', () => { - const stack = new Stack(); new ivs.Channel(stack, 'Channel', { authorized: true, }); @@ -58,7 +66,6 @@ test('channel is authorized', () => { }); test('channel type', () => { - const stack = new Stack(); new ivs.Channel(stack, 'Channel', { type: ivs.ChannelType.BASIC, }); @@ -76,7 +83,6 @@ test('channel type', () => { }); test('channel latency mode', () => { - const stack = new Stack(); new ivs.Channel(stack, 'Channel', { latencyMode: ivs.LatencyMode.NORMAL, }); @@ -94,22 +100,18 @@ test('channel latency mode', () => { }); test('channel from arn', () => { - const stack = new Stack(); const channel = ivs.Channel.fromChannelArn(stack, 'Channel', 'arn:aws:ivs:us-west-2:123456789012:channel/abcdABCDefgh'); expect(stack.resolve(channel.channelArn)).toBe('arn:aws:ivs:us-west-2:123456789012:channel/abcdABCDefgh'); }); test('channel invalid name throws validation error', () => { - const stack = new Stack(); - expect(() => new ivs.Channel(stack, 'Channel', { name: 'Would you like a carrot?', })).toThrow('name must contain only numbers, letters, hyphens and underscores, got: \'Would you like a carrot?\''); }); test('playback key pair mandatory properties', () => { - const stack = new Stack(); new ivs.PlaybackKeyPair(stack, 'PlaybackKeyPair', { publicKeyMaterial: publicKey, }); @@ -127,7 +129,6 @@ test('playback key pair mandatory properties', () => { }); test('playback key pair name', () => { - const stack = new Stack(); new ivs.PlaybackKeyPair(stack, 'PlaybackKeyPair', { publicKeyMaterial: publicKey, name: 'CarrotsAreNutritious', @@ -147,8 +148,6 @@ test('playback key pair name', () => { }); test('playback key pair invalid name throws validation error', () => { - const stack = new Stack(); - expect(() => new ivs.PlaybackKeyPair(stack, 'PlaybackKeyPair', { publicKeyMaterial: 'Carrots Are Orange', name: 'Would you like a carrot?', @@ -156,7 +155,6 @@ test('playback key pair invalid name throws validation error', () => { }); test('stream key mandatory properties', () => { - const stack = new Stack(); new ivs.StreamKey(stack, 'StreamKey', { channel: ivs.Channel.fromChannelArn(stack, 'ChannelRef', 'arn:aws:ivs:us-west-2:123456789012:channel/abcdABCDefgh'), }); @@ -174,7 +172,6 @@ test('stream key mandatory properties', () => { }); test('channel and stream key.. at the same time', () => { - const stack = new Stack(); const channel = new ivs.Channel(stack, 'Channel'); channel.addStreamKey('StreamKey'); @@ -194,7 +191,6 @@ test('channel and stream key.. at the same time', () => { }); test('stream key from channel reference', () => { - const stack = new Stack(); const channel = ivs.Channel.fromChannelArn(stack, 'Channel', 'arn:aws:ivs:us-west-2:123456789012:channel/abcdABCDefgh'); channel.addStreamKey('StreamKey'); @@ -211,20 +207,17 @@ test('stream key from channel reference', () => { }); test('channel from invalid channel arn throws error', () => { - const stack = new Stack(); expect(() => ivs.Channel.fromChannelArn(stack, 'ChannelRef', 'this is an invalid arn, in fact, it is a carrot 🥕')) .toThrow('ARNs must start with \"arn:\" and have at least 6 components: this is an invalid arn, in fact, it is a carrot 🥕'); }); test('channel from invalid channel arn service throws error', () => { - const stack = new Stack(); expect( () => ivs.Channel.fromChannelArn(stack, 'ChannelRef', 'arn:aws:ec2:us-west-2:123456789012:instance/abcdABCDefgh')) .toThrow('Invalid service, expected \'ivs\', got \'ec2\''); }); test('channel from invalid channel arn resource throws error', () => { - const stack = new Stack(); expect( () => ivs.Channel.fromChannelArn(stack, 'ChannelRef', 'arn:aws:ivs:us-west-2:123456789012:stream-key/abcdABCDefgh')) .toThrow('Invalid resource, expected \'channel\', got \'stream-key\''); diff --git a/packages/@aws-cdk/aws-msk/test/cluster.test.ts b/packages/@aws-cdk/aws-msk/test/cluster.test.ts index a990895e16d9c..71877df25e95a 100644 --- a/packages/@aws-cdk/aws-msk/test/cluster.test.ts +++ b/packages/@aws-cdk/aws-msk/test/cluster.test.ts @@ -13,7 +13,12 @@ describe('MSK Cluster', () => { let vpc: ec2.IVpc; beforeEach(() => { - stack = new core.Stack(); + const app = new core.App({ + context: { + '@aws-cdk/core:newStyleStackSynthesis': false, + }, + }); + stack = new core.Stack(app); vpc = new ec2.Vpc(stack, 'Vpc'); }); diff --git a/packages/@aws-cdk/aws-servicecatalog/test/portfolio.test.ts b/packages/@aws-cdk/aws-servicecatalog/test/portfolio.test.ts index 216c34295cab2..8f9a27a96a940 100644 --- a/packages/@aws-cdk/aws-servicecatalog/test/portfolio.test.ts +++ b/packages/@aws-cdk/aws-servicecatalog/test/portfolio.test.ts @@ -8,7 +8,12 @@ describe('Portfolio', () => { let stack: cdk.Stack; beforeEach(() => { - stack = new cdk.Stack(); + const app = new cdk.App({ + context: { + '@aws-cdk/core:newStyleStackSynthesis': false, + }, + }); + stack = new cdk.Stack(app); }); describe('portfolio creation and importing', () => { From c3b872ad47ff3bdf2c841aa195b6fa6922c03769 Mon Sep 17 00:00:00 2001 From: hanukoon Date: Tue, 10 Aug 2021 21:12:52 +0900 Subject: [PATCH 25/47] fix(ec2): "clientVpnEndoint" => "clientVpnEndpoint" (#14902) It is a solution to the issue #13810 Corrected the typo "clientVpnEndpoint" in the ec2 module to "clientVpnEnpoint". The maintainer (@rix0rrr) talked about @deprecated tags on existing incorrect members in the issue thread, but I didn't work on it because I thought it was an internal reference member. (if @deprecated tag is the rule of this repository in this case, please comment). This is my first commitment to this report. If there's anything wrong, please let me know in the comments. thanks ---- edit ----- Originally, this PR was #14835 , but I deleted my fork report by mistake, so I couldn't correct the error, so I uploaded it again. --- .../lib/client-vpn-authorization-rule.ts | 25 +++- .../aws-ec2/lib/client-vpn-endpoint.ts | 4 +- .../@aws-cdk/aws-ec2/lib/client-vpn-route.ts | 28 +++- .../client-vpn-authorization-rule.test.ts | 93 ++++++++++++++ .../aws-ec2/test/client-vpn-route.test.ts | 121 ++++++++++++++++++ 5 files changed, 262 insertions(+), 9 deletions(-) create mode 100644 packages/@aws-cdk/aws-ec2/test/client-vpn-authorization-rule.test.ts create mode 100644 packages/@aws-cdk/aws-ec2/test/client-vpn-route.test.ts diff --git a/packages/@aws-cdk/aws-ec2/lib/client-vpn-authorization-rule.ts b/packages/@aws-cdk/aws-ec2/lib/client-vpn-authorization-rule.ts index c63f940ab4883..ea574628d16e5 100644 --- a/packages/@aws-cdk/aws-ec2/lib/client-vpn-authorization-rule.ts +++ b/packages/@aws-cdk/aws-ec2/lib/client-vpn-authorization-rule.ts @@ -35,8 +35,16 @@ export interface ClientVpnAuthorizationRuleOptions { export interface ClientVpnAuthorizationRuleProps extends ClientVpnAuthorizationRuleOptions { /** * The client VPN endpoint to which to add the rule. + * @default clientVpnEndpoint is required */ - readonly clientVpnEndoint: IClientVpnEndpoint; + readonly clientVpnEndpoint?: IClientVpnEndpoint; + + /** + * The client VPN endpoint to which to add the rule. + * @deprecated Use `clientVpnEndpoint` instead + * @default clientVpnEndpoint is required + */ + readonly clientVpnEndoint?: IClientVpnEndpoint; } /** @@ -44,10 +52,21 @@ export interface ClientVpnAuthorizationRuleProps extends ClientVpnAuthorizationR */ export class ClientVpnAuthorizationRule extends Resource { constructor(scope: Construct, id: string, props: ClientVpnAuthorizationRuleProps) { + if (!props.clientVpnEndoint && !props.clientVpnEndpoint) { + throw new Error( + 'ClientVpnAuthorizationRule: either clientVpnEndpoint or clientVpnEndoint (deprecated) must be specified', + ); + } + if (props.clientVpnEndoint && props.clientVpnEndpoint) { + throw new Error( + 'ClientVpnAuthorizationRule: either clientVpnEndpoint or clientVpnEndoint (deprecated) must be specified' + + ', but not both', + ); + } + const clientVpnEndpoint = props.clientVpnEndoint || props.clientVpnEndpoint; super(scope, id); - new CfnClientVpnAuthorizationRule(this, 'Resource', { - clientVpnEndpointId: props.clientVpnEndoint.endpointId, + clientVpnEndpointId: clientVpnEndpoint!.endpointId, targetNetworkCidr: props.cidr, accessGroupId: props.groupId, authorizeAllGroups: !props.groupId, diff --git a/packages/@aws-cdk/aws-ec2/lib/client-vpn-endpoint.ts b/packages/@aws-cdk/aws-ec2/lib/client-vpn-endpoint.ts index 43431bd649046..3ee8e8956d3d1 100644 --- a/packages/@aws-cdk/aws-ec2/lib/client-vpn-endpoint.ts +++ b/packages/@aws-cdk/aws-ec2/lib/client-vpn-endpoint.ts @@ -356,7 +356,7 @@ export class ClientVpnEndpoint extends Resource implements IClientVpnEndpoint { public addAuthorizationRule(id: string, props: ClientVpnAuthorizationRuleOptions): ClientVpnAuthorizationRule { return new ClientVpnAuthorizationRule(this, id, { ...props, - clientVpnEndoint: this, + clientVpnEndpoint: this, }); } @@ -366,7 +366,7 @@ export class ClientVpnEndpoint extends Resource implements IClientVpnEndpoint { public addRoute(id: string, props: ClientVpnRouteOptions): ClientVpnRoute { return new ClientVpnRoute(this, id, { ...props, - clientVpnEndoint: this, + clientVpnEndpoint: this, }); } } diff --git a/packages/@aws-cdk/aws-ec2/lib/client-vpn-route.ts b/packages/@aws-cdk/aws-ec2/lib/client-vpn-route.ts index 38734631a5d91..dd0c026be5a55 100644 --- a/packages/@aws-cdk/aws-ec2/lib/client-vpn-route.ts +++ b/packages/@aws-cdk/aws-ec2/lib/client-vpn-route.ts @@ -62,10 +62,19 @@ export abstract class ClientVpnRouteTarget { * Properties for a ClientVpnRoute */ export interface ClientVpnRouteProps extends ClientVpnRouteOptions { + + /** + * The client VPN endpoint to which to add the route. + * @default clientVpnEndpoint is required + */ + readonly clientVpnEndpoint?: IClientVpnEndpoint; /** * The client VPN endpoint to which to add the route. + * @deprecated Use `clientVpnEndpoint` instead + * @default clientVpnEndpoint is required + */ - readonly clientVpnEndoint: IClientVpnEndpoint; + readonly clientVpnEndoint?: IClientVpnEndpoint; } /** @@ -73,16 +82,27 @@ export interface ClientVpnRouteProps extends ClientVpnRouteOptions { */ export class ClientVpnRoute extends Resource { constructor(scope: Construct, id: string, props: ClientVpnRouteProps) { + if (!props.clientVpnEndoint && !props.clientVpnEndpoint) { + throw new Error( + 'ClientVpnRoute: either clientVpnEndpoint or clientVpnEndoint (deprecated) must be specified', + ); + } + if (props.clientVpnEndoint && props.clientVpnEndpoint) { + throw new Error( + 'ClientVpnRoute: either clientVpnEndpoint or clientVpnEndoint (deprecated) must be specified' + + ', but not both', + ); + } + const clientVpnEndpoint = props.clientVpnEndoint || props.clientVpnEndpoint; super(scope, id); - const route = new CfnClientVpnRoute(this, 'Resource', { - clientVpnEndpointId: props.clientVpnEndoint.endpointId, + clientVpnEndpointId: clientVpnEndpoint!.endpointId, description: props.description, destinationCidrBlock: props.cidr, targetVpcSubnetId: props.target.subnetId, }); // See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-clientvpnroute.html - route.node.addDependency(props.clientVpnEndoint.targetNetworksAssociated); + route.node.addDependency(clientVpnEndpoint!.targetNetworksAssociated); } } diff --git a/packages/@aws-cdk/aws-ec2/test/client-vpn-authorization-rule.test.ts b/packages/@aws-cdk/aws-ec2/test/client-vpn-authorization-rule.test.ts new file mode 100644 index 0000000000000..6c8911d90a06d --- /dev/null +++ b/packages/@aws-cdk/aws-ec2/test/client-vpn-authorization-rule.test.ts @@ -0,0 +1,93 @@ +import '@aws-cdk/assert-internal/jest'; +import { Stack } from '@aws-cdk/core'; +import { Connections, IClientVpnEndpoint } from '../lib'; +import { ClientVpnAuthorizationRule } from '../lib/client-vpn-authorization-rule'; + +let stack: Stack; +beforeEach(() => { + stack = new Stack(); +}); + +describe('ClientVpnAuthorizationRule constructor', () => { + test('normal usage', () => { + const clientVpnEndpoint: IClientVpnEndpoint = { + endpointId: 'myClientVpnEndpoint', + targetNetworksAssociated: [], + stack, + env: { account: 'myAccount', region: 'us-east-1' }, + connections: new Connections(), + node: stack.node, + }; + new ClientVpnAuthorizationRule(stack, 'NormalRule', { + cidr: '10.0.10.0/32', + clientVpnEndpoint, + }); + expect(stack).toCountResources('AWS::EC2::ClientVpnAuthorizationRule', 1); + expect(stack.node.children.length).toBe(1); + }); + test('either clientVpnEndoint (deprecated, typo) or clientVpnEndpoint is required', () => { + expect(() => { + new ClientVpnAuthorizationRule(stack, 'RuleNoEndointNoEndpoint', { + cidr: '10.0.10.0/32', + }); + }).toThrow( + new Error( + 'ClientVpnAuthorizationRule: either clientVpnEndpoint or clientVpnEndoint (deprecated) must be specified', + ), + ); + }); + test('specifying both clientVpnEndoint (deprecated, typo) and clientVpnEndpoint is not allowed', () => { + const clientVpnEndoint: IClientVpnEndpoint = { + endpointId: 'typoTypo', + targetNetworksAssociated: [], + stack, + env: { account: 'myAccount', region: 'us-east-1' }, + connections: new Connections(), + node: stack.node, + }; + const clientVpnEndpoint: IClientVpnEndpoint = { + endpointId: 'myClientVpnEndpoint', + targetNetworksAssociated: [], + stack, + env: { account: 'myAccount', region: 'us-east-1' }, + connections: new Connections(), + node: stack.node, + }; + expect(() => { + new ClientVpnAuthorizationRule(stack, 'RuleBothEndointAndEndpoint', { + cidr: '10.0.10.0/32', + clientVpnEndoint, + clientVpnEndpoint, + }); + }).toThrow( + new Error( + 'ClientVpnAuthorizationRule: either clientVpnEndpoint or clientVpnEndoint (deprecated) must be specified' + + ', but not both', + ), + ); + }); + test('invalid constructor calls should not add anything to the stack', () => { + expect(() => { + new ClientVpnAuthorizationRule(stack, 'RuleNoEndointNoEndpoint', { + cidr: '10.0.10.0/32', + }); + }).toThrow(); + expect(stack.node.children.length).toBe(0); + }); + test('supplying clientVpnEndoint (deprecated due to typo) should still work', () => { + const clientVpnEndoint: IClientVpnEndpoint = { + endpointId: 'myClientVpnEndpoint', + targetNetworksAssociated: [], + stack, + env: { account: 'myAccount', region: 'us-east-1' }, + connections: new Connections(), + node: stack.node, + }; + new ClientVpnAuthorizationRule(stack, 'RuleWithEndointTypo', { + cidr: '10.0.10.0/32', + clientVpnEndoint, + }); + expect(stack).toCountResources('AWS::EC2::ClientVpnAuthorizationRule', 1); + expect(stack.node.children.length).toBe(1); + }); +}); diff --git a/packages/@aws-cdk/aws-ec2/test/client-vpn-route.test.ts b/packages/@aws-cdk/aws-ec2/test/client-vpn-route.test.ts new file mode 100644 index 0000000000000..42f094ab4bb9e --- /dev/null +++ b/packages/@aws-cdk/aws-ec2/test/client-vpn-route.test.ts @@ -0,0 +1,121 @@ +import '@aws-cdk/assert-internal/jest'; +import { SamlMetadataDocument, SamlProvider } from '@aws-cdk/aws-iam'; +import { Stack } from '@aws-cdk/core'; +import * as ec2 from '../lib'; +import { + ClientVpnRoute, + ClientVpnRouteTarget, + ClientVpnUserBasedAuthentication, +} from '../lib'; + +let stack: Stack; +let vpc: ec2.IVpc; +beforeEach(() => { + stack = new Stack(); + vpc = new ec2.Vpc(stack, 'Vpc'); +}); + +describe('ClientVpnRoute constructor', () => { + test('normal usage', () => { + const samlProvider = new SamlProvider(stack, 'Provider', { + metadataDocument: SamlMetadataDocument.fromXml('xml'), + }); + const clientVpnEndpoint = vpc.addClientVpnEndpoint('Endpoint', { + cidr: '10.100.0.0/16', + serverCertificateArn: 'server-certificate-arn', + clientCertificateArn: 'client-certificate-arn', + clientConnectionHandler: { + functionArn: 'function-arn', + functionName: 'AWSClientVPN-function-name', + }, + dnsServers: ['8.8.8.8', '8.8.4.4'], + userBasedAuthentication: ClientVpnUserBasedAuthentication.federated(samlProvider), + }); + new ClientVpnRoute(stack, 'NormalRoute', { + clientVpnEndpoint, + cidr: '0.0.0.0/0', + target: ClientVpnRouteTarget.local(), + }); + expect(stack).toCountResources('AWS::EC2::VPC', 1); + expect(stack).toCountResources('AWS::EC2::ClientVpnEndpoint', 1); + expect(stack).toCountResources('AWS::EC2::ClientVpnRoute', 1); + expect(stack.node.children.length).toBe(3); + }); + test('either clientVpnEndoint (deprecated, typo) or clientVpnEndpoint is required', () => { + expect(() => { + new ClientVpnRoute(stack, 'RouteNoEndointOrEndpoint', { + cidr: '0.0.0.0/0', + target: ClientVpnRouteTarget.local(), + }); + }).toThrow( + new Error( + 'ClientVpnRoute: either clientVpnEndpoint or clientVpnEndoint (deprecated) must be specified', + ), + ); + }); + test('specifying both clientVpnEndoint (deprecated, typo) and clientVpnEndpoint is not allowed', () => { + const samlProvider = new SamlProvider(stack, 'Provider', { + metadataDocument: SamlMetadataDocument.fromXml('xml'), + }); + const clientVpnEndpoint = vpc.addClientVpnEndpoint('Endpoint', { + cidr: '10.100.0.0/16', + serverCertificateArn: 'server-certificate-arn', + clientCertificateArn: 'client-certificate-arn', + clientConnectionHandler: { + functionArn: 'function-arn', + functionName: 'AWSClientVPN-function-name', + }, + dnsServers: ['8.8.8.8', '8.8.4.4'], + userBasedAuthentication: ClientVpnUserBasedAuthentication.federated(samlProvider), + }); + const clientVpnEndoint = clientVpnEndpoint; + expect(() => { + new ClientVpnRoute(stack, 'RouteBothEndointAndEndpoint', { + clientVpnEndoint, + clientVpnEndpoint, + cidr: '0.0.0.0/0', + target: ClientVpnRouteTarget.local(), + }); + }).toThrow( + new Error( + 'ClientVpnRoute: either clientVpnEndpoint or clientVpnEndoint (deprecated) must be specified' + + ', but not both', + ), + ); + }); + test('invalid constructor calls should not add anything to the stack', () => { + expect(() => { + new ClientVpnRoute(stack, 'RouteNoEndointOrEndpoint', { + cidr: '0.0.0.0/0', + target: ClientVpnRouteTarget.local(), + }); + }).toThrow(); + expect(stack).toCountResources('AWS::EC2::VPC', 1); + expect(stack.node.children.length).toBe(1); + }); + test('supplying clientVpnEndoint (deprecated due to typo) should still work', () => { + const samlProvider = new SamlProvider(stack, 'Provider', { + metadataDocument: SamlMetadataDocument.fromXml('xml'), + }); + const clientVpnEndoint = vpc.addClientVpnEndpoint('Endpoint', { + cidr: '10.100.0.0/16', + serverCertificateArn: 'server-certificate-arn', + clientCertificateArn: 'client-certificate-arn', + clientConnectionHandler: { + functionArn: 'function-arn', + functionName: 'AWSClientVPN-function-name', + }, + dnsServers: ['8.8.8.8', '8.8.4.4'], + userBasedAuthentication: ClientVpnUserBasedAuthentication.federated(samlProvider), + }); + new ClientVpnRoute(stack, 'RouteWithEndointTypo', { + clientVpnEndoint, + cidr: '0.0.0.0/0', + target: ClientVpnRouteTarget.local(), + }); + expect(stack).toCountResources('AWS::EC2::VPC', 1); + expect(stack).toCountResources('AWS::EC2::ClientVpnEndpoint', 1); + expect(stack).toCountResources('AWS::EC2::ClientVpnRoute', 1); + expect(stack.node.children.length).toBe(3); + }); +}); From 04b8d400b2653aff4f48709e8b420c6adb996ef5 Mon Sep 17 00:00:00 2001 From: Thorsten Hoeger Date: Tue, 10 Aug 2021 14:56:32 +0200 Subject: [PATCH 26/47] feat(pipelines): add `synthCodeBuildDefaults` (#15627) This change allows specifying the codeBuildDefaults for the synth-action as it is already possible with assets and self-mutation. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/pipelines/README.md | 7 ++++--- .../pipelines/lib/codepipeline/codepipeline.ts | 15 +++++++++++---- .../pipelines/test/compliance/synths.test.ts | 8 ++++++++ 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/packages/@aws-cdk/pipelines/README.md b/packages/@aws-cdk/pipelines/README.md index 103715704ec62..f17a35e3a9990 100644 --- a/packages/@aws-cdk/pipelines/README.md +++ b/packages/@aws-cdk/pipelines/README.md @@ -547,7 +547,7 @@ of properties that allow you to customize various aspects of the projects: ```ts new CodeBuildStep('Synth', { - // ...standard RunScript props... + // ...standard ShellStep props... commands: [/* ... */], env: { /* ... */ }, @@ -582,8 +582,8 @@ new CodeBuildStep('Synth', { ``` You can also configure defaults for *all* CodeBuild projects by passing `codeBuildDefaults`, -or just for the asset publishing and self-mutation projects by passing `assetPublishingCodeBuildDefaults` -or `selfMutationCodeBuildDefaults`: +or just for the synth, asset publishing, and self-mutation projects by passing `synthCodeBuildDefaults`, +`assetPublishingCodeBuildDefaults`, or `selfMutationCodeBuildDefaults`: ```ts new CodePipeline(this, 'Pipeline', { @@ -613,6 +613,7 @@ new CodePipeline(this, 'Pipeline', { ], }, + synthCodeBuildDefaults: { /* ... */ }, assetPublishingCodeBuildDefaults: { /* ... */ }, selfMutationCodeBuildDefaults: { /* ... */ }, }); diff --git a/packages/@aws-cdk/pipelines/lib/codepipeline/codepipeline.ts b/packages/@aws-cdk/pipelines/lib/codepipeline/codepipeline.ts index cc4cdeea3aa3f..27a2b15509532 100644 --- a/packages/@aws-cdk/pipelines/lib/codepipeline/codepipeline.ts +++ b/packages/@aws-cdk/pipelines/lib/codepipeline/codepipeline.ts @@ -132,17 +132,24 @@ export interface CodePipelineProps { */ readonly codeBuildDefaults?: CodeBuildOptions; + /** + * Additional customizations to apply to the synthesize CodeBuild projects + * + * @default - Only `codeBuildDefaults` are applied + */ + readonly synthCodeBuildDefaults?: CodeBuildOptions; + /** * Additional customizations to apply to the asset publishing CodeBuild projects * - * @default - Only `codeBuildProjectDefaults` are applied + * @default - Only `codeBuildDefaults` are applied */ readonly assetPublishingCodeBuildDefaults?: CodeBuildOptions; /** * Additional customizations to apply to the self mutation CodeBuild projects * - * @default - Only `codeBuildProjectDefaults` are applied + * @default - Only `codeBuildDefaults` are applied */ readonly selfMutationCodeBuildDefaults?: CodeBuildOptions; @@ -681,8 +688,8 @@ export class CodePipeline extends PipelineBase { const typeBasedCustomizations = { [CodeBuildProjectType.SYNTH]: this.props.dockerEnabledForSynth - ? { buildEnvironment: { privileged: true } } - : {}, + ? mergeCodeBuildOptions(this.props.synthCodeBuildDefaults, { buildEnvironment: { privileged: true } }) + : this.props.synthCodeBuildDefaults, [CodeBuildProjectType.ASSETS]: this.props.assetPublishingCodeBuildDefaults, diff --git a/packages/@aws-cdk/pipelines/test/compliance/synths.test.ts b/packages/@aws-cdk/pipelines/test/compliance/synths.test.ts index 7c47600b66155..247cbd50974e0 100644 --- a/packages/@aws-cdk/pipelines/test/compliance/synths.test.ts +++ b/packages/@aws-cdk/pipelines/test/compliance/synths.test.ts @@ -559,6 +559,14 @@ behavior('Synth can be made to run in a VPC', (suite) => { THEN_codePipelineExpectation(); }); + suite.additional('Modern, using the synthCodeBuildDefaults', () => { + new ModernTestGitHubNpmPipeline(pipelineStack, 'Cdk', { + synthCodeBuildDefaults: { vpc }, + }); + + THEN_codePipelineExpectation(); + }); + suite.additional('Modern, using CodeBuildStep', () => { new ModernTestGitHubNpmPipeline(pipelineStack, 'Cdk', { synth: new CodeBuildStep('Synth', { From 6b32b2fb0c6ed2a21eb929e39930c6c9cf668dae Mon Sep 17 00:00:00 2001 From: nohack <61228138+nohack@users.noreply.github.com> Date: Tue, 10 Aug 2021 23:08:31 +0530 Subject: [PATCH 27/47] feat(aws-elbv2): ALB target group routing algorithms (#15622) Closes #15160 --- .../lib/alb/application-listener.ts | 11 +++++++- .../lib/alb/application-target-group.ts | 12 ++++++++- .../lib/shared/enums.ts | 15 +++++++++++ .../test/alb/listener.test.ts | 25 +++++++++++++++++++ .../test/alb/target-group.test.ts | 23 +++++++++++++++++ 5 files changed, 84 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener.ts index 8d52d3bc60eb4..a1ea49a3b18a6 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener.ts @@ -5,7 +5,7 @@ import * as cxapi from '@aws-cdk/cx-api'; import { Construct } from 'constructs'; import { BaseListener, BaseListenerLookupOptions } from '../shared/base-listener'; import { HealthCheck } from '../shared/base-target-group'; -import { ApplicationProtocol, ApplicationProtocolVersion, IpAddressType, SslPolicy } from '../shared/enums'; +import { ApplicationProtocol, ApplicationProtocolVersion, TargetGroupLoadBalancingAlgorithmType, IpAddressType, SslPolicy } from '../shared/enums'; import { IListenerCertificate, ListenerCertificate } from '../shared/listener-certificate'; import { determineProtocolAndPort } from '../shared/util'; import { ListenerAction } from './application-listener-action'; @@ -367,6 +367,7 @@ export class ApplicationListener extends BaseListener implements IApplicationLis slowStart: props.slowStart, stickinessCookieDuration: props.stickinessCookieDuration, stickinessCookieName: props.stickinessCookieName, + loadBalancingAlgorithmType: props.loadBalancingAlgorithmType, targetGroupName: props.targetGroupName, targets: props.targets, vpc: this.loadBalancer.vpc, @@ -887,6 +888,14 @@ export interface AddApplicationTargetsProps extends AddRuleProps { * @default No health check */ readonly healthCheck?: HealthCheck; + + /** + * The load balancing algorithm to select targets for routing requests. + * + * @default round_robin. + */ + readonly loadBalancingAlgorithmType?: TargetGroupLoadBalancingAlgorithmType; + } /** diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-target-group.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-target-group.ts index e7a6b2eef27d1..4c3085f2d5a66 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-target-group.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-target-group.ts @@ -7,7 +7,7 @@ import { BaseTargetGroupProps, ITargetGroup, loadBalancerNameFromListenerArn, LoadBalancerTargetProps, TargetGroupAttributes, TargetGroupBase, TargetGroupImportProps, } from '../shared/base-target-group'; -import { ApplicationProtocol, ApplicationProtocolVersion, Protocol, TargetType } from '../shared/enums'; +import { ApplicationProtocol, ApplicationProtocolVersion, Protocol, TargetType, TargetGroupLoadBalancingAlgorithmType } from '../shared/enums'; import { ImportedTargetGroupBase } from '../shared/imported'; import { determineProtocolAndPort } from '../shared/util'; import { IApplicationListener } from './application-listener'; @@ -78,6 +78,13 @@ export interface ApplicationTargetGroupProps extends BaseTargetGroupProps { */ readonly stickinessCookieName?: string; + /** + * The load balancing algorithm to select targets for routing requests. + * + * @default TargetGroupLoadBalancingAlgorithmType.ROUND_ROBIN + */ + readonly loadBalancingAlgorithmType?: TargetGroupLoadBalancingAlgorithmType; + /** * The targets to add to this target group. * @@ -140,6 +147,9 @@ export class ApplicationTargetGroup extends TargetGroupBase implements IApplicat if (props.stickinessCookieDuration) { this.enableCookieStickiness(props.stickinessCookieDuration, props.stickinessCookieName); } + if (props.loadBalancingAlgorithmType) { + this.setAttribute('load_balancing.algorithm.type', props.loadBalancingAlgorithmType); + } this.addTarget(...(props.targets || [])); } } diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/enums.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/enums.ts index 8c5f183bb2cc2..94a9473ab9bc9 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/enums.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/enums.ts @@ -171,3 +171,18 @@ export enum TargetType { */ LAMBDA = 'lambda', } + +/** + * Load balancing algorithmm type for target groups + */ +export enum TargetGroupLoadBalancingAlgorithmType { + /** + * round_robin + */ + ROUND_ROBIN = 'round_robin', + + /** + * least_outstanding_requests + */ + LEAST_OUTSTANDING_REQUESTS = 'least_outstanding_requests', +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/listener.test.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/listener.test.ts index fffc6e365bcea..2d945aeb2621f 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/listener.test.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/listener.test.ts @@ -866,6 +866,31 @@ describe('tests', () => { }); }); + test('Custom Load balancer algorithm type', () => { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'VPC'); + const lb = new elbv2.ApplicationLoadBalancer(stack, 'LB', { vpc }); + const listener = lb.addListener('Listener', { port: 80 }); + + // WHEN + listener.addTargets('Group', { + port: 80, + targets: [new FakeSelfRegisteringTarget(stack, 'Target', vpc)], + loadBalancingAlgorithmType: elbv2.TargetGroupLoadBalancingAlgorithmType.LEAST_OUTSTANDING_REQUESTS, + }); + + // THEN + expect(stack).toHaveResource('AWS::ElasticLoadBalancingV2::TargetGroup', { + TargetGroupAttributes: [ + { + Key: 'load_balancing.algorithm.type', + Value: 'least_outstanding_requests', + }, + ], + }); + }); + describe('Throws with bad fixed responses', () => { test('status code', () => { diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/target-group.test.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/target-group.test.ts index 965844affb709..97c36c33ce237 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/target-group.test.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/target-group.test.ts @@ -156,6 +156,29 @@ describe('tests', () => { }); }); + test('Custom Load balancer algorithm type', () => { + // GIVEN + const app = new cdk.App(); + const stack = new cdk.Stack(app, 'Stack'); + const vpc = new ec2.Vpc(stack, 'VPC', {}); + + // WHEN + new elbv2.ApplicationTargetGroup(stack, 'TargetGroup', { + loadBalancingAlgorithmType: elbv2.TargetGroupLoadBalancingAlgorithmType.LEAST_OUTSTANDING_REQUESTS, + vpc, + }); + + // THEN + expect(stack).toHaveResource('AWS::ElasticLoadBalancingV2::TargetGroup', { + TargetGroupAttributes: [ + { + Key: 'load_balancing.algorithm.type', + Value: 'least_outstanding_requests', + }, + ], + }); + }); + test('Can set a protocol version', () => { // GIVEN const app = new cdk.App(); From 59245429acb9e54c46c051d9c19f103698c4610d Mon Sep 17 00:00:00 2001 From: Julian Michel Date: Tue, 10 Aug 2021 21:27:21 +0200 Subject: [PATCH 28/47] docs(cognito): describe addDependency for identity provider and app client (#15893) When an app client is created, it receives the name of the identity provider as a string. During the deployment, the identity provider must be created first, then the app client can be created (because it references the identity provider). Due to the fact that the reference is passed as a string, CDK can't add the dependency between the identity provider and the app client automatically. Therefore, `addDependency` must be called manually when both constructs are created in the same stack. The missing dependency was reported two times in the last weeks (issue #15850 and #15692). Because of that I would propose to add this behaviour in the readme. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-cognito/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/@aws-cdk/aws-cognito/README.md b/packages/@aws-cdk/aws-cognito/README.md index 0c9c77ce42fdf..283fd4d6584ea 100644 --- a/packages/@aws-cdk/aws-cognito/README.md +++ b/packages/@aws-cdk/aws-cognito/README.md @@ -565,6 +565,21 @@ pool.addClient('app-client', { }); ``` +If the identity provider and the app client are created in the same stack, specify the dependency between both constructs to make sure that the identity provider already exists when the app client will be created. The app client cannot handle the dependency to the identity provider automatically because the client does not have access to the provider's construct. + +```ts +const provider = new cognito.UserPoolIdentityProviderAmazon(this, 'Amazon', { + // ... +}); +const client = pool.addClient('app-client', { + // ... + supportedIdentityProviders: [ + cognito.UserPoolClientIdentityProvider.AMAZON, + ], +} +client.node.addDependency(provider); +``` + In accordance with the OIDC open standard, Cognito user pool clients provide access tokens, ID tokens and refresh tokens. More information is available at [Using Tokens with User Pools](https://docs.aws.amazon.com/en_us/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-with-identity-providers.html). The expiration time for these tokens can be configured as shown below. From 8cb0e97ea663e0447af77842e1a8efa8aee917eb Mon Sep 17 00:00:00 2001 From: Julian Michel Date: Tue, 10 Aug 2021 22:08:21 +0200 Subject: [PATCH 29/47] feat(cognito): add support for token revocation in UserPoolClient (#15317) Add support for token revocation in UserPoolClient. For new user pool clients, token revocation is enabled by default. Property `enableTokenRevocation` introduces the possibility to enable token revocation for existing user pool clients. Closes #15126 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-cognito/README.md | 11 +++++ .../aws-cognito/lib/user-pool-client.ts | 8 ++++ .../aws-cognito/test/user-pool-client.test.ts | 47 +++++++++++++++++++ 3 files changed, 66 insertions(+) diff --git a/packages/@aws-cdk/aws-cognito/README.md b/packages/@aws-cdk/aws-cognito/README.md index 283fd4d6584ea..bdb93fc24d566 100644 --- a/packages/@aws-cdk/aws-cognito/README.md +++ b/packages/@aws-cdk/aws-cognito/README.md @@ -618,6 +618,17 @@ pool.addClient('app-client', { }); ``` +[Token revocation](https://docs.aws.amazon.com/cognito/latest/developerguide/token-revocation.html +) can be configured to be able to revoke refresh tokens in app clients. By default, token revocation is enabled for new user pools. The property can be used to enable the token revocation in existing app clients or to change the default behavior. + +```ts +const pool = new cognito.UserPool(this, 'Pool'); +pool.addClient('app-client', { + // ... + enableTokenRevocation: true, +}); +``` + ### Resource Servers A resource server is a server for access-protected resources. It handles authenticated requests from an app that has an diff --git a/packages/@aws-cdk/aws-cognito/lib/user-pool-client.ts b/packages/@aws-cdk/aws-cognito/lib/user-pool-client.ts index d1f89f188c667..99ddaac75e595 100644 --- a/packages/@aws-cdk/aws-cognito/lib/user-pool-client.ts +++ b/packages/@aws-cdk/aws-cognito/lib/user-pool-client.ts @@ -293,6 +293,13 @@ export interface UserPoolClientOptions { * @default - all standard and custom attributes */ readonly writeAttributes?: ClientAttributes; + + /** + * Enable token revocation for this client. + * @see https://docs.aws.amazon.com/cognito/latest/developerguide/token-revocation.html#enable-token-revocation + * @default true for new user pool clients + */ + readonly enableTokenRevocation?: boolean; } /** @@ -381,6 +388,7 @@ export class UserPoolClient extends Resource implements IUserPoolClient { supportedIdentityProviders: this.configureIdentityProviders(props), readAttributes: props.readAttributes?.attributes(), writeAttributes: props.writeAttributes?.attributes(), + enableTokenRevocation: props.enableTokenRevocation, }); this.configureTokenValidity(resource, props); diff --git a/packages/@aws-cdk/aws-cognito/test/user-pool-client.test.ts b/packages/@aws-cdk/aws-cognito/test/user-pool-client.test.ts index dc8dde7779bbc..d6fc81f28c43c 100644 --- a/packages/@aws-cdk/aws-cognito/test/user-pool-client.test.ts +++ b/packages/@aws-cdk/aws-cognito/test/user-pool-client.test.ts @@ -541,6 +541,53 @@ describe('User Pool Client', () => { })).toThrow(/disableOAuth is set/); }); + test('EnableTokenRevocation is absent by default', () => { + // GIVEN + const stack = new Stack(); + const pool = new UserPool(stack, 'Pool'); + + // WHEN + pool.addClient('Client'); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::Cognito::UserPoolClient', { + EnableTokenRevocation: Match.absentProperty(), + }); + }); + + test('enableTokenRevocation in addClient', () => { + // GIVEN + const stack = new Stack(); + const pool = new UserPool(stack, 'Pool'); + + // WHEN + pool.addClient('Client', { + enableTokenRevocation: true, + }); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::Cognito::UserPoolClient', { + EnableTokenRevocation: true, + }); + }); + + test('enableTokenRevocation in UserPoolClient', () => { + // GIVEN + const stack = new Stack(); + const pool = new UserPool(stack, 'Pool'); + + // WHEN + new UserPoolClient(stack, 'Client1', { + userPool: pool, + enableTokenRevocation: true, + }); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::Cognito::UserPoolClient', { + EnableTokenRevocation: true, + }); + }); + describe('token validity', () => { test('default', () => { // GIVEN From 898b05689899c85224e7b062ab2d65f112fe1bc0 Mon Sep 17 00:00:00 2001 From: AWS CDK Team Date: Tue, 10 Aug 2021 21:09:31 +0000 Subject: [PATCH 30/47] chore(release): 1.118.0 --- CHANGELOG.md | 14 ++++++++++++++ version.v1.json | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef046c0c53529..83cca9c58cb2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,20 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [1.118.0](https://github.com/aws/aws-cdk/compare/v1.117.0...v1.118.0) (2021-08-10) + + +### Features + +* **aws-elbv2:** ALB target group routing algorithms ([#15622](https://github.com/aws/aws-cdk/issues/15622)) ([6b32b2f](https://github.com/aws/aws-cdk/commit/6b32b2fb0c6ed2a21eb929e39930c6c9cf668dae)), closes [#15160](https://github.com/aws/aws-cdk/issues/15160) +* **cognito:** add support for token revocation in UserPoolClient ([#15317](https://github.com/aws/aws-cdk/issues/15317)) ([8cb0e97](https://github.com/aws/aws-cdk/commit/8cb0e97ea663e0447af77842e1a8efa8aee917eb)), closes [#15126](https://github.com/aws/aws-cdk/issues/15126) +* **pipelines:** add `synthCodeBuildDefaults` ([#15627](https://github.com/aws/aws-cdk/issues/15627)) ([04b8d40](https://github.com/aws/aws-cdk/commit/04b8d400b2653aff4f48709e8b420c6adb996ef5)) + + +### Bug Fixes + +* **ec2:** "clientVpnEndoint" => "clientVpnEndpoint" ([#14902](https://github.com/aws/aws-cdk/issues/14902)) ([c3b872a](https://github.com/aws/aws-cdk/commit/c3b872ad47ff3bdf2c841aa195b6fa6922c03769)), closes [#13810](https://github.com/aws/aws-cdk/issues/13810) + ## [1.117.0](https://github.com/aws/aws-cdk/compare/v1.116.0...v1.117.0) (2021-08-05) diff --git a/version.v1.json b/version.v1.json index 95b9ca9e3c2f0..5c8ead95001f8 100644 --- a/version.v1.json +++ b/version.v1.json @@ -1,3 +1,3 @@ { - "version": "1.117.0" + "version": "1.118.0" } From c42b3e8c83337afcb225103effcd94565261a073 Mon Sep 17 00:00:00 2001 From: Madeline Kusters Date: Tue, 10 Aug 2021 16:16:41 -0700 Subject: [PATCH 31/47] chore(pr checks): empty commit to trigger PR checks that are stuck From bf5882f8def0676bbfaee7c2ff4fab6bf39df281 Mon Sep 17 00:00:00 2001 From: akuntsch Date: Wed, 11 Aug 2021 11:08:20 +0200 Subject: [PATCH 32/47] fix(core): asset bundling fails for non-existent user (#15313) Currently, when not explicitly passing a user in BundlingOptions, `os.userInfo()` is called as a default fallback. Even though the user is only used and needed when using docker bundling, it is still called when using local bundling. This can be problematic e.g. when running cdk scripts inside a docker container where the user does not exist inside the container (see #15415). Fixes #15415. ---- *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/asset-staging.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/@aws-cdk/core/lib/asset-staging.ts b/packages/@aws-cdk/core/lib/asset-staging.ts index 89f7257ae522a..c948bc377c9a6 100644 --- a/packages/@aws-cdk/core/lib/asset-staging.ts +++ b/packages/@aws-cdk/core/lib/asset-staging.ts @@ -428,16 +428,6 @@ export class AssetStaging extends CoreConstruct { // Chmod the bundleDir to full access. fs.chmodSync(bundleDir, 0o777); - let user: string; - if (options.user) { - user = options.user; - } else { // Default to current user - const userInfo = os.userInfo(); - user = userInfo.uid !== -1 // uid is -1 on Windows - ? `${userInfo.uid}:${userInfo.gid}` - : '1000:1000'; - } - // Always mount input and output dir const volumes = [ { @@ -457,6 +447,16 @@ export class AssetStaging extends CoreConstruct { localBundling = options.local?.tryBundle(bundleDir, options); if (!localBundling) { + let user: string; + if (options.user) { + user = options.user; + } else { // Default to current user + const userInfo = os.userInfo(); + user = userInfo.uid !== -1 // uid is -1 on Windows + ? `${userInfo.uid}:${userInfo.gid}` + : '1000:1000'; + } + options.image.run({ command: options.command, user, From e0d61810ab78f7cab1af53bce82c60790a814f71 Mon Sep 17 00:00:00 2001 From: AWS CDK Automation <43080478+aws-cdk-automation@users.noreply.github.com> Date: Wed, 11 Aug 2021 13:23:25 +0300 Subject: [PATCH 33/47] feat(cfnspec): cloudformation spec v39.9.0 (#15987) Co-authored-by: AWS CDK Team Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- packages/@aws-cdk/cfnspec/CHANGELOG.md | 38 +++++ packages/@aws-cdk/cfnspec/cfn.version | 2 +- ...0_CloudFormationResourceSpecification.json | 161 +++++++++++++++++- 3 files changed, 197 insertions(+), 4 deletions(-) diff --git a/packages/@aws-cdk/cfnspec/CHANGELOG.md b/packages/@aws-cdk/cfnspec/CHANGELOG.md index cbadd0a7eda90..716c917940793 100644 --- a/packages/@aws-cdk/cfnspec/CHANGELOG.md +++ b/packages/@aws-cdk/cfnspec/CHANGELOG.md @@ -1,3 +1,41 @@ +# CloudFormation Resource Specification v39.9.0 + +## New Resource Types + +* AWS::Athena::PreparedStatement + +## Attribute Changes + +* AWS::ApiGateway::Resource ResourceId (__added__) +* AWS::Athena::WorkGroup WorkGroupConfigurationUpdates.EngineVersion.EffectiveEngineVersion (__added__) +* AWS::MWAA::Environment LoggingConfiguration.SchedulerLogs.CloudWatchLogGroupArn (__added__) +* AWS::MWAA::Environment LoggingConfiguration.TaskLogs.CloudWatchLogGroupArn (__added__) +* AWS::MWAA::Environment LoggingConfiguration.WebserverLogs.CloudWatchLogGroupArn (__added__) +* AWS::MWAA::Environment LoggingConfiguration.WorkerLogs.CloudWatchLogGroupArn (__added__) + +## Property Changes + +* AWS::AppSync::GraphQLApi LambdaAuthorizerConfig (__added__) +* AWS::LookoutEquipment::InferenceScheduler ModelName.UpdateType (__changed__) + * Old: Mutable + * New: Immutable +* AWS::LookoutEquipment::InferenceScheduler ServerSideKmsKeyId.UpdateType (__changed__) + * Old: Mutable + * New: Immutable +* AWS::S3::AccessPoint Name (__added__) +* AWS::Synthetics::Canary VisualReference (__added__) + +## Property Type Changes + +* AWS::AppSync::GraphQLApi.LambdaAuthorizerConfig (__added__) +* AWS::SageMaker::Model.RepositoryAuthConfig (__added__) +* AWS::Synthetics::Canary.BaseScreenshot (__added__) +* AWS::Synthetics::Canary.VisualReference (__added__) +* AWS::AppSync::GraphQLApi.AdditionalAuthenticationProvider LambdaAuthorizerConfig (__added__) +* AWS::IoTSiteWise::AssetModel.TumblingWindow Offset (__added__) +* AWS::SageMaker::Model.ImageConfig RepositoryAuthConfig (__added__) + + # CloudFormation Resource Specification v39.8.0 ## New Resource Types diff --git a/packages/@aws-cdk/cfnspec/cfn.version b/packages/@aws-cdk/cfnspec/cfn.version index 212ba4596ef15..ff93cfe146d81 100644 --- a/packages/@aws-cdk/cfnspec/cfn.version +++ b/packages/@aws-cdk/cfnspec/cfn.version @@ -1 +1 @@ -39.8.0 +39.9.0 diff --git a/packages/@aws-cdk/cfnspec/spec-source/000_CloudFormationResourceSpecification.json b/packages/@aws-cdk/cfnspec/spec-source/000_CloudFormationResourceSpecification.json index 5e6a900098e55..2d71e22ab1083 100644 --- a/packages/@aws-cdk/cfnspec/spec-source/000_CloudFormationResourceSpecification.json +++ b/packages/@aws-cdk/cfnspec/spec-source/000_CloudFormationResourceSpecification.json @@ -7114,6 +7114,12 @@ "Required": true, "UpdateType": "Mutable" }, + "LambdaAuthorizerConfig": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-additionalauthenticationprovider.html#cfn-appsync-graphqlapi-additionalauthenticationprovider-lambdaauthorizerconfig", + "Required": false, + "Type": "LambdaAuthorizerConfig", + "UpdateType": "Mutable" + }, "OpenIDConnectConfig": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-additionalauthenticationprovider.html#cfn-appsync-graphqlapi-additionalauthenticationprovider-openidconnectconfig", "Required": false, @@ -7158,6 +7164,29 @@ } } }, + "AWS::AppSync::GraphQLApi.LambdaAuthorizerConfig": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-lambdaauthorizerconfig.html", + "Properties": { + "AuthorizerResultTtlInSeconds": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-lambdaauthorizerconfig.html#cfn-appsync-graphqlapi-lambdaauthorizerconfig-authorizerresultttlinseconds", + "PrimitiveType": "Double", + "Required": false, + "UpdateType": "Mutable" + }, + "AuthorizerUri": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-lambdaauthorizerconfig.html#cfn-appsync-graphqlapi-lambdaauthorizerconfig-authorizeruri", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "IdentityValidationExpression": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-lambdaauthorizerconfig.html#cfn-appsync-graphqlapi-lambdaauthorizerconfig-identityvalidationexpression", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + } + } + }, "AWS::AppSync::GraphQLApi.LogConfig": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-logconfig.html", "Properties": { @@ -35861,6 +35890,12 @@ "PrimitiveType": "String", "Required": true, "UpdateType": "Mutable" + }, + "Offset": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotsitewise-assetmodel-tumblingwindow.html#cfn-iotsitewise-assetmodel-tumblingwindow-offset", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" } } }, @@ -57003,6 +57038,12 @@ "PrimitiveType": "String", "Required": true, "UpdateType": "Immutable" + }, + "RepositoryAuthConfig": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-model-containerdefinition-imageconfig.html#cfn-sagemaker-model-containerdefinition-imageconfig-repositoryauthconfig", + "Required": false, + "Type": "RepositoryAuthConfig", + "UpdateType": "Immutable" } } }, @@ -57028,6 +57069,17 @@ } } }, + "AWS::SageMaker::Model.RepositoryAuthConfig": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-model-containerdefinition-imageconfig-repositoryauthconfig.html", + "Properties": { + "RepositoryCredentialsProviderArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-model-containerdefinition-imageconfig-repositoryauthconfig.html#cfn-sagemaker-model-containerdefinition-imageconfig-repositoryauthconfig-repositorycredentialsproviderarn", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + } + } + }, "AWS::SageMaker::Model.VpcConfig": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-model-vpcconfig.html", "Properties": { @@ -59046,6 +59098,24 @@ } } }, + "AWS::Synthetics::Canary.BaseScreenshot": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-basescreenshot.html", + "Properties": { + "IgnoreCoordinates": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-basescreenshot.html#cfn-synthetics-canary-basescreenshot-ignorecoordinates", + "PrimitiveItemType": "String", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + }, + "ScreenshotName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-basescreenshot.html#cfn-synthetics-canary-basescreenshot-screenshotname", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + } + } + }, "AWS::Synthetics::Canary.Code": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-code.html", "Properties": { @@ -59153,6 +59223,24 @@ } } }, + "AWS::Synthetics::Canary.VisualReference": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-visualreference.html", + "Properties": { + "BaseCanaryRunId": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-visualreference.html#cfn-synthetics-canary-visualreference-basecanaryrunid", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + }, + "BaseScreenshots": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-visualreference.html#cfn-synthetics-canary-visualreference-basescreenshots", + "ItemType": "BaseScreenshot", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + } + } + }, "AWS::Transfer::Server.EndpointDetails": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-transfer-server-endpointdetails.html", "Properties": { @@ -61525,7 +61613,7 @@ } } }, - "ResourceSpecificationVersion": "39.8.0", + "ResourceSpecificationVersion": "39.9.0", "ResourceTypes": { "AWS::ACMPCA::Certificate": { "Attributes": { @@ -62750,6 +62838,11 @@ } }, "AWS::ApiGateway::Resource": { + "Attributes": { + "ResourceId": { + "PrimitiveType": "String" + } + }, "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-resource.html", "Properties": { "ParentId": { @@ -65302,6 +65395,12 @@ "Required": true, "UpdateType": "Mutable" }, + "LambdaAuthorizerConfig": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlapi.html#cfn-appsync-graphqlapi-lambdaauthorizerconfig", + "Required": false, + "Type": "LambdaAuthorizerConfig", + "UpdateType": "Mutable" + }, "LogConfig": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlapi.html#cfn-appsync-graphqlapi-logconfig", "Required": false, @@ -65704,6 +65803,35 @@ } } }, + "AWS::Athena::PreparedStatement": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-athena-preparedstatement.html", + "Properties": { + "Description": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-athena-preparedstatement.html#cfn-athena-preparedstatement-description", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "QueryStatement": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-athena-preparedstatement.html#cfn-athena-preparedstatement-querystatement", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + }, + "StatementName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-athena-preparedstatement.html#cfn-athena-preparedstatement-statementname", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "WorkGroup": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-athena-preparedstatement.html#cfn-athena-preparedstatement-workgroup", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + } + } + }, "AWS::Athena::WorkGroup": { "Attributes": { "CreationTime": { @@ -65711,6 +65839,9 @@ }, "WorkGroupConfiguration.EngineVersion.EffectiveEngineVersion": { "PrimitiveType": "String" + }, + "WorkGroupConfigurationUpdates.EngineVersion.EffectiveEngineVersion": { + "PrimitiveType": "String" } }, "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-athena-workgroup.html", @@ -86872,7 +87003,7 @@ "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lookoutequipment-inferencescheduler.html#cfn-lookoutequipment-inferencescheduler-modelname", "PrimitiveType": "String", "Required": true, - "UpdateType": "Mutable" + "UpdateType": "Immutable" }, "RoleArn": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lookoutequipment-inferencescheduler.html#cfn-lookoutequipment-inferencescheduler-rolearn", @@ -86884,7 +87015,7 @@ "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lookoutequipment-inferencescheduler.html#cfn-lookoutequipment-inferencescheduler-serversidekmskeyid", "PrimitiveType": "String", "Required": false, - "UpdateType": "Mutable" + "UpdateType": "Immutable" }, "Tags": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lookoutequipment-inferencescheduler.html#cfn-lookoutequipment-inferencescheduler-tags", @@ -87072,6 +87203,18 @@ "LoggingConfiguration.DagProcessingLogs.CloudWatchLogGroupArn": { "PrimitiveType": "String" }, + "LoggingConfiguration.SchedulerLogs.CloudWatchLogGroupArn": { + "PrimitiveType": "String" + }, + "LoggingConfiguration.TaskLogs.CloudWatchLogGroupArn": { + "PrimitiveType": "String" + }, + "LoggingConfiguration.WebserverLogs.CloudWatchLogGroupArn": { + "PrimitiveType": "String" + }, + "LoggingConfiguration.WorkerLogs.CloudWatchLogGroupArn": { + "PrimitiveType": "String" + }, "WebserverUrl": { "PrimitiveType": "String" } @@ -94306,6 +94449,12 @@ "Required": true, "UpdateType": "Immutable" }, + "Name": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-accesspoint.html#cfn-s3-accesspoint-name", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Immutable" + }, "Policy": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-accesspoint.html#cfn-s3-accesspoint-policy", "PrimitiveType": "Json", @@ -98539,6 +98688,12 @@ "Required": false, "Type": "VPCConfig", "UpdateType": "Mutable" + }, + "VisualReference": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-synthetics-canary.html#cfn-synthetics-canary-visualreference", + "Required": false, + "Type": "VisualReference", + "UpdateType": "Mutable" } } }, From e4f288931ab566d0c3a09c9b0c6f4528f0748c50 Mon Sep 17 00:00:00 2001 From: max-allan-surevine Date: Wed, 11 Aug 2021 12:04:48 +0100 Subject: [PATCH 34/47] docs: improve documentation on the use of "env" with context lookups (#15983) This requires too much documentation to explain fully here in an error message. Bottom line is : You must set an env. So lets tell people that and not suggest they can sidestep creating env by setting CLI environment variables. Whatever you put in the env is up to the user (whether process.env.AWS_DEFAULT_REGION or process.env.CDK_DEFAULT_REGION or a fixed value, doesn't matter as long as you create an env). Lets give people a link to understand "env" instead. ---- *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/context-provider.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/@aws-cdk/core/lib/context-provider.ts b/packages/@aws-cdk/core/lib/context-provider.ts index 1eb210623558f..526414a9cf790 100644 --- a/packages/@aws-cdk/core/lib/context-provider.ts +++ b/packages/@aws-cdk/core/lib/context-provider.ts @@ -84,9 +84,9 @@ export class ContextProvider { if (Token.isUnresolved(stack.account) || Token.isUnresolved(stack.region)) { throw new Error(`Cannot retrieve value from context provider ${options.provider} since account/region ` + - 'are not specified at the stack level. Either configure "env" with explicit account and region when ' + - 'you define your stack, or use the environment variables "CDK_DEFAULT_ACCOUNT" and "CDK_DEFAULT_REGION" ' + - 'to inherit environment information from the CLI (not recommended for production stacks)'); + 'are not specified at the stack level. Configure "env" with an account and region when ' + + 'you define your stack.' + + 'See https://docs.aws.amazon.com/cdk/latest/guide/environments.html for more details.'); } const { key, props } = this.getKey(scope, options); From 277b25033060118cd9e0407cb2aaae81ffd4bfa4 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Wed, 11 Aug 2021 13:43:55 +0200 Subject: [PATCH 35/47] docs(codepipeline): explain how cross-account CodeCommit works (#15988) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../lib/codecommit/source-action.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/codecommit/source-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/codecommit/source-action.ts index 8708410dfff18..136bf9bba9dc5 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/codecommit/source-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/codecommit/source-action.ts @@ -106,6 +106,15 @@ export interface CodeCommitSourceActionProps extends codepipeline.CommonAwsActio /** * CodePipeline Source that is provided by an AWS CodeCommit repository. + * + * If the CodeCommit repository is in a different account, you must use + * `CodeCommitTrigger.EVENTS` to trigger the pipeline. + * + * (That is because the Pipeline structure normally only has a `RepositoryName` + * field, and that is not enough for the pipeline to locate the repository's + * source account. However, if the pipeline is triggered via an EventBridge + * event, the event itself has the full repository ARN in there, allowing the + * pipeline to locate the repository). */ export class CodeCommitSourceAction extends Action { /** From 9e4f673cbad3b20c3b99a6d8616307b805e70f18 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Wed, 11 Aug 2021 14:24:39 +0200 Subject: [PATCH 36/47] chore(scripts): safety script incorrectly checks `peerDependencies` (#15989) Our script that checks that Yarn doesn't mess up incorrectly checks `yarn.lock` for `peerDependencies`. Given that `peerDependencies` aren't installed directly, this makes no sense. In fact, the build currently fails with: ``` Dependency jest@>=26.6.3 from @aws-cdk/assert not present in yarn.lock. ``` ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- scripts/check-yarn-lock.js | 3 +-- yarn.lock | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/check-yarn-lock.js b/scripts/check-yarn-lock.js index d13e4e08cf64f..8fd59b5a60bc8 100755 --- a/scripts/check-yarn-lock.js +++ b/scripts/check-yarn-lock.js @@ -40,13 +40,12 @@ async function main() { const dependencyId = `${dependencyName}@${dependencyVersion}`; const isLocalDependency = dependencyVersion === '0.0.0' || dependencyVersion === '^0.0.0'; if (!isLocalDependency && !yarnPackages.has(dependencyId)) { - throw new Error(`ERROR! Dependency ${dependencyId} from ${package.name} not present in yarn.lock. Please run yarn update and try again!`); + throw new Error(`ERROR! Dependency ${dependencyId} from ${package.name} not present in yarn.lock. Please run 'yarn install' and try again!`); } } projects.forEach((p) => { Object.entries(p.devDependencies || {}).forEach(([depName, depVersion]) => errorIfNotInYarnLock(p, depName, depVersion)); - Object.entries(p.peerDependencies || {}).forEach(([depName, depVersion]) => errorIfNotInYarnLock(p, depName, depVersion)); Object.entries(p.dependencies || {}).forEach(([depName, depVersion]) => errorIfNotInYarnLock(p, depName, depVersion)); }); } diff --git a/yarn.lock b/yarn.lock index 7e67161d74f5e..66bb214514901 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1628,7 +1628,7 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@^26.0.24": +"@types/jest@^26.0.22", "@types/jest@^26.0.24": version "26.0.24" resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.24.tgz#943d11976b16739185913a1936e0de0c4a7d595a" integrity sha512-E/X5Vib8BWqZNRlDxj9vYXhsDwPYbPINqKF9BsnSoon4RQ0D9moEuLD8txgyypFLH7J4+Lho9Nr/c8H0Fi+17w== From e17c627c3bcf3404ad844c570dc926eb25584cbf Mon Sep 17 00:00:00 2001 From: Nick Lynch Date: Wed, 11 Aug 2021 15:37:24 +0100 Subject: [PATCH 37/47] test(aws-lambda-python): remove hard-coded references to @aws-cdk/aws-lambda (#15994) Remove the hard coded reference to the @aws-cdk/aws-lambda packages from the test, which should fix the issue that prevent building the package as an alpha module in v2. This was previously done in #15921, but I missed these entries in the tests. related #15586 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-lambda-python/test/function.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/@aws-cdk/aws-lambda-python/test/function.test.ts b/packages/@aws-cdk/aws-lambda-python/test/function.test.ts index 0eda2a419e97c..c0636329b2ecc 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/function.test.ts +++ b/packages/@aws-cdk/aws-lambda-python/test/function.test.ts @@ -48,7 +48,7 @@ test('PythonFunction with defaults', () => { }); expect(bundle).toHaveBeenCalledWith(expect.objectContaining({ - entry: expect.stringMatching(/@aws-cdk\/aws-lambda-python\/test\/lambda-handler$/), + entry: expect.stringMatching(/aws-lambda-python\/test\/lambda-handler$/), outputPathSuffix: '.', })); @@ -65,7 +65,7 @@ test('PythonFunction with index in a subdirectory', () => { }); expect(bundle).toHaveBeenCalledWith(expect.objectContaining({ - entry: expect.stringMatching(/@aws-cdk\/aws-lambda-python\/test\/lambda-handler-sub$/), + entry: expect.stringMatching(/aws-lambda-python\/test\/lambda-handler-sub$/), outputPathSuffix: '.', })); @@ -142,4 +142,4 @@ test('allows specifying hash type', () => { S3Key: 'MY_CUSTOM_HASH', }, }); -}); \ No newline at end of file +}); From 2b37e29e824dad799f2794bf4f2f1185cd92928d Mon Sep 17 00:00:00 2001 From: Brian Hubbell <655067+brianhubbell@users.noreply.github.com> Date: Wed, 11 Aug 2021 14:35:51 -0700 Subject: [PATCH 38/47] chore(aws-apigatewayv2): docs spelling correction (#15962) Spelling fixes. ---- *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-apigatewayv2/lib/http/api.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/aws-apigatewayv2/lib/http/api.ts b/packages/@aws-cdk/aws-apigatewayv2/lib/http/api.ts index e4b6ce929eb2a..094c0131872d8 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/lib/http/api.ts +++ b/packages/@aws-cdk/aws-apigatewayv2/lib/http/api.ts @@ -84,7 +84,7 @@ export interface IHttpApi extends IApi { */ export interface HttpApiProps { /** - * Name for the HTTP API resoruce + * Name for the HTTP API resource * @default - id of the HttpApi construct. */ readonly apiName?: string; @@ -209,7 +209,7 @@ export interface CorsPreflightOptions { } /** - * Options for the Route with Integration resoruce + * Options for the Route with Integration resource */ export interface AddRoutesOptions extends BatchHttpRouteOptions { /** From 9ba8387892cb789deb27bacbd7f2a495988304dd Mon Sep 17 00:00:00 2001 From: Ayato Tokubi Date: Wed, 11 Aug 2021 22:14:52 +0000 Subject: [PATCH 39/47] chore(apigatewayv2): fix typo in README (#15950) This PR fix typo in README of `aws-apigatewayv2`. I made PR #15227 and was pointed out typo. According to the PR, `webSocketStage` is correct. ---- *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-apigatewayv2/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-apigatewayv2/README.md b/packages/@aws-cdk/aws-apigatewayv2/README.md index 944e328fc8532..c5dc2318b2d53 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/README.md +++ b/packages/@aws-cdk/aws-apigatewayv2/README.md @@ -316,7 +316,7 @@ To retrieve a websocket URL and a callback URL: ```ts const webSocketURL = webSocketStage.url; // wss://${this.api.apiId}.execute-api.${s.region}.${s.urlSuffix}/${urlPath} -const callbackURL = webSocketURL.callbackUrl; +const callbackURL = webSocketStage.callbackUrl; // https://${this.api.apiId}.execute-api.${s.region}.${s.urlSuffix}/${urlPath} ``` From 2e65e72f6b813bad61daa9eba56af34baae908d2 Mon Sep 17 00:00:00 2001 From: Madeline Kusters <80541297+madeline-k@users.noreply.github.com> Date: Wed, 11 Aug 2021 16:23:38 -0700 Subject: [PATCH 40/47] chore(ec2): explicit feature flags to produce a consistent template during tests (#16008) In v1, the default value of the `@aws-cdk/core:newStyleStackSynthesis` flag is `false`. As a consequence, `Template.fromStack()` generates, by default, a template without the rule and parameter related to bootstrap versions. In v2, the default value of this flag is `true`. So this test fails in the v2 branch. By explicitly setting the flag to `false`, we ensure that the tests passes on both v1 and v2, regardless of the default values. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../aws-ec2/test/client-vpn-authorization-rule.test.ts | 9 +++++++-- packages/@aws-cdk/aws-ec2/test/client-vpn-route.test.ts | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/@aws-cdk/aws-ec2/test/client-vpn-authorization-rule.test.ts b/packages/@aws-cdk/aws-ec2/test/client-vpn-authorization-rule.test.ts index 6c8911d90a06d..5390eb43adb85 100644 --- a/packages/@aws-cdk/aws-ec2/test/client-vpn-authorization-rule.test.ts +++ b/packages/@aws-cdk/aws-ec2/test/client-vpn-authorization-rule.test.ts @@ -1,11 +1,16 @@ import '@aws-cdk/assert-internal/jest'; -import { Stack } from '@aws-cdk/core'; +import { App, Stack } from '@aws-cdk/core'; import { Connections, IClientVpnEndpoint } from '../lib'; import { ClientVpnAuthorizationRule } from '../lib/client-vpn-authorization-rule'; let stack: Stack; beforeEach(() => { - stack = new Stack(); + const app = new App({ + context: { + '@aws-cdk/core:newStyleStackSynthesis': false, + }, + }); + stack = new Stack(app); }); describe('ClientVpnAuthorizationRule constructor', () => { diff --git a/packages/@aws-cdk/aws-ec2/test/client-vpn-route.test.ts b/packages/@aws-cdk/aws-ec2/test/client-vpn-route.test.ts index 42f094ab4bb9e..fde37f49335ae 100644 --- a/packages/@aws-cdk/aws-ec2/test/client-vpn-route.test.ts +++ b/packages/@aws-cdk/aws-ec2/test/client-vpn-route.test.ts @@ -1,6 +1,6 @@ import '@aws-cdk/assert-internal/jest'; import { SamlMetadataDocument, SamlProvider } from '@aws-cdk/aws-iam'; -import { Stack } from '@aws-cdk/core'; +import { App, Stack } from '@aws-cdk/core'; import * as ec2 from '../lib'; import { ClientVpnRoute, @@ -11,7 +11,12 @@ import { let stack: Stack; let vpc: ec2.IVpc; beforeEach(() => { - stack = new Stack(); + const app = new App({ + context: { + '@aws-cdk/core:newStyleStackSynthesis': false, + }, + }); + stack = new Stack(app); vpc = new ec2.Vpc(stack, 'Vpc'); }); From 111a3c514b243ff18ee6e50a3c039b4190e557ef Mon Sep 17 00:00:00 2001 From: Ben Limmer Date: Thu, 12 Aug 2021 03:16:33 -0600 Subject: [PATCH 41/47] chore(pipelines): improve CodeBuildStep.project error message (#15977) This PR improves the error message when trying to access a CodeBuildStep's `project` property before the pipeline is built. It now matches the verbiage used in the CodePipeline `synthProject` getter: https://github.com/aws/aws-cdk/blob/965d27ffb106763c7562d0b0a333827368ea434e/packages/%40aws-cdk/pipelines/lib/codepipeline/codepipeline.ts#L292-L297 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/pipelines/lib/codepipeline/codebuild-step.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/pipelines/lib/codepipeline/codebuild-step.ts b/packages/@aws-cdk/pipelines/lib/codepipeline/codebuild-step.ts index 1454d34a167c3..3047b43c5c755 100644 --- a/packages/@aws-cdk/pipelines/lib/codepipeline/codebuild-step.ts +++ b/packages/@aws-cdk/pipelines/lib/codepipeline/codebuild-step.ts @@ -166,7 +166,7 @@ export class CodeBuildStep extends ShellStep { */ public get project(): codebuild.IProject { if (!this._project) { - throw new Error('Project becomes available after the pipeline has been built'); + throw new Error('Call pipeline.buildPipeline() before reading this property'); } return this._project; } From 8b70badebccc1be93266533df43e39ac0e3e52a8 Mon Sep 17 00:00:00 2001 From: Niranjan Jayakar Date: Thu, 12 Aug 2021 12:46:34 +0100 Subject: [PATCH 42/47] fix(assert): matchTemplate with superset fails when additional parameters are present (#16015) When `matchTemplate()` is used with the `SUPERSET` match style, it does not honour new Parameters and Outputs in the CloudFormation template. The fix is to only fail only when expected Parameters and Outputs are missing or modified. fixes #15946 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../lib/assertions/match-template.ts | 5 +- .../assert-internal/test/cloud-artifact.ts | 29 ++++ .../assert-internal/test/have-output.test.ts | 26 +--- .../test/have-resource.test.ts | 48 ++---- .../test/match-template.test.ts | 144 ++++++++++++++++++ 5 files changed, 188 insertions(+), 64 deletions(-) create mode 100644 packages/@aws-cdk/assert-internal/test/cloud-artifact.ts create mode 100644 packages/@aws-cdk/assert-internal/test/match-template.test.ts diff --git a/packages/@aws-cdk/assert-internal/lib/assertions/match-template.ts b/packages/@aws-cdk/assert-internal/lib/assertions/match-template.ts index e668466d12416..b3787446f1aef 100644 --- a/packages/@aws-cdk/assert-internal/lib/assertions/match-template.ts +++ b/packages/@aws-cdk/assert-internal/lib/assertions/match-template.ts @@ -78,16 +78,15 @@ class StackMatchesTemplateAssertion extends Assertion { } for (const change of Object.values(diff.parameters.changes)) { - if (change.isAddition) { return false; } + if (!change.isAddition) { return false; } } for (const change of Object.values(diff.outputs.changes)) { - if (change.isAddition || change.isUpdate) { return false; } + if (!change.isAddition) { return false; } } return true; } - throw new Error(`Unsupported match style: ${this.matchStyle}`); } public get description(): string { diff --git a/packages/@aws-cdk/assert-internal/test/cloud-artifact.ts b/packages/@aws-cdk/assert-internal/test/cloud-artifact.ts new file mode 100644 index 0000000000000..3cdacf6af5134 --- /dev/null +++ b/packages/@aws-cdk/assert-internal/test/cloud-artifact.ts @@ -0,0 +1,29 @@ +import * as fs from 'fs'; +import * as path from 'path'; +import * as cxschema from '@aws-cdk/cloud-assembly-schema'; +import * as cxapi from '@aws-cdk/cx-api'; + +export function mkStack(template: any): cxapi.CloudFormationStackArtifact { + const assembly = new cxapi.CloudAssemblyBuilder(); + assembly.addArtifact('test', { + type: cxschema.ArtifactType.AWS_CLOUDFORMATION_STACK, + environment: cxapi.EnvironmentUtils.format('123456789012', 'bermuda-triangle-1'), + properties: { + templateFile: 'template.json', + }, + }); + + fs.writeFileSync(path.join(assembly.outdir, 'template.json'), JSON.stringify(template)); + return assembly.buildAssembly().getStackByName('test'); +} + +export function mkResource(props: any): cxapi.CloudFormationStackArtifact { + return mkStack({ + Resources: { + SomeResource: { + Type: 'Some::Resource', + Properties: props, + }, + }, + }); +} \ No newline at end of file diff --git a/packages/@aws-cdk/assert-internal/test/have-output.test.ts b/packages/@aws-cdk/assert-internal/test/have-output.test.ts index a92664f4875a5..ffe6212588748 100644 --- a/packages/@aws-cdk/assert-internal/test/have-output.test.ts +++ b/packages/@aws-cdk/assert-internal/test/have-output.test.ts @@ -1,7 +1,6 @@ -import { unlink, writeFileSync } from 'fs'; -import { join } from 'path'; -import * as cxschema from '@aws-cdk/cloud-assembly-schema'; +import { unlink } from 'fs'; import * as cxapi from '@aws-cdk/cx-api'; +import { mkStack } from './cloud-artifact'; import '../jest'; let templateFilePath: string; @@ -180,23 +179,4 @@ afterEach(done => { } else { done(); } -}); - -function mkStack(template: any): cxapi.CloudFormationStackArtifact { - const templateFileName = 'test-have-output-template.json'; - const stackName = 'test-have-output'; - const assembly = new cxapi.CloudAssemblyBuilder(); - - assembly.addArtifact(stackName, { - type: cxschema.ArtifactType.AWS_CLOUDFORMATION_STACK, - environment: cxapi.EnvironmentUtils.format('123456789012', 'bermuda-triangle-1'), - properties: { - templateFile: templateFileName, - }, - }); - - templateFilePath = join(assembly.outdir, templateFileName); - writeFileSync(templateFilePath, JSON.stringify(template)); - - return assembly.buildAssembly().getStackByName(stackName); -} +}); \ No newline at end of file diff --git a/packages/@aws-cdk/assert-internal/test/have-resource.test.ts b/packages/@aws-cdk/assert-internal/test/have-resource.test.ts index 7772e5f7d193f..324e221114df0 100644 --- a/packages/@aws-cdk/assert-internal/test/have-resource.test.ts +++ b/packages/@aws-cdk/assert-internal/test/have-resource.test.ts @@ -1,8 +1,5 @@ -import { writeFileSync } from 'fs'; -import { join } from 'path'; -import * as cxschema from '@aws-cdk/cloud-assembly-schema'; -import * as cxapi from '@aws-cdk/cx-api'; import { ABSENT, arrayWith, exactValue, expect as cdkExpect, haveResource, haveResourceLike, Capture, anything } from '../lib/index'; +import { mkResource, mkStack } from './cloud-artifact'; test('support resource with no properties', () => { const synthStack = mkStack({ @@ -86,7 +83,7 @@ test('haveResource allows to opt in value extension', () => { describe('property absence', () => { test('pass on absence', () => { - const synthStack = mkSomeResource({ + const synthStack = mkResource({ Prop: 'somevalue', }); @@ -96,7 +93,7 @@ describe('property absence', () => { }); test('fail on presence', () => { - const synthStack = mkSomeResource({ + const synthStack = mkResource({ PropA: 3, }); @@ -108,7 +105,7 @@ describe('property absence', () => { }); test('pass on deep absence', () => { - const synthStack = mkSomeResource({ + const synthStack = mkResource({ Deep: { Prop: 'somevalue', }, @@ -123,7 +120,7 @@ describe('property absence', () => { }); test('fail on deep presence', () => { - const synthStack = mkSomeResource({ + const synthStack = mkResource({ Deep: { Prop: 'somevalue', }, @@ -139,7 +136,7 @@ describe('property absence', () => { }); test('can use matcher to test for list element', () => { - const synthStack = mkSomeResource({ + const synthStack = mkResource({ List: [ { Prop: 'distraction' }, { Prop: 'goal' }, @@ -160,7 +157,7 @@ describe('property absence', () => { }); test('arrayContaining must match all elements in any order', () => { - const synthStack = mkSomeResource({ + const synthStack = mkResource({ List: ['a', 'b'], }); @@ -178,7 +175,7 @@ describe('property absence', () => { }); test('exactValue escapes from deep fuzzy matching', () => { - const synthStack = mkSomeResource({ + const synthStack = mkResource({ Deep: { PropA: 'A', PropB: 'B', @@ -216,7 +213,7 @@ describe('property absence', () => { * it. */ test('objectContainingDeep has deep effect through lists', () => { - const synthStack = mkSomeResource({ + const synthStack = mkResource({ List: [ { PropA: 'A', @@ -240,7 +237,7 @@ describe('property absence', () => { }); test('test capturing', () => { - const synthStack = mkSomeResource({ + const synthStack = mkResource({ Prop: 'somevalue', }); @@ -252,28 +249,3 @@ describe('property absence', () => { expect(propValue.capturedValue).toEqual('somevalue'); }); }); - -function mkStack(template: any): cxapi.CloudFormationStackArtifact { - const assembly = new cxapi.CloudAssemblyBuilder(); - assembly.addArtifact('test', { - type: cxschema.ArtifactType.AWS_CLOUDFORMATION_STACK, - environment: cxapi.EnvironmentUtils.format('123456789', 'us-west-2'), - properties: { - templateFile: 'template.json', - }, - }); - - writeFileSync(join(assembly.outdir, 'template.json'), JSON.stringify(template)); - return assembly.buildAssembly().getStackByName('test'); -} - -function mkSomeResource(props: any): cxapi.CloudFormationStackArtifact { - return mkStack({ - Resources: { - SomeResource: { - Type: 'Some::Resource', - Properties: props, - }, - }, - }); -} \ No newline at end of file diff --git a/packages/@aws-cdk/assert-internal/test/match-template.test.ts b/packages/@aws-cdk/assert-internal/test/match-template.test.ts new file mode 100644 index 0000000000000..dc3a4bfe6fb26 --- /dev/null +++ b/packages/@aws-cdk/assert-internal/test/match-template.test.ts @@ -0,0 +1,144 @@ +import { MatchStyle } from '../lib'; +import { mkStack } from './cloud-artifact'; +import '../jest'; + +describe('matchTemplate', () => { + describe('exact match', () => { + test('match on resources', () => { + const stack = mkStack({ + Resources: { + FooResource: { Type: 'Foo::Bar' }, + }, + }); + + expect(stack).toMatchTemplate({ + Resources: { + FooResource: { Type: 'Foo::Bar' }, + }, + }, MatchStyle.EXACT); + + expect(stack).not.toMatchTemplate({ + Resources: { + FooResource: { Type: 'Foo::Baz' }, + }, + }, MatchStyle.EXACT); + }); + + test('match on parameters', () => { + const stack = mkStack({ + Parameters: { + FooParameter: { Type: 'String' }, + }, + }); + expect(stack).toMatchTemplate({ + Parameters: { + FooParameter: { Type: 'String' }, + }, + }, MatchStyle.EXACT); + + expect(stack).not.toMatchTemplate({ + Parameters: { + BarParameter: { Type: 'String' }, + }, + }, MatchStyle.EXACT); + }); + + test('match on outputs', () => { + const stack = mkStack({ + Outputs: { + FooOutput: { Value: 'Foo' }, + }, + }); + + expect(stack).toMatchTemplate({ + Outputs: { + FooOutput: { Value: 'Foo' }, + }, + }, MatchStyle.EXACT); + + expect(stack).not.toMatchTemplate({ + Outputs: { + BarOutput: { Value: 'Bar' }, + }, + }, MatchStyle.EXACT); + + expect(stack).not.toMatchTemplate({ + Outputs: { + FooOutput: { Value: 'Bar' }, + }, + }, MatchStyle.EXACT); + }); + }); + + describe('superset match', () => { + test('match on resources', () => { + const stack = mkStack({ + Resources: { + FooResource: { + Type: 'Foo::Bar', + }, + BazResource: { + Type: 'Foo::Baz', + }, + }, + }); + expect(stack).toMatchTemplate({ + Resources: { + FooResource: { + Type: 'Foo::Bar', + }, + }, + }, MatchStyle.SUPERSET); + }); + + test('match on parameters', () => { + const stack = mkStack({ + Parameters: { + FooParameter: { Type: 'String' }, + BarParameter: { Type: 'String' }, + }, + }); + expect(stack).toMatchTemplate({ + Parameters: { + FooParameter: { Type: 'String' }, + }, + }, MatchStyle.SUPERSET); + + expect(stack).not.toMatchTemplate({ + Parameters: { + FooParameter: { Type: 'String' }, + BarParameter: { Type: 'Number' }, + }, + }, MatchStyle.SUPERSET); + }); + + test('match on outputs', () => { + const stack = mkStack({ + Outputs: { + FooOutput: { Value: 'Foo' }, + BarOutput: { Value: 'Bar' }, + }, + }); + + expect(stack).toMatchTemplate({ + Outputs: { + FooOutput: { Value: 'Foo' }, + }, + }, MatchStyle.SUPERSET); + + expect(stack).not.toMatchTemplate({ + Outputs: { + FooOutput: { Value: 'Foo' }, + BarOutput: { Value: 'Baz' }, + }, + }, MatchStyle.SUPERSET); + + expect(stack).not.toMatchTemplate({ + Outputs: { + FooOutput: { Value: 'Bar' }, + BazOutput: { Value: 'Bar' }, + }, + }, MatchStyle.SUPERSET); + }); + }); +}); \ No newline at end of file From 97fc29032c05edb7914c48efee0124be0126a5c4 Mon Sep 17 00:00:00 2001 From: Julian Michel Date: Thu, 12 Aug 2021 14:29:42 +0200 Subject: [PATCH 43/47] feat(aws-apigateway): import existing usage plan (#15771) New method `UsagePlan.fromUsagePlanId()` that allows to import an existing usage plan using its id. Closes #12677. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-apigateway/README.md | 6 ++ .../@aws-cdk/aws-apigateway/lib/usage-plan.ts | 96 ++++++++++++++----- .../integ.usage-plan.sharing.expected.json | 41 ++++++++ .../test/integ.usage-plan.sharing.ts | 37 +++++++ .../aws-apigateway/test/usage-plan.test.ts | 20 ++++ 5 files changed, 176 insertions(+), 24 deletions(-) create mode 100644 packages/@aws-cdk/aws-apigateway/test/integ.usage-plan.sharing.expected.json create mode 100644 packages/@aws-cdk/aws-apigateway/test/integ.usage-plan.sharing.ts diff --git a/packages/@aws-cdk/aws-apigateway/README.md b/packages/@aws-cdk/aws-apigateway/README.md index 9e33ef2125810..620b728b91435 100644 --- a/packages/@aws-cdk/aws-apigateway/README.md +++ b/packages/@aws-cdk/aws-apigateway/README.md @@ -212,6 +212,12 @@ plan.addApiStage({ }); ``` +Existing usage plans can be imported into a CDK app using its id. + +```ts +const importedUsagePlan = UsagePlan.fromUsagePlanId(stack, 'imported-usage-plan', ''); +``` + The name and value of the API Key can be specified at creation; if not provided, a name and value will be automatically generated by API Gateway. diff --git a/packages/@aws-cdk/aws-apigateway/lib/usage-plan.ts b/packages/@aws-cdk/aws-apigateway/lib/usage-plan.ts index 82f45bc538db6..4db28eb936e80 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/usage-plan.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/usage-plan.ts @@ -1,4 +1,4 @@ -import { FeatureFlags, Lazy, Names, Resource, Token } from '@aws-cdk/core'; +import { FeatureFlags, IResource, Lazy, Names, Resource, Token } from '@aws-cdk/core'; import { APIGATEWAY_USAGEPLANKEY_ORDERINSENSITIVE_ID } from '@aws-cdk/cx-api'; import { Construct } from 'constructs'; import { IApiKey } from './api-key'; @@ -156,35 +156,32 @@ export interface AddApiKeyOptions { readonly overrideLogicalId?: string; } -export class UsagePlan extends Resource { +/** + * A UsagePlan, either managed by this CDK app, or imported. + */ +export interface IUsagePlan extends IResource { /** + * Id of the usage plan * @attribute */ - public readonly usagePlanId: string; - - private readonly apiStages = new Array(); + readonly usagePlanId: string; - constructor(scope: Construct, id: string, props: UsagePlanProps = { }) { - super(scope, id); - let resource: CfnUsagePlan; - - resource = new CfnUsagePlan(this, 'Resource', { - apiStages: Lazy.any({ produce: () => this.renderApiStages(this.apiStages) }), - description: props.description, - quota: this.renderQuota(props), - throttle: this.renderThrottle(props.throttle), - usagePlanName: props.name, - }); - - this.apiStages.push(...(props.apiStages || [])); + /** + * Adds an ApiKey. + * + * @param apiKey the api key to associate with this usage plan + * @param options options that control the behaviour of this method + */ + addApiKey(apiKey: IApiKey, options?: AddApiKeyOptions): void; - this.usagePlanId = resource.ref; +} - // Add ApiKey when - if (props.apiKey) { - this.addApiKey(props.apiKey); - } - } +abstract class UsagePlanBase extends Resource implements IUsagePlan { + /** + * Id of the usage plan + * @attribute + */ + public abstract readonly usagePlanId: string; /** * Adds an ApiKey. @@ -213,6 +210,57 @@ export class UsagePlan extends Resource { } } +} + +export class UsagePlan extends UsagePlanBase { + + /** + * Import an externally defined usage plan using its ARN. + * + * @param scope the construct that will "own" the imported usage plan. + * @param id the id of the imported usage plan in the construct tree. + * @param usagePlanId the id of an existing usage plan. + */ + public static fromUsagePlanId(scope: Construct, id: string, usagePlanId: string): IUsagePlan { + class Import extends UsagePlanBase { + public readonly usagePlanId = usagePlanId; + + constructor() { + super(scope, id); + } + } + return new Import(); + } + + /** + * @attribute + */ + public readonly usagePlanId: string; + + private readonly apiStages = new Array(); + + constructor(scope: Construct, id: string, props: UsagePlanProps = { }) { + super(scope, id); + let resource: CfnUsagePlan; + + resource = new CfnUsagePlan(this, 'Resource', { + apiStages: Lazy.any({ produce: () => this.renderApiStages(this.apiStages) }), + description: props.description, + quota: this.renderQuota(props), + throttle: this.renderThrottle(props.throttle), + usagePlanName: props.name, + }); + + this.apiStages.push(...(props.apiStages || [])); + + this.usagePlanId = resource.ref; + + // Add ApiKey when + if (props.apiKey) { + this.addApiKey(props.apiKey); + } + } + /** * Adds an apiStage. * @param apiStage diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.usage-plan.sharing.expected.json b/packages/@aws-cdk/aws-apigateway/test/integ.usage-plan.sharing.expected.json new file mode 100644 index 0000000000000..9e663c4a1f2c8 --- /dev/null +++ b/packages/@aws-cdk/aws-apigateway/test/integ.usage-plan.sharing.expected.json @@ -0,0 +1,41 @@ +[ + { + "Resources": { + "myusageplan4B391740": { + "Type": "AWS::ApiGateway::UsagePlan" + } + }, + "Outputs": { + "ExportsOutputRefmyusageplan4B391740F6B819BA": { + "Value": { + "Ref": "myusageplan4B391740" + }, + "Export": { + "Name": "test-apigateway-usageplan-create:ExportsOutputRefmyusageplan4B391740F6B819BA" + } + } + } + }, + { + "Resources": { + "myusageplanUsagePlanKeyResourcetestapigatewayusageplanimportmyapikey14CF31667CCB4183": { + "Type": "AWS::ApiGateway::UsagePlanKey", + "Properties": { + "KeyId": { + "Ref": "myapikey5C116C09" + }, + "KeyType": "API_KEY", + "UsagePlanId": { + "Fn::ImportValue": "test-apigateway-usageplan-create:ExportsOutputRefmyusageplan4B391740F6B819BA" + } + } + }, + "myapikey5C116C09": { + "Type": "AWS::ApiGateway::ApiKey", + "Properties": { + "Enabled": true + } + } + } + } +] \ No newline at end of file diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.usage-plan.sharing.ts b/packages/@aws-cdk/aws-apigateway/test/integ.usage-plan.sharing.ts new file mode 100644 index 0000000000000..58ffe84234367 --- /dev/null +++ b/packages/@aws-cdk/aws-apigateway/test/integ.usage-plan.sharing.ts @@ -0,0 +1,37 @@ +/// !cdk-integ * +import * as cdk from '@aws-cdk/core'; +import * as apigateway from '../lib'; +import { IUsagePlan } from '../lib'; + +class Create extends cdk.Stack { + public usagePlan: IUsagePlan; + + constructor(scope: cdk.App, id: string) { + super(scope, id); + + this.usagePlan = new apigateway.UsagePlan(this, 'myusageplan'); + } +} + +interface ImportStackProps extends cdk.StackProps { + usagePlan: apigateway.IUsagePlan; +} + +class Import extends cdk.Stack { + constructor(scope: cdk.App, id: string, props: ImportStackProps) { + super(scope, id); + + const usageplan = apigateway.UsagePlan.fromUsagePlanId(this, 'myusageplan', props.usagePlan.usagePlanId); + const apikey = new apigateway.ApiKey(this, 'myapikey'); + usageplan.addApiKey(apikey); + } +} + +const app = new cdk.App(); + +const test = new Create(app, 'test-apigateway-usageplan-create'); +new Import(app, 'test-apigateway-usageplan-import', { + usagePlan: test.usagePlan, +}); + +app.synth(); 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 88df6f2a04506..2cb6e4ed48ed2 100644 --- a/packages/@aws-cdk/aws-apigateway/test/usage-plan.test.ts +++ b/packages/@aws-cdk/aws-apigateway/test/usage-plan.test.ts @@ -176,6 +176,26 @@ describe('usage plan', () => { }, ResourcePart.Properties); }); + + test('imported', () => { + // GIVEN + const stack = new cdk.Stack(); + const usagePlan: apigateway.IUsagePlan = apigateway.UsagePlan.fromUsagePlanId(stack, 'my-usage-plan', 'imported-id'); + const apiKey: apigateway.ApiKey = new apigateway.ApiKey(stack, 'my-api-key'); + + // WHEN + usagePlan.addApiKey(apiKey); + + // THEN + expect(stack).toHaveResource('AWS::ApiGateway::UsagePlanKey', { + KeyId: { + Ref: 'myapikey1B052F70', + }, + KeyType: 'API_KEY', + UsagePlanId: 'imported-id', + }, ResourcePart.Properties); + }); + test('multiple keys', () => { // GIVEN const stack = new cdk.Stack(); From 400a59d19ee63fbd9318da34760b4ed8c9ba99b9 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Thu, 12 Aug 2021 15:56:12 +0200 Subject: [PATCH 44/47] fix(pipelines): repos with dashes cannot be used as additionalInputs (#16017) Cause: dashes are valid in *artifact names* in CodePipeline, but are *not* valid in *secondary source names* in CodeBuild. Do a sanitization to the intersection of requirements between CodePipeline and CodeBuild. Fixes #15753. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../lib/codepipeline/_codebuild-factory.ts | 4 +- .../lib/codepipeline/artifact-map.ts | 23 +++++++++- .../lib/codepipeline/codepipeline.ts | 2 +- .../codepipeline/codepipeline-sources.test.ts | 42 ++++++++++++++++++- .../pipelines/test/compliance/synths.test.ts | 4 +- .../integ.newpipeline-with-vpc.expected.json | 4 +- .../test/integ.newpipeline.expected.json | 4 +- 7 files changed, 70 insertions(+), 13 deletions(-) diff --git a/packages/@aws-cdk/pipelines/lib/codepipeline/_codebuild-factory.ts b/packages/@aws-cdk/pipelines/lib/codepipeline/_codebuild-factory.ts index c4f2eb41ab3fd..ac125aee29f0d 100644 --- a/packages/@aws-cdk/pipelines/lib/codepipeline/_codebuild-factory.ts +++ b/packages/@aws-cdk/pipelines/lib/codepipeline/_codebuild-factory.ts @@ -326,12 +326,12 @@ function generateInputArtifactLinkCommands(artifacts: ArtifactMap, inputs: FileS const fragments = []; if (!['.', '..'].includes(path.dirname(input.directory))) { - fragments.push(`mkdir -p "${input.directory}"`); + fragments.push(`mkdir -p -- "${input.directory}"`); } const artifact = artifacts.toCodePipeline(input.fileSet); - fragments.push(`ln -s "$CODEBUILD_SRC_DIR_${artifact.artifactName}" "${input.directory}"`); + fragments.push(`ln -s -- "$CODEBUILD_SRC_DIR_${artifact.artifactName}" "${input.directory}"`); return fragments.join(' && '); }); diff --git a/packages/@aws-cdk/pipelines/lib/codepipeline/artifact-map.ts b/packages/@aws-cdk/pipelines/lib/codepipeline/artifact-map.ts index 4ec4b086815c7..2d3383bb469bf 100644 --- a/packages/@aws-cdk/pipelines/lib/codepipeline/artifact-map.ts +++ b/packages/@aws-cdk/pipelines/lib/codepipeline/artifact-map.ts @@ -1,3 +1,4 @@ +import * as crypto from 'crypto'; import * as cp from '@aws-cdk/aws-codepipeline'; import { FileSet } from '../blueprint'; import { PipelineGraph } from '../helpers-internal'; @@ -38,9 +39,27 @@ export class ArtifactMap { } } +/** + * Sanitize a string to be a valid artifact name + * + * This must comport to both the rules of artifacts in CodePipeline, as well + * as the names of Source Identifiers in CodeBuild. + * + * Artifact Name limits aren't documented. + * + * Source Identifier limits are documented here: + * https://docs.aws.amazon.com/codebuild/latest/APIReference/API_ProjectSource.html#CodeBuild-Type-ProjectSource-sourceIdentifier + */ function sanitizeArtifactName(x: string): string { - // FIXME: Does this REALLY not allow '.'? The docs don't mention it, but action names etc. do! - return x.replace(/[^A-Za-z0-9@\-_]/g, '_'); + let sani = x.replace(/[^A-Za-z0-9_]/g, '_'); // Charset requirement is imposed by CodeBuild + const maxLength = 100; // Max length of 100 is imposed by CodePipeline library + + if (sani.length > maxLength) { + const fingerprint = crypto.createHash('sha256').update(sani).digest('hex').substr(0, 8); + sani = sani.substr(0, maxLength - fingerprint.length) + fingerprint; + } + + return sani; } /** diff --git a/packages/@aws-cdk/pipelines/lib/codepipeline/codepipeline.ts b/packages/@aws-cdk/pipelines/lib/codepipeline/codepipeline.ts index 27a2b15509532..7b1d0d87d9c22 100644 --- a/packages/@aws-cdk/pipelines/lib/codepipeline/codepipeline.ts +++ b/packages/@aws-cdk/pipelines/lib/codepipeline/codepipeline.ts @@ -830,7 +830,7 @@ enum CodeBuildProjectType { function actionName(node: GraphNode, parent: GraphNode) { const names = node.ancestorPath(parent).map(n => n.id); - return names.map(sanitizeName).join('.'); + return names.map(sanitizeName).join('.').substr(0, 100); // Cannot exceed 100 chars } function sanitizeName(x: string): string { diff --git a/packages/@aws-cdk/pipelines/test/codepipeline/codepipeline-sources.test.ts b/packages/@aws-cdk/pipelines/test/codepipeline/codepipeline-sources.test.ts index 72553c38262d3..84aef10bb171c 100644 --- a/packages/@aws-cdk/pipelines/test/codepipeline/codepipeline-sources.test.ts +++ b/packages/@aws-cdk/pipelines/test/codepipeline/codepipeline-sources.test.ts @@ -1,4 +1,4 @@ -import { anything, arrayWith, objectLike } from '@aws-cdk/assert-internal'; +import { anything, arrayWith, Capture, objectLike } from '@aws-cdk/assert-internal'; import '@aws-cdk/assert-internal/jest'; import * as ccommit from '@aws-cdk/aws-codecommit'; import { CodeCommitTrigger, GitHubTrigger } from '@aws-cdk/aws-codepipeline-actions'; @@ -140,5 +140,43 @@ test('GitHub source does not accept unresolved identifiers', () => { }).toThrow(/Step id cannot be unresolved/); }); +test('Dashes in repo names are removed from artifact names', () => { + new ModernTestGitHubNpmPipeline(pipelineStack, 'Pipeline', { + input: cdkp.CodePipelineSource.gitHub('owner/my-repo', 'main'), + }); + + expect(pipelineStack).toHaveResourceLike('AWS::CodePipeline::Pipeline', { + Stages: arrayWith({ + Name: 'Source', + Actions: [ + objectLike({ + OutputArtifacts: [ + { Name: 'owner_my_repo_Source' }, + ], + }), + ], + }), + }); +}); + +test('artifact names are never longer than 128 characters', () => { + new ModernTestGitHubNpmPipeline(pipelineStack, 'Pipeline', { + input: cdkp.CodePipelineSource.gitHub('owner/' + 'my-repo'.repeat(100), 'main'), + }); + + const artifactId = Capture.aString(); + expect(pipelineStack).toHaveResourceLike('AWS::CodePipeline::Pipeline', { + Stages: arrayWith({ + Name: 'Source', + Actions: [ + objectLike({ + OutputArtifacts: [ + { Name: artifactId.capture() }, + ], + }), + ], + }), + }); -// a-z0-9.@-_ \ No newline at end of file + expect(artifactId.capturedValue.length).toBeLessThanOrEqual(128); +}); \ No newline at end of file diff --git a/packages/@aws-cdk/pipelines/test/compliance/synths.test.ts b/packages/@aws-cdk/pipelines/test/compliance/synths.test.ts index 247cbd50974e0..58bae441ee156 100644 --- a/packages/@aws-cdk/pipelines/test/compliance/synths.test.ts +++ b/packages/@aws-cdk/pipelines/test/compliance/synths.test.ts @@ -948,8 +948,8 @@ behavior('Multiple input sources in side-by-side directories', (suite) => { phases: { install: { commands: [ - 'ln -s "$CODEBUILD_SRC_DIR_foo_bar_Source" "../sibling"', - 'ln -s "$CODEBUILD_SRC_DIR_Prebuild_Output" "sub"', + 'ln -s -- "$CODEBUILD_SRC_DIR_foo_bar_Source" "../sibling"', + 'ln -s -- "$CODEBUILD_SRC_DIR_Prebuild_Output" "sub"', ], }, build: { diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-vpc.expected.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-vpc.expected.json index 7a937f57d6a8e..e0075942e6069 100644 --- a/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-vpc.expected.json +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline-with-vpc.expected.json @@ -766,7 +766,7 @@ "Name": "rix0rrr_cdk-pipelines-demo", "OutputArtifacts": [ { - "Name": "rix0rrr_cdk-pipelines-demo_Source" + "Name": "rix0rrr_cdk_pipelines_demo_Source" } ], "RunOrder": 1 @@ -791,7 +791,7 @@ }, "InputArtifacts": [ { - "Name": "rix0rrr_cdk-pipelines-demo_Source" + "Name": "rix0rrr_cdk_pipelines_demo_Source" } ], "Name": "Synth", diff --git a/packages/@aws-cdk/pipelines/test/integ.newpipeline.expected.json b/packages/@aws-cdk/pipelines/test/integ.newpipeline.expected.json index 96ffa58af1c62..07e65b9bd643f 100644 --- a/packages/@aws-cdk/pipelines/test/integ.newpipeline.expected.json +++ b/packages/@aws-cdk/pipelines/test/integ.newpipeline.expected.json @@ -232,7 +232,7 @@ "Name": "rix0rrr_cdk-pipelines-demo", "OutputArtifacts": [ { - "Name": "rix0rrr_cdk-pipelines-demo_Source" + "Name": "rix0rrr_cdk_pipelines_demo_Source" } ], "RunOrder": 1 @@ -257,7 +257,7 @@ }, "InputArtifacts": [ { - "Name": "rix0rrr_cdk-pipelines-demo_Source" + "Name": "rix0rrr_cdk_pipelines_demo_Source" } ], "Name": "Synth", From 34edd5b18d7266fa807ff42c03190f105fe1e217 Mon Sep 17 00:00:00 2001 From: Nico Tonnhofer Date: Thu, 12 Aug 2021 16:54:03 +0200 Subject: [PATCH 45/47] chore(lambda-python): strip out deprecated symbols (#15958) While other commits already remove most deprecated symbols this was left. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-lambda-python/lib/bundling.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-lambda-python/lib/bundling.ts b/packages/@aws-cdk/aws-lambda-python/lib/bundling.ts index 5a3228a78fef7..0c2b4bf624786 100644 --- a/packages/@aws-cdk/aws-lambda-python/lib/bundling.ts +++ b/packages/@aws-cdk/aws-lambda-python/lib/bundling.ts @@ -100,7 +100,7 @@ export function bundle(options: BundlingOptions): lambda.Code { const image = cdk.DockerImage.fromBuild(stagedir, { buildArgs: { - IMAGE: runtime.bundlingDockerImage.image, + IMAGE: runtime.bundlingImage.image, }, file: dockerfile, }); From ab228a648fa08e8189c010d475426f1ff003ddf7 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Thu, 12 Aug 2021 18:59:07 +0200 Subject: [PATCH 46/47] chore(core): tell which stack is exceeding max resource count (#16019) Previously, the error message gave no indication which stack was violating the resource count, which does not help when you have dozens. ---- *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/stack.ts | 2 +- packages/@aws-cdk/core/test/stack.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/@aws-cdk/core/lib/stack.ts b/packages/@aws-cdk/core/lib/stack.ts index a74a82e55ccd6..ee80e56334101 100644 --- a/packages/@aws-cdk/core/lib/stack.ts +++ b/packages/@aws-cdk/core/lib/stack.ts @@ -785,7 +785,7 @@ export class Stack extends CoreConstruct implements ITaggable { const numberOfResources = Object.keys(resources).length; if (numberOfResources > this.maxResources) { - throw new Error(`Number of resources: ${numberOfResources} is greater than allowed maximum of ${this.maxResources}`); + throw new Error(`Number of resources in stack '${this.node.path}': ${numberOfResources} is greater than allowed maximum of ${this.maxResources}`); } else if (numberOfResources >= (this.maxResources * 0.8)) { Annotations.of(this).addInfo(`Number of resources: ${numberOfResources} is approaching allowed maximum of ${this.maxResources}`); } diff --git a/packages/@aws-cdk/core/test/stack.test.ts b/packages/@aws-cdk/core/test/stack.test.ts index 11a4a01796031..4473b99e0c2dc 100644 --- a/packages/@aws-cdk/core/test/stack.test.ts +++ b/packages/@aws-cdk/core/test/stack.test.ts @@ -59,7 +59,7 @@ describe('stack', () => { expect(() => { app.synth(); - }).toThrow('Number of resources: 1000 is greater than allowed maximum of 500'); + }).toThrow('Number of resources in stack \'MyStack\': 1000 is greater than allowed maximum of 500'); }); @@ -81,7 +81,7 @@ describe('stack', () => { expect(() => { app.synth(); - }).toThrow('Number of resources: 200 is greater than allowed maximum of 100'); + }).toThrow('Number of resources in stack \'MyStack\': 200 is greater than allowed maximum of 100'); }); From bb5d5874098b4b1047a29b6697e5e3a65f349ff0 Mon Sep 17 00:00:00 2001 From: Sam Wilson Date: Thu, 12 Aug 2021 15:34:42 -0500 Subject: [PATCH 47/47] feat(apigatewayv2): http api - domain url for a stage (#15973) Closes #15801 By adding and `apiMapping` field to base.ts, we can reference the custom domain information from the `HttpStage` construct ---- *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-apigatewayv2/README.md | 6 +++ .../lib/common/api-mapping.ts | 6 +++ .../aws-apigatewayv2/lib/common/base.ts | 11 ++++- .../aws-apigatewayv2/lib/http/stage.ts | 11 +++++ .../aws-apigatewayv2/test/http/stage.test.ts | 47 ++++++++++++++++++- 5 files changed, 78 insertions(+), 3 deletions(-) diff --git a/packages/@aws-cdk/aws-apigatewayv2/README.md b/packages/@aws-cdk/aws-apigatewayv2/README.md index c5dc2318b2d53..cf0a2ab0552c7 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/README.md +++ b/packages/@aws-cdk/aws-apigatewayv2/README.md @@ -224,6 +224,12 @@ with 3 API mapping resources across different APIs and Stages. | api | beta | `https://${domainName}/bar` | | apiDemo | $default | `https://${domainName}/demo` | +You can retrieve the full domain URL with mapping key using the `domainUrl` property as so - + +```ts +const demoDomainUrl = apiDemo.defaultStage.domainUrl; // returns "https://example.com/demo" +``` + ### Managing access API Gateway supports multiple mechanisms for [controlling and managing access to your HTTP diff --git a/packages/@aws-cdk/aws-apigatewayv2/lib/common/api-mapping.ts b/packages/@aws-cdk/aws-apigatewayv2/lib/common/api-mapping.ts index adbe3fe3efc2c..f9ebfc89b52ca 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/lib/common/api-mapping.ts +++ b/packages/@aws-cdk/aws-apigatewayv2/lib/common/api-mapping.ts @@ -82,6 +82,11 @@ export class ApiMapping extends Resource implements IApiMapping { */ public readonly mappingKey?: string; + /** + * API domain name + */ + public readonly domainName: IDomainName; + constructor(scope: Construct, id: string, props: ApiMappingProps) { super(scope, id); @@ -121,5 +126,6 @@ export class ApiMapping extends Resource implements IApiMapping { this.apiMappingId = resource.ref; this.mappingKey = props.apiMappingKey; + this.domainName = props.domainName; } } diff --git a/packages/@aws-cdk/aws-apigatewayv2/lib/common/base.ts b/packages/@aws-cdk/aws-apigatewayv2/lib/common/base.ts index cd88fceba46b8..006df3f83cd2b 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/lib/common/base.ts +++ b/packages/@aws-cdk/aws-apigatewayv2/lib/common/base.ts @@ -36,6 +36,12 @@ export abstract class StageBase extends Resource implements IStage { public abstract readonly stageName: string; protected abstract readonly baseApi: IApi; + /** + * The created ApiMapping if domain mapping has been added + * @internal + */ + protected _apiMapping?: ApiMapping + /** * The URL to this stage. */ @@ -45,7 +51,10 @@ export abstract class StageBase extends Resource implements IStage { * @internal */ protected _addDomainMapping(domainMapping: DomainMappingOptions) { - new ApiMapping(this, `${domainMapping.domainName}${domainMapping.mappingKey}`, { + if (this._apiMapping) { + throw new Error('Only one ApiMapping allowed per Stage'); + } + this._apiMapping = new ApiMapping(this, `${domainMapping.domainName}${domainMapping.mappingKey}`, { api: this.baseApi, domainName: domainMapping.domainName, stage: this, diff --git a/packages/@aws-cdk/aws-apigatewayv2/lib/http/stage.ts b/packages/@aws-cdk/aws-apigatewayv2/lib/http/stage.ts index 3ad58eea4364b..709f207a04435 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/lib/http/stage.ts +++ b/packages/@aws-cdk/aws-apigatewayv2/lib/http/stage.ts @@ -176,4 +176,15 @@ export class HttpStage extends HttpStageBase { const urlPath = this.stageName === DEFAULT_STAGE_NAME ? '' : this.stageName; return `https://${this.api.apiId}.execute-api.${s.region}.${s.urlSuffix}/${urlPath}`; } + + /** + * The custom domain URL to this stage + */ + public get domainUrl(): string { + if (!this._apiMapping) { + throw new Error('domainUrl is not available when no API mapping is associated with the Stage'); + } + + return `https://${this._apiMapping.domainName.name}/${this._apiMapping.mappingKey ?? ''}`; + } } diff --git a/packages/@aws-cdk/aws-apigatewayv2/test/http/stage.test.ts b/packages/@aws-cdk/aws-apigatewayv2/test/http/stage.test.ts index c56c2ded5d48b..e7a05924719d3 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/test/http/stage.test.ts +++ b/packages/@aws-cdk/aws-apigatewayv2/test/http/stage.test.ts @@ -1,8 +1,8 @@ import { Template } from '@aws-cdk/assertions'; +import { Certificate } from '@aws-cdk/aws-certificatemanager'; import { Metric } from '@aws-cdk/aws-cloudwatch'; import { Stack } from '@aws-cdk/core'; -import { HttpApi, HttpStage } from '../../lib'; - +import { DomainName, HttpApi, HttpStage } from '../../lib'; describe('HttpStage', () => { test('default', () => { @@ -116,4 +116,47 @@ describe('HttpStage', () => { const metricNames = metrics.map(m => m.metricName); expect(metricNames).toEqual(['4xx', '5xx', 'DataProcessed', 'Latency', 'IntegrationLatency', 'Count']); }); +}); + +describe('HttpStage with domain mapping', () => { + const domainName = 'example.com'; + const certArn = 'arn:aws:acm:us-east-1:111111111111:certificate'; + + test('domainUrl returns the correct path', () => { + const stack = new Stack(); + const api = new HttpApi(stack, 'Api', { + createDefaultStage: false, + }); + + const dn = new DomainName(stack, 'DN', { + domainName, + certificate: Certificate.fromCertificateArn(stack, 'cert', certArn), + }); + + const stage = new HttpStage(stack, 'DefaultStage', { + httpApi: api, + domainMapping: { + domainName: dn, + }, + }); + + expect(stage.domainUrl).toBe(`https://${domainName}/`); + }); + + test('domainUrl throws error if domainMapping is not configured', () => { + const stack = new Stack(); + const api = new HttpApi(stack, 'Api', { + createDefaultStage: false, + }); + + const stage = new HttpStage(stack, 'DefaultStage', { + httpApi: api, + }); + + const t = () => { + stage.domainUrl; + }; + + expect(t).toThrow(/domainUrl is not available when no API mapping is associated with the Stage/); + }); }); \ No newline at end of file