diff --git a/CHANGELOG.md b/CHANGELOG.md index 69145a82950ad..0167a2fb4caa2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,41 @@ 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.21.0](https://github.com/aws/aws-cdk/compare/v1.20.0...v1.21.0) (2020-01-15) + + +### Features + +* **assert:** cdk assert: implement 'haveOutput' assertion ([#5366](https://github.com/aws/aws-cdk/issues/5366)) ([ee6decb](https://github.com/aws/aws-cdk/commit/ee6decbb4f2b90454777632f8750eae8674b1be2)), closes [#1906](https://github.com/aws/aws-cdk/issues/1906) +* **cli:** run cdk from inner directories ([#5772](https://github.com/aws/aws-cdk/issues/5772)) ([a54630d](https://github.com/aws/aws-cdk/commit/a54630db99716e1a7a19e4320fa4c55a42e5ea68)) +* **codepipeline:** add CannedACL and CacheControl to S3 deploy action ([#5698](https://github.com/aws/aws-cdk/issues/5698)) ([b3e7978](https://github.com/aws/aws-cdk/commit/b3e7978dff2ce20d8e0327db13186922205a1b4c)) +* **codepipeline:** add support for externalEntityLink in the manual approval action ([#5558](https://github.com/aws/aws-cdk/issues/5558)) ([be2e3e3](https://github.com/aws/aws-cdk/commit/be2e3e305eee5d90552c08512a4d476db74b91d0)) +* **codepipeline:** Pipeline Variables ([#5604](https://github.com/aws/aws-cdk/issues/5604)) ([34d3e7d](https://github.com/aws/aws-cdk/commit/34d3e7de39dc197510013f6e4f91170b4c2e29f7)), closes [#5219](https://github.com/aws/aws-cdk/issues/5219) +* **ec2:** `VpcEndpointService` construct ([#5498](https://github.com/aws/aws-cdk/issues/5498)) ([a2713f3](https://github.com/aws/aws-cdk/commit/a2713f35d65bd26fb9ff878c6daed072ffed5f15)) +* recommend matching commands ([#5668](https://github.com/aws/aws-cdk/issues/5668)) ([6108b91](https://github.com/aws/aws-cdk/commit/6108b91d6d3c087a61ac9b3990030a5a52a08808)) +* **elbv2:** default config for internal load balancer will fall back to Isolated subnets ([#5696](https://github.com/aws/aws-cdk/pull/5696)) ([8b9c1fc](https://github.com/aws/aws-cdk/commit/8b9c1fc652673083ffd92f58a97931c1bbb834c9)) +* **iam:** `Role.withoutPolicyUpdates()` ([#5569](https://github.com/aws/aws-cdk/issues/5569)) ([ea4ca3e](https://github.com/aws/aws-cdk/commit/ea4ca3ea251e54921c39ee79f321cae2701837ad)), closes [#2985](https://github.com/aws/aws-cdk/issues/2985) [#4465](https://github.com/aws/aws-cdk/issues/4465) [#4501](https://github.com/aws/aws-cdk/issues/4501) +* **iam:** support importing service roles ([#5701](https://github.com/aws/aws-cdk/issues/5701)) ([0f02dad](https://github.com/aws/aws-cdk/commit/0f02dad9ffa9d01912f29edc0c8d91869a6c4824)), closes [#2651](https://github.com/aws/aws-cdk/issues/2651) +* **s3:** server access logs ([#5072](https://github.com/aws/aws-cdk/issues/5072)) ([c9b074b](https://github.com/aws/aws-cdk/commit/c9b074b28b26a537fb81b9a4a431df6412964c59)) + + +### Bug Fixes + +* **acm:** `DnsValidatedCertificate` in non-aws partitions ([#5771](https://github.com/aws/aws-cdk/issues/5771)) ([e3305d8](https://github.com/aws/aws-cdk/commit/e3305d8d09b3fd87a0609606c3638332c4eeef33)) +* **apigateway:** authorizer name is not optional ([#5731](https://github.com/aws/aws-cdk/issues/5731)) ([21c425e](https://github.com/aws/aws-cdk/commit/21c425e066dec3ec44daedfa980f9e4d96488755)), closes [#5678](https://github.com/aws/aws-cdk/issues/5678) +* **apigateway:** unable to associate RestApi as a route53 target for late bound domains ([#5555](https://github.com/aws/aws-cdk/issues/5555)) ([c02741e](https://github.com/aws/aws-cdk/commit/c02741ed53ecc834acfb5c3c4d5fc0deab6f2726)) +* **cli:** Fix various init templates & their tests ([#5693](https://github.com/aws/aws-cdk/issues/5693)) ([a85da79](https://github.com/aws/aws-cdk/commit/a85da79c0da05f57af84d388efe7775502cf0039)) +* **cli:** proxy support is broken ([#5803](https://github.com/aws/aws-cdk/issues/5803)) ([3a63f57](https://github.com/aws/aws-cdk/commit/3a63f57b3f36f914ac086d9bfe08274f0ddec574)), closes [#5743](https://github.com/aws/aws-cdk/issues/5743) [#5791](https://github.com/aws/aws-cdk/issues/5791) +* **cloudformation:** nested stack example in readme is broken ([#5729](https://github.com/aws/aws-cdk/issues/5729)) ([c53356a](https://github.com/aws/aws-cdk/commit/c53356a3cc4c4a96d326d73bfa28d791100391bc)), closes [#5686](https://github.com/aws/aws-cdk/issues/5686) +* **cloudwatch:** cross-account metrics in env-agnostic stack ([#5775](https://github.com/aws/aws-cdk/issues/5775)) ([5292bd5](https://github.com/aws/aws-cdk/commit/5292bd56ad4f7c2bf68767861c5e252b13282f34)), closes [aws/aws-cdk#5628](https://github.com/aws/aws-cdk/issues/5628) +* **codepipeline:** Action.onStateChange() has wrong detail type ([#5721](https://github.com/aws/aws-cdk/issues/5721)) ([8686dd5](https://github.com/aws/aws-cdk/commit/8686dd5bae583df08f2b25a8133c7e9296f7a643)), closes [#3614](https://github.com/aws/aws-cdk/issues/3614) +* **custom-resources:** missing physical resource id for delete calls ([#5805](https://github.com/aws/aws-cdk/issues/5805)) ([9b7236a](https://github.com/aws/aws-cdk/commit/9b7236abb4b08c2d080858059dc2b531031da6fe)), closes [#5796](https://github.com/aws/aws-cdk/issues/5796) +* **ecr-assets:** unable to use one Dockerfile to build multiple images ([#5705](https://github.com/aws/aws-cdk/issues/5705)) ([ff3f27f](https://github.com/aws/aws-cdk/commit/ff3f27fe56dc2300032c307cf09f50a3cd7a997e)), closes [#5683](https://github.com/aws/aws-cdk/issues/5683) +* **ecs:** cannot separate `Cluster` and `Ec2Service` behind ALB ([#5813](https://github.com/aws/aws-cdk/issues/5813)) ([eb3c517](https://github.com/aws/aws-cdk/commit/eb3c5170e1c3f5243ee437ab7627dd84d68d5740)) +* **glue:** empty string in Table.s3prefix is not undefined ([#5783](https://github.com/aws/aws-cdk/issues/5783)) ([18e15de](https://github.com/aws/aws-cdk/commit/18e15de64dfcadd9b5cacef54ed5d93a9a91189a)), closes [#5763](https://github.com/aws/aws-cdk/issues/5763) +* **iam:** can't use `OrganizationPrincipal` for assuming Role ([#5746](https://github.com/aws/aws-cdk/issues/5746)) ([6c3d4c4](https://github.com/aws/aws-cdk/commit/6c3d4c40b7f4cef1c3d484bf9b3409ee6f33cc27)), closes [#5732](https://github.com/aws/aws-cdk/issues/5732) +* **rds:** pass the ARN of master instead of its ID in DatabaseInstanceReadReplica ([#5702](https://github.com/aws/aws-cdk/issues/5702)) ([d323c0c](https://github.com/aws/aws-cdk/commit/d323c0c13aaf475f59615a41969bb60cbb678be8)), closes [#5530](https://github.com/aws/aws-cdk/issues/5530) + ## [1.20.0](https://github.com/aws/aws-cdk/compare/v1.19.0...v1.20.0) (2020-01-07) diff --git a/lerna.json b/lerna.json index 6822cabb86b31..47c5cf69a3a3e 100644 --- a/lerna.json +++ b/lerna.json @@ -9,5 +9,5 @@ "tools/*" ], "rejectCycles": "true", - "version": "1.20.0" + "version": "1.21.0" } diff --git a/package.json b/package.json index 1fe02950551c1..72233f3f057c2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aws-cdk", - "version": "1.20.0", + "version": "1.21.0", "private": true, "pkglint": { "include": "dependencies/node-version" diff --git a/packages/@aws-cdk/alexa-ask/package.json b/packages/@aws-cdk/alexa-ask/package.json index b03d02b585f9e..ec2ceaa711636 100644 --- a/packages/@aws-cdk/alexa-ask/package.json +++ b/packages/@aws-cdk/alexa-ask/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/alexa-ask", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for Alexa::ASK", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,16 +80,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/app-delivery/package.json b/packages/@aws-cdk/app-delivery/package.json index fbb84029d8ea6..1351ffe28daea 100644 --- a/packages/@aws-cdk/app-delivery/package.json +++ b/packages/@aws-cdk/app-delivery/package.json @@ -1,7 +1,7 @@ { "name": "@aws-cdk/app-delivery", "description": "Continuous Integration / Continuous Delivery for CDK Applications", - "version": "1.20.0", + "version": "1.21.0", "main": "lib/index.js", "types": "lib/index.d.ts", "jsii": { @@ -40,24 +40,24 @@ "compat": "cdk-compat" }, "dependencies": { - "@aws-cdk/aws-cloudformation": "1.20.0", - "@aws-cdk/aws-codebuild": "1.20.0", - "@aws-cdk/aws-codepipeline": "1.20.0", - "@aws-cdk/aws-codepipeline-actions": "1.20.0", - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/core": "1.20.0", - "@aws-cdk/cx-api": "1.20.0" + "@aws-cdk/aws-cloudformation": "1.21.0", + "@aws-cdk/aws-codebuild": "1.21.0", + "@aws-cdk/aws-codepipeline": "1.21.0", + "@aws-cdk/aws-codepipeline-actions": "1.21.0", + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/core": "1.21.0", + "@aws-cdk/cx-api": "1.21.0" }, "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", + "@aws-cdk/assert": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", "fast-check": "^1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "repository": { "type": "git", @@ -76,14 +76,14 @@ "cdk" ], "peerDependencies": { - "@aws-cdk/aws-cloudformation": "1.20.0", - "@aws-cdk/aws-codebuild": "1.20.0", - "@aws-cdk/aws-codepipeline": "1.20.0", - "@aws-cdk/aws-codepipeline-actions": "1.20.0", - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/core": "1.20.0", - "@aws-cdk/cx-api": "1.20.0" + "@aws-cdk/aws-cloudformation": "1.21.0", + "@aws-cdk/aws-codebuild": "1.21.0", + "@aws-cdk/aws-codepipeline": "1.21.0", + "@aws-cdk/aws-codepipeline-actions": "1.21.0", + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/core": "1.21.0", + "@aws-cdk/cx-api": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/assert/README.md b/packages/@aws-cdk/assert/README.md index d3db7d3a96c23..ff04c0e985828 100644 --- a/packages/@aws-cdk/assert/README.md +++ b/packages/@aws-cdk/assert/README.md @@ -79,3 +79,25 @@ expect(stack).to(haveResource('AWS::CertificateManager::Certificate', { // Note: some properties omitted here })); ``` +### Check existence of an output +`haveOutput` assertion can be used to check that a stack contains specific output. +Parameters to check against can be: +- `outputName` +- `outputValue` +- `exportName` + +If `outputValue` is provided, at least one of `outputName`, `exportName` should be provided as well + +Example +```ts +expect(synthStack).to(haveOutput({ + outputName: 'TestOutputName', + exportName: 'TestOutputExportName', + outputValue: { + 'Fn::GetAtt': [ + 'TestResource', + 'Arn' + ] + } +})); +``` diff --git a/packages/@aws-cdk/assert/jest.ts b/packages/@aws-cdk/assert/jest.ts index d5715364652a7..78fa8fab38d90 100644 --- a/packages/@aws-cdk/assert/jest.ts +++ b/packages/@aws-cdk/assert/jest.ts @@ -1,8 +1,11 @@ -import { Stack } from "@aws-cdk/core"; +import { Stack } from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; -import { HaveResourceAssertion, ResourcePart } from "./lib/assertions/have-resource"; -import { MatchStyle, matchTemplate } from "./lib/assertions/match-template"; +import { JestFriendlyAssertion } from './lib/assertion'; +import { haveOutput, HaveOutputProperties } from './lib/assertions/have-output'; +import { HaveResourceAssertion, ResourcePart } from './lib/assertions/have-resource'; +import { MatchStyle, matchTemplate } from './lib/assertions/match-template'; import { expect as ourExpect } from './lib/expect'; +import { StackInspector } from './lib/inspector'; declare global { namespace jest { @@ -17,6 +20,8 @@ declare global { toHaveResourceLike(resourceType: string, properties?: any, comparison?: ResourcePart): R; + + toHaveOutput(props: HaveOutputProperties): R; } } } @@ -50,8 +55,9 @@ expect.extend({ comparison?: ResourcePart) { const assertion = new HaveResourceAssertion(resourceType, properties, comparison, false); - return assertHaveResource(assertion, actual); + return applyAssertion(assertion, actual); }, + toHaveResourceLike( actual: cxapi.CloudFormationStackArtifact | Stack, resourceType: string, @@ -59,11 +65,18 @@ expect.extend({ comparison?: ResourcePart) { const assertion = new HaveResourceAssertion(resourceType, properties, comparison, true); - return assertHaveResource(assertion, actual); + return applyAssertion(assertion, actual); + }, + + toHaveOutput( + actual: cxapi.CloudFormationStackArtifact | Stack, + props: HaveOutputProperties) { + + return applyAssertion(haveOutput(props), actual); } }); -function assertHaveResource(assertion: HaveResourceAssertion, actual: cxapi.CloudFormationStackArtifact | Stack) { +function applyAssertion(assertion: JestFriendlyAssertion, actual: cxapi.CloudFormationStackArtifact | Stack) { const inspector = ourExpect(actual); const pass = assertion.assertUsing(inspector); if (pass) { diff --git a/packages/@aws-cdk/assert/lib/assertion.ts b/packages/@aws-cdk/assert/lib/assertion.ts index d193a6856c27e..57ef3ca759e78 100644 --- a/packages/@aws-cdk/assert/lib/assertion.ts +++ b/packages/@aws-cdk/assert/lib/assertion.ts @@ -20,6 +20,13 @@ export abstract class Assertion { } } +export abstract class JestFriendlyAssertion extends Assertion { + /** + * Generates an error message that can be used by Jest. + */ + public abstract generateErrorMessage(): string; +} + import { AndAssertion } from "./assertions/and-assertion"; function and(left: Assertion, right: Assertion): Assertion { diff --git a/packages/@aws-cdk/assert/lib/assertions/have-output.ts b/packages/@aws-cdk/assert/lib/assertions/have-output.ts new file mode 100644 index 0000000000000..36f76b3e573a0 --- /dev/null +++ b/packages/@aws-cdk/assert/lib/assertions/have-output.ts @@ -0,0 +1,116 @@ +import { JestFriendlyAssertion } from '../assertion'; +import { StackInspector } from '../inspector'; + +class HaveOutputAssertion extends JestFriendlyAssertion { + private readonly inspected: InspectionFailure[] = []; + + constructor(private readonly outputName?: string, private readonly exportName?: any, private outputValue?: any) { + super(); + if (!this.outputName && !this.exportName) { + throw new Error('At least one of [outputName, exportName] should be provided'); + } + } + + public get description(): string { + const descriptionPartsArray = new Array(); + + if (this.outputName) { + descriptionPartsArray.push(`name '${this.outputName}'`); + } + if (this.exportName) { + descriptionPartsArray.push(`export name ${JSON.stringify(this.exportName)}`); + } + if (this.outputValue) { + descriptionPartsArray.push(`value ${JSON.stringify(this.outputValue)}`); + } + + return 'output with ' + descriptionPartsArray.join(', '); + } + + public assertUsing(inspector: StackInspector): boolean { + if (!('Outputs' in inspector.value)) { + return false; + } + + for (const [name, props] of Object.entries(inspector.value.Outputs as Record)) { + const mismatchedFields = new Array(); + + if (this.outputName && name !== this.outputName) { + mismatchedFields.push('name'); + } + + if (this.exportName && JSON.stringify(this.exportName) !== JSON.stringify(props.Export?.Name)) { + mismatchedFields.push('export name'); + } + + if (this.outputValue && JSON.stringify(this.outputValue) !== JSON.stringify(props.Value)) { + mismatchedFields.push('value'); + } + + if (mismatchedFields.length === 0) { + return true; + } + + this.inspected.push({ + output: { [name]: props }, + failureReason: `mismatched ${mismatchedFields.join(', ')}`, + }); + } + + return false; + } + + public generateErrorMessage() { + const lines = new Array(); + + lines.push(`None of ${this.inspected.length} outputs matches ${this.description}.`); + + for (const inspected of this.inspected) { + lines.push(`- ${inspected.failureReason} in:`); + lines.push(indent(4, JSON.stringify(inspected.output, null, 2))); + } + + return lines.join('\n'); + } +} + +/** + * Interface for haveOutput function properties + * NOTE that at least one of [outputName, exportName] should be provided + */ +export interface HaveOutputProperties { + /** + * Logical ID of the output + * @default - the logical ID of the output will not be checked + */ + outputName?: string; + /** + * Export name of the output, when it's exported for cross-stack referencing + * @default - the export name is not required and will not be checked + */ + exportName?: any; + /** + * Value of the output; + * @default - the value will not be checked + */ + outputValue?: any; +} + +interface InspectionFailure { + output: any; + failureReason: string; +} + +/** + * An assertion to check whether Output with particular properties is present in a stack + * @param props properties of the Output that is being asserted against. + * Check ``HaveOutputProperties`` interface to get full list of available parameters + */ +export function haveOutput(props: HaveOutputProperties): JestFriendlyAssertion { + return new HaveOutputAssertion(props.outputName, props.exportName, props.outputValue); +} + +function indent(n: number, s: string) { + const prefix = ' '.repeat(n); + return prefix + s.replace(/\n/g, '\n' + prefix); +} diff --git a/packages/@aws-cdk/assert/lib/assertions/have-resource.ts b/packages/@aws-cdk/assert/lib/assertions/have-resource.ts index d6653f3b64ce6..ce94e152ab5ac 100644 --- a/packages/@aws-cdk/assert/lib/assertions/have-resource.ts +++ b/packages/@aws-cdk/assert/lib/assertions/have-resource.ts @@ -1,4 +1,4 @@ -import { Assertion } from "../assertion"; +import { Assertion, JestFriendlyAssertion } from "../assertion"; import { StackInspector } from "../inspector"; /** @@ -30,8 +30,8 @@ export function haveResourceLike(resourceType: string, type PropertyPredicate = (props: any, inspection: InspectionFailure) => boolean; -export class HaveResourceAssertion extends Assertion { - private inspected: InspectionFailure[] = []; +export class HaveResourceAssertion extends JestFriendlyAssertion { + private readonly inspected: InspectionFailure[] = []; private readonly part: ResourcePart; private readonly predicate: PropertyPredicate; diff --git a/packages/@aws-cdk/assert/lib/index.ts b/packages/@aws-cdk/assert/lib/index.ts index b79d93592affc..ff3516dc2f6fd 100644 --- a/packages/@aws-cdk/assert/lib/index.ts +++ b/packages/@aws-cdk/assert/lib/index.ts @@ -4,6 +4,7 @@ export * from './inspector'; export * from './synth-utils'; export * from './assertions/exist'; +export * from './assertions/have-output'; export * from './assertions/have-resource'; export * from './assertions/have-type'; export * from './assertions/match-template'; diff --git a/packages/@aws-cdk/assert/package.json b/packages/@aws-cdk/assert/package.json index b48d3d5a8e365..8c289aa0f194e 100644 --- a/packages/@aws-cdk/assert/package.json +++ b/packages/@aws-cdk/assert/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/assert", - "version": "1.20.0", + "version": "1.21.0", "description": "An assertion library for use with CDK Apps", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -23,9 +23,8 @@ ], "coverageThreshold": { "global": { - "statements": 80, - "lines": 80, - "branches": 60 + "statements": 75, + "branches": 65 } }, "preset": "ts-jest", @@ -41,16 +40,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@types/jest": "^24.0.25", - "cdk-build-tools": "1.20.0", + "@types/jest": "^24.9.0", + "cdk-build-tools": "1.21.0", "jest": "^24.9.0", - "pkglint": "1.20.0", - "ts-jest": "^24.2.0" + "pkglint": "1.21.0", + "ts-jest": "^24.3.0" }, "dependencies": { - "@aws-cdk/cloudformation-diff": "1.20.0", - "@aws-cdk/core": "1.20.0", - "@aws-cdk/cx-api": "1.20.0" + "@aws-cdk/cloudformation-diff": "1.21.0", + "@aws-cdk/core": "1.21.0", + "@aws-cdk/cx-api": "1.21.0" }, "peerDependencies": { "jest": "^24.9.0" diff --git a/packages/@aws-cdk/assert/test/have-output.test.ts b/packages/@aws-cdk/assert/test/have-output.test.ts new file mode 100644 index 0000000000000..71dfd9015c89c --- /dev/null +++ b/packages/@aws-cdk/assert/test/have-output.test.ts @@ -0,0 +1,201 @@ +import * as cxapi from '@aws-cdk/cx-api'; +import { unlink, writeFileSync } from 'fs'; +import { join } from 'path'; +import '../jest'; + +let templateFilePath: string; +let synthStack: cxapi.CloudFormationStackArtifact; +let noOutputStack: cxapi.CloudFormationStackArtifact; + +beforeEach(done => { + synthStack = mkStack({ + Resources: { + SomeResource: { + Type: 'Some::Resource', + Properties: { + PropA: 'somevalue' + } + }, + AnotherResource: { + Type: 'Some::AnotherResource', + Properties: { + PropA: 'anothervalue' + } + } + }, + Outputs: { + TestOutput: { + Value: { + 'Fn::GetAtt': [ + 'SomeResource', + 'Arn' + ] + }, + Export: { + Name: 'TestOutputExportName' + } + }, + ComplexExportNameOutput: { + Value: { + 'Fn::GetAtt': [ + 'ComplexOutputResource', + 'Arn' + ] + }, + Export: { + Name: { + "Fn::Sub": "${AWS::StackName}-ComplexExportNameOutput" + } + } + } + } + }); + noOutputStack = mkStack({ + Resources: { + SomeResource: { + Type: 'Some::Resource', + Properties: { + PropA: 'somevalue' + } + } + } + }); + done(); +}); + +test('haveOutput should assert true when output with correct name is provided', () => { + expect(synthStack).toHaveOutput({ + outputName: 'TestOutput' + }); +}); + +test('haveOutput should assert false when output with incorrect name is provided', () => { + expect(synthStack).not.toHaveOutput({ + outputName: 'WrongOutput' + }); +}); + +test('haveOutput should assert true when output with correct name and export name is provided', () => { + expect(synthStack).toHaveOutput({ + outputName: 'TestOutput', + exportName: 'TestOutputExportName', + }); +}); + +test('haveOutput should assert false when output with correct name and incorrect export name is provided', () => { + expect(synthStack).not.toHaveOutput({ + outputName: 'TestOutput', + exportName: 'WrongTestOutputExportName', + }); +}); + +test('haveOutput should assert true when output with correct name, export name and value is provided', () => { + expect(synthStack).toHaveOutput({ + outputName: 'TestOutput', + exportName: 'TestOutputExportName', + outputValue: { + 'Fn::GetAtt': [ + 'SomeResource', + 'Arn' + ] + } + }); +}); + +test('haveOutput should assert false when output with correct name and export name and incorrect value is provided', () => { + expect(synthStack).not.toHaveOutput({ + outputName: 'TestOutput', + exportName: 'TestOutputExportName', + outputValue: 'SomeWrongValue' + }); +}); + +test('haveOutput should assert true when output with correct export name and value is provided', () => { + expect(synthStack).toHaveOutput({ + exportName: 'TestOutputExportName', + outputValue: { + 'Fn::GetAtt': [ + 'SomeResource', + 'Arn' + ] + } + }); +}); + +test('haveOutput should assert false when output with correct export name and incorrect value is provided', () => { + expect(synthStack).not.toHaveOutput({ + exportName: 'TestOutputExportName', + outputValue: 'WrongValue' + }); +}); + +test('haveOutput should assert true when output with correct output name and value is provided', () => { + expect(synthStack).toHaveOutput({ + outputName: 'TestOutput', + outputValue: { + 'Fn::GetAtt': [ + 'SomeResource', + 'Arn' + ] + } + }); +}); + +test('haveOutput should assert false when output with correct output name and incorrect value is provided', () => { + expect(synthStack).not.toHaveOutput({ + outputName: 'TestOutput', + outputValue: 'WrongValue' + }); +}); + +test('haveOutput should assert false when asserting against noOutputStack', () => { + expect(noOutputStack).not.toHaveOutput({ + outputName: 'TestOutputName', + exportName: 'TestExportName', + outputValue: 'TestOutputValue' + }); +}); + +test('haveOutput should throw Error when none of outputName and exportName is provided', () => { + expect(() => expect(synthStack).toHaveOutput({ outputValue: 'SomeValue' })) + .toThrow('At least one of [outputName, exportName] should be provided'); +}); + +test('haveOutput should be able to handle complex exportName values', () => { + expect(synthStack).toHaveOutput({ + exportName: {'Fn::Sub': '${AWS::StackName}-ComplexExportNameOutput'}, + outputValue: { + 'Fn::GetAtt': [ + 'ComplexOutputResource', + 'Arn' + ] + } + }); +}); + +afterEach(done => { + if (templateFilePath) { + unlink(templateFilePath, 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: cxapi.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); +} diff --git a/packages/@aws-cdk/assets/lib/fs/copy.ts b/packages/@aws-cdk/assets/lib/fs/copy.ts index 7fc66c9043aa0..01b6c19cc66a6 100644 --- a/packages/@aws-cdk/assets/lib/fs/copy.ts +++ b/packages/@aws-cdk/assets/lib/fs/copy.ts @@ -1,7 +1,7 @@ import * as fs from 'fs'; import * as path from 'path'; -import { CopyOptions } from './copy-options'; import { FollowMode } from './follow-mode'; +import { CopyOptions } from './options'; import { shouldExclude, shouldFollow } from './utils'; export function copyDirectory(srcDir: string, destDir: string, options: CopyOptions = { }, rootDir?: string) { diff --git a/packages/@aws-cdk/assets/lib/fs/fingerprint.ts b/packages/@aws-cdk/assets/lib/fs/fingerprint.ts index 085335bc64a70..6b3f653a95f34 100644 --- a/packages/@aws-cdk/assets/lib/fs/fingerprint.ts +++ b/packages/@aws-cdk/assets/lib/fs/fingerprint.ts @@ -1,8 +1,8 @@ import * as crypto from 'crypto'; import * as fs from 'fs'; import * as path from 'path'; -import { CopyOptions } from './copy-options'; import { FollowMode } from './follow-mode'; +import { FingerprintOptions } from './options'; import { shouldExclude, shouldFollow } from './utils'; const BUFFER_SIZE = 8 * 1024; @@ -10,14 +10,6 @@ const CTRL_SOH = '\x01'; const CTRL_SOT = '\x02'; const CTRL_ETX = '\x03'; -export interface FingerprintOptions extends CopyOptions { - /** - * Extra information to encode into the fingerprint (e.g. build instructions - * and other inputs) - */ - extra?: string; -} - /** * Produces fingerprint based on the contents of a single file or an entire directory tree. * @@ -31,7 +23,7 @@ export interface FingerprintOptions extends CopyOptions { */ export function fingerprint(fileOrDirectory: string, options: FingerprintOptions = { }) { const hash = crypto.createHash('sha256'); - _hashField(hash, 'options.extra', options.extra || ''); + _hashField(hash, 'options.extra', options.extraHash || ''); const follow = options.follow || FollowMode.EXTERNAL; _hashField(hash, 'options.follow', follow); diff --git a/packages/@aws-cdk/assets/lib/fs/index.ts b/packages/@aws-cdk/assets/lib/fs/index.ts index a66267535075d..a1a4c68a83cef 100644 --- a/packages/@aws-cdk/assets/lib/fs/index.ts +++ b/packages/@aws-cdk/assets/lib/fs/index.ts @@ -1,4 +1,4 @@ export * from './copy'; -export * from './copy-options'; export * from './fingerprint'; export * from './follow-mode'; +export * from './options'; diff --git a/packages/@aws-cdk/assets/lib/fs/copy-options.ts b/packages/@aws-cdk/assets/lib/fs/options.ts similarity index 55% rename from packages/@aws-cdk/assets/lib/fs/copy-options.ts rename to packages/@aws-cdk/assets/lib/fs/options.ts index ac8d8b5686f0d..727da36568502 100644 --- a/packages/@aws-cdk/assets/lib/fs/copy-options.ts +++ b/packages/@aws-cdk/assets/lib/fs/options.ts @@ -18,3 +18,16 @@ export interface CopyOptions { */ readonly exclude?: string[]; } + +/** + * Options related to calculating source hash. + */ +export interface FingerprintOptions extends CopyOptions { + /** + * Extra information to encode into the fingerprint (e.g. build instructions + * and other inputs) + * + * @default - hash is only based on source content + */ + readonly extraHash?: string; +} diff --git a/packages/@aws-cdk/assets/lib/index.ts b/packages/@aws-cdk/assets/lib/index.ts index fffa67ab1b17f..e2a67003867bd 100644 --- a/packages/@aws-cdk/assets/lib/index.ts +++ b/packages/@aws-cdk/assets/lib/index.ts @@ -1,4 +1,4 @@ -export * from './fs/copy-options'; +export * from './api'; export * from './fs/follow-mode'; +export * from './fs/options'; export * from './staging'; -export * from './api'; diff --git a/packages/@aws-cdk/assets/lib/staging.ts b/packages/@aws-cdk/assets/lib/staging.ts index b148647ac011d..0961b306c8629 100644 --- a/packages/@aws-cdk/assets/lib/staging.ts +++ b/packages/@aws-cdk/assets/lib/staging.ts @@ -2,9 +2,9 @@ import { Construct, ISynthesisSession } from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; import * as fs from 'fs'; import * as path from 'path'; -import { copyDirectory, CopyOptions, fingerprint } from './fs'; +import { copyDirectory, fingerprint, FingerprintOptions } from './fs'; -export interface StagingProps extends CopyOptions { +export interface StagingProps extends FingerprintOptions { readonly sourcePath: string; } @@ -46,7 +46,7 @@ export class Staging extends Construct { */ public readonly sourceHash: string; - private readonly copyOptions: CopyOptions; + private readonly fingerprintOptions: FingerprintOptions; private readonly relativePath?: string; @@ -54,7 +54,7 @@ export class Staging extends Construct { super(scope, id); this.sourcePath = props.sourcePath; - this.copyOptions = props; + this.fingerprintOptions = props; this.sourceHash = fingerprint(this.sourcePath, props); const stagingDisabled = this.node.tryGetContext(cxapi.DISABLE_ASSET_STAGING_CONTEXT); @@ -84,7 +84,7 @@ export class Staging extends Construct { fs.copyFileSync(this.sourcePath, targetPath); } else if (stat.isDirectory()) { fs.mkdirSync(targetPath); - copyDirectory(this.sourcePath, targetPath, this.copyOptions); + copyDirectory(this.sourcePath, targetPath, this.fingerprintOptions); } else { throw new Error(`Unknown file type: ${this.sourcePath}`); } diff --git a/packages/@aws-cdk/assets/package.json b/packages/@aws-cdk/assets/package.json index 47b7c32dc46ef..79c94b9d75d8d 100644 --- a/packages/@aws-cdk/assets/package.json +++ b/packages/@aws-cdk/assets/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/assets", - "version": "1.20.0", + "version": "1.21.0", "description": "Integration of CDK apps with local assets", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -63,27 +63,27 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/minimatch": "^3.0.3", "@types/nodeunit": "^0.0.30", "@types/sinon": "^7.5.0", - "aws-cdk": "1.20.0", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", + "aws-cdk": "1.21.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0", - "sinon": "^8.0.2", + "pkglint": "1.21.0", + "sinon": "^8.0.4", "ts-mock-imports": "^1.2.6" }, "dependencies": { - "@aws-cdk/core": "1.20.0", - "@aws-cdk/cx-api": "1.20.0", + "@aws-cdk/core": "1.21.0", + "@aws-cdk/cx-api": "1.21.0", "minimatch": "^3.0.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.20.0", - "@aws-cdk/cx-api": "1.20.0" + "@aws-cdk/core": "1.21.0", + "@aws-cdk/cx-api": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/assets/test/test.staging.ts b/packages/@aws-cdk/assets/test/test.staging.ts index 803af0a487b32..b1d3652a33211 100644 --- a/packages/@aws-cdk/assets/test/test.staging.ts +++ b/packages/@aws-cdk/assets/test/test.staging.ts @@ -57,5 +57,22 @@ export = { 'tree.json', ]); test.done(); + }, + + 'allow specifying extra data to include in the source hash'(test: Test) { + // GIVEN + const app = new App(); + const stack = new Stack(app, 'stack'); + const directory = path.join(__dirname, 'fs', 'fixtures', 'test1'); + + // WHEN + const withoutExtra = new Staging(stack, 'withoutExtra', { sourcePath: directory }); + const withExtra = new Staging(stack, 'withExtra', { sourcePath: directory, extraHash: 'boom' }); + + // THEN + test.notEqual(withoutExtra.sourceHash, withExtra.sourceHash); + test.deepEqual(withoutExtra.sourceHash, '2f37f937c51e2c191af66acf9b09f548926008ec68c575bd2ee54b6e997c0e00'); + test.deepEqual(withExtra.sourceHash, 'c95c915a5722bb9019e2c725d11868e5a619b55f36172f76bcbcaa8bb2d10c5f'); + test.done(); } }; diff --git a/packages/@aws-cdk/aws-accessanalyzer/package.json b/packages/@aws-cdk/aws-accessanalyzer/package.json index 4f5331373da8e..39d710301debc 100644 --- a/packages/@aws-cdk/aws-accessanalyzer/package.json +++ b/packages/@aws-cdk/aws-accessanalyzer/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-accessanalyzer", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::AccessAnalyzer", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,16 +81,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-amazonmq/package.json b/packages/@aws-cdk/aws-amazonmq/package.json index bce657c4a91e2..99c789cc9a58e 100644 --- a/packages/@aws-cdk/aws-amazonmq/package.json +++ b/packages/@aws-cdk/aws-amazonmq/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-amazonmq", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::AmazonMQ", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,16 +80,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-amplify/package.json b/packages/@aws-cdk/aws-amplify/package.json index baab94c2575c4..76ee03ad57ea6 100644 --- a/packages/@aws-cdk/aws-amplify/package.json +++ b/packages/@aws-cdk/aws-amplify/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-amplify", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::Amplify", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,16 +81,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-apigateway/README.md b/packages/@aws-cdk/aws-apigateway/README.md index 0fd8dee131bd6..f8b660ced70fe 100644 --- a/packages/@aws-cdk/aws-apigateway/README.md +++ b/packages/@aws-cdk/aws-apigateway/README.md @@ -484,7 +484,7 @@ CNAME records only for subdomains.) ```ts new route53.ARecord(this, 'CustomDomainAliasRecord', { zone: hostedZoneForExampleCom, - target: route53.AddressRecordTarget.fromAlias(new route53_targets.ApiGateway(api)) + target: route53.RecordTarget.fromAlias(new route53_targets.ApiGateway(api)) }); ``` @@ -527,7 +527,7 @@ If you wish to setup this domain with an Amazon Route53 alias, use the `route53_ ```ts new route53.ARecord(this, 'CustomDomainAliasRecord', { zone: hostedZoneForExampleCom, - target: route53.AddressRecordTarget.fromAlias(new route53_targets.ApiGatewayDomain(domainName)) + target: route53.RecordTarget.fromAlias(new route53_targets.ApiGatewayDomain(domainName)) }); ``` diff --git a/packages/@aws-cdk/aws-apigateway/lib/authorizers/lambda.ts b/packages/@aws-cdk/aws-apigateway/lib/authorizers/lambda.ts index ad222b627593e..5175407981186 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/authorizers/lambda.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/authorizers/lambda.ts @@ -13,7 +13,7 @@ export interface TokenAuthorizerProps { /** * An optional human friendly name for the authorizer. Note that, this is not the primary identifier of the authorizer. * - * @default - none + * @default this.node.uniqueId */ readonly authorizerName?: string; @@ -92,7 +92,7 @@ export class TokenAuthorizer extends Authorizer implements IAuthorizer { const restApiId = Lazy.stringValue({ produce: () => this.restApiId }); const resource = new CfnAuthorizer(this, 'Resource', { - name: props.authorizerName, + name: props.authorizerName ?? this.node.uniqueId, restApiId, type: 'TOKEN', authorizerUri: `arn:aws:apigateway:${Stack.of(this).region}:lambda:path/2015-03-31/functions/${props.handler.functionArn}/invocations`, diff --git a/packages/@aws-cdk/aws-apigateway/lib/restapi.ts b/packages/@aws-cdk/aws-apigateway/lib/restapi.ts index 25cf73991db69..a66bba21fbd22 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/restapi.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/restapi.ts @@ -212,13 +212,8 @@ export class RestApi extends Resource implements IRestApi { */ public deploymentStage!: Stage; - /** - * The domain name mapped to this API, if defined through the `domainName` - * configuration prop. - */ - public readonly domainName?: DomainName; - private readonly methods = new Array(); + private _domainName?: DomainName; private _latestDeployment: Deployment | undefined; constructor(scope: Construct, id: string, props: RestApiProps = { }) { @@ -253,10 +248,18 @@ export class RestApi extends Resource implements IRestApi { this.restApiRootResourceId = resource.attrRootResourceId; if (props.domainName) { - this.domainName = this.addDomainName('CustomDomain', props.domainName); + this.addDomainName('CustomDomain', props.domainName); } } + /** + * The first domain name mapped to this API, if defined through the `domainName` + * configuration prop, or added via `addDomainName` + */ + public get domainName() { + return this._domainName; + } + /** * API Gateway deployment that represents the latest changes of the API. * This resource will be automatically updated every time the REST API model changes. @@ -292,10 +295,14 @@ export class RestApi extends Resource implements IRestApi { * @param options custom domain options */ public addDomainName(id: string, options: DomainNameOptions): DomainName { - return new DomainName(this, id, { + const domainName = new DomainName(this, id, { ...options, mapping: this }); + if (!this._domainName) { + this._domainName = domainName; + } + return domainName; } /** diff --git a/packages/@aws-cdk/aws-apigateway/package.json b/packages/@aws-cdk/aws-apigateway/package.json index 856b7cf4348b9..dd02134d3cc6f 100644 --- a/packages/@aws-cdk/aws-apigateway/package.json +++ b/packages/@aws-cdk/aws-apigateway/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-apigateway", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::ApiGateway", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -65,29 +65,29 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", + "@aws-cdk/assert": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-certificatemanager": "1.20.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-certificatemanager": "1.21.0", + "@aws-cdk/aws-elasticloadbalancingv2": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-certificatemanager": "1.20.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-certificatemanager": "1.21.0", + "@aws-cdk/aws-elasticloadbalancingv2": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-apigateway/test/authorizers/integ.token-authorizer-iam-role.expected.json b/packages/@aws-cdk/aws-apigateway/test/authorizers/integ.token-authorizer-iam-role.expected.json index 702856a6922b3..d2c26cd1de4ba 100644 --- a/packages/@aws-cdk/aws-apigateway/test/authorizers/integ.token-authorizer-iam-role.expected.json +++ b/packages/@aws-cdk/aws-apigateway/test/authorizers/integ.token-authorizer-iam-role.expected.json @@ -105,6 +105,7 @@ "MyAuthorizer6575980E": { "Type": "AWS::ApiGateway::Authorizer", "Properties": { + "Name": "TokenAuthorizerIAMRoleIntegMyAuthorizer1DFDE3B5", "RestApiId": { "Ref": "MyRestApi2D1F47A9" }, diff --git a/packages/@aws-cdk/aws-apigateway/test/authorizers/integ.token-authorizer.expected.json b/packages/@aws-cdk/aws-apigateway/test/authorizers/integ.token-authorizer.expected.json index bfad9880b7040..60c98adf6e1d2 100644 --- a/packages/@aws-cdk/aws-apigateway/test/authorizers/integ.token-authorizer.expected.json +++ b/packages/@aws-cdk/aws-apigateway/test/authorizers/integ.token-authorizer.expected.json @@ -199,6 +199,7 @@ "MyAuthorizer6575980E": { "Type": "AWS::ApiGateway::Authorizer", "Properties": { + "Name": "TokenAuthorizerIntegMyAuthorizer793B1D5F", "RestApiId": { "Ref": "MyRestApi2D1F47A9" }, diff --git a/packages/@aws-cdk/aws-apigateway/test/test.domains.ts b/packages/@aws-cdk/aws-apigateway/test/test.domains.ts index 3591cf9558717..a285b472f3dd9 100644 --- a/packages/@aws-cdk/aws-apigateway/test/test.domains.ts +++ b/packages/@aws-cdk/aws-apigateway/test/test.domains.ts @@ -177,6 +177,112 @@ export = { } })); + test.done(); + }, + + 'a domain name can be added later'(test: Test) { + // GIVEN + const domainName = 'my.domain.com'; + const stack = new Stack(); + const certificate = new acm.Certificate(stack, 'cert', { domainName: 'my.domain.com' }); + + // WHEN + const api = new apigw.RestApi(stack, 'api', {}); + + api.root.addMethod('GET'); + + api.addDomainName('domainId', { domainName, certificate }); + + // THEN + expect(stack).to(haveResource('AWS::ApiGateway::DomainName', { + "DomainName": domainName, + "EndpointConfiguration": { + "Types": [ + "REGIONAL" + ] + }, + "RegionalCertificateArn": { + "Ref": "cert56CA94EB" + } + })); + expect(stack).to(haveResource('AWS::ApiGateway::BasePathMapping', { + "DomainName": { + "Ref": "apidomainId102F8DAA" + }, + "RestApiId": { + "Ref": "apiC8550315" + }, + "Stage": { + "Ref": "apiDeploymentStageprod896C8101" + } + })); + + test.done(); + }, + + 'multiple domain names can be added'(test: Test) { + // GIVEN + const domainName = 'my.domain.com'; + const stack = new Stack(); + const certificate = new acm.Certificate(stack, 'cert', { domainName: 'my.domain.com' }); + + // WHEN + const api = new apigw.RestApi(stack, 'api', {}); + + api.root.addMethod('GET'); + + const domainName1 = api.addDomainName('domainId', { domainName, certificate }); + api.addDomainName('domainId1', { domainName: 'your.domain.com', certificate }); + api.addDomainName('domainId2', { domainName: 'our.domain.com', certificate }); + + test.deepEqual(api.domainName, domainName1); + + // THEN + expect(stack).to(haveResource('AWS::ApiGateway::DomainName', { + "DomainName": 'my.domain.com', + "EndpointConfiguration": { + "Types": [ + "REGIONAL" + ] + }, + "RegionalCertificateArn": { + "Ref": "cert56CA94EB" + } + })); + expect(stack).to(haveResource('AWS::ApiGateway::DomainName', { + "DomainName": 'your.domain.com', + "EndpointConfiguration": { + "Types": [ + "REGIONAL" + ] + }, + "RegionalCertificateArn": { + "Ref": "cert56CA94EB" + } + })); + expect(stack).to(haveResource('AWS::ApiGateway::DomainName', { + "DomainName": 'our.domain.com', + "EndpointConfiguration": { + "Types": [ + "REGIONAL" + ] + }, + "RegionalCertificateArn": { + "Ref": "cert56CA94EB" + } + })); + expect(stack).to(haveResource('AWS::ApiGateway::BasePathMapping', { + "DomainName": { + "Ref": "apidomainId102F8DAA" + }, + "RestApiId": { + "Ref": "apiC8550315" + }, + "Stage": { + "Ref": "apiDeploymentStageprod896C8101" + } + })); + test.done(); } }; diff --git a/packages/@aws-cdk/aws-applicationautoscaling/package.json b/packages/@aws-cdk/aws-applicationautoscaling/package.json index 6ee30ad1a149c..7f7037f22ea60 100644 --- a/packages/@aws-cdk/aws-applicationautoscaling/package.json +++ b/packages/@aws-cdk/aws-applicationautoscaling/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-applicationautoscaling", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::ApplicationAutoScaling", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,26 +62,26 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", "fast-check": "^1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-autoscaling-common": "1.20.0", - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-autoscaling-common": "1.21.0", + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-autoscaling-common": "1.20.0", - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-autoscaling-common": "1.21.0", + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-appmesh/package.json b/packages/@aws-cdk/aws-appmesh/package.json index 4c7f9eac73baf..56199f8f4dcf5 100644 --- a/packages/@aws-cdk/aws-appmesh/package.json +++ b/packages/@aws-cdk/aws-appmesh/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-appmesh", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::AppMesh", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -64,25 +64,25 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-servicediscovery": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-servicediscovery": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-servicediscovery": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-servicediscovery": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-appstream/package.json b/packages/@aws-cdk/aws-appstream/package.json index 30c72e4c2b759..c5cc9b26e4f12 100644 --- a/packages/@aws-cdk/aws-appstream/package.json +++ b/packages/@aws-cdk/aws-appstream/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-appstream", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::AppStream", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,16 +80,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-appsync/package.json b/packages/@aws-cdk/aws-appsync/package.json index 2de2430227bea..296745778e5f9 100644 --- a/packages/@aws-cdk/aws-appsync/package.json +++ b/packages/@aws-cdk/aws-appsync/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-appsync", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::AppSync", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,26 +79,26 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-cognito": "1.20.0", - "@aws-cdk/aws-dynamodb": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-cognito": "1.21.0", + "@aws-cdk/aws-dynamodb": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-cognito": "1.20.0", - "@aws-cdk/aws-dynamodb": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-cognito": "1.21.0", + "@aws-cdk/aws-dynamodb": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-athena/package.json b/packages/@aws-cdk/aws-athena/package.json index 9abf7515f2926..d212b4f281f9d 100644 --- a/packages/@aws-cdk/aws-athena/package.json +++ b/packages/@aws-cdk/aws-athena/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-athena", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::Athena", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,17 +79,17 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-autoscaling-common/package.json b/packages/@aws-cdk/aws-autoscaling-common/package.json index 645c1af9b6418..698f979ebf541 100644 --- a/packages/@aws-cdk/aws-autoscaling-common/package.json +++ b/packages/@aws-cdk/aws-autoscaling-common/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-autoscaling-common", - "version": "1.20.0", + "version": "1.21.0", "description": "Common implementation package for @aws-cdk/aws-autoscaling and @aws-cdk/aws-applicationautoscaling", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -58,22 +58,22 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", "fast-check": "^1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "awslint": { "exclude": [ diff --git a/packages/@aws-cdk/aws-autoscaling-hooktargets/package.json b/packages/@aws-cdk/aws-autoscaling-hooktargets/package.json index a1f7f7251cf7b..48867c100c2d3 100644 --- a/packages/@aws-cdk/aws-autoscaling-hooktargets/package.json +++ b/packages/@aws-cdk/aws-autoscaling-hooktargets/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-autoscaling-hooktargets", - "version": "1.20.0", + "version": "1.21.0", "description": "Lifecycle hook for AWS AutoScaling", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -76,32 +76,32 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "@aws-cdk/assert": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "jest": "^24.9.0", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-autoscaling": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/aws-sns-subscriptions": "1.20.0", - "@aws-cdk/aws-sqs": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-autoscaling": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/aws-sns-subscriptions": "1.21.0", + "@aws-cdk/aws-sqs": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-autoscaling": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/aws-sns-subscriptions": "1.20.0", - "@aws-cdk/aws-sqs": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-autoscaling": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/aws-sns-subscriptions": "1.21.0", + "@aws-cdk/aws-sqs": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-autoscaling/package.json b/packages/@aws-cdk/aws-autoscaling/package.json index 752118a20e675..b92c603abb7fa 100644 --- a/packages/@aws-cdk/aws-autoscaling/package.json +++ b/packages/@aws-cdk/aws-autoscaling/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-autoscaling", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::AutoScaling", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,35 +62,35 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "@aws-cdk/cx-api": "1.20.0", + "@aws-cdk/assert": "1.21.0", + "@aws-cdk/cx-api": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-autoscaling-common": "1.20.0", - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-elasticloadbalancing": "1.20.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-autoscaling-common": "1.21.0", + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-elasticloadbalancing": "1.21.0", + "@aws-cdk/aws-elasticloadbalancingv2": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-autoscaling-common": "1.20.0", - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-elasticloadbalancing": "1.20.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-autoscaling-common": "1.21.0", + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-elasticloadbalancing": "1.21.0", + "@aws-cdk/aws-elasticloadbalancingv2": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-autoscalingplans/package.json b/packages/@aws-cdk/aws-autoscalingplans/package.json index 5868e93311e80..9b405f031b809 100644 --- a/packages/@aws-cdk/aws-autoscalingplans/package.json +++ b/packages/@aws-cdk/aws-autoscalingplans/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-autoscalingplans", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::AutoScalingPlans", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,17 +79,17 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-backup/package.json b/packages/@aws-cdk/aws-backup/package.json index 903b1bc85c403..041f2c01625b9 100644 --- a/packages/@aws-cdk/aws-backup/package.json +++ b/packages/@aws-cdk/aws-backup/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-backup", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::Backup", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,16 +81,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-batch/package.json b/packages/@aws-cdk/aws-batch/package.json index 26123de085885..de2c6cc4d9768 100644 --- a/packages/@aws-cdk/aws-batch/package.json +++ b/packages/@aws-cdk/aws-batch/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-batch", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::Batch", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,17 +79,17 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-budgets/package.json b/packages/@aws-cdk/aws-budgets/package.json index 61a0739cce125..e50de334dc05a 100644 --- a/packages/@aws-cdk/aws-budgets/package.json +++ b/packages/@aws-cdk/aws-budgets/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-budgets", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::Budgets", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,17 +79,17 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-certificatemanager/lambda-packages/dns_validated_certificate_handler/package.json b/packages/@aws-cdk/aws-certificatemanager/lambda-packages/dns_validated_certificate_handler/package.json index 500af155123ae..2279a0aede26f 100644 --- a/packages/@aws-cdk/aws-certificatemanager/lambda-packages/dns_validated_certificate_handler/package.json +++ b/packages/@aws-cdk/aws-certificatemanager/lambda-packages/dns_validated_certificate_handler/package.json @@ -1,7 +1,7 @@ { "name": "dns_validated_certificate_handler", "private": true, - "version": "1.20.0", + "version": "1.21.0", "description": "This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.", "main": "lib/index.js", "directories": { diff --git a/packages/@aws-cdk/aws-certificatemanager/lib/dns-validated-certificate.ts b/packages/@aws-cdk/aws-certificatemanager/lib/dns-validated-certificate.ts index e9bfe1b1d787c..5cfa1edb47ad1 100644 --- a/packages/@aws-cdk/aws-certificatemanager/lib/dns-validated-certificate.ts +++ b/packages/@aws-cdk/aws-certificatemanager/lib/dns-validated-certificate.ts @@ -75,7 +75,7 @@ export class DnsValidatedCertificate extends cdk.Resource implements ICertificat })); requestorFunction.addToRolePolicy(new iam.PolicyStatement({ actions: ['route53:changeResourceRecordSets'], - resources: [`arn:aws:route53:::hostedzone/${this.hostedZoneId}`], + resources: [`arn:${cdk.Stack.of(requestorFunction).partition}:route53:::hostedzone/${this.hostedZoneId}`], })); const certificate = new cfn.CustomResource(this, 'CertificateRequestorResource', { diff --git a/packages/@aws-cdk/aws-certificatemanager/package.json b/packages/@aws-cdk/aws-certificatemanager/package.json index e20dde17784d6..1dcf73b2a5ac0 100644 --- a/packages/@aws-cdk/aws-certificatemanager/package.json +++ b/packages/@aws-cdk/aws-certificatemanager/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-certificatemanager", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::CertificateManager", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,27 +62,27 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-cloudformation": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-route53": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-cloudformation": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-route53": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-cloudformation": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-route53": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-cloudformation": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-route53": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-certificatemanager/test/test.dns-validated-certificate.ts b/packages/@aws-cdk/aws-certificatemanager/test/test.dns-validated-certificate.ts index a78d9c03f7c91..3b62fbc3f309b 100644 --- a/packages/@aws-cdk/aws-certificatemanager/test/test.dns-validated-certificate.ts +++ b/packages/@aws-cdk/aws-certificatemanager/test/test.dns-validated-certificate.ts @@ -66,10 +66,10 @@ export = { 'Fn::Join': [ '', [ - 'arn:aws:route53:::hostedzone/', - { - Ref: 'ExampleDotCom4D1B83AA' - } + 'arn:', + { Ref: 'AWS::Partition' }, + ':route53:::hostedzone/', + { Ref: 'ExampleDotCom4D1B83AA' } ] ] } diff --git a/packages/@aws-cdk/aws-cloud9/package.json b/packages/@aws-cdk/aws-cloud9/package.json index 83fce775f0d79..d646b062eed46 100644 --- a/packages/@aws-cdk/aws-cloud9/package.json +++ b/packages/@aws-cdk/aws-cloud9/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-cloud9", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::Cloud9", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,17 +79,17 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-cloudformation/README.md b/packages/@aws-cdk/aws-cloudformation/README.md index 9fe486f1b168c..192b788edae9f 100644 --- a/packages/@aws-cdk/aws-cloudformation/README.md +++ b/packages/@aws-cdk/aws-cloudformation/README.md @@ -68,7 +68,7 @@ import cfn = require('@aws-cdk/aws-cloudformation'); import s3 = require('@aws-cdk/aws-s3'); class MyNestedStack extends cfn.NestedStack { - constructor(scope: Construct, id: string, props: cfn.NestedStackProps) { + constructor(scope: Construct, id: string, props?: cfn.NestedStackProps) { super(scope, id, props); new s3.Bucket(this, 'NestedBucket'); @@ -76,11 +76,11 @@ class MyNestedStack extends cfn.NestedStack { } class MyParentStack extends Stack { - constructor(scope: Construct, id: string, props: StackProps) { + constructor(scope: Construct, id: string, props?: StackProps) { super(scope, id, props); - new MyNestedStack(scope, 'Nested1'); - new MyNestedStack(scope, 'Nested2'); + new MyNestedStack(this, 'Nested1'); + new MyNestedStack(this, 'Nested2'); } } ``` diff --git a/packages/@aws-cdk/aws-cloudformation/package.json b/packages/@aws-cdk/aws-cloudformation/package.json index c7358a1c0438c..8417dc0e226a3 100644 --- a/packages/@aws-cdk/aws-cloudformation/package.json +++ b/packages/@aws-cdk/aws-cloudformation/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-cloudformation", - "version": "1.20.0", + "version": "1.21.0", "description": "CDK Constructs for AWS CloudFormation", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,36 +62,36 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-s3-assets": "1.20.0", - "@aws-cdk/aws-sns-subscriptions": "1.20.0", - "@aws-cdk/aws-sqs": "1.20.0", - "@aws-cdk/aws-ssm": "1.20.0", + "@aws-cdk/assert": "1.21.0", + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-s3-assets": "1.21.0", + "@aws-cdk/aws-sns-subscriptions": "1.21.0", + "@aws-cdk/aws-sqs": "1.21.0", + "@aws-cdk/aws-ssm": "1.21.0", "@types/aws-lambda": "^8.10.39", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/core": "1.20.0", - "@aws-cdk/cx-api": "1.20.0" + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/core": "1.21.0", + "@aws-cdk/cx-api": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/core": "1.20.0", - "@aws-cdk/cx-api": "1.20.0" + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/core": "1.21.0", + "@aws-cdk/cx-api": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-cloudfront/package.json b/packages/@aws-cdk/aws-cloudfront/package.json index 67d4ffbcdcf64..a4bafc967c4da 100644 --- a/packages/@aws-cdk/aws-cloudfront/package.json +++ b/packages/@aws-cdk/aws-cloudfront/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-cloudfront", - "version": "1.20.0", + "version": "1.21.0", "description": "CDK Constructs for AWS CloudFront", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,31 +62,31 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "aws-sdk": "^2.599.0", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "aws-sdk": "^2.601.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-certificatemanager": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kms": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-certificatemanager": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kms": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-certificatemanager": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kms": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-certificatemanager": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kms": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-cloudtrail/package.json b/packages/@aws-cdk/aws-cloudtrail/package.json index a1fad63ef688a..ac097ee7c0bc2 100644 --- a/packages/@aws-cdk/aws-cloudtrail/package.json +++ b/packages/@aws-cdk/aws-cloudtrail/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-cloudtrail", - "version": "1.20.0", + "version": "1.21.0", "description": "CDK Constructs for AWS CloudTrail", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,32 +62,32 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "aws-sdk": "^2.599.0", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "aws-sdk": "^2.601.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "colors": "^1.4.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kms": "1.20.0", - "@aws-cdk/aws-logs": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kms": "1.21.0", + "@aws-cdk/aws-logs": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kms": "1.20.0", - "@aws-cdk/aws-logs": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kms": "1.21.0", + "@aws-cdk/aws-logs": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-cloudwatch-actions/package.json b/packages/@aws-cdk/aws-cloudwatch-actions/package.json index 70af9a4431253..f841541bfbae8 100644 --- a/packages/@aws-cdk/aws-cloudwatch-actions/package.json +++ b/packages/@aws-cdk/aws-cloudwatch-actions/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-cloudwatch-actions", - "version": "1.20.0", + "version": "1.21.0", "description": "Alarm Actions for AWS CloudWatch CDK library", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -76,30 +76,30 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "@aws-cdk/assert": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "jest": "^24.9.0", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-applicationautoscaling": "1.20.0", - "@aws-cdk/aws-autoscaling": "1.20.0", - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-applicationautoscaling": "1.21.0", + "@aws-cdk/aws-autoscaling": "1.21.0", + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-applicationautoscaling": "1.20.0", - "@aws-cdk/aws-autoscaling": "1.20.0", - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-applicationautoscaling": "1.21.0", + "@aws-cdk/aws-autoscaling": "1.21.0", + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-cloudwatch/lib/private/env-tokens.ts b/packages/@aws-cdk/aws-cloudwatch/lib/private/env-tokens.ts index e0157393df489..15fcda4886791 100644 --- a/packages/@aws-cdk/aws-cloudwatch/lib/private/env-tokens.ts +++ b/packages/@aws-cdk/aws-cloudwatch/lib/private/env-tokens.ts @@ -26,7 +26,9 @@ class StackDependentToken implements cdk.IResolvable { public resolve(context: cdk.IResolveContext) { const stackValue = this.fn(cdk.Stack.of(context.scope)); - if (cdk.Token.isUnresolved(stackValue) || stackValue === this.originalValue) { + // Don't render if the values are definitely the same. If the stack + // is unresolved we don't know, better output the value. + if (!cdk.Token.isUnresolved(stackValue) && stackValue === this.originalValue) { return undefined; } diff --git a/packages/@aws-cdk/aws-cloudwatch/package.json b/packages/@aws-cdk/aws-cloudwatch/package.json index f66be66f15bfd..7c3b188e35a22 100644 --- a/packages/@aws-cdk/aws-cloudwatch/package.json +++ b/packages/@aws-cdk/aws-cloudwatch/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-cloudwatch", - "version": "1.20.0", + "version": "1.21.0", "description": "CDK Constructs for AWS CloudWatch", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,22 +62,22 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "awslint": { "exclude": [ diff --git a/packages/@aws-cdk/aws-cloudwatch/test/test.cross-environment.ts b/packages/@aws-cdk/aws-cloudwatch/test/test.cross-environment.ts index a35f34d953304..3a970d80bb20e 100644 --- a/packages/@aws-cdk/aws-cloudwatch/test/test.cross-environment.ts +++ b/packages/@aws-cdk/aws-cloudwatch/test/test.cross-environment.ts @@ -46,6 +46,38 @@ export = { test.done(); }, + + 'metric with explicit account and region will render in environment agnostic stack'(test: Test) { + // GIVEN + const graph = new GraphWidget({ + left: [ + a.with({ account: '1234', region: 'us-north-5' }) + ], + }); + + // THEN + graphMetricsAre(test, new Stack(), graph, [ + [ 'Test', 'ACount', { accountId: '1234', region: 'us-north-5' }], + ]); + + test.done(); + }, + + 'metric attached to agnostic stack will not render in agnostic stack'(test: Test) { + // GIVEN + const graph = new GraphWidget({ + left: [ + a.attachTo(new Stack()), + ], + }); + + // THEN + graphMetricsAre(test, new Stack(), graph, [ + [ 'Test', 'ACount' ], + ]); + + test.done(); + }, }, 'in alarms': { diff --git a/packages/@aws-cdk/aws-codebuild/package.json b/packages/@aws-cdk/aws-codebuild/package.json index ee3d30718f4a6..a6b3a1f488487 100644 --- a/packages/@aws-cdk/aws-codebuild/package.json +++ b/packages/@aws-cdk/aws-codebuild/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-codebuild", - "version": "1.20.0", + "version": "1.21.0", "description": "CDK Constructs for AWS CodeBuild", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -66,47 +66,47 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/aws-sqs": "1.20.0", + "@aws-cdk/assert": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/aws-sqs": "1.21.0", "@types/nodeunit": "^0.0.30", - "aws-sdk": "^2.599.0", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "aws-sdk": "^2.601.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/assets": "1.20.0", - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-codecommit": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-ecr": "1.20.0", - "@aws-cdk/aws-ecr-assets": "1.20.0", - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kms": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/aws-s3-assets": "1.20.0", - "@aws-cdk/aws-secretsmanager": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/assets": "1.21.0", + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-codecommit": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-ecr": "1.21.0", + "@aws-cdk/aws-ecr-assets": "1.21.0", + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kms": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/aws-s3-assets": "1.21.0", + "@aws-cdk/aws-secretsmanager": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/assets": "1.20.0", - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-codecommit": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-ecr": "1.20.0", - "@aws-cdk/aws-ecr-assets": "1.20.0", - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kms": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/aws-s3-assets": "1.20.0", - "@aws-cdk/aws-secretsmanager": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/assets": "1.21.0", + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-codecommit": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-ecr": "1.21.0", + "@aws-cdk/aws-ecr-assets": "1.21.0", + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kms": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/aws-s3-assets": "1.21.0", + "@aws-cdk/aws-secretsmanager": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-codebuild/test/test.project.ts b/packages/@aws-cdk/aws-codebuild/test/test.project.ts index 1eccd319898c8..17402b5ae1395 100644 --- a/packages/@aws-cdk/aws-codebuild/test/test.project.ts +++ b/packages/@aws-cdk/aws-codebuild/test/test.project.ts @@ -301,4 +301,34 @@ export = { test.done(); }, + + 'can use an ImmutableRole for a Project within a VPC'(test: Test) { + const stack = new cdk.Stack(); + + const role = new iam.Role(stack, 'Role', { + assumedBy: new iam.ServicePrincipal('codebuild.amazonaws.com') + }); + + const vpc = new ec2.Vpc(stack, 'Vpc'); + + new codebuild.Project(stack, 'Project', { + source: codebuild.Source.gitHubEnterprise({ + httpsCloneUrl: 'https://mygithub-enterprise.com/myuser/myrepo', + }), + role: role.withoutPolicyUpdates(), + vpc, + }); + + expect(stack).to(countResources('AWS::IAM::Policy', 0)); + + // Check that the CodeBuild project does not have a DependsOn + expect(stack).to(haveResource('AWS::CodeBuild::Project', (res: any) => { + if (res.DependsOn && res.DependsOn.length > 0) { + throw new Error(`CodeBuild project should have no DependsOn, but got: ${JSON.stringify(res, undefined, 2)}`); + } + return true; + }, ResourcePart.CompleteDefinition)); + + test.done(); + }, }; \ No newline at end of file diff --git a/packages/@aws-cdk/aws-codecommit/package.json b/packages/@aws-cdk/aws-codecommit/package.json index 8c3afa6e1a80f..7c2c20d559c82 100644 --- a/packages/@aws-cdk/aws-codecommit/package.json +++ b/packages/@aws-cdk/aws-codecommit/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-codecommit", - "version": "1.20.0", + "version": "1.21.0", "description": "CDK Constructs for AWS CodeCommit", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -67,26 +67,26 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", + "@aws-cdk/assert": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", "@types/nodeunit": "^0.0.30", - "aws-sdk": "^2.599.0", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "aws-sdk": "^2.601.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-codedeploy/package.json b/packages/@aws-cdk/aws-codedeploy/package.json index 32660eb6b867c..b037721ea68cf 100644 --- a/packages/@aws-cdk/aws-codedeploy/package.json +++ b/packages/@aws-cdk/aws-codedeploy/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-codedeploy", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::CodeDeploy", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -65,36 +65,36 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-autoscaling": "1.20.0", - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-elasticloadbalancing": "1.20.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-autoscaling": "1.21.0", + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-elasticloadbalancing": "1.21.0", + "@aws-cdk/aws-elasticloadbalancingv2": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-autoscaling": "1.20.0", - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-elasticloadbalancing": "1.20.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-autoscaling": "1.21.0", + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-elasticloadbalancing": "1.21.0", + "@aws-cdk/aws-elasticloadbalancingv2": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-codepipeline-actions/README.md b/packages/@aws-cdk/aws-codepipeline-actions/README.md index ff8a047d256e3..92102fc07e18a 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/README.md +++ b/packages/@aws-cdk/aws-codepipeline-actions/README.md @@ -44,6 +44,26 @@ pipeline.addStage({ }); ``` +The CodeCommit source action emits variables: + +```typescript +const sourceAction = new codepipeline_actions.CodeCommitSourceAction({ + // ... + variablesNamespace: 'MyNamespace', // optional - by default, a name will be generated for you +}); + +// later: + +new codepipeline_actions.CodeBuildAction({ + // ... + environmentVariables: { + COMMIT_ID: { + value: sourceAction.variables.commitId, + }, + }, +}); +``` + #### GitHub To use GitHub as the source of a CodePipeline: @@ -66,6 +86,26 @@ pipeline.addStage({ }); ``` +The GitHub source action emits variables: + +```typescript +const sourceAction = new codepipeline_actions.GitHubSourceAction({ + // ... + variablesNamespace: 'MyNamespace', // optional - by default, a name will be generated for you +}); + +// later: + +new codepipeline_actions.CodeBuildAction({ + // ... + environmentVariables: { + COMMIT_URL: { + value: sourceAction.variables.commitUrl, + }, + }, +}); +``` + #### AWS S3 To use an S3 Bucket as a source in CodePipeline: @@ -116,6 +156,26 @@ const sourceAction = new codepipeline_actions.S3SourceAction({ }); ``` +The S3 source action emits variables: + +```typescript +const sourceAction = new codepipeline_actions.S3SourceAction({ + // ... + variablesNamespace: 'MyNamespace', // optional - by default, a name will be generated for you +}); + +// later: + +new codepipeline_actions.CodeBuildAction({ + // ... + environmentVariables: { + VERSION_ID: { + value: sourceAction.variables.versionId, + }, + }, +}); +``` + #### AWS ECR To use an ECR Repository as a source in a Pipeline: @@ -137,6 +197,26 @@ pipeline.addStage({ }); ``` +The ECR source action emits variables: + +```typescript +const sourceAction = new codepipeline_actions.EcrSourceAction({ + // ... + variablesNamespace: 'MyNamespace', // optional - by default, a name will be generated for you +}); + +// later: + +new codepipeline_actions.CodeBuildAction({ + // ... + environmentVariables: { + IMAGE_URI: { + value: sourceAction.variables.imageUri, + }, + }, +}); +``` + ### Build & test #### AWS CodeBuild @@ -266,6 +346,48 @@ const project = new codebuild.PipelineProject(this, 'MyProject', { }); ``` +##### Variables + +The CodeBuild action emits variables. +Unlike many other actions, the variables are not static, +but dynamic, defined in the buildspec, +in the 'exported-variables' subsection of the 'env' section. +Example: + +```typescript +const buildAction = new codepipeline_actions.CodeBuildAction({ + actionName: 'Build1', + input: sourceOutput, + project: new codebuild.PipelineProject(this, 'Project', { + buildSpec: codebuild.BuildSpec.fromObject({ + version: '0.2', + env: { + 'exported-variables': [ + 'MY_VAR', + ], + }, + phases: { + build: { + commands: 'export MY_VAR="some value"', + }, + }, + }), + }), + variablesNamespace: 'MyNamespace', // optional - by default, a name will be generated for you +}); + +// later: + +new codepipeline_actions.CodeBuildAction({ + // ... + environmentVariables: { + MyVar: { + value: buildAction.variable('MY_VAR'), + }, + }, +}); +``` + #### Jenkins In order to use Jenkins Actions in the Pipeline, @@ -304,7 +426,7 @@ const buildAction = new codepipeline_actions.JenkinsAction({ actionName: 'JenkinsBuild', jenkinsProvider: jenkinsProvider, projectName: 'MyProject', - type: ccodepipeline_actions.JenkinsActionType.BUILD, + type: codepipeline_actions.JenkinsActionType.BUILD, }); ``` @@ -421,7 +543,7 @@ const func = new lambda.Function(lambdaStack, 'Lambda', { runtime: lambda.Runtime.NODEJS_10_X, }); // used to make sure each CDK synthesis produces a different Version -const version = func.addVersion('NewVersion') +const version = func.addVersion('NewVersion'); const alias = new lambda.Alias(lambdaStack, 'LambdaAlias', { aliasName: 'Prod', version, @@ -598,5 +720,48 @@ const lambdaAction = new codepipeline_actions.LambdaInvokeAction({ }); ``` +The Lambda invoke action emits variables. +Unlike many other actions, the variables are not static, +but dynamic, defined by the function calling the `PutJobSuccessResult` +API with the `outputVariables` property filled with the map of variables +Example: + +```typescript +import lambda = require('@aws-cdk/aws-lambda'); + +const lambdaInvokeAction = new codepipeline_actions.LambdaInvokeAction({ + actionName: 'Lambda', + lambda: new lambda.Function(this, 'Func', { + runtime: lambda.Runtime.NODEJS_10_X, + handler: 'index.handler', + code: lambda.Code.fromInline(` + var AWS = require('aws-sdk'); + + exports.handler = async function(event, context) { + var codepipeline = new AWS.CodePipeline(); + await codepipeline.putJobSuccessResult({ + jobId: event['CodePipeline.job'].id, + outputVariables: { + MY_VAR: "some value", + }, + }).promise(); + } + `), + }), + variablesNamespace: 'MyNamespace', // optional - by default, a name will be generated for you +}); + +// later: + +new codepipeline_actions.CodeBuildAction({ + // ... + environmentVariables: { + MyVar: { + value: lambdaInvokeAction.variable('MY_VAR'), + }, + }, +}); +``` + See [the AWS documentation](https://docs.aws.amazon.com/codepipeline/latest/userguide/actions-invoke-lambda-function.html) on how to write a Lambda function invoked from CodePipeline. diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/action.ts index 514ebd9cc70bc..024cd1a66fc9a 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/action.ts @@ -1,6 +1,6 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as events from '@aws-cdk/aws-events'; -import { Construct } from '@aws-cdk/core'; +import { Construct, Lazy } from '@aws-cdk/core'; /** * Low-level class for generic CodePipeline Actions. @@ -13,12 +13,34 @@ import { Construct } from '@aws-cdk/core'; * @experimental */ export abstract class Action implements codepipeline.IAction { + public readonly actionProperties: codepipeline.ActionProperties; private _pipeline?: codepipeline.IPipeline; private _stage?: codepipeline.IStage; private _scope?: Construct; + private readonly customerProvidedNamespace?: string; + private readonly namespaceOrToken: string; + private actualNamespace?: string; + private variableReferenced = false; - constructor(public readonly actionProperties: codepipeline.ActionProperties) { - // nothing to do + protected constructor(actionProperties: codepipeline.ActionProperties) { + this.customerProvidedNamespace = actionProperties.variablesNamespace; + this.namespaceOrToken = Lazy.stringValue({ produce: () => { + // make sure the action was bound (= added to a pipeline) + if (this.actualNamespace !== undefined) { + return this.customerProvidedNamespace !== undefined + // if a customer passed a namespace explicitly, always use that + ? this.customerProvidedNamespace + // otherwise, only return a namespace if any variable was referenced + : (this.variableReferenced ? this.actualNamespace : undefined); + } else { + throw new Error(`Cannot reference variables of action '${this.actionProperties.actionName}', ` + + 'as that action was never added to a pipeline'); + } + }}); + this.actionProperties = { + ...actionProperties, + variablesNamespace: this.namespaceOrToken, + }; } public bind(scope: Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): @@ -27,6 +49,11 @@ export abstract class Action implements codepipeline.IAction { this._stage = stage; this._scope = scope; + this.actualNamespace = this.customerProvidedNamespace === undefined + // default a namespace name, based on the stage and action names + ? `${stage.stageName}_${this.actionProperties.actionName}_NS` + : this.customerProvidedNamespace; + return this.bound(scope, stage, options); } @@ -34,7 +61,7 @@ export abstract class Action implements codepipeline.IAction { const rule = new events.Rule(this.scope, name, options); rule.addTarget(target); rule.addEventPattern({ - detailType: [ 'CodePipeline Stage Execution State Change' ], + detailType: [ 'CodePipeline Action Execution State Change' ], source: [ 'aws.codepipeline' ], resources: [ this.pipeline.pipelineArn ], detail: { @@ -45,6 +72,11 @@ export abstract class Action implements codepipeline.IAction { return rule; } + protected variableExpression(variableName: string): string { + this.variableReferenced = true; + return `#{${this.namespaceOrToken}.${variableName}}`; + } + /** * The method called when an Action is attached to a Pipeline. * This method is guaranteed to be called only once for each Action instance. diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/codebuild/build-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/codebuild/build-action.ts index 845a3a052f4cd..10348f02533a3 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/codebuild/build-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/codebuild/build-action.ts @@ -92,6 +92,20 @@ export class CodeBuildAction extends Action { this.props = props; } + /** + * Reference a CodePipeline variable defined by the CodeBuild project this action points to. + * Variables in CodeBuild actions are defined using the 'exported-variables' subsection of the 'env' + * section of the buildspec. + * + * @param variableName the name of the variable to reference. + * A variable by this name must be present in the 'exported-variables' section of the buildspec + * + * @see https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html#build-spec-ref-syntax + */ + public variable(variableName: string): string { + return this.variableExpression(variableName); + } + protected bound(scope: cdk.Construct, _stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig { // check for a cross-account action if there are any outputs 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 35c3cbea50f8c..76183aa51aa83 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 @@ -29,6 +29,29 @@ export enum CodeCommitTrigger { EVENTS = 'Events', } +/** + * The CodePipeline variables emitted by the CodeCommit source Action. + */ +export interface CodeCommitSourceVariables { + /** The name of the repository this action points to. */ + readonly repositoryName: string; + + /** The name of the branch this action tracks. */ + readonly branchName: string; + + /** The date the currently last commit on the tracked branch was authored, in ISO-8601 format. */ + readonly authorDate: string; + + /** The date the currently last commit on the tracked branch was committed, in ISO-8601 format. */ + readonly committerDate: string; + + /** The SHA1 hash of the currently last commit on the tracked branch. */ + readonly commitId: string; + + /** The message of the currently last commit on the tracked branch. */ + readonly commitMessage: string; +} + /** * Construction properties of the {@link CodeCommitSourceAction CodeCommit source CodePipeline Action}. */ @@ -79,6 +102,18 @@ export class CodeCommitSourceAction extends Action { this.props = props; } + /** The variables emitted by this action. */ + public get variables(): CodeCommitSourceVariables { + return { + repositoryName: this.variableExpression('RepositoryName'), + branchName: this.variableExpression('BranchName'), + authorDate: this.variableExpression('AuthorDate'), + committerDate: this.variableExpression('CommitterDate'), + commitId: this.variableExpression('CommitId'), + commitMessage: this.variableExpression('CommitMessage'), + }; + } + protected bound(_scope: Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig { const createEvent = this.props.trigger === undefined || diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/ecr/source-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/ecr/source-action.ts index 05f1932705fba..09ee9d3744af3 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/ecr/source-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/ecr/source-action.ts @@ -6,6 +6,26 @@ import { Construct } from '@aws-cdk/core'; import { Action } from '../action'; import { sourceArtifactBounds } from '../common'; +/** + * The CodePipeline variables emitted by the ECR source Action. + */ +export interface EcrSourceVariables { + /** The identifier of the registry. In ECR, this is usually the ID of the AWS account owning it. */ + readonly registryId: string; + + /** The physical name of the repository that this action tracks. */ + readonly repositoryName: string; + + /** The digest of the current image, in the form ':'. */ + readonly imageDigest: string; + + /** The Docker tag of the current image. */ + readonly imageTag: string; + + /** The full ECR Docker URI of the current image. */ + readonly imageUri: string; +} + /** * Construction properties of {@link EcrSourceAction}. */ @@ -51,6 +71,17 @@ export class EcrSourceAction extends Action { this.props = props; } + /** The variables emitted by this action. */ + public get variables(): EcrSourceVariables { + return { + registryId: this.variableExpression('RegistryId'), + repositoryName: this.variableExpression('RepositoryName'), + imageDigest: this.variableExpression('ImageDigest'), + imageTag: this.variableExpression('ImageTag'), + imageUri: this.variableExpression('ImageURI'), + }; + } + protected bound(_scope: Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig { options.role.addToPolicy(new iam.PolicyStatement({ diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/github/source-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/github/source-action.ts index 6b1b718846631..42062e9040dde 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/github/source-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/github/source-action.ts @@ -12,6 +12,26 @@ export enum GitHubTrigger { WEBHOOK = 'WebHook', } +/** + * The CodePipeline variables emitted by GitHub source Action. + */ +export interface GitHubSourceVariables { + /** The name of the repository this action points to. */ + readonly repositoryName: string; + /** The name of the branch this action tracks. */ + readonly branchName: string; + /** The date the currently last commit on the tracked branch was authored, in ISO-8601 format. */ + readonly authorDate: string; + /** The date the currently last commit on the tracked branch was committed, in ISO-8601 format. */ + readonly committerDate: string; + /** The SHA1 hash of the currently last commit on the tracked branch. */ + readonly commitId: string; + /** The message of the currently last commit on the tracked branch. */ + readonly commitMessage: string; + /** The GitHub API URL of the currently last commit on the tracked branch. */ + readonly commitUrl: string; +} + /** * Construction properties of the {@link GitHubSourceAction GitHub source action}. */ @@ -79,6 +99,19 @@ export class GitHubSourceAction extends Action { this.props = props; } + /** The variables emitted by this action. */ + public get variables(): GitHubSourceVariables { + return { + repositoryName: this.variableExpression('RepositoryName'), + branchName: this.variableExpression('BranchName'), + authorDate: this.variableExpression('AuthorDate'), + committerDate: this.variableExpression('CommitterDate'), + commitId: this.variableExpression('CommitId'), + commitMessage: this.variableExpression('CommitMessage'), + commitUrl: this.variableExpression('CommitUrl'), + }; + } + protected bound(scope: Construct, stage: codepipeline.IStage, _options: codepipeline.ActionBindOptions): codepipeline.ActionConfig { if (!this.props.trigger || this.props.trigger === GitHubTrigger.WEBHOOK) { diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/lambda/invoke-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/lambda/invoke-action.ts index 839cbb0a42acd..a0220fc6e7d2b 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/lambda/invoke-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/lambda/invoke-action.ts @@ -74,6 +74,21 @@ export class LambdaInvokeAction extends Action { this.props = props; } + /** + * Reference a CodePipeline variable defined by the Lambda function this action points to. + * Variables in Lambda invoke actions are defined by calling the PutJobSuccessResult CodePipeline API call + * with the 'outputVariables' property filled. + * + * @param variableName the name of the variable to reference. + * A variable by this name must be present in the 'outputVariables' section of the PutJobSuccessResult + * request that the Lambda function calls when the action is invoked + * + * @see https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_PutJobSuccessResult.html + */ + public variable(variableName: string): string { + return this.variableExpression(variableName); + } + protected bound(scope: Construct, _stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig { // allow pipeline to list functions diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/manual-approval-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/manual-approval-action.ts index badccd4591f46..3a318011caad3 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/manual-approval-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/manual-approval-action.ts @@ -24,6 +24,13 @@ export interface ManualApprovalActionProps extends codepipeline.CommonAwsActionP * Any additional information that you want to include in the notification email message. */ readonly additionalInformation?: string; + + /** + * URL you want to provide to the reviewer as part of the approval request. + * + * @default - the approval request will not have an external link + */ + readonly externalEntityLink?: string; } /** @@ -73,6 +80,7 @@ export class ManualApprovalAction extends Action { ? { NotificationArn: this._notificationTopic.topicArn, CustomData: this.props.additionalInformation, + ExternalEntityLink: this.props.externalEntityLink, } : undefined, }; diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/s3/deploy-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/s3/deploy-action.ts index d65e4cf1dca3c..0aa421ce14b36 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/s3/deploy-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/s3/deploy-action.ts @@ -1,9 +1,47 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as s3 from '@aws-cdk/aws-s3'; -import { Construct } from '@aws-cdk/core'; +import { Construct, Duration } from '@aws-cdk/core'; import { Action } from '../action'; import { deployArtifactBounds } from '../common'; +// Class copied verbatim from the aws-s3-deployment module. +// Yes, it sucks that we didn't abstract this properly in a common class, +// but having 2 different CacheControl classes that behave differently would be worse I think. +// Something to do when CDK 2.0.0 comes out. +/** + * Used for HTTP cache-control header, which influences downstream caches. + * Use the provided static factory methods to construct instances of this class. + * Used in the {@link S3DeployActionProps.cacheControl} property. + * + * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 + */ +export class CacheControl { + /** The 'must-revalidate' cache control directive. */ + public static mustRevalidate() { return new CacheControl('must-revalidate'); } + /** The 'no-cache' cache control directive. */ + public static noCache() { return new CacheControl('no-cache'); } + /** The 'no-transform' cache control directive. */ + public static noTransform() { return new CacheControl('no-transform'); } + /** The 'public' cache control directive. */ + public static setPublic() { return new CacheControl('public'); } + /** The 'private' cache control directive. */ + public static setPrivate() { return new CacheControl('private'); } + /** The 'proxy-revalidate' cache control directive. */ + public static proxyRevalidate() { return new CacheControl('proxy-revalidate'); } + /** The 'max-age' cache control directive. */ + public static maxAge(t: Duration) { return new CacheControl(`max-age: ${t.toSeconds()}`); } + /** The 's-max-age' cache control directive. */ + public static sMaxAge(t: Duration) { return new CacheControl(`s-max-age: ${t.toSeconds()}`); } + /** + * Allows you to create an arbitrary cache control directive, + * in case our support is missing a method for a particular directive. + */ + public static fromString(s: string) { return new CacheControl(s); } + + /** @param value the actual text value of the created directive */ + private constructor(public value: string) {} +} + /** * Construction properties of the {@link S3DeployAction S3 deploy Action}. */ @@ -29,6 +67,23 @@ export interface S3DeployActionProps extends codepipeline.CommonAwsActionProps { * The Amazon S3 bucket that is the deploy target. */ readonly bucket: s3.IBucket; + + /** + * The specified canned ACL to objects deployed to Amazon S3. + * This overwrites any existing ACL that was applied to the object. + * + * @default - the original object ACL + */ + readonly accessControl?: s3.BucketAccessControl; + + /** + * The caching behavior for requests/responses for objects in the bucket. + * The final cache control property will be the result of joining all of the provided array elements with a comma + * (plus a space after the comma). + * + * @default - none, decided by the HTTP client + */ + readonly cacheControl?: CacheControl[]; } /** @@ -63,6 +118,8 @@ export class S3DeployAction extends Action { BucketName: this.props.bucket.bucketName, Extract: this.props.extract === false ? 'false' : 'true', ObjectKey: this.props.objectKey, + CannedACL: this.props.accessControl, + CacheControl: this.props.cacheControl && this.props.cacheControl.map(ac => ac.value).join(', '), }, }; } diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/s3/source-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/s3/source-action.ts index e311d624d54f2..1cf1d821dd0ac 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/s3/source-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/s3/source-action.ts @@ -30,6 +30,17 @@ export enum S3Trigger { EVENTS = 'Events', } +/** + * The CodePipeline variables emitted by the S3 source Action. + */ +export interface S3SourceVariables { + /** The identifier of the S3 version of the object that triggered the build. */ + readonly versionId: string; + + /** The e-tag of the S3 version of the object that triggered the build. */ + readonly eTag: string; +} + /** * Construction properties of the {@link S3SourceAction S3 source Action}. */ @@ -88,6 +99,14 @@ export class S3SourceAction extends Action { this.props = props; } + /** The variables emitted by this action. */ + public get variables(): S3SourceVariables { + return { + versionId: this.variableExpression('VersionId'), + eTag: this.variableExpression('ETag'), + }; + } + protected bound(_scope: Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig { if (this.props.trigger === S3Trigger.EVENTS) { diff --git a/packages/@aws-cdk/aws-codepipeline-actions/package.json b/packages/@aws-cdk/aws-codepipeline-actions/package.json index 933409d9eb5ef..e381573002266 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/package.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-codepipeline-actions", - "version": "1.20.0", + "version": "1.21.0", "description": "Concrete Actions for AWS Code Pipeline", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -64,52 +64,52 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "@aws-cdk/aws-cloudtrail": "1.20.0", + "@aws-cdk/assert": "1.21.0", + "@aws-cdk/aws-cloudtrail": "1.21.0", "@types/lodash": "^4.14.149", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", "lodash": "^4.17.15", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-cloudformation": "1.20.0", - "@aws-cdk/aws-codebuild": "1.20.0", - "@aws-cdk/aws-codecommit": "1.20.0", - "@aws-cdk/aws-codedeploy": "1.20.0", - "@aws-cdk/aws-codepipeline": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-ecr": "1.20.0", - "@aws-cdk/aws-ecs": "1.20.0", - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-events-targets": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/aws-sns-subscriptions": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-cloudformation": "1.21.0", + "@aws-cdk/aws-codebuild": "1.21.0", + "@aws-cdk/aws-codecommit": "1.21.0", + "@aws-cdk/aws-codedeploy": "1.21.0", + "@aws-cdk/aws-codepipeline": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-ecr": "1.21.0", + "@aws-cdk/aws-ecs": "1.21.0", + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-events-targets": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/aws-sns-subscriptions": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-cloudformation": "1.20.0", - "@aws-cdk/aws-codebuild": "1.20.0", - "@aws-cdk/aws-codecommit": "1.20.0", - "@aws-cdk/aws-codedeploy": "1.20.0", - "@aws-cdk/aws-codepipeline": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-ecr": "1.20.0", - "@aws-cdk/aws-ecs": "1.20.0", - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-events-targets": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/aws-sns-subscriptions": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-cloudformation": "1.21.0", + "@aws-cdk/aws-codebuild": "1.21.0", + "@aws-cdk/aws-codecommit": "1.21.0", + "@aws-cdk/aws-codedeploy": "1.21.0", + "@aws-cdk/aws-codepipeline": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-ecr": "1.21.0", + "@aws-cdk/aws-ecs": "1.21.0", + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-events-targets": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/aws-sns-subscriptions": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/codebuild/test.codebuild-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/codebuild/test.codebuild-action.ts index 45ff0a49654b4..dacfae6d21cd1 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/codebuild/test.codebuild-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/codebuild/test.codebuild-action.ts @@ -3,6 +3,7 @@ import * as codebuild from '@aws-cdk/aws-codebuild'; import * as codecommit from '@aws-cdk/aws-codecommit'; import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as s3 from '@aws-cdk/aws-s3'; +import * as sns from '@aws-cdk/aws-sns'; import { App, Stack } from '@aws-cdk/core'; import { Test } from 'nodeunit'; import * as cpactions from '../../lib'; @@ -122,5 +123,84 @@ export = { test.done(); }, + + 'exposes variables for other actions to consume'(test: Test) { + const stack = new Stack(); + + const sourceOutput = new codepipeline.Artifact(); + const codeBuildAction = new cpactions.CodeBuildAction({ + actionName: 'CodeBuild', + input: sourceOutput, + project: new codebuild.PipelineProject(stack, 'CodeBuild', { + buildSpec: codebuild.BuildSpec.fromObject({ + version: '0.2', + env: { + 'exported-variables': [ + 'SomeVar', + ], + }, + phases: { + build: { + commands: [ + 'export SomeVar="Some Value"', + ], + }, + }, + }), + }), + }); + new codepipeline.Pipeline(stack, 'Pipeline', { + stages: [ + { + stageName: 'Source', + actions: [ + new cpactions.S3SourceAction({ + actionName: 'S3_Source', + bucket: s3.Bucket.fromBucketName(stack, 'Bucket', 'bucket'), + bucketKey: 'key', + output: sourceOutput, + }), + ], + }, + { + stageName: 'Build', + actions: [ + codeBuildAction, + new cpactions.ManualApprovalAction({ + actionName: 'Approve', + additionalInformation: codeBuildAction.variable('SomeVar'), + notificationTopic: sns.Topic.fromTopicArn(stack, 'Topic', 'arn:aws:sns:us-east-1:123456789012:mytopic'), + runOrder: 2, + }), + ], + }, + ], + }); + + expect(stack).to(haveResourceLike('AWS::CodePipeline::Pipeline', { + "Stages": [ + { + "Name": "Source", + }, + { + "Name": "Build", + "Actions": [ + { + "Name": "CodeBuild", + "Namespace": "Build_CodeBuild_NS", + }, + { + "Name": "Approve", + "Configuration": { + "CustomData": "#{Build_CodeBuild_NS.SomeVar}", + }, + }, + ], + }, + ], + })); + + test.done(); + }, }, }; diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/codecommit/test.codecommit-source-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/codecommit/test.codecommit-source-action.ts index 1086d3b0d82f4..e67cf3139d4b2 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/codecommit/test.codecommit-source-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/codecommit/test.codecommit-source-action.ts @@ -109,6 +109,61 @@ export = { test.done(); }, + + 'exposes variables for other actions to consume'(test: Test) { + const stack = new Stack(); + + const sourceOutput = new codepipeline.Artifact(); + const codeCommitSourceAction = new cpactions.CodeCommitSourceAction({ + actionName: 'Source', + repository: new codecommit.Repository(stack, 'MyRepo', { + repositoryName: 'my-repo', + }), + output: sourceOutput, + }); + new codepipeline.Pipeline(stack, 'Pipeline', { + stages: [ + { + stageName: 'Source', + actions: [codeCommitSourceAction], + }, + { + stageName: 'Build', + actions: [ + new cpactions.CodeBuildAction({ + actionName: 'Build', + project: new codebuild.PipelineProject(stack, 'MyProject'), + input: sourceOutput, + environmentVariables: { + AuthorDate: { value: codeCommitSourceAction.variables.authorDate }, + }, + }), + ], + }, + ], + }); + + expect(stack).to(haveResourceLike('AWS::CodePipeline::Pipeline', { + "Stages": [ + { + "Name": "Source", + }, + { + "Name": "Build", + "Actions": [ + { + "Name": "Build", + "Configuration": { + "EnvironmentVariables": '[{"name":"AuthorDate","type":"PLAINTEXT","value":"#{Source_Source_NS.AuthorDate}"}]', + }, + }, + ], + }, + ], + })); + + test.done(); + }, }, }; diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/ecr/test.ecr-source-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/ecr/test.ecr-source-action.ts new file mode 100644 index 0000000000000..d00283d33c9eb --- /dev/null +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/ecr/test.ecr-source-action.ts @@ -0,0 +1,66 @@ +import { expect, haveResourceLike } from "@aws-cdk/assert"; +import * as codebuild from '@aws-cdk/aws-codebuild'; +import * as codepipeline from '@aws-cdk/aws-codepipeline'; +import * as ecr from '@aws-cdk/aws-ecr'; +import { Stack } from "@aws-cdk/core"; +import { Test } from 'nodeunit'; +import * as cpactions from '../../lib'; + +// tslint:disable:object-literal-key-quotes + +export = { + 'ECR source Action': { + 'exposes variables for other actions to consume'(test: Test) { + const stack = new Stack(); + + const sourceOutput = new codepipeline.Artifact(); + const ecrSourceAction = new cpactions.EcrSourceAction({ + actionName: 'Source', + output: sourceOutput, + repository: ecr.Repository.fromRepositoryName(stack, 'Repo', 'repo'), + }); + new codepipeline.Pipeline(stack, 'Pipeline', { + stages: [ + { + stageName: 'Source', + actions: [ecrSourceAction], + }, + { + stageName: 'Build', + actions: [ + new cpactions.CodeBuildAction({ + actionName: 'Build', + project: new codebuild.PipelineProject(stack, 'MyProject'), + input: sourceOutput, + environmentVariables: { + ImageDigest: { value: ecrSourceAction.variables.imageDigest }, + }, + }), + ], + }, + ], + }); + + expect(stack).to(haveResourceLike('AWS::CodePipeline::Pipeline', { + "Stages": [ + { + "Name": "Source", + }, + { + "Name": "Build", + "Actions": [ + { + "Name": "Build", + "Configuration": { + "EnvironmentVariables": '[{"name":"ImageDigest","type":"PLAINTEXT","value":"#{Source_Source_NS.ImageDigest}"}]', + }, + }, + ], + }, + ], + })); + + test.done(); + }, + }, +}; diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/github/test.github-source-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/github/test.github-source-action.ts new file mode 100644 index 0000000000000..1707c245defa7 --- /dev/null +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/github/test.github-source-action.ts @@ -0,0 +1,211 @@ +import { expect, haveResourceLike, SynthUtils } from "@aws-cdk/assert"; +import * as codebuild from '@aws-cdk/aws-codebuild'; +import * as codepipeline from '@aws-cdk/aws-codepipeline'; +import { SecretValue, Stack } from "@aws-cdk/core"; +import { Test } from 'nodeunit'; +import * as cpactions from '../../lib'; + +// tslint:disable:object-literal-key-quotes + +export = { + 'GitHub source Action': { + 'exposes variables for other actions to consume'(test: Test) { + const stack = new Stack(); + + const sourceOutput = new codepipeline.Artifact(); + const gitHubSourceAction = new cpactions.GitHubSourceAction({ + actionName: 'Source', + owner: 'aws', + repo: 'aws-cdk', + output: sourceOutput, + oauthToken: SecretValue.plainText('secret'), + }); + new codepipeline.Pipeline(stack, 'Pipeline', { + stages: [ + { + stageName: 'Source', + actions: [gitHubSourceAction], + }, + { + stageName: 'Build', + actions: [ + new cpactions.CodeBuildAction({ + actionName: 'Build', + project: new codebuild.PipelineProject(stack, 'MyProject'), + input: sourceOutput, + environmentVariables: { + CommitUrl: { value: gitHubSourceAction.variables.commitUrl }, + }, + }), + ], + }, + ], + }); + + expect(stack).to(haveResourceLike('AWS::CodePipeline::Pipeline', { + "Stages": [ + { + "Name": "Source", + }, + { + "Name": "Build", + "Actions": [ + { + "Name": "Build", + "Configuration": { + "EnvironmentVariables": '[{"name":"CommitUrl","type":"PLAINTEXT","value":"#{Source_Source_NS.CommitUrl}"}]', + }, + }, + ], + }, + ], + })); + + test.done(); + }, + + 'always renders the customer-supplied namespace, even if none of the variables are used'(test: Test) { + const stack = new Stack(); + + const sourceOutput = new codepipeline.Artifact(); + new codepipeline.Pipeline(stack, 'Pipeline', { + stages: [ + { + stageName: 'Source', + actions: [ + new cpactions.GitHubSourceAction({ + actionName: 'Source', + owner: 'aws', + repo: 'aws-cdk', + output: sourceOutput, + oauthToken: SecretValue.plainText('secret'), + variablesNamespace: 'MyNamespace', + }), + ], + }, + { + stageName: 'Build', + actions: [ + new cpactions.CodeBuildAction({ + actionName: 'Build', + project: new codebuild.PipelineProject(stack, 'MyProject'), + input: sourceOutput, + }), + ], + }, + ], + }); + + expect(stack).to(haveResourceLike('AWS::CodePipeline::Pipeline', { + "Stages": [ + { + "Name": "Source", + "Actions": [ + { + "Name": "Source", + "Namespace": "MyNamespace", + }, + ], + }, + { + }, + ], + })); + + test.done(); + }, + + 'fails if a variable from an action without a namespace set that is not part of a pipeline is referenced'(test: Test) { + const stack = new Stack(); + + const unusedSourceAction = new cpactions.GitHubSourceAction({ + actionName: 'Source2', + owner: 'aws', + repo: 'aws-cdk', + output: new codepipeline.Artifact(), + oauthToken: SecretValue.plainText('secret'), + }); + const sourceOutput = new codepipeline.Artifact(); + new codepipeline.Pipeline(stack, 'Pipeline', { + stages: [ + { + stageName: 'Source', + actions: [new cpactions.GitHubSourceAction({ + actionName: 'Source1', + owner: 'aws', + repo: 'aws-cdk', + output: sourceOutput, + oauthToken: SecretValue.plainText('secret'), + })], + }, + { + stageName: 'Build', + actions: [ + new cpactions.CodeBuildAction({ + actionName: 'Build', + project: new codebuild.PipelineProject(stack, 'MyProject'), + input: sourceOutput, + environmentVariables: { + 'VAR1': { value: unusedSourceAction.variables.authorDate }, + }, + }), + ], + }, + ], + }); + + test.throws(() => { + SynthUtils.synthesize(stack); + }, /Cannot reference variables of action 'Source2', as that action was never added to a pipeline/); + + test.done(); + }, + + 'fails if a variable from an action with a namespace set that is not part of a pipeline is referenced'(test: Test) { + const stack = new Stack(); + + const unusedSourceAction = new cpactions.GitHubSourceAction({ + actionName: 'Source2', + owner: 'aws', + repo: 'aws-cdk', + output: new codepipeline.Artifact(), + oauthToken: SecretValue.plainText('secret'), + variablesNamespace: 'MyNamespace', + }); + const sourceOutput = new codepipeline.Artifact(); + new codepipeline.Pipeline(stack, 'Pipeline', { + stages: [ + { + stageName: 'Source', + actions: [new cpactions.GitHubSourceAction({ + actionName: 'Source1', + owner: 'aws', + repo: 'aws-cdk', + output: sourceOutput, + oauthToken: SecretValue.plainText('secret'), + })], + }, + { + stageName: 'Build', + actions: [ + new cpactions.CodeBuildAction({ + actionName: 'Build', + project: new codebuild.PipelineProject(stack, 'MyProject'), + input: sourceOutput, + environmentVariables: { + 'VAR1': { value: unusedSourceAction.variables.authorDate }, + }, + }), + ], + }, + ], + }); + + test.throws(() => { + SynthUtils.synthesize(stack); + }, /Cannot reference variables of action 'Source2', as that action was never added to a pipeline/); + + test.done(); + }, + }, +}; diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-events.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-events.expected.json index 5d136e655cc8b..050b8e6ef57dd 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-events.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-events.expected.json @@ -484,7 +484,7 @@ "Properties": { "EventPattern": { "detail-type": [ - "CodePipeline Stage Execution State Change" + "CodePipeline Action Execution State Change" ], "source": [ "aws.codepipeline" diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-s3-deploy.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-s3-deploy.expected.json index 59e980a3009db..65591dd703225 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-s3-deploy.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-s3-deploy.expected.json @@ -309,7 +309,9 @@ "BucketName": { "Ref": "DeployBucket67E2C076" }, - "Extract": "true" + "Extract": "true", + "CannedACL": "PublicRead", + "CacheControl": "public, max-age: 43200" }, "InputArtifacts": [ { diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-s3-deploy.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-s3-deploy.ts index d2a21bf37070c..350c0ac1aa570 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-s3-deploy.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-s3-deploy.ts @@ -34,6 +34,11 @@ new codepipeline.Pipeline(stack, 'Pipeline', { actionName: 'DeployAction', input: sourceOutput, bucket: deployBucket, + accessControl: s3.BucketAccessControl.PUBLIC_READ, + cacheControl: [ + cpactions.CacheControl.setPublic(), + cpactions.CacheControl.maxAge(cdk.Duration.hours(12)), + ], }) ], }, diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/lambda/test.lambda-invoke-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/lambda/test.lambda-invoke-action.ts index fa7b63f51346a..e972ed2f33992 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/lambda/test.lambda-invoke-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/lambda/test.lambda-invoke-action.ts @@ -1,6 +1,8 @@ import { expect, haveResourceLike } from "@aws-cdk/assert"; import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as lambda from '@aws-cdk/aws-lambda'; +import * as s3 from '@aws-cdk/aws-s3'; +import * as sns from '@aws-cdk/aws-sns'; import { Aws, Lazy, SecretValue, Stack, Token } from "@aws-cdk/core"; import { Test } from 'nodeunit'; import * as cpactions from '../../lib'; @@ -230,6 +232,68 @@ export = { test.done(); }, + + 'exposes variables for other actions to consume'(test: Test) { + const stack = new Stack(); + + const sourceOutput = new codepipeline.Artifact(); + const lambdaInvokeAction = new cpactions.LambdaInvokeAction({ + actionName: 'LambdaInvoke', + lambda: lambda.Function.fromFunctionArn(stack, 'Func', 'arn:aws:lambda:us-east-1:123456789012:function:some-func'), + }); + new codepipeline.Pipeline(stack, 'Pipeline', { + stages: [ + { + stageName: 'Source', + actions: [ + new cpactions.S3SourceAction({ + actionName: 'S3_Source', + bucket: s3.Bucket.fromBucketName(stack, 'Bucket', 'bucket'), + bucketKey: 'key', + output: sourceOutput, + }), + ], + }, + { + stageName: 'Invoke', + actions: [ + lambdaInvokeAction, + new cpactions.ManualApprovalAction({ + actionName: 'Approve', + additionalInformation: lambdaInvokeAction.variable('SomeVar'), + notificationTopic: sns.Topic.fromTopicArn(stack, 'Topic', 'arn:aws:sns:us-east-1:123456789012:mytopic'), + runOrder: 2, + }), + ], + }, + ], + }); + + expect(stack).to(haveResourceLike('AWS::CodePipeline::Pipeline', { + "Stages": [ + { + "Name": "Source", + }, + { + "Name": "Invoke", + "Actions": [ + { + "Name": "LambdaInvoke", + "Namespace": "Invoke_LambdaInvoke_NS", + }, + { + "Name": "Approve", + "Configuration": { + "CustomData": "#{Invoke_LambdaInvoke_NS.SomeVar}", + }, + }, + ], + }, + ], + })); + + test.done(); + }, }, }; diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/s3/test.s3-source-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/s3/test.s3-source-action.ts index 8f6ed6b882b15..e3d91a9bb7daa 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/s3/test.s3-source-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/s3/test.s3-source-action.ts @@ -175,6 +175,60 @@ export = { test.done(); }, + + 'exposes variables for other actions to consume'(test: Test) { + const stack = new Stack(); + + const sourceOutput = new codepipeline.Artifact(); + const s3SourceAction = new cpactions.S3SourceAction({ + actionName: 'Source', + output: sourceOutput, + bucket: new s3.Bucket(stack, 'Bucket'), + bucketKey: 'key.zip', + }); + new codepipeline.Pipeline(stack, 'Pipeline', { + stages: [ + { + stageName: 'Source', + actions: [s3SourceAction], + }, + { + stageName: 'Build', + actions: [ + new cpactions.CodeBuildAction({ + actionName: 'Build', + project: new codebuild.PipelineProject(stack, 'MyProject'), + input: sourceOutput, + environmentVariables: { + VersionId: { value: s3SourceAction.variables.versionId }, + }, + }), + ], + }, + ], + }); + + expect(stack).to(haveResourceLike('AWS::CodePipeline::Pipeline', { + "Stages": [ + { + "Name": "Source", + }, + { + "Name": "Build", + "Actions": [ + { + "Name": "Build", + "Configuration": { + "EnvironmentVariables": '[{"name":"VersionId","type":"PLAINTEXT","value":"#{Source_Source_NS.VersionId}"}]', + }, + }, + ], + }, + ], + })); + + test.done(); + }, }, }; diff --git a/packages/@aws-cdk/aws-codepipeline/README.md b/packages/@aws-cdk/aws-codepipeline/README.md index 4e439c665aa90..5e77c98e492bb 100644 --- a/packages/@aws-cdk/aws-codepipeline/README.md +++ b/packages/@aws-cdk/aws-codepipeline/README.md @@ -83,7 +83,6 @@ sourceStage.addAction(someAction); ### Cross-region CodePipelines You can also use the cross-region feature to deploy resources -(currently, only CloudFormation Stacks are supported) into a different region than your Pipeline is in. It works like this: @@ -180,6 +179,56 @@ const replicationBucket = new s3.Bucket(replicationStack, 'ReplicationBucket', { }); ``` +### Variables + +The library supports the CodePipeline Variables feature. +Each action class that emits variables has a separate variables interface, +accessed as a property of the action instance called `variables`. +You instantiate the action class and assign it to a local variable; +when you want to use a variable in the configuration of a different action, +you access the appropriate property of the interface returned from `variables`, +which represents a single variable. +Example: + +```typescript +// MyAction is some action type that produces variables +const myAction = new MyAction({ + // ... +}); +new OtherAction({ + // ... + config: myAction.variables.myVariable, +}); +``` + +The namespace name that will be used will be automatically generated by the pipeline construct, +based on the stage and action name; +you can pass a custom name when creating the action instance: + +```typescript +const myAction = new MyAction({ + // ... + variablesNamespace: 'MyNamespace', +}); +``` + +There are also global variables available, +not tied to any action; +these are accessed through static properties of the `GlobalVariables` class: + +```typescript +new OtherAction({ + // ... + config: codepipeline.GlobalVariables.executionId, +}); +``` + +Check the documentation of the `@aws-cdk/aws-codepipeline-actions` +for details on how to use the variables for each action class. + +See the [CodePipeline documentation](https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-variables.html) +for more details on how to use the variables feature. + ### Events #### Using a pipeline as an event target diff --git a/packages/@aws-cdk/aws-codepipeline/lib/action.ts b/packages/@aws-cdk/aws-codepipeline/lib/action.ts index a8a2a74024520..e5c8e66dc0c15 100644 --- a/packages/@aws-cdk/aws-codepipeline/lib/action.ts +++ b/packages/@aws-cdk/aws-codepipeline/lib/action.ts @@ -27,6 +27,17 @@ export interface ActionArtifactBounds { readonly maxOutputs: number; } +/** + * The CodePipeline variables that are global, + * not bound to a specific action. + * This class defines a bunch of static fields that represent the different variables. + * These can be used can be used in any action configuration. + */ +export class GlobalVariables { + /** The identifier of the current pipeline execution. */ + public static readonly executionId = '#{codepipeline.PipelineExecutionId}'; +} + export interface ActionProperties { readonly actionName: string; readonly role?: iam.IRole; @@ -84,6 +95,13 @@ export interface ActionProperties { readonly artifactBounds: ActionArtifactBounds; readonly inputs?: Artifact[]; readonly outputs?: Artifact[]; + + /** + * The name of the namespace to use for variables emitted by this action. + * + * @default - a name will be generated, based on the stage and action names + */ + readonly variablesNamespace?: string; } export interface ActionBindOptions { @@ -181,6 +199,15 @@ export interface CommonActionProps { * @see https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html */ readonly runOrder?: number; + + /** + * The name of the namespace to use for variables emitted by this action. + * + * @default - a name will be generated, based on the stage and action names, + * if any of the action's variables were referenced - otherwise, + * no namespace will be set + */ + readonly variablesNamespace?: string; } /** diff --git a/packages/@aws-cdk/aws-codepipeline/lib/full-action-descriptor.ts b/packages/@aws-cdk/aws-codepipeline/lib/full-action-descriptor.ts index e2aa2774bb5c3..b2759ff353b85 100644 --- a/packages/@aws-cdk/aws-codepipeline/lib/full-action-descriptor.ts +++ b/packages/@aws-cdk/aws-codepipeline/lib/full-action-descriptor.ts @@ -21,6 +21,7 @@ export class FullActionDescriptor { public readonly version: string; public readonly runOrder: number; public readonly artifactBounds: ActionArtifactBounds; + public readonly namespace?: string; public readonly inputs: Artifact[]; public readonly outputs: Artifact[]; public readonly region?: string; @@ -37,6 +38,7 @@ export class FullActionDescriptor { this.version = actionProperties.version || '1'; this.runOrder = actionProperties.runOrder === undefined ? 1 : actionProperties.runOrder; this.artifactBounds = actionProperties.artifactBounds; + this.namespace = actionProperties.variablesNamespace; this.inputs = deduplicateArtifacts(actionProperties.inputs); this.outputs = deduplicateArtifacts(actionProperties.outputs); this.region = props.actionRegion || actionProperties.region; diff --git a/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts b/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts index 70480091e8371..5cb2e1465882f 100644 --- a/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts +++ b/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts @@ -8,7 +8,7 @@ import { CfnPipeline } from './codepipeline.generated'; import { CrossRegionSupportConstruct, CrossRegionSupportStack } from './cross-region-support-stack'; import { FullActionDescriptor } from './full-action-descriptor'; import { Stage } from './stage'; -import { validateName, validateSourceAction } from "./validation"; +import { validateName, validateNamespaceName, validateSourceAction } from "./validation"; /** * Allows you to control where to place a new Stage when it's added to the Pipeline. @@ -354,15 +354,18 @@ export class Pipeline extends PipelineBase { // get the role for the given action const actionRole = this.getRoleForAction(stage, action, actionScope); + // // CodePipeline Variables + validateNamespaceName(action.actionProperties.variablesNamespace); + // bind the Action - const actionDescriptor = action.bind(actionScope, stage, { + const actionConfig = action.bind(actionScope, stage, { role: actionRole ? actionRole : this.role, bucket: crossRegionInfo.artifactBucket, }); return new FullActionDescriptor({ action, - actionConfig: actionDescriptor, + actionConfig, actionRole, actionRegion: crossRegionInfo.region, }); diff --git a/packages/@aws-cdk/aws-codepipeline/lib/stage.ts b/packages/@aws-cdk/aws-codepipeline/lib/stage.ts index 15b31cefaf1d4..de236a3c30263 100644 --- a/packages/@aws-cdk/aws-codepipeline/lib/stage.ts +++ b/packages/@aws-cdk/aws-codepipeline/lib/stage.ts @@ -157,6 +157,7 @@ export class Stage implements IStage { runOrder: action.runOrder, roleArn: action.role ? action.role.roleArn : undefined, region: action.region, + namespace: action.namespace, }; } diff --git a/packages/@aws-cdk/aws-codepipeline/lib/validation.ts b/packages/@aws-cdk/aws-codepipeline/lib/validation.ts index c30e90eb0c2d4..821a13a2c9a1f 100644 --- a/packages/@aws-cdk/aws-codepipeline/lib/validation.ts +++ b/packages/@aws-cdk/aws-codepipeline/lib/validation.ts @@ -53,6 +53,10 @@ export function validateArtifactName(artifactName: string | undefined): void { validateAgainstRegex(/^[a-zA-Z0-9_-]{1,100}$/, 'Artifact', artifactName); } +export function validateNamespaceName(namespaceName: string | undefined): void { + validateAgainstRegex(/^[A-Za-z0-9@_-]{1,100}$/, 'Namespace', namespaceName); +} + function validateAgainstRegex(regex: RegExp, thing: string, name: string | undefined) { // name could be a Token - in that case, skip validation altogether if (cdk.Token.isUnresolved(name)) { diff --git a/packages/@aws-cdk/aws-codepipeline/package.json b/packages/@aws-cdk/aws-codepipeline/package.json index d5c2a04eeab02..80e9841d45753 100644 --- a/packages/@aws-cdk/aws-codepipeline/package.json +++ b/packages/@aws-cdk/aws-codepipeline/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-codepipeline", - "version": "1.20.0", + "version": "1.21.0", "description": "Better interface to AWS Code Pipeline", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -69,28 +69,28 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kms": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kms": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kms": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kms": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" @@ -120,6 +120,7 @@ "docs-public-apis:@aws-cdk/aws-codepipeline.ActionArtifactBounds.maxOutputs", "docs-public-apis:@aws-cdk/aws-codepipeline.ActionArtifactBounds.minInputs", "docs-public-apis:@aws-cdk/aws-codepipeline.ActionArtifactBounds.minOutputs", + "public-static-props-all-caps:@aws-cdk/aws-codepipeline.GlobalVariables.executionId", "docs-public-apis:@aws-cdk/aws-codepipeline.ActionBindOptions", "docs-public-apis:@aws-cdk/aws-codepipeline.ActionBindOptions.bucket", "docs-public-apis:@aws-cdk/aws-codepipeline.ActionBindOptions.role", diff --git a/packages/@aws-cdk/aws-codepipeline/test/fake-build-action.ts b/packages/@aws-cdk/aws-codepipeline/test/fake-build-action.ts index 4496626a55c25..f1ba06d1f3128 100644 --- a/packages/@aws-cdk/aws-codepipeline/test/fake-build-action.ts +++ b/packages/@aws-cdk/aws-codepipeline/test/fake-build-action.ts @@ -17,10 +17,13 @@ export interface FakeBuildActionProps extends codepipeline.CommonActionProps { account?: string; region?: string; + + customConfigKey?: string; } export class FakeBuildAction implements codepipeline.IAction { public readonly actionProperties: codepipeline.ActionProperties; + private readonly customConfigKey: string | undefined; constructor(props: FakeBuildActionProps) { this.actionProperties = { @@ -31,11 +34,16 @@ export class FakeBuildAction implements codepipeline.IAction { inputs: [props.input, ...props.extraInputs || []], outputs: props.output ? [props.output] : undefined, }; + this.customConfigKey = props.customConfigKey; } public bind(_scope: Construct, _stage: codepipeline.IStage, _options: codepipeline.ActionBindOptions): codepipeline.ActionConfig { - return {}; + return { + configuration: { + CustomConfigKey: this.customConfigKey, + }, + }; } public onStateChange(_name: string, _target?: events.IRuleTarget, _options?: events.RuleProps): events.Rule { diff --git a/packages/@aws-cdk/aws-codepipeline/test/fake-source-action.ts b/packages/@aws-cdk/aws-codepipeline/test/fake-source-action.ts index c6f772e73a7df..099efb65b359a 100644 --- a/packages/@aws-cdk/aws-codepipeline/test/fake-source-action.ts +++ b/packages/@aws-cdk/aws-codepipeline/test/fake-source-action.ts @@ -1,18 +1,23 @@ import * as events from '@aws-cdk/aws-events'; -import { Construct } from '@aws-cdk/core'; +import { Construct, Lazy } from '@aws-cdk/core'; import * as codepipeline from '../lib'; +export interface IFakeSourceActionVariables { + readonly firstVariable: string; +} + export interface FakeSourceActionProps extends codepipeline.CommonActionProps { - output: codepipeline.Artifact; + readonly output: codepipeline.Artifact; - extraOutputs?: codepipeline.Artifact[]; + readonly extraOutputs?: codepipeline.Artifact[]; - region?: string; + readonly region?: string; } export class FakeSourceAction implements codepipeline.IAction { public readonly inputs?: codepipeline.Artifact[]; public readonly outputs?: codepipeline.Artifact[]; + public readonly variables: IFakeSourceActionVariables; public readonly actionProperties: codepipeline.ActionProperties; @@ -24,6 +29,9 @@ export class FakeSourceAction implements codepipeline.IAction { artifactBounds: { minInputs: 0, maxInputs: 0, minOutputs: 1, maxOutputs: 4 }, outputs: [props.output, ...props.extraOutputs || []], }; + this.variables = { + firstVariable: Lazy.stringValue({ produce: () => `#{${this.actionProperties.variablesNamespace}.FirstVariable}` }), + }; } public bind(_scope: Construct, _stage: codepipeline.IStage, _options: codepipeline.ActionBindOptions): diff --git a/packages/@aws-cdk/aws-codepipeline/test/test.variables.ts b/packages/@aws-cdk/aws-codepipeline/test/test.variables.ts new file mode 100644 index 0000000000000..4ae685ee976de --- /dev/null +++ b/packages/@aws-cdk/aws-codepipeline/test/test.variables.ts @@ -0,0 +1,144 @@ +import { expect, haveResourceLike } from '@aws-cdk/assert'; +import * as cdk from '@aws-cdk/core'; +import { Test } from 'nodeunit'; +import * as codepipeline from '../lib'; +import { FakeBuildAction } from './fake-build-action'; +import { FakeSourceAction } from './fake-source-action'; + +// tslint:disable:object-literal-key-quotes + +export = { + 'Pipeline Variables': { + 'uses the passed namespace when its passed when constructing the Action'(test: Test) { + const stack = new cdk.Stack(); + new codepipeline.Pipeline(stack, 'Pipeline', { + stages: [ + { + stageName: 'Source', + actions: [new FakeSourceAction({ + actionName: 'Source', + output: new codepipeline.Artifact(), + variablesNamespace: 'MyNamespace', + })], + }, + ], + }); + + expect(stack, true).to(haveResourceLike('AWS::CodePipeline::Pipeline', { + "Stages": [ + { + "Name": "Source", + "Actions": [ + { + "Name": "Source", + "Namespace": "MyNamespace", + }, + ], + }, + ], + })); + + test.done(); + }, + + 'allows using the variable in the configuration of a different action'(test: Test) { + const stack = new cdk.Stack(); + const sourceOutput = new codepipeline.Artifact(); + const fakeSourceAction = new FakeSourceAction({ + actionName: 'Source', + output: sourceOutput, + variablesNamespace: 'SourceVariables', + }); + new codepipeline.Pipeline(stack, 'Pipeline', { + stages: [ + { + stageName: 'Source', + actions: [fakeSourceAction], + }, + { + stageName: 'Build', + actions: [new FakeBuildAction({ + actionName: 'Build', + input: sourceOutput, + customConfigKey: fakeSourceAction.variables.firstVariable, + })], + }, + ], + }); + + expect(stack).to(haveResourceLike('AWS::CodePipeline::Pipeline', { + "Stages": [ + { + "Name": "Source", + }, + { + "Name": "Build", + "Actions": [ + { + "Name": "Build", + "Configuration": { + "CustomConfigKey": "#{SourceVariables.FirstVariable}", + }, + }, + ], + }, + ], + })); + + test.done(); + }, + + 'fails when trying add an action using variables with an empty string for the namespace to a pipeline'(test: Test) { + const stack = new cdk.Stack(); + const pipeline = new codepipeline.Pipeline(stack, 'Pipeline'); + const sourceStage = pipeline.addStage({ stageName: 'Source' }); + + const sourceAction = new FakeSourceAction({ + actionName: 'Source', + output: new codepipeline.Artifact(), + variablesNamespace: '', + }); + + test.throws(() => { + sourceStage.addAction(sourceAction); + }, /Namespace name must match regular expression:/); + + test.done(); + }, + + 'can use global variables'(test: Test) { + const stack = new cdk.Stack(); + + new codepipeline.Pipeline(stack, 'Pipeline', { + stages: [ + { + stageName: 'Source', + actions: [new FakeBuildAction({ + actionName: 'Build', + input: new codepipeline.Artifact(), + customConfigKey: codepipeline.GlobalVariables.executionId, + })], + }, + ], + }); + + expect(stack, true).to(haveResourceLike('AWS::CodePipeline::Pipeline', { + "Stages": [ + { + "Name": "Source", + "Actions": [ + { + "Name": "Build", + "Configuration": { + "CustomConfigKey": "#{codepipeline.PipelineExecutionId}", + }, + }, + ], + }, + ], + })); + + test.done(); + }, + }, +}; diff --git a/packages/@aws-cdk/aws-codestar/package.json b/packages/@aws-cdk/aws-codestar/package.json index 1acbed7acd8c4..4abd43675c369 100644 --- a/packages/@aws-cdk/aws-codestar/package.json +++ b/packages/@aws-cdk/aws-codestar/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-codestar", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::CodeStar", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,16 +81,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-codestarnotifications/package.json b/packages/@aws-cdk/aws-codestarnotifications/package.json index 84dab09f6da1c..af107a596a6b7 100644 --- a/packages/@aws-cdk/aws-codestarnotifications/package.json +++ b/packages/@aws-cdk/aws-codestarnotifications/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-codestarnotifications", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::CodeStarNotifications", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,16 +81,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-cognito/package.json b/packages/@aws-cdk/aws-cognito/package.json index bb7e45761f00f..1d92b080a5ae8 100644 --- a/packages/@aws-cdk/aws-cognito/package.json +++ b/packages/@aws-cdk/aws-cognito/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-cognito", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::Cognito", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,23 +62,23 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-config/package.json b/packages/@aws-cdk/aws-config/package.json index 59b7f2389d2f4..2a1f96a1dfde1 100644 --- a/packages/@aws-cdk/aws-config/package.json +++ b/packages/@aws-cdk/aws-config/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-config", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::Config", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,29 +62,29 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "@aws-cdk/aws-events-targets": "1.20.0", + "@aws-cdk/assert": "1.21.0", + "@aws-cdk/aws-events-targets": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-datapipeline/package.json b/packages/@aws-cdk/aws-datapipeline/package.json index d0225a4d1641c..0f86703d7bfb2 100644 --- a/packages/@aws-cdk/aws-datapipeline/package.json +++ b/packages/@aws-cdk/aws-datapipeline/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-datapipeline", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::DataPipeline", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,17 +79,17 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-dax/package.json b/packages/@aws-cdk/aws-dax/package.json index 336ffbd775221..292ff66df7194 100644 --- a/packages/@aws-cdk/aws-dax/package.json +++ b/packages/@aws-cdk/aws-dax/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-dax", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::DAX", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,17 +79,17 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-directoryservice/package.json b/packages/@aws-cdk/aws-directoryservice/package.json index bbe093d2f8227..b3a4193f77747 100644 --- a/packages/@aws-cdk/aws-directoryservice/package.json +++ b/packages/@aws-cdk/aws-directoryservice/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-directoryservice", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::DirectoryService", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,17 +79,17 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-dlm/package.json b/packages/@aws-cdk/aws-dlm/package.json index a52ffe6866c22..8d677a5ad8167 100644 --- a/packages/@aws-cdk/aws-dlm/package.json +++ b/packages/@aws-cdk/aws-dlm/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-dlm", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::DLM", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,16 +80,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-dms/package.json b/packages/@aws-cdk/aws-dms/package.json index 57da3b0371615..0597ca321a502 100644 --- a/packages/@aws-cdk/aws-dms/package.json +++ b/packages/@aws-cdk/aws-dms/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-dms", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::DMS", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,17 +79,17 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-docdb/package.json b/packages/@aws-cdk/aws-docdb/package.json index 79a2598380cd9..d12eef3635c17 100644 --- a/packages/@aws-cdk/aws-docdb/package.json +++ b/packages/@aws-cdk/aws-docdb/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-docdb", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::DocDB", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,16 +81,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-dynamodb-global/lambda-packages/aws-global-table-coordinator/package.json b/packages/@aws-cdk/aws-dynamodb-global/lambda-packages/aws-global-table-coordinator/package.json index d91bc9a18b53e..8d5af8bd81b50 100644 --- a/packages/@aws-cdk/aws-dynamodb-global/lambda-packages/aws-global-table-coordinator/package.json +++ b/packages/@aws-cdk/aws-dynamodb-global/lambda-packages/aws-global-table-coordinator/package.json @@ -1,7 +1,7 @@ { "name": "aws-global-lambda-coordinator", "private": true, - "version": "1.20.0", + "version": "1.21.0", "description": "This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.", "main": "lib/handler.js", "directories": { diff --git a/packages/@aws-cdk/aws-dynamodb-global/package.json b/packages/@aws-cdk/aws-dynamodb-global/package.json index 03fbef1595375..24423184b5054 100644 --- a/packages/@aws-cdk/aws-dynamodb-global/package.json +++ b/packages/@aws-cdk/aws-dynamodb-global/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-dynamodb-global", - "version": "1.20.0", + "version": "1.21.0", "description": "Build a global dynamodb table", "license": "Apache-2.0", "homepage": "https://github.com/aws/aws-cdk", @@ -45,27 +45,27 @@ "global" ], "dependencies": { - "@aws-cdk/aws-cloudformation": "1.20.0", - "@aws-cdk/aws-dynamodb": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-cloudformation": "1.21.0", + "@aws-cdk/aws-dynamodb": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "peerDependencies": { - "@aws-cdk/aws-cloudformation": "1.20.0", - "@aws-cdk/aws-dynamodb": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-cloudformation": "1.21.0", + "@aws-cdk/aws-dynamodb": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "scripts": { "build": "cdk-build", diff --git a/packages/@aws-cdk/aws-dynamodb/package.json b/packages/@aws-cdk/aws-dynamodb/package.json index eca2338d8cd35..b7dcfcde109e2 100644 --- a/packages/@aws-cdk/aws-dynamodb/package.json +++ b/packages/@aws-cdk/aws-dynamodb/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-dynamodb", - "version": "1.20.0", + "version": "1.21.0", "description": "CDK Constructs for AWS DynamoDB", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,24 +62,24 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-applicationautoscaling": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-applicationautoscaling": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-applicationautoscaling": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-applicationautoscaling": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-ec2/lib/security-group.ts b/packages/@aws-cdk/aws-ec2/lib/security-group.ts index 1373c811df30b..c900126a606b3 100644 --- a/packages/@aws-cdk/aws-ec2/lib/security-group.ts +++ b/packages/@aws-cdk/aws-ec2/lib/security-group.ts @@ -17,6 +17,11 @@ export interface ISecurityGroup extends IResource, IPeer { */ readonly securityGroupId: string; + /** + * Whether the SecurityGroup has been configured to allow all outbound traffic + */ + readonly allowAllOutbound: boolean; + /** * Add an ingress rule for the current security group * @@ -52,6 +57,7 @@ abstract class SecurityGroupBase extends Resource implements ISecurityGroup { } public abstract readonly securityGroupId: string; + public abstract readonly allowAllOutbound: boolean; public readonly canInlineRule = false; public readonly connections: Connections = new Connections({ securityGroups: [this] }); @@ -294,6 +300,7 @@ export class SecurityGroup extends SecurityGroupBase { public static fromSecurityGroupId(scope: Construct, id: string, securityGroupId: string, options: SecurityGroupImportOptions = {}): ISecurityGroup { class MutableImport extends SecurityGroupBase { public securityGroupId = securityGroupId; + public allowAllOutbound = options.allowAllOutbound ?? true; public addEgressRule(peer: IPeer, connection: Port, description?: string, remoteRule?: boolean) { // Only if allowAllOutbound has been disabled @@ -305,6 +312,7 @@ export class SecurityGroup extends SecurityGroupBase { class ImmutableImport extends SecurityGroupBase { public securityGroupId = securityGroupId; + public allowAllOutbound = options.allowAllOutbound ?? true; public addEgressRule(_peer: IPeer, _connection: Port, _description?: string, _remoteRule?: boolean) { // do nothing @@ -341,12 +349,15 @@ export class SecurityGroup extends SecurityGroupBase { */ public readonly securityGroupVpcId: string; + /** + * Whether the SecurityGroup has been configured to allow all outbound traffic + */ + public readonly allowAllOutbound: boolean; + private readonly securityGroup: CfnSecurityGroup; private readonly directIngressRules: CfnSecurityGroup.IngressProperty[] = []; private readonly directEgressRules: CfnSecurityGroup.EgressProperty[] = []; - private readonly allowAllOutbound: boolean; - constructor(scope: Construct, id: string, props: SecurityGroupProps) { super(scope, id, { physicalName: props.securityGroupName diff --git a/packages/@aws-cdk/aws-ec2/lib/vpc-endpoint.ts b/packages/@aws-cdk/aws-ec2/lib/vpc-endpoint.ts index 16510f853325c..6285f94966929 100644 --- a/packages/@aws-cdk/aws-ec2/lib/vpc-endpoint.ts +++ b/packages/@aws-cdk/aws-ec2/lib/vpc-endpoint.ts @@ -203,6 +203,27 @@ export interface IInterfaceVpcEndpointService { readonly port: number; } +/** + * A custom-hosted service for an interface VPC endpoint. + */ +export class InterfaceVpcEndpointService implements IInterfaceVpcEndpointService { + + /** + * The name of the service. + */ + public readonly name: string; + + /** + * The port of the service. + */ + public readonly port: number; + + constructor(name: string, port?: number) { + this.name = name; + this.port = port || 443; + } +} + /** * An AWS service for an interface VPC endpoint. */ diff --git a/packages/@aws-cdk/aws-ec2/package.json b/packages/@aws-cdk/aws-ec2/package.json index 6ff67e2c7f67c..f4dd3983e898f 100644 --- a/packages/@aws-cdk/aws-ec2/package.json +++ b/packages/@aws-cdk/aws-ec2/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-ec2", - "version": "1.20.0", + "version": "1.21.0", "description": "CDK Constructs for AWS EC2", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,28 +62,28 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-ssm": "1.20.0", - "@aws-cdk/core": "1.20.0", - "@aws-cdk/cx-api": "1.20.0" + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-ssm": "1.21.0", + "@aws-cdk/core": "1.21.0", + "@aws-cdk/cx-api": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-ssm": "1.20.0", - "@aws-cdk/core": "1.20.0", - "@aws-cdk/cx-api": "1.20.0" + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-ssm": "1.21.0", + "@aws-cdk/core": "1.21.0", + "@aws-cdk/cx-api": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-ec2/test/test.vpc-endpoint.ts b/packages/@aws-cdk/aws-ec2/test/test.vpc-endpoint.ts index a2fcaa97b9164..fa538a49b67a6 100644 --- a/packages/@aws-cdk/aws-ec2/test/test.vpc-endpoint.ts +++ b/packages/@aws-cdk/aws-ec2/test/test.vpc-endpoint.ts @@ -3,7 +3,7 @@ import { AnyPrincipal, PolicyStatement } from '@aws-cdk/aws-iam'; import { Stack } from '@aws-cdk/core'; import { Test } from 'nodeunit'; // tslint:disable-next-line:max-line-length -import { GatewayVpcEndpoint, GatewayVpcEndpointAwsService, InterfaceVpcEndpoint, InterfaceVpcEndpointAwsService, SecurityGroup, SubnetType, Vpc } from '../lib'; +import { GatewayVpcEndpoint, GatewayVpcEndpointAwsService, InterfaceVpcEndpoint, InterfaceVpcEndpointAwsService, InterfaceVpcEndpointService, SecurityGroup, SubnetType, Vpc } from '../lib'; export = { 'gateway endpoint': { @@ -332,6 +332,23 @@ export = { }, )); test.done(); - } + }, + 'non-AWS service interface endpoint'(test: Test) { + // GIVEN + const stack = new Stack(); + const vpc = new Vpc(stack, 'VpcNetwork'); + + // WHEN + vpc.addInterfaceEndpoint('YourService', { + service: new InterfaceVpcEndpointService("com.amazonaws.vpce.us-east-1.vpce-svc-uuddlrlrbastrtsvc", 443) + }); + + // THEN + expect(stack).to(haveResource('AWS::EC2::VPCEndpoint', { + ServiceName: "com.amazonaws.vpce.us-east-1.vpce-svc-uuddlrlrbastrtsvc" + })); + + test.done(); + }, } }; diff --git a/packages/@aws-cdk/aws-ecr-assets/lib/image-asset.ts b/packages/@aws-cdk/aws-ecr-assets/lib/image-asset.ts index 1b733aafbab96..cc011d5b928be 100644 --- a/packages/@aws-cdk/aws-ecr-assets/lib/image-asset.ts +++ b/packages/@aws-cdk/aws-ecr-assets/lib/image-asset.ts @@ -5,7 +5,7 @@ import * as fs from 'fs'; import * as path from 'path'; import { AdoptedRepository } from './adopted-repository'; -export interface DockerImageAssetProps extends assets.CopyOptions { +export interface DockerImageAssetProps extends assets.FingerprintOptions { /** * The directory where the Dockerfile is stored */ @@ -93,10 +93,21 @@ export class DockerImageAsset extends Construct implements assets.IAsset { exclude = [...exclude, ...fs.readFileSync(ignore).toString().split('\n').filter(e => !!e)]; } + // include build context in "extra" so it will impact the hash + const extraHash: { [field: string]: any } = { }; + if (props.extraHash) { extraHash.user = props.extraHash; } + if (props.buildArgs) { extraHash.buildArgs = props.buildArgs; } + if (props.target) { extraHash.target = props.target; } + if (props.file) { extraHash.file = props.file; } + if (props.repositoryName) { extraHash.repositoryName = props.repositoryName; } + const staging = new assets.Staging(this, 'Staging', { ...props, exclude, - sourcePath: dir + sourcePath: dir, + extraHash: Object.keys(extraHash).length === 0 + ? undefined + : JSON.stringify(extraHash) }); this.sourceHash = staging.sourceHash; diff --git a/packages/@aws-cdk/aws-ecr-assets/package.json b/packages/@aws-cdk/aws-ecr-assets/package.json index 34f95dcd11e07..be21f9ea40465 100644 --- a/packages/@aws-cdk/aws-ecr-assets/package.json +++ b/packages/@aws-cdk/aws-ecr-assets/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-ecr-assets", - "version": "1.20.0", + "version": "1.21.0", "description": "Docker image assets deployed to ECR", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -59,36 +59,36 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", "@types/proxyquire": "^1.3.28", - "aws-cdk": "1.20.0", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", + "aws-cdk": "1.21.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0", + "pkglint": "1.21.0", "proxyquire": "^2.1.3" }, "dependencies": { - "@aws-cdk/assets": "1.20.0", - "@aws-cdk/aws-cloudformation": "1.20.0", - "@aws-cdk/aws-ecr": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/core": "1.20.0", - "@aws-cdk/cx-api": "1.20.0" + "@aws-cdk/assets": "1.21.0", + "@aws-cdk/aws-cloudformation": "1.21.0", + "@aws-cdk/aws-ecr": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/core": "1.21.0", + "@aws-cdk/cx-api": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/assets": "1.20.0", - "@aws-cdk/aws-cloudformation": "1.20.0", - "@aws-cdk/aws-ecr": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/core": "1.20.0", - "@aws-cdk/cx-api": "1.20.0" + "@aws-cdk/assets": "1.21.0", + "@aws-cdk/aws-cloudformation": "1.21.0", + "@aws-cdk/aws-ecr": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/core": "1.21.0", + "@aws-cdk/cx-api": "1.21.0" }, "nyc": { "statements": 70 diff --git a/packages/@aws-cdk/aws-ecr-assets/test/demo-image-custom-docker-file/Dockerfile b/packages/@aws-cdk/aws-ecr-assets/test/demo-image-custom-docker-file/Dockerfile new file mode 100644 index 0000000000000..123b5670febc8 --- /dev/null +++ b/packages/@aws-cdk/aws-ecr-assets/test/demo-image-custom-docker-file/Dockerfile @@ -0,0 +1,5 @@ +FROM python:3.6 +EXPOSE 8000 +WORKDIR /src +ADD . /src +CMD python3 index.py diff --git a/packages/@aws-cdk/aws-ecr-assets/test/test.image-asset.ts b/packages/@aws-cdk/aws-ecr-assets/test/test.image-asset.ts index 1d109532c433c..5da0630ee6705 100644 --- a/packages/@aws-cdk/aws-ecr-assets/test/test.image-asset.ts +++ b/packages/@aws-cdk/aws-ecr-assets/test/test.image-asset.ts @@ -334,6 +334,29 @@ export = { repositoryName: token }), /Cannot use Token as value of 'repositoryName'/); + test.done(); + }, + + 'docker build options are included in the asset id'(test: Test) { + // GIVEN + const stack = new Stack(); + const directory = path.join(__dirname, 'demo-image-custom-docker-file'); + + const asset1 = new DockerImageAsset(stack, 'Asset1', { directory }); + const asset2 = new DockerImageAsset(stack, 'Asset2', { directory, file: 'Dockerfile.Custom' }); + const asset3 = new DockerImageAsset(stack, 'Asset3', { directory, target: 'NonDefaultTarget' }); + const asset4 = new DockerImageAsset(stack, 'Asset4', { directory, buildArgs: { opt1: '123', opt2: 'boom' } }); + const asset5 = new DockerImageAsset(stack, 'Asset5', { directory, file: 'Dockerfile.Custom', target: 'NonDefaultTarget' }); + const asset6 = new DockerImageAsset(stack, 'Asset6', { directory, extraHash: 'random-extra' }); + const asset7 = new DockerImageAsset(stack, 'Asset7', { directory, repositoryName: 'foo' }); + + test.deepEqual(asset1.sourceHash, 'b84a5001da0f5714e484134e2471213d7e987e22ee6219469029f1779370cc2a'); + test.deepEqual(asset2.sourceHash, 'c6568a7946e92a408c60278f70834b901638e71237d470ed1e5e6d707c55c0c9'); + test.deepEqual(asset3.sourceHash, '963a5329c170c54bc667fddab8d9cc4cec4bffb65ce3a1f323bb5fbc1d268732'); + test.deepEqual(asset4.sourceHash, '0e3eb87273509e0f0d45d67d40fa3080566aa22abd7f976e1ce7ea60a8ccd0a8'); + test.deepEqual(asset5.sourceHash, 'de0fd4b2bff8c9f180351fd59c6f2e9409fa21366453e1e0b75fedbd93dda1fc'); + test.deepEqual(asset6.sourceHash, '00879adf80f97271bf6d7e214b4fac8a043fc6e2661912cbf4d898ccb317d46c'); + test.deepEqual(asset7.sourceHash, 'b8abda995e51bd1a47b2705fa40021f3e9619a334bddb96866e808b09303eff7'); test.done(); } }; diff --git a/packages/@aws-cdk/aws-ecr/package.json b/packages/@aws-cdk/aws-ecr/package.json index 471b03a011bf9..4ee375356847b 100644 --- a/packages/@aws-cdk/aws-ecr/package.json +++ b/packages/@aws-cdk/aws-ecr/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-ecr", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::ECR", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -66,24 +66,24 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/base/application-load-balanced-service-base.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/base/application-load-balanced-service-base.ts index b6a0980732b10..4d305ad2940c2 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/base/application-load-balanced-service-base.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/base/application-load-balanced-service-base.ts @@ -3,7 +3,7 @@ import { IVpc } from '@aws-cdk/aws-ec2'; import { AwsLogDriver, BaseService, CloudMapOptions, Cluster, ContainerImage, ICluster, LogDriver, PropagatedTagSource, Secret } from '@aws-cdk/aws-ecs'; import { ApplicationListener, ApplicationLoadBalancer, ApplicationProtocol, ApplicationTargetGroup, ListenerCertificate } from '@aws-cdk/aws-elasticloadbalancingv2'; import { IRole } from '@aws-cdk/aws-iam'; -import { AddressRecordTarget, ARecord, IHostedZone } from '@aws-cdk/aws-route53'; +import { ARecord, IHostedZone, RecordTarget } from '@aws-cdk/aws-route53'; import { LoadBalancerTarget } from '@aws-cdk/aws-route53-targets'; import * as cdk from '@aws-cdk/core'; @@ -342,7 +342,7 @@ export abstract class ApplicationLoadBalancedServiceBase extends cdk.Construct { const record = new ARecord(this, "DNS", { zone: props.domainZone, recordName: props.domainName, - target: AddressRecordTarget.fromAlias(new LoadBalancerTarget(this.loadBalancer)), + target: RecordTarget.fromAlias(new LoadBalancerTarget(this.loadBalancer)), }); domainName = record.domainName; diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/base/application-multiple-target-groups-service-base.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/base/application-multiple-target-groups-service-base.ts index c29c56a5de8cc..803846f1d7b68 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/base/application-multiple-target-groups-service-base.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/base/application-multiple-target-groups-service-base.ts @@ -4,7 +4,7 @@ import { AwsLogDriver, BaseService, CloudMapOptions, Cluster, ContainerDefinitio Protocol, Secret } from '@aws-cdk/aws-ecs'; import { ApplicationListener, ApplicationLoadBalancer, ApplicationProtocol, ApplicationTargetGroup } from '@aws-cdk/aws-elasticloadbalancingv2'; import { IRole } from '@aws-cdk/aws-iam'; -import { AddressRecordTarget, ARecord, IHostedZone } from '@aws-cdk/aws-route53'; +import { ARecord, IHostedZone, RecordTarget } from '@aws-cdk/aws-route53'; import { LoadBalancerTarget } from '@aws-cdk/aws-route53-targets'; import { CfnOutput, Construct, Duration, Stack } from '@aws-cdk/core'; @@ -561,7 +561,7 @@ export abstract class ApplicationMultipleTargetGroupsServiceBase extends Constru const record = new ARecord(this, `DNS${loadBalancer.node.id}`, { zone, recordName: name, - target: AddressRecordTarget.fromAlias(new LoadBalancerTarget(loadBalancer)), + target: RecordTarget.fromAlias(new LoadBalancerTarget(loadBalancer)), }); domainName = record.domainName; diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/base/network-load-balanced-service-base.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/base/network-load-balanced-service-base.ts index 7e0e355b01b5b..b6dd6492edbef 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/base/network-load-balanced-service-base.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/base/network-load-balanced-service-base.ts @@ -2,7 +2,7 @@ import { IVpc } from '@aws-cdk/aws-ec2'; import { AwsLogDriver, BaseService, CloudMapOptions, Cluster, ContainerImage, ICluster, LogDriver, PropagatedTagSource, Secret } from '@aws-cdk/aws-ecs'; import { NetworkListener, NetworkLoadBalancer, NetworkTargetGroup } from '@aws-cdk/aws-elasticloadbalancingv2'; import { IRole } from '@aws-cdk/aws-iam'; -import { AddressRecordTarget, ARecord, IHostedZone } from '@aws-cdk/aws-route53'; +import { ARecord, IHostedZone, RecordTarget } from '@aws-cdk/aws-route53'; import { LoadBalancerTarget } from '@aws-cdk/aws-route53-targets'; import * as cdk from '@aws-cdk/core'; @@ -287,7 +287,7 @@ export abstract class NetworkLoadBalancedServiceBase extends cdk.Construct { new ARecord(this, "DNS", { zone: props.domainZone, recordName: props.domainName, - target: AddressRecordTarget.fromAlias(new LoadBalancerTarget(this.loadBalancer)), + target: RecordTarget.fromAlias(new LoadBalancerTarget(this.loadBalancer)), }); } diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/base/network-multiple-target-groups-service-base.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/base/network-multiple-target-groups-service-base.ts index 1ed2d0f6b353d..2fc26dcdb586e 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/base/network-multiple-target-groups-service-base.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/base/network-multiple-target-groups-service-base.ts @@ -3,7 +3,7 @@ import { AwsLogDriver, BaseService, CloudMapOptions, Cluster, ContainerDefinitio PropagatedTagSource, Protocol, Secret } from '@aws-cdk/aws-ecs'; import { NetworkListener, NetworkLoadBalancer, NetworkTargetGroup } from '@aws-cdk/aws-elasticloadbalancingv2'; import { IRole } from '@aws-cdk/aws-iam'; -import { AddressRecordTarget, ARecord, IHostedZone } from '@aws-cdk/aws-route53'; +import { ARecord, IHostedZone, RecordTarget } from '@aws-cdk/aws-route53'; import { LoadBalancerTarget } from '@aws-cdk/aws-route53-targets'; import { CfnOutput, Construct, Duration, Stack } from '@aws-cdk/core'; @@ -430,7 +430,7 @@ export abstract class NetworkMultipleTargetGroupsServiceBase extends Construct { new ARecord(this, `DNS${loadBalancer.node.id}`, { zone, recordName: name, - target: AddressRecordTarget.fromAlias(new LoadBalancerTarget(loadBalancer)), + target: RecordTarget.fromAlias(new LoadBalancerTarget(loadBalancer)), }); } } diff --git a/packages/@aws-cdk/aws-ecs-patterns/package.json b/packages/@aws-cdk/aws-ecs-patterns/package.json index b80dff9572b7a..99d2b737d2ce3 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/package.json +++ b/packages/@aws-cdk/aws-ecs-patterns/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-ecs-patterns", - "version": "1.20.0", + "version": "1.21.0", "description": "CDK Constructs for AWS ECS", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -60,45 +60,45 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "jest": "^24.9.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-applicationautoscaling": "1.20.0", - "@aws-cdk/aws-certificatemanager": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-ecs": "1.20.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.20.0", - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-events-targets": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-route53": "1.20.0", - "@aws-cdk/aws-route53-targets": "1.20.0", - "@aws-cdk/aws-servicediscovery": "1.20.0", - "@aws-cdk/aws-sqs": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-applicationautoscaling": "1.21.0", + "@aws-cdk/aws-certificatemanager": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-ecs": "1.21.0", + "@aws-cdk/aws-elasticloadbalancingv2": "1.21.0", + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-events-targets": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-route53": "1.21.0", + "@aws-cdk/aws-route53-targets": "1.21.0", + "@aws-cdk/aws-servicediscovery": "1.21.0", + "@aws-cdk/aws-sqs": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-applicationautoscaling": "1.20.0", - "@aws-cdk/aws-certificatemanager": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-ecs": "1.20.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.20.0", - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-events-targets": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-route53": "1.20.0", - "@aws-cdk/aws-route53-targets": "1.20.0", - "@aws-cdk/aws-servicediscovery": "1.20.0", - "@aws-cdk/aws-sqs": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-applicationautoscaling": "1.21.0", + "@aws-cdk/aws-certificatemanager": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-ecs": "1.21.0", + "@aws-cdk/aws-elasticloadbalancingv2": "1.21.0", + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-events-targets": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-route53": "1.21.0", + "@aws-cdk/aws-route53-targets": "1.21.0", + "@aws-cdk/aws-servicediscovery": "1.21.0", + "@aws-cdk/aws-sqs": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-ecs/README.md b/packages/@aws-cdk/aws-ecs/README.md index 446fb8ed1dd63..80b299f670175 100644 --- a/packages/@aws-cdk/aws-ecs/README.md +++ b/packages/@aws-cdk/aws-ecs/README.md @@ -53,9 +53,9 @@ const ecsService = new ecs.Ec2Service(this, 'Service', { For a set of constructs defining common ECS architectural patterns, see the `@aws-cdk/aws-ecs-patterns` package. -## AWS Fargate vs Amazon ECS +## Launch Types: AWS Fargate vs Amazon EC2 -There are two sets of constructs in this library; one to run tasks on Amazon ECS and +There are two sets of constructs in this library; one to run tasks on Amazon EC2 and one to run tasks on AWS Fargate. - Use the `Ec2TaskDefinition` and `Ec2Service` constructs to run tasks on Amazon EC2 instances running in your account. diff --git a/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts b/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts index 9220b2e4d5da6..13877c0785126 100644 --- a/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts +++ b/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts @@ -1,5 +1,5 @@ import * as ec2 from '@aws-cdk/aws-ec2'; -import { Construct, Lazy, Resource } from '@aws-cdk/core'; +import { Construct, Lazy, Resource, Stack } from '@aws-cdk/core'; import { BaseService, BaseServiceOptions, IService, LaunchType, PropagatedTagSource } from '../base/base-service'; import { NetworkMode, TaskDefinition } from '../base/task-definition'; import { CfnService } from '../ecs.generated'; @@ -160,9 +160,16 @@ export class Ec2Service extends BaseService implements IEc2Service { if (props.taskDefinition.networkMode === NetworkMode.AWS_VPC) { this.configureAwsVpcNetworking(props.cluster.vpc, props.assignPublicIp, props.vpcSubnets, props.securityGroup); } else { - // Either None, Bridge or Host networking. Copy SecurityGroup from ASG. + // Either None, Bridge or Host networking. Copy SecurityGroups from ASG. + // We have to be smart here -- by default future Security Group rules would be created + // in the Cluster stack. However, if the Cluster is in a different stack than us, + // that will lead to a cyclic reference (we point to that stack for the cluster name, + // but that stack will point to the ALB probably created right next to us). + // + // In that case, reference the same security groups but make sure new rules are + // created in the current scope (i.e., this stack) validateNoNetworkingProps(props); - this.connections.addSecurityGroup(...props.cluster.connections.securityGroups); + this.connections.addSecurityGroup(...securityGroupsInThisStack(this, props.cluster.connections.securityGroups)); } this.addPlacementConstraints(...props.placementConstraints || []); @@ -218,6 +225,28 @@ function validateNoNetworkingProps(props: Ec2ServiceProps) { } } +/** + * Force security group rules to be created in this stack. + * + * For every security group, if the scope and the group are in different stacks, return + * a fake "imported" security group instead. This will behave as the original security group, + * but new Ingress and Egress rule resources will be added in the current stack instead of the + * other one. + */ +function securityGroupsInThisStack(scope: Construct, groups: ec2.ISecurityGroup[]): ec2.ISecurityGroup[] { + const thisStack = Stack.of(scope); + + let i = 1; + return groups.map(group => { + if (thisStack === Stack.of(group)) { return group; } // Simple case, just return the original one + + return ec2.SecurityGroup.fromSecurityGroupId(scope, `SecurityGroup${i++}`, group.securityGroupId, { + allowAllOutbound: group.allowAllOutbound, + mutable: true, + }); + }); +} + /** * The built-in container instance attributes */ diff --git a/packages/@aws-cdk/aws-ecs/package.json b/packages/@aws-cdk/aws-ecs/package.json index a47f24ea813d6..08160d1cfb256 100644 --- a/packages/@aws-cdk/aws-ecs/package.json +++ b/packages/@aws-cdk/aws-ecs/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-ecs", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::ECS", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,66 +62,66 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", "@types/proxyquire": "^1.3.28", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0", + "pkglint": "1.21.0", "proxyquire": "^2.1.3" }, "dependencies": { - "@aws-cdk/aws-applicationautoscaling": "1.20.0", - "@aws-cdk/aws-autoscaling": "1.20.0", - "@aws-cdk/aws-autoscaling-hooktargets": "1.20.0", - "@aws-cdk/aws-certificatemanager": "1.20.0", - "@aws-cdk/aws-cloudformation": "1.20.0", - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-ecr": "1.20.0", - "@aws-cdk/aws-ecr-assets": "1.20.0", - "@aws-cdk/aws-elasticloadbalancing": "1.20.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-logs": "1.20.0", - "@aws-cdk/aws-route53": "1.20.0", - "@aws-cdk/aws-route53-targets": "1.20.0", - "@aws-cdk/aws-secretsmanager": "1.20.0", - "@aws-cdk/aws-servicediscovery": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/aws-sqs": "1.20.0", - "@aws-cdk/aws-ssm": "1.20.0", - "@aws-cdk/core": "1.20.0", - "@aws-cdk/cx-api": "1.20.0" + "@aws-cdk/aws-applicationautoscaling": "1.21.0", + "@aws-cdk/aws-autoscaling": "1.21.0", + "@aws-cdk/aws-autoscaling-hooktargets": "1.21.0", + "@aws-cdk/aws-certificatemanager": "1.21.0", + "@aws-cdk/aws-cloudformation": "1.21.0", + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-ecr": "1.21.0", + "@aws-cdk/aws-ecr-assets": "1.21.0", + "@aws-cdk/aws-elasticloadbalancing": "1.21.0", + "@aws-cdk/aws-elasticloadbalancingv2": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-logs": "1.21.0", + "@aws-cdk/aws-route53": "1.21.0", + "@aws-cdk/aws-route53-targets": "1.21.0", + "@aws-cdk/aws-secretsmanager": "1.21.0", + "@aws-cdk/aws-servicediscovery": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/aws-sqs": "1.21.0", + "@aws-cdk/aws-ssm": "1.21.0", + "@aws-cdk/core": "1.21.0", + "@aws-cdk/cx-api": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-applicationautoscaling": "1.20.0", - "@aws-cdk/aws-autoscaling": "1.20.0", - "@aws-cdk/aws-autoscaling-hooktargets": "1.20.0", - "@aws-cdk/aws-certificatemanager": "1.20.0", - "@aws-cdk/aws-cloudformation": "1.20.0", - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-ecr": "1.20.0", - "@aws-cdk/aws-ecr-assets": "1.20.0", - "@aws-cdk/aws-elasticloadbalancing": "1.20.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-logs": "1.20.0", - "@aws-cdk/aws-route53": "1.20.0", - "@aws-cdk/aws-route53-targets": "1.20.0", - "@aws-cdk/aws-secretsmanager": "1.20.0", - "@aws-cdk/aws-servicediscovery": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/aws-sqs": "1.20.0", - "@aws-cdk/aws-ssm": "1.20.0", - "@aws-cdk/core": "1.20.0", - "@aws-cdk/cx-api": "1.20.0" + "@aws-cdk/aws-applicationautoscaling": "1.21.0", + "@aws-cdk/aws-autoscaling": "1.21.0", + "@aws-cdk/aws-autoscaling-hooktargets": "1.21.0", + "@aws-cdk/aws-certificatemanager": "1.21.0", + "@aws-cdk/aws-cloudformation": "1.21.0", + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-ecr": "1.21.0", + "@aws-cdk/aws-ecr-assets": "1.21.0", + "@aws-cdk/aws-elasticloadbalancing": "1.21.0", + "@aws-cdk/aws-elasticloadbalancingv2": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-logs": "1.21.0", + "@aws-cdk/aws-route53": "1.21.0", + "@aws-cdk/aws-route53-targets": "1.21.0", + "@aws-cdk/aws-secretsmanager": "1.21.0", + "@aws-cdk/aws-servicediscovery": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/aws-sqs": "1.21.0", + "@aws-cdk/aws-ssm": "1.21.0", + "@aws-cdk/core": "1.21.0", + "@aws-cdk/cx-api": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-ecs/test/ec2/test.cross-stack.ts b/packages/@aws-cdk/aws-ecs/test/ec2/test.cross-stack.ts new file mode 100644 index 0000000000000..fee694d75cd0f --- /dev/null +++ b/packages/@aws-cdk/aws-ecs/test/ec2/test.cross-stack.ts @@ -0,0 +1,100 @@ +import { expect, haveResource } from '@aws-cdk/assert'; +import * as ec2 from '@aws-cdk/aws-ec2'; +import * as elbv2 from '@aws-cdk/aws-elasticloadbalancingv2'; +import { App, Stack } from '@aws-cdk/core'; +import { Test } from 'nodeunit'; +import * as ecs from '../../lib'; + +// Test various cross-stack Cluster/Service/ALB scenario's + +let app: App; +let stack1: Stack; +let stack2: Stack; +let cluster: ecs.Cluster; +let service: ecs.Ec2Service; + +export = { + "setUp"(cb: () => void) { + app = new App(); + + stack1 = new Stack(app, 'Stack1'); + const vpc = new ec2.Vpc(stack1, 'Vpc'); + cluster = new ecs.Cluster(stack1, 'Cluster', { + vpc, + capacity: { instanceType: new ec2.InstanceType('t2.micro'), } + }); + + stack2 = new Stack(app, 'Stack2'); + const taskDefinition = new ecs.Ec2TaskDefinition(stack2, 'TD'); + const container = taskDefinition.addContainer('Main', { + image: ecs.ContainerImage.fromRegistry('asdf'), + memoryLimitMiB: 512 + }); + container.addPortMappings({ containerPort: 8000 }); + + service = new ecs.Ec2Service(stack2, 'Service', { + cluster, + taskDefinition, + }); + + cb(); + }, + + "ALB next to Service"(test: Test) { + // WHEN + const lb = new elbv2.ApplicationLoadBalancer(stack2, "ALB", { vpc: cluster.vpc }); + const listener = lb.addListener("listener", { port: 80 }); + listener.addTargets("target", { + port: 80, + targets: [service] + }); + + // THEN: it shouldn't throw due to cyclic dependencies + expect(stack2).to(haveResource('AWS::ECS::Service')); + + expectIngress(stack2); + + test.done(); + }, + + "ALB next to Cluster"(test: Test) { + // WHEN + const lb = new elbv2.ApplicationLoadBalancer(stack1, "ALB", { vpc: cluster.vpc }); + const listener = lb.addListener("listener", { port: 80 }); + listener.addTargets("target", { + port: 80, + targets: [service] + }); + + // THEN: it shouldn't throw due to cyclic dependencies + expect(stack2).to(haveResource('AWS::ECS::Service')); + expectIngress(stack2); + + test.done(); + }, + + "ALB in its own stack"(test: Test) { + // WHEN + const stack3 = new Stack(app, 'Stack3'); + const lb = new elbv2.ApplicationLoadBalancer(stack3, "ALB", { vpc: cluster.vpc }); + const listener = lb.addListener("listener", { port: 80 }); + listener.addTargets("target", { + port: 80, + targets: [service] + }); + + // THEN: it shouldn't throw due to cyclic dependencies + expect(stack2).to(haveResource('AWS::ECS::Service')); + expectIngress(stack2); + + test.done(); + }, +}; + +function expectIngress(stack: Stack) { + expect(stack).to(haveResource('AWS::EC2::SecurityGroupIngress', { + FromPort: 32768, + ToPort: 65535, + GroupId: { "Fn::ImportValue": "Stack1:ExportsOutputFnGetAttClusterDefaultAutoScalingGroupInstanceSecurityGroup1D15236AGroupIdEAB9C5E1" }, + })); +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-efs/package.json b/packages/@aws-cdk/aws-efs/package.json index 81be0e5f488aa..9f902a00d9741 100644 --- a/packages/@aws-cdk/aws-efs/package.json +++ b/packages/@aws-cdk/aws-efs/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-efs", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::EFS", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,17 +79,17 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-eks-legacy/package.json b/packages/@aws-cdk/aws-eks-legacy/package.json index bd79397703d0a..723f7ab7b929c 100644 --- a/packages/@aws-cdk/aws-eks-legacy/package.json +++ b/packages/@aws-cdk/aws-eks-legacy/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-eks-legacy", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::EKS (Legacy)", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,32 +62,32 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-autoscaling": "1.20.0", - "@aws-cdk/aws-cloudformation": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-ssm": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-autoscaling": "1.21.0", + "@aws-cdk/aws-cloudformation": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-ssm": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-autoscaling": "1.20.0", - "@aws-cdk/aws-cloudformation": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-ssm": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-autoscaling": "1.21.0", + "@aws-cdk/aws-cloudformation": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-ssm": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-eks/package.json b/packages/@aws-cdk/aws-eks/package.json index 220a31d771d03..f53ba79b70010 100644 --- a/packages/@aws-cdk/aws-eks/package.json +++ b/packages/@aws-cdk/aws-eks/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-eks", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::EKS", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,35 +62,35 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "aws-sdk": "^2.599.0", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "aws-sdk": "^2.601.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-autoscaling": "1.20.0", - "@aws-cdk/aws-cloudformation": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-ssm": "1.20.0", - "@aws-cdk/core": "1.20.0", - "@aws-cdk/custom-resources": "1.20.0" + "@aws-cdk/aws-autoscaling": "1.21.0", + "@aws-cdk/aws-cloudformation": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-ssm": "1.21.0", + "@aws-cdk/core": "1.21.0", + "@aws-cdk/custom-resources": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-autoscaling": "1.20.0", - "@aws-cdk/aws-cloudformation": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-ssm": "1.20.0", - "@aws-cdk/core": "1.20.0", - "@aws-cdk/custom-resources": "1.20.0" + "@aws-cdk/aws-autoscaling": "1.21.0", + "@aws-cdk/aws-cloudformation": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-ssm": "1.21.0", + "@aws-cdk/core": "1.21.0", + "@aws-cdk/custom-resources": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-elasticache/package.json b/packages/@aws-cdk/aws-elasticache/package.json index 5f585406bee32..93eb2b0694f14 100644 --- a/packages/@aws-cdk/aws-elasticache/package.json +++ b/packages/@aws-cdk/aws-elasticache/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-elasticache", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::ElastiCache", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,17 +79,17 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-elasticbeanstalk/package.json b/packages/@aws-cdk/aws-elasticbeanstalk/package.json index b6eb689fb6c70..57abc201cec70 100644 --- a/packages/@aws-cdk/aws-elasticbeanstalk/package.json +++ b/packages/@aws-cdk/aws-elasticbeanstalk/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-elasticbeanstalk", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::ElasticBeanstalk", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,17 +79,17 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-elasticloadbalancing/package.json b/packages/@aws-cdk/aws-elasticloadbalancing/package.json index a52624b55cc90..0791d0b10045d 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancing/package.json +++ b/packages/@aws-cdk/aws-elasticloadbalancing/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-elasticloadbalancing", - "version": "1.20.0", + "version": "1.21.0", "description": "CDK Constructs for AWS ElasticLoadBalancing", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,22 +62,22 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2-targets/package.json b/packages/@aws-cdk/aws-elasticloadbalancingv2-targets/package.json index 23e61c8b06a49..7076e5607e9df 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2-targets/package.json +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2-targets/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-elasticloadbalancingv2-targets", - "version": "1.20.0", + "version": "1.21.0", "description": "Integration targets for AWS ElasticLoadBalancingV2", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -77,28 +77,28 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", "jest": "^24.9.0", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/assets": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/assets": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-elasticloadbalancingv2": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/assets": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/assets": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-elasticloadbalancingv2": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-load-balancer.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-load-balancer.ts index d05a44bfb7f94..0a4cb0ac3eaeb 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-load-balancer.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-load-balancer.ts @@ -29,7 +29,9 @@ export interface BaseLoadBalancerProps { /** * Where in the VPC to place the load balancer * - * @default - Public subnets if internetFacing, otherwise private subnets. + * @default - Public subnets if internetFacing, Private subnets if internal and + * there are Private subnets, Isolated subnets if internal and there are no + * Private subnets. */ readonly vpcSubnets?: ec2.SubnetSelection; @@ -128,8 +130,7 @@ export abstract class BaseLoadBalancer extends Resource { const internetFacing = ifUndefined(baseProps.internetFacing, false); const vpcSubnets = ifUndefined(baseProps.vpcSubnets, - { subnetType: internetFacing ? ec2.SubnetType.PUBLIC : ec2.SubnetType.PRIVATE }); - + (internetFacing ? {subnetType: ec2.SubnetType.PUBLIC} : {}) ); const { subnetIds, internetConnectivityEstablished } = baseProps.vpc.selectSubnets(vpcSubnets); this.vpc = baseProps.vpc; diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json b/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json index 037158458417c..2656015c43eaf 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-elasticloadbalancingv2", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::ElasticLoadBalancingV2", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,32 +62,32 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-certificatemanager": "1.20.0", - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-certificatemanager": "1.21.0", + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-certificatemanager": "1.20.0", - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-certificatemanager": "1.21.0", + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/nlb/test.load-balancer.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/nlb/test.load-balancer.ts index 1977dd8425ce5..5c0046e186013 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/nlb/test.load-balancer.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/nlb/test.load-balancer.ts @@ -90,6 +90,174 @@ export = { Name: 'myLoadBalancer' })); test.done(); - } + }, + + 'Trivial construction: internal with Isolated subnets only'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'VPC', { + subnetConfiguration: [{ + cidrMask: 20, + name: 'Isolated', + subnetType: ec2.SubnetType.ISOLATED, + }] + }); + + // WHEN + new elbv2.NetworkLoadBalancer(stack, 'LB', { + vpc, + internetFacing: false, + }); + + // THEN + expect(stack).to(haveResource('AWS::ElasticLoadBalancingV2::LoadBalancer', { + Scheme: "internal", + Subnets: [ + { Ref: "VPCIsolatedSubnet1SubnetEBD00FC6" }, + { Ref: "VPCIsolatedSubnet2Subnet4B1C8CAA" }, + ], + Type: "network" + })); + + test.done(); + }, + 'Internal with Public, Private, and Isolated subnets'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'VPC', { + subnetConfiguration: [{ + cidrMask: 24, + name: 'Public', + subnetType: ec2.SubnetType.PUBLIC, + }, { + cidrMask: 24, + name: 'Private', + subnetType: ec2.SubnetType.PRIVATE, + }, { + cidrMask: 28, + name: 'Isolated', + subnetType: ec2.SubnetType.ISOLATED, + } + ] + }); + // WHEN + new elbv2.NetworkLoadBalancer(stack, 'LB', { + vpc, + internetFacing: false, + }); + + // THEN + expect(stack).to(haveResource('AWS::ElasticLoadBalancingV2::LoadBalancer', { + Scheme: "internal", + Subnets: [ + { Ref: "VPCPrivateSubnet1Subnet8BCA10E0" }, + { Ref: "VPCPrivateSubnet2SubnetCFCDAA7A" }, + ], + Type: "network" + })); + + test.done(); + }, + 'Internet-facing with Public, Private, and Isolated subnets'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'VPC', { + subnetConfiguration: [{ + cidrMask: 24, + name: 'Public', + subnetType: ec2.SubnetType.PUBLIC, + }, { + cidrMask: 24, + name: 'Private', + subnetType: ec2.SubnetType.PRIVATE, + }, { + cidrMask: 28, + name: 'Isolated', + subnetType: ec2.SubnetType.ISOLATED, + } + ] + }); + + // WHEN + new elbv2.NetworkLoadBalancer(stack, 'LB', { + vpc, + internetFacing: true, + }); + + // THEN + expect(stack).to(haveResource('AWS::ElasticLoadBalancingV2::LoadBalancer', { + Scheme: "internet-facing", + Subnets: [ + { Ref: "VPCPublicSubnet1SubnetB4246D30" }, + { Ref: "VPCPublicSubnet2Subnet74179F39" }, + ], + Type: "network" + })); + + test.done(); + }, + 'Internal load balancer supplying public subnets'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'VPC'); + + // WHEN + new elbv2.NetworkLoadBalancer(stack, 'LB', { + vpc, + internetFacing: false, + vpcSubnets: {subnetType: ec2.SubnetType.PUBLIC} + }); + + // THEN + expect(stack).to(haveResource('AWS::ElasticLoadBalancingV2::LoadBalancer', { + Scheme: "internal", + Subnets: [ + { Ref: "VPCPublicSubnet1SubnetB4246D30" }, + { Ref: "VPCPublicSubnet2Subnet74179F39" }, + ], + Type: "network" + })); + + test.done(); + }, + 'Internal load balancer supplying isolated subnets'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'VPC', { + subnetConfiguration: [{ + cidrMask: 24, + name: 'Public', + subnetType: ec2.SubnetType.PUBLIC, + }, { + cidrMask: 24, + name: 'Private', + subnetType: ec2.SubnetType.PRIVATE, + }, { + cidrMask: 28, + name: 'Isolated', + subnetType: ec2.SubnetType.ISOLATED, + } + ] + }); + + // WHEN + new elbv2.NetworkLoadBalancer(stack, 'LB', { + vpc, + internetFacing: false, + vpcSubnets: {subnetType: ec2.SubnetType.ISOLATED} + }); + + // THEN + expect(stack).to(haveResource('AWS::ElasticLoadBalancingV2::LoadBalancer', { + Scheme: "internal", + Subnets: [ + { Ref: "VPCIsolatedSubnet1SubnetEBD00FC6" }, + { Ref: "VPCIsolatedSubnet2Subnet4B1C8CAA" }, + ], + Type: "network" + })); + + test.done(); + } }; diff --git a/packages/@aws-cdk/aws-elasticsearch/package.json b/packages/@aws-cdk/aws-elasticsearch/package.json index 22bde287f72cd..67a7f8a5a3606 100644 --- a/packages/@aws-cdk/aws-elasticsearch/package.json +++ b/packages/@aws-cdk/aws-elasticsearch/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-elasticsearch", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::Elasticsearch", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,17 +79,17 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-emr/package.json b/packages/@aws-cdk/aws-emr/package.json index ac6fc2d7a477b..86864e79fea83 100644 --- a/packages/@aws-cdk/aws-emr/package.json +++ b/packages/@aws-cdk/aws-emr/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-emr", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::EMR", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,17 +79,17 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-events-targets/package.json b/packages/@aws-cdk/aws-events-targets/package.json index d595cb111ed16..2fc2f9718cd1e 100644 --- a/packages/@aws-cdk/aws-events-targets/package.json +++ b/packages/@aws-cdk/aws-events-targets/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-events-targets", - "version": "1.20.0", + "version": "1.21.0", "description": "Event targets for AWS CloudWatch Events", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -48,7 +48,7 @@ }, "cdk-build": { "pre": [ - "cp -f $(node -p 'require.resolve(\"aws-sdk/apis/metadata.json\")') lib/sdk-api-metadata.json" + "cp -f $(node -p 'require.resolve(\"aws-sdk/apis/metadata.json\")') lib/sdk-api-metadata.json && rm -f lib/sdk-api-metadata.d.ts" ] }, "jest": { @@ -84,45 +84,45 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "@aws-cdk/aws-codecommit": "1.20.0", - "aws-sdk": "^2.599.0", + "@aws-cdk/assert": "1.21.0", + "@aws-cdk/aws-codecommit": "1.21.0", + "aws-sdk": "^2.601.0", "aws-sdk-mock": "^5.0.0", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", "jest": "^24.9.0", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-cloudformation": "1.20.0", - "@aws-cdk/aws-codebuild": "1.20.0", - "@aws-cdk/aws-codepipeline": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-ecs": "1.20.0", - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/aws-sns-subscriptions": "1.20.0", - "@aws-cdk/aws-sqs": "1.20.0", - "@aws-cdk/aws-stepfunctions": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-cloudformation": "1.21.0", + "@aws-cdk/aws-codebuild": "1.21.0", + "@aws-cdk/aws-codepipeline": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-ecs": "1.21.0", + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/aws-sns-subscriptions": "1.21.0", + "@aws-cdk/aws-sqs": "1.21.0", + "@aws-cdk/aws-stepfunctions": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-cloudformation": "1.20.0", - "@aws-cdk/aws-codebuild": "1.20.0", - "@aws-cdk/aws-codepipeline": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-ecs": "1.20.0", - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/aws-sns-subscriptions": "1.20.0", - "@aws-cdk/aws-sqs": "1.20.0", - "@aws-cdk/aws-stepfunctions": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-cloudformation": "1.21.0", + "@aws-cdk/aws-codebuild": "1.21.0", + "@aws-cdk/aws-codepipeline": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-ecs": "1.21.0", + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/aws-sns-subscriptions": "1.21.0", + "@aws-cdk/aws-sqs": "1.21.0", + "@aws-cdk/aws-stepfunctions": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-events/package.json b/packages/@aws-cdk/aws-events/package.json index 9995f93e5bafc..7caa5cc4343c1 100644 --- a/packages/@aws-cdk/aws-events/package.json +++ b/packages/@aws-cdk/aws-events/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-events", - "version": "1.20.0", + "version": "1.21.0", "description": "AWS CloudWatch Events Construct Library", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -63,21 +63,21 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-eventschemas/package.json b/packages/@aws-cdk/aws-eventschemas/package.json index f7493497c2dc6..b91f7b08ba91e 100644 --- a/packages/@aws-cdk/aws-eventschemas/package.json +++ b/packages/@aws-cdk/aws-eventschemas/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-eventschemas", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::EventSchemas", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,16 +81,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-fsx/package.json b/packages/@aws-cdk/aws-fsx/package.json index 1b0a6e018d390..20fde7c08c1cb 100644 --- a/packages/@aws-cdk/aws-fsx/package.json +++ b/packages/@aws-cdk/aws-fsx/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-fsx", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::FSx", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,16 +81,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-gamelift/package.json b/packages/@aws-cdk/aws-gamelift/package.json index 2ee1157b2506d..f559b373c491e 100644 --- a/packages/@aws-cdk/aws-gamelift/package.json +++ b/packages/@aws-cdk/aws-gamelift/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-gamelift", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::GameLift", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,17 +79,17 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-glue/lib/table.ts b/packages/@aws-cdk/aws-glue/lib/table.ts index d204cbdafb1b3..92532d22b564e 100644 --- a/packages/@aws-cdk/aws-glue/lib/table.ts +++ b/packages/@aws-cdk/aws-glue/lib/table.ts @@ -236,7 +236,7 @@ export class Table extends Resource implements ITable { this.database = props.database; this.dataFormat = props.dataFormat; - this.s3Prefix = props.s3Prefix || 'data/'; + this.s3Prefix = (props.s3Prefix !== undefined && props.s3Prefix !== null) ? props.s3Prefix : 'data/'; validateSchema(props.columns, props.partitionKeys); this.columns = props.columns; diff --git a/packages/@aws-cdk/aws-glue/package.json b/packages/@aws-cdk/aws-glue/package.json index 64115058a4720..8036380594423 100644 --- a/packages/@aws-cdk/aws-glue/package.json +++ b/packages/@aws-cdk/aws-glue/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-glue", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::Glue", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,26 +62,26 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kms": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kms": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kms": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kms": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-glue/test/test.table.ts b/packages/@aws-cdk/aws-glue/test/test.table.ts index 357f27135dc95..69701ea2924be 100644 --- a/packages/@aws-cdk/aws-glue/test/test.table.ts +++ b/packages/@aws-cdk/aws-glue/test/test.table.ts @@ -1079,6 +1079,74 @@ export = { test.done(); }, + 'explicit s3 bucket and with empty prefix'(test: Test) { + const app = new cdk.App(); + const dbStack = new cdk.Stack(app, 'db'); + const stack = new cdk.Stack(app, 'app'); + const bucket = new s3.Bucket(stack, 'ExplicitBucket'); + const database = new glue.Database(dbStack, 'Database', { + databaseName: 'database', + }); + + new glue.Table(stack, 'Table', { + database, + bucket, + s3Prefix: '', + tableName: 'table', + columns: [{ + name: 'col', + type: glue.Schema.STRING + }], + dataFormat: glue.DataFormat.Json, + }); + + expect(stack).to(haveResource('AWS::Glue::Table', { + CatalogId: { + Ref: "AWS::AccountId" + }, + DatabaseName: { + "Fn::ImportValue": "db:ExportsOutputRefDatabaseB269D8BB88F4B1C4" + }, + TableInput: { + Description: "table generated by CDK", + Name: "table", + Parameters: { + has_encrypted_data: false + }, + StorageDescriptor: { + Columns: [ + { + Name: "col", + Type: "string" + } + ], + Compressed: false, + InputFormat: "org.apache.hadoop.mapred.TextInputFormat", + Location: { + "Fn::Join": [ + "", + [ + "s3://", + { + Ref: "ExplicitBucket0AA51A3F" + }, + "/" + ] + ] + }, + OutputFormat: "org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat", + SerdeInfo: { + SerializationLibrary: "org.openx.data.jsonserde.JsonSerDe" + }, + StoredAsSubDirectories: false + }, + TableType: "EXTERNAL_TABLE" + } + })); + + test.done(); + }, + 'grants': { 'read only'(test: Test) { const stack = new cdk.Stack(); diff --git a/packages/@aws-cdk/aws-greengrass/package.json b/packages/@aws-cdk/aws-greengrass/package.json index 9fd2fc52ae7cf..f316cb0ce8969 100644 --- a/packages/@aws-cdk/aws-greengrass/package.json +++ b/packages/@aws-cdk/aws-greengrass/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-greengrass", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::Greengrass", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,16 +81,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-guardduty/package.json b/packages/@aws-cdk/aws-guardduty/package.json index aebb4180d14c9..12861a9547654 100644 --- a/packages/@aws-cdk/aws-guardduty/package.json +++ b/packages/@aws-cdk/aws-guardduty/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-guardduty", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::GuardDuty", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,17 +79,17 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-iam/README.md b/packages/@aws-cdk/aws-iam/README.md index aefeaef3c028d..1e783fb628870 100644 --- a/packages/@aws-cdk/aws-iam/README.md +++ b/packages/@aws-cdk/aws-iam/README.md @@ -47,9 +47,78 @@ The `grant*` methods accept an `IGrantable` object. This interface is implemente You can find which `grant*` methods exist for a resource in the [AWS CDK API Reference](https://docs.aws.amazon.com/cdk/api/latest/docs/aws-construct-library.html). +### Roles + +Many AWS resources require *Roles* to operate. These Roles define the AWS API +calls an instance or other AWS service is allowed to make. + +Creating Roles and populating them with the right permissions *Statements* is +a necessary but tedious part of setting up AWS infrastructure. In order to +help you focus on your business logic, CDK will take care of creating +roles and populating them with least-privilege permissions automatically. + +All constructs that require Roles will create one for you if don't specify +one at construction time. Permissions will be added to that role +automatically if you associate the construct with other constructs from the +AWS Construct Library (for example, if you tell an *AWS CodePipeline* to trigger +an *AWS Lambda Function*, the Pipeline's Role will automatically get +`lambda:InvokeFunction` permissions on that particular Lambda Function), +or if you explicitly grant permissions using `grant` functions (see the +previous section). + +#### Opting out of automatic permissions management + +You may prefer to manage a Role's permissions yourself instead of having the +CDK automatically manage them for you. This may happen in one of the +following cases: + +* You don't like the permissions that CDK automatically generates and + want to substitute your own set. +* The least-permissions policy that the CDK generates is becoming too + big for IAM to store, and you need to add some wildcards to keep the + policy size down. + +To prevent constructs from updating your Role's policy, pass the object +returned by `myRole.withoutPolicyUpdates()` instead of `myRole` itself. + +For example, to have an AWS CodePipeline *not* automatically add the required +permissions to trigger the expected targets, do the following: + +```ts +const role = new iam.Role(this, 'Role', { + assumedBy: new iam.ServicePrincipal('codepipeline.amazonaws.com'), +}); + +new codepipeline.Pipeline(this, 'Pipeline', { + // Give the Pipeline an immutable view of the Role + role: role.withoutPolicyUpdates(), +}); + +// You now have to manage the Role policies yourself +role.addToPolicy(new iam.PolicyStatement({ + action: [/* whatever actions you want */], + resource: [/* whatever resources you intend to touch */], +}); +``` + +#### Using existing roles + +If there are Roles in your account that have already been created which you +would like to use in your CDK application, you can use `Role.fromRoleArn` to +import them, as follows: + +```ts +const role = iam.Role.fromRoleArn(this, 'Role', 'arn:aws:iam::123456789012:role/MyExistingRole', { + // Set 'mutable' to 'false' to use the role as-is and prevent adding new + // policies to it. The default is 'true', which means the role may be + // modified as part of the deployment. + mutable: false, +}); +``` + ### Configuring an ExternalId -If you need to create roles that will be assumed by 3rd parties, it is generally a good idea to [require an `ExternalId` +If you need to create Roles that will be assumed by 4rd parties, it is generally a good idea to [require an `ExternalId` to assume them](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html). Configuring an `ExternalId` works like this: diff --git a/packages/@aws-cdk/aws-iam/lib/private/immutable-role.ts b/packages/@aws-cdk/aws-iam/lib/private/immutable-role.ts new file mode 100644 index 0000000000000..d894cc8dbc722 --- /dev/null +++ b/packages/@aws-cdk/aws-iam/lib/private/immutable-role.ts @@ -0,0 +1,58 @@ +import { DependableTrait } from '@aws-cdk/core'; +import { Grant } from '../grant'; +import { IManagedPolicy } from '../managed-policy'; +import { Policy } from '../policy'; +import { PolicyStatement } from '../policy-statement'; +import { IPrincipal } from '../principals'; +import { IRole } from '../role'; + +/** + * An immutable wrapper around an IRole + * + * This wrapper ignores all mutating operations, like attaching policies or + * adding policy statements. + * + * Useful in cases where you want to turn off CDK's automatic permissions + * management, and instead have full control over all permissions. + * + * Note: if you want to ignore all mutations for an externally defined role + * which was imported into the CDK with {@link Role.fromRoleArn}, you don't have to use this class - + * simply pass the property mutable = false when calling {@link Role.fromRoleArn}. + */ +export class ImmutableRole implements IRole { + public readonly assumeRoleAction = this.role.assumeRoleAction; + public readonly policyFragment = this.role.policyFragment; + public readonly grantPrincipal = this.role.grantPrincipal; + public readonly roleArn = this.role.roleArn; + public readonly roleName = this.role.roleName; + public readonly node = this.role.node; + public readonly stack = this.role.stack; + + constructor(private readonly role: IRole) { + // implement IDependable privately + DependableTrait.implement(this, { + dependencyRoots: [ role ] + }); + } + + public attachInlinePolicy(_policy: Policy): void { + // do nothing + } + + public addManagedPolicy(_policy: IManagedPolicy): void { + // do nothing + } + + public addToPolicy(_statement: PolicyStatement): boolean { + // Not really added, but for the purposes of consumer code pretend that it was. + return true; + } + + public grant(grantee: IPrincipal, ...actions: string[]): Grant { + return this.role.grant(grantee, ...actions); + } + + public grantPassRole(grantee: IPrincipal): Grant { + return this.role.grantPassRole(grantee); + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-iam/lib/role.ts b/packages/@aws-cdk/aws-iam/lib/role.ts index f2eef64775ccf..7d3398da3a197 100644 --- a/packages/@aws-cdk/aws-iam/lib/role.ts +++ b/packages/@aws-cdk/aws-iam/lib/role.ts @@ -7,6 +7,7 @@ import { Policy } from './policy'; import { PolicyDocument } from './policy-document'; import { PolicyStatement } from './policy-statement'; import { ArnPrincipal, IPrincipal, PrincipalPolicyFragment } from './principals'; +import { ImmutableRole } from './private/immutable-role'; import { AttachedPolicies } from './util'; export interface RoleProps { @@ -162,16 +163,32 @@ export class Role extends Resource implements IRole { ? resourceName.slice('service-role/'.length) : resourceName; - abstract class Import extends Resource implements IRole { + class Import extends Resource implements IRole { public readonly grantPrincipal: IPrincipal = this; public readonly assumeRoleAction: string = 'sts:AssumeRole'; public readonly policyFragment = new ArnPrincipal(roleArn).policyFragment; public readonly roleArn = roleArn; public readonly roleName = roleName; + private readonly attachedPolicies = new AttachedPolicies(); + private defaultPolicy?: Policy; - public abstract addToPolicy(statement: PolicyStatement): boolean; + public addToPolicy(statement: PolicyStatement): boolean { + if (!this.defaultPolicy) { + this.defaultPolicy = new Policy(this, 'Policy'); + this.attachInlinePolicy(this.defaultPolicy); + } + this.defaultPolicy.addStatements(statement); + return true; + } - public abstract attachInlinePolicy(policy: Policy): void; + public attachInlinePolicy(policy: Policy): void { + const policyAccount = Stack.of(policy).account; + + if (accountsAreEqualOrOneIsUnresolved(policyAccount, roleAccount)) { + this.attachedPolicies.attach(policy); + policy.attachToRole(this); + } + } public addManagedPolicy(_policy: IManagedPolicy): void { // FIXME: Add warning that we're ignoring this @@ -199,44 +216,11 @@ export class Role extends Resource implements IRole { const roleAccount = parsedArn.account; - class MutableImport extends Import { - private readonly attachedPolicies = new AttachedPolicies(); - private defaultPolicy?: Policy; - - public addToPolicy(statement: PolicyStatement): boolean { - if (!this.defaultPolicy) { - this.defaultPolicy = new Policy(this, 'Policy'); - this.attachInlinePolicy(this.defaultPolicy); - } - this.defaultPolicy.addStatements(statement); - return true; - } - - public attachInlinePolicy(policy: Policy): void { - const policyAccount = Stack.of(policy).account; - - if (accountsAreEqualOrOneIsUnresolved(policyAccount, roleAccount)) { - this.attachedPolicies.attach(policy); - policy.attachToRole(this); - } - } - } - - class ImmutableImport extends Import { - public addToPolicy(_statement: PolicyStatement): boolean { - return true; - } - - public attachInlinePolicy(_policy: Policy): void { - // do nothing - } - } - const scopeAccount = scopeStack.account; return options.mutable !== false && accountsAreEqualOrOneIsUnresolved(scopeAccount, roleAccount) - ? new MutableImport(scope, id) - : new ImmutableImport(scope, id); + ? new Import(scope, id) + : new ImmutableRole(new Import(scope, id)); function accountsAreEqualOrOneIsUnresolved(account1: string | undefined, account2: string | undefined): boolean { @@ -385,6 +369,19 @@ export class Role extends Resource implements IRole { public grantPassRole(identity: IPrincipal) { return this.grant(identity, 'iam:PassRole'); } + + /** + * Return a copy of this Role object whose Policies will not be updated + * + * Use the object returned by this method if you want this Role to be used by + * a construct without it automatically updating the Role's Policies. + * + * If you do, you are responsible for adding the correct statements to the + * Role's policies yourself. + */ + public withoutPolicyUpdates(): IRole { + return new ImmutableRole(this); + } } /** @@ -417,7 +414,7 @@ export interface IRole extends IIdentity { } function createAssumeRolePolicy(principal: IPrincipal, externalIds: string[]) { - const statement = new PolicyStatement(); + const statement = new AwsStarStatement(); statement.addPrincipals(principal); statement.addActions(principal.assumeRoleAction); @@ -439,3 +436,21 @@ function validateMaxSessionDuration(duration?: number) { throw new Error(`maxSessionDuration is set to ${duration}, but must be >= 3600sec (1hr) and <= 43200sec (12hrs)`); } } + +/** + * A PolicyStatement that normalizes its Principal field differently + * + * Normally, "anyone" is normalized to "Principal: *", but this statement + * normalizes to "Principal: { AWS: * }". + */ +class AwsStarStatement extends PolicyStatement { + public toStatementJson(): any { + const stat = super.toStatementJson(); + + if (stat.Principal === '*') { + stat.Principal = { AWS: '*' }; + } + + return stat; + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-iam/package.json b/packages/@aws-cdk/aws-iam/package.json index 18271606450bc..e4a13fe4567c7 100644 --- a/packages/@aws-cdk/aws-iam/package.json +++ b/packages/@aws-cdk/aws-iam/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-iam", - "version": "1.20.0", + "version": "1.21.0", "description": "CDK routines for easily assigning correct and minimal IAM permissions", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -64,20 +64,20 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "jest": "^24.9.0", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0", - "@aws-cdk/region-info": "1.20.0" + "@aws-cdk/core": "1.21.0", + "@aws-cdk/region-info": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0", - "@aws-cdk/region-info": "1.20.0" + "@aws-cdk/core": "1.21.0", + "@aws-cdk/region-info": "1.21.0" }, "jest": { "moduleFileExtensions": [ diff --git a/packages/@aws-cdk/aws-iam/test/immutable-role.test.ts b/packages/@aws-cdk/aws-iam/test/immutable-role.test.ts new file mode 100644 index 0000000000000..7a39b761bbb7f --- /dev/null +++ b/packages/@aws-cdk/aws-iam/test/immutable-role.test.ts @@ -0,0 +1,87 @@ +import '@aws-cdk/assert/jest'; +import { Stack } from '@aws-cdk/core'; +import * as iam from '../lib'; + +// tslint:disable:object-literal-key-quotes + +describe('ImmutableRole', () => { + let stack: Stack; + let mutableRole: iam.Role; + let immutableRole: iam.IRole; + + beforeEach(() => { + stack = new Stack(); + mutableRole = new iam.Role(stack, 'MutableRole', { + assumedBy: new iam.AnyPrincipal(), + }); + immutableRole = mutableRole.withoutPolicyUpdates(); + }); + + test('ignores calls to attachInlinePolicy', () => { + const user = new iam.User(stack, 'User'); + const policy = new iam.Policy(stack, 'Policy', { + statements: [new iam.PolicyStatement({ + resources: ['*'], + actions: ['s3:*'], + })], + users: [user], + }); + + immutableRole.attachInlinePolicy(policy); + + expect(stack).toHaveResource('AWS::IAM::Policy', { + "PolicyDocument": { + "Statement": [ + { + "Action": "s3:*", + "Resource": "*", + "Effect": "Allow", + }, + ], + "Version": "2012-10-17", + }, + "PolicyName": "Policy23B91518", + "Users": [ + { + "Ref": "User00B015A1", + }, + ], + }); + }); + + test('ignores calls to addManagedPolicy', () => { + mutableRole.addManagedPolicy({ managedPolicyArn: 'Arn1' }); + + immutableRole.addManagedPolicy({ managedPolicyArn: 'Arn2' }); + + expect(stack).toHaveResourceLike('AWS::IAM::Role', { + "ManagedPolicyArns": [ + 'Arn1', + ], + }); + }); + + test('ignores calls to addToPolicy', () => { + mutableRole.addToPolicy(new iam.PolicyStatement({ + resources: ['*'], + actions: ['s3:*'], + })); + + immutableRole.addToPolicy(new iam.PolicyStatement({ + resources: ['*'], + actions: ['iam:*'], + })); + + expect(stack).toHaveResourceLike('AWS::IAM::Policy', { + "PolicyDocument": { + "Statement": [ + { + "Resource": "*", + "Action": "s3:*", + "Effect": "Allow", + }, + ], + }, + }); + }); +}); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-iam/test/integ.role.expected.json b/packages/@aws-cdk/aws-iam/test/integ.role.expected.json index 21aa4898932ab..0e2dbd39d9e93 100644 --- a/packages/@aws-cdk/aws-iam/test/integ.role.expected.json +++ b/packages/@aws-cdk/aws-iam/test/integ.role.expected.json @@ -95,6 +95,28 @@ "Version": "2012-10-17" } } + }, + "TestRole3C1F30727": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Condition": { + "StringEquals": { + "aws:PrincipalOrgID": "o-1234" + } + }, + "Effect": "Allow", + "Principal": { + "AWS": "*" + } + } + ], + "Version": "2012-10-17" + } + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-iam/test/integ.role.ts b/packages/@aws-cdk/aws-iam/test/integ.role.ts index e5708b9823b49..91d7e30fb9bba 100644 --- a/packages/@aws-cdk/aws-iam/test/integ.role.ts +++ b/packages/@aws-cdk/aws-iam/test/integ.role.ts @@ -1,5 +1,5 @@ import { App, Stack } from "@aws-cdk/core"; -import { AccountRootPrincipal, Policy, PolicyStatement, Role, ServicePrincipal } from "../lib"; +import { AccountRootPrincipal, OrganizationPrincipal, Policy, PolicyStatement, Role, ServicePrincipal } from "../lib"; const app = new App(); @@ -21,4 +21,9 @@ new Role(stack, 'TestRole2', { externalIds: ['supply-me'], }); +// Role with an org +new Role(stack, 'TestRole3', { + assumedBy: new OrganizationPrincipal('o-1234'), +}); + app.synth(); diff --git a/packages/@aws-cdk/aws-iam/test/role.test.ts b/packages/@aws-cdk/aws-iam/test/role.test.ts index 1aafc2e7e5f21..80d5e70dc860d 100644 --- a/packages/@aws-cdk/aws-iam/test/role.test.ts +++ b/packages/@aws-cdk/aws-iam/test/role.test.ts @@ -1,6 +1,6 @@ import '@aws-cdk/assert/jest'; import { Duration, Stack } from '@aws-cdk/core'; -import { ArnPrincipal, CompositePrincipal, FederatedPrincipal, ManagedPolicy, PolicyStatement, Role, ServicePrincipal, User } from '../lib'; +import { AnyPrincipal, ArnPrincipal, CompositePrincipal, FederatedPrincipal, ManagedPolicy, PolicyStatement, Role, ServicePrincipal, User } from '../lib'; describe('IAM role', () => { test('default role', () => { @@ -319,4 +319,30 @@ describe('IAM role', () => { } }); }); + + test('Principal-* in an AssumeRolePolicyDocument gets translated to { "AWS": "*" }', () => { + // The docs say that "Principal: *" and "Principal: { AWS: * }" are equivalent + // (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html) + // but in practice CreateRole errors out if you use "Principal: *" in an AssumeRolePolicyDocument: + // An error occurred (MalformedPolicyDocument) when calling the CreateRole operation: AssumeRolepolicy contained an invalid principal: "STAR":"*". + + // Make sure that we handle this case specially. + const stack = new Stack(); + new Role(stack, 'Role', { + assumedBy: new AnyPrincipal(), + }); + + expect(stack).toHaveResource('AWS::IAM::Role', { + AssumeRolePolicyDocument: { + Statement: [ + { + Action: "sts:AssumeRole", + Effect: "Allow", + Principal: { AWS: "*" }, + } + ], + Version: "2012-10-17" + } + }); + }); }); diff --git a/packages/@aws-cdk/aws-inspector/package.json b/packages/@aws-cdk/aws-inspector/package.json index ef2559c9d2e4a..9fc5fc538e652 100644 --- a/packages/@aws-cdk/aws-inspector/package.json +++ b/packages/@aws-cdk/aws-inspector/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-inspector", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::Inspector", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,17 +79,17 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-iot/package.json b/packages/@aws-cdk/aws-iot/package.json index 95a998c0ab1a1..6bbbae4bc5862 100644 --- a/packages/@aws-cdk/aws-iot/package.json +++ b/packages/@aws-cdk/aws-iot/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-iot", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::IoT", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,17 +79,17 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-iot1click/package.json b/packages/@aws-cdk/aws-iot1click/package.json index 1f23781400b02..6d50e69f0b41a 100644 --- a/packages/@aws-cdk/aws-iot1click/package.json +++ b/packages/@aws-cdk/aws-iot1click/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-iot1click", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::IoT1Click", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,16 +80,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-iotanalytics/package.json b/packages/@aws-cdk/aws-iotanalytics/package.json index aeb44770f9e64..50b15a936d259 100644 --- a/packages/@aws-cdk/aws-iotanalytics/package.json +++ b/packages/@aws-cdk/aws-iotanalytics/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-iotanalytics", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::IoTAnalytics", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,16 +81,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-iotevents/package.json b/packages/@aws-cdk/aws-iotevents/package.json index c1f401b4e13ff..2bb91a75ad669 100644 --- a/packages/@aws-cdk/aws-iotevents/package.json +++ b/packages/@aws-cdk/aws-iotevents/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-iotevents", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::IoTEvents", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,16 +81,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-iotthingsgraph/package.json b/packages/@aws-cdk/aws-iotthingsgraph/package.json index 74848d907bc72..1538b0ac08b17 100644 --- a/packages/@aws-cdk/aws-iotthingsgraph/package.json +++ b/packages/@aws-cdk/aws-iotthingsgraph/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-iotthingsgraph", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::IoTThingsGraph", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,16 +81,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-kinesis/package.json b/packages/@aws-cdk/aws-kinesis/package.json index e945bdb71a1ef..6123976c37b4a 100644 --- a/packages/@aws-cdk/aws-kinesis/package.json +++ b/packages/@aws-cdk/aws-kinesis/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-kinesis", - "version": "1.20.0", + "version": "1.21.0", "description": "CDK Constructs for AWS Kinesis", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -61,25 +61,25 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kms": "1.20.0", - "@aws-cdk/aws-logs": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kms": "1.21.0", + "@aws-cdk/aws-logs": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kms": "1.20.0", - "@aws-cdk/aws-logs": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kms": "1.21.0", + "@aws-cdk/aws-logs": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-kinesisanalytics/package.json b/packages/@aws-cdk/aws-kinesisanalytics/package.json index 314ebc917ccc4..feb3b663d52c6 100644 --- a/packages/@aws-cdk/aws-kinesisanalytics/package.json +++ b/packages/@aws-cdk/aws-kinesisanalytics/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-kinesisanalytics", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::KinesisAnalytics", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -82,17 +82,17 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-kinesisfirehose/package.json b/packages/@aws-cdk/aws-kinesisfirehose/package.json index 8a77a05f7bf05..3e2020cbbdad8 100644 --- a/packages/@aws-cdk/aws-kinesisfirehose/package.json +++ b/packages/@aws-cdk/aws-kinesisfirehose/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-kinesisfirehose", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::KinesisFirehose", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,17 +79,17 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-kms/package.json b/packages/@aws-cdk/aws-kms/package.json index da6bebf20405f..fc51f0d43d211 100644 --- a/packages/@aws-cdk/aws-kms/package.json +++ b/packages/@aws-cdk/aws-kms/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-kms", - "version": "1.20.0", + "version": "1.21.0", "description": "CDK Constructs for AWS KMS", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,22 +62,22 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-lakeformation/package.json b/packages/@aws-cdk/aws-lakeformation/package.json index dbbd21b908455..090a04c6653ac 100644 --- a/packages/@aws-cdk/aws-lakeformation/package.json +++ b/packages/@aws-cdk/aws-lakeformation/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-lakeformation", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::LakeFormation", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,16 +81,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-lambda-destinations/package.json b/packages/@aws-cdk/aws-lambda-destinations/package.json index 8641ab446c3ec..966daa59141b0 100644 --- a/packages/@aws-cdk/aws-lambda-destinations/package.json +++ b/packages/@aws-cdk/aws-lambda-destinations/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-lambda-destinations", - "version": "1.20.0", + "version": "1.21.0", "description": "CDK Destinations Constructs for AWS Lambda", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -76,27 +76,27 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "jest": "^24.9.0", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/aws-sqs": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/aws-sqs": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/aws-sqs": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/aws-sqs": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-lambda-event-sources/package.json b/packages/@aws-cdk/aws-lambda-event-sources/package.json index fa9de67aca75d..636c35306f1cc 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/package.json +++ b/packages/@aws-cdk/aws-lambda-event-sources/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-lambda-event-sources", - "version": "1.20.0", + "version": "1.21.0", "description": "Event sources for AWS Lambda", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -58,41 +58,41 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-apigateway": "1.20.0", - "@aws-cdk/aws-dynamodb": "1.20.0", - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kinesis": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/aws-s3-notifications": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/aws-sns-subscriptions": "1.20.0", - "@aws-cdk/aws-sqs": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-apigateway": "1.21.0", + "@aws-cdk/aws-dynamodb": "1.21.0", + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kinesis": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/aws-s3-notifications": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/aws-sns-subscriptions": "1.21.0", + "@aws-cdk/aws-sqs": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-apigateway": "1.20.0", - "@aws-cdk/aws-dynamodb": "1.20.0", - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kinesis": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/aws-s3-notifications": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/aws-sns-subscriptions": "1.20.0", - "@aws-cdk/aws-sqs": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-apigateway": "1.21.0", + "@aws-cdk/aws-dynamodb": "1.21.0", + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kinesis": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/aws-s3-notifications": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/aws-sns-subscriptions": "1.21.0", + "@aws-cdk/aws-sqs": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-lambda/package.json b/packages/@aws-cdk/aws-lambda/package.json index 9a3fc65f66e5e..ac24ec0981346 100644 --- a/packages/@aws-cdk/aws-lambda/package.json +++ b/packages/@aws-cdk/aws-lambda/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-lambda", - "version": "1.20.0", + "version": "1.21.0", "description": "CDK Constructs for AWS Lambda", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -66,46 +66,46 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/aws-lambda": "^8.10.39", "@types/lodash": "^4.14.149", "@types/nodeunit": "^0.0.30", "@types/sinon": "^7.5.0", - "aws-sdk": "^2.599.0", + "aws-sdk": "^2.601.0", "aws-sdk-mock": "^5.0.0", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "lodash": "^4.17.15", - "nock": "^11.7.1", + "nock": "^11.7.2", "nodeunit": "^0.11.3", - "pkglint": "1.20.0", - "sinon": "^8.0.2" + "pkglint": "1.21.0", + "sinon": "^8.0.4" }, "dependencies": { - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-logs": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/aws-s3-assets": "1.20.0", - "@aws-cdk/aws-sqs": "1.20.0", - "@aws-cdk/core": "1.20.0", - "@aws-cdk/cx-api": "1.20.0" + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-logs": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/aws-s3-assets": "1.21.0", + "@aws-cdk/aws-sqs": "1.21.0", + "@aws-cdk/core": "1.21.0", + "@aws-cdk/cx-api": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-logs": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/aws-s3-assets": "1.20.0", - "@aws-cdk/aws-sqs": "1.20.0", - "@aws-cdk/core": "1.20.0", - "@aws-cdk/cx-api": "1.20.0" + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-logs": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/aws-s3-assets": "1.21.0", + "@aws-cdk/aws-sqs": "1.21.0", + "@aws-cdk/core": "1.21.0", + "@aws-cdk/cx-api": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-logs-destinations/package.json b/packages/@aws-cdk/aws-logs-destinations/package.json index 880cc979470aa..5e320aadd315b 100644 --- a/packages/@aws-cdk/aws-logs-destinations/package.json +++ b/packages/@aws-cdk/aws-logs-destinations/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-logs-destinations", - "version": "1.20.0", + "version": "1.21.0", "description": "Log Destinations for AWS CloudWatch Logs", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -76,27 +76,27 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "jest": "^24.9.0", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kinesis": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-logs": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kinesis": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-logs": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kinesis": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-logs": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kinesis": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-logs": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-logs/package.json b/packages/@aws-cdk/aws-logs/package.json index 915ecd455516a..2f6330a5c27b5 100644 --- a/packages/@aws-cdk/aws-logs/package.json +++ b/packages/@aws-cdk/aws-logs/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-logs", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::Logs", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,24 +62,24 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-managedblockchain/package.json b/packages/@aws-cdk/aws-managedblockchain/package.json index 6f5eb98480efb..a085b7416f22c 100644 --- a/packages/@aws-cdk/aws-managedblockchain/package.json +++ b/packages/@aws-cdk/aws-managedblockchain/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-managedblockchain", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::ManagedBlockchain", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,16 +81,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-mediaconvert/package.json b/packages/@aws-cdk/aws-mediaconvert/package.json index baafb4b71327e..573fb4369d040 100644 --- a/packages/@aws-cdk/aws-mediaconvert/package.json +++ b/packages/@aws-cdk/aws-mediaconvert/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-mediaconvert", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::MediaConvert", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,16 +81,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-medialive/package.json b/packages/@aws-cdk/aws-medialive/package.json index 45221fbbf050d..77e94dd276cda 100644 --- a/packages/@aws-cdk/aws-medialive/package.json +++ b/packages/@aws-cdk/aws-medialive/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-medialive", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::MediaLive", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,16 +81,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-mediastore/package.json b/packages/@aws-cdk/aws-mediastore/package.json index bf87f3d6c99f0..97dce5d17195d 100644 --- a/packages/@aws-cdk/aws-mediastore/package.json +++ b/packages/@aws-cdk/aws-mediastore/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-mediastore", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::MediaStore", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,16 +81,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-msk/package.json b/packages/@aws-cdk/aws-msk/package.json index 39468dbe1830b..716d196a0e18c 100644 --- a/packages/@aws-cdk/aws-msk/package.json +++ b/packages/@aws-cdk/aws-msk/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-msk", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::MSK", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,16 +81,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-neptune/package.json b/packages/@aws-cdk/aws-neptune/package.json index a62403474b433..96ddd5eb00779 100644 --- a/packages/@aws-cdk/aws-neptune/package.json +++ b/packages/@aws-cdk/aws-neptune/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-neptune", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::Neptune", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,16 +80,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-opsworks/package.json b/packages/@aws-cdk/aws-opsworks/package.json index a38cdaa1209e5..c87befe73d8bf 100644 --- a/packages/@aws-cdk/aws-opsworks/package.json +++ b/packages/@aws-cdk/aws-opsworks/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-opsworks", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::OpsWorks", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,17 +79,17 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-opsworkscm/package.json b/packages/@aws-cdk/aws-opsworkscm/package.json index c0c8b9c373c42..9d2c58c3f6dc8 100644 --- a/packages/@aws-cdk/aws-opsworkscm/package.json +++ b/packages/@aws-cdk/aws-opsworkscm/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-opsworkscm", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::OpsWorksCM", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,16 +81,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-pinpoint/package.json b/packages/@aws-cdk/aws-pinpoint/package.json index c09692364ac86..2c62fe4630f25 100644 --- a/packages/@aws-cdk/aws-pinpoint/package.json +++ b/packages/@aws-cdk/aws-pinpoint/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-pinpoint", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::Pinpoint", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,16 +81,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-pinpointemail/package.json b/packages/@aws-cdk/aws-pinpointemail/package.json index 9f7bb0f83d2aa..44743fc3e2833 100644 --- a/packages/@aws-cdk/aws-pinpointemail/package.json +++ b/packages/@aws-cdk/aws-pinpointemail/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-pinpointemail", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::PinpointEmail", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,16 +81,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-qldb/package.json b/packages/@aws-cdk/aws-qldb/package.json index d21f2c095d4a3..6c640bfefed2d 100644 --- a/packages/@aws-cdk/aws-qldb/package.json +++ b/packages/@aws-cdk/aws-qldb/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-qldb", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::QLDB", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,16 +81,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-ram/package.json b/packages/@aws-cdk/aws-ram/package.json index 48467bb19f351..cce7216b73885 100644 --- a/packages/@aws-cdk/aws-ram/package.json +++ b/packages/@aws-cdk/aws-ram/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-ram", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::RAM", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,16 +81,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-rds/package.json b/packages/@aws-cdk/aws-rds/package.json index 03e25846db465..cbd32cc2e842b 100644 --- a/packages/@aws-cdk/aws-rds/package.json +++ b/packages/@aws-cdk/aws-rds/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-rds", - "version": "1.20.0", + "version": "1.21.0", "description": "CDK Constructs for AWS RDS", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,37 +62,37 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "@aws-cdk/aws-events-targets": "1.20.0", + "@aws-cdk/assert": "1.21.0", + "@aws-cdk/aws-events-targets": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kms": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-logs": "1.20.0", - "@aws-cdk/aws-secretsmanager": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kms": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-logs": "1.21.0", + "@aws-cdk/aws-secretsmanager": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kms": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-logs": "1.20.0", - "@aws-cdk/aws-secretsmanager": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kms": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-logs": "1.21.0", + "@aws-cdk/aws-secretsmanager": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-redshift/package.json b/packages/@aws-cdk/aws-redshift/package.json index 0d8fa335e9202..3203700c4dfa4 100644 --- a/packages/@aws-cdk/aws-redshift/package.json +++ b/packages/@aws-cdk/aws-redshift/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-redshift", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::Redshift", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,17 +79,17 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-robomaker/package.json b/packages/@aws-cdk/aws-robomaker/package.json index 47efa5cc356bd..82f8260088e2a 100644 --- a/packages/@aws-cdk/aws-robomaker/package.json +++ b/packages/@aws-cdk/aws-robomaker/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-robomaker", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::RoboMaker", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,16 +81,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-route53-patterns/package.json b/packages/@aws-cdk/aws-route53-patterns/package.json index 2cf27b51900ed..1ce88ca217e77 100644 --- a/packages/@aws-cdk/aws-route53-patterns/package.json +++ b/packages/@aws-cdk/aws-route53-patterns/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-route53-patterns", - "version": "1.20.0", + "version": "1.21.0", "description": "CDK Constructs for AWS Route53 patterns", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -76,33 +76,33 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "jest": "^24.9.0", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-certificatemanager": "1.20.0", - "@aws-cdk/aws-cloudfront": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-route53": "1.20.0", - "@aws-cdk/aws-route53-targets": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/core": "1.20.0", - "@aws-cdk/region-info": "1.20.0" + "@aws-cdk/aws-certificatemanager": "1.21.0", + "@aws-cdk/aws-cloudfront": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-route53": "1.21.0", + "@aws-cdk/aws-route53-targets": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/core": "1.21.0", + "@aws-cdk/region-info": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-certificatemanager": "1.20.0", - "@aws-cdk/aws-cloudfront": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-route53": "1.20.0", - "@aws-cdk/aws-route53-targets": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/core": "1.20.0", - "@aws-cdk/region-info": "1.20.0" + "@aws-cdk/aws-certificatemanager": "1.21.0", + "@aws-cdk/aws-cloudfront": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-route53": "1.21.0", + "@aws-cdk/aws-route53-targets": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/core": "1.21.0", + "@aws-cdk/region-info": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-route53-targets/package.json b/packages/@aws-cdk/aws-route53-targets/package.json index 93099ffde61c9..1b102a05e2e68 100644 --- a/packages/@aws-cdk/aws-route53-targets/package.json +++ b/packages/@aws-cdk/aws-route53-targets/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-route53-targets", - "version": "1.20.0", + "version": "1.21.0", "description": "CDK Constructs for AWS Route53 Alias Targets", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -76,38 +76,38 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "@aws-cdk/aws-certificatemanager": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "@aws-cdk/assert": "1.21.0", + "@aws-cdk/aws-certificatemanager": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "jest": "^24.9.0", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-apigateway": "1.20.0", - "@aws-cdk/aws-cloudfront": "1.20.0", - "@aws-cdk/aws-elasticloadbalancing": "1.20.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-route53": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/core": "1.20.0", - "@aws-cdk/region-info": "1.20.0" + "@aws-cdk/aws-apigateway": "1.21.0", + "@aws-cdk/aws-cloudfront": "1.21.0", + "@aws-cdk/aws-elasticloadbalancing": "1.21.0", + "@aws-cdk/aws-elasticloadbalancingv2": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-route53": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/core": "1.21.0", + "@aws-cdk/region-info": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-apigateway": "1.20.0", - "@aws-cdk/aws-cloudfront": "1.20.0", - "@aws-cdk/aws-elasticloadbalancing": "1.20.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-route53": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/core": "1.20.0", - "@aws-cdk/region-info": "1.20.0" + "@aws-cdk/aws-apigateway": "1.21.0", + "@aws-cdk/aws-cloudfront": "1.21.0", + "@aws-cdk/aws-elasticloadbalancing": "1.21.0", + "@aws-cdk/aws-elasticloadbalancingv2": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-route53": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/core": "1.21.0", + "@aws-cdk/region-info": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-route53-targets/test/classic-load-balancer-target.test.ts b/packages/@aws-cdk/aws-route53-targets/test/classic-load-balancer-target.test.ts index adae96db257ed..46ae09ccdff7b 100644 --- a/packages/@aws-cdk/aws-route53-targets/test/classic-load-balancer-target.test.ts +++ b/packages/@aws-cdk/aws-route53-targets/test/classic-load-balancer-target.test.ts @@ -22,7 +22,7 @@ test('use classic ELB as record target', () => { new route53.ARecord(zone, 'Alias', { zone, recordName: '_foo', - target: route53.AddressRecordTarget.fromAlias(new targets.ClassicLoadBalancerTarget(lb)) + target: route53.RecordTarget.fromAlias(new targets.ClassicLoadBalancerTarget(lb)) }); // THEN diff --git a/packages/@aws-cdk/aws-route53-targets/test/cloudfront-target.test.ts b/packages/@aws-cdk/aws-route53-targets/test/cloudfront-target.test.ts index bacb38bd7ac88..d00cdeeb72ef2 100644 --- a/packages/@aws-cdk/aws-route53-targets/test/cloudfront-target.test.ts +++ b/packages/@aws-cdk/aws-route53-targets/test/cloudfront-target.test.ts @@ -27,7 +27,7 @@ test('use CloudFront as record target', () => { new route53.ARecord(zone, 'Alias', { zone, recordName: '_foo', - target: route53.AddressRecordTarget.fromAlias(new targets.CloudFrontTarget(distribution)) + target: route53.RecordTarget.fromAlias(new targets.CloudFrontTarget(distribution)) }); // THEN diff --git a/packages/@aws-cdk/aws-route53-targets/test/integ.alb-alias-target.ts b/packages/@aws-cdk/aws-route53-targets/test/integ.alb-alias-target.ts index 2a31a12bfcbd3..fec83da47b9e1 100644 --- a/packages/@aws-cdk/aws-route53-targets/test/integ.alb-alias-target.ts +++ b/packages/@aws-cdk/aws-route53-targets/test/integ.alb-alias-target.ts @@ -22,7 +22,7 @@ const zone = new route53.PublicHostedZone(stack, 'HostedZone', { zoneName: 'test new route53.ARecord(zone, 'Alias', { zone, recordName: '_foo', - target: route53.AddressRecordTarget.fromAlias(new targets.LoadBalancerTarget(lb)) + target: route53.RecordTarget.fromAlias(new targets.LoadBalancerTarget(lb)) }); app.synth(); diff --git a/packages/@aws-cdk/aws-route53-targets/test/integ.api-gateway-domain-name.ts b/packages/@aws-cdk/aws-route53-targets/test/integ.api-gateway-domain-name.ts index 4601caf8e14dd..b2ecd1bc75879 100644 --- a/packages/@aws-cdk/aws-route53-targets/test/integ.api-gateway-domain-name.ts +++ b/packages/@aws-cdk/aws-route53-targets/test/integ.api-gateway-domain-name.ts @@ -43,7 +43,7 @@ class TestStack extends Stack { new route53.ARecord(this, 'Alias', { zone, - target: route53.AddressRecordTarget.fromAlias(new targets.ApiGateway(api)) + target: route53.RecordTarget.fromAlias(new targets.ApiGateway(api)) }); } } diff --git a/packages/@aws-cdk/aws-route53-targets/test/integ.cloudfront-alias-target.ts b/packages/@aws-cdk/aws-route53-targets/test/integ.cloudfront-alias-target.ts index 6152c17b7ccfe..09b2a64644440 100644 --- a/packages/@aws-cdk/aws-route53-targets/test/integ.cloudfront-alias-target.ts +++ b/packages/@aws-cdk/aws-route53-targets/test/integ.cloudfront-alias-target.ts @@ -28,7 +28,7 @@ const distribution = new cloudfront.CloudFrontWebDistribution(stack, 'MyDistribu new route53.ARecord(zone, 'Alias', { zone, recordName: '_foo', - target: route53.AddressRecordTarget.fromAlias(new targets.CloudFrontTarget(distribution)) + target: route53.RecordTarget.fromAlias(new targets.CloudFrontTarget(distribution)) }); app.synth(); diff --git a/packages/@aws-cdk/aws-route53-targets/test/load-balancer-target.test.ts b/packages/@aws-cdk/aws-route53-targets/test/load-balancer-target.test.ts index 4ca6115c3ca6d..e49ff542428c3 100644 --- a/packages/@aws-cdk/aws-route53-targets/test/load-balancer-target.test.ts +++ b/packages/@aws-cdk/aws-route53-targets/test/load-balancer-target.test.ts @@ -22,7 +22,7 @@ test('use ALB as record target', () => { new route53.ARecord(zone, 'Alias', { zone, recordName: '_foo', - target: route53.AddressRecordTarget.fromAlias(new targets.LoadBalancerTarget(lb)) + target: route53.RecordTarget.fromAlias(new targets.LoadBalancerTarget(lb)) }); // THEN diff --git a/packages/@aws-cdk/aws-route53/README.md b/packages/@aws-cdk/aws-route53/README.md index 2f4418c710c05..3007b51ae9184 100644 --- a/packages/@aws-cdk/aws-route53/README.md +++ b/packages/@aws-cdk/aws-route53/README.md @@ -63,7 +63,7 @@ import route53 = require('@aws-cdk/aws-route53'); new route53.ARecord(this, 'ARecord', { zone: myZone, - target: route53.AddressRecordTarget.fromIpAddresses('1.2.3.4', '5.6.7.8') + target: route53.RecordTarget.fromIpAddresses('1.2.3.4', '5.6.7.8') }); ``` @@ -74,7 +74,7 @@ import targets = require('@aws-cdk/aws-route53-targets'); new route53.AaaaRecord(this, 'Alias', { zone: myZone, - target: route53.AddressRecordTarget.fromAlias(new targets.CloudFrontTarget(distribution)) + target: route53.RecordTarget.fromAlias(new targets.CloudFrontTarget(distribution)) }); ``` diff --git a/packages/@aws-cdk/aws-route53/lib/record-set.ts b/packages/@aws-cdk/aws-route53/lib/record-set.ts index 3137825e85bf0..d41b8456b8564 100644 --- a/packages/@aws-cdk/aws-route53/lib/record-set.ts +++ b/packages/@aws-cdk/aws-route53/lib/record-set.ts @@ -171,7 +171,7 @@ export interface AaaaRecordProps extends RecordSetOptions { /** * The target. */ - readonly target: AddressRecordTarget; + readonly target: RecordTarget; } /** diff --git a/packages/@aws-cdk/aws-route53/package.json b/packages/@aws-cdk/aws-route53/package.json index e7ebc063b33d7..bcb6be5b649c2 100644 --- a/packages/@aws-cdk/aws-route53/package.json +++ b/packages/@aws-cdk/aws-route53/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-route53", - "version": "1.20.0", + "version": "1.21.0", "description": "CDK Constructs for AWS Route53", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,27 +62,27 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "aws-sdk": "^2.599.0", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "aws-sdk": "^2.601.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-logs": "1.20.0", - "@aws-cdk/core": "1.20.0", - "@aws-cdk/cx-api": "1.20.0" + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-logs": "1.21.0", + "@aws-cdk/core": "1.21.0", + "@aws-cdk/cx-api": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-logs": "1.20.0", - "@aws-cdk/core": "1.20.0", - "@aws-cdk/cx-api": "1.20.0" + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-logs": "1.21.0", + "@aws-cdk/core": "1.21.0", + "@aws-cdk/cx-api": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-route53/test/integ.route53.ts b/packages/@aws-cdk/aws-route53/test/integ.route53.ts index 8a59e5a44f707..6e48977b62ac9 100644 --- a/packages/@aws-cdk/aws-route53/test/integ.route53.ts +++ b/packages/@aws-cdk/aws-route53/test/integ.route53.ts @@ -1,6 +1,6 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as cdk from '@aws-cdk/core'; -import { AddressRecordTarget, ARecord, CaaAmazonRecord, CnameRecord, PrivateHostedZone, PublicHostedZone, TxtRecord } from '../lib'; +import { ARecord, CaaAmazonRecord, CnameRecord, PrivateHostedZone, PublicHostedZone, RecordTarget, TxtRecord } from '../lib'; const app = new cdk.App(); @@ -39,7 +39,7 @@ new CnameRecord(stack, 'CNAME', { new ARecord(stack, 'A', { zone: privateZone, recordName: 'test', - target: AddressRecordTarget.fromIpAddresses('1.2.3.4', '5.6.7.8') + target: RecordTarget.fromIpAddresses('1.2.3.4', '5.6.7.8') }); new CaaAmazonRecord(stack, 'CaaAmazon', { diff --git a/packages/@aws-cdk/aws-route53/test/test.record-set.ts b/packages/@aws-cdk/aws-route53/test/test.record-set.ts index 68ff1a47bd69e..a96663a2b7239 100644 --- a/packages/@aws-cdk/aws-route53/test/test.record-set.ts +++ b/packages/@aws-cdk/aws-route53/test/test.record-set.ts @@ -108,7 +108,7 @@ export = { new route53.ARecord(stack, 'A', { zone, recordName: 'www', - target: route53.AddressRecordTarget.fromIpAddresses('1.2.3.4', '5.6.7.8'), + target: route53.RecordTarget.fromIpAddresses('1.2.3.4', '5.6.7.8'), }); // THEN @@ -179,7 +179,7 @@ export = { new route53.AaaaRecord(stack, 'AAAA', { zone, recordName: 'www', - target: route53.AddressRecordTarget.fromIpAddresses('2001:0db8:85a3:0000:0000:8a2e:0370:7334'), + target: route53.RecordTarget.fromIpAddresses('2001:0db8:85a3:0000:0000:8a2e:0370:7334'), }); // THEN diff --git a/packages/@aws-cdk/aws-route53resolver/package.json b/packages/@aws-cdk/aws-route53resolver/package.json index c98857c9bdfd4..e14b1f74ec796 100644 --- a/packages/@aws-cdk/aws-route53resolver/package.json +++ b/packages/@aws-cdk/aws-route53resolver/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-route53resolver", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::Route53Resolver", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,16 +80,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-s3-assets/package.json b/packages/@aws-cdk/aws-s3-assets/package.json index 5a939983c0937..ed74c3f9c85ac 100644 --- a/packages/@aws-cdk/aws-s3-assets/package.json +++ b/packages/@aws-cdk/aws-s3-assets/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-s3-assets", - "version": "1.20.0", + "version": "1.21.0", "description": "Deploy local files and directories to S3", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -59,31 +59,31 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", "@types/sinon": "^7.5.0", - "aws-cdk": "1.20.0", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", + "aws-cdk": "1.21.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0", - "sinon": "^8.0.2", + "pkglint": "1.21.0", + "sinon": "^8.0.4", "ts-mock-imports": "^1.2.6" }, "dependencies": { - "@aws-cdk/assets": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/core": "1.20.0", - "@aws-cdk/cx-api": "1.20.0" + "@aws-cdk/assets": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/core": "1.21.0", + "@aws-cdk/cx-api": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/assets": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/core": "1.20.0", - "@aws-cdk/cx-api": "1.20.0" + "@aws-cdk/assets": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/core": "1.21.0", + "@aws-cdk/cx-api": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-s3-deployment/lib/bucket-deployment.ts b/packages/@aws-cdk/aws-s3-deployment/lib/bucket-deployment.ts index 17cd6d8c38c94..79488eaaf7370 100644 --- a/packages/@aws-cdk/aws-s3-deployment/lib/bucket-deployment.ts +++ b/packages/@aws-cdk/aws-s3-deployment/lib/bucket-deployment.ts @@ -162,8 +162,6 @@ export class BucketDeployment extends cdk.Construct { } const sourceHash = calcSourceHash(handlerSourceDirectory); - // tslint:disable-next-line: no-console - console.error({sourceHash}); const handler = new lambda.SingletonFunction(this, 'CustomResourceHandler', { uuid: this.renderSingletonUuid(props.memoryLimit), diff --git a/packages/@aws-cdk/aws-s3-deployment/package.json b/packages/@aws-cdk/aws-s3-deployment/package.json index b5c278730d13f..d689ce19534b3 100644 --- a/packages/@aws-cdk/aws-s3-deployment/package.json +++ b/packages/@aws-cdk/aws-s3-deployment/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-s3-deployment", - "version": "1.20.0", + "version": "1.21.0", "description": "Constructs for deploying contents to S3 buckets", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -76,31 +76,31 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-cloudformation": "1.20.0", - "@aws-cdk/aws-cloudfront": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/aws-s3-assets": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-cloudformation": "1.21.0", + "@aws-cdk/aws-cloudfront": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/aws-s3-assets": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-cloudformation": "1.20.0", - "@aws-cdk/aws-cloudfront": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/aws-s3-assets": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-cloudformation": "1.21.0", + "@aws-cdk/aws-cloudfront": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/aws-s3-assets": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-s3-notifications/package.json b/packages/@aws-cdk/aws-s3-notifications/package.json index 6e6aa92b17b4f..797d868d54e7e 100644 --- a/packages/@aws-cdk/aws-s3-notifications/package.json +++ b/packages/@aws-cdk/aws-s3-notifications/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-s3-notifications", - "version": "1.20.0", + "version": "1.21.0", "description": "Bucket Notifications API for AWS S3", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -75,28 +75,28 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", "jest": "^24.9.0", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/aws-sqs": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/aws-sqs": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/aws-sqs": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/aws-sqs": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-s3/README.md b/packages/@aws-cdk/aws-s3/README.md index db6bd71b9de75..ecf645d4c55cd 100644 --- a/packages/@aws-cdk/aws-s3/README.md +++ b/packages/@aws-cdk/aws-s3/README.md @@ -192,6 +192,28 @@ When `blockPublicPolicy` is set to `true`, `grantPublicRead()` throws an error. [block public access settings]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html +### Logging configuration + +Use `serverAccessLogsBucket` to describe where server access logs are to be stored. + +```ts +const accessLogsBucket = new Bucket(this, 'AccessLogsBucket'); + +const bucket = new Bucket(this, 'MyBucket', { + serverAccessLogsBucket: accessLogsBucket, +}); +``` + +It's also possible to specify a prefix for Amazon S3 to assign to all log object keys. + +```ts +const bucket = new Bucket(this, 'MyBucket', { + serverAccessLogsBucket: accessLogsBucket, + serverAccessLogsPrefix: 'logs' +}); +``` + +[S3 Server access logging]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerLogs.html ### Website redirection diff --git a/packages/@aws-cdk/aws-s3/lib/bucket.ts b/packages/@aws-cdk/aws-s3/lib/bucket.ts index 206aac0d1d97e..505471d510289 100644 --- a/packages/@aws-cdk/aws-s3/lib/bucket.ts +++ b/packages/@aws-cdk/aws-s3/lib/bucket.ts @@ -901,6 +901,18 @@ export interface BucketProps { * @default - No CORS configuration. */ readonly cors?: CorsRule[]; + + /** + * Destination bucket for the server access logs. + * @default - Access logs are disabled + */ + readonly serverAccessLogsBucket?: IBucket; + + /** + * Optional log file prefix to use for the bucket's access logs. + * @default - No log file prefix + */ + readonly serverAccessLogsPrefix?: string; } /** @@ -982,6 +994,7 @@ export class Bucket extends BucketBase { public policy?: BucketPolicy; protected autoCreatePolicy = true; protected disallowPublicAccess?: boolean; + private accessControl?: BucketAccessControl; private readonly lifecycleRules: LifecycleRule[] = []; private readonly versioned?: boolean; private readonly notifications: BucketNotifications; @@ -1006,7 +1019,8 @@ export class Bucket extends BucketBase { publicAccessBlockConfiguration: props.blockPublicAccess, metricsConfigurations: Lazy.anyValue({ produce: () => this.parseMetricConfiguration() }), corsConfiguration: Lazy.anyValue({ produce: () => this.parseCorsConfiguration() }), - accessControl: props.accessControl, + accessControl: Lazy.stringValue({ produce: () => this.accessControl }), + loggingConfiguration: this.parseServerAccessLogs(props), }); resource.applyRemovalPolicy(props.removalPolicy); @@ -1029,6 +1043,11 @@ export class Bucket extends BucketBase { this.bucketRegionalDomainName = resource.attrRegionalDomainName; this.disallowPublicAccess = props.blockPublicAccess && props.blockPublicAccess.blockPublicPolicy; + this.accessControl = props.accessControl; + + if (props.serverAccessLogsBucket instanceof Bucket) { + props.serverAccessLogsBucket.allowLogDelivery(); + } // Add all bucket metric configurations rules (props.metrics || []).forEach(this.addMetric.bind(this)); @@ -1273,6 +1292,21 @@ export class Bucket extends BucketBase { } } + private parseServerAccessLogs(props: BucketProps): CfnBucket.LoggingConfigurationProperty | undefined { + if (props.serverAccessLogsPrefix && !props.serverAccessLogsBucket) { + throw new Error(`"serverAccessLogsBucket" is required if "serverAccessLogsPrefix" is set`); + } + + if (!props.serverAccessLogsBucket) { + return undefined; + } + + return { + destinationBucketName: props.serverAccessLogsBucket.bucketName, + logFilePrefix: props.serverAccessLogsPrefix, + }; + } + private parseMetricConfiguration(): CfnBucket.MetricsConfigurationProperty[] | undefined { if (!this.metrics || this.metrics.length === 0) { return undefined; @@ -1358,6 +1392,20 @@ export class Bucket extends BucketBase { routingRules }; } + + /** + * Allows the LogDelivery group to write, fails if ACL was set differently. + * + * @see + * https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl + */ + private allowLogDelivery() { + if (this.accessControl && this.accessControl !== BucketAccessControl.LOG_DELIVERY_WRITE) { + throw new Error("Cannot enable log delivery to this bucket because the bucket's ACL has been set and can't be changed"); + } + + this.accessControl = BucketAccessControl.LOG_DELIVERY_WRITE; + } } /** diff --git a/packages/@aws-cdk/aws-s3/package.json b/packages/@aws-cdk/aws-s3/package.json index cab7dddda7364..effb9cd9e8a80 100644 --- a/packages/@aws-cdk/aws-s3/package.json +++ b/packages/@aws-cdk/aws-s3/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-s3", - "version": "1.20.0", + "version": "1.21.0", "description": "CDK Constructs for AWS S3", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,26 +62,26 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kms": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kms": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kms": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kms": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.expected.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.expected.json new file mode 100644 index 0000000000000..87fe6aa792b63 --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.expected.json @@ -0,0 +1,25 @@ +{ + "Resources": { + "MyAccessLogsBucketF7FE6635": { + "Type": "AWS::S3::Bucket", + "Properties": { + "AccessControl": "LogDeliveryWrite" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "MyBucketF68F3FF0": { + "Type": "AWS::S3::Bucket", + "Properties": { + "LoggingConfiguration": { + "DestinationBucketName": { + "Ref": "MyAccessLogsBucketF7FE6635" + }, + "LogFilePrefix": "example" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.ts b/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.ts new file mode 100644 index 0000000000000..3373257e5529c --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.server-access-logs.ts @@ -0,0 +1,19 @@ +#!/usr/bin/env node +import * as cdk from '@aws-cdk/core'; +import * as s3 from '../lib'; + +const app = new cdk.App(); + +const stack = new cdk.Stack(app, 'aws-cdk-s3-access-logs'); + +const accessLogBucket = new s3.Bucket(stack, 'MyAccessLogsBucket', { + removalPolicy: cdk.RemovalPolicy.DESTROY, +}); + +new s3.Bucket(stack, 'MyBucket', { + serverAccessLogsBucket: accessLogBucket, + serverAccessLogsPrefix: 'example', + removalPolicy: cdk.RemovalPolicy.DESTROY, +}); + +app.synth(); diff --git a/packages/@aws-cdk/aws-s3/test/test.bucket.ts b/packages/@aws-cdk/aws-s3/test/test.bucket.ts index 07d5df2eb6f57..a5e05f4b6e56a 100644 --- a/packages/@aws-cdk/aws-s3/test/test.bucket.ts +++ b/packages/@aws-cdk/aws-s3/test/test.bucket.ts @@ -1723,5 +1723,82 @@ export = { // THEN new s3.Bucket(stack, 'b', { encryptionKey: key }); test.done(); - } + }, + + 'Bucket with Server Access Logs'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + + // WHEN + const accessLogBucket = new s3.Bucket(stack, 'AccessLogs'); + new s3.Bucket(stack, 'MyBucket', { + serverAccessLogsBucket: accessLogBucket, + }); + + // THEN + expect(stack).to(haveResource('AWS::S3::Bucket', { + LoggingConfiguration: { + DestinationBucketName: { + Ref: 'AccessLogs8B620ECA', + }, + } + })); + + test.done(); + }, + + 'Bucket with Server Access Logs with Prefix'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + + // WHEN + const accessLogBucket = new s3.Bucket(stack, 'AccessLogs'); + new s3.Bucket(stack, 'MyBucket', { + serverAccessLogsBucket: accessLogBucket, + serverAccessLogsPrefix: 'hello', + }); + + // THEN + expect(stack).to(haveResource('AWS::S3::Bucket', { + LoggingConfiguration: { + DestinationBucketName: { + Ref: 'AccessLogs8B620ECA', + }, + LogFilePrefix: 'hello' + } + })); + + test.done(); + }, + + 'Access log prefix given without bucket'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + + // THEN + test.throws(() => new s3.Bucket(stack, 'MyBucket', { + serverAccessLogsPrefix: 'hello' + }), /"serverAccessLogsBucket" is required if "serverAccessLogsPrefix" is set/); + + test.done(); + }, + + 'Bucket Allow Log delivery changes bucket Access Control should fail'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + + // WHEN + const accessLogBucket = new s3.Bucket(stack, 'AccessLogs', { + accessControl: s3.BucketAccessControl.AUTHENTICATED_READ, + }); + test.throws(() => + new s3.Bucket(stack, 'MyBucket', { + serverAccessLogsBucket: accessLogBucket, + serverAccessLogsPrefix: 'hello', + accessControl: s3.BucketAccessControl.AUTHENTICATED_READ, + }) + , /Cannot enable log delivery to this bucket because the bucket's ACL has been set and can't be changed/); + + test.done(); + }, }; diff --git a/packages/@aws-cdk/aws-sagemaker/package.json b/packages/@aws-cdk/aws-sagemaker/package.json index 40c960c5e0d36..93b48d810f845 100644 --- a/packages/@aws-cdk/aws-sagemaker/package.json +++ b/packages/@aws-cdk/aws-sagemaker/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-sagemaker", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::SageMaker", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,16 +80,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-sam/package.json b/packages/@aws-cdk/aws-sam/package.json index ffcac19e00866..f16ffe2707a11 100644 --- a/packages/@aws-cdk/aws-sam/package.json +++ b/packages/@aws-cdk/aws-sam/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-sam", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for the AWS Serverless Application Model (SAM) resources", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -63,19 +63,19 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "@types/jest": "^24.0.25", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", + "@aws-cdk/assert": "1.21.0", + "@types/jest": "^24.9.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", "jest": "^24.9.0", - "pkglint": "1.20.0", - "ts-jest": "^24.2.0" + "pkglint": "1.21.0", + "ts-jest": "^24.3.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "jest": { "collectCoverage": true, diff --git a/packages/@aws-cdk/aws-sdb/package.json b/packages/@aws-cdk/aws-sdb/package.json index f504c8f19afeb..007e313a9700e 100644 --- a/packages/@aws-cdk/aws-sdb/package.json +++ b/packages/@aws-cdk/aws-sdb/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-sdb", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::SDB", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,17 +79,17 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-secretsmanager/package.json b/packages/@aws-cdk/aws-secretsmanager/package.json index 7af336c57b58f..2e37645c9266f 100644 --- a/packages/@aws-cdk/aws-secretsmanager/package.json +++ b/packages/@aws-cdk/aws-secretsmanager/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-secretsmanager", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::SecretsManager", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -63,29 +63,29 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kms": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-sam": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kms": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-sam": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kms": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-sam": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kms": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-sam": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-securityhub/package.json b/packages/@aws-cdk/aws-securityhub/package.json index 56c1a510eeafc..8132a6b185c46 100644 --- a/packages/@aws-cdk/aws-securityhub/package.json +++ b/packages/@aws-cdk/aws-securityhub/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-securityhub", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::SecurityHub", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,16 +81,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-servicecatalog/package.json b/packages/@aws-cdk/aws-servicecatalog/package.json index aff56ed83c31d..f74312ac1540c 100644 --- a/packages/@aws-cdk/aws-servicecatalog/package.json +++ b/packages/@aws-cdk/aws-servicecatalog/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-servicecatalog", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::ServiceCatalog", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,17 +79,17 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-servicediscovery/package.json b/packages/@aws-cdk/aws-servicediscovery/package.json index a5ebe3d9ad973..612839ad50f08 100644 --- a/packages/@aws-cdk/aws-servicediscovery/package.json +++ b/packages/@aws-cdk/aws-servicediscovery/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-servicediscovery", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::ServiceDiscovery", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,26 +62,26 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.20.0", - "@aws-cdk/aws-route53": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-elasticloadbalancingv2": "1.21.0", + "@aws-cdk/aws-route53": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.20.0", - "@aws-cdk/aws-route53": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-elasticloadbalancingv2": "1.21.0", + "@aws-cdk/aws-route53": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-ses-actions/package.json b/packages/@aws-cdk/aws-ses-actions/package.json index 12fef90c017dd..a762a3fb22930 100644 --- a/packages/@aws-cdk/aws-ses-actions/package.json +++ b/packages/@aws-cdk/aws-ses-actions/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-ses-actions", - "version": "1.20.0", + "version": "1.21.0", "description": "Receipt rule actions for AWS SES", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -77,31 +77,31 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "jest": "^24.9.0", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kms": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/aws-ses": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kms": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/aws-ses": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kms": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/aws-ses": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kms": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/aws-ses": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-ses/package.json b/packages/@aws-cdk/aws-ses/package.json index 41f5e3cfd6c6a..a28e1057cc9a0 100644 --- a/packages/@aws-cdk/aws-ses/package.json +++ b/packages/@aws-cdk/aws-ses/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-ses", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::SES", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,24 +62,24 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-sns-subscriptions/package.json b/packages/@aws-cdk/aws-sns-subscriptions/package.json index c4841c2956e84..7143b6a008922 100644 --- a/packages/@aws-cdk/aws-sns-subscriptions/package.json +++ b/packages/@aws-cdk/aws-sns-subscriptions/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-sns-subscriptions", - "version": "1.20.0", + "version": "1.21.0", "description": "CDK Subscription Constructs for AWS SNS", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -76,27 +76,27 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "jest": "^24.9.0", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/aws-sqs": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/aws-sqs": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/aws-sqs": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/aws-sqs": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-sns/package.json b/packages/@aws-cdk/aws-sns/package.json index bbbdaa5ffa574..5ab2bfc05c69d 100644 --- a/packages/@aws-cdk/aws-sns/package.json +++ b/packages/@aws-cdk/aws-sns/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-sns", - "version": "1.20.0", + "version": "1.21.0", "description": "CDK Constructs for AWS SNS", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -65,29 +65,29 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", + "@aws-cdk/assert": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kms": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kms": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kms": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kms": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-sqs/package.json b/packages/@aws-cdk/aws-sqs/package.json index f672344805d39..775c591447e06 100644 --- a/packages/@aws-cdk/aws-sqs/package.json +++ b/packages/@aws-cdk/aws-sqs/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-sqs", - "version": "1.20.0", + "version": "1.21.0", "description": "CDK Constructs for AWS SQS", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,28 +62,28 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", + "@aws-cdk/assert": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", "@types/nodeunit": "^0.0.30", - "aws-sdk": "^2.599.0", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "aws-sdk": "^2.601.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kms": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kms": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kms": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kms": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-ssm/package.json b/packages/@aws-cdk/aws-ssm/package.json index 5f1a001097e33..2b719d3cf620a 100644 --- a/packages/@aws-cdk/aws-ssm/package.json +++ b/packages/@aws-cdk/aws-ssm/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-ssm", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::SSM", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,26 +62,26 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kms": "1.20.0", - "@aws-cdk/core": "1.20.0", - "@aws-cdk/cx-api": "1.20.0" + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kms": "1.21.0", + "@aws-cdk/core": "1.21.0", + "@aws-cdk/cx-api": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kms": "1.20.0", - "@aws-cdk/core": "1.20.0", - "@aws-cdk/cx-api": "1.20.0" + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kms": "1.21.0", + "@aws-cdk/core": "1.21.0", + "@aws-cdk/cx-api": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/package.json b/packages/@aws-cdk/aws-stepfunctions-tasks/package.json index a0387f535e733..414893f425e52 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/package.json +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-stepfunctions-tasks", - "version": "1.20.0", + "version": "1.21.0", "description": "Task integrations for AWS StepFunctions", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,44 +79,44 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", "jest": "^24.9.0", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/assets": "1.20.0", - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-ecr": "1.20.0", - "@aws-cdk/aws-ecr-assets": "1.20.0", - "@aws-cdk/aws-ecs": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kms": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/aws-sqs": "1.20.0", - "@aws-cdk/aws-stepfunctions": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/assets": "1.21.0", + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-ecr": "1.21.0", + "@aws-cdk/aws-ecr-assets": "1.21.0", + "@aws-cdk/aws-ecs": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kms": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/aws-sqs": "1.21.0", + "@aws-cdk/aws-stepfunctions": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/assets": "1.20.0", - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-ecr": "1.20.0", - "@aws-cdk/aws-ecr-assets": "1.20.0", - "@aws-cdk/aws-ecs": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-kms": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/aws-sqs": "1.20.0", - "@aws-cdk/aws-stepfunctions": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/assets": "1.21.0", + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-ecr": "1.21.0", + "@aws-cdk/aws-ecr-assets": "1.21.0", + "@aws-cdk/aws-ecs": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-kms": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/aws-sqs": "1.21.0", + "@aws-cdk/aws-stepfunctions": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-stepfunctions/package.json b/packages/@aws-cdk/aws-stepfunctions/package.json index ae5e2a69a5158..987d4c746eb6e 100644 --- a/packages/@aws-cdk/aws-stepfunctions/package.json +++ b/packages/@aws-cdk/aws-stepfunctions/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-stepfunctions", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::StepFunctions", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,26 +62,26 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", + "@aws-cdk/assert": "1.21.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-transfer/package.json b/packages/@aws-cdk/aws-transfer/package.json index ab9f385a7bef8..9822c9dfcfc2d 100644 --- a/packages/@aws-cdk/aws-transfer/package.json +++ b/packages/@aws-cdk/aws-transfer/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-transfer", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::Transfer", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,16 +81,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-waf/package.json b/packages/@aws-cdk/aws-waf/package.json index e40c7d3f386c4..037ea44840f63 100644 --- a/packages/@aws-cdk/aws-waf/package.json +++ b/packages/@aws-cdk/aws-waf/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-waf", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::WAF", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,17 +79,17 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-wafregional/package.json b/packages/@aws-cdk/aws-wafregional/package.json index 58581b551cced..1d77783a880ec 100644 --- a/packages/@aws-cdk/aws-wafregional/package.json +++ b/packages/@aws-cdk/aws-wafregional/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-wafregional", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::WAFRegional", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,17 +79,17 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-wafv2/package.json b/packages/@aws-cdk/aws-wafv2/package.json index 9a0b105c5d473..db6406fd82f69 100644 --- a/packages/@aws-cdk/aws-wafv2/package.json +++ b/packages/@aws-cdk/aws-wafv2/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-wafv2", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::WAFv2", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,16 +81,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-workspaces/package.json b/packages/@aws-cdk/aws-workspaces/package.json index 76b1fd325757f..88f2a89a33b11 100644 --- a/packages/@aws-cdk/aws-workspaces/package.json +++ b/packages/@aws-cdk/aws-workspaces/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-workspaces", - "version": "1.20.0", + "version": "1.21.0", "description": "The CDK Construct Library for AWS::WorkSpaces", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,17 +79,17 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", - "pkglint": "1.20.0" + "@aws-cdk/assert": "1.21.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.20.0" + "@aws-cdk/core": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/cfnspec/package.json b/packages/@aws-cdk/cfnspec/package.json index 3589b60945683..379e57272be17 100644 --- a/packages/@aws-cdk/cfnspec/package.json +++ b/packages/@aws-cdk/cfnspec/package.json @@ -1,7 +1,7 @@ { "name": "@aws-cdk/cfnspec", "description": "The CloudFormation resource specification used by @aws-cdk packages", - "version": "1.20.0", + "version": "1.21.0", "scripts": { "update": "cdk-build && /bin/bash build-tools/update.sh", "build": "cdk-build && node build-tools/build", @@ -25,12 +25,12 @@ "@types/fs-extra": "^8.0.1", "@types/md5": "^2.1.33", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", + "cdk-build-tools": "1.21.0", "fast-json-patch": "^2.2.1", "fs-extra": "^8.1.0", "json-diff": "^0.5.4", "nodeunit": "^0.11.3", - "pkglint": "1.20.0", + "pkglint": "1.21.0", "sort-json": "^2.0.0" }, "dependencies": { diff --git a/packages/@aws-cdk/cloudformation-diff/package.json b/packages/@aws-cdk/cloudformation-diff/package.json index 6a76c3ab2fd51..a36aa54a76e35 100644 --- a/packages/@aws-cdk/cloudformation-diff/package.json +++ b/packages/@aws-cdk/cloudformation-diff/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/cloudformation-diff", - "version": "1.20.0", + "version": "1.21.0", "description": "Utilities to diff CDK stacks against CloudFormation templates", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -41,23 +41,23 @@ }, "license": "Apache-2.0", "dependencies": { - "@aws-cdk/cfnspec": "1.20.0", - "@aws-cdk/cx-api": "1.20.0", + "@aws-cdk/cfnspec": "1.21.0", + "@aws-cdk/cx-api": "1.21.0", "colors": "^1.4.0", - "diff": "^4.0.1", + "diff": "^4.0.2", "fast-deep-equal": "^3.1.1", "string-width": "^4.2.0", "table": "^5.4.6" }, "devDependencies": { - "@types/jest": "^24.0.25", + "@types/jest": "^24.9.0", "@types/string-width": "^4.0.1", "@types/table": "^4.0.7", - "cdk-build-tools": "1.20.0", + "cdk-build-tools": "1.21.0", "fast-check": "^1.21.0", "jest": "^24.9.0", - "pkglint": "1.20.0", - "ts-jest": "^24.2.0" + "pkglint": "1.21.0", + "ts-jest": "^24.3.0" }, "repository": { "url": "https://github.com/aws/aws-cdk.git", diff --git a/packages/@aws-cdk/core/package.json b/packages/@aws-cdk/core/package.json index bcbe6db1087fb..40eda2285f200 100644 --- a/packages/@aws-cdk/core/package.json +++ b/packages/@aws-cdk/core/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/core", - "version": "1.20.0", + "version": "1.21.0", "description": "AWS Cloud Development Kit Core Library", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -149,19 +149,19 @@ "devDependencies": { "@types/lodash": "^4.14.149", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cfn2ts": "1.21.0", "fast-check": "^1.21.0", "lodash": "^4.17.15", "nodeunit": "^0.11.3", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/cx-api": "1.20.0" + "@aws-cdk/cx-api": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/cx-api": "1.20.0" + "@aws-cdk/cx-api": "1.21.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/custom-resources/lib/aws-custom-resource/runtime/index.ts b/packages/@aws-cdk/custom-resources/lib/aws-custom-resource/runtime/index.ts index 47e7e03319485..7a6288d285e5a 100644 --- a/packages/@aws-cdk/custom-resources/lib/aws-custom-resource/runtime/index.ts +++ b/packages/@aws-cdk/custom-resources/lib/aws-custom-resource/runtime/index.ts @@ -115,7 +115,7 @@ export async function handler(event: AWSLambda.CloudFormationCustomResourceEvent physicalResourceId = call.physicalResourceIdPath ? flatData[call.physicalResourceIdPath] - : call.physicalResourceId; + : call.physicalResourceId || (event as any).PhysicalResourceId; } await respond('SUCCESS', 'OK', physicalResourceId, data); diff --git a/packages/@aws-cdk/custom-resources/package.json b/packages/@aws-cdk/custom-resources/package.json index 0c01b3a7ba29f..1f711ba3025f6 100644 --- a/packages/@aws-cdk/custom-resources/package.json +++ b/packages/@aws-cdk/custom-resources/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/custom-resources", - "version": "1.20.0", + "version": "1.21.0", "description": "Constructs for implementing CDK custom resources", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -66,41 +66,41 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.20.0", - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/aws-ssm": "1.20.0", + "@aws-cdk/assert": "1.21.0", + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/aws-ssm": "1.21.0", "@types/aws-lambda": "^8.10.39", "@types/fs-extra": "^8.0.1", "@types/sinon": "^7.5.0", - "aws-sdk": "^2.599.0", + "aws-sdk": "^2.601.0", "aws-sdk-mock": "^5.0.0", - "cdk-build-tools": "1.20.0", - "cdk-integ-tools": "1.20.0", - "cfn2ts": "1.20.0", + "cdk-build-tools": "1.21.0", + "cdk-integ-tools": "1.21.0", + "cfn2ts": "1.21.0", "fs-extra": "^8.1.0", - "nock": "^11.7.1", - "pkglint": "1.20.0", - "sinon": "^8.0.2" + "nock": "^11.7.2", + "pkglint": "1.21.0", + "sinon": "^8.0.4" }, "dependencies": { - "@aws-cdk/aws-cloudformation": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/aws-stepfunctions": "1.20.0", - "@aws-cdk/aws-stepfunctions-tasks": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-cloudformation": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/aws-stepfunctions": "1.21.0", + "@aws-cdk/aws-stepfunctions-tasks": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-cloudformation": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/aws-stepfunctions": "1.20.0", - "@aws-cdk/aws-stepfunctions-tasks": "1.20.0", - "@aws-cdk/core": "1.20.0" + "@aws-cdk/aws-cloudformation": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/aws-stepfunctions": "1.21.0", + "@aws-cdk/aws-stepfunctions-tasks": "1.21.0", + "@aws-cdk/core": "1.21.0" }, "jest": { "moduleFileExtensions": [ diff --git a/packages/@aws-cdk/custom-resources/test/aws-custom-resource/aws-custom-resource-provider.test.ts b/packages/@aws-cdk/custom-resources/test/aws-custom-resource/aws-custom-resource-provider.test.ts index 8a5b4da815271..e613eccc879bc 100644 --- a/packages/@aws-cdk/custom-resources/test/aws-custom-resource/aws-custom-resource-provider.test.ts +++ b/packages/@aws-cdk/custom-resources/test/aws-custom-resource/aws-custom-resource-provider.test.ts @@ -151,6 +151,41 @@ test('delete event', async () => { expect(request.isDone()).toBeTruthy(); }); +test('delete event with Delete call and no physical resource id in call', async () => { + const deleteParameterFake = sinon.fake.resolves({}); + + AWS.mock('SSM', 'deleteParameter', deleteParameterFake); + + const event: AWSLambda.CloudFormationCustomResourceDeleteEvent = { + ...eventCommon, + RequestType: 'Delete', + PhysicalResourceId: 'physicalResourceId', + ResourceProperties: { + ServiceToken: 'token', + Delete: { + service: 'SSM', + action: 'deleteParameter', + parameters: { + Name: 'my-param' + }, + } as AwsSdkCall + } + }; + + const request = createRequest(body => + body.Status === 'SUCCESS' && + body.PhysicalResourceId === 'physicalResourceId' + ); + + await handler(event, {} as AWSLambda.Context); + + sinon.assert.calledWith(deleteParameterFake, { + Name: 'my-param' + }); + + expect(request.isDone()).toBeTruthy(); +}); + test('catch errors', async () => { const error: NodeJS.ErrnoException = new Error(); error.code = 'NoSuchBucket'; diff --git a/packages/@aws-cdk/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.expected.json b/packages/@aws-cdk/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.expected.json index f22e625ffa0b6..880c33b630c11 100644 --- a/packages/@aws-cdk/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.expected.json +++ b/packages/@aws-cdk/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.expected.json @@ -109,7 +109,7 @@ "Properties": { "Code": { "S3Bucket": { - "Ref": "AssetParameters1e957dd8cdd272089cd3aab5aa7cf195406aa84f4234b0cdab8553fe0268a3c2S3Bucket8CF060C1" + "Ref": "AssetParametersc6841f16fc6689f1b3a9ae6e91f18d4e6cc06c23c2b1e7b7155625c258cb8999S3Bucket38F49C79" }, "S3Key": { "Fn::Join": [ @@ -122,7 +122,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters1e957dd8cdd272089cd3aab5aa7cf195406aa84f4234b0cdab8553fe0268a3c2S3VersionKey2F6385AE" + "Ref": "AssetParametersc6841f16fc6689f1b3a9ae6e91f18d4e6cc06c23c2b1e7b7155625c258cb8999S3VersionKey9906BC0C" } ] } @@ -135,7 +135,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters1e957dd8cdd272089cd3aab5aa7cf195406aa84f4234b0cdab8553fe0268a3c2S3VersionKey2F6385AE" + "Ref": "AssetParametersc6841f16fc6689f1b3a9ae6e91f18d4e6cc06c23c2b1e7b7155625c258cb8999S3VersionKey9906BC0C" } ] } @@ -230,17 +230,17 @@ } }, "Parameters": { - "AssetParameters1e957dd8cdd272089cd3aab5aa7cf195406aa84f4234b0cdab8553fe0268a3c2S3Bucket8CF060C1": { + "AssetParametersc6841f16fc6689f1b3a9ae6e91f18d4e6cc06c23c2b1e7b7155625c258cb8999S3Bucket38F49C79": { "Type": "String", - "Description": "S3 bucket for asset \"1e957dd8cdd272089cd3aab5aa7cf195406aa84f4234b0cdab8553fe0268a3c2\"" + "Description": "S3 bucket for asset \"c6841f16fc6689f1b3a9ae6e91f18d4e6cc06c23c2b1e7b7155625c258cb8999\"" }, - "AssetParameters1e957dd8cdd272089cd3aab5aa7cf195406aa84f4234b0cdab8553fe0268a3c2S3VersionKey2F6385AE": { + "AssetParametersc6841f16fc6689f1b3a9ae6e91f18d4e6cc06c23c2b1e7b7155625c258cb8999S3VersionKey9906BC0C": { "Type": "String", - "Description": "S3 key for asset version \"1e957dd8cdd272089cd3aab5aa7cf195406aa84f4234b0cdab8553fe0268a3c2\"" + "Description": "S3 key for asset version \"c6841f16fc6689f1b3a9ae6e91f18d4e6cc06c23c2b1e7b7155625c258cb8999\"" }, - "AssetParameters1e957dd8cdd272089cd3aab5aa7cf195406aa84f4234b0cdab8553fe0268a3c2ArtifactHash2B344D8E": { + "AssetParametersc6841f16fc6689f1b3a9ae6e91f18d4e6cc06c23c2b1e7b7155625c258cb8999ArtifactHash5595423D": { "Type": "String", - "Description": "Artifact hash for asset \"1e957dd8cdd272089cd3aab5aa7cf195406aa84f4234b0cdab8553fe0268a3c2\"" + "Description": "Artifact hash for asset \"c6841f16fc6689f1b3a9ae6e91f18d4e6cc06c23c2b1e7b7155625c258cb8999\"" } }, "Outputs": { diff --git a/packages/@aws-cdk/cx-api/package.json b/packages/@aws-cdk/cx-api/package.json index 79f67ea8cb62e..0f2df80f2d0ba 100644 --- a/packages/@aws-cdk/cx-api/package.json +++ b/packages/@aws-cdk/cx-api/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/cx-api", - "version": "1.20.0", + "version": "1.21.0", "description": "Cloud executable protocol", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -66,11 +66,11 @@ }, "license": "Apache-2.0", "devDependencies": { - "@types/jest": "^24.0.25", + "@types/jest": "^24.9.0", "@types/semver": "^6.2.0", - "cdk-build-tools": "1.20.0", + "cdk-build-tools": "1.21.0", "jest": "^24.9.0", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "repository": { "url": "https://github.com/aws/aws-cdk.git", diff --git a/packages/@aws-cdk/region-info/package.json b/packages/@aws-cdk/region-info/package.json index 8f51a8904e8a1..ea7cbf04547ec 100644 --- a/packages/@aws-cdk/region-info/package.json +++ b/packages/@aws-cdk/region-info/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/region-info", - "version": "1.20.0", + "version": "1.21.0", "description": "AWS region information, such as service principal names", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,9 +53,9 @@ "license": "Apache-2.0", "devDependencies": { "@types/fs-extra": "^8.0.1", - "cdk-build-tools": "1.20.0", + "cdk-build-tools": "1.21.0", "fs-extra": "^8.1.0", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "jest": { "coverageReporters": [ diff --git a/packages/aws-cdk/bin/cdk.ts b/packages/aws-cdk/bin/cdk.ts index e96084d5c2c3b..2563ba389d260 100644 --- a/packages/aws-cdk/bin/cdk.ts +++ b/packages/aws-cdk/bin/cdk.ts @@ -3,6 +3,7 @@ import 'source-map-support/register'; import * as cxapi from '@aws-cdk/cx-api'; import * as colors from 'colors/safe'; +import * as fs from 'fs-extra'; import * as path from 'path'; import * as yargs from 'yargs'; @@ -17,7 +18,7 @@ import { availableInitLanguages, cliInit, printAvailableTemplates } from '../lib import { data, debug, error, print, setVerbose, success } from '../lib/logging'; import { PluginHost } from '../lib/plugin'; import { serializeStructure } from '../lib/serialize'; -import { Configuration, Settings } from '../lib/settings'; +import { Configuration, PROJECT_CONFIG, Settings } from '../lib/settings'; import * as version from '../lib/version'; // tslint:disable:no-shadowed-variable max-line-length @@ -103,6 +104,16 @@ async function initCommandLine() { if (argv.verbose) { setVerbose(); } + + const projectRootDirectory = await lookupProjectRoot(); + + if (projectRootDirectory) { + // We change to the project root directory to maintian the behavior prior to (1.21.0) this feature, where + // cdk commands had to be executed from the project root. + // Note that if we cannot locate the project root, then we proceed anyway because the user might have the "app" configured in some other way. + process.chdir(projectRootDirectory); + } + debug('CDK toolkit version:', version.DISPLAY_VERSION); debug('Command line arguments:', argv); @@ -382,6 +393,31 @@ async function initCommandLine() { } } +async function lookupProjectRoot(): Promise { + + async function ascend(directory: string): Promise { + + const filePath = path.join(directory, PROJECT_CONFIG); + + if (await fs.pathExists(filePath)) { + return directory; + } + + const parentDir = path.dirname(directory); + + if (parentDir === directory) { + // We reached the file system root, give up. + return undefined; + } + + return ascend(parentDir); + + } + + return ascend(path.resolve(process.cwd())); + +} + initCommandLine() .then(value => { if (value == null) { return; } diff --git a/packages/aws-cdk/lib/api/util/sdk.ts b/packages/aws-cdk/lib/api/util/sdk.ts index af1b776d01277..f9efd98c67b4d 100644 --- a/packages/aws-cdk/lib/api/util/sdk.ts +++ b/packages/aws-cdk/lib/api/util/sdk.ts @@ -195,9 +195,9 @@ export class SDK implements ISDK { return environment; } - private async configureSDKHttpOptions(options: SDKOptions) { + private configureSDKHttpOptions(options: SDKOptions) { const config: {[k: string]: any} = {}; - const httpOptions: {[k: string]: any} = {}; + config.httpOptions = {}; let userAgent = options.userAgent; if (userAgent == null) { @@ -207,19 +207,30 @@ export class SDK implements ISDK { } config.customUserAgent = userAgent; - // https://aws.amazon.com/blogs/developer/using-the-aws-sdk-for-javascript-from-behind-a-proxy/ - options.proxyAddress = options.proxyAddress || httpsProxyFromEnvironment(); - options.caBundlePath = options.caBundlePath || caBundlePathFromEnvironment(); + const proxyAddress = options.proxyAddress || httpsProxyFromEnvironment(); + const caBundlePath = options.caBundlePath || caBundlePathFromEnvironment(); - if (options.proxyAddress) { // Ignore empty string on purpose - debug('Using proxy server: %s', options.proxyAddress); - httpOptions.proxy = options.proxyAddress; + if (proxyAddress && caBundlePath) { + throw new Error(`At the moment, cannot specify Proxy (${proxyAddress}) and CA Bundle (${caBundlePath}) at the same time. See https://github.com/aws/aws-cdk/issues/5804`); + // Maybe it's possible after all, but I've been staring at + // https://github.com/TooTallNate/node-proxy-agent/blob/master/index.js#L79 + // a while now trying to figure out what to pass in so that the underlying Agent + // object will get the 'ca' argument. It's not trivial and I don't want to risk it. } - if (options.caBundlePath) { - debug('Using ca bundle path: %s', options.caBundlePath); - httpOptions.agent = new https.Agent({ca: await readIfPossible(options.caBundlePath)}); + + if (proxyAddress) { // Ignore empty string on purpose + // https://aws.amazon.com/blogs/developer/using-the-aws-sdk-for-javascript-from-behind-a-proxy/ + debug('Using proxy server: %s', proxyAddress); + // eslint-disable-next-line @typescript-eslint/no-require-imports + const ProxyAgent: any = require('proxy-agent'); + config.httpOptions.agent = new ProxyAgent(proxyAddress); + } + if (caBundlePath) { + debug('Using CA bundle path: %s', caBundlePath); + config.httpOptions.agent = new https.Agent({ + ca: readIfPossible(caBundlePath) + }); } - config.httpOptions = httpOptions; AWS.config.update(config); } @@ -512,7 +523,7 @@ async function hasEc2Credentials() { ['/sys/devices/virtual/dmi/id/sys_vendor', /ec2/i], ]; for (const [file, re] of files) { - if (matchesRegex(re, await readIfPossible(file))) { + if (matchesRegex(re, readIfPossible(file))) { instance = true; break; } @@ -532,10 +543,15 @@ async function setConfigVariable() { } } -async function readIfPossible(filename: string): Promise { +/** + * Read a file if it exists, or return undefined + * + * Not async because it is used in the constructor + */ +function readIfPossible(filename: string): string | undefined { try { - if (!await fs.pathExists(filename)) { return undefined; } - return fs.readFile(filename, { encoding: 'utf-8' }); + if (!fs.pathExistsSync(filename)) { return undefined; } + return fs.readFileSync(filename, { encoding: 'utf-8' }); } catch (e) { debug(e); return undefined; diff --git a/packages/aws-cdk/lib/init-templates/sample-app/fsharp/src/%name.PascalCased%/%name.PascalCased%Stack.template.fs b/packages/aws-cdk/lib/init-templates/sample-app/fsharp/src/%name.PascalCased%/%name.PascalCased%Stack.template.fs index f78b30d675d0f..1582e37f4faaf 100644 --- a/packages/aws-cdk/lib/init-templates/sample-app/fsharp/src/%name.PascalCased%/%name.PascalCased%Stack.template.fs +++ b/packages/aws-cdk/lib/init-templates/sample-app/fsharp/src/%name.PascalCased%/%name.PascalCased%Stack.template.fs @@ -1,4 +1,4 @@ -namespace HelloCdk +namespace %name.PascalCased% open Amazon.CDK open Amazon.CDK.AWS.SNS diff --git a/packages/aws-cdk/lib/init-templates/sample-app/fsharp/src/%name.PascalCased%/Program.template.fs b/packages/aws-cdk/lib/init-templates/sample-app/fsharp/src/%name.PascalCased%/Program.template.fs index 77234df375089..dc618af3fbbf1 100644 --- a/packages/aws-cdk/lib/init-templates/sample-app/fsharp/src/%name.PascalCased%/Program.template.fs +++ b/packages/aws-cdk/lib/init-templates/sample-app/fsharp/src/%name.PascalCased%/Program.template.fs @@ -1,9 +1,11 @@ open Amazon.CDK -open %name.PascalCased%Stack +open %name.PascalCased% [] let main _ = let app = App(null) - %name.PascalCased%Stack(app, "%name.PascalCased%Stack", StackProps) |> ignore + + %name.PascalCased%Stack(app, "%name.PascalCased%Stack", StackProps()) |> ignore + app.Synth() |> ignore 0 diff --git a/packages/aws-cdk/lib/init-templates/sample-app/java/src/test/java/com/myorg/%name.PascalCased%StackTest.template.java b/packages/aws-cdk/lib/init-templates/sample-app/java/src/test/java/com/myorg/%name.PascalCased%StackTest.template.java index d9f09a46d7fef..aaca734f06d68 100644 --- a/packages/aws-cdk/lib/init-templates/sample-app/java/src/test/java/com/myorg/%name.PascalCased%StackTest.template.java +++ b/packages/aws-cdk/lib/init-templates/sample-app/java/src/test/java/com/myorg/%name.PascalCased%StackTest.template.java @@ -19,6 +19,6 @@ public void testStack() throws IOException { %name.PascalCased%Stack stack = new %name.PascalCased%Stack(app, "test"); JsonNode actual = JSON.valueToTree(app.synth().getStackArtifact(stack.getArtifactId()).getTemplate()); - assertThat(actual.asText(), CoreMatchers.both(CoreMatchers.containsString("AWS::SQS::Queue")).and(CoreMatchers.containsString("AWS::SNS::Topic"))); + assertThat(actual.toString(), CoreMatchers.both(CoreMatchers.containsString("AWS::SQS::Queue")).and(CoreMatchers.containsString("AWS::SNS::Topic"))); } } diff --git a/packages/aws-cdk/lib/init-templates/sample-app/python/%name%/%name%_stack.template.py b/packages/aws-cdk/lib/init-templates/sample-app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py similarity index 100% rename from packages/aws-cdk/lib/init-templates/sample-app/python/%name%/%name%_stack.template.py rename to packages/aws-cdk/lib/init-templates/sample-app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py diff --git a/packages/aws-cdk/lib/init-templates/sample-app/python/%name%/__init__.py b/packages/aws-cdk/lib/init-templates/sample-app/python/%name.PythonModule%/__init__.py similarity index 100% rename from packages/aws-cdk/lib/init-templates/sample-app/python/%name%/__init__.py rename to packages/aws-cdk/lib/init-templates/sample-app/python/%name.PythonModule%/__init__.py diff --git a/packages/aws-cdk/lib/init-templates/sample-app/python/README.template.md b/packages/aws-cdk/lib/init-templates/sample-app/python/README.template.md index 2716cd118afc4..b8084d113f854 100644 --- a/packages/aws-cdk/lib/init-templates/sample-app/python/README.template.md +++ b/packages/aws-cdk/lib/init-templates/sample-app/python/README.template.md @@ -1,13 +1,13 @@ # Welcome to your CDK Python project! -You should explore the contents of this project. It demonstrates a CDK app with an instance of a stack (`%name.PascalCased%Stack`) +You should explore the contents of this project. It demonstrates a CDK app with an instance of a stack (`%name.PythonModule%_stack`) which contains an Amazon SQS queue that is subscribed to an Amazon SNS topic. The `cdk.json` file tells the CDK Toolkit how to execute your app. This project is set up like a standard Python project. The initialization process also creates -a virtualenv within this project, stored under the .env directory. To create the virtualenv +a virtualenv within this project, stored under the .env directory. To create the virtualenv it assumes that there is a `python3` executable in your path with access to the `venv` package. If for any reason the automatic creation of the virtualenv fails, you can create the virtualenv manually once the init process completes. diff --git a/packages/aws-cdk/lib/init-templates/sample-app/python/app.template.py b/packages/aws-cdk/lib/init-templates/sample-app/python/app.template.py index 40c3c3526af30..580bbee9e069c 100644 --- a/packages/aws-cdk/lib/init-templates/sample-app/python/app.template.py +++ b/packages/aws-cdk/lib/init-templates/sample-app/python/app.template.py @@ -2,10 +2,10 @@ from aws_cdk import core -from %name%.%name%_stack import %name.PascalCased%Stack +from %name.PythonModule%.%name.PythonModule%_stack import %name.PascalCased%Stack app = core.App() -%name.PascalCased%Stack(app, "%name%", env={'region': 'us-west-2'}) +%name.PascalCased%Stack(app, "%name.StackName%", env={'region': 'us-west-2'}) app.synth() diff --git a/packages/aws-cdk/lib/init-templates/sample-app/python/setup.template.py b/packages/aws-cdk/lib/init-templates/sample-app/python/setup.template.py index 09829f28d4151..f7d9afb7473bc 100644 --- a/packages/aws-cdk/lib/init-templates/sample-app/python/setup.template.py +++ b/packages/aws-cdk/lib/init-templates/sample-app/python/setup.template.py @@ -6,7 +6,7 @@ setuptools.setup( - name="%name%", + name="%name.PythonModule%", version="0.0.1", description="A sample CDK Python app", @@ -15,8 +15,8 @@ author="author", - package_dir={"": "%name%"}, - packages=setuptools.find_packages(where="%name%"), + package_dir={"": "%name.PythonModule%"}, + packages=setuptools.find_packages(where="%name.PythonModule%"), install_requires=[ "aws-cdk.core", diff --git a/packages/aws-cdk/lib/init-templates/sample-app/python/tests/unit/test_%name%_stack.template.py b/packages/aws-cdk/lib/init-templates/sample-app/python/tests/unit/test_%name.PythonModule%_stack.template.py similarity index 56% rename from packages/aws-cdk/lib/init-templates/sample-app/python/tests/unit/test_%name%_stack.template.py rename to packages/aws-cdk/lib/init-templates/sample-app/python/tests/unit/test_%name.PythonModule%_stack.template.py index 5c441bd3ae13d..fab17d075ac44 100644 --- a/packages/aws-cdk/lib/init-templates/sample-app/python/tests/unit/test_%name%_stack.template.py +++ b/packages/aws-cdk/lib/init-templates/sample-app/python/tests/unit/test_%name.PythonModule%_stack.template.py @@ -2,13 +2,13 @@ import pytest from aws_cdk import core -from %name%.%name%_stack import %name.PascalCased%Stack +from %name%.%name.PythonModule%_stack import %name.PascalCased%Stack def get_template(): app = core.App() - %name.PascalCased%Stack(app, "%name%") - return json.dumps(app.synth().get_stack("%name%").template) + %name.PascalCased%Stack(app, "%name.StackName%") + return json.dumps(app.synth().get_stack("%name.StackName%").template) def test_sqs_queue_created(): diff --git a/packages/aws-cdk/package.json b/packages/aws-cdk/package.json index 4f4528058f61e..73620108c970a 100644 --- a/packages/aws-cdk/package.json +++ b/packages/aws-cdk/package.json @@ -1,7 +1,7 @@ { "name": "aws-cdk", "description": "CDK Toolkit, the command line tool for CDK apps", - "version": "1.20.0", + "version": "1.21.0", "main": "lib/index.js", "types": "lib/index.d.ts", "bin": { @@ -42,8 +42,8 @@ "@types/archiver": "^3.0.0", "@types/fs-extra": "^8.0.1", "@types/glob": "^7.1.1", - "@types/jest": "^24.0.25", - "@types/jszip": "^3.1.6", + "@types/jest": "^24.9.0", + "@types/jszip": "^3.1.7", "@types/minimatch": "^3.0.3", "@types/mockery": "^1.4.29", "@types/node": "^10.17.13", @@ -54,22 +54,22 @@ "@types/table": "^4.0.7", "@types/uuid": "^3.4.6", "@types/yaml": "^1.2.0", - "@types/yargs": "^13.0.4", + "@types/yargs": "^15.0.0", "aws-sdk-mock": "^5.0.0", - "cdk-build-tools": "1.20.0", + "cdk-build-tools": "1.21.0", "jest": "^24.9.0", "jszip": "^3.2.2", "mockery": "^2.1.0", - "pkglint": "1.20.0", - "sinon": "^8.0.2", - "ts-jest": "^24.2.0" + "pkglint": "1.21.0", + "sinon": "^8.0.4", + "ts-jest": "^24.3.0" }, "dependencies": { - "@aws-cdk/cloudformation-diff": "1.20.0", - "@aws-cdk/cx-api": "1.20.0", - "@aws-cdk/region-info": "1.20.0", + "@aws-cdk/cloudformation-diff": "1.21.0", + "@aws-cdk/cx-api": "1.21.0", + "@aws-cdk/region-info": "1.21.0", "archiver": "^3.1.1", - "aws-sdk": "^2.599.0", + "aws-sdk": "^2.601.0", "camelcase": "^5.3.1", "colors": "^1.4.0", "decamelize": "^3.2.0", @@ -78,6 +78,7 @@ "json-diff": "^0.5.4", "minimatch": ">=3.0", "promptly": "^3.0.3", + "proxy-agent": "^3.1.1", "request": "^2.88.0", "semver": "^7.1.1", "source-map-support": "^0.5.16", diff --git a/packages/aws-cdk/test/docker.test.ts b/packages/aws-cdk/test/docker.test.ts index 0d903b62d80d7..1dc03fa0f4c58 100644 --- a/packages/aws-cdk/test/docker.test.ts +++ b/packages/aws-cdk/test/docker.test.ts @@ -297,3 +297,45 @@ test('relative path', async () => { prepareEcrRepositoryStub.restore(); shellStub.restore(); }); + +test('passes the correct file to docker build', async () => { + // GIVEN + const toolkit = new ToolkitInfo({ + sdk: new MockSDK(), + bucketName: 'BUCKET_NAME', + bucketEndpoint: 'BUCKET_ENDPOINT', + environment: { name: 'env', account: '1234', region: 'abc' } + }); + + const prepareEcrRepositoryStub = sinon.stub(toolkit, 'prepareEcrRepository').resolves({ + repositoryUri: 'uri', + repositoryName: 'name' + }); + + const shellStub = sinon.stub(os, 'shell').rejects('STOPTEST'); + + // WHEN + const asset: cxapi.ContainerImageAssetMetadataEntry = { + id: 'assetId', + imageNameParameter: 'MyParameter', + packaging: 'container-image', + path: '/foo', + sourceHash: '1234567890abcdef', + repositoryName: 'some-name', + file: 'some-file' + }; + + try { + await prepareContainerAsset('.', asset, toolkit, false); + } catch (e) { + if (!/STOPTEST/.test(e.toString())) { throw e; } + } + + // THEN + const command = ['docker', 'build', '--tag', `uri:latest`, '/foo', '--file', 'some-file']; + + expect(shellStub.calledWith(command)).toBeTruthy(); + + prepareEcrRepositoryStub.restore(); + shellStub.restore(); +}); diff --git a/packages/aws-cdk/test/integ/cli/test-cdk-from-inner-directory.sh b/packages/aws-cdk/test/integ/cli/test-cdk-from-inner-directory.sh new file mode 100755 index 0000000000000..2d9305d19e24e --- /dev/null +++ b/packages/aws-cdk/test/integ/cli/test-cdk-from-inner-directory.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -euo pipefail +scriptdir=$(cd $(dirname $0) && pwd) +source ${scriptdir}/common.bash +# ---------------------------------------------------------- + +setup + +pushd docker +cdk diff ${STACK_NAME_PREFIX}-test-1 + +echo "✅ success" diff --git a/packages/aws-cdk/test/integ/cli/test-cdk-from-outer-directory.sh b/packages/aws-cdk/test/integ/cli/test-cdk-from-outer-directory.sh new file mode 100755 index 0000000000000..cc9bbe934ad22 --- /dev/null +++ b/packages/aws-cdk/test/integ/cli/test-cdk-from-outer-directory.sh @@ -0,0 +1,26 @@ +#!/bin/bash +set -euo pipefail +scriptdir=$(cd $(dirname $0) && pwd) +source ${scriptdir}/common.bash +# ---------------------------------------------------------- + +setup + +temp_dir=$(mktemp -d) + +function cleanup() { + rm -rf ${temp_dir} +} + +trap cleanup EXIT INT + +pushd ${temp_dir} +set +e +output="$(cdk diff ${STACK_NAME_PREFIX}-test-1 2>&1)" +set -e + +if [[ "${output}" != *"--app is required"* ]]; then + fail "unexpected output when running 'cdk diff' from outer directory: ${output}" +fi + +echo "✅ success" diff --git a/packages/aws-cdk/test/integ/init/common.bash b/packages/aws-cdk/test/integ/init/common.bash index 1298b2b3f71fa..f41f02b5215e8 100644 --- a/packages/aws-cdk/test/integ/init/common.bash +++ b/packages/aws-cdk/test/integ/init/common.bash @@ -1,5 +1,5 @@ set -eu -init_test_dir=/tmp/cdk-init-test +init_test_dir="${init_test_dir:=/tmp/cdk-init-test}" function setup() { rm -rf $init_test_dir diff --git a/packages/aws-cdk/test/integ/init/test-csharp.sh b/packages/aws-cdk/test/integ/init/test-csharp.sh index 65b479812f77d..ea82e3b63f38c 100755 --- a/packages/aws-cdk/test/integ/init/test-csharp.sh +++ b/packages/aws-cdk/test/integ/init/test-csharp.sh @@ -21,6 +21,6 @@ for template in $templates; do setup - cdk init -l csharp -t $template + cdk init -l csharp $template cdk synth done diff --git a/packages/aws-cdk/test/integ/init/test-fsharp.sh b/packages/aws-cdk/test/integ/init/test-fsharp.sh index 146384fff0d25..f8ad463703672 100755 --- a/packages/aws-cdk/test/integ/init/test-fsharp.sh +++ b/packages/aws-cdk/test/integ/init/test-fsharp.sh @@ -21,6 +21,6 @@ for template in $templates; do setup - cdk init -l fsharp -t $template + cdk init -l fsharp $template cdk synth done diff --git a/packages/aws-cdk/test/integ/init/test-java.sh b/packages/aws-cdk/test/integ/init/test-java.sh index 81cf7deccf4ea..f27441809da3c 100755 --- a/packages/aws-cdk/test/integ/init/test-java.sh +++ b/packages/aws-cdk/test/integ/init/test-java.sh @@ -21,6 +21,6 @@ for template in $templates; do setup - cdk init -l java -t $template + cdk init -l java $template cdk synth done diff --git a/packages/aws-cdk/test/integ/init/test-javascript.sh b/packages/aws-cdk/test/integ/init/test-javascript.sh index d386eaafbad29..c161d35a5edd1 100755 --- a/packages/aws-cdk/test/integ/init/test-javascript.sh +++ b/packages/aws-cdk/test/integ/init/test-javascript.sh @@ -21,6 +21,6 @@ for template in $templates; do setup - cdk init -l javascript -t $template + cdk init -l javascript $template cdk synth done diff --git a/packages/aws-cdk/test/integ/init/test-python-stackname.sh b/packages/aws-cdk/test/integ/init/test-python-stackname.sh new file mode 100755 index 0000000000000..415c9bdb25cf2 --- /dev/null +++ b/packages/aws-cdk/test/integ/init/test-python-stackname.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# Naming shim for backwards compatibility with legacy +# tests and canaries. +set -eu +scriptdir=$(cd $(dirname $0) && pwd) +init_test_dir=/tmp/cdkInitTest +source $scriptdir/test-python.sh diff --git a/packages/aws-cdk/test/integ/init/test-python.sh b/packages/aws-cdk/test/integ/init/test-python.sh index 0c6304f5c1c5f..33034466f05d0 100755 --- a/packages/aws-cdk/test/integ/init/test-python.sh +++ b/packages/aws-cdk/test/integ/init/test-python.sh @@ -21,7 +21,7 @@ for template in $templates; do setup - cdk init -l python -t $template + cdk init -l python $template source .env/bin/activate type -p pip diff --git a/packages/aws-cdk/test/integ/init/test-typescript.sh b/packages/aws-cdk/test/integ/init/test-typescript.sh index 0943ae90caa04..67a6cb2920729 100755 --- a/packages/aws-cdk/test/integ/init/test-typescript.sh +++ b/packages/aws-cdk/test/integ/init/test-typescript.sh @@ -21,9 +21,13 @@ for template in $templates; do setup - cdk init -l typescript -t $template + cdk init -l typescript $template npm ls # this will fail if we have unmet peer dependencies npm run build npm run test - cdk synth + + # Can't run `cdk synth` on libraries + if [[ $template != "lib" ]]; then + cdk synth + fi done diff --git a/packages/cdk-dasm/package.json b/packages/cdk-dasm/package.json index 66baeba8e00e5..991c830e0ac56 100644 --- a/packages/cdk-dasm/package.json +++ b/packages/cdk-dasm/package.json @@ -1,6 +1,6 @@ { "name": "cdk-dasm", - "version": "1.20.0", + "version": "1.21.0", "description": "AWS CDK disassembler: convert CloudFormation to code", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -30,7 +30,7 @@ "yaml": "1.7.2" }, "devDependencies": { - "@types/jest": "^24.0.25", + "@types/jest": "^24.9.0", "@types/yaml": "1.2.0", "jest": "^24.9.0" }, diff --git a/packages/cdk/package.json b/packages/cdk/package.json index 38ee86438f4f1..551e5d877101d 100644 --- a/packages/cdk/package.json +++ b/packages/cdk/package.json @@ -1,12 +1,12 @@ { "name": "cdk", - "version": "1.20.0", + "version": "1.21.0", "description": "AWS CDK Toolkit", "bin": { "cdk": "bin/cdk" }, "dependencies": { - "aws-cdk": "1.20.0" + "aws-cdk": "1.21.0" }, "repository": { "type": "git", diff --git a/packages/decdk/package.json b/packages/decdk/package.json index a964c31cbe51f..185c3cd755d4f 100644 --- a/packages/decdk/package.json +++ b/packages/decdk/package.json @@ -1,6 +1,6 @@ { "name": "decdk", - "version": "1.20.0", + "version": "1.21.0", "description": "Declarative CDK: a CloudFormation-like syntax for defining CDK stacks", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -27,137 +27,137 @@ }, "license": "Apache-2.0", "dependencies": { - "@aws-cdk/alexa-ask": "1.20.0", - "@aws-cdk/app-delivery": "1.20.0", - "@aws-cdk/assets": "1.20.0", - "@aws-cdk/aws-accessanalyzer": "1.20.0", - "@aws-cdk/aws-amazonmq": "1.20.0", - "@aws-cdk/aws-amplify": "1.20.0", - "@aws-cdk/aws-apigateway": "1.20.0", - "@aws-cdk/aws-applicationautoscaling": "1.20.0", - "@aws-cdk/aws-appmesh": "1.20.0", - "@aws-cdk/aws-appstream": "1.20.0", - "@aws-cdk/aws-appsync": "1.20.0", - "@aws-cdk/aws-athena": "1.20.0", - "@aws-cdk/aws-autoscaling": "1.20.0", - "@aws-cdk/aws-autoscaling-common": "1.20.0", - "@aws-cdk/aws-autoscaling-hooktargets": "1.20.0", - "@aws-cdk/aws-autoscalingplans": "1.20.0", - "@aws-cdk/aws-backup": "1.20.0", - "@aws-cdk/aws-batch": "1.20.0", - "@aws-cdk/aws-budgets": "1.20.0", - "@aws-cdk/aws-certificatemanager": "1.20.0", - "@aws-cdk/aws-cloud9": "1.20.0", - "@aws-cdk/aws-cloudformation": "1.20.0", - "@aws-cdk/aws-cloudfront": "1.20.0", - "@aws-cdk/aws-cloudtrail": "1.20.0", - "@aws-cdk/aws-cloudwatch": "1.20.0", - "@aws-cdk/aws-cloudwatch-actions": "1.20.0", - "@aws-cdk/aws-codebuild": "1.20.0", - "@aws-cdk/aws-codecommit": "1.20.0", - "@aws-cdk/aws-codedeploy": "1.20.0", - "@aws-cdk/aws-codepipeline": "1.20.0", - "@aws-cdk/aws-codepipeline-actions": "1.20.0", - "@aws-cdk/aws-codestar": "1.20.0", - "@aws-cdk/aws-codestarnotifications": "1.20.0", - "@aws-cdk/aws-cognito": "1.20.0", - "@aws-cdk/aws-config": "1.20.0", - "@aws-cdk/aws-datapipeline": "1.20.0", - "@aws-cdk/aws-dax": "1.20.0", - "@aws-cdk/aws-directoryservice": "1.20.0", - "@aws-cdk/aws-dlm": "1.20.0", - "@aws-cdk/aws-dms": "1.20.0", - "@aws-cdk/aws-docdb": "1.20.0", - "@aws-cdk/aws-dynamodb": "1.20.0", - "@aws-cdk/aws-dynamodb-global": "1.20.0", - "@aws-cdk/aws-ec2": "1.20.0", - "@aws-cdk/aws-ecr": "1.20.0", - "@aws-cdk/aws-ecr-assets": "1.20.0", - "@aws-cdk/aws-ecs": "1.20.0", - "@aws-cdk/aws-ecs-patterns": "1.20.0", - "@aws-cdk/aws-efs": "1.20.0", - "@aws-cdk/aws-eks": "1.20.0", - "@aws-cdk/aws-eks-legacy": "1.20.0", - "@aws-cdk/aws-elasticache": "1.20.0", - "@aws-cdk/aws-elasticbeanstalk": "1.20.0", - "@aws-cdk/aws-elasticloadbalancing": "1.20.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.20.0", - "@aws-cdk/aws-elasticloadbalancingv2-targets": "1.20.0", - "@aws-cdk/aws-elasticsearch": "1.20.0", - "@aws-cdk/aws-emr": "1.20.0", - "@aws-cdk/aws-events": "1.20.0", - "@aws-cdk/aws-events-targets": "1.20.0", - "@aws-cdk/aws-eventschemas": "1.20.0", - "@aws-cdk/aws-fsx": "1.20.0", - "@aws-cdk/aws-gamelift": "1.20.0", - "@aws-cdk/aws-glue": "1.20.0", - "@aws-cdk/aws-greengrass": "1.20.0", - "@aws-cdk/aws-guardduty": "1.20.0", - "@aws-cdk/aws-iam": "1.20.0", - "@aws-cdk/aws-inspector": "1.20.0", - "@aws-cdk/aws-iot": "1.20.0", - "@aws-cdk/aws-iot1click": "1.20.0", - "@aws-cdk/aws-iotanalytics": "1.20.0", - "@aws-cdk/aws-iotevents": "1.20.0", - "@aws-cdk/aws-iotthingsgraph": "1.20.0", - "@aws-cdk/aws-kinesis": "1.20.0", - "@aws-cdk/aws-kinesisanalytics": "1.20.0", - "@aws-cdk/aws-kinesisfirehose": "1.20.0", - "@aws-cdk/aws-kms": "1.20.0", - "@aws-cdk/aws-lakeformation": "1.20.0", - "@aws-cdk/aws-lambda": "1.20.0", - "@aws-cdk/aws-lambda-destinations": "1.20.0", - "@aws-cdk/aws-lambda-event-sources": "1.20.0", - "@aws-cdk/aws-logs": "1.20.0", - "@aws-cdk/aws-logs-destinations": "1.20.0", - "@aws-cdk/aws-managedblockchain": "1.20.0", - "@aws-cdk/aws-mediaconvert": "1.20.0", - "@aws-cdk/aws-medialive": "1.20.0", - "@aws-cdk/aws-mediastore": "1.20.0", - "@aws-cdk/aws-msk": "1.20.0", - "@aws-cdk/aws-neptune": "1.20.0", - "@aws-cdk/aws-opsworks": "1.20.0", - "@aws-cdk/aws-opsworkscm": "1.20.0", - "@aws-cdk/aws-pinpoint": "1.20.0", - "@aws-cdk/aws-pinpointemail": "1.20.0", - "@aws-cdk/aws-qldb": "1.20.0", - "@aws-cdk/aws-ram": "1.20.0", - "@aws-cdk/aws-rds": "1.20.0", - "@aws-cdk/aws-redshift": "1.20.0", - "@aws-cdk/aws-robomaker": "1.20.0", - "@aws-cdk/aws-route53": "1.20.0", - "@aws-cdk/aws-route53-patterns": "1.20.0", - "@aws-cdk/aws-route53-targets": "1.20.0", - "@aws-cdk/aws-route53resolver": "1.20.0", - "@aws-cdk/aws-s3": "1.20.0", - "@aws-cdk/aws-s3-assets": "1.20.0", - "@aws-cdk/aws-s3-deployment": "1.20.0", - "@aws-cdk/aws-s3-notifications": "1.20.0", - "@aws-cdk/aws-sagemaker": "1.20.0", - "@aws-cdk/aws-sam": "1.20.0", - "@aws-cdk/aws-sdb": "1.20.0", - "@aws-cdk/aws-secretsmanager": "1.20.0", - "@aws-cdk/aws-securityhub": "1.20.0", - "@aws-cdk/aws-servicecatalog": "1.20.0", - "@aws-cdk/aws-servicediscovery": "1.20.0", - "@aws-cdk/aws-ses": "1.20.0", - "@aws-cdk/aws-ses-actions": "1.20.0", - "@aws-cdk/aws-sns": "1.20.0", - "@aws-cdk/aws-sns-subscriptions": "1.20.0", - "@aws-cdk/aws-sqs": "1.20.0", - "@aws-cdk/aws-ssm": "1.20.0", - "@aws-cdk/aws-stepfunctions": "1.20.0", - "@aws-cdk/aws-stepfunctions-tasks": "1.20.0", - "@aws-cdk/aws-transfer": "1.20.0", - "@aws-cdk/aws-waf": "1.20.0", - "@aws-cdk/aws-wafregional": "1.20.0", - "@aws-cdk/aws-wafv2": "1.20.0", - "@aws-cdk/aws-workspaces": "1.20.0", - "@aws-cdk/cfnspec": "1.20.0", - "@aws-cdk/core": "1.20.0", - "@aws-cdk/custom-resources": "1.20.0", - "@aws-cdk/cx-api": "1.20.0", - "@aws-cdk/region-info": "1.20.0", + "@aws-cdk/alexa-ask": "1.21.0", + "@aws-cdk/app-delivery": "1.21.0", + "@aws-cdk/assets": "1.21.0", + "@aws-cdk/aws-accessanalyzer": "1.21.0", + "@aws-cdk/aws-amazonmq": "1.21.0", + "@aws-cdk/aws-amplify": "1.21.0", + "@aws-cdk/aws-apigateway": "1.21.0", + "@aws-cdk/aws-applicationautoscaling": "1.21.0", + "@aws-cdk/aws-appmesh": "1.21.0", + "@aws-cdk/aws-appstream": "1.21.0", + "@aws-cdk/aws-appsync": "1.21.0", + "@aws-cdk/aws-athena": "1.21.0", + "@aws-cdk/aws-autoscaling": "1.21.0", + "@aws-cdk/aws-autoscaling-common": "1.21.0", + "@aws-cdk/aws-autoscaling-hooktargets": "1.21.0", + "@aws-cdk/aws-autoscalingplans": "1.21.0", + "@aws-cdk/aws-backup": "1.21.0", + "@aws-cdk/aws-batch": "1.21.0", + "@aws-cdk/aws-budgets": "1.21.0", + "@aws-cdk/aws-certificatemanager": "1.21.0", + "@aws-cdk/aws-cloud9": "1.21.0", + "@aws-cdk/aws-cloudformation": "1.21.0", + "@aws-cdk/aws-cloudfront": "1.21.0", + "@aws-cdk/aws-cloudtrail": "1.21.0", + "@aws-cdk/aws-cloudwatch": "1.21.0", + "@aws-cdk/aws-cloudwatch-actions": "1.21.0", + "@aws-cdk/aws-codebuild": "1.21.0", + "@aws-cdk/aws-codecommit": "1.21.0", + "@aws-cdk/aws-codedeploy": "1.21.0", + "@aws-cdk/aws-codepipeline": "1.21.0", + "@aws-cdk/aws-codepipeline-actions": "1.21.0", + "@aws-cdk/aws-codestar": "1.21.0", + "@aws-cdk/aws-codestarnotifications": "1.21.0", + "@aws-cdk/aws-cognito": "1.21.0", + "@aws-cdk/aws-config": "1.21.0", + "@aws-cdk/aws-datapipeline": "1.21.0", + "@aws-cdk/aws-dax": "1.21.0", + "@aws-cdk/aws-directoryservice": "1.21.0", + "@aws-cdk/aws-dlm": "1.21.0", + "@aws-cdk/aws-dms": "1.21.0", + "@aws-cdk/aws-docdb": "1.21.0", + "@aws-cdk/aws-dynamodb": "1.21.0", + "@aws-cdk/aws-dynamodb-global": "1.21.0", + "@aws-cdk/aws-ec2": "1.21.0", + "@aws-cdk/aws-ecr": "1.21.0", + "@aws-cdk/aws-ecr-assets": "1.21.0", + "@aws-cdk/aws-ecs": "1.21.0", + "@aws-cdk/aws-ecs-patterns": "1.21.0", + "@aws-cdk/aws-efs": "1.21.0", + "@aws-cdk/aws-eks": "1.21.0", + "@aws-cdk/aws-eks-legacy": "1.21.0", + "@aws-cdk/aws-elasticache": "1.21.0", + "@aws-cdk/aws-elasticbeanstalk": "1.21.0", + "@aws-cdk/aws-elasticloadbalancing": "1.21.0", + "@aws-cdk/aws-elasticloadbalancingv2": "1.21.0", + "@aws-cdk/aws-elasticloadbalancingv2-targets": "1.21.0", + "@aws-cdk/aws-elasticsearch": "1.21.0", + "@aws-cdk/aws-emr": "1.21.0", + "@aws-cdk/aws-events": "1.21.0", + "@aws-cdk/aws-events-targets": "1.21.0", + "@aws-cdk/aws-eventschemas": "1.21.0", + "@aws-cdk/aws-fsx": "1.21.0", + "@aws-cdk/aws-gamelift": "1.21.0", + "@aws-cdk/aws-glue": "1.21.0", + "@aws-cdk/aws-greengrass": "1.21.0", + "@aws-cdk/aws-guardduty": "1.21.0", + "@aws-cdk/aws-iam": "1.21.0", + "@aws-cdk/aws-inspector": "1.21.0", + "@aws-cdk/aws-iot": "1.21.0", + "@aws-cdk/aws-iot1click": "1.21.0", + "@aws-cdk/aws-iotanalytics": "1.21.0", + "@aws-cdk/aws-iotevents": "1.21.0", + "@aws-cdk/aws-iotthingsgraph": "1.21.0", + "@aws-cdk/aws-kinesis": "1.21.0", + "@aws-cdk/aws-kinesisanalytics": "1.21.0", + "@aws-cdk/aws-kinesisfirehose": "1.21.0", + "@aws-cdk/aws-kms": "1.21.0", + "@aws-cdk/aws-lakeformation": "1.21.0", + "@aws-cdk/aws-lambda": "1.21.0", + "@aws-cdk/aws-lambda-destinations": "1.21.0", + "@aws-cdk/aws-lambda-event-sources": "1.21.0", + "@aws-cdk/aws-logs": "1.21.0", + "@aws-cdk/aws-logs-destinations": "1.21.0", + "@aws-cdk/aws-managedblockchain": "1.21.0", + "@aws-cdk/aws-mediaconvert": "1.21.0", + "@aws-cdk/aws-medialive": "1.21.0", + "@aws-cdk/aws-mediastore": "1.21.0", + "@aws-cdk/aws-msk": "1.21.0", + "@aws-cdk/aws-neptune": "1.21.0", + "@aws-cdk/aws-opsworks": "1.21.0", + "@aws-cdk/aws-opsworkscm": "1.21.0", + "@aws-cdk/aws-pinpoint": "1.21.0", + "@aws-cdk/aws-pinpointemail": "1.21.0", + "@aws-cdk/aws-qldb": "1.21.0", + "@aws-cdk/aws-ram": "1.21.0", + "@aws-cdk/aws-rds": "1.21.0", + "@aws-cdk/aws-redshift": "1.21.0", + "@aws-cdk/aws-robomaker": "1.21.0", + "@aws-cdk/aws-route53": "1.21.0", + "@aws-cdk/aws-route53-patterns": "1.21.0", + "@aws-cdk/aws-route53-targets": "1.21.0", + "@aws-cdk/aws-route53resolver": "1.21.0", + "@aws-cdk/aws-s3": "1.21.0", + "@aws-cdk/aws-s3-assets": "1.21.0", + "@aws-cdk/aws-s3-deployment": "1.21.0", + "@aws-cdk/aws-s3-notifications": "1.21.0", + "@aws-cdk/aws-sagemaker": "1.21.0", + "@aws-cdk/aws-sam": "1.21.0", + "@aws-cdk/aws-sdb": "1.21.0", + "@aws-cdk/aws-secretsmanager": "1.21.0", + "@aws-cdk/aws-securityhub": "1.21.0", + "@aws-cdk/aws-servicecatalog": "1.21.0", + "@aws-cdk/aws-servicediscovery": "1.21.0", + "@aws-cdk/aws-ses": "1.21.0", + "@aws-cdk/aws-ses-actions": "1.21.0", + "@aws-cdk/aws-sns": "1.21.0", + "@aws-cdk/aws-sns-subscriptions": "1.21.0", + "@aws-cdk/aws-sqs": "1.21.0", + "@aws-cdk/aws-ssm": "1.21.0", + "@aws-cdk/aws-stepfunctions": "1.21.0", + "@aws-cdk/aws-stepfunctions-tasks": "1.21.0", + "@aws-cdk/aws-transfer": "1.21.0", + "@aws-cdk/aws-waf": "1.21.0", + "@aws-cdk/aws-wafregional": "1.21.0", + "@aws-cdk/aws-wafv2": "1.21.0", + "@aws-cdk/aws-workspaces": "1.21.0", + "@aws-cdk/cfnspec": "1.21.0", + "@aws-cdk/core": "1.21.0", + "@aws-cdk/custom-resources": "1.21.0", + "@aws-cdk/cx-api": "1.21.0", + "@aws-cdk/region-info": "1.21.0", "fs-extra": "^8.1.0", "jsii-reflect": "^0.21.1", "jsonschema": "^1.2.5", @@ -166,9 +166,9 @@ }, "devDependencies": { "@types/fs-extra": "^8.0.1", - "@types/jest": "^24.0.25", + "@types/jest": "^24.9.0", "@types/yaml": "1.2.0", - "@types/yargs": "^13.0.4", + "@types/yargs": "^15.0.0", "jest": "^24.9.0", "jsii": "^0.21.1" }, diff --git a/tools/awslint/package.json b/tools/awslint/package.json index ce79e219b2268..cdd23425b3cd1 100644 --- a/tools/awslint/package.json +++ b/tools/awslint/package.json @@ -1,7 +1,7 @@ { "name": "awslint", "private": true, - "version": "1.20.0", + "version": "1.21.0", "description": "Enforces the AWS Construct Library guidelines", "main": "index.js", "scripts": { @@ -25,7 +25,7 @@ }, "devDependencies": { "@types/fs-extra": "^8.0.1", - "@types/yargs": "^13.0.4", + "@types/yargs": "^15.0.0", "tslint": "^5.20.1", "typescript": "~3.7.4" }, diff --git a/tools/cdk-build-tools/lib/package-info.ts b/tools/cdk-build-tools/lib/package-info.ts index 3358d347ac047..fe104006b26fc 100644 --- a/tools/cdk-build-tools/lib/package-info.ts +++ b/tools/cdk-build-tools/lib/package-info.ts @@ -83,7 +83,7 @@ export interface CompilerOverrides { */ export function packageCompiler(compilers: CompilerOverrides): string[] { if (isJsii()) { - return [compilers.jsii || require.resolve('jsii/bin/jsii'), '--project-references']; + return [compilers.jsii || require.resolve('jsii/bin/jsii'), '--project-references', '--silence-warnings=reserved-word']; } else { return [compilers.tsc || require.resolve('typescript/bin/tsc'), '--build']; } diff --git a/tools/cdk-build-tools/package.json b/tools/cdk-build-tools/package.json index d76bc011e03e6..9f1884c73c869 100644 --- a/tools/cdk-build-tools/package.json +++ b/tools/cdk-build-tools/package.json @@ -1,7 +1,7 @@ { "name": "cdk-build-tools", "private": true, - "version": "1.20.0", + "version": "1.21.0", "description": "Tools package with shared build scripts for CDK packages", "main": "lib/index.js", "repository": { @@ -32,26 +32,26 @@ "license": "Apache-2.0", "devDependencies": { "@types/fs-extra": "^8.0.1", - "@types/jest": "^24.0.25", - "@types/yargs": "^13.0.4", - "pkglint": "1.20.0" + "@types/jest": "^24.9.0", + "@types/yargs": "^15.0.0", + "pkglint": "1.21.0" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "^2.14.0", - "@typescript-eslint/parser": "^2.14.0", - "awslint": "1.20.0", + "@typescript-eslint/eslint-plugin": "^2.16.0", + "@typescript-eslint/parser": "^2.16.0", + "awslint": "1.21.0", "colors": "^1.4.0", "eslint": "^6.8.0", - "eslint-import-resolver-node": "^0.3.2", + "eslint-import-resolver-node": "^0.3.3", "eslint-import-resolver-typescript": "^2.0.0", - "eslint-plugin-import": "^2.19.1", + "eslint-plugin-import": "^2.20.0", "fs-extra": "^8.1.0", "jest": "^24.9.0", "jsii": "^0.21.1", "jsii-pacmak": "^0.21.1", "nodeunit": "^0.11.3", "nyc": "^15.0.0", - "ts-jest": "^24.2.0", + "ts-jest": "^24.3.0", "tslint": "^5.20.1", "typescript": "~3.7.4", "yargs": "^15.1.0" diff --git a/tools/cdk-integ-tools/package.json b/tools/cdk-integ-tools/package.json index ac16f249bbde3..ed0191cf01a7d 100644 --- a/tools/cdk-integ-tools/package.json +++ b/tools/cdk-integ-tools/package.json @@ -1,7 +1,7 @@ { "name": "cdk-integ-tools", "private": true, - "version": "1.20.0", + "version": "1.21.0", "description": "Package with integration test scripts for CDK packages", "main": "index.js", "repository": { @@ -30,14 +30,14 @@ "license": "Apache-2.0", "devDependencies": { "@types/fs-extra": "^8.0.1", - "@types/yargs": "^13.0.4", - "cdk-build-tools": "1.20.0", - "pkglint": "1.20.0" + "@types/yargs": "^15.0.0", + "cdk-build-tools": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { - "@aws-cdk/cloudformation-diff": "1.20.0", - "@aws-cdk/cx-api": "1.20.0", - "aws-cdk": "1.20.0", + "@aws-cdk/cloudformation-diff": "1.21.0", + "@aws-cdk/cx-api": "1.21.0", + "aws-cdk": "1.21.0", "fs-extra": "^8.1.0", "yargs": "^15.1.0" }, diff --git a/tools/cfn2ts/package.json b/tools/cfn2ts/package.json index 6d3a2d90d3cae..30a500ba5b558 100644 --- a/tools/cfn2ts/package.json +++ b/tools/cfn2ts/package.json @@ -1,7 +1,7 @@ { "name": "cfn2ts", "private": true, - "version": "1.20.0", + "version": "1.21.0", "description": "Generates typescript types from CloudFormation spec, with support for enrichments", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -29,7 +29,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@aws-cdk/cfnspec": "1.20.0", + "@aws-cdk/cfnspec": "1.21.0", "codemaker": "^0.21.1", "fast-json-patch": "^3.0.0-1", "fs-extra": "^8.1.0", @@ -37,11 +37,11 @@ }, "devDependencies": { "@types/fs-extra": "^8.0.1", - "@types/jest": "^24.0.25", - "@types/yargs": "^13.0.4", - "cdk-build-tools": "1.20.0", + "@types/jest": "^24.9.0", + "@types/yargs": "^15.0.0", + "cdk-build-tools": "1.21.0", "jest": "^24.9.0", - "pkglint": "1.20.0" + "pkglint": "1.21.0" }, "cdk-build": { "eslint": { diff --git a/tools/pkglint/package.json b/tools/pkglint/package.json index 8833c3a50931c..246bd7cc44355 100644 --- a/tools/pkglint/package.json +++ b/tools/pkglint/package.json @@ -1,6 +1,6 @@ { "name": "pkglint", - "version": "1.20.0", + "version": "1.21.0", "private": true, "description": "Validate and fix package.json files", "main": "lib/index.js", @@ -36,7 +36,7 @@ "devDependencies": { "@types/fs-extra": "^8.0.1", "@types/semver": "^6.2.0", - "@types/yargs": "^13.0.4" + "@types/yargs": "^15.0.0" }, "dependencies": { "case": "^1.6.2", diff --git a/tools/pkgtools/package.json b/tools/pkgtools/package.json index 1861c3f7186ec..4e95c39cedc31 100644 --- a/tools/pkgtools/package.json +++ b/tools/pkgtools/package.json @@ -1,7 +1,7 @@ { "name": "pkgtools", "private": true, - "version": "1.20.0", + "version": "1.21.0", "description": "Tools for generating cross-package artifacts", "main": "index.js", "repository": { @@ -30,9 +30,9 @@ "license": "Apache-2.0", "devDependencies": { "@types/fs-extra": "^8.0.1", - "@types/yargs": "^13.0.4", - "cdk-build-tools": "1.20.0", - "pkglint": "1.20.0" + "@types/yargs": "^15.0.0", + "cdk-build-tools": "1.21.0", + "pkglint": "1.21.0" }, "dependencies": { "fs-extra": "^8.1.0", diff --git a/yarn.lock b/yarn.lock index f1c6ac208d213..06404341aec24 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1322,10 +1322,10 @@ "@types/istanbul-lib-coverage" "*" "@types/istanbul-lib-report" "*" -"@types/jest@^24.0.25": - version "24.0.25" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.0.25.tgz#2aba377824ce040114aa906ad2cac2c85351360f" - integrity sha512-hnP1WpjN4KbGEK4dLayul6lgtys6FPz0UfxMeMQCv0M+sTnzN3ConfiO72jHgLxl119guHgI8gLqDOrRLsyp2g== +"@types/jest@^24.9.0": + version "24.9.0" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.9.0.tgz#78c6991cd1734cf0d390be24875e310bb0a9fb74" + integrity sha512-dXvuABY9nM1xgsXlOtLQXJKdacxZJd7AtvLsKZ/0b57ruMXDKCOXAC/M75GbllQX6o1pcZ5hAG4JzYy7Z/wM2w== dependencies: jest-diff "^24.3.0" @@ -1339,10 +1339,10 @@ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= -"@types/jszip@^3.1.6": - version "3.1.6" - resolved "https://registry.yarnpkg.com/@types/jszip/-/jszip-3.1.6.tgz#0512574a2b35f3194b41769c56e4b35065e67000" - integrity sha512-m8uFcI+O2EupCfbEVQWsBM/4nhbegjOHL7cQgBpM95FeF98kdFJXzy9/8yhx4b3lCRl/gMBhcvyh30Qt3X+XPQ== +"@types/jszip@^3.1.7": + version "3.1.7" + resolved "https://registry.yarnpkg.com/@types/jszip/-/jszip-3.1.7.tgz#c45bd72b448b3fb002125282c57c36190247cb34" + integrity sha512-+XQKNI5zpxutK05hO67huUTw/2imXCuJWjnFdU63tRES/xXSX1yVR9cv/QAdO6Rii2y2tTHbzjQ4i2apLfuK0Q== dependencies: "@types/node" "*" @@ -1454,53 +1454,60 @@ resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-13.1.0.tgz#c563aa192f39350a1d18da36c5a8da382bbd8228" integrity sha512-gCubfBUZ6KxzoibJ+SCUc/57Ms1jz5NjHe4+dI2krNmU5zCPAphyLJYyTOg06ueIyfj+SaCUqmzun7ImlxDcKg== -"@types/yargs@^13.0.0", "@types/yargs@^13.0.4": +"@types/yargs@^13.0.0": version "13.0.4" resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-13.0.4.tgz#53d231cebe1a540e7e13727fc1f0d13ad4a9ba3b" integrity sha512-Ke1WmBbIkVM8bpvsNEcGgQM70XcEh/nbpxQhW7FhrsbCsXSY9BmLB1+LHtD7r9zrsOcFlLiF+a/UeJsdfw3C5A== dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^2.14.0": - version "2.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.14.0.tgz#c74447400537d4eb7aae1e31879ab43e6c662a8a" - integrity sha512-sneOJ3Hu0m5whJiVIxGBZZZMxMJ7c0LhAJzeMJgHo+n5wFs+/6rSR/gl7crkdR2kNwfOOSdzdc0gMvatG4dX2Q== +"@types/yargs@^15.0.0": + version "15.0.0" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.0.tgz#26aa57277eec9ab9c5fce61bddec20ecc9a4cfb7" + integrity sha512-TITCsNxRSDVmq3kPGuUdKZTPTfHeswsUGIjxSe8SB4EBKTPA0DO0y4yWI95kZ2hfqJAYxmu+gxzjOwdumB5S0g== + dependencies: + "@types/yargs-parser" "*" + +"@typescript-eslint/eslint-plugin@^2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.16.0.tgz#bf339b7db824c7cc3fd1ebedbc88dd17016471af" + integrity sha512-TKWbeFAKRPrvKiR9GNxErQ8sELKqg1ZvXi6uho07mcKShBnCnqNpDQWP01FEvWKf0bxM2g7uQEI5MNjSNqvUpQ== dependencies: - "@typescript-eslint/experimental-utils" "2.14.0" + "@typescript-eslint/experimental-utils" "2.16.0" eslint-utils "^1.4.3" functional-red-black-tree "^1.0.1" regexpp "^3.0.0" tsutils "^3.17.1" -"@typescript-eslint/experimental-utils@2.14.0": - version "2.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.14.0.tgz#e9179fa3c44e00b3106b85d7b69342901fb43e3b" - integrity sha512-KcyKS7G6IWnIgl3ZpyxyBCxhkBPV+0a5Jjy2g5HxlrbG2ZLQNFeneIBVXdaBCYOVjvGmGGFKom1kgiAY75SDeQ== +"@typescript-eslint/experimental-utils@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.16.0.tgz#bba65685728c532e0ddc811a0376e8d38e671f77" + integrity sha512-bXTmAztXpqxliDKZgvWkl+5dHeRN+jqXVZ16peKKFzSXVzT6mz8kgBpHiVzEKO2NZ8OCU7dG61K9sRS/SkUUFQ== dependencies: "@types/json-schema" "^7.0.3" - "@typescript-eslint/typescript-estree" "2.14.0" + "@typescript-eslint/typescript-estree" "2.16.0" eslint-scope "^5.0.0" -"@typescript-eslint/parser@^2.14.0": - version "2.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.14.0.tgz#30fa0523d86d74172a5e32274558404ba4262cd6" - integrity sha512-haS+8D35fUydIs+zdSf4BxpOartb/DjrZ2IxQ5sR8zyGfd77uT9ZJZYF8+I0WPhzqHmfafUBx8MYpcp8pfaoSA== +"@typescript-eslint/parser@^2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.16.0.tgz#d0c0135a8fdb915f670802ddd7c1ba457c1b4f9d" + integrity sha512-+w8dMaYETM9v6il1yYYkApMSiwgnqXWJbXrA94LAWN603vXHACsZTirJduyeBOJjA9wT6xuXe5zZ1iCUzoxCfw== dependencies: "@types/eslint-visitor-keys" "^1.0.0" - "@typescript-eslint/experimental-utils" "2.14.0" - "@typescript-eslint/typescript-estree" "2.14.0" + "@typescript-eslint/experimental-utils" "2.16.0" + "@typescript-eslint/typescript-estree" "2.16.0" eslint-visitor-keys "^1.1.0" -"@typescript-eslint/typescript-estree@2.14.0": - version "2.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.14.0.tgz#c67698acdc14547f095eeefe908958d93e1a648d" - integrity sha512-pnLpUcMNG7GfFFfNQbEX6f1aPa5fMnH2G9By+A1yovYI4VIOK2DzkaRuUlIkbagpAcrxQHLqovI1YWqEcXyRnA== +"@typescript-eslint/typescript-estree@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.16.0.tgz#b444943a76c716ed32abd08cbe96172d2ca0ab75" + integrity sha512-hyrCYjFHISos68Bk5KjUAXw0pP/455qq9nxqB1KkT67Pxjcfw+r6Yhcmqnp8etFL45UexCHUMrADHH7dI/m2WQ== dependencies: debug "^4.1.1" eslint-visitor-keys "^1.1.0" glob "^7.1.6" is-glob "^4.0.1" - lodash.unescape "4.0.1" + lodash "^4.17.15" semver "^6.3.0" tsutils "^3.17.1" @@ -1569,7 +1576,7 @@ add-stream@^1.0.0: resolved "https://registry.yarnpkg.com/add-stream/-/add-stream-1.0.0.tgz#6a7990437ca736d5e1288db92bd3266d5f5cb2aa" integrity sha1-anmQQ3ynNtXhKI25K9MmbV9csqo= -agent-base@4, agent-base@^4.3.0: +agent-base@4, agent-base@^4.2.0, agent-base@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.3.0.tgz#8165f01c436009bccad0b1d122f05ed770efc6ee" integrity sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg== @@ -1841,6 +1848,11 @@ assign-symbols@^1.0.0: resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= +ast-types@0.x.x: + version "0.13.2" + resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.13.2.tgz#df39b677a911a83f3a049644fb74fdded23cea48" + integrity sha512-uWMHxJxtfj/1oZClOxDEV1sQ1HCDkA4MG8Gr69KKeBjEVH0R84WlejZ0y2DcwyBlpAEMltmVYkVgqfLFb2oyiA== + astral-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" @@ -1882,10 +1894,10 @@ aws-sdk-mock@^5.0.0: sinon "^8.0.1" traverse "^0.6.6" -aws-sdk@^2.596.0, aws-sdk@^2.599.0: - version "2.599.0" - resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.599.0.tgz#45705cbf95a34b6b7f455c3b43c9c7a8c37297e4" - integrity sha512-7yTXnV5SC9W6m+STbziPd1ZNVh9fTtEZ7Mm0rMqEDm/B2fJBa5xd45TwWG8JvS40X5+9jUBykiWdCuVBBx82rg== +aws-sdk@^2.596.0, aws-sdk@^2.601.0: + version "2.601.0" + resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.601.0.tgz#7210e4e1edcffbe76e9b2a7181617966c9cfc731" + integrity sha512-i8ND3Hn0zjuwyau47io8Uyvbeb6dnOYbC6k34u3DvqH3I/kFDgDAme6L58LUzSHAPDWhUDjNXpScmMsGZVDWrw== dependencies: buffer "4.9.1" events "1.1.1" @@ -2109,6 +2121,11 @@ byte-size@^5.0.1: resolved "https://registry.yarnpkg.com/byte-size/-/byte-size-5.0.1.tgz#4b651039a5ecd96767e71a3d7ed380e48bed4191" integrity sha512-/XuKeqWocKsYa/cBY1YbSJSWWqTi4cFgr9S6OyM7PBaPbr9zvNGwWP33vt0uqGhwDdN+y3yhbXVILEUpnwEWGw== +bytes@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" + integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== + cacache@^12.0.0, cacache@^12.0.3: version "12.0.3" resolved "https://registry.yarnpkg.com/cacache/-/cacache-12.0.3.tgz#be99abba4e1bf5df461cd5a2c1071fc432573390" @@ -2878,6 +2895,11 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" +data-uri-to-buffer@1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-1.2.0.tgz#77163ea9c20d8641b4707e8f18abdf9a78f34835" + integrity sha512-vKQ9DTQPN1FLYiiEEOQ6IBGFqvjCa5rSK3cWMy/Nespm5d/x3dGFT9UBZnkLxCwua/IXBi2TYnwTEpsOvhC4UQ== + data-urls@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe" @@ -2902,6 +2924,13 @@ dateformat@^3.0.0: resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== +debug@2, debug@^2.1.3, debug@^2.2.0, debug@^2.3.3, debug@^2.6.9: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + debug@3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" @@ -2909,12 +2938,12 @@ debug@3.1.0: dependencies: ms "2.0.0" -debug@^2.1.3, debug@^2.2.0, debug@^2.3.3, debug@^2.6.9: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== +debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== dependencies: - ms "2.0.0" + ms "^2.1.1" debug@^3.1.0, debug@^3.2.6: version "3.2.6" @@ -2923,13 +2952,6 @@ debug@^3.1.0, debug@^3.2.6: dependencies: ms "^2.1.1" -debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" - integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== - dependencies: - ms "^2.1.1" - debuglog@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" @@ -3043,6 +3065,15 @@ define-property@^2.0.2: is-descriptor "^1.0.2" isobject "^3.0.1" +degenerator@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/degenerator/-/degenerator-1.0.4.tgz#fcf490a37ece266464d9cc431ab98c5819ced095" + integrity sha1-/PSQo37OJmRk2cxDGrmMWBnO0JU= + dependencies: + ast-types "0.x.x" + escodegen "1.x.x" + esprima "3.x.x" + delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -3053,6 +3084,11 @@ delegates@^1.0.0: resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= +depd@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" + integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= + deprecation@^2.0.0: version "2.3.1" resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919" @@ -3096,10 +3132,10 @@ diff@^1.3.2: resolved "https://registry.yarnpkg.com/diff/-/diff-1.4.0.tgz#7f28d2eb9ee7b15a97efd89ce63dcfdaa3ccbabf" integrity sha1-fyjS657nsVqX79ic5j3P2qPMur8= -diff@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.1.tgz#0c667cb467ebbb5cea7f14f135cc2dba7780a8ff" - integrity sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q== +diff@^4.0.1, diff@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== difflib@~0.2.1: version "0.2.4" @@ -3346,6 +3382,18 @@ escape-string-regexp@^2.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== +escodegen@1.x.x: + version "1.12.1" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.12.1.tgz#08770602a74ac34c7a90ca9229e7d51e379abc76" + integrity sha512-Q8t2YZ+0e0pc7NRVj3B4tSQ9rim1oi4Fh46k2xhJ2qOiEwhQfdjyEQddWdj7ZFaKmU+5104vn1qrcjEPWq+bgQ== + dependencies: + esprima "^3.1.3" + estraverse "^4.2.0" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.6.1" + escodegen@^1.9.1: version "1.12.0" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.12.0.tgz#f763daf840af172bb3a2b6dd7219c0e17f7ff541" @@ -3358,13 +3406,13 @@ escodegen@^1.9.1: optionalDependencies: source-map "~0.6.1" -eslint-import-resolver-node@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a" - integrity sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q== +eslint-import-resolver-node@^0.3.2, eslint-import-resolver-node@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.3.tgz#dbaa52b6b2816b50bc6711af75422de808e98404" + integrity sha512-b8crLDo0M5RSe5YG8Pu2DYBj71tSB6OvXkfzwbJU2w7y8P4/yo0MyF8jU26IEuEuHF2K5/gcAJE3LhQGqBBbVg== dependencies: debug "^2.6.9" - resolve "^1.5.0" + resolve "^1.13.1" eslint-import-resolver-typescript@^2.0.0: version "2.0.0" @@ -3385,10 +3433,10 @@ eslint-module-utils@^2.4.1: debug "^2.6.9" pkg-dir "^2.0.0" -eslint-plugin-import@^2.19.1: - version "2.19.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.19.1.tgz#5654e10b7839d064dd0d46cd1b88ec2133a11448" - integrity sha512-x68131aKoCZlCae7rDXKSAQmbT5DQuManyXo2sK6fJJ0aK5CWAkv6A6HJZGgqC8IhjQxYPgo6/IY4Oz8AFsbBw== +eslint-plugin-import@^2.20.0: + version "2.20.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.20.0.tgz#d749a7263fb6c29980def8e960d380a6aa6aecaa" + integrity sha512-NK42oA0mUc8Ngn4kONOPsPB1XhbUvNHqF+g307dPV28aknPoiNnKLFd9em4nkswwepdF5ouieqv5Th/63U7YJQ== dependencies: array-includes "^3.0.3" array.prototype.flat "^1.2.1" @@ -3480,7 +3528,7 @@ espree@^6.1.2: acorn-jsx "^5.1.0" eslint-visitor-keys "^1.1.0" -esprima@^3.1.3: +esprima@3.x.x, esprima@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" integrity sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM= @@ -3715,6 +3763,11 @@ file-entry-cache@^5.0.1: dependencies: flat-cache "^2.0.1" +file-uri-to-path@1: + version "1.0.0" + resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" + integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== + fill-keys@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/fill-keys/-/fill-keys-1.0.2.tgz#9a8fa36f4e8ad634e3bf6b4f3c8882551452eb20" @@ -3916,6 +3969,14 @@ fsevents@^1.2.7: nan "^2.12.1" node-pre-gyp "^0.12.0" +ftp@~0.3.10: + version "0.3.10" + resolved "https://registry.yarnpkg.com/ftp/-/ftp-0.3.10.tgz#9197d861ad8142f3e63d5a83bfe4c59f7330885d" + integrity sha1-kZfYYa2BQvPmPVqDv+TFn3MwiF0= + dependencies: + readable-stream "1.1.x" + xregexp "2.0.0" + function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" @@ -3983,6 +4044,18 @@ get-stream@^4.0.0, get-stream@^4.1.0: dependencies: pump "^3.0.0" +get-uri@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/get-uri/-/get-uri-2.0.4.tgz#d4937ab819e218d4cb5ae18e4f5962bef169cc6a" + integrity sha512-v7LT/s8kVjs+Tx0ykk1I+H/rbpzkHvuIq87LmeXptcf5sNWm9uQiwjNAt94SJPA1zOlCntmnOlJvVWKmzsxG8Q== + dependencies: + data-uri-to-buffer "1" + debug "2" + extend "~3.0.2" + file-uri-to-path "1" + ftp "~0.3.10" + readable-stream "2" + get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" @@ -4281,6 +4354,17 @@ http-cache-semantics@^3.8.1: resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz#39b0e16add9b605bf0a9ef3d9daaf4843b4cacd2" integrity sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w== +http-errors@1.7.3: + version "1.7.3" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" + integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== + dependencies: + depd "~1.1.2" + inherits "2.0.4" + setprototypeof "1.1.1" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" + http-proxy-agent@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz#e4821beef5b2142a2026bd73926fe537631c5405" @@ -4306,6 +4390,14 @@ https-proxy-agent@^2.2.3: agent-base "^4.3.0" debug "^3.1.0" +https-proxy-agent@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-3.0.1.tgz#b8c286433e87602311b01c8ea34413d856a4af81" + integrity sha512-+ML2Rbh6DAuee7d07tYGEKOEi2voWPUGan+ExdPbPW6Z3svq+JCqr0v8WmKPOkz1vOVykPCBSuobe7G8GJUtVg== + dependencies: + agent-base "^4.3.0" + debug "^3.1.0" + humanize-ms@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" @@ -4406,7 +4498,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3: +inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -4475,7 +4567,7 @@ invariant@^2.2.4: dependencies: loose-envify "^1.0.0" -ip@1.1.5: +ip@1.1.5, ip@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" integrity sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo= @@ -5737,11 +5829,6 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "^3.0.0" -lodash.unescape@4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/lodash.unescape/-/lodash.unescape-4.0.1.tgz#bf2249886ce514cda112fae9218cdc065211fc9c" - integrity sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw= - lodash.union@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.union/-/lodash.union-4.6.0.tgz#48bb5088409f16f1821666641c44dd1aaae3cd88" @@ -6222,6 +6309,11 @@ nested-error-stacks@^2.0.0: resolved "https://registry.yarnpkg.com/nested-error-stacks/-/nested-error-stacks-2.1.0.tgz#0fbdcf3e13fe4994781280524f8b96b0cdff9c61" integrity sha512-AO81vsIO1k1sM4Zrd6Hu7regmJN1NSiAja10gc4bX3F0wd+9rQmcuHQaHVQCYIEC8iFXnE+mavh23GOt7wBgug== +netmask@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/netmask/-/netmask-1.0.6.tgz#20297e89d86f6f6400f250d9f4f6b4c1945fcd35" + integrity sha1-ICl+idhvb2QA8lDZ9Pa0wZRfzTU= + nice-try@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" @@ -6239,10 +6331,10 @@ nise@^3.0.1: lolex "^5.0.1" path-to-regexp "^1.7.0" -nock@^11.7.1: - version "11.7.1" - resolved "https://registry.yarnpkg.com/nock/-/nock-11.7.1.tgz#761971f24093e291af6e1f0af5b6eb048b94b1c1" - integrity sha512-fW+dlMyquAEvgtmGoRHftKrNnJ7yZcbINQDTW7OKRoTYa+11GA0u0UokWHuvCyZrG5TXkplnEv2jmj6R3vvImg== +nock@^11.7.2: + version "11.7.2" + resolved "https://registry.yarnpkg.com/nock/-/nock-11.7.2.tgz#4cee4fa838dc3635c074c5b3436bcdec7f7ee213" + integrity sha512-7swr5bL1xBZ5FctyubjxEVySXOSebyqcL7Vy1bx1nS9IUqQWj81cmKjVKJLr8fHhtzI1MV8nyCdENA/cGcY1+Q== dependencies: debug "^4.1.0" json-stringify-safe "^5.0.1" @@ -6783,6 +6875,31 @@ p-waterfall@^1.0.0: dependencies: p-reduce "^1.0.0" +pac-proxy-agent@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/pac-proxy-agent/-/pac-proxy-agent-3.0.1.tgz#115b1e58f92576cac2eba718593ca7b0e37de2ad" + integrity sha512-44DUg21G/liUZ48dJpUSjZnFfZro/0K5JTyFYLBcmh9+T6Ooi4/i4efwUiEy0+4oQusCBqWdhv16XohIj1GqnQ== + dependencies: + agent-base "^4.2.0" + debug "^4.1.1" + get-uri "^2.0.0" + http-proxy-agent "^2.1.0" + https-proxy-agent "^3.0.0" + pac-resolver "^3.0.0" + raw-body "^2.2.0" + socks-proxy-agent "^4.0.1" + +pac-resolver@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pac-resolver/-/pac-resolver-3.0.0.tgz#6aea30787db0a891704deb7800a722a7615a6f26" + integrity sha512-tcc38bsjuE3XZ5+4vP96OfhOugrX+JcnpUbhfuc4LuXBLQhoTthOstZeoQJBDnQUDYzYmdImKsbz0xSl1/9qeA== + dependencies: + co "^4.6.0" + degenerator "^1.0.4" + ip "^1.1.5" + netmask "^1.0.6" + thunkify "^2.1.2" + package-hash@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/package-hash/-/package-hash-3.0.0.tgz#50183f2d36c9e3e528ea0a8605dff57ce976f88e" @@ -7104,6 +7221,25 @@ protoduck@^5.0.1: dependencies: genfun "^5.0.0" +proxy-agent@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/proxy-agent/-/proxy-agent-3.1.1.tgz#7e04e06bf36afa624a1540be247b47c970bd3014" + integrity sha512-WudaR0eTsDx33O3EJE16PjBRZWcX8GqCEeERw1W3hZJgH/F2a46g7jty6UGty6NeJ4CKQy8ds2CJPMiyeqaTvw== + dependencies: + agent-base "^4.2.0" + debug "4" + http-proxy-agent "^2.1.0" + https-proxy-agent "^3.0.0" + lru-cache "^5.1.1" + pac-proxy-agent "^3.0.1" + proxy-from-env "^1.0.0" + socks-proxy-agent "^4.0.1" + +proxy-from-env@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.0.0.tgz#33c50398f70ea7eb96d21f7b817630a55791c7ee" + integrity sha1-M8UDmPcOp+uW0h97gXYwpVeRx+4= + proxyquire@^2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/proxyquire/-/proxyquire-2.1.3.tgz#2049a7eefa10a9a953346a18e54aab2b4268df39" @@ -7188,6 +7324,16 @@ quick-lru@^1.0.0: resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8" integrity sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g= +raw-body@^2.2.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.1.tgz#30ac82f98bb5ae8c152e67149dac8d55153b168c" + integrity sha512-9WmIKF6mkvA0SLmA2Knm9+qj89e+j1zqgyn8aXGd7+nAduPoqgI9lO57SAZNn/Byzo5P7JhXTyg9PzaJbH73bA== + dependencies: + bytes "3.1.0" + http-errors "1.7.3" + iconv-lite "0.4.24" + unpipe "1.0.0" + rc@^1.2.7: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" @@ -7310,6 +7456,29 @@ read@1, read@^1.0.4, read@~1.0.1: string_decoder "~1.1.1" util-deprecate "~1.0.1" +readable-stream@1.1.x: + version "1.1.14" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" + integrity sha1-fPTFTvZI44EwhMY23SB54WbAgdk= + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +readable-stream@2: + version "2.3.7" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" + integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + "readable-stream@2 || 3", readable-stream@^3.0.1, readable-stream@^3.0.2, readable-stream@^3.1.1, readable-stream@^3.4.0: version "3.4.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.4.0.tgz#a51c26754658e0a3c21dbf59163bd45ba6f447fc" @@ -7495,17 +7664,10 @@ resolve@1.1.7: resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= -resolve@1.x, resolve@^1.10.0, resolve@^1.11.1, resolve@^1.3.2: - version "1.12.2" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.12.2.tgz#08b12496d9aa8659c75f534a8f05f0d892fff594" - integrity sha512-cAVTI2VLHWYsGOirfeYVVQ7ZDejtQ9fp4YhYckWDEkFfqbVjaT11iM8k6xSAfGFMM+gDpZjMnFssPu8we+mqFw== - dependencies: - path-parse "^1.0.6" - -resolve@^1.12.0, resolve@^1.5.0: - version "1.13.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.13.1.tgz#be0aa4c06acd53083505abb35f4d66932ab35d16" - integrity sha512-CxqObCX8K8YtAhOBRg+lrcdn+LK+WYOS8tSjqSFbjtrI5PnS63QPhZl4+yKfrU9tdsbMu9Anr/amegT87M9Z6w== +resolve@1.x, resolve@^1.10.0, resolve@^1.11.1, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.3.2: + version "1.14.2" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.14.2.tgz#dbf31d0fa98b1f29aa5169783b9c290cb865fea2" + integrity sha512-EjlOBLBO1kxsUxsKjLt7TAECyKW6fOh1VRkykQkKGzcBbjjPIxBqGh0jf7GJ3k/f5mxMqW3htMD3WdTUVtW8HQ== dependencies: path-parse "^1.0.6" @@ -7681,6 +7843,11 @@ set-value@^2.0.0, set-value@^2.0.1: is-plain-object "^2.0.3" split-string "^3.0.1" +setprototypeof@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" + integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== + shallow-clone@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" @@ -7730,10 +7897,10 @@ signal-exit@^3.0.0, signal-exit@^3.0.2: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= -sinon@^8.0.1, sinon@^8.0.2: - version "8.0.2" - resolved "https://registry.yarnpkg.com/sinon/-/sinon-8.0.2.tgz#cc5f6daa9cc351b86b03faaca1e9c3650a04ae11" - integrity sha512-8W1S7BnCyvk7SK+Xi15B1QAVLuS81G/NGmWefPb31+ly6xI3fXaug/g5oUdfc8+7ruC4Ay51AxuLlYm8diq6kA== +sinon@^8.0.1, sinon@^8.0.4: + version "8.0.4" + resolved "https://registry.yarnpkg.com/sinon/-/sinon-8.0.4.tgz#eb13242fa50bf876c54e88bdc96f281a0dd08a53" + integrity sha512-cFsmgmvsgFb87e7SV7IcekogITlHX2KmlplyI9Pda0FH1Z8Ms/kWbpLs25Idp0m6ZJ3HEEjhaYYXbcTtWWUn4w== dependencies: "@sinonjs/commons" "^1.7.0" "@sinonjs/formatio" "^4.0.1" @@ -7807,7 +7974,7 @@ snapdragon@^0.8.1: source-map-resolve "^0.5.0" use "^3.1.0" -socks-proxy-agent@^4.0.0: +socks-proxy-agent@^4.0.0, socks-proxy-agent@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-4.0.2.tgz#3c8991f3145b2799e70e11bd5fbc8b1963116386" integrity sha512-NT6syHhI9LmuEMSK6Kd2V7gNv5KFZoLE7V5udWmn0de+3Mkj3UMA/AJPLyeNUVmElCurSHtUdM3ETpR3z770Wg== @@ -7989,6 +8156,11 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" +"statuses@>= 1.5.0 < 2": + version "1.5.0" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" + integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= + stealthy-require@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" @@ -8103,6 +8275,11 @@ string_decoder@^1.1.1: dependencies: safe-buffer "~5.2.0" +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= + string_decoder@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" @@ -8431,6 +8608,11 @@ through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6: resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= +thunkify@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/thunkify/-/thunkify-2.1.2.tgz#faa0e9d230c51acc95ca13a361ac05ca7e04553d" + integrity sha1-+qDp0jDFGsyVyhOjYawFyn4EVT0= + tiny-glob@^0.2.6: version "0.2.6" resolved "https://registry.yarnpkg.com/tiny-glob/-/tiny-glob-0.2.6.tgz#9e056e169d9788fe8a734dfa1ff02e9b92ed7eda" @@ -8486,6 +8668,11 @@ to-regex@^3.0.1, to-regex@^3.0.2: regex-not "^1.0.2" safe-regex "^1.1.0" +toidentifier@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" + integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== + tough-cookie@^2.3.3, tough-cookie@^2.3.4: version "2.5.0" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" @@ -8534,10 +8721,10 @@ trivial-deferred@^1.0.1: resolved "https://registry.yarnpkg.com/trivial-deferred/-/trivial-deferred-1.0.1.tgz#376d4d29d951d6368a6f7a0ae85c2f4d5e0658f3" integrity sha1-N21NKdlR1jaKb3oK6FwvTV4GWPM= -ts-jest@^24.2.0: - version "24.2.0" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-24.2.0.tgz#7abca28c2b4b0a1fdd715cd667d65d047ea4e768" - integrity sha512-Yc+HLyldlIC9iIK8xEN7tV960Or56N49MDP7hubCZUeI7EbIOTsas6rXCMB4kQjLACJ7eDOF4xWEO5qumpKsag== +ts-jest@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-24.3.0.tgz#b97814e3eab359ea840a1ac112deae68aa440869" + integrity sha512-Hb94C/+QRIgjVZlJyiWwouYUF+siNJHJHknyspaOcZ+OQAIdFG/UrdQVXw/0B8Z3No34xkUXZJpOTy9alOWdVQ== dependencies: bs-logger "0.x" buffer-from "1.x" @@ -8732,6 +8919,11 @@ universalify@^0.1.0: resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== +unpipe@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= + unset-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" @@ -9074,6 +9266,11 @@ xmlbuilder@~9.0.1: resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" integrity sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0= +xregexp@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-2.0.0.tgz#52a63e56ca0b84a7f3a5f3d61872f126ad7a5943" + integrity sha1-UqY+VsoLhKfzpfPWGHLxJq16WUM= + xregexp@^4.2.4: version "4.2.4" resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-4.2.4.tgz#02a4aea056d65a42632c02f0233eab8e4d7e57ed"