diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 87fdccb0cbb7a..3116ffd4a844d 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,7 +1,7 @@ --- name: "\U00002753 General Issue" about: Create a new issue -labels: status/needs-triage +labels: needs-triage --- diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md index 273b24583ca51..c8c28a35eff3e 100644 --- a/.github/ISSUE_TEMPLATE/bug.md +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -1,7 +1,7 @@ --- name: "\U0001F41B Bug Report" about: Report a bug -labels: bug, status/needs-triage +labels: bug, needs-triage --- diff --git a/.github/ISSUE_TEMPLATE/general-issues.md b/.github/ISSUE_TEMPLATE/general-issues.md index 18ff0ed728595..eb34c66987c42 100644 --- a/.github/ISSUE_TEMPLATE/general-issues.md +++ b/.github/ISSUE_TEMPLATE/general-issues.md @@ -1,7 +1,7 @@ --- name: "\U00002753 General Issue" about: Create a new issue -labels: status/needs-triage +labels: needs-triage --- diff --git a/.github/ISSUE_TEMPLATE/tracking.md b/.github/ISSUE_TEMPLATE/tracking.md new file mode 100644 index 0000000000000..0b7af0fdc1547 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/tracking.md @@ -0,0 +1,61 @@ +--- +name: "📊 Tracking Issue" +title: "📊Tracking: [service]" +about: Add a module tracking issue (internal use only) +labels: management/tracking +--- + +Add your +1 👍 to help us prioritize high-level constructs for this service +--- + +### Overview: + + + + + + + +[AWS Docs](url) +[CDK API Reference](url) + + +### Implementation: + + + + + + + +### Issue list: + + + + + + + + +--- +This is a 📊Tracking Issue diff --git a/.github/actions/prlinter/package.json b/.github/actions/prlinter/package.json index 07c63e8c580e9..2927c04d2fdcd 100644 --- a/.github/actions/prlinter/package.json +++ b/.github/actions/prlinter/package.json @@ -1,11 +1,11 @@ { "name": "prlinter", "private": true, - "version": "0.0.1", + "version": "0.0.0", "description": "", "main": "index.js", "keywords": [], - "license": "Apache-2.0", + "license": "Apache-2.0", "author": { "name": "Amazon Web Services", "url": "https://aws.amazon.com", @@ -16,4 +16,4 @@ "@actions/github": "^2.1.0", "prlint": "file:../../../tools/prlint" } -} +} \ No newline at end of file diff --git a/.mergify.yml b/.mergify.yml index c3c903c5d5f65..cee2d79f48cd5 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -11,7 +11,7 @@ pull_request_rules: - name: automatic merge actions: comment: - message: Thank you for contributing! Your pull request is now being automatically merged. + message: Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to [allow changes to be pushed to your fork](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork)). merge: strict: smart method: squash @@ -34,7 +34,7 @@ pull_request_rules: - name: automatic merge actions: comment: - message: Thank you for contributing! Your pull request is now being automatically merged without squashing. + message: Thank you for contributing! Your pull request will be updated from master and then merged automatically without squashing (do not update manually, and be sure to [allow changes to be pushed to your fork](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork)). merge: strict: smart # Merge instead of squash @@ -42,7 +42,6 @@ pull_request_rules: strict_method: merge delete_head_branch: {} conditions: - - base!=release - -title~=(WIP|wip) - -label~=(blocked|do-not-merge) # Only if no-squash is set diff --git a/.versionrc.json b/.versionrc.json new file mode 100644 index 0000000000000..3178955551057 --- /dev/null +++ b/.versionrc.json @@ -0,0 +1,5 @@ +{ + "skip": { "tag": true }, + "packageFiles": [ { "filename": "lerna.json", "type": "json" } ], + "bumpFiles": [ { "filename": "lerna.json", "type": "json" } ] +} diff --git a/CHANGELOG.md b/CHANGELOG.md index a817d29fd36b9..3006e3bb7f32d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,40 @@ 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.26.0](https://github.com/aws/aws-cdk/compare/v1.25.0...v1.26.0) (2020-02-25) + + +### ⚠ BREAKING CHANGES + +* **apigateway:** the interface now accepts endpointconfiguration property instead of endpoint type as defined by cfn +* **lambda-nodejs:** `parcel-bundler` v1.x is now a peer dependency of `@aws-cdk/aws-lambda-nodejs`. Please add it to your `package.json`. + +### Features + +* **apigateway:** expose endpointconfiguration to include vpcEndpointIds ([#6078](https://github.com/aws/aws-cdk/issues/6078)) ([99de6ca](https://github.com/aws/aws-cdk/commit/99de6ca6940f8e7e66e44d1cc68f0e1f1cb80b94)), closes [#6038](https://github.com/aws/aws-cdk/issues/6038) +* **apigateway:** lambda request authorizer ([#5642](https://github.com/aws/aws-cdk/issues/5642)) ([031932d](https://github.com/aws/aws-cdk/commit/031932d79511c3750f3f4177d74ead4609cab541)) +* **appsync:** mapping template for lambda proxy ([#6288](https://github.com/aws/aws-cdk/pull/6288)) ([f865d5e](https://github.com/aws/aws-cdk/commit/f865d5ec25df9b3232a66d8e3e9aa32e23cb8aa5)) +* **batch:** add JobQueue, ComputeEnvironment and JobDefinition constructs ([c8a22b1](https://github.com/aws/aws-cdk/commit/c8a22b176cdee7da2cde15c38a6fc107686cf2d0)) +* **cdk-assets:** asset uploading tool ([c505348](https://github.com/aws/aws-cdk/commit/c5053480b057b307c4ebf33d2792839f07a09bb6)) +* **cli:** faster "no-op" deployments ([#6346](https://github.com/aws/aws-cdk/issues/6346)) ([d4a132b](https://github.com/aws/aws-cdk/commit/d4a132bff91ab8e78ed38dc5ee41842554347ecf)), closes [#6046](https://github.com/aws/aws-cdk/issues/6046) [#2553](https://github.com/aws/aws-cdk/issues/2553) [#6216](https://github.com/aws/aws-cdk/issues/6216) +* **cfn:** CloudFormation Resource Specification 11.1.0 ([#6424](https://github.com/aws/aws-cdk/issues/6424)) ([ab9b77c](https://github.com/aws/aws-cdk/commit/ab9b77cc9857b5ea34952d4efb3f67c1d8a51311)) +* **cognito:** user pool verification and invitation messages ([#6282](https://github.com/aws/aws-cdk/issues/6282)) ([faf6693](https://github.com/aws/aws-cdk/commit/faf6693e2590fbe7332be8737afd35874f6719f1)) +* **ecs-patterns:** create dlq when queue is not provided for QueueProcessingService ([#6356](https://github.com/aws/aws-cdk/issues/6356)) ([e307d7f](https://github.com/aws/aws-cdk/commit/e307d7fa721a54ee54d8ad8e4b3f13e6c45c342a)) +* **kms:** `trustAccountIdentities` avoids cyclic stack dependencies ([03f4ef2](https://github.com/aws/aws-cdk/commit/03f4ef27408822d288c75790c8d1270e007a0842)) +* **rds:** attach description to database secret ([d5a4854](https://github.com/aws/aws-cdk/commit/d5a48545f83efe7ca39cab75579b2cd91f55800b)) +* **sns:** support multiple tokens as url and email subscriptions ([#6357](https://github.com/aws/aws-cdk/issues/6357)) ([e5493bd](https://github.com/aws/aws-cdk/commit/e5493bd2cea897a2d4e1576d3084e9fb2e9f6b7f)), closes [#3996](https://github.com/aws/aws-cdk/issues/3996) +* **ssm:** add ability to specify SSM Parameter tier ([#6326](https://github.com/aws/aws-cdk/issues/6326)) ([9209ef6](https://github.com/aws/aws-cdk/commit/9209ef6e4879c64a9b374a14e2fb7b09b5c51052)) + + +### Bug Fixes + +* **aws-ecs:** propagate dnsTtl property part of cloudMapOptions ([#6370](https://github.com/aws/aws-cdk/issues/6370)) ([747bdb2](https://github.com/aws/aws-cdk/commit/747bdb240296c69430dbd8970f809aa1540da11d)), closes [#6223](https://github.com/aws/aws-cdk/issues/6223) +* **cli:** `cdk deploy` hangs when stack deployment fails ([#6433](https://github.com/aws/aws-cdk/issues/6433)) ([4b11d99](https://github.com/aws/aws-cdk/commit/4b11d998a09b2ecdff720dea0cd3ace718cb5b1d)) +* **cli:** Python init templates are missing .gitignore file ([#6350](https://github.com/aws/aws-cdk/issues/6350)) ([cd6cd42](https://github.com/aws/aws-cdk/commit/cd6cd42e4d0debbd9161bcf4d4bf22ef1a92f128)), closes [#5566](https://github.com/aws/aws-cdk/issues/5566) +* **core:** top-level resources cannot use long logical ids ([#6419](https://github.com/aws/aws-cdk/issues/6419)) ([2a418b9](https://github.com/aws/aws-cdk/commit/2a418b9490f65ddcc34d96afb64c0d49041ae049)), closes [#6190](https://github.com/aws/aws-cdk/issues/6190) [#6190](https://github.com/aws/aws-cdk/issues/6190) +* **ecs:** support file as firelens config type ([#6322](https://github.com/aws/aws-cdk/issues/6322)) ([f9996f3](https://github.com/aws/aws-cdk/commit/f9996f3e72460068f53d2cb551f00fb32386e9c9)) +* **lambda:** erroneous inline code support for ruby ([#6365](https://github.com/aws/aws-cdk/issues/6365)) ([8e21e78](https://github.com/aws/aws-cdk/commit/8e21e783d50bf75550298d7c111ad3ddb97f5343)), closes [#6302](https://github.com/aws/aws-cdk/issues/6302) +* **lambda-nodejs:** parcel is too big to bundle ([a93e4d5](https://github.com/aws/aws-cdk/commit/a93e4d5418af1409f1b3278bffb8ace360d28a19)), closes [#6340](https://github.com/aws/aws-cdk/issues/6340) ## [1.25.0](https://github.com/aws/aws-cdk/compare/v1.24.0...v1.25.0) (2020-02-18) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 01355b0f529fe..20c5277e90b23 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -38,6 +38,7 @@ and let us know if it's not up-to-date (even better, submit a PR with your corr - [API Compatibility Checks](#api-compatibility-checks) - [Examples](#examples) - [Feature Flags](#feature-flags) + - [Versioning](#versioning) - [Troubleshooting](#troubleshooting) - [Debugging](#debugging) - [Connecting the VS Code Debugger](#connecting-the-vs-code-debugger) @@ -381,6 +382,12 @@ If you also wish to package to all languages, make sure you have all the [toolch $ ./pack.sh ``` +> NOTE: in local builds, pack.sh will finish but will fail with an error +> indicating the build artifacts use the marker version (`0.0.0`). This is +> normal, and you can trust the output in `dist/` despite the failure. This is a +> protection we have to make sure we don't accidentally release artifacts with +> the marker version. + ### Full Docker build Clone the repo: @@ -659,6 +666,25 @@ CDK](https://github.com/aws/aws-cdk/issues/3398) we will either remove the legacy behavior or flip the logic for all these features and then reset the `FEATURE_FLAGS` map for the next cycle. +### Versioning + +All `package.json` files in this repo use a stable marker version of `0.0.0`. +This means that when you declare dependencies, you should always use `0.0.0`. +This makes it easier for us to bump a new version (the `bump.sh` script will +just update the central version and create a CHANGELOG entry) and also reduces +the chance of merge conflicts after a new version is released. + +Additional scripts that take part in the versioning mechanism: + +- `scripts/get-version.js` can be used to obtain the actual version of the repo. + You can use either from JavaScript code by `require('./scripts/get-version')` + or from a shell script `node -p "require('./scripts/get-version')"`. +- `scripts/get-version-marker.js` returns `0.0.0` and used to DRY the version + marker. +- `scripts/align-version.sh` and `scripts/align-version.js` are used to align + all package.json files in the repo to the official version. This script is + invoked in CI builds and should not be used inside a development environment. + ## Troubleshooting Most build issues can be solved by doing a full clean rebuild: diff --git a/buildspec.yaml b/buildspec.yaml index c38d30f692b6d..9d8f575942945 100644 --- a/buildspec.yaml +++ b/buildspec.yaml @@ -13,6 +13,7 @@ phases: - /bin/bash ./fetch-dotnet-snk.sh build: commands: + - /bin/bash ./scripts/align-version.sh - /bin/bash ./build.sh post_build: commands: diff --git a/bump.sh b/bump.sh index 1a2d6a7fdf72e..4e27012be15c7 100755 --- a/bump.sh +++ b/bump.sh @@ -17,18 +17,7 @@ version=${1:-minor} echo "Starting ${version} version bump" -export NODE_OPTIONS="--max-old-space-size=4096 ${NODE_OPTIONS:-}" +# /bin/bash ./install.sh -/bin/bash ./install.sh - -npx lerna version ${version} --yes --exact --force-publish=* --no-git-tag-version --no-push - -# Another round of install to fix package-lock.jsons -/bin/bash ./install.sh - -# align "peerDependencies" to actual dependencies after bump -# this is technically only required for major version bumps, but in the meantime we shall do it in every bump -/bin/bash scripts/fix-peer-deps.sh - -# Generate CHANGELOG and create a commit -npx standard-version --release --skip.tag=true --commit-all +# Generate CHANGELOG and create a commit (see .versionrc.json) +npx standard-version --release-as ${version} diff --git a/lerna.json b/lerna.json index c0a6a58196933..1797667ed0e64 100644 --- a/lerna.json +++ b/lerna.json @@ -5,9 +5,10 @@ "packages": [ "packages/*", "packages/@aws-cdk/*", + "packages/@monocdk-experiment/*", "packages/@aws-cdk/*/lambda-packages/*", "tools/*" ], "rejectCycles": "true", - "version": "1.25.0" + "version": "1.26.0" } diff --git a/pack.sh b/pack.sh index e139d0a048eba..02b901f141273 100755 --- a/pack.sh +++ b/pack.sh @@ -57,8 +57,14 @@ done # Remove a JSII aggregate POM that may have snuk past rm -rf dist/java/software/amazon/jsii -# Get version from lerna -version="$(cat ${root}/lerna.json | grep version | cut -d '"' -f4)" +# Get version +version="$(node -p "require('./scripts/get-version')")" + +# Ensure we don't publish anything beyond 1.x for now +if [[ ! "${version}" == "1."* ]]; then + echo "ERROR: accidentally releasing a major version? Expecting repo version to start with '1.' but got '${version}'" + exit 1 +fi # Get commit from CodePipeline (or git, if we are in CodeBuild) # If CODEBUILD_RESOLVED_SOURCE_VERSION is not defined (i.e. local @@ -79,6 +85,16 @@ HERE # copy CHANGELOG.md to dist/ for github releases cp CHANGELOG.md ${distdir}/ +# defensive: make sure our artifacts don't use the version marker (this means +# that "pack" will always fails when building in a dev environment) +# when we get to 10.0.0, we can fix this... +marker=$(node -p "require('./scripts/get-version-marker')") +if find dist/ | grep "${marker}"; then + echo "ERROR: build artifacts use the version marker '${marker}' instead of a real version." + echo "This is expected for builds in a development environment but should not happen in CI builds!" + exit 1 +fi + # for posterity, print all files in dist echo "==============================================================================================" echo " dist contents" diff --git a/package.json b/package.json index 859882b3adf6b..7a6e3617842e8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aws-cdk", - "version": "1.25.0", + "version": "0.0.0", "private": true, "pkglint": { "include": "dependencies/node-version" @@ -10,6 +10,7 @@ "build": "./build.sh", "pack": "./pack.sh", "compat": "./scripts/check-api-compatibility.sh", + "bump": "./bump.sh", "build-all": "tsc -b" }, "devDependencies": { @@ -19,19 +20,13 @@ "jsii-pacmak": "^0.22.0", "jsii-rosetta": "^0.22.0", "lerna": "^3.20.2", - "typescript": "~3.8.2" + "standard-version": "^7.1.0", + "typescript": "~3.8.3" }, "repository": { "type": "git", "url": "git://github.com/aws/aws-cdk" }, - "standard-version": { - "releaseCommitMessageFormat": "v{{currentTag}}", - "scripts": { - "prebump": "echo $(node -pe \"require('./lerna.json').version\")", - "precommit": "git add ." - } - }, "license": "Apache-2.0", "author": { "name": "Amazon Web Services", @@ -41,6 +36,7 @@ "packages": [ "packages/*", "packages/@aws-cdk/*", + "packages/@monocdk-experiment/*", "packages/@aws-cdk/*/lambda-packages/*", "tools/*" ], @@ -62,4 +58,4 @@ "@aws-cdk/cx-api/semver/**" ] } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/alexa-ask/package.json b/packages/@aws-cdk/alexa-ask/package.json index 2c9ee9392adc1..6449e7bbda510 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 a64ac2a58bb69..18bf1e24cf5ee 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.25.0", + "version": "0.0.0", "main": "lib/index.js", "types": "lib/index.d.ts", "jsii": { @@ -40,24 +40,24 @@ "compat": "cdk-compat" }, "dependencies": { - "@aws-cdk/aws-cloudformation": "1.25.0", - "@aws-cdk/aws-codebuild": "1.25.0", - "@aws-cdk/aws-codepipeline": "1.25.0", - "@aws-cdk/aws-codepipeline-actions": "1.25.0", - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/core": "1.25.0", - "@aws-cdk/cx-api": "1.25.0" + "@aws-cdk/aws-cloudformation": "0.0.0", + "@aws-cdk/aws-codebuild": "0.0.0", + "@aws-cdk/aws-codepipeline": "0.0.0", + "@aws-cdk/aws-codepipeline-actions": "0.0.0", + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/cx-api": "0.0.0" }, "devDependencies": { - "@aws-cdk/assert": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", + "@aws-cdk/assert": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", "fast-check": "^1.22.2", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "repository": { "type": "git", @@ -76,14 +76,14 @@ "cdk" ], "peerDependencies": { - "@aws-cdk/aws-cloudformation": "1.25.0", - "@aws-cdk/aws-codebuild": "1.25.0", - "@aws-cdk/aws-codepipeline": "1.25.0", - "@aws-cdk/aws-codepipeline-actions": "1.25.0", - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/core": "1.25.0", - "@aws-cdk/cx-api": "1.25.0" + "@aws-cdk/aws-cloudformation": "0.0.0", + "@aws-cdk/aws-codebuild": "0.0.0", + "@aws-cdk/aws-codepipeline": "0.0.0", + "@aws-cdk/aws-codepipeline-actions": "0.0.0", + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/cx-api": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/assert/jest.ts b/packages/@aws-cdk/assert/jest.ts index 78fa8fab38d90..11cc8226ea035 100644 --- a/packages/@aws-cdk/assert/jest.ts +++ b/packages/@aws-cdk/assert/jest.ts @@ -1,4 +1,4 @@ -import { Stack } from '@aws-cdk/core'; +import * as core from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; import { JestFriendlyAssertion } from './lib/assertion'; import { haveOutput, HaveOutputProperties } from './lib/assertions/have-output'; @@ -28,7 +28,7 @@ declare global { expect.extend({ toMatchTemplate( - actual: cxapi.CloudFormationStackArtifact | Stack, + actual: cxapi.CloudFormationStackArtifact | core.Stack, template: any, matchStyle?: MatchStyle) { @@ -49,7 +49,7 @@ expect.extend({ }, toHaveResource( - actual: cxapi.CloudFormationStackArtifact | Stack, + actual: cxapi.CloudFormationStackArtifact | core.Stack, resourceType: string, properties?: any, comparison?: ResourcePart) { @@ -59,7 +59,7 @@ expect.extend({ }, toHaveResourceLike( - actual: cxapi.CloudFormationStackArtifact | Stack, + actual: cxapi.CloudFormationStackArtifact | core.Stack, resourceType: string, properties?: any, comparison?: ResourcePart) { @@ -69,14 +69,14 @@ expect.extend({ }, toHaveOutput( - actual: cxapi.CloudFormationStackArtifact | Stack, + actual: cxapi.CloudFormationStackArtifact | core.Stack, props: HaveOutputProperties) { return applyAssertion(haveOutput(props), actual); } }); -function applyAssertion(assertion: JestFriendlyAssertion, actual: cxapi.CloudFormationStackArtifact | Stack) { +function applyAssertion(assertion: JestFriendlyAssertion, actual: cxapi.CloudFormationStackArtifact | core.Stack) { const inspector = ourExpect(actual); const pass = assertion.assertUsing(inspector); if (pass) { diff --git a/packages/@aws-cdk/assert/lib/assertions/count-resources.ts b/packages/@aws-cdk/assert/lib/assertions/count-resources.ts index 52e96a188e220..1a0eb3b4667cb 100644 --- a/packages/@aws-cdk/assert/lib/assertions/count-resources.ts +++ b/packages/@aws-cdk/assert/lib/assertions/count-resources.ts @@ -1,5 +1,6 @@ import { Assertion } from "../assertion"; import { StackInspector } from "../inspector"; +import { isSuperObject } from "./have-resource"; /** * An assertion to check whether a resource of a given type and with the given properties exists, disregarding properties @@ -32,13 +33,10 @@ class CountResourcesAssertion extends Assertion { const resource = inspector.value.Resources[logicalId]; if (resource.Type === this.resourceType) { if (this.props) { - const propEntries = Object.entries(this.props); - propEntries.forEach(([key, val]) => { - if (resource.Properties && resource.Properties[key] && JSON.stringify(resource.Properties[key]) === JSON.stringify(val)) { - counted++; - this.inspected += 1; - } - }); + if (isSuperObject(resource.Properties, this.props, [], true)) { + counted++; + this.inspected += 1; + } } else { counted++; this.inspected += 1; diff --git a/packages/@aws-cdk/assert/lib/synth-utils.ts b/packages/@aws-cdk/assert/lib/synth-utils.ts index 2606ecc669eca..57d21926919b1 100644 --- a/packages/@aws-cdk/assert/lib/synth-utils.ts +++ b/packages/@aws-cdk/assert/lib/synth-utils.ts @@ -1,15 +1,15 @@ -import { App, ConstructNode, Stack, SynthesisOptions } from '@aws-cdk/core'; +import * as core from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; import * as fs from 'fs'; import * as path from 'path'; export class SynthUtils { - public static synthesize(stack: Stack, options: SynthesisOptions = { }): cxapi.CloudFormationStackArtifact { + public static synthesize(stack: core.Stack, options: core.SynthesisOptions = { }): cxapi.CloudFormationStackArtifact { // always synthesize against the root (be it an App or whatever) so all artifacts will be included const root = stack.node.root; // if the root is an app, invoke "synth" to avoid double synthesis - const assembly = root instanceof App ? root.synth() : ConstructNode.synth(root.node, options); + const assembly = root instanceof core.App ? root.synth() : core.ConstructNode.synth(root.node, options); return assembly.getStackArtifact(stack.artifactId); } @@ -17,7 +17,7 @@ export class SynthUtils { /** * Synthesizes the stack and returns the resulting CloudFormation template. */ - public static toCloudFormation(stack: Stack, options: SynthesisOptions = { }): any { + public static toCloudFormation(stack: core.Stack, options: core.SynthesisOptions = { }): any { const synth = this._synthesizeWithNested(stack, options); if (synth instanceof cxapi.CloudFormationStackArtifact) { return synth.template; @@ -29,7 +29,7 @@ export class SynthUtils { /** * @returns Returns a subset of the synthesized CloudFormation template (only specific resource types). */ - public static subset(stack: Stack, options: SubsetOptions): any { + public static subset(stack: core.Stack, options: SubsetOptions): any { const template = this.toCloudFormation(stack); if (template.Resources) { for (const [key, resource] of Object.entries(template.Resources)) { @@ -49,12 +49,12 @@ export class SynthUtils { * @return CloudFormationStackArtifact for normal stacks or the actual template for nested stacks * @internal */ - public static _synthesizeWithNested(stack: Stack, options: SynthesisOptions = { }): cxapi.CloudFormationStackArtifact | object { + public static _synthesizeWithNested(stack: core.Stack, options: core.SynthesisOptions = { }): cxapi.CloudFormationStackArtifact | object { // always synthesize against the root (be it an App or whatever) so all artifacts will be included const root = stack.node.root; // if the root is an app, invoke "synth" to avoid double synthesis - const assembly = root instanceof App ? root.synth() : ConstructNode.synth(root.node, options); + const assembly = root instanceof core.App ? root.synth() : core.ConstructNode.synth(root.node, options); // if this is a nested stack (it has a parent), then just read the template as a string if (stack.nestedStackParent) { diff --git a/packages/@aws-cdk/assert/package.json b/packages/@aws-cdk/assert/package.json index 439fa1df05e45..e254e272d4d4e 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.25.0", + "version": "0.0.0", "description": "An assertion library for use with CDK Apps", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -30,17 +30,18 @@ "license": "Apache-2.0", "devDependencies": { "@types/jest": "^25.1.2", - "cdk-build-tools": "1.25.0", + "cdk-build-tools": "0.0.0", "jest": "^24.9.0", - "pkglint": "1.25.0", + "pkglint": "0.0.0", "ts-jest": "^25.2.0" }, "dependencies": { - "@aws-cdk/cloudformation-diff": "1.25.0", - "@aws-cdk/core": "1.25.0", - "@aws-cdk/cx-api": "1.25.0" + "@aws-cdk/cloudformation-diff": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/cx-api": "0.0.0" }, "peerDependencies": { + "@aws-cdk/core": "0.0.0", "jest": "^24.9.0" }, "repository": { @@ -57,4 +58,4 @@ "node": ">= 10.3.0" }, "stability": "experimental" -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/assert/test/assertions.test.ts b/packages/@aws-cdk/assert/test/assertions.test.ts index d5a7f56132e36..2d860e3518b80 100644 --- a/packages/@aws-cdk/assert/test/assertions.test.ts +++ b/packages/@aws-cdk/assert/test/assertions.test.ts @@ -276,7 +276,7 @@ failingExample('expect to count resources like props - more than ex cdkExpect(synthStack).to(countResourcesLike(resourceType, 1, { parentId: 123 })); }); -failingExample('expect to count resources like props - nested props out of order', () => { +passingExample('expect to count resources like props - nested props out of order', () => { const resourceType = 'Test::Resource'; const synthStack = synthesizedStack(stack => { new TestResource(stack, 'R1', { type: resourceType, properties: { id: 987, parentInfo: { id: 123, name: "A" } } }); @@ -286,7 +286,7 @@ failingExample('expect to count resources like props - nested props cdkExpect(synthStack).to(countResourcesLike(resourceType, 2, { parentInfo: { id: 123, name: "A" } })); }); -failingExample('expect to count resources like props - nested props incomplete', () => { +passingExample('expect to count resources like props - nested props incomplete', () => { const resourceType = 'Test::Resource'; const synthStack = synthesizedStack(stack => { new TestResource(stack, 'R1', { type: resourceType, properties: { id: 987, parentInfo: { id: 123, name: "A" } } }); diff --git a/packages/@aws-cdk/assets/package.json b/packages/@aws-cdk/assets/package.json index a0d8a685086d7..026f3d6b69453 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/minimatch": "^3.0.3", "@types/nodeunit": "^0.0.30", - "@types/sinon": "^7.5.0", - "aws-cdk": "1.25.0", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", + "@types/sinon": "^7.5.2", + "aws-cdk": "0.0.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0", + "pkglint": "0.0.0", "sinon": "^9.0.0", "ts-mock-imports": "^1.2.6" }, "dependencies": { - "@aws-cdk/core": "1.25.0", - "@aws-cdk/cx-api": "1.25.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/cx-api": "0.0.0", "minimatch": "^3.0.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.25.0", - "@aws-cdk/cx-api": "1.25.0" + "@aws-cdk/core": "0.0.0", + "@aws-cdk/cx-api": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-accessanalyzer/package.json b/packages/@aws-cdk/aws-accessanalyzer/package.json index 50ebedf80002a..2b4850c503a09 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-acmpca/package.json b/packages/@aws-cdk/aws-acmpca/package.json index aabe9dedebd6e..7461e242f7bfd 100644 --- a/packages/@aws-cdk/aws-acmpca/package.json +++ b/packages/@aws-cdk/aws-acmpca/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-acmpca", - "version": "1.25.0", + "version": "0.0.0", "description": "The CDK Construct Library for AWS::ACMPCA", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,16 +81,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 642e0e0bf063a..40b4668d08b64 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 137e55a79f300..fdc18ec05ffac 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 b7537d82c63fb..c7d33102bce74 100644 --- a/packages/@aws-cdk/aws-apigateway/README.md +++ b/packages/@aws-cdk/aws-apigateway/README.md @@ -132,7 +132,11 @@ const key = api.addApiKey('ApiKey'); const plan = api.addUsagePlan('UsagePlan', { name: 'Easy', - apiKey: key + apiKey: key, + throttle: { + rateLimit: 10, + burstLimit: 2 + } }); plan.addApiStage({ @@ -521,9 +525,12 @@ as `example.com`, and for subdomains, such as `www.example.com`. (You can create CNAME records only for subdomains.) ```ts +import * as route53 from '@aws-cdk/aws-route53'; +import * as targets from '@aws-cdk/aws-route53-targets'; + new route53.ARecord(this, 'CustomDomainAliasRecord', { zone: hostedZoneForExampleCom, - target: route53.RecordTarget.fromAlias(new route53_targets.ApiGateway(api)) + target: route53.RecordTarget.fromAlias(new targets.ApiGateway(api)) }); ``` @@ -561,12 +568,15 @@ domain.addBasePathMapping(api); This can also be achieved through the `mapping` configuration when defining the domain as demonstrated above. -If you wish to setup this domain with an Amazon Route53 alias, use the `route53_targets.ApiGatewayDomain`: +If you wish to setup this domain with an Amazon Route53 alias, use the `targets.ApiGatewayDomain`: ```ts +import * as route53 from '@aws-cdk/aws-route53'; +import * as targets from '@aws-cdk/aws-route53-targets'; + new route53.ARecord(this, 'CustomDomainAliasRecord', { zone: hostedZoneForExampleCom, - target: route53.RecordTarget.fromAlias(new route53_targets.ApiGatewayDomain(domainName)) + target: route53.RecordTarget.fromAlias(new targets.ApiGatewayDomain(domainName)) }); ``` diff --git a/packages/@aws-cdk/aws-apigateway/package.json b/packages/@aws-cdk/aws-apigateway/package.json index 3193d1102444a..8e033beda0cfa 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.25.0", + "version": "0.0.0", "description": "The CDK Construct Library for AWS::ApiGateway", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,30 +62,30 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-certificatemanager": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-certificatemanager": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-elasticloadbalancingv2": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-certificatemanager": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-certificatemanager": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-elasticloadbalancingv2": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" @@ -298,4 +298,4 @@ ] }, "stability": "stable" -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-apigatewayv2/package.json b/packages/@aws-cdk/aws-apigatewayv2/package.json index 04a1257e08152..3e909d4ddd8e4 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/package.json +++ b/packages/@aws-cdk/aws-apigatewayv2/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-apigatewayv2", - "version": "1.25.0", + "version": "0.0.0", "description": "The CDK Construct Library for AWS::APIGatewayv2", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,16 +80,16 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-appconfig/package.json b/packages/@aws-cdk/aws-appconfig/package.json index cd496b48ed8c5..bb528269371ef 100644 --- a/packages/@aws-cdk/aws-appconfig/package.json +++ b/packages/@aws-cdk/aws-appconfig/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-appconfig", - "version": "1.25.0", + "version": "0.0.0", "description": "The CDK Construct Library for AWS::AppConfig", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -65,16 +65,16 @@ "jest": {}, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-applicationautoscaling/lib/target-tracking-scaling-policy.ts b/packages/@aws-cdk/aws-applicationautoscaling/lib/target-tracking-scaling-policy.ts index 053dca7f4f289..f2f2a5bed2dfe 100644 --- a/packages/@aws-cdk/aws-applicationautoscaling/lib/target-tracking-scaling-policy.ts +++ b/packages/@aws-cdk/aws-applicationautoscaling/lib/target-tracking-scaling-policy.ts @@ -35,14 +35,24 @@ export interface BaseTargetTrackingProps { /** * Period after a scale in activity completes before another scale in activity can start. * - * @default - No scale in cooldown. + * @default Duration.seconds(300) for the following scalable targets: ECS services, + * Spot Fleet requests, EMR clusters, AppStream 2.0 fleets, Aurora DB clusters, + * Amazon SageMaker endpoint variants, Custom resources. For all other scalable + * targets, the default value is Duration.seconds(0): DynamoDB tables, DynamoDB + * global secondary indexes, Amazon Comprehend document classification endpoints, + * Lambda provisioned concurrency */ readonly scaleInCooldown?: cdk.Duration; /** * Period after a scale out activity completes before another scale out activity can start. * - * @default - No scale out cooldown. + * @default Duration.seconds(300) for the following scalable targets: ECS services, + * Spot Fleet requests, EMR clusters, AppStream 2.0 fleets, Aurora DB clusters, + * Amazon SageMaker endpoint variants, Custom resources. For all other scalable + * targets, the default value is Duration.seconds(0): DynamoDB tables, DynamoDB + * global secondary indexes, Amazon Comprehend document classification endpoints, + * Lambda provisioned concurrency */ readonly scaleOutCooldown?: cdk.Duration; } diff --git a/packages/@aws-cdk/aws-applicationautoscaling/package.json b/packages/@aws-cdk/aws-applicationautoscaling/package.json index 42a5ca44ddc2c..3c57582480981 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", "fast-check": "^1.22.2", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-autoscaling-common": "1.25.0", - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-autoscaling-common": "0.0.0", + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-autoscaling-common": "1.25.0", - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-autoscaling-common": "0.0.0", + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/core": "0.0.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 dcc966ae23a68..093f5761c106f 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-servicediscovery": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-servicediscovery": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-servicediscovery": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-servicediscovery": "0.0.0", + "@aws-cdk/core": "0.0.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 5f7a79fbe2ae3..c8f39b2191e09 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-appsync/README.md b/packages/@aws-cdk/aws-appsync/README.md index 56e08034ebb38..4dff64bd8ed60 100644 --- a/packages/@aws-cdk/aws-appsync/README.md +++ b/packages/@aws-cdk/aws-appsync/README.md @@ -70,9 +70,16 @@ export class ApiStack extends Stack { logConfig: { fieldLogLevel: FieldLogLevel.ALL, }, - userPoolConfig: { - userPool, - defaultAction: UserPoolDefaultAction.ALLOW, + authorizationConfig: { + defaultAuthorization: { + userPool, + defaultAction: UserPoolDefaultAction.ALLOW, + }, + additionalAuthorizationModes: [ + { + apiKeyDesc: 'My API Key', + }, + ], }, schemaDefinitionFile: './schema.graphql', }); diff --git a/packages/@aws-cdk/aws-appsync/lib/graphqlapi.ts b/packages/@aws-cdk/aws-appsync/lib/graphqlapi.ts index 15de26772b6c9..36a87436aa4d3 100644 --- a/packages/@aws-cdk/aws-appsync/lib/graphqlapi.ts +++ b/packages/@aws-cdk/aws-appsync/lib/graphqlapi.ts @@ -2,9 +2,14 @@ import { IUserPool } from "@aws-cdk/aws-cognito"; import { Table } from '@aws-cdk/aws-dynamodb'; import { IGrantable, IPrincipal, IRole, ManagedPolicy, Role, ServicePrincipal } from "@aws-cdk/aws-iam"; import { IFunction } from "@aws-cdk/aws-lambda"; -import { Construct, IResolvable } from "@aws-cdk/core"; +import { Construct, Duration, IResolvable } from "@aws-cdk/core"; import { readFileSync } from "fs"; -import { CfnDataSource, CfnGraphQLApi, CfnGraphQLSchema, CfnResolver } from "./appsync.generated"; +import { CfnApiKey, CfnDataSource, CfnGraphQLApi, CfnGraphQLSchema, CfnResolver } from "./appsync.generated"; + +/** + * Marker interface for the different authorization modes. + */ +export interface AuthMode { } /** * enum with all possible values for Cognito user-pool default actions @@ -23,7 +28,7 @@ export enum UserPoolDefaultAction { /** * Configuration for Cognito user-pools in AppSync */ -export interface UserPoolConfig { +export interface UserPoolConfig extends AuthMode { /** * The Cognito user pool to use as identity source @@ -43,6 +48,51 @@ export interface UserPoolConfig { readonly defaultAction?: UserPoolDefaultAction; } +function isUserPoolConfig(obj: unknown): obj is UserPoolConfig { + return (obj as UserPoolConfig).userPool !== undefined; +} + +/** + * Configuration for API Key authorization in AppSync + */ +export interface ApiKeyConfig extends AuthMode { + /** + * Unique description of the API key + */ + readonly apiKeyDesc: string; + + /** + * The time from creation time after which the API key expires, using RFC3339 representation. + * It must be a minimum of 1 day and a maximum of 365 days from date of creation. + * Rounded down to the nearest hour. + * @default - 7 days from creation time + */ + readonly expires?: string; +} + +function isApiKeyConfig(obj: unknown): obj is ApiKeyConfig { + return (obj as ApiKeyConfig).apiKeyDesc !== undefined; +} + +/** + * Configuration of the API authorization modes. + */ +export interface AuthorizationConfig { + /** + * Optional authorization configuration + * + * @default - API Key authorization + */ + readonly defaultAuthorization?: AuthMode; + + /** + * Additional authorization modes + * + * @default - No other modes + */ + readonly additionalAuthorizationModes?: [AuthMode] +} + /** * log-level for fields in AppSync */ @@ -90,11 +140,11 @@ export interface GraphQLApiProps { readonly name: string; /** - * Optional user pool authorizer configuration + * Optional authorization configuration * - * @default - Do not use Cognito auth + * @default - API Key authorization */ - readonly userPoolConfig?: UserPoolConfig; + readonly authorizationConfig?: AuthorizationConfig; /** * Logging configuration for this api @@ -145,7 +195,6 @@ export class GraphQLApi extends Construct { public readonly schema: CfnGraphQLSchema; private api: CfnGraphQLApi; - private authenticationType: string; constructor(scope: Construct, id: string, props: GraphQLApiProps) { super(scope, id); @@ -156,22 +205,9 @@ export class GraphQLApi extends Construct { apiLogsRole.addManagedPolicy(ManagedPolicy.fromAwsManagedPolicyName('service-role/AWSAppSyncPushToCloudWatchLogs')); } - if (props.userPoolConfig) { - this.authenticationType = 'AMAZON_COGNITO_USER_POOLS'; - } else { - this.authenticationType = 'API_KEY'; - } - this.api = new CfnGraphQLApi(this, 'Resource', { name: props.name, - authenticationType: this.authenticationType, - ...props.userPoolConfig && { - userPoolConfig: { - userPoolId: props.userPoolConfig.userPool.userPoolId, - awsRegion: props.userPoolConfig.userPool.stack.region, - defaultAction: props.userPoolConfig.defaultAction ? props.userPoolConfig.defaultAction.toString() : 'ALLOW', - }, - }, + authenticationType: 'API_KEY', ...props.logConfig && { logConfig: { cloudWatchLogsRoleArn: apiLogsRole ? apiLogsRole.roleArn : undefined, @@ -186,6 +222,10 @@ export class GraphQLApi extends Construct { this.graphQlUrl = this.api.attrGraphQlUrl; this.name = this.api.name; + if (props.authorizationConfig) { + this.setupAuth(props.authorizationConfig); + } + let definition; if (props.schemaDefinition) { definition = props.schemaDefinition; @@ -230,6 +270,55 @@ export class GraphQLApi extends Construct { }); } + private setupAuth(auth: AuthorizationConfig) { + if (isUserPoolConfig(auth.defaultAuthorization)) { + const { authenticationType, userPoolConfig } = this.userPoolDescFrom(auth.defaultAuthorization); + this.api.authenticationType = authenticationType; + this.api.userPoolConfig = userPoolConfig; + } else if (isApiKeyConfig(auth.defaultAuthorization)) { + this.api.authenticationType = this.apiKeyDesc(auth.defaultAuthorization).authenticationType; + } + + this.api.additionalAuthenticationProviders = []; + for (const mode of (auth.additionalAuthorizationModes || [])) { + if (isUserPoolConfig(mode)) { + this.api.additionalAuthenticationProviders.push(this.userPoolDescFrom(mode)); + } else if (isApiKeyConfig(mode)) { + this.api.additionalAuthenticationProviders.push(this.apiKeyDesc(mode)); + } + } + } + + private userPoolDescFrom(upConfig: UserPoolConfig): { authenticationType: string; userPoolConfig: CfnGraphQLApi.UserPoolConfigProperty } { + return { + authenticationType: 'AMAZON_COGNITO_USER_POOLS', + userPoolConfig: { + appIdClientRegex: upConfig.appIdClientRegex, + userPoolId: upConfig.userPool.userPoolId, + awsRegion: upConfig.userPool.stack.region, + defaultAction: upConfig.defaultAction ? upConfig.defaultAction.toString() : 'ALLOW', + } + }; + } + + private apiKeyDesc(akConfig: ApiKeyConfig): { authenticationType: string } { + let expires: number | undefined; + if (akConfig.expires) { + expires = new Date(akConfig.expires).valueOf(); + const now = Date.now(); + const days = (d: number) => now + Duration.days(d).toMilliseconds(); + if (expires < days(1) || expires > days(365)) { + throw Error("API key expiration must be between 1 and 365 days."); + } + expires = Math.round(expires / 1000); + } + new CfnApiKey(this, `${akConfig.apiKeyDesc || ''}ApiKey`, { + expires, + description: akConfig.apiKeyDesc, + apiId: this.apiId, + }); + return { authenticationType: 'API_KEY' }; + } } /** diff --git a/packages/@aws-cdk/aws-appsync/package.json b/packages/@aws-cdk/aws-appsync/package.json index 2153ca23fccb6..9e6865b6c18da 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.25.0", + "version": "0.0.0", "description": "The CDK Construct Library for AWS::AppSync", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,29 +79,36 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.25.0", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-cognito": "1.25.0", - "@aws-cdk/aws-dynamodb": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-cognito": "0.0.0", + "@aws-cdk/aws-dynamodb": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-cognito": "1.25.0", - "@aws-cdk/aws-dynamodb": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-cognito": "0.0.0", + "@aws-cdk/aws-dynamodb": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" }, + "awslint": { + "exclude": [ + "no-unused-type:@aws-cdk/aws-appsync.ApiKeyConfig", + "no-unused-type:@aws-cdk/aws-appsync.UserPoolConfig", + "no-unused-type:@aws-cdk/aws-appsync.UserPoolDefaultAction" + ] + }, "stability": "experimental" } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-appsync/test/integ.graphql.expected.json b/packages/@aws-cdk/aws-appsync/test/integ.graphql.expected.json index 1fad1ba0f55a6..2face78179375 100644 --- a/packages/@aws-cdk/aws-appsync/test/integ.graphql.expected.json +++ b/packages/@aws-cdk/aws-appsync/test/integ.graphql.expected.json @@ -1,10 +1,101 @@ { "Resources": { + "PoolsmsRoleC3352CE6": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Condition": { + "StringEquals": { + "sts:ExternalId": "awsappsyncintegPool5D14B05B" + } + }, + "Effect": "Allow", + "Principal": { + "Service": "cognito-idp.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": "sns:Publish", + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "sns-publish" + } + ] + } + }, + "PoolD3F588B8": { + "Type": "AWS::Cognito::UserPool", + "Properties": { + "AdminCreateUserConfig": { + "AllowAdminCreateUserOnly": true + }, + "EmailVerificationMessage": "Hello {username}, Your verification code is {####}", + "EmailVerificationSubject": "Verify your new account", + "LambdaConfig": {}, + "SmsConfiguration": { + "ExternalId": "awsappsyncintegPool5D14B05B", + "SnsCallerArn": { + "Fn::GetAtt": [ + "PoolsmsRoleC3352CE6", + "Arn" + ] + } + }, + "SmsVerificationMessage": "The verification code to your new account is {####}", + "UserPoolName": "myPool", + "VerificationMessageTemplate": { + "DefaultEmailOption": "CONFIRM_WITH_CODE", + "EmailMessage": "Hello {username}, Your verification code is {####}", + "EmailSubject": "Verify your new account", + "SmsMessage": "The verification code to your new account is {####}" + } + } + }, "ApiF70053CD": { "Type": "AWS::AppSync::GraphQLApi", "Properties": { - "AuthenticationType": "API_KEY", - "Name": "demoapi" + "AuthenticationType": "AMAZON_COGNITO_USER_POOLS", + "Name": "demoapi", + "AdditionalAuthenticationProviders": [ + { + "AuthenticationType": "API_KEY" + } + ], + "UserPoolConfig": { + "AwsRegion": { + "Ref": "AWS::Region" + }, + "DefaultAction": "ALLOW", + "UserPoolId": { + "Ref": "PoolD3F588B8" + } + } + } + }, + "ApiMyAPIKeyApiKeyACDEE2CC": { + "Type": "AWS::AppSync::ApiKey", + "Properties": { + "ApiId": { + "Fn::GetAtt": [ + "ApiF70053CD", + "ApiId" + ] + }, + "Description": "My API Key" } }, "ApiSchema510EECD7": { diff --git a/packages/@aws-cdk/aws-appsync/test/integ.graphql.ts b/packages/@aws-cdk/aws-appsync/test/integ.graphql.ts index a3d1cee096029..a2efb337e3a28 100644 --- a/packages/@aws-cdk/aws-appsync/test/integ.graphql.ts +++ b/packages/@aws-cdk/aws-appsync/test/integ.graphql.ts @@ -1,14 +1,32 @@ +import { UserPool } from '@aws-cdk/aws-cognito'; import { AttributeType, BillingMode, Table } from '@aws-cdk/aws-dynamodb'; import { App, Stack } from '@aws-cdk/core'; import { join } from 'path'; -import { GraphQLApi, KeyCondition, MappingTemplate, PrimaryKey, Values } from '../lib'; +import { GraphQLApi, KeyCondition, MappingTemplate, PrimaryKey, UserPoolDefaultAction, Values } from '../lib'; const app = new App(); const stack = new Stack(app, 'aws-appsync-integ'); +const userPool = new UserPool(stack, 'Pool', { + userPoolName: 'myPool', +}); + const api = new GraphQLApi(stack, 'Api', { name: `demoapi`, schemaDefinitionFile: join(__dirname, 'schema.graphql'), + authorizationConfig: { + defaultAuthorization: { + userPool, + defaultAction: UserPoolDefaultAction.ALLOW, + }, + additionalAuthorizationModes: [ + { + apiKeyDesc: 'My API Key', + // Can't specify a date because it will inevitably be in the past. + // expires: '2019-02-05T12:00:00Z', + }, + ], + }, }); const customerTable = new Table(stack, 'CustomerTable', { diff --git a/packages/@aws-cdk/aws-athena/package.json b/packages/@aws-cdk/aws-athena/package.json index ea28e8bca2e72..3c345ba3237ce 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 7494d9fcba574..a936cc1f9bc5e 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", "fast-check": "^1.22.2", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "awslint": { "exclude": [ diff --git a/packages/@aws-cdk/aws-autoscaling-hooktargets/package.json b/packages/@aws-cdk/aws-autoscaling-hooktargets/package.json index 2654e8532d1eb..80dce2476fe75 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.25.0", + "version": "0.0.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.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "@aws-cdk/assert": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "jest": "^24.9.0", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-autoscaling": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/aws-sns-subscriptions": "1.25.0", - "@aws-cdk/aws-sqs": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-autoscaling": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/aws-sns-subscriptions": "0.0.0", + "@aws-cdk/aws-sqs": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-autoscaling": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/aws-sns-subscriptions": "1.25.0", - "@aws-cdk/aws-sqs": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-autoscaling": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/aws-sns-subscriptions": "0.0.0", + "@aws-cdk/aws-sqs": "0.0.0", + "@aws-cdk/core": "0.0.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 61461f56baed9..84fda470e5205 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.25.0", + "version": "0.0.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.25.0", - "@aws-cdk/cx-api": "1.25.0", + "@aws-cdk/assert": "0.0.0", + "@aws-cdk/cx-api": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-autoscaling-common": "1.25.0", - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-elasticloadbalancing": "1.25.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-autoscaling-common": "0.0.0", + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-elasticloadbalancing": "0.0.0", + "@aws-cdk/aws-elasticloadbalancingv2": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-autoscaling-common": "1.25.0", - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-elasticloadbalancing": "1.25.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-autoscaling-common": "0.0.0", + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-elasticloadbalancing": "0.0.0", + "@aws-cdk/aws-elasticloadbalancingv2": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/core": "0.0.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 e122f649dea41..a7b66daa871f6 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 b69329644b342..44c8ae655ea0e 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-batch/lib/compute-environment.ts b/packages/@aws-cdk/aws-batch/lib/compute-environment.ts new file mode 100644 index 0000000000000..663d806f0fff7 --- /dev/null +++ b/packages/@aws-cdk/aws-batch/lib/compute-environment.ts @@ -0,0 +1,458 @@ +import * as ec2 from '@aws-cdk/aws-ec2'; +import * as iam from '@aws-cdk/aws-iam'; +import { Aws, Construct, IResource, Resource, Stack, Tag } from '@aws-cdk/core'; +import { CfnComputeEnvironment } from './batch.generated'; + +/** + * Property to specify if the compute environment + * uses On-Demand or SpotFleet compute resources. + */ +export enum ComputeResourceType { + /** + * Resources will be EC2 On-Demand resources. + */ + ON_DEMAND = 'EC2', + + /** + * Resources will be EC2 SpotFleet resources. + */ + SPOT = 'SPOT', +} + +/** + * Properties for how to prepare compute resources + * that are provisioned for a compute environment. + */ +export enum AllocationStrategy { + /** + * Batch will use the best fitting instance type will be used + * when assigning a batch job in this compute environment. + */ + BEST_FIT = 'BEST_FIT', + + /** + * Batch will select additional instance types that are large enough to + * meet the requirements of the jobs in the queue, with a preference for + * instance types with a lower cost per unit vCPU. + */ + BEST_FIT_PROGRESSIVE = 'BEST_FIT_PROGRESSIVE', + + /** + * This is only available for Spot Instance compute resources and will select + * additional instance types that are large enough to meet the requirements of + * the jobs in the queue, with a preference for instance types that are less + * likely to be interrupted. + */ + SPOT_CAPACITY_OPTIMIZED = 'SPOT_CAPACITY_OPTIMIZED', +} + +/** + * Properties for defining the structure of the batch compute cluster. + */ +export interface ComputeResources { + /** + * The IAM role applied to EC2 resources in the compute environment. + * + * @default - a new role will be created. + */ + readonly instanceRole?: iam.IRole; + + /** + * The types of EC2 instances that may be launched in the compute environment. You can specify instance + * families to launch any instance type within those families (for example, c4 or p3), or you can specify + * specific sizes within a family (such as c4.8xlarge). You can also choose optimal to pick instance types + * (from the C, M, and R instance families) on the fly that match the demand of your job queues. + * + * @default optimal + */ + readonly instanceTypes?: ec2.InstanceType[]; + + /** + * The EC2 security group(s) associated with instances launched in the compute environment. + * + * @default AWS default security group. + */ + readonly securityGroups?: ec2.ISecurityGroup[]; + + /** + * The VPC network that all compute resources will be connected to. + */ + readonly vpc: ec2.IVpc; + + /** + * The VPC subnets into which the compute resources are launched. + * + * @default - private subnets of the supplied VPC. + */ + readonly vpcSubnets?: ec2.SubnetSelection; + + /** + * The type of compute environment: ON_DEMAND or SPOT. + * + * @default ON_DEMAND + */ + readonly type?: ComputeResourceType; + + /** + * This property will be ignored if you set the environment type to ON_DEMAND. + * + * The maximum percentage that a Spot Instance price can be when compared with the On-Demand price for + * that instance type before instances are launched. For example, if your maximum percentage is 20%, + * then the Spot price must be below 20% of the current On-Demand price for that EC2 instance. You always + * pay the lowest (market) price and never more than your maximum percentage. If you leave this field empty, + * the default value is 100% of the On-Demand price. + * + * @default 100 + */ + readonly bidPercentage?: number; + + /** + * The desired number of EC2 vCPUS in the compute environment. + * + * @default - no desired vcpu value will be used. + */ + readonly desiredvCpus?: number; + + /** + * The maximum number of EC2 vCPUs that an environment can reach. Each vCPU is equivalent to + * 1,024 CPU shares. You must specify at least one vCPU. + * + * @default 256 + */ + readonly maxvCpus?: number; + + /** + * The minimum number of EC2 vCPUs that an environment should maintain (even if the compute environment state is DISABLED). + * Each vCPU is equivalent to 1,024 CPU shares. You must specify at least one vCPU. + * + * @default 1 + */ + readonly minvCpus?: number; + + /** + * The EC2 key pair that is used for instances launched in the compute environment. + * If no key is defined, then SSH access is not allowed to provisioned compute resources. + * + * @default - No SSH access will be possible. + */ + readonly ec2KeyPair?: string; + + /** + * The Amazon Machine Image (AMI) ID used for instances launched in the compute environment. + * + * @default - no image will be used. + */ + readonly image?: ec2.IMachineImage; + + /** + * This property will be ignored if you set the environment type to ON_DEMAND. + * + * The Amazon Resource Name (ARN) of the Amazon EC2 Spot Fleet IAM role applied to a SPOT compute environment. + * For more information, see Amazon EC2 Spot Fleet Role in the AWS Batch User Guide. + * + * @link https://docs.aws.amazon.com/batch/latest/userguide/spot_fleet_IAM_role.html + * @default - no fleet role will be used. + */ + readonly spotFleetRole?: iam.IRole; + + /** + * Key-value pair tags to be applied to resources that are launched in the compute environment. + * For AWS Batch, these take the form of "String1": "String2", where String1 is the tag key and + * String2 is the tag value—for example, { "Name": "AWS Batch Instance - C4OnDemand" }. + * + * @default - no tags will be assigned on compute resources. + */ + readonly computeResourcesTags?: Tag; +} + +/** + * Properties for creating a new Compute Environment + */ +export interface ComputeEnvironmentProps { + /** + * The allocation strategy to use for the compute resource in case not enough instances ofthe best + * fitting instance type can be allocated. This could be due to availability of the instance type in + * the region or Amazon EC2 service limits. If this is not specified, the default is BEST_FIT, which + * will use only the best fitting instance type, waiting for additional capacity if it's not available. + * This allocation strategy keeps costs lower but can limit scaling. If you are using Spot Fleets with + * BEST_FIT then the Spot Fleet IAM Role must be specified. BEST_FIT_PROGRESSIVE will select an additional + * instance type that is large enough to meet the requirements of the jobs in the queue, with a preference + * for an instance type with a lower cost. SPOT_CAPACITY_OPTIMIZED is only available for Spot Instance + * compute resources and will select an additional instance type that is large enough to meet the requirements + * of the jobs in the queue, with a preference for an instance type that is less likely to be interrupted. + * + * @default AllocationStrategy.BEST_FIT + */ + readonly allocationStrategy?: AllocationStrategy; + + /** + * A name for the compute environment. + * + * Up to 128 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed. + * + * @default Cloudformation-generated name + */ + readonly computeEnvironmentName?: string; + + /** + * The details of the compute resources managed by this environment. + * + * If specified, and this is an managed compute environment, the property will be ignored. + * + * By default, AWS Batch managed compute environments use a recent, approved version of the + * Amazon ECS-optimized AMI for compute resources. + * + * @default - AWS-managed compute resources + */ + readonly computeResources?: ComputeResources; + + /** + * The state of the compute environment. If the state is set to true, then the compute + * environment accepts jobs from a queue and can scale out automatically based on queues. + * + * @default true + */ + readonly enabled?: boolean; + + /** + * The IAM role used by Batch to make calls to other AWS services on your behalf for managing + * the resources that you use with the service. By default, this role is created for you using + * the AWS managed service policy for Batch. + * + * @link https://docs.aws.amazon.com/batch/latest/userguide/service_IAM_role.html + * + * @default - Role using the 'service-role/AWSBatchServiceRole' policy. + */ + readonly serviceRole?: iam.IRole, + + /** + * Determines if AWS should manage the allocation of compute resources for processing jobs. + * If set to false, then you are in charge of providing the compute resource details. + * + * @default true + */ + readonly managed?: boolean; +} + +/** + * Properties of a compute environment. + */ +export interface IComputeEnvironment extends IResource { + /** + * The ARN of this compute environment. + * + * @attribute + */ + readonly computeEnvironmentArn: string; + + /** + * The name of this compute environment. + * + * @attribute + */ + readonly computeEnvironmentName: string; +} + +/** + * Batch Compute Environment. + * + * Defines a batch compute environment to run batch jobs on. + */ +export class ComputeEnvironment extends Resource implements IComputeEnvironment { + /** + * Fetches an existing batch compute environment by its amazon resource name. + * + * @param scope + * @param id + * @param computeEnvironmentArn + */ + public static fromComputeEnvironmentArn(scope: Construct, id: string, computeEnvironmentArn: string): IComputeEnvironment { + const stack = Stack.of(scope); + const computeEnvironmentName = stack.parseArn(computeEnvironmentArn).resourceName!; + + class Import extends Resource implements IComputeEnvironment { + public readonly computeEnvironmentArn = computeEnvironmentArn; + public readonly computeEnvironmentName = computeEnvironmentName; + } + + return new Import(scope, id); + } + + /** + * The ARN of this compute environment. + * + * @attribute + */ + public readonly computeEnvironmentArn: string; + + /** + * The name of this compute environment. + * + * @attribute + */ + public readonly computeEnvironmentName: string; + + constructor(scope: Construct, id: string, props: ComputeEnvironmentProps = { enabled: true, managed: true }) { + super(scope, id, { + physicalName: props.computeEnvironmentName, + }); + + this.validateProps(props); + + const spotFleetRole = this.getSpotFleetRole(props); + let computeResources: CfnComputeEnvironment.ComputeResourcesProperty | undefined; + + // Only allow compute resources to be set when using UNMANAGED type + if (props.computeResources && !this.isManaged(props)) { + computeResources = { + allocationStrategy: props.allocationStrategy || AllocationStrategy.BEST_FIT, + bidPercentage: props.computeResources.bidPercentage, + desiredvCpus: props.computeResources.desiredvCpus, + ec2KeyPair: props.computeResources.ec2KeyPair, + imageId: props.computeResources.image && props.computeResources.image.getImage(this).imageId, + instanceRole: props.computeResources.instanceRole + ? props.computeResources.instanceRole.roleArn + : new iam.Role(this, 'Resource-Instance-Role', { + assumedBy: new iam.ServicePrincipal('batch.amazonaws.com'), + }).roleArn, + instanceTypes: this.buildInstanceTypes(props.computeResources.instanceTypes), + maxvCpus: props.computeResources.maxvCpus || 256, + minvCpus: props.computeResources.minvCpus || 0, + securityGroupIds: this.buildSecurityGroupIds(props.computeResources.vpc, props.computeResources.securityGroups), + spotIamFleetRole: spotFleetRole ? spotFleetRole.roleArn : undefined, + subnets: props.computeResources.vpc.selectSubnets(props.computeResources.vpcSubnets).subnetIds, + tags: props.computeResources.computeResourcesTags, + type: props.computeResources.type || ComputeResourceType.ON_DEMAND, + }; + } + + const computeEnvironment = new CfnComputeEnvironment(this, 'Resource', { + computeEnvironmentName: this.physicalName, + computeResources, + serviceRole: props.serviceRole + ? props.serviceRole.roleArn + : new iam.Role(this, 'Resource-Service-Instance-Role', { + managedPolicies: [ + iam.ManagedPolicy.fromAwsManagedPolicyName('service-role/AWSBatchServiceRole'), + ], + assumedBy: new iam.ServicePrincipal('batch.amazonaws.com'), + }).roleArn, + state: props.enabled === undefined ? 'ENABLED' : (props.enabled ? 'ENABLED' : 'DISABLED'), + type: this.isManaged(props) ? 'UNMANAGED' : 'MANAGED', + }); + + if (props.computeResources && props.computeResources.vpc) { + this.node.addDependency(props.computeResources.vpc); + } + + this.computeEnvironmentArn = this.getResourceArnAttribute(computeEnvironment.ref, { + service: 'batch', + resource: 'compute-environment', + resourceName: this.physicalName, + }); + this.computeEnvironmentName = this.getResourceNameAttribute(computeEnvironment.ref); + } + + private isManaged(props: ComputeEnvironmentProps): boolean { + return props.managed === undefined ? true : props.managed; + } + + /** + * Validates the properties provided for a new batch compute environment. + */ + private validateProps(props: ComputeEnvironmentProps) { + if (props === undefined) { + return; + } + + if (this.isManaged(props) && props.computeResources !== undefined) { + throw new Error('It is not allowed to set computeResources on an AWS managed compute environment'); + } + + if (!this.isManaged(props) && props.computeResources === undefined) { + throw new Error('computeResources is missing but required on an unmanaged compute environment'); + } + + // Setting a bid percentage is only allowed on SPOT resources + + // Cannot use SPOT_CAPACITY_OPTIMIZED when using ON_DEMAND + if (props.computeResources) { + if (props.computeResources.type === ComputeResourceType.ON_DEMAND) { + // VALIDATE FOR ON_DEMAND + + // Bid percentage is not allowed + if (props.computeResources.bidPercentage !== undefined) { + throw new Error('Setting the bid percentage is only allowed for SPOT type resources on a batch compute environment'); + } + + // SPOT_CAPACITY_OPTIMIZED allocation is not allowed + if (props.allocationStrategy && props.allocationStrategy === AllocationStrategy.SPOT_CAPACITY_OPTIMIZED) { + throw new Error('The SPOT_CAPACITY_OPTIMIZED allocation strategy is only allowed if the environment is a SPOT type compute environment'); + } + } else { + // VALIDATE FOR SPOT + + // Bid percentage must be from 0 - 100 + if (props.computeResources.bidPercentage !== undefined && + (props.computeResources.bidPercentage < 0 || props.computeResources.bidPercentage > 100)) { + throw new Error('Bid percentage can only be a value between 0 and 100'); + } + } + + if (props.computeResources.minvCpus) { + // minvCpus cannot be less than 0 + if (props.computeResources.minvCpus < 0) { + throw new Error('Minimum vCpus for a batch compute environment cannot be less than 0'); + } + + // minvCpus cannot exceed max vCpus + if (props.computeResources.maxvCpus && + props.computeResources.minvCpus > props.computeResources.maxvCpus) { + throw new Error('Minimum vCpus cannot be greater than the maximum vCpus'); + } + } + } + } + + private buildInstanceTypes(instanceTypes?: ec2.InstanceType[]): string[] { + if (instanceTypes === undefined) { + return [ + 'optimal', + ]; + } + + return instanceTypes.map((type: ec2.InstanceType) => type.toString()); + } + + private buildSecurityGroupIds(vpc: ec2.IVpc, securityGroups?: ec2.ISecurityGroup[]): string[] | undefined { + if (securityGroups === undefined) { + return [ + new ec2.SecurityGroup(this, 'Resource-Security-Group', { vpc }).securityGroupId, + ]; + } + + return securityGroups.map((group: ec2.ISecurityGroup) => group.securityGroupId); + } + + /** + * Generates an AWS IAM role for provisioning spotfleet resources + * if the allocation strategy is set to BEST_FIT or not defined. + * + * @param props - the compute environment construct properties + */ + private getSpotFleetRole(props: ComputeEnvironmentProps): iam.IRole | undefined { + if (props.allocationStrategy && props.allocationStrategy !== AllocationStrategy.BEST_FIT) { + return undefined; + } + + if (props.computeResources) { + if (props.computeResources.spotFleetRole) { + return props.computeResources.spotFleetRole; + } else if (props.computeResources.type === ComputeResourceType.SPOT) { + return iam.Role.fromRoleArn(this, 'Resource-SpotFleet-Role', + `arn${Aws.PARTITION}iam::${this.stack.account}:role/aws-service-role/spotfleet.amazonaws.com/AWSServiceRoleForEC2SpotFleet`); + } + } + + return undefined; + } +} diff --git a/packages/@aws-cdk/aws-batch/lib/index.ts b/packages/@aws-cdk/aws-batch/lib/index.ts index 5f0b6784e8e2a..251be8901a3ea 100644 --- a/packages/@aws-cdk/aws-batch/lib/index.ts +++ b/packages/@aws-cdk/aws-batch/lib/index.ts @@ -1,2 +1,5 @@ // AWS::Batch CloudFormation Resources: export * from './batch.generated'; +export * from './compute-environment'; +export * from './job-definition'; +export * from './job-queue'; diff --git a/packages/@aws-cdk/aws-batch/lib/job-definition-image-config.ts b/packages/@aws-cdk/aws-batch/lib/job-definition-image-config.ts new file mode 100644 index 0000000000000..6d8a4b18bca43 --- /dev/null +++ b/packages/@aws-cdk/aws-batch/lib/job-definition-image-config.ts @@ -0,0 +1,86 @@ +import * as ecs from '@aws-cdk/aws-ecs'; +import * as iam from '@aws-cdk/aws-iam'; +import * as cdk from '@aws-cdk/core'; +import { JobDefinitionContainer } from './job-definition'; + +/** + * TaskDefinitionRole + * + * Defines the required properties of a Batch Job Definition. + */ +interface TaskDefinitionProps { + /** + * Defines the IAM role used when executing this task definition + */ + readonly executionRole: iam.IRole; +} + +/** + * Batch Job Task Definition + * + * Defines a Batch Job Task Definition. The properties of this task definition mirrors + * those of an {@link ecs.ContainerDefinition}. This class is a wrapper on that structure. + */ +class TaskDefinition { + /** + * The IAM role used during execution of the task definition. This IAM role should + * contain the relevant access required to interact with resources your application needs to perform. + */ + public readonly executionRole: iam.IRole; + + constructor(props: TaskDefinitionProps) { + this.executionRole = props.executionRole; + } + + /** + * Internal function to allow the Batch Job task defintion + * to match the CDK requirements of an EC2 task definition. + * + * @internal + */ + // tslint:disable-next-line: no-empty + public _linkContainer() {} + + /** + * Retrieves the execution role for this task definition + */ + public obtainExecutionRole(): iam.IRole { + return this.executionRole; + } +} + +/** + * The configuration for creating a batch container image. + */ +export class JobDefinitionImageConfig { + /** + * Specifies the name of the container image + */ + public readonly imageName: string; + + constructor(scope: cdk.Construct, container: JobDefinitionContainer) { + const config = this.bindImageConfig(scope, container); + + this.imageName = config.imageName; + } + + private bindImageConfig(scope: cdk.Construct, container: JobDefinitionContainer): ecs.ContainerImageConfig { + return container.image.bind(scope, new ecs.ContainerDefinition(scope, 'Resource-Batch-Job-Container-Definition', { + command: container.command, + cpu: container.vcpus, + image: container.image, + environment: container.environment, + linuxParameters: container.linuxParams, + memoryLimitMiB: container.memoryLimitMiB, + privileged: container.privileged, + readonlyRootFilesystem: container.readOnly, + gpuCount: container.gpuCount, + user: container.user, + taskDefinition: new TaskDefinition({ + executionRole: container.jobRole || new iam.LazyRole(scope, 'Resource-Batch-Task-Definition-Role', { + assumedBy: new iam.ServicePrincipal('batch.amazonaws.com') + }), + }) as unknown as ecs.TaskDefinition, + })); + } +} diff --git a/packages/@aws-cdk/aws-batch/lib/job-definition.ts b/packages/@aws-cdk/aws-batch/lib/job-definition.ts new file mode 100644 index 0000000000000..4dad6363e50b5 --- /dev/null +++ b/packages/@aws-cdk/aws-batch/lib/job-definition.ts @@ -0,0 +1,360 @@ +import * as ec2 from '@aws-cdk/aws-ec2'; +import * as ecs from '@aws-cdk/aws-ecs'; +import * as iam from '@aws-cdk/aws-iam'; +import { Construct, Duration, IResource, Resource, Stack } from '@aws-cdk/core'; +import { CfnJobDefinition } from './batch.generated'; +import { JobDefinitionImageConfig } from './job-definition-image-config'; + +/** + * Properties of a job definition container. + */ +export interface JobDefinitionContainer { + /** + * The command that is passed to the container. + * + * If you provide a shell command as a single string, you have to quote command-line arguments. + * + * @default - CMD value built into container image. + */ + readonly command?: string[]; + + /** + * The environment variables to pass to the container. + * + * @default none + */ + readonly environment?: { [key: string]: string }; + + /** + * The image used to start a container. + */ + readonly image: ecs.ContainerImage; + + /** + * The instance type to use for a multi-node parallel job. Currently all node groups in a + * multi-node parallel job must use the same instance type. This parameter is not valid + * for single-node container jobs. + * + * @default - None + */ + readonly instanceType?: ec2.InstanceType; + + /** + * The IAM role that the container can assume for AWS permissions. + * + * @default - An IAM role will created. + */ + readonly jobRole?: iam.IRole; + + /** + * Linux-specific modifications that are applied to the container, such as details for device mappings. + * For now, only the `devices` property is supported. + * + * @default - None will be used. + */ + readonly linuxParams?: ecs.LinuxParameters; + + /** + * The hard limit (in MiB) of memory to present to the container. If your container attempts to exceed + * the memory specified here, the container is killed. You must specify at least 4 MiB of memory for a job. + * + * @default 4 + */ + readonly memoryLimitMiB?: number; + + /** + * The mount points for data volumes in your container. + * + * @default - No mount points will be used. + */ + readonly mountPoints?: ecs.MountPoint[]; + + /** + * When this parameter is true, the container is given elevated privileges on the host container instance (similar to the root user). + * @default false + */ + readonly privileged?: boolean; + + /** + * When this parameter is true, the container is given read-only access to its root file system. + * + * @default false + */ + readonly readOnly?: boolean; + + /** + * The number of physical GPUs to reserve for the container. The number of GPUs reserved for all + * containers in a job should not exceed the number of available GPUs on the compute resource that the job is launched on. + * + * @default - No GPU reservation. + */ + readonly gpuCount?: number; + + /** + * A list of ulimits to set in the container. + * + * @default - No limits. + */ + readonly ulimits?: ecs.Ulimit[]; + + /** + * The user name to use inside the container. + * + * @default - None will be used. + */ + readonly user?: string; + + /** + * The number of vCPUs reserved for the container. Each vCPU is equivalent to + * 1,024 CPU shares. You must specify at least one vCPU. + * + * @default 1 + */ + readonly vcpus?: number; + + /** + * A list of data volumes used in a job. + * + * @default - No data volumes will be used. + */ + readonly volumes?: ecs.Volume[]; +} + +/** + * Construction properties of the {@link JobDefinition} construct. + */ +export interface JobDefinitionProps { + /** + * The name of the job definition. + * + * Up to 128 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed. + * + * @default Cloudformation-generated name + */ + readonly jobDefinitionName?: string; + + /** + * An object with various properties specific to container-based jobs. + */ + readonly container: JobDefinitionContainer; + + /** + * An object with various properties specific to multi-node parallel jobs. + * + * @default - undefined + */ + readonly nodeProps?: IMultiNodeProps; + + /** + * When you submit a job, you can specify parameters that should replace the + * placeholders or override the default job definition parameters. Parameters + * in job submission requests take precedence over the defaults in a job definition. + * This allows you to use the same job definition for multiple jobs that use the same + * format, and programmatically change values in the command at submission time. + * + * @link https://docs.aws.amazon.com/batch/latest/userguide/job_definition_parameters.html + * @default - undefined + */ + readonly parameters?: { [key: string]: string }; + + /** + * The number of times to move a job to the RUNNABLE status. You may specify between 1 and + * 10 attempts. If the value of attempts is greater than one, the job is retried on failure + * the same number of attempts as the value. + * + * @default 1 + */ + readonly retryAttempts?: number; + + /** + * The timeout configuration for jobs that are submitted with this job definition. You can specify + * a timeout duration after which AWS Batch terminates your jobs if they have not finished. + * + * @default - undefined + */ + readonly timeout?: Duration; +} + +/** + * Properties for specifying multi-node properties for compute resources. + */ +export interface IMultiNodeProps { + /** + * Specifies the node index for the main node of a multi-node parallel job. This node index value must be fewer than the number of nodes. + */ + mainNode: number; + + /** + * A list of node ranges and their properties associated with a multi-node parallel job. + */ + rangeProps: INodeRangeProps[]; + + /** + * The number of nodes associated with a multi-node parallel job. + */ + count: number; +} + +/** + * Properties for a multi-node batch job. + */ +export interface INodeRangeProps { + /** + * The container details for the node range. + */ + container: JobDefinitionContainer; + + /** + * The minimum node index value to apply this container definition against. + * + * You may nest node ranges, for example 0:10 and 4:5, in which case the 4:5 range properties override the 0:10 properties. + * + * @default 0 + */ + fromNodeIndex?: number; + + /** + * The maximum node index value to apply this container definition against. If omitted, the highest value is used relative. + * + * to the number of nodes associated with the job. You may nest node ranges, for example 0:10 and 4:5, + * in which case the 4:5 range properties override the 0:10 properties. + * + * @default {@link IMultiNodeprops.count} + */ + toNodeIndex?: number; +} + +/** + * An interface representing a job definition - either a new one, created with the CDK, *using the + * {@link JobDefinition} class, or existing ones, referenced using the {@link JobDefinition.fromJobDefinitionArn} method. + */ +export interface IJobDefinition extends IResource { + /** + * The ARN of this batch job definition. + * + * @attribute + */ + readonly jobDefinitionArn: string; + + /** + * The name of the batch job definition. + * + * @attribute + */ + readonly jobDefinitionName: string; +} + +/** + * Batch Job Definition. + * + * Defines a batch job definition to execute a specific batch job. + */ +export class JobDefinition extends Resource implements IJobDefinition { + /** + * Imports an existing batch job definition by its amazon resource name. + * + * @param scope + * @param id + * @param jobDefinitionArn + */ + public static fromJobDefinitionArn(scope: Construct, id: string, jobDefinitionArn: string): IJobDefinition { + const stack = Stack.of(scope); + const jobDefName = stack.parseArn(jobDefinitionArn).resourceName!; + + class Import extends Resource implements IJobDefinition { + public readonly jobDefinitionArn = jobDefinitionArn; + public readonly jobDefinitionName = jobDefName; + } + + return new Import(scope, id); + } + + public readonly jobDefinitionArn: string; + public readonly jobDefinitionName: string; + private readonly imageConfig: JobDefinitionImageConfig; + + constructor(scope: Construct, id: string, props: JobDefinitionProps) { + super(scope, id, { + physicalName: props.jobDefinitionName, + }); + + this.imageConfig = new JobDefinitionImageConfig(this, props.container); + + const jobDef = new CfnJobDefinition(this, 'Resource', { + jobDefinitionName: props.jobDefinitionName, + containerProperties: this.buildJobContainer(props.container), + type: 'container', + nodeProperties: props.nodeProps + ? { mainNode: props.nodeProps.mainNode, + nodeRangeProperties: this.buildNodeRangeProps(props.nodeProps), + numNodes: props.nodeProps.count } + : undefined, + parameters: props.parameters, + retryStrategy: { + attempts: props.retryAttempts || 1, + }, + timeout: { + attemptDurationSeconds: props.timeout ? props.timeout.toSeconds() : undefined, + }, + }); + + this.jobDefinitionArn = this.getResourceArnAttribute(jobDef.ref, { + service: 'batch', + resource: 'job-definition', + resourceName: this.physicalName, + }); + this.jobDefinitionName = this.getResourceNameAttribute(jobDef.ref); + } + + private deserializeEnvVariables(env?: { [name: string]: string}): CfnJobDefinition.EnvironmentProperty[] | undefined { + const vars = new Array(); + + if (env === undefined) { + return undefined; + } + + Object.keys(env).map((name: string) => { + vars.push({ name, value: env[name] }); + }); + + return vars; + } + + private buildJobContainer(container?: JobDefinitionContainer): CfnJobDefinition.ContainerPropertiesProperty | undefined { + if (container === undefined) { + return undefined; + } + + return { + command: container.command, + environment: this.deserializeEnvVariables(container.environment), + image: this.imageConfig.imageName, + instanceType: container.instanceType && container.instanceType.toString(), + jobRoleArn: container.jobRole && container.jobRole.roleArn, + linuxParameters: container.linuxParams + ? { devices: container.linuxParams.renderLinuxParameters().devices } + : undefined, + memory: container.memoryLimitMiB || 4, + mountPoints: container.mountPoints, + privileged: container.privileged || false, + readonlyRootFilesystem: container.readOnly || false, + ulimits: container.ulimits, + user: container.user, + vcpus: container.vcpus || 1, + volumes: container.volumes, + }; + } + + private buildNodeRangeProps(multiNodeProps: IMultiNodeProps): CfnJobDefinition.NodeRangePropertyProperty[] { + const rangeProps = new Array(); + + for (const prop of multiNodeProps.rangeProps) { + rangeProps.push({ + container: this.buildJobContainer(prop.container), + targetNodes: `${prop.fromNodeIndex || 0}:${prop.toNodeIndex || multiNodeProps.count}`, + }); + } + + return rangeProps; + } +} diff --git a/packages/@aws-cdk/aws-batch/lib/job-queue.ts b/packages/@aws-cdk/aws-batch/lib/job-queue.ts new file mode 100644 index 0000000000000..9e285e45c0ed8 --- /dev/null +++ b/packages/@aws-cdk/aws-batch/lib/job-queue.ts @@ -0,0 +1,139 @@ +import { Construct, IResource, Resource, Stack } from '@aws-cdk/core'; +import { CfnJobQueue } from './batch.generated'; +import { ComputeEnvironment, IComputeEnvironment } from './compute-environment'; + +/** + * Properties for mapping a compute environment to a job queue. + */ +export interface JobQueueComputeEnvironment { + /** + * The batch compute environment to use for processing submitted jobs to this queue. + */ + readonly computeEnvironment: IComputeEnvironment; + + /** + * The order in which this compute environment will be selected for dynamic allocation of resources to process submitted jobs. + */ + readonly order: number; +} + +/** + * Properties of a batch job queue. + */ +export interface JobQueueProps { + /** + * A name for the job queue. + * + * Up to 128 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed. + * + * @default Cloudformation-generated name + */ + readonly jobQueueName?: string; + + /** + * The set of compute environments mapped to a job queue and their order relative to each other. The job scheduler uses this parameter to + * determine which compute environment should execute a given job. Compute environments must be in the VALID state before you can associate them + * with a job queue. You can associate up to three compute environments with a job queue. + * + * @default Default-Compute-Environment + */ + readonly computeEnvironments?: JobQueueComputeEnvironment[]; + + /** + * The priority of the job queue. Job queues with a higher priority (or a higher integer value for the priority parameter) are evaluated first + * when associated with the same compute environment. Priority is determined in descending order, for example, a job queue with a priority value + * of 10 is given scheduling preference over a job queue with a priority value of 1. + * + * @default 1 + */ + readonly priority?: number; + + /** + * The state of the job queue. If set to true, it is able to accept jobs. + * + * @default true + */ + readonly enabled?: boolean; +} + +/** + * Properties of a Job Queue. + */ +export interface IJobQueue extends IResource { + /** + * The ARN of this batch job queue. + * + * @attribute + */ + readonly jobQueueArn: string; + + /** + * A name for the job queue. + * + * Up to 128 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed. + * + * @attribute + */ + readonly jobQueueName: string; +} + +/** + * Batch Job Queue. + * + * Defines a batch job queue to define how submitted batch jobs + * should be ran based on specified batch compute environments. + */ +export class JobQueue extends Resource implements IJobQueue { + /** + * Fetches an existing batch job queue by its amazon resource name. + * + * @param scope + * @param id + * @param jobQueueArn + */ + public static fromJobQueueArn(scope: Construct, id: string, jobQueueArn: string): IJobQueue { + const stack = Stack.of(scope); + const jobQueueName = stack.parseArn(jobQueueArn).resourceName!; + + class Import extends Resource implements IJobQueue { + public readonly jobQueueArn = jobQueueArn; + public readonly jobQueueName = jobQueueName; + } + + return new Import(scope, id); + } + + public readonly jobQueueArn: string; + public readonly jobQueueName: string; + + constructor(scope: Construct, id: string, props: JobQueueProps = {}) { + super(scope, id, { + physicalName: props.jobQueueName, + }); + + const jobQueue = new CfnJobQueue(this, 'Resource', { + computeEnvironmentOrder: props.computeEnvironments + ? props.computeEnvironments.map(cp => ({ + computeEnvironment: cp.computeEnvironment.computeEnvironmentArn, + order: cp.order, + } as CfnJobQueue.ComputeEnvironmentOrderProperty)) + : [ + { + // Get an AWS Managed Compute Environment + computeEnvironment: new ComputeEnvironment(this, 'Resource-Batch-Compute-Environment').computeEnvironmentArn, + order: 1, + }, + ], + jobQueueName: this.physicalName, + priority: props.priority || 1, + state: props.enabled === undefined ? 'ENABLED' : (props.enabled ? 'ENABLED' : 'DISABLED'), + }); + + this.jobQueueArn = this.getResourceArnAttribute(jobQueue.ref, { + service: 'batch', + resource: 'job-queue', + resourceName: this.physicalName, + }); + this.jobQueueName = this.getResourceNameAttribute(jobQueue.ref); + } +} diff --git a/packages/@aws-cdk/aws-batch/package.json b/packages/@aws-cdk/aws-batch/package.json index b689f57179580..eb8af8d12f359 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.25.0", + "version": "0.0.0", "description": "The CDK Construct Library for AWS::Batch", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -67,7 +67,7 @@ "coverageThreshold": { "global": { "branches": 60, - "statements": 80 + "statements": 60 } }, "collectCoverage": true, @@ -79,17 +79,27 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", + "jest": "^24.9.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-ecr": "0.0.0", + "@aws-cdk/aws-ecs": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-ecr": "0.0.0", + "@aws-cdk/aws-ecs": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-batch/test/compute-environment.test.ts b/packages/@aws-cdk/aws-batch/test/compute-environment.test.ts new file mode 100644 index 0000000000000..18cd77e5f3b15 --- /dev/null +++ b/packages/@aws-cdk/aws-batch/test/compute-environment.test.ts @@ -0,0 +1,395 @@ +import { expect, haveResource, haveResourceLike, ResourcePart } from '@aws-cdk/assert'; +import '@aws-cdk/assert/jest'; +import * as ec2 from '@aws-cdk/aws-ec2'; +import * as ecs from '@aws-cdk/aws-ecs'; +import * as iam from '@aws-cdk/aws-iam'; +import * as cdk from '@aws-cdk/core'; +import { throws } from 'assert'; +import * as batch from '../lib'; + +describe('Batch Compute Evironment', () => { + let expectedManagedDefaultComputeProps: any; + let defaultServiceRole: any; + + let stack: cdk.Stack; + let vpc: ec2.Vpc; + + beforeEach(() => { + // GIVEN + stack = new cdk.Stack(); + vpc = new ec2.Vpc(stack, 'test-vpc'); + + defaultServiceRole = { + ServiceRole: { + 'Fn::GetAtt': [ + 'testcomputeenvResourceServiceInstanceRole105069A5', + 'Arn' + ], + }, + }; + + expectedManagedDefaultComputeProps = (overrides: any) => { + return { + ComputeResources: { + AllocationStrategy: batch.AllocationStrategy.BEST_FIT, + InstanceRole: { + 'Fn::GetAtt': [ + 'testcomputeenvResourceInstanceRole7FD819B9', + 'Arn' + ] + }, + InstanceTypes: [ + 'optimal' + ], + MaxvCpus: 256, + MinvCpus: 0, + Subnets: [ + { + Ref: 'testvpcPrivateSubnet1Subnet865FB50A' + }, + { + Ref: 'testvpcPrivateSubnet2Subnet23D3396F' + } + ], + Type: batch.ComputeResourceType.ON_DEMAND, + ...overrides, + } + }; + }; + }); + + describe('when validating props', () => { + test('should deny setting compute resources when using type managed', () => { + // THEN + throws(() => { + // WHEN + new batch.ComputeEnvironment(stack, 'test-compute-env', { + computeResources: { + vpc, + }, + }); + }); + }); + + test('should deny if creating an unmanged environment with no provided compute resource props', () => { + // THEN + throws(() => { + // WHEN + new batch.ComputeEnvironment(stack, 'test-compute-env', { + managed: false, + }); + }); + }); + }); + + describe('using spot resources', () => { + test('should provide a spotfleet role if one is not given', () => { + // WHEN + new batch.ComputeEnvironment(stack, 'test-compute-env', { + managed: false, + computeResources: { + type: batch.ComputeResourceType.SPOT, + vpc, + }, + }); + + // THEN + expect(stack).to(haveResourceLike('AWS::Batch::ComputeEnvironment', { + Type: 'MANAGED', + ...expectedManagedDefaultComputeProps({ + Type: batch.ComputeResourceType.SPOT, + SpotIamFleetRole: { + 'Fn::Join': [ + '', + [ + 'arn', + { + Ref: 'AWS::Partition' + }, + 'iam::', + { + Ref: 'AWS::AccountId' + }, + ':role/aws-service-role/spotfleet.amazonaws.com/AWSServiceRoleForEC2SpotFleet', + ], + ], + }, + }), + }, ResourcePart.Properties)); + }); + + describe('with a bid percentage', () => { + test('should deny my bid if set below 0', () => { + // THEN + throws(() => { + // WHEN + new batch.ComputeEnvironment(stack, 'test-compute-env', { + managed: false, + computeResources: { + vpc, + type: batch.ComputeResourceType.SPOT, + bidPercentage: -1, + }, + }); + }); + }); + + test('should deny my bid if above 100', () => { + // THEN + throws(() => { + // WHEN + new batch.ComputeEnvironment(stack, 'test-compute-env', { + managed: false, + computeResources: { + vpc, + type: batch.ComputeResourceType.SPOT, + bidPercentage: 101, + }, + }); + }); + }); + }); + }); + + describe('with properties specified', () => { + test('renders the correct cloudformation properties', () => { + // WHEN + const props = { + allocationStrategy: batch.AllocationStrategy.BEST_FIT, + computeEnvironmentName: 'my-test-compute-env', + computeResources: { + vpc, + computeResourcesTags: new cdk.Tag('foo', 'bar'), + desiredvCpus: 1, + ec2KeyPair: 'my-key-pair', + image: new ecs.EcsOptimizedAmi({ + generation: ec2.AmazonLinuxGeneration.AMAZON_LINUX_2, + hardwareType: ecs.AmiHardwareType.STANDARD, + }), + instanceRole: new iam.Role(stack, 'test-compute-env-instance-role', { + assumedBy: new iam.ServicePrincipal('batch.amazonaws.com'), + }), + instanceTypes: [ + ec2.InstanceType.of(ec2.InstanceClass.T2, ec2.InstanceSize.MICRO), + ], + maxvCpus: 4, + minvCpus: 1, + securityGroups: [ + new ec2.SecurityGroup(stack, 'test-sg', { + vpc, + allowAllOutbound: true, + }), + ], + type: batch.ComputeResourceType.ON_DEMAND, + vpcSubnets: { + subnetType: ec2.SubnetType.PRIVATE, + }, + } as batch.ComputeResources, + enabled: false, + managed: false, + }; + + new batch.ComputeEnvironment(stack, 'test-compute-env', props); + + // THEN + expect(stack).to(haveResourceLike('AWS::Batch::ComputeEnvironment', { + ComputeEnvironmentName: 'my-test-compute-env', + Type: 'MANAGED', + State: 'DISABLED', + ServiceRole: { + 'Fn::GetAtt': [ + 'testcomputeenvResourceServiceInstanceRole105069A5', + 'Arn' + ], + }, + ComputeResources: { + AllocationStrategy: batch.AllocationStrategy.BEST_FIT, + DesiredvCpus: props.computeResources.desiredvCpus, + Ec2KeyPair: props.computeResources.ec2KeyPair, + ImageId: { + Ref: 'SsmParameterValueawsserviceecsoptimizedamiamazonlinux2recommendedimageidC96584B6F00A464EAD1953AFF4B05118Parameter' + }, + InstanceRole: { + 'Fn::GetAtt': [ + props.computeResources.instanceRole ? `${props.computeResources.instanceRole.node.uniqueId}F3B86D94` : '', + 'Arn' + ] + }, + InstanceTypes: [ + props.computeResources.instanceTypes ? props.computeResources.instanceTypes[0].toString() : '', + ], + MaxvCpus: props.computeResources.maxvCpus, + MinvCpus: props.computeResources.minvCpus, + SecurityGroupIds: [ + { + 'Fn::GetAtt': [ + 'testsg872EB48A', + 'GroupId' + ] + } + ], + Subnets: [ + { + Ref: `${vpc.node.uniqueId}PrivateSubnet1Subnet865FB50A` + }, + { + Ref: `${vpc.node.uniqueId}PrivateSubnet2Subnet23D3396F` + } + ], + Tags: { + key: 'foo', + props: {}, + defaultPriority: 100, + value: 'bar' + }, + Type: 'EC2' + }, + }, ResourcePart.Properties)); + }); + + describe('with no allocation strategy specified', () => { + test('should default to a best_fit strategy', () => { + // WHEN + new batch.ComputeEnvironment(stack, 'test-compute-env', { + managed: false, + computeResources: { + vpc, + }, + }); + + // THEN + expect(stack).to(haveResourceLike('AWS::Batch::ComputeEnvironment', { + Type: 'MANAGED', + ServiceRole: { + 'Fn::GetAtt': [ + 'testcomputeenvResourceServiceInstanceRole105069A5', + 'Arn' + ], + }, + }, ResourcePart.Properties)); + }); + }); + + describe('with a min vcpu value', () => { + test('should deny less than 0', () => { + // THEN + throws(() => { + // WHEN + new batch.ComputeEnvironment(stack, 'test-compute-env', { + computeResources: { + vpc, + minvCpus: -1, + }, + }); + }); + }); + + test('cannot be greater than the max vcpu value', () => { + // THEN + throws(() => { + // WHEN + new batch.ComputeEnvironment(stack, 'test-compute-env', { + computeResources: { + vpc, + minvCpus: 2, + maxvCpus: 1, + }, + }); + }); + }); + }); + + describe('with no min vcpu value provided', () => { + test('should default to 0', () => { + // WHEN + new batch.ComputeEnvironment(stack, 'test-compute-env', { + managed: false, + computeResources: { + vpc, + }, + }); + + // THEN + expect(stack).to(haveResourceLike('AWS::Batch::ComputeEnvironment', { + ...defaultServiceRole, + ...expectedManagedDefaultComputeProps({ + MinvCpus: 0, + }), + }, ResourcePart.Properties)); + }); + }); + + describe('with no max vcpu value provided', () => { + test('should default to 256', () => { + // WHEN + new batch.ComputeEnvironment(stack, 'test-compute-env', { + managed: false, + computeResources: { + vpc, + }, + }); + + // THEN + expect(stack).to(haveResourceLike('AWS::Batch::ComputeEnvironment', { + ...expectedManagedDefaultComputeProps({ + MaxvCpus: 256, + }), + }, ResourcePart.Properties)); + }); + }); + + describe('with no instance role specified', () => { + test('should generate a role for me', () => { + // WHEN + new batch.ComputeEnvironment(stack, 'test-compute-env', { + managed: false, + computeResources: { + vpc, + }, + }); + + // THEN + expect(stack).to(haveResource('AWS::Batch::ComputeEnvironment')); + expect(stack).to(haveResource('AWS::IAM::Role')); + }); + }); + + describe('with no instance type defined', () => { + test('should default to optimal matching', () => { + // WHEN + new batch.ComputeEnvironment(stack, 'test-compute-env', { + managed: false, + computeResources: { + vpc, + }, + }); + + // THEN + expect(stack).to(haveResourceLike('AWS::Batch::ComputeEnvironment', { + ...expectedManagedDefaultComputeProps({ + InstanceTypes: [ 'optimal' ], + }), + }, ResourcePart.Properties)); + }); + }); + + describe('with no type specified', () => { + test('should default to EC2', () => { + // WHEN + new batch.ComputeEnvironment(stack, 'test-compute-env', { + managed: false, + computeResources: { + vpc, + }, + }); + + // THEN + expect(stack).to(haveResourceLike('AWS::Batch::ComputeEnvironment', { + ...expectedManagedDefaultComputeProps({ + Type: batch.ComputeResourceType.ON_DEMAND, + }), + }, ResourcePart.Properties)); + }); + }); + }); +}); diff --git a/packages/@aws-cdk/aws-batch/test/integ.batch.expected.json b/packages/@aws-cdk/aws-batch/test/integ.batch.expected.json new file mode 100644 index 0000000000000..7c367e0d37a08 --- /dev/null +++ b/packages/@aws-cdk/aws-batch/test/integ.batch.expected.json @@ -0,0 +1,1195 @@ +{ + "Resources": { + "vpcA2121C38": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "batch-stack/vpc" + } + ] + } + }, + "vpcPublicSubnet1Subnet2E65531E": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "CidrBlock": "10.0.0.0/19", + "VpcId": { + "Ref": "vpcA2121C38" + }, + "AvailabilityZone": "test-region-1a", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "Name", + "Value": "batch-stack/vpc/PublicSubnet1" + }, + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + } + ] + } + }, + "vpcPublicSubnet1RouteTable48A2DF9B": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "vpcA2121C38" + }, + "Tags": [ + { + "Key": "Name", + "Value": "batch-stack/vpc/PublicSubnet1" + } + ] + } + }, + "vpcPublicSubnet1RouteTableAssociation5D3F4579": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "vpcPublicSubnet1RouteTable48A2DF9B" + }, + "SubnetId": { + "Ref": "vpcPublicSubnet1Subnet2E65531E" + } + } + }, + "vpcPublicSubnet1DefaultRoute10708846": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "vpcPublicSubnet1RouteTable48A2DF9B" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "vpcIGWE57CBDCA" + } + }, + "DependsOn": [ + "vpcVPCGW7984C166" + ] + }, + "vpcPublicSubnet1EIPDA49DCBE": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "batch-stack/vpc/PublicSubnet1" + } + ] + } + }, + "vpcPublicSubnet1NATGateway9C16659E": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "vpcPublicSubnet1EIPDA49DCBE", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "vpcPublicSubnet1Subnet2E65531E" + }, + "Tags": [ + { + "Key": "Name", + "Value": "batch-stack/vpc/PublicSubnet1" + } + ] + } + }, + "vpcPublicSubnet2Subnet009B674F": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "CidrBlock": "10.0.32.0/19", + "VpcId": { + "Ref": "vpcA2121C38" + }, + "AvailabilityZone": "test-region-1b", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "Name", + "Value": "batch-stack/vpc/PublicSubnet2" + }, + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + } + ] + } + }, + "vpcPublicSubnet2RouteTableEB40D4CB": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "vpcA2121C38" + }, + "Tags": [ + { + "Key": "Name", + "Value": "batch-stack/vpc/PublicSubnet2" + } + ] + } + }, + "vpcPublicSubnet2RouteTableAssociation21F81B59": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "vpcPublicSubnet2RouteTableEB40D4CB" + }, + "SubnetId": { + "Ref": "vpcPublicSubnet2Subnet009B674F" + } + } + }, + "vpcPublicSubnet2DefaultRouteA1EC0F60": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "vpcPublicSubnet2RouteTableEB40D4CB" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "vpcIGWE57CBDCA" + } + }, + "DependsOn": [ + "vpcVPCGW7984C166" + ] + }, + "vpcPublicSubnet2EIP9B3743B1": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "batch-stack/vpc/PublicSubnet2" + } + ] + } + }, + "vpcPublicSubnet2NATGateway9B8AE11A": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "vpcPublicSubnet2EIP9B3743B1", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "vpcPublicSubnet2Subnet009B674F" + }, + "Tags": [ + { + "Key": "Name", + "Value": "batch-stack/vpc/PublicSubnet2" + } + ] + } + }, + "vpcPublicSubnet3Subnet11B92D7C": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "CidrBlock": "10.0.64.0/19", + "VpcId": { + "Ref": "vpcA2121C38" + }, + "AvailabilityZone": "test-region-1c", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "Name", + "Value": "batch-stack/vpc/PublicSubnet3" + }, + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + } + ] + } + }, + "vpcPublicSubnet3RouteTableA3C00665": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "vpcA2121C38" + }, + "Tags": [ + { + "Key": "Name", + "Value": "batch-stack/vpc/PublicSubnet3" + } + ] + } + }, + "vpcPublicSubnet3RouteTableAssociationD102D1C4": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "vpcPublicSubnet3RouteTableA3C00665" + }, + "SubnetId": { + "Ref": "vpcPublicSubnet3Subnet11B92D7C" + } + } + }, + "vpcPublicSubnet3DefaultRoute3F356A11": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "vpcPublicSubnet3RouteTableA3C00665" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "vpcIGWE57CBDCA" + } + }, + "DependsOn": [ + "vpcVPCGW7984C166" + ] + }, + "vpcPublicSubnet3EIP2C3B9D91": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "batch-stack/vpc/PublicSubnet3" + } + ] + } + }, + "vpcPublicSubnet3NATGateway82F6CA9E": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "vpcPublicSubnet3EIP2C3B9D91", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "vpcPublicSubnet3Subnet11B92D7C" + }, + "Tags": [ + { + "Key": "Name", + "Value": "batch-stack/vpc/PublicSubnet3" + } + ] + } + }, + "vpcPrivateSubnet1Subnet934893E8": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "CidrBlock": "10.0.96.0/19", + "VpcId": { + "Ref": "vpcA2121C38" + }, + "AvailabilityZone": "test-region-1a", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "Name", + "Value": "batch-stack/vpc/PrivateSubnet1" + }, + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + } + ] + } + }, + "vpcPrivateSubnet1RouteTableB41A48CC": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "vpcA2121C38" + }, + "Tags": [ + { + "Key": "Name", + "Value": "batch-stack/vpc/PrivateSubnet1" + } + ] + } + }, + "vpcPrivateSubnet1RouteTableAssociation67945127": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "vpcPrivateSubnet1RouteTableB41A48CC" + }, + "SubnetId": { + "Ref": "vpcPrivateSubnet1Subnet934893E8" + } + } + }, + "vpcPrivateSubnet1DefaultRoute1AA8E2E5": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "vpcPrivateSubnet1RouteTableB41A48CC" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "vpcPublicSubnet1NATGateway9C16659E" + } + } + }, + "vpcPrivateSubnet2Subnet7031C2BA": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "CidrBlock": "10.0.128.0/19", + "VpcId": { + "Ref": "vpcA2121C38" + }, + "AvailabilityZone": "test-region-1b", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "Name", + "Value": "batch-stack/vpc/PrivateSubnet2" + }, + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + } + ] + } + }, + "vpcPrivateSubnet2RouteTable7280F23E": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "vpcA2121C38" + }, + "Tags": [ + { + "Key": "Name", + "Value": "batch-stack/vpc/PrivateSubnet2" + } + ] + } + }, + "vpcPrivateSubnet2RouteTableAssociation007E94D3": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "vpcPrivateSubnet2RouteTable7280F23E" + }, + "SubnetId": { + "Ref": "vpcPrivateSubnet2Subnet7031C2BA" + } + } + }, + "vpcPrivateSubnet2DefaultRouteB0E07F99": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "vpcPrivateSubnet2RouteTable7280F23E" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "vpcPublicSubnet2NATGateway9B8AE11A" + } + } + }, + "vpcPrivateSubnet3Subnet985AC459": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "CidrBlock": "10.0.160.0/19", + "VpcId": { + "Ref": "vpcA2121C38" + }, + "AvailabilityZone": "test-region-1c", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "Name", + "Value": "batch-stack/vpc/PrivateSubnet3" + }, + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + } + ] + } + }, + "vpcPrivateSubnet3RouteTable24DA79A0": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "vpcA2121C38" + }, + "Tags": [ + { + "Key": "Name", + "Value": "batch-stack/vpc/PrivateSubnet3" + } + ] + } + }, + "vpcPrivateSubnet3RouteTableAssociationC58B3C2C": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "vpcPrivateSubnet3RouteTable24DA79A0" + }, + "SubnetId": { + "Ref": "vpcPrivateSubnet3Subnet985AC459" + } + } + }, + "vpcPrivateSubnet3DefaultRoute30C45F47": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "vpcPrivateSubnet3RouteTable24DA79A0" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "vpcPublicSubnet3NATGateway82F6CA9E" + } + } + }, + "vpcIGWE57CBDCA": { + "Type": "AWS::EC2::InternetGateway", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "batch-stack/vpc" + } + ] + } + }, + "vpcVPCGW7984C166": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "VpcId": { + "Ref": "vpcA2121C38" + }, + "InternetGatewayId": { + "Ref": "vpcIGWE57CBDCA" + } + } + }, + "batchmanagedcomputeenvResourceServiceInstanceRole3A9DC7D6": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "batch.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSBatchServiceRole" + ] + ] + } + ] + } + }, + "batchmanagedcomputeenv1AA975A9": { + "Type": "AWS::Batch::ComputeEnvironment", + "Properties": { + "ServiceRole": { + "Fn::GetAtt": [ + "batchmanagedcomputeenvResourceServiceInstanceRole3A9DC7D6", + "Arn" + ] + }, + "Type": "UNMANAGED", + "State": "ENABLED" + } + }, + "batchdemandcomputeenvResourceInstanceRole8989496E": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "batch.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + }, + "DependsOn": [ + "vpcIGWE57CBDCA", + "vpcPrivateSubnet1DefaultRoute1AA8E2E5", + "vpcPrivateSubnet1RouteTableB41A48CC", + "vpcPrivateSubnet1RouteTableAssociation67945127", + "vpcPrivateSubnet1Subnet934893E8", + "vpcPrivateSubnet2DefaultRouteB0E07F99", + "vpcPrivateSubnet2RouteTable7280F23E", + "vpcPrivateSubnet2RouteTableAssociation007E94D3", + "vpcPrivateSubnet2Subnet7031C2BA", + "vpcPrivateSubnet3DefaultRoute30C45F47", + "vpcPrivateSubnet3RouteTable24DA79A0", + "vpcPrivateSubnet3RouteTableAssociationC58B3C2C", + "vpcPrivateSubnet3Subnet985AC459", + "vpcPublicSubnet1DefaultRoute10708846", + "vpcPublicSubnet1EIPDA49DCBE", + "vpcPublicSubnet1NATGateway9C16659E", + "vpcPublicSubnet1RouteTable48A2DF9B", + "vpcPublicSubnet1RouteTableAssociation5D3F4579", + "vpcPublicSubnet1Subnet2E65531E", + "vpcPublicSubnet2DefaultRouteA1EC0F60", + "vpcPublicSubnet2EIP9B3743B1", + "vpcPublicSubnet2NATGateway9B8AE11A", + "vpcPublicSubnet2RouteTableEB40D4CB", + "vpcPublicSubnet2RouteTableAssociation21F81B59", + "vpcPublicSubnet2Subnet009B674F", + "vpcPublicSubnet3DefaultRoute3F356A11", + "vpcPublicSubnet3EIP2C3B9D91", + "vpcPublicSubnet3NATGateway82F6CA9E", + "vpcPublicSubnet3RouteTableA3C00665", + "vpcPublicSubnet3RouteTableAssociationD102D1C4", + "vpcPublicSubnet3Subnet11B92D7C", + "vpcA2121C38", + "vpcVPCGW7984C166" + ] + }, + "batchdemandcomputeenvResourceSecurityGroup64711D4D": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "batch-stack/batch-demand-compute-env/Resource-Security-Group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": { + "Ref": "vpcA2121C38" + } + }, + "DependsOn": [ + "vpcIGWE57CBDCA", + "vpcPrivateSubnet1DefaultRoute1AA8E2E5", + "vpcPrivateSubnet1RouteTableB41A48CC", + "vpcPrivateSubnet1RouteTableAssociation67945127", + "vpcPrivateSubnet1Subnet934893E8", + "vpcPrivateSubnet2DefaultRouteB0E07F99", + "vpcPrivateSubnet2RouteTable7280F23E", + "vpcPrivateSubnet2RouteTableAssociation007E94D3", + "vpcPrivateSubnet2Subnet7031C2BA", + "vpcPrivateSubnet3DefaultRoute30C45F47", + "vpcPrivateSubnet3RouteTable24DA79A0", + "vpcPrivateSubnet3RouteTableAssociationC58B3C2C", + "vpcPrivateSubnet3Subnet985AC459", + "vpcPublicSubnet1DefaultRoute10708846", + "vpcPublicSubnet1EIPDA49DCBE", + "vpcPublicSubnet1NATGateway9C16659E", + "vpcPublicSubnet1RouteTable48A2DF9B", + "vpcPublicSubnet1RouteTableAssociation5D3F4579", + "vpcPublicSubnet1Subnet2E65531E", + "vpcPublicSubnet2DefaultRouteA1EC0F60", + "vpcPublicSubnet2EIP9B3743B1", + "vpcPublicSubnet2NATGateway9B8AE11A", + "vpcPublicSubnet2RouteTableEB40D4CB", + "vpcPublicSubnet2RouteTableAssociation21F81B59", + "vpcPublicSubnet2Subnet009B674F", + "vpcPublicSubnet3DefaultRoute3F356A11", + "vpcPublicSubnet3EIP2C3B9D91", + "vpcPublicSubnet3NATGateway82F6CA9E", + "vpcPublicSubnet3RouteTableA3C00665", + "vpcPublicSubnet3RouteTableAssociationD102D1C4", + "vpcPublicSubnet3Subnet11B92D7C", + "vpcA2121C38", + "vpcVPCGW7984C166" + ] + }, + "batchdemandcomputeenvResourceServiceInstanceRole8DF7CB96": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "batch.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSBatchServiceRole" + ] + ] + } + ] + }, + "DependsOn": [ + "vpcIGWE57CBDCA", + "vpcPrivateSubnet1DefaultRoute1AA8E2E5", + "vpcPrivateSubnet1RouteTableB41A48CC", + "vpcPrivateSubnet1RouteTableAssociation67945127", + "vpcPrivateSubnet1Subnet934893E8", + "vpcPrivateSubnet2DefaultRouteB0E07F99", + "vpcPrivateSubnet2RouteTable7280F23E", + "vpcPrivateSubnet2RouteTableAssociation007E94D3", + "vpcPrivateSubnet2Subnet7031C2BA", + "vpcPrivateSubnet3DefaultRoute30C45F47", + "vpcPrivateSubnet3RouteTable24DA79A0", + "vpcPrivateSubnet3RouteTableAssociationC58B3C2C", + "vpcPrivateSubnet3Subnet985AC459", + "vpcPublicSubnet1DefaultRoute10708846", + "vpcPublicSubnet1EIPDA49DCBE", + "vpcPublicSubnet1NATGateway9C16659E", + "vpcPublicSubnet1RouteTable48A2DF9B", + "vpcPublicSubnet1RouteTableAssociation5D3F4579", + "vpcPublicSubnet1Subnet2E65531E", + "vpcPublicSubnet2DefaultRouteA1EC0F60", + "vpcPublicSubnet2EIP9B3743B1", + "vpcPublicSubnet2NATGateway9B8AE11A", + "vpcPublicSubnet2RouteTableEB40D4CB", + "vpcPublicSubnet2RouteTableAssociation21F81B59", + "vpcPublicSubnet2Subnet009B674F", + "vpcPublicSubnet3DefaultRoute3F356A11", + "vpcPublicSubnet3EIP2C3B9D91", + "vpcPublicSubnet3NATGateway82F6CA9E", + "vpcPublicSubnet3RouteTableA3C00665", + "vpcPublicSubnet3RouteTableAssociationD102D1C4", + "vpcPublicSubnet3Subnet11B92D7C", + "vpcA2121C38", + "vpcVPCGW7984C166" + ] + }, + "batchdemandcomputeenv6131030A": { + "Type": "AWS::Batch::ComputeEnvironment", + "Properties": { + "ServiceRole": { + "Fn::GetAtt": [ + "batchdemandcomputeenvResourceServiceInstanceRole8DF7CB96", + "Arn" + ] + }, + "Type": "MANAGED", + "ComputeResources": { + "AllocationStrategy": "BEST_FIT", + "InstanceRole": { + "Fn::GetAtt": [ + "batchdemandcomputeenvResourceInstanceRole8989496E", + "Arn" + ] + }, + "InstanceTypes": [ + "optimal" + ], + "MaxvCpus": 256, + "MinvCpus": 0, + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "batchdemandcomputeenvResourceSecurityGroup64711D4D", + "GroupId" + ] + } + ], + "Subnets": [ + { + "Ref": "vpcPrivateSubnet1Subnet934893E8" + }, + { + "Ref": "vpcPrivateSubnet2Subnet7031C2BA" + }, + { + "Ref": "vpcPrivateSubnet3Subnet985AC459" + } + ], + "Type": "EC2" + }, + "State": "ENABLED" + }, + "DependsOn": [ + "vpcIGWE57CBDCA", + "vpcPrivateSubnet1DefaultRoute1AA8E2E5", + "vpcPrivateSubnet1RouteTableB41A48CC", + "vpcPrivateSubnet1RouteTableAssociation67945127", + "vpcPrivateSubnet1Subnet934893E8", + "vpcPrivateSubnet2DefaultRouteB0E07F99", + "vpcPrivateSubnet2RouteTable7280F23E", + "vpcPrivateSubnet2RouteTableAssociation007E94D3", + "vpcPrivateSubnet2Subnet7031C2BA", + "vpcPrivateSubnet3DefaultRoute30C45F47", + "vpcPrivateSubnet3RouteTable24DA79A0", + "vpcPrivateSubnet3RouteTableAssociationC58B3C2C", + "vpcPrivateSubnet3Subnet985AC459", + "vpcPublicSubnet1DefaultRoute10708846", + "vpcPublicSubnet1EIPDA49DCBE", + "vpcPublicSubnet1NATGateway9C16659E", + "vpcPublicSubnet1RouteTable48A2DF9B", + "vpcPublicSubnet1RouteTableAssociation5D3F4579", + "vpcPublicSubnet1Subnet2E65531E", + "vpcPublicSubnet2DefaultRouteA1EC0F60", + "vpcPublicSubnet2EIP9B3743B1", + "vpcPublicSubnet2NATGateway9B8AE11A", + "vpcPublicSubnet2RouteTableEB40D4CB", + "vpcPublicSubnet2RouteTableAssociation21F81B59", + "vpcPublicSubnet2Subnet009B674F", + "vpcPublicSubnet3DefaultRoute3F356A11", + "vpcPublicSubnet3EIP2C3B9D91", + "vpcPublicSubnet3NATGateway82F6CA9E", + "vpcPublicSubnet3RouteTableA3C00665", + "vpcPublicSubnet3RouteTableAssociationD102D1C4", + "vpcPublicSubnet3Subnet11B92D7C", + "vpcA2121C38", + "vpcVPCGW7984C166" + ] + }, + "batchspotcomputeenvResourceInstanceRoleF6188F15": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "batch.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + }, + "DependsOn": [ + "vpcIGWE57CBDCA", + "vpcPrivateSubnet1DefaultRoute1AA8E2E5", + "vpcPrivateSubnet1RouteTableB41A48CC", + "vpcPrivateSubnet1RouteTableAssociation67945127", + "vpcPrivateSubnet1Subnet934893E8", + "vpcPrivateSubnet2DefaultRouteB0E07F99", + "vpcPrivateSubnet2RouteTable7280F23E", + "vpcPrivateSubnet2RouteTableAssociation007E94D3", + "vpcPrivateSubnet2Subnet7031C2BA", + "vpcPrivateSubnet3DefaultRoute30C45F47", + "vpcPrivateSubnet3RouteTable24DA79A0", + "vpcPrivateSubnet3RouteTableAssociationC58B3C2C", + "vpcPrivateSubnet3Subnet985AC459", + "vpcPublicSubnet1DefaultRoute10708846", + "vpcPublicSubnet1EIPDA49DCBE", + "vpcPublicSubnet1NATGateway9C16659E", + "vpcPublicSubnet1RouteTable48A2DF9B", + "vpcPublicSubnet1RouteTableAssociation5D3F4579", + "vpcPublicSubnet1Subnet2E65531E", + "vpcPublicSubnet2DefaultRouteA1EC0F60", + "vpcPublicSubnet2EIP9B3743B1", + "vpcPublicSubnet2NATGateway9B8AE11A", + "vpcPublicSubnet2RouteTableEB40D4CB", + "vpcPublicSubnet2RouteTableAssociation21F81B59", + "vpcPublicSubnet2Subnet009B674F", + "vpcPublicSubnet3DefaultRoute3F356A11", + "vpcPublicSubnet3EIP2C3B9D91", + "vpcPublicSubnet3NATGateway82F6CA9E", + "vpcPublicSubnet3RouteTableA3C00665", + "vpcPublicSubnet3RouteTableAssociationD102D1C4", + "vpcPublicSubnet3Subnet11B92D7C", + "vpcA2121C38", + "vpcVPCGW7984C166" + ] + }, + "batchspotcomputeenvResourceSecurityGroup07B09BF9": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "batch-stack/batch-spot-compute-env/Resource-Security-Group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": { + "Ref": "vpcA2121C38" + } + }, + "DependsOn": [ + "vpcIGWE57CBDCA", + "vpcPrivateSubnet1DefaultRoute1AA8E2E5", + "vpcPrivateSubnet1RouteTableB41A48CC", + "vpcPrivateSubnet1RouteTableAssociation67945127", + "vpcPrivateSubnet1Subnet934893E8", + "vpcPrivateSubnet2DefaultRouteB0E07F99", + "vpcPrivateSubnet2RouteTable7280F23E", + "vpcPrivateSubnet2RouteTableAssociation007E94D3", + "vpcPrivateSubnet2Subnet7031C2BA", + "vpcPrivateSubnet3DefaultRoute30C45F47", + "vpcPrivateSubnet3RouteTable24DA79A0", + "vpcPrivateSubnet3RouteTableAssociationC58B3C2C", + "vpcPrivateSubnet3Subnet985AC459", + "vpcPublicSubnet1DefaultRoute10708846", + "vpcPublicSubnet1EIPDA49DCBE", + "vpcPublicSubnet1NATGateway9C16659E", + "vpcPublicSubnet1RouteTable48A2DF9B", + "vpcPublicSubnet1RouteTableAssociation5D3F4579", + "vpcPublicSubnet1Subnet2E65531E", + "vpcPublicSubnet2DefaultRouteA1EC0F60", + "vpcPublicSubnet2EIP9B3743B1", + "vpcPublicSubnet2NATGateway9B8AE11A", + "vpcPublicSubnet2RouteTableEB40D4CB", + "vpcPublicSubnet2RouteTableAssociation21F81B59", + "vpcPublicSubnet2Subnet009B674F", + "vpcPublicSubnet3DefaultRoute3F356A11", + "vpcPublicSubnet3EIP2C3B9D91", + "vpcPublicSubnet3NATGateway82F6CA9E", + "vpcPublicSubnet3RouteTableA3C00665", + "vpcPublicSubnet3RouteTableAssociationD102D1C4", + "vpcPublicSubnet3Subnet11B92D7C", + "vpcA2121C38", + "vpcVPCGW7984C166" + ] + }, + "batchspotcomputeenvResourceServiceInstanceRole8B0DF5A7": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "batch.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSBatchServiceRole" + ] + ] + } + ] + }, + "DependsOn": [ + "vpcIGWE57CBDCA", + "vpcPrivateSubnet1DefaultRoute1AA8E2E5", + "vpcPrivateSubnet1RouteTableB41A48CC", + "vpcPrivateSubnet1RouteTableAssociation67945127", + "vpcPrivateSubnet1Subnet934893E8", + "vpcPrivateSubnet2DefaultRouteB0E07F99", + "vpcPrivateSubnet2RouteTable7280F23E", + "vpcPrivateSubnet2RouteTableAssociation007E94D3", + "vpcPrivateSubnet2Subnet7031C2BA", + "vpcPrivateSubnet3DefaultRoute30C45F47", + "vpcPrivateSubnet3RouteTable24DA79A0", + "vpcPrivateSubnet3RouteTableAssociationC58B3C2C", + "vpcPrivateSubnet3Subnet985AC459", + "vpcPublicSubnet1DefaultRoute10708846", + "vpcPublicSubnet1EIPDA49DCBE", + "vpcPublicSubnet1NATGateway9C16659E", + "vpcPublicSubnet1RouteTable48A2DF9B", + "vpcPublicSubnet1RouteTableAssociation5D3F4579", + "vpcPublicSubnet1Subnet2E65531E", + "vpcPublicSubnet2DefaultRouteA1EC0F60", + "vpcPublicSubnet2EIP9B3743B1", + "vpcPublicSubnet2NATGateway9B8AE11A", + "vpcPublicSubnet2RouteTableEB40D4CB", + "vpcPublicSubnet2RouteTableAssociation21F81B59", + "vpcPublicSubnet2Subnet009B674F", + "vpcPublicSubnet3DefaultRoute3F356A11", + "vpcPublicSubnet3EIP2C3B9D91", + "vpcPublicSubnet3NATGateway82F6CA9E", + "vpcPublicSubnet3RouteTableA3C00665", + "vpcPublicSubnet3RouteTableAssociationD102D1C4", + "vpcPublicSubnet3Subnet11B92D7C", + "vpcA2121C38", + "vpcVPCGW7984C166" + ] + }, + "batchspotcomputeenv2CE4DFD9": { + "Type": "AWS::Batch::ComputeEnvironment", + "Properties": { + "ServiceRole": { + "Fn::GetAtt": [ + "batchspotcomputeenvResourceServiceInstanceRole8B0DF5A7", + "Arn" + ] + }, + "Type": "MANAGED", + "ComputeResources": { + "AllocationStrategy": "BEST_FIT", + "BidPercentage": 80, + "InstanceRole": { + "Fn::GetAtt": [ + "batchspotcomputeenvResourceInstanceRoleF6188F15", + "Arn" + ] + }, + "InstanceTypes": [ + "optimal" + ], + "MaxvCpus": 256, + "MinvCpus": 0, + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "batchspotcomputeenvResourceSecurityGroup07B09BF9", + "GroupId" + ] + } + ], + "SpotIamFleetRole": { + "Fn::Join": [ + "", + [ + "arn", + { + "Ref": "AWS::Partition" + }, + "iam::", + { + "Ref": "AWS::AccountId" + }, + ":role/aws-service-role/spotfleet.amazonaws.com/AWSServiceRoleForEC2SpotFleet" + ] + ] + }, + "Subnets": [ + { + "Ref": "vpcPrivateSubnet1Subnet934893E8" + }, + { + "Ref": "vpcPrivateSubnet2Subnet7031C2BA" + }, + { + "Ref": "vpcPrivateSubnet3Subnet985AC459" + } + ], + "Type": "SPOT" + }, + "State": "ENABLED" + }, + "DependsOn": [ + "vpcIGWE57CBDCA", + "vpcPrivateSubnet1DefaultRoute1AA8E2E5", + "vpcPrivateSubnet1RouteTableB41A48CC", + "vpcPrivateSubnet1RouteTableAssociation67945127", + "vpcPrivateSubnet1Subnet934893E8", + "vpcPrivateSubnet2DefaultRouteB0E07F99", + "vpcPrivateSubnet2RouteTable7280F23E", + "vpcPrivateSubnet2RouteTableAssociation007E94D3", + "vpcPrivateSubnet2Subnet7031C2BA", + "vpcPrivateSubnet3DefaultRoute30C45F47", + "vpcPrivateSubnet3RouteTable24DA79A0", + "vpcPrivateSubnet3RouteTableAssociationC58B3C2C", + "vpcPrivateSubnet3Subnet985AC459", + "vpcPublicSubnet1DefaultRoute10708846", + "vpcPublicSubnet1EIPDA49DCBE", + "vpcPublicSubnet1NATGateway9C16659E", + "vpcPublicSubnet1RouteTable48A2DF9B", + "vpcPublicSubnet1RouteTableAssociation5D3F4579", + "vpcPublicSubnet1Subnet2E65531E", + "vpcPublicSubnet2DefaultRouteA1EC0F60", + "vpcPublicSubnet2EIP9B3743B1", + "vpcPublicSubnet2NATGateway9B8AE11A", + "vpcPublicSubnet2RouteTableEB40D4CB", + "vpcPublicSubnet2RouteTableAssociation21F81B59", + "vpcPublicSubnet2Subnet009B674F", + "vpcPublicSubnet3DefaultRoute3F356A11", + "vpcPublicSubnet3EIP2C3B9D91", + "vpcPublicSubnet3NATGateway82F6CA9E", + "vpcPublicSubnet3RouteTableA3C00665", + "vpcPublicSubnet3RouteTableAssociationD102D1C4", + "vpcPublicSubnet3Subnet11B92D7C", + "vpcA2121C38", + "vpcVPCGW7984C166" + ] + }, + "batchjobqueueE3C528F2": { + "Type": "AWS::Batch::JobQueue", + "Properties": { + "ComputeEnvironmentOrder": [ + { + "ComputeEnvironment": { + "Ref": "batchmanagedcomputeenv1AA975A9" + }, + "Order": 1 + }, + { + "ComputeEnvironment": { + "Ref": "batchdemandcomputeenv6131030A" + }, + "Order": 2 + }, + { + "ComputeEnvironment": { + "Ref": "batchspotcomputeenv2CE4DFD9" + }, + "Order": 3 + } + ], + "Priority": 1, + "State": "ENABLED" + } + }, + "batchjobrepo4C508C51": { + "Type": "AWS::ECR::Repository", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "batchjobdeffromecrE0E30DAD": { + "Type": "AWS::Batch::JobDefinition", + "Properties": { + "Type": "container", + "ContainerProperties": { + "Image": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "batchjobrepo4C508C51", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "batchjobrepo4C508C51", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "batchjobrepo4C508C51" + }, + ":latest" + ] + ] + }, + "Memory": 4, + "Privileged": false, + "ReadonlyRootFilesystem": false, + "Vcpus": 1 + }, + "RetryStrategy": { + "Attempts": 1 + }, + "Timeout": {} + } + }, + "batchjobdeffrom4007378D": { + "Type": "AWS::Batch::JobDefinition", + "Properties": { + "Type": "container", + "ContainerProperties": { + "Image": "docker/whalesay", + "Memory": 4, + "Privileged": false, + "ReadonlyRootFilesystem": false, + "Vcpus": 1 + }, + "RetryStrategy": { + "Attempts": 1 + }, + "Timeout": {} + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-batch/test/integ.batch.ts b/packages/@aws-cdk/aws-batch/test/integ.batch.ts new file mode 100644 index 0000000000000..c28d7d4f2e159 --- /dev/null +++ b/packages/@aws-cdk/aws-batch/test/integ.batch.ts @@ -0,0 +1,55 @@ +import * as ec2 from '@aws-cdk/aws-ec2'; +import * as ecr from '@aws-cdk/aws-ecr'; +import * as ecs from '@aws-cdk/aws-ecs'; +import * as cdk from '@aws-cdk/core'; +import * as batch from '../lib/'; + +export const app = new cdk.App(); + +const stack = new cdk.Stack(app, 'batch-stack'); + +const vpc = new ec2.Vpc(stack, 'vpc'); + +new batch.JobQueue(stack, 'batch-job-queue', { + computeEnvironments: [ + { + computeEnvironment: new batch.ComputeEnvironment(stack, 'batch-managed-compute-env'), + order: 1, + }, + { + computeEnvironment: new batch.ComputeEnvironment(stack, 'batch-demand-compute-env', { + managed: false, + computeResources: { + type: batch.ComputeResourceType.ON_DEMAND, + vpc, + }, + }), + order: 2, + }, + { + computeEnvironment: new batch.ComputeEnvironment(stack, 'batch-spot-compute-env', { + managed: false, + computeResources: { + type: batch.ComputeResourceType.SPOT, + vpc, + bidPercentage: 80, + }, + }), + order: 3, + }, + ] +}); + +const repo = new ecr.Repository(stack, 'batch-job-repo'); + +new batch.JobDefinition(stack, 'batch-job-def-from-ecr', { + container: { + image: new ecs.EcrImage(repo, 'latest'), + }, +}); + +new batch.JobDefinition(stack, 'batch-job-def-from-', { + container: { + image: ecs.ContainerImage.fromRegistry('docker/whalesay'), + }, +}); diff --git a/packages/@aws-cdk/aws-batch/test/job-definition.test.ts b/packages/@aws-cdk/aws-batch/test/job-definition.test.ts new file mode 100644 index 0000000000000..45cc0c0418ef7 --- /dev/null +++ b/packages/@aws-cdk/aws-batch/test/job-definition.test.ts @@ -0,0 +1,202 @@ +import '@aws-cdk/assert/jest'; +import { ResourcePart } from '@aws-cdk/assert/lib/assertions/have-resource'; +import * as ec2 from '@aws-cdk/aws-ec2'; +import * as ecr from '@aws-cdk/aws-ecr'; +import * as ecs from '@aws-cdk/aws-ecs'; +import * as iam from '@aws-cdk/aws-iam'; +import * as cdk from '@aws-cdk/core'; +import * as batch from '../lib'; + +describe('Batch Job Definition', () => { + let stack: cdk.Stack; + let jobDefProps: batch.JobDefinitionProps; + + beforeEach(() => { + stack = new cdk.Stack(); + + const role = new iam.Role(stack, 'job-role', { + assumedBy: new iam.ServicePrincipal('batch.amazonaws.com'), + }); + + const linuxParams = new ecs.LinuxParameters(stack, 'job-linux-params', { + initProcessEnabled: true, + sharedMemorySize: 1, + }); + + jobDefProps = { + jobDefinitionName: 'test-job', + container: { + command: [ 'echo "Hello World"' ], + environment: { + foo: 'bar', + }, + jobRole: role, + gpuCount: 1, + image: ecs.EcrImage.fromRegistry('docker/whalesay'), + instanceType: ec2.InstanceType.of(ec2.InstanceClass.T2, ec2.InstanceSize.MICRO), + linuxParams, + memoryLimitMiB: 1, + mountPoints: new Array(), + privileged: true, + readOnly: true, + ulimits: new Array(), + user: 'root', + vcpus: 2, + volumes: new Array(), + }, + nodeProps: { + count: 2, + mainNode: 1, + rangeProps: new Array(), + }, + parameters: { + foo: 'bar', + }, + retryAttempts: 2, + timeout: cdk.Duration.seconds(30), + }; + }); + + test('renders the correct cloudformation properties', () => { + // WHEN + new batch.JobDefinition(stack, 'job-def', jobDefProps); + + // THEN + expect(stack).toHaveResourceLike('AWS::Batch::JobDefinition', { + JobDefinitionName: jobDefProps.jobDefinitionName, + ContainerProperties: jobDefProps.container ? { + Command: jobDefProps.container.command, + Environment: [ + { + Name: 'foo', + Value: 'bar', + }, + ], + InstanceType: jobDefProps.container.instanceType ? jobDefProps.container.instanceType.toString() : '', + LinuxParameters: {}, + Memory: jobDefProps.container.memoryLimitMiB, + MountPoints: [], + Privileged: jobDefProps.container.privileged, + ReadonlyRootFilesystem: jobDefProps.container.readOnly, + Ulimits: [], + User: jobDefProps.container.user, + Vcpus: jobDefProps.container.vcpus, + Volumes: [], + } : undefined, + NodeProperties: jobDefProps.nodeProps ? { + MainNode: jobDefProps.nodeProps.mainNode, + NodeRangeProperties: [], + NumNodes: jobDefProps.nodeProps.count, + } : undefined, + Parameters: { + foo: 'bar', + }, + RetryStrategy: { + Attempts: jobDefProps.retryAttempts, + }, + Timeout: { + AttemptDurationSeconds: jobDefProps.timeout ? jobDefProps.timeout.toSeconds() : -1, + }, + Type: 'container', + }, ResourcePart.Properties); + }); + test('can use an ecr image', () => { + // WHEN + const repo = new ecr.Repository(stack, 'image-repo'); + + new batch.JobDefinition(stack, 'job-def', { + container: { + image: ecs.ContainerImage.fromEcrRepository(repo), + }, + }); + + // THEN + expect(stack).toHaveResourceLike('AWS::Batch::JobDefinition', { + ContainerProperties: { + Image: { + 'Fn::Join': [ + '', + [ + { + 'Fn::Select': [ + 4, + { + 'Fn::Split': [ + ':', + { + 'Fn::GetAtt': [ + 'imagerepoD116FAF0', + 'Arn' + ] + } + ] + } + ] + }, + '.dkr.ecr.', + { + 'Fn::Select': [ + 3, + { + 'Fn::Split': [ + ':', + { + 'Fn::GetAtt': [ + 'imagerepoD116FAF0', + 'Arn' + ] + } + ] + } + ] + }, + '.', + { + Ref: 'AWS::URLSuffix' + }, + '/', + { + Ref: 'imagerepoD116FAF0' + }, + ':latest' + ] + ] + }, + Memory: 4, + Privileged: false, + ReadonlyRootFilesystem: false, + Vcpus: 1 + } + }, ResourcePart.Properties); + }); + + test('can use a registry image', () => { + // WHEN + new batch.JobDefinition(stack, 'job-def', { + container: { + image: ecs.ContainerImage.fromRegistry('docker/whalesay'), + }, + }); + + // THEN + expect(stack).toHaveResourceLike('AWS::Batch::JobDefinition', { + ContainerProperties: { + Image: 'docker/whalesay', + Memory: 4, + Privileged: false, + ReadonlyRootFilesystem: false, + Vcpus: 1, + }, + }, ResourcePart.Properties); + }); + + test('can be imported from an ARN', () => { + // WHEN + const importedJob = batch.JobDefinition.fromJobDefinitionArn(stack, 'job-def-clone', + 'arn:aws:batch:us-east-1:123456789012:job-definition/job-def-name:1'); + + // THEN + expect(importedJob.jobDefinitionName).toEqual('job-def-name:1'); + expect(importedJob.jobDefinitionArn).toEqual('arn:aws:batch:us-east-1:123456789012:job-definition/job-def-name:1'); + }); +}); diff --git a/packages/@aws-cdk/aws-batch/test/job-queue.test.ts b/packages/@aws-cdk/aws-batch/test/job-queue.test.ts new file mode 100644 index 0000000000000..d99a6ad82e8fe --- /dev/null +++ b/packages/@aws-cdk/aws-batch/test/job-queue.test.ts @@ -0,0 +1,81 @@ +import { ResourcePart } from '@aws-cdk/assert'; +import '@aws-cdk/assert/jest'; +import * as cdk from '@aws-cdk/core'; +import * as batch from '../lib'; + +describe('Batch Job Queue', () => { + let stack: cdk.Stack; + let computeEnvironment: batch.ComputeEnvironment; + + beforeEach(() => { + stack = new cdk.Stack(); + computeEnvironment = new batch.ComputeEnvironment(stack, 'test-compute-env'); + }); + + it('can be imported from an ARN', () => { + // WHEN + const existingJobQ = new batch.JobQueue(stack, 'test-job-queue', { + priority: 1, + enabled: false, + computeEnvironments: [ + { + computeEnvironment, + order: 1, + } + ], + }); + const jobQFromArn = batch.JobQueue.fromJobQueueArn(stack, 'test-job-queue-from-arn', existingJobQ.jobQueueArn); + + // THEN + expect(jobQFromArn.jobQueueArn).toEqual(existingJobQ.jobQueueArn); + }); + + it('renders the correct cloudformation properties', () => { + // WHEN + const props: batch.JobQueueProps = { + priority: 1, + enabled: false, + computeEnvironments: [ + { + computeEnvironment, + order: 1, + }, + ], + jobQueueName: 'test-job-queue-name' + }; + new batch.JobQueue(stack, 'test-job-queue', props); + + // THEN + expect(stack).toHaveResourceLike('AWS::Batch::JobQueue', { + JobQueueName: props.jobQueueName, + State: props.enabled ? 'ENABLED' : 'DISABLED', + Priority: props.priority, + ComputeEnvironmentOrder: [ + { + ComputeEnvironment: { + Ref: 'testcomputeenv547FFD1A' + }, + Order: 1, + } + ], + }, ResourcePart.Properties); + }); + + it('should have a default queue priority of 1', () => { + // WHEN + new batch.JobQueue(stack, 'test-job-queue', { + enabled: false, + computeEnvironments: [ + { + computeEnvironment, + order: 1, + } + ], + }); + + // THEN + expect(stack).toHaveResourceLike('AWS::Batch::JobQueue', { + Priority: 1, + }, ResourcePart.Properties); + }); +}); diff --git a/packages/@aws-cdk/aws-budgets/package.json b/packages/@aws-cdk/aws-budgets/package.json index 79e79c15bd6cb..e7e568f2c60dc 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 69dca9a90da6a..4d92427360bbd 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.25.0", + "version": "0.0.0", "description": "This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.", "main": "lib/index.js", "directories": { @@ -40,4 +40,4 @@ "nock": "^11.7.0", "ts-jest": "^24.2.0" } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-certificatemanager/package.json b/packages/@aws-cdk/aws-certificatemanager/package.json index 47f6360a20627..21ec9fe778bd6 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-cloudformation": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-route53": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-cloudformation": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-route53": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-cloudformation": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-route53": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-cloudformation": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-route53": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-cloud9/package.json b/packages/@aws-cdk/aws-cloud9/package.json index 84778614efdbc..8356868cd14e1 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-cloudformation/package.json b/packages/@aws-cdk/aws-cloudformation/package.json index afe3728bbf520..e32ca34714311 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.25.0", + "version": "0.0.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.25.0", - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-s3-assets": "1.25.0", - "@aws-cdk/aws-sns-subscriptions": "1.25.0", - "@aws-cdk/aws-sqs": "1.25.0", - "@aws-cdk/aws-ssm": "1.25.0", + "@aws-cdk/assert": "0.0.0", + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-s3-assets": "0.0.0", + "@aws-cdk/aws-sns-subscriptions": "0.0.0", + "@aws-cdk/aws-sqs": "0.0.0", + "@aws-cdk/aws-ssm": "0.0.0", "@types/aws-lambda": "^8.10.39", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/core": "1.25.0", - "@aws-cdk/cx-api": "1.25.0" + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/cx-api": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/core": "1.25.0", - "@aws-cdk/cx-api": "1.25.0" + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/cx-api": "0.0.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 46ae45e516769..c5768f3bae46a 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "aws-sdk": "^2.624.0", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "aws-sdk": "^2.630.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-certificatemanager": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-certificatemanager": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-certificatemanager": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-certificatemanager": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/core": "0.0.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 f96097058a218..802d17e76b5dd 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "aws-sdk": "^2.624.0", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "aws-sdk": "^2.630.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "colors": "^1.4.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/aws-logs": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/aws-logs": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/aws-logs": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/aws-logs": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/core": "0.0.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 ad8fa1331ee7a..cc770416b4935 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.25.0", + "version": "0.0.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.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "@aws-cdk/assert": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "jest": "^24.9.0", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-applicationautoscaling": "1.25.0", - "@aws-cdk/aws-autoscaling": "1.25.0", - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-applicationautoscaling": "0.0.0", + "@aws-cdk/aws-autoscaling": "0.0.0", + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-applicationautoscaling": "1.25.0", - "@aws-cdk/aws-autoscaling": "1.25.0", - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-applicationautoscaling": "0.0.0", + "@aws-cdk/aws-autoscaling": "0.0.0", + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-cloudwatch/package.json b/packages/@aws-cdk/aws-cloudwatch/package.json index a4591d46f07a5..a43f1223bf553 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "awslint": { "exclude": [ diff --git a/packages/@aws-cdk/aws-codebuild/package.json b/packages/@aws-cdk/aws-codebuild/package.json index b95f30cad1c53..80e3aae90db11 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.25.0", + "version": "0.0.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.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/aws-sqs": "1.25.0", + "@aws-cdk/assert": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/aws-sqs": "0.0.0", "@types/nodeunit": "^0.0.30", - "aws-sdk": "^2.624.0", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "aws-sdk": "^2.630.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/assets": "1.25.0", - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-codecommit": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-ecr": "1.25.0", - "@aws-cdk/aws-ecr-assets": "1.25.0", - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/aws-s3-assets": "1.25.0", - "@aws-cdk/aws-secretsmanager": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/assets": "0.0.0", + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-codecommit": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-ecr": "0.0.0", + "@aws-cdk/aws-ecr-assets": "0.0.0", + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/aws-s3-assets": "0.0.0", + "@aws-cdk/aws-secretsmanager": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/assets": "1.25.0", - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-codecommit": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-ecr": "1.25.0", - "@aws-cdk/aws-ecr-assets": "1.25.0", - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/aws-s3-assets": "1.25.0", - "@aws-cdk/aws-secretsmanager": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/assets": "0.0.0", + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-codecommit": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-ecr": "0.0.0", + "@aws-cdk/aws-ecr-assets": "0.0.0", + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/aws-s3-assets": "0.0.0", + "@aws-cdk/aws-secretsmanager": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-codecommit/package.json b/packages/@aws-cdk/aws-codecommit/package.json index 100e5e3661876..cf0636a9dccda 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.25.0", + "version": "0.0.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.25.0", - "@aws-cdk/aws-sns": "1.25.0", + "@aws-cdk/assert": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", "@types/nodeunit": "^0.0.30", - "aws-sdk": "^2.624.0", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "aws-sdk": "^2.630.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/core": "0.0.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 dbf8a1f508880..2794bd40367fe 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-autoscaling": "1.25.0", - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-elasticloadbalancing": "1.25.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-autoscaling": "0.0.0", + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-elasticloadbalancing": "0.0.0", + "@aws-cdk/aws-elasticloadbalancingv2": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-autoscaling": "1.25.0", - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-elasticloadbalancing": "1.25.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-autoscaling": "0.0.0", + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-elasticloadbalancing": "0.0.0", + "@aws-cdk/aws-elasticloadbalancingv2": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-codepipeline-actions/package.json b/packages/@aws-cdk/aws-codepipeline-actions/package.json index 4051582a892c9..9c3570f6f167a 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.25.0", + "version": "0.0.0", "description": "Concrete Actions for AWS Code Pipeline", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -64,53 +64,53 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.25.0", - "@aws-cdk/aws-cloudtrail": "1.25.0", + "@aws-cdk/assert": "0.0.0", + "@aws-cdk/aws-cloudtrail": "0.0.0", "@types/lodash": "^4.14.149", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", "lodash": "^4.17.15", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-cloudformation": "1.25.0", - "@aws-cdk/aws-codebuild": "1.25.0", - "@aws-cdk/aws-codecommit": "1.25.0", - "@aws-cdk/aws-codedeploy": "1.25.0", - "@aws-cdk/aws-codepipeline": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-ecr": "1.25.0", - "@aws-cdk/aws-ecs": "1.25.0", - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-events-targets": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/aws-sns-subscriptions": "1.25.0", - "@aws-cdk/core": "1.25.0", + "@aws-cdk/aws-cloudformation": "0.0.0", + "@aws-cdk/aws-codebuild": "0.0.0", + "@aws-cdk/aws-codecommit": "0.0.0", + "@aws-cdk/aws-codedeploy": "0.0.0", + "@aws-cdk/aws-codepipeline": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-ecr": "0.0.0", + "@aws-cdk/aws-ecs": "0.0.0", + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-events-targets": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/aws-sns-subscriptions": "0.0.0", + "@aws-cdk/core": "0.0.0", "case": "1.6.2" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-cloudformation": "1.25.0", - "@aws-cdk/aws-codebuild": "1.25.0", - "@aws-cdk/aws-codecommit": "1.25.0", - "@aws-cdk/aws-codedeploy": "1.25.0", - "@aws-cdk/aws-codepipeline": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-ecr": "1.25.0", - "@aws-cdk/aws-ecs": "1.25.0", - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-events-targets": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/aws-sns-subscriptions": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-cloudformation": "0.0.0", + "@aws-cdk/aws-codebuild": "0.0.0", + "@aws-cdk/aws-codecommit": "0.0.0", + "@aws-cdk/aws-codedeploy": "0.0.0", + "@aws-cdk/aws-codepipeline": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-ecr": "0.0.0", + "@aws-cdk/aws-ecs": "0.0.0", + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-events-targets": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/aws-sns-subscriptions": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "bundledDependencies": [ "case" diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/test.pipeline.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/test.pipeline.ts index 5bb4fafc565c6..bc679d1747da0 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/test.pipeline.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/test.pipeline.ts @@ -959,5 +959,168 @@ export = { test.done(); }, + + 'adds a dependency on the Stack containing a new action Role'(test: Test) { + const region = 'us-west-2'; + const pipelineAccount = '123456789012'; + const buildAccount = '901234567890'; + const app = new App(); + + const buildStack = new Stack(app, 'BuildStack', { + env: { account: buildAccount, region }, + }); + const actionRolePhysicalName = 'ProjectRolePhysicalName'; + const actionRoleInOtherAccount = new iam.Role(buildStack, 'ProjectRole', { + assumedBy: new iam.AccountPrincipal(pipelineAccount), + roleName: actionRolePhysicalName, + }); + const projectPhysicalName = 'ProjectPhysicalName'; + const project = codebuild.Project.fromProjectName(buildStack, 'Project', + projectPhysicalName); + + const pipelineStack = new Stack(app, 'PipelineStack', { + env: { account: pipelineAccount, region }, + }); + const bucket = new s3.Bucket(pipelineStack, 'ArtifactBucket', { + bucketName: 'source-bucket', + encryption: s3.BucketEncryption.KMS, + }); + const sourceOutput = new codepipeline.Artifact(); + new codepipeline.Pipeline(pipelineStack, 'Pipeline', { + artifactBucket: bucket, + stages: [ + { + stageName: 'Source', + actions: [ + new cpactions.S3SourceAction({ + actionName: 'S3', + bucket, + bucketKey: 'path/to/file.zip', + output: sourceOutput, + }), + ], + }, + { + stageName: 'Build', + actions: [ + new cpactions.CodeBuildAction({ + actionName: 'CodeBuild', + project, + input: sourceOutput, + role: actionRoleInOtherAccount, + }), + ], + }, + ], + }); + + expect(pipelineStack).to(haveResourceLike('AWS::CodePipeline::Pipeline', { + "Stages": [ + { + "Name": "Source", + }, + { + "Name": "Build", + "Actions": [ + { + "Name": "CodeBuild", + "Configuration": { + "ProjectName": projectPhysicalName, + }, + "RoleArn": { + "Fn::Join": ["", [ + "arn:", + { "Ref": "AWS::Partition" }, + `:iam::${buildAccount}:role/${actionRolePhysicalName}`, + ]], + }, + }, + ], + }, + ], + })); + + test.equal(pipelineStack.dependencies.length, 1); + + test.done(); + }, + + 'does not add a dependency on the Stack containing an imported action Role'(test: Test) { + const region = 'us-west-2'; + const pipelineAccount = '123456789012'; + const buildAccount = '901234567890'; + const app = new App(); + + const buildStack = new Stack(app, 'BuildStack', { + env: { account: buildAccount, region }, + }); + const actionRolePhysicalName = 'ProjectRolePhysicalName'; + const actionRoleInOtherAccount = iam.Role.fromRoleArn(buildStack, 'ProjectRole', + `arn:aws:iam::${buildAccount}:role/${actionRolePhysicalName}`); + const projectPhysicalName = 'ProjectPhysicalName'; + const project = new codebuild.PipelineProject(buildStack, 'Project', { + projectName: projectPhysicalName, + }); + + const pipelineStack = new Stack(app, 'PipelineStack', { + env: { account: pipelineAccount, region }, + }); + const bucket = new s3.Bucket(pipelineStack, 'ArtifactBucket', { + bucketName: 'source-bucket', + encryption: s3.BucketEncryption.KMS, + }); + const sourceOutput = new codepipeline.Artifact(); + new codepipeline.Pipeline(pipelineStack, 'Pipeline', { + artifactBucket: bucket, + stages: [ + { + stageName: 'Source', + actions: [ + new cpactions.S3SourceAction({ + actionName: 'S3', + bucket, + bucketKey: 'path/to/file.zip', + output: sourceOutput, + }), + ], + }, + { + stageName: 'Build', + actions: [ + new cpactions.CodeBuildAction({ + actionName: 'CodeBuild', + project, + input: sourceOutput, + role: actionRoleInOtherAccount, + }), + ], + }, + ], + }); + + expect(pipelineStack).to(haveResourceLike('AWS::CodePipeline::Pipeline', { + "Stages": [ + { + "Name": "Source", + }, + { + "Name": "Build", + "Actions": [ + { + "Name": "CodeBuild", + "Configuration": { + "ProjectName": projectPhysicalName, + }, + "RoleArn": `arn:aws:iam::${buildAccount}:role/${actionRolePhysicalName}`, + }, + ], + }, + ], + })); + + test.equal(pipelineStack.dependencies.length, 0); + + test.done(); + }, }, }; diff --git a/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts b/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts index e8b7831d29a51..9250def339fbb 100644 --- a/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts +++ b/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts @@ -541,8 +541,14 @@ export class Pipeline extends PipelineBase { if (action.actionProperties.role) { if (this.isAwsOwned(action)) { // the role has to be deployed before the pipeline - const roleStack = Stack.of(action.actionProperties.role); - pipelineStack.addDependency(roleStack); + // (our magical cross-stack dependencies will not work, + // because the role might be from a different environment), + // but _only_ if it's a new Role - + // an imported Role should not add the dependency + if (action.actionProperties.role instanceof iam.Role) { + const roleStack = Stack.of(action.actionProperties.role); + pipelineStack.addDependency(roleStack); + } return action.actionProperties.role; } else { diff --git a/packages/@aws-cdk/aws-codepipeline/lib/stage.ts b/packages/@aws-cdk/aws-codepipeline/lib/stage.ts index de236a3c30263..e23a079513b9c 100644 --- a/packages/@aws-cdk/aws-codepipeline/lib/stage.ts +++ b/packages/@aws-cdk/aws-codepipeline/lib/stage.ts @@ -63,9 +63,10 @@ export class Stage implements IStage { for (const outputArtifact of outputArtifacts) { if (!outputArtifact.artifactName) { - const artifactName = `Artifact_${this.stageName}_${action.actionName}` + (unnamedOutputs.length === 1 + const unsanitizedArtifactName = `Artifact_${this.stageName}_${action.actionName}` + (unnamedOutputs.length === 1 ? '' : '_' + (unnamedOutputs.indexOf(outputArtifact) + 1)); + const artifactName = sanitizeArtifactName(unsanitizedArtifactName); (outputArtifact as any)._setName(artifactName); } } @@ -167,3 +168,9 @@ export class Stage implements IStage { .map(a => ({ name: a.artifactName! })); } } + +function sanitizeArtifactName(artifactName: string): string { + // strip out some characters that are legal in Stage and Action names, + // but not in Artifact names + return artifactName.replace(/[@.]/g, ''); +} diff --git a/packages/@aws-cdk/aws-codepipeline/package.json b/packages/@aws-cdk/aws-codepipeline/package.json index df5d41336e83c..881b61952c822 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-codepipeline/test/test.artifacts.ts b/packages/@aws-cdk/aws-codepipeline/test/test.artifacts.ts index ff975b18e0c90..484f220a57ab6 100644 --- a/packages/@aws-cdk/aws-codepipeline/test/test.artifacts.ts +++ b/packages/@aws-cdk/aws-codepipeline/test/test.artifacts.ts @@ -172,6 +172,63 @@ export = { test.done(); }, + + 'without a name, sanitize the auto stage-action derived name'(test: Test) { + const stack = new cdk.Stack(); + + const sourceOutput = new codepipeline.Artifact(); + new codepipeline.Pipeline(stack, 'Pipeline', { + stages: [ + { + stageName: 'Source.@', // @ and . are not allowed in Artifact names! + actions: [ + new FakeSourceAction({ + actionName: 'source1', + output: sourceOutput, + }), + ], + }, + { + stageName: 'Build', + actions: [ + new FakeBuildAction({ + actionName: 'build1', + input: sourceOutput, + }), + ], + }, + ], + }); + + expect(stack).to(haveResourceLike('AWS::CodePipeline::Pipeline', { + "Stages": [ + { + "Name": "Source.@", + "Actions": [ + { + "Name": "source1", + "OutputArtifacts": [ + { "Name": "Artifact_Source_source1" }, + ], + }, + ], + }, + { + "Name": "Build", + "Actions": [ + { + "Name": "build1", + "InputArtifacts": [ + { "Name": "Artifact_Source_source1" }, + ], + }, + ], + }, + ], + })); + + test.done(); + }, }, }; diff --git a/packages/@aws-cdk/aws-codestar/package.json b/packages/@aws-cdk/aws-codestar/package.json index 8ff1274f07790..e7981d31d1aa0 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 167ff4bc82d80..45553d32b2e75 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-cognito/README.md b/packages/@aws-cdk/aws-cognito/README.md index 843e6873994aa..af580d9ad6394 100644 --- a/packages/@aws-cdk/aws-cognito/README.md +++ b/packages/@aws-cdk/aws-cognito/README.md @@ -86,6 +86,56 @@ All email subjects, bodies and SMS messages for both invitation and verification Learn more about [message templates here](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pool-settings-message-templates.html). +### Sign In + +Users registering or signing in into your application can do so with multiple identifiers. There are 4 options +available: + +* `username`: Allow signing in using the one time immutable user name that the user chose at the time of sign up. +* `email`: Allow signing in using the email address that is associated with the account. +* `phone`: Allow signing in using the phone number that is associated with the account. +* `preferredUsername`: Allow signing in with an alternate user name that the user can change at any time. However, this + is not available if the `username` option is not chosen. + +The following code sets up a user pool so that the user can sign in with either their username or their email address - + +```ts +new UserPool(this, 'myuserpool', { + // ... + // ... + signInAliases: { + username: true, + email: true + }, +}); +``` + +User pools can either be configured so that user name is primary sign in form, but also allows for the other three to be +used additionally; or it can be configured so that email and/or phone numbers are the only ways a user can register and +sign in. Read more about this +[here](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html#user-pool-settings-aliases-settings). + +To match with 'Option 1' in the above link, with a verified email, `signInAliases` should be set to +`{ username: true, email: true }`. To match with 'Option 2' in the above link with both a verified +email and phone number, this property should be set to `{ email: true, phone: true }`. + +Cognito recommends that email and phone number be automatically verified, if they are one of the sign in methods for +the user pool. Read more about that +[here](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html#user-pool-settings-aliases). +The CDK does this by default, when email and/or phone number are specified as part of `signInAliases`. This can be +overridden by specifying the `autoVerify` property. + +The following code snippet sets up only email as a sign in alias, but both email and phone number to be auto-verified. + +```ts +new UserPool(this, 'myuserpool', { + // ... + // ... + signInAliases: { username: true, email: true }, + autoVerify: { email: true, phone: true } +}); +``` + ### Security Cognito sends various messages to its users via SMS, for different actions, ranging from account verification to @@ -108,4 +158,24 @@ new UserPool(this, 'myuserpool', { When the `smsRole` property is specified, the `smsRoleExternalId` may also be specified. The value of `smsRoleExternalId` will be used as the `sts:ExternalId` when the Cognito service assumes the role. In turn, the role's assume role policy should be configured to accept this value as the ExternalId. Learn more about [ExternalId -here](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html). \ No newline at end of file +here](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html). + +### Importing User Pools + +Any user pool that has been created outside of this stack, can be imported into the CDK app. Importing a user pool +allows for it to be used in other parts of the CDK app that reference an `IUserPool`. However, imported user pools have +limited configurability. As a rule of thumb, none of the properties that is are part of the +[`AWS::Cognito::UserPool`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpool.html) +CloudFormation resource can be configured. + +User pools can be imported either using their id via the `UserPool.fromUserPoolId()`, or by using their ARN, via the +`UserPool.fromUserPoolArn()` API. + +```ts +const stack = new Stack(app, 'my-stack'); + +const awesomePool = UserPool.fromUserPoolId(stack, 'awesome-user-pool', 'us-east-1_oiuR12Abd'); + +const otherAwesomePool = UserPool.fromUserPoolArn(stack, 'other-awesome-user-pool', + 'arn:aws:cognito-idp:eu-west-1:123456789012:userpool/us-east-1_mtRyYQ14D'); +``` \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cognito/lib/user-pool.ts b/packages/@aws-cdk/aws-cognito/lib/user-pool.ts index c61e3da8e9152..43a41541ac136 100644 --- a/packages/@aws-cdk/aws-cognito/lib/user-pool.ts +++ b/packages/@aws-cdk/aws-cognito/lib/user-pool.ts @@ -1,6 +1,6 @@ import { IRole, PolicyDocument, PolicyStatement, Role, ServicePrincipal } from '@aws-cdk/aws-iam'; import * as lambda from '@aws-cdk/aws-lambda'; -import { Construct, IResource, Lazy, Resource } from '@aws-cdk/core'; +import { Construct, IResource, Lazy, Resource, Stack } from '@aws-cdk/core'; import { CfnUserPool } from './cognito.generated'; /** @@ -121,28 +121,50 @@ export enum UserPoolAttribute { } /** - * Methods of user sign-in + * The different ways in which users of this pool can sign up or sign in. */ -export enum SignInType { +export interface SignInAliases { /** - * End-user will sign in with a username, with optional aliases + * Whether user is allowed to sign up or sign in with a username + * @default true */ - USERNAME, + readonly username?: boolean; /** - * End-user will sign in using an email address + * Whether a user is allowed to sign up or sign in with an email address + * @default false */ - EMAIL, + readonly email?: boolean; /** - * End-user will sign in using a phone number + * Whether a user is allowed to sign up or sign in with a phone number + * @default false */ - PHONE, + readonly phone?: boolean; /** - * End-user will sign in using either an email address or phone number + * Whether a user is allowed to ign in with a secondary username, that can be set and modified after sign up. + * Can only be used in conjunction with `USERNAME`. + * @default false */ - EMAIL_OR_PHONE + readonly preferredUsername?: boolean; +} + +/** + * Attributes that can be automatically verified for users in a user pool. + */ +export interface AutoVerifiedAttrs { + /** + * Whether the email address of the user should be auto verified at sign up. + * @default - true, if email is turned on for `signIn`. false, otherwise. + */ + readonly email?: boolean; + + /** + * Whether the phone number of the user should be auto verified at sign up. + * @default - true, if phone is turned on for `signIn`. false, otherwise. + */ + readonly phone?: boolean; } export interface UserPoolTriggers { @@ -327,28 +349,28 @@ export interface UserPoolProps { readonly smsRoleExternalId?: string; /** - * Method used for user registration & sign in. + * Methods in which a user registers or signs in to a user pool. * Allows either username with aliases OR sign in with email, phone, or both. * - * @default SignInType.Username - */ - readonly signInType?: SignInType; - - /** - * Attributes to allow as username alias. - * Only valid if signInType is USERNAME + * Read the sections on usernames and aliases to learn more - + * https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html * - * @default - No alias. + * To match with 'Option 1' in the above link, with a verified email, this property should be set to + * `{ username: true, email: true }`. To match with 'Option 2' in the above link with both a verified email and phone + * number, this property should be set to `{ email: true, phone: true }`. + * + * @default { username: true } */ - readonly usernameAliasAttributes?: UserPoolAttribute[]; + readonly signInAliases?: SignInAliases; /** - * Attributes which Cognito will automatically send a verification message to. - * Must be either EMAIL, PHONE, or both. + * Attributes which Cognito will look to verify automatically upon user sign up. + * EMAIL and PHONE are the only available options. * - * @default - No auto verification. + * @default - If `signIn` include email and/or phone, they will be included in `autoVerifiedAttributes` by default. + * If absent, no attributes will be auto-verified. */ - readonly autoVerifiedAttributes?: UserPoolAttribute[]; + readonly autoVerify?: AutoVerifiedAttrs; /** * Lambda functions to use for supported Cognito triggers. @@ -358,28 +380,9 @@ export interface UserPoolProps { readonly lambdaTriggers?: UserPoolTriggers; } -export interface UserPoolAttributes { - /** - * The ID of an existing user pool - */ - readonly userPoolId: string; - - /** - * The ARN of the imported user pool - */ - readonly userPoolArn: string; - - /** - * The provider name of the imported user pool - */ - readonly userPoolProviderName: string; - - /** - * The URL of the imported user pool - */ - readonly userPoolProviderUrl: string; -} - +/** + * Represents a Cognito UserPool + */ export interface IUserPool extends IResource { /** * The physical ID of this user pool resource @@ -392,18 +395,6 @@ export interface IUserPool extends IResource { * @attribute */ readonly userPoolArn: string; - - /** - * The provider name of this user pool resource - * @attribute - */ - readonly userPoolProviderName: string; - - /** - * The provider URL of this user pool resource - * @attribute - */ - readonly userPoolProviderUrl: string; } /** @@ -411,22 +402,28 @@ export interface IUserPool extends IResource { */ export class UserPool extends Resource implements IUserPool { /** - * Import an existing user pool resource - * @param scope Parent construct - * @param id Construct ID - * @param attrs Imported user pool properties + * Import an existing user pool based on its id. */ - public static fromUserPoolAttributes(scope: Construct, id: string, attrs: UserPoolAttributes): IUserPool { - /** - * Define a user pool which has been declared in another stack - */ + public static fromUserPoolId(scope: Construct, id: string, userPoolId: string): IUserPool { class Import extends Resource implements IUserPool { - public readonly userPoolId = attrs.userPoolId; - public readonly userPoolArn = attrs.userPoolArn; - public readonly userPoolProviderName = attrs.userPoolProviderName; - public readonly userPoolProviderUrl = attrs.userPoolProviderUrl; + public readonly userPoolId = userPoolId; + public readonly userPoolArn = Stack.of(this).formatArn({ + service: 'cognito-idp', + resource: 'userpool', + resourceName: userPoolId, + }); } + return new Import(scope, id); + } + /** + * Import an existing user pool based on its ARN. + */ + public static fromUserPoolArn(scope: Construct, id: string, userPoolArn: string): IUserPool { + class Import extends Resource implements IUserPool { + public readonly userPoolArn = userPoolArn; + public readonly userPoolId = Stack.of(this).parseArn(userPoolArn).resourceName!; + } return new Import(scope, id); } @@ -442,11 +439,13 @@ export class UserPool extends Resource implements IUserPool { /** * User pool provider name + * @attribute */ public readonly userPoolProviderName: string; /** * User pool provider URL + * @attribute */ public readonly userPoolProviderUrl: string; @@ -455,46 +454,7 @@ export class UserPool extends Resource implements IUserPool { constructor(scope: Construct, id: string, props: UserPoolProps = {}) { super(scope, id); - let aliasAttributes: UserPoolAttribute[] | undefined; - let usernameAttributes: UserPoolAttribute[] | undefined; - - if (props.usernameAliasAttributes != null && props.signInType !== SignInType.USERNAME) { - throw new Error(`'usernameAliasAttributes' can only be set with a signInType of 'USERNAME'`); - } - - if (props.usernameAliasAttributes - && !props.usernameAliasAttributes.every(a => { - return a === UserPoolAttribute.EMAIL || a === UserPoolAttribute.PHONE_NUMBER || a === UserPoolAttribute.PREFERRED_USERNAME; - })) { - throw new Error(`'usernameAliasAttributes' can only include EMAIL, PHONE_NUMBER, or PREFERRED_USERNAME`); - } - - if (props.autoVerifiedAttributes - && !props.autoVerifiedAttributes.every(a => a === UserPoolAttribute.EMAIL || a === UserPoolAttribute.PHONE_NUMBER)) { - throw new Error(`'autoVerifiedAttributes' can only include EMAIL or PHONE_NUMBER`); - } - - switch (props.signInType) { - case SignInType.USERNAME: - aliasAttributes = props.usernameAliasAttributes; - break; - - case SignInType.EMAIL: - usernameAttributes = [UserPoolAttribute.EMAIL]; - break; - - case SignInType.PHONE: - usernameAttributes = [UserPoolAttribute.PHONE_NUMBER]; - break; - - case SignInType.EMAIL_OR_PHONE: - usernameAttributes = [UserPoolAttribute.EMAIL, UserPoolAttribute.PHONE_NUMBER]; - break; - - default: - aliasAttributes = props.usernameAliasAttributes; - break; - } + const signIn = this.signInConfiguration(props); if (props.lambdaTriggers) { for (const t of Object.keys(props.lambdaTriggers)) { @@ -537,9 +497,9 @@ export class UserPool extends Resource implements IUserPool { const userPool = new CfnUserPool(this, 'Resource', { userPoolName: props.userPoolName, - usernameAttributes, - aliasAttributes, - autoVerifiedAttributes: props.autoVerifiedAttributes, + usernameAttributes: signIn.usernameAttrs, + aliasAttributes: signIn.aliasAttrs, + autoVerifiedAttributes: signIn.autoVerifyAttrs, lambdaConfig: Lazy.anyValue({ produce: () => this.triggers }), smsConfiguration: this.smsConfiguration(props), adminCreateUserConfig, @@ -674,6 +634,42 @@ export class UserPool extends Resource implements IUserPool { }); } + private signInConfiguration(props: UserPoolProps) { + let aliasAttrs: string[] | undefined; + let usernameAttrs: string[] | undefined; + let autoVerifyAttrs: string[] | undefined; + + const signIn: SignInAliases = props.signInAliases ?? { username: true }; + + if (signIn.preferredUsername && !signIn.username) { + throw new Error('username signIn must be enabled if preferredUsername is enabled'); + } + + if (signIn.username) { + aliasAttrs = []; + if (signIn.email) { aliasAttrs.push(UserPoolAttribute.EMAIL); } + if (signIn.phone) { aliasAttrs.push(UserPoolAttribute.PHONE_NUMBER); } + if (signIn.preferredUsername) { aliasAttrs.push(UserPoolAttribute.PREFERRED_USERNAME); } + if (aliasAttrs.length === 0) { aliasAttrs = undefined; } + } else { + usernameAttrs = []; + if (signIn.email) { usernameAttrs.push(UserPoolAttribute.EMAIL); } + if (signIn.phone) { usernameAttrs.push(UserPoolAttribute.PHONE_NUMBER); } + } + + if (props.autoVerify) { + autoVerifyAttrs = []; + if (props.autoVerify.email) { autoVerifyAttrs.push(UserPoolAttribute.EMAIL); } + if (props.autoVerify.phone) { autoVerifyAttrs.push(UserPoolAttribute.PHONE_NUMBER); } + } else if (signIn.email || signIn.phone) { + autoVerifyAttrs = []; + if (signIn.email) { autoVerifyAttrs.push(UserPoolAttribute.EMAIL); } + if (signIn.phone) { autoVerifyAttrs.push(UserPoolAttribute.PHONE_NUMBER); } + } + + return { usernameAttrs, aliasAttrs, autoVerifyAttrs }; + } + private smsConfiguration(props: UserPoolProps): CfnUserPool.SmsConfigurationProperty { if (props.smsRole) { return { @@ -710,4 +706,4 @@ export class UserPool extends Resource implements IUserPool { }; } } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cognito/package.json b/packages/@aws-cdk/aws-cognito/package.json index 0e7a894e4f7cc..6a1bdf7edcdcf 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.25.0", + "version": "0.0.0", "description": "The CDK Construct Library for AWS::Cognito", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,25 +62,25 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "jest": "^24.9.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "jest": {}, "engines": { @@ -88,9 +88,7 @@ }, "awslint": { "exclude": [ - "from-method:@aws-cdk/aws-cognito.UserPool", - "from-arn:UserPool.fromUserPoolArn", - "docs-public-apis:@aws-cdk/aws-cognito.IUserPool", + "no-unused-type:@aws-cdk/aws-cognito.UserPoolAttribute", "props-default-doc:@aws-cdk/aws-cognito.UserPoolTriggers.verifyAuthChallengeResponse", "props-default-doc:@aws-cdk/aws-cognito.UserPoolTriggers.userMigration", "props-default-doc:@aws-cdk/aws-cognito.UserPoolTriggers.preTokenGeneration", @@ -105,9 +103,8 @@ "docs-public-apis:@aws-cdk/aws-cognito.UserPoolClient.userPoolClientClientSecret", "docs-public-apis:@aws-cdk/aws-cognito.UserPoolClient.userPoolClientId", "docs-public-apis:@aws-cdk/aws-cognito.UserPoolClient.userPoolClientName", - "docs-public-apis:@aws-cdk/aws-cognito.UserPoolAttributes", "docs-public-apis:@aws-cdk/aws-cognito.UserPoolClientProps" ] }, "stability": "experimental" -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-explicit-props.expected.json b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-explicit-props.expected.json new file mode 100644 index 0000000000000..f7b8a29230d8d --- /dev/null +++ b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-explicit-props.expected.json @@ -0,0 +1,81 @@ +{ + "Resources": { + "myuserpoolsmsRole0E16FDD9": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Condition": { + "StringEquals": { + "sts:ExternalId": "integuserpoolmyuserpoolDA38443C" + } + }, + "Effect": "Allow", + "Principal": { + "Service": "cognito-idp.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": "sns:Publish", + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "sns-publish" + } + ] + } + }, + "myuserpool01998219": { + "Type": "AWS::Cognito::UserPool", + "Properties": { + "AdminCreateUserConfig": { + "AllowAdminCreateUserOnly": false, + "InviteMessageTemplate": { + "EmailMessage": "invitation email body from the integ test for {username}. Temp password is {####}.", + "EmailSubject": "invitation email subject from the integ test", + "SMSMessage": "invitation sms message from the integ test for {username}. Temp password is {####}." + } + }, + "AliasAttributes": [ + "email" + ], + "AutoVerifiedAttributes": [ + "email", + "phone_number" + ], + "EmailVerificationMessage": "verification email body from the integ test. Code is {####}.", + "EmailVerificationSubject": "verification email subject from the integ test", + "LambdaConfig": {}, + "SmsConfiguration": { + "ExternalId": "integuserpoolmyuserpoolDA38443C", + "SnsCallerArn": { + "Fn::GetAtt": [ + "myuserpoolsmsRole0E16FDD9", + "Arn" + ] + } + }, + "SmsVerificationMessage": "verification sms message from the integ test. Code is {####}.", + "UserPoolName": "MyUserPool", + "VerificationMessageTemplate": { + "DefaultEmailOption": "CONFIRM_WITH_CODE", + "EmailMessage": "verification email body from the integ test. Code is {####}.", + "EmailSubject": "verification email subject from the integ test", + "SmsMessage": "verification sms message from the integ test. Code is {####}." + } + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-explicit-props.ts b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-explicit-props.ts new file mode 100644 index 0000000000000..316beb5d3a494 --- /dev/null +++ b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-explicit-props.ts @@ -0,0 +1,28 @@ +import { App, Stack } from '@aws-cdk/core'; +import { UserPool } from '../lib'; + +const app = new App(); +const stack = new Stack(app, 'integ-user-pool'); + +new UserPool(stack, 'myuserpool', { + userPoolName: 'MyUserPool', + userInvitation: { + emailSubject: 'invitation email subject from the integ test', + emailBody: 'invitation email body from the integ test for {username}. Temp password is {####}.', + smsMessage: 'invitation sms message from the integ test for {username}. Temp password is {####}.', + }, + selfSignUpEnabled: true, + userVerification: { + emailBody: 'verification email body from the integ test. Code is {####}.', + emailSubject: 'verification email subject from the integ test', + smsMessage: 'verification sms message from the integ test. Code is {####}.', + }, + signInAliases: { + username: true, + email: true, + }, + autoVerify: { + email: true, + phone: true, + }, +}); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cognito/test/user-pool.test.ts b/packages/@aws-cdk/aws-cognito/test/user-pool.test.ts index 32436ffe9ec8b..16cfc7b9b051b 100644 --- a/packages/@aws-cdk/aws-cognito/test/user-pool.test.ts +++ b/packages/@aws-cdk/aws-cognito/test/user-pool.test.ts @@ -3,7 +3,7 @@ import { ABSENT } from '@aws-cdk/assert/lib/assertions/have-resource'; import { Role } from '@aws-cdk/aws-iam'; import * as lambda from '@aws-cdk/aws-lambda'; import { Stack, Tag } from '@aws-cdk/core'; -import { SignInType, UserPool, UserPoolAttribute, VerificationEmailStyle } from '../lib'; +import { UserPool, VerificationEmailStyle } from '../lib'; describe('User Pool', () => { test('default setup', () => { @@ -36,7 +36,7 @@ describe('User Pool', () => { } }); - expect(stack).toHaveResourceLike('AWS::IAM::Role', { + expect(stack).toHaveResource('AWS::IAM::Role', { AssumeRolePolicyDocument: { Statement: [ { @@ -51,7 +51,8 @@ describe('User Pool', () => { Service: 'cognito-idp.amazonaws.com' } } - ] + ], + Version: '2012-10-17' }, Policies: [ { @@ -62,8 +63,10 @@ describe('User Pool', () => { Effect: 'Allow', Resource: '*' } - ] - } + ], + Version: '2012-10-17' + }, + PolicyName: 'sns-publish' } ] }); @@ -154,6 +157,30 @@ describe('User Pool', () => { }); }); + test('import using id', () => { + // GIVEN + const stack = new Stack(undefined, undefined, { + env: { region: 'some-region-1', account: '0123456789012' } + }); + const userPoolId = 'test-user-pool'; + + // WHEN + const pool = UserPool.fromUserPoolId(stack, 'userpool', userPoolId); + expect(pool.userPoolId).toEqual(userPoolId); + expect(pool.userPoolArn).toMatch(/cognito-idp:some-region-1:0123456789012:userpool\/test-user-pool/); + }); + + test('import using arn', () => { + // GIVEN + const stack = new Stack(); + const userPoolArn = 'arn:aws:cognito-idp:us-east-1:0123456789012:userpool/test-user-pool'; + + // WHEN + const pool = UserPool.fromUserPoolArn(stack, 'userpool', userPoolArn); + expect(pool.userPoolId).toEqual('test-user-pool'); + expect(pool.userPoolArn).toEqual(userPoolArn); + }); + test('support tags', () => { // GIVEN const stack = new Stack(); @@ -316,53 +343,97 @@ describe('User Pool', () => { }); }); - test('set sign in type', () => { + test('no username aliases specified', () => { + // GIVEN + const stack = new Stack(); + + // WHEN + new UserPool(stack, 'Pool'); + + // THEN + expect(stack).toHaveResourceLike('AWS::Cognito::UserPool', { + UsernameAttributes: ABSENT, + AliasAttributes: ABSENT, + }); + }); + + test('fails when preferredUsername is used without username', () => { + const stack = new Stack(); + expect(() => new UserPool(stack, 'Pool', { + signInAliases: { preferredUsername: true } + })).toThrow(/username/); + }); + + test('username and email are specified as the username aliases', () => { // GIVEN const stack = new Stack(); // WHEN new UserPool(stack, 'Pool', { - signInType: SignInType.EMAIL, - autoVerifiedAttributes: [ UserPoolAttribute.EMAIL ] + signInAliases: { username: true, email: true } }); // THEN expect(stack).toHaveResourceLike('AWS::Cognito::UserPool', { - UsernameAttributes: [ 'email' ], - AutoVerifiedAttributes: [ 'email' ] + UsernameAttributes: ABSENT, + AliasAttributes: [ 'email' ], }); }); - test('usernameAliasAttributes require signInType of USERNAME', () => { + test('email and phone number are specified as the username aliases', () => { + // GIVEN const stack = new Stack(); - expect(() => { - new UserPool(stack, 'Pool', { - signInType: SignInType.EMAIL, - usernameAliasAttributes: [ UserPoolAttribute.PREFERRED_USERNAME ] - }); - }).toThrow(/'usernameAliasAttributes' can only be set with a signInType of 'USERNAME'/); + // WHEN + new UserPool(stack, 'Pool', { + signInAliases: { email: true, phone: true } + }); + + // THEN + expect(stack).toHaveResourceLike('AWS::Cognito::UserPool', { + UsernameAttributes: [ 'email', 'phone_number' ], + AliasAttributes: ABSENT, + }); }); - test('usernameAliasAttributes must be one or more of EMAIL, PHONE_NUMBER, or PREFERRED_USERNAME', () => { + test('email and phone number are autoverified, by default, if they are specified as signIn', () => { + // GIVEN const stack = new Stack(); - expect(() => { - new UserPool(stack, 'Pool', { - signInType: SignInType.USERNAME, - usernameAliasAttributes: [ UserPoolAttribute.GIVEN_NAME ] - }); - }).toThrow(/'usernameAliasAttributes' can only include EMAIL, PHONE_NUMBER, or PREFERRED_USERNAME/); + // WHEN + new UserPool(stack, 'Pool1', { + userPoolName: 'Pool1', + signInAliases: { email: true } + }); + new UserPool(stack, 'Pool2', { + userPoolName: 'Pool2', + signInAliases: { email: true, phone: true } + }); + + // THEN + expect(stack).toHaveResourceLike('AWS::Cognito::UserPool', { + UserPoolName: 'Pool1', + AutoVerifiedAttributes: [ 'email' ], + }); + expect(stack).toHaveResourceLike('AWS::Cognito::UserPool', { + UserPoolName: 'Pool2', + AutoVerifiedAttributes: [ 'email', 'phone_number' ], + }); }); - test('autoVerifiedAttributes must be one or more of EMAIL or PHONE_NUMBER', () => { + test('explicit autoverify are correctly picked up', () => { + // GIVEN const stack = new Stack(); - expect(() => { - new UserPool(stack, 'Pool', { - signInType: SignInType.EMAIL, - autoVerifiedAttributes: [ UserPoolAttribute.EMAIL, UserPoolAttribute.GENDER ] - }); - }).toThrow(/'autoVerifiedAttributes' can only include EMAIL or PHONE_NUMBER/); + // WHEN + new UserPool(stack, 'Pool', { + signInAliases: { username: true }, + autoVerify: { email: true, phone: true }, + }); + + // THEN + expect(stack).toHaveResourceLike('AWS::Cognito::UserPool', { + AutoVerifiedAttributes: [ 'email', 'phone_number' ], + }); }); }); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-config/package.json b/packages/@aws-cdk/aws-config/package.json index 1b218cc5e6c97..c1fc0151e5d09 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.25.0", + "version": "0.0.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.25.0", - "@aws-cdk/aws-events-targets": "1.25.0", + "@aws-cdk/assert": "0.0.0", + "@aws-cdk/aws-events-targets": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/core": "0.0.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 ca9fad1bab929..e33fd2d0fec99 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 6c4527a6b2535..ea428e10b914e 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 f2d3c8e50b98c..eef2fba259d79 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 50d5ff30f7e3a..cf75659a660d8 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 97582ce4fc056..f112392504110 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 f6c66f5dfab34..f538a2f4381fc 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 4e3a01942cce4..7fa9a6464fd1f 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.25.0", + "version": "0.0.0", "description": "This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.", "main": "lib/handler.js", "directories": { @@ -39,4 +39,4 @@ "lambda-tester": "^3.6.0", "nock": "^11.7.0" } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-dynamodb-global/package.json b/packages/@aws-cdk/aws-dynamodb-global/package.json index 12e1759777965..71203e8fb8137 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.25.0", + "version": "0.0.0", "description": "Build a global dynamodb table", "deprecated": "This module has been deprecated. Use @aws-cdk/aws-dynamodb.Table with replicationRegions instead", "license": "Apache-2.0", @@ -46,27 +46,27 @@ "global" ], "dependencies": { - "@aws-cdk/aws-cloudformation": "1.25.0", - "@aws-cdk/aws-dynamodb": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-cloudformation": "0.0.0", + "@aws-cdk/aws-dynamodb": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "devDependencies": { - "@aws-cdk/assert": "1.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "peerDependencies": { - "@aws-cdk/aws-cloudformation": "1.25.0", - "@aws-cdk/aws-dynamodb": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-cloudformation": "0.0.0", + "@aws-cdk/aws-dynamodb": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "scripts": { "build": "cdk-build", diff --git a/packages/@aws-cdk/aws-dynamodb/package.json b/packages/@aws-cdk/aws-dynamodb/package.json index 00d34b9c1ac8c..ebcea0c734d8f 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.25.0", + "version": "0.0.0", "description": "CDK Constructs for AWS DynamoDB", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,35 +62,35 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "aws-sdk": "^2.624.0", + "aws-sdk": "^2.630.0", "aws-sdk-mock": "^5.0.0", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0", + "pkglint": "0.0.0", "sinon": "^9.0.0" }, "dependencies": { - "@aws-cdk/aws-applicationautoscaling": "1.25.0", - "@aws-cdk/aws-cloudformation": "1.25.0", - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/core": "1.25.0", - "@aws-cdk/custom-resources": "1.25.0" + "@aws-cdk/aws-applicationautoscaling": "0.0.0", + "@aws-cdk/aws-cloudformation": "0.0.0", + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/custom-resources": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-applicationautoscaling": "1.25.0", - "@aws-cdk/aws-cloudformation": "1.25.0", - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/core": "1.25.0", - "@aws-cdk/custom-resources": "1.25.0" + "@aws-cdk/aws-applicationautoscaling": "0.0.0", + "@aws-cdk/aws-cloudformation": "0.0.0", + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/custom-resources": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-ec2/README.md b/packages/@aws-cdk/aws-ec2/README.md index abd36271a73f3..c4ff1c03f1939 100644 --- a/packages/@aws-cdk/aws-ec2/README.md +++ b/packages/@aws-cdk/aws-ec2/README.md @@ -556,3 +556,24 @@ new ec2.FlowLog(this, 'FlowLog', { destination: ec2.FlowLogDestination.toS3(bucket) }); ``` + +## User Data +User data enables you to run a script when your instances start up. In order to configure these scripts you can add commands directly to the script + or you can use the UserData's convenience functions to aid in the creation of your script. + +A user data could be configured to run a script found in an asset through the following: +```ts +const asset = new Asset(this, 'Asset', {path: path.join(__dirname, 'configure.sh')}); +const instance = new ec2.Instance(this, 'Instance', { + // ... + }); +const localPath = instance.userData.addS3DownloadCommand({ + bucket:asset.bucket, + bucketKey:asset.s3ObjectKey, +}); +instance.userData.addExecuteFileCommand({ + filePath:localPath, + arguments: '--verbose -y' +}); +asset.grantRead( instance.role ); +``` \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ec2/lib/user-data.ts b/packages/@aws-cdk/aws-ec2/lib/user-data.ts index b637e181c8104..aecab8cd0e3ec 100644 --- a/packages/@aws-cdk/aws-ec2/lib/user-data.ts +++ b/packages/@aws-cdk/aws-ec2/lib/user-data.ts @@ -1,3 +1,5 @@ +import { IBucket } from "@aws-cdk/aws-s3"; +import { CfnElement, Resource, Stack } from "@aws-cdk/core"; import { OperatingSystemType } from "./machine-image"; /** @@ -12,6 +14,50 @@ export interface LinuxUserDataOptions { readonly shebang?: string; } +/** + * Options when downloading files from S3 + */ +export interface S3DownloadOptions { + + /** + * Name of the S3 bucket to download from + */ + readonly bucket: IBucket; + + /** + * The key of the file to download + */ + readonly bucketKey: string; + + /** + * The name of the local file. + * + * @default Linux - /tmp/bucketKey + * Windows - %TEMP%/bucketKey + */ + readonly localFile?: string; + +} + +/** + * Options when executing a file. + */ +export interface ExecuteFileOptions { + + /** + * The path to the file. + */ + readonly filePath: string; + + /** + * The arguments to be passed to the file. + * + * @default No arguments are passed to the file. + */ + readonly arguments?: string; + +} + /** * Instance User Data */ @@ -51,14 +97,41 @@ export abstract class UserData { */ public abstract addCommands(...commands: string[]): void; + /** + * Add one or more commands to the user data that will run when the script exits. + */ + public abstract addOnExitCommands(...commands: string[]): void; + /** * Render the UserData for use in a construct */ public abstract render(): string; + + /** + * Adds commands to download a file from S3 + * + * @returns: The local path that the file will be downloaded to + */ + public abstract addS3DownloadCommand(params: S3DownloadOptions): string; + + /** + * Adds commands to execute a file + */ + public abstract addExecuteFileCommand( params: ExecuteFileOptions): void; + + /** + * Adds a command which will send a cfn-signal when the user data script ends + */ + public abstract addSignalOnExitCommand( resource: Resource ): void; + } +/** + * Linux Instance User Data + */ class LinuxUserData extends UserData { private readonly lines: string[] = []; + private readonly onExitLines: string[] = []; constructor(private readonly props: LinuxUserDataOptions = {}) { super(); @@ -68,14 +141,54 @@ class LinuxUserData extends UserData { this.lines.push(...commands); } + public addOnExitCommands(...commands: string[]) { + this.onExitLines.push(...commands); + } + public render(): string { const shebang = this.props.shebang !== undefined ? this.props.shebang : '#!/bin/bash'; - return [shebang, ...this.lines].join('\n'); + return [shebang, ...(this.renderOnExitLines()), ...this.lines].join('\n'); + } + + public addS3DownloadCommand(params: S3DownloadOptions): string { + const s3Path = `s3://${params.bucket.bucketName}/${params.bucketKey}`; + const localPath = ( params.localFile && params.localFile.length !== 0 ) ? params.localFile : `/tmp/${ params.bucketKey }`; + this.addCommands( + `mkdir -p $(dirname '${localPath}')`, + `aws s3 cp '${s3Path}' '${localPath}'` + ); + + return localPath; + } + + public addExecuteFileCommand( params: ExecuteFileOptions): void { + this.addCommands( + `set -e`, + `chmod +x '${params.filePath}'`, + `'${params.filePath}' ${params.arguments}` + ); + } + + public addSignalOnExitCommand( resource: Resource ): void { + const stack = Stack.of(resource); + const resourceID = stack.getLogicalId(resource.node.defaultChild as CfnElement); + this.addOnExitCommands(`/opt/aws/bin/cfn-signal --stack ${stack.stackName} --resource ${resourceID} --region ${stack.region} -e $exitCode || echo 'Failed to send Cloudformation Signal'`); + } + + private renderOnExitLines(): string[] { + if ( this.onExitLines.length > 0 ) { + return [ 'function exitTrap(){', 'exitCode=$?', ...this.onExitLines, '}', 'trap exitTrap EXIT' ]; + } + return []; } } +/** + * Windows Instance User Data + */ class WindowsUserData extends UserData { private readonly lines: string[] = []; + private readonly onExitLines: string[] = []; constructor() { super(); @@ -85,11 +198,53 @@ class WindowsUserData extends UserData { this.lines.push(...commands); } + public addOnExitCommands(...commands: string[]) { + this.onExitLines.push(...commands); + } + public render(): string { - return `${this.lines.join('\n')}`; + return `${ + [...(this.renderOnExitLines()), + ...this.lines, + ...( this.onExitLines.length > 0 ? ['throw "Success"'] : [] ) + ].join('\n') + }`; + } + + public addS3DownloadCommand(params: S3DownloadOptions): string { + const localPath = ( params.localFile && params.localFile.length !== 0 ) ? params.localFile : `C:/temp/${ params.bucketKey }`; + this.addCommands( + `mkdir (Split-Path -Path '${localPath}' ) -ea 0`, + `Read-S3Object -BucketName '${params.bucket.bucketName}' -key '${params.bucketKey}' -file '${localPath}' -ErrorAction Stop` + ); + return localPath; + } + + public addExecuteFileCommand( params: ExecuteFileOptions): void { + this.addCommands( + `&'${params.filePath}' ${params.arguments}`, + `if (!$?) { Write-Error 'Failed to execute the file "${params.filePath}"' -ErrorAction Stop }` + ); + } + + public addSignalOnExitCommand( resource: Resource ): void { + const stack = Stack.of(resource); + const resourceID = stack.getLogicalId(resource.node.defaultChild as CfnElement); + + this.addOnExitCommands(`cfn-signal --stack ${stack.stackName} --resource ${resourceID} --region ${stack.region} --success ($success.ToString().ToLower())`); + } + + private renderOnExitLines(): string[] { + if ( this.onExitLines.length > 0 ) { + return ['trap {', '$success=($PSItem.Exception.Message -eq "Success")', ...this.onExitLines, 'break', '}']; + } + return []; } } +/** + * Custom Instance User Data + */ class CustomUserData extends UserData { private readonly lines: string[] = []; @@ -101,7 +256,23 @@ class CustomUserData extends UserData { this.lines.push(...commands); } + public addOnExitCommands(): void { + throw new Error("CustomUserData does not support addOnExitCommands, use UserData.forLinux() or UserData.forWindows() instead."); + } + public render(): string { return this.lines.join('\n'); } + + public addS3DownloadCommand(): string { + throw new Error("CustomUserData does not support addS3DownloadCommand, use UserData.forLinux() or UserData.forWindows() instead."); + } + + public addExecuteFileCommand(): void { + throw new Error("CustomUserData does not support addExecuteFileCommand, use UserData.forLinux() or UserData.forWindows() instead."); + } + + public addSignalOnExitCommand(): void { + throw new Error("CustomUserData does not support addSignalOnExitCommand, use UserData.forLinux() or UserData.forWindows() instead."); + } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ec2/package.json b/packages/@aws-cdk/aws-ec2/package.json index bbe0616a76acf..67f6556ad807b 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.25.0", + "version": "0.0.0", "description": "CDK Constructs for AWS EC2", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,32 +62,32 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-logs": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/aws-ssm": "1.25.0", - "@aws-cdk/core": "1.25.0", - "@aws-cdk/cx-api": "1.25.0" + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-logs": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/aws-ssm": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/cx-api": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-logs": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/aws-ssm": "1.25.0", - "@aws-cdk/core": "1.25.0", - "@aws-cdk/cx-api": "1.25.0" + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-logs": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/aws-ssm": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/cx-api": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-ec2/test/test.userdata.ts b/packages/@aws-cdk/aws-ec2/test/test.userdata.ts index 48ba004fd56dd..83ea9cf2f0b18 100644 --- a/packages/@aws-cdk/aws-ec2/test/test.userdata.ts +++ b/packages/@aws-cdk/aws-ec2/test/test.userdata.ts @@ -1,4 +1,6 @@ +import { Bucket } from '@aws-cdk/aws-s3'; import { Test } from 'nodeunit'; +import { Stack } from "../../core/lib"; import * as ec2 from '../lib'; export = { @@ -14,6 +16,99 @@ export = { test.equals(rendered, 'command1\ncommand2'); test.done(); }, + 'can create Windows user data with commands on exit'(test: Test) { + // GIVEN + const userData = ec2.UserData.forWindows(); + + // WHEN + userData.addCommands('command1', 'command2'); + userData.addOnExitCommands('onexit1', 'onexit2'); + + // THEN + const rendered = userData.render(); + test.equals(rendered, 'trap {\n' + + '$success=($PSItem.Exception.Message -eq "Success")\n' + + 'onexit1\n' + + 'onexit2\n' + + 'break\n' + + '}\n' + + 'command1\n' + + 'command2\n' + + 'throw "Success"'); + test.done(); + }, + 'can create Windows with Signal Command'(test: Test) { + // GIVEN + const stack = new Stack(); + const resource = new ec2.Vpc(stack, 'RESOURCE'); + const userData = ec2.UserData.forWindows(); + + // WHEN + userData.addSignalOnExitCommand( resource ); + userData.addCommands("command1"); + + // THEN + const rendered = userData.render(); + + test.equals(rendered, 'trap {\n' + + '$success=($PSItem.Exception.Message -eq "Success")\n' + + 'cfn-signal --stack Stack --resource RESOURCE1989552F --region ${Token[AWS::Region.4]} --success ($success.ToString().ToLower())\n' + + 'break\n' + + '}\n' + + 'command1\n' + + 'throw "Success"' + ); + test.done(); + }, + 'can windows userdata download S3 files'(test: Test) { + // GIVEN + const stack = new Stack(); + const userData = ec2.UserData.forWindows(); + const bucket = Bucket.fromBucketName( stack, "testBucket", "test" ); + const bucket2 = Bucket.fromBucketName( stack, "testBucket2", "test2" ); + + // WHEN + userData.addS3DownloadCommand({ + bucket, + bucketKey: "filename.bat" + } ); + userData.addS3DownloadCommand({ + bucket: bucket2, + bucketKey: "filename2.bat", + localFile: "c:\\test\\location\\otherScript.bat" + } ); + + // THEN + const rendered = userData.render(); + test.equals(rendered, 'mkdir (Split-Path -Path \'C:/temp/filename.bat\' ) -ea 0\n' + + 'Read-S3Object -BucketName \'test\' -key \'filename.bat\' -file \'C:/temp/filename.bat\' -ErrorAction Stop\n' + + 'mkdir (Split-Path -Path \'c:\\test\\location\\otherScript.bat\' ) -ea 0\n' + + 'Read-S3Object -BucketName \'test2\' -key \'filename2.bat\' -file \'c:\\test\\location\\otherScript.bat\' -ErrorAction Stop' + ); + test.done(); + }, + 'can windows userdata execute files'(test: Test) { + // GIVEN + const userData = ec2.UserData.forWindows(); + + // WHEN + userData.addExecuteFileCommand({ + filePath: "C:\\test\\filename.bat", + } ); + userData.addExecuteFileCommand({ + filePath: "C:\\test\\filename2.bat", + arguments: "arg1 arg2 -arg $variable" + } ); + + // THEN + const rendered = userData.render(); + test.equals(rendered, '&\'C:\\test\\filename.bat\' undefined\n' + + 'if (!$?) { Write-Error \'Failed to execute the file "C:\\test\\filename.bat"\' -ErrorAction Stop }\n' + + '&\'C:\\test\\filename2.bat\' arg1 arg2 -arg $variable\n' + + 'if (!$?) { Write-Error \'Failed to execute the file "C:\\test\\filename2.bat"\' -ErrorAction Stop }' + ); + test.done(); + }, 'can create Linux user data'(test: Test) { // GIVEN @@ -26,6 +121,101 @@ export = { test.equals(rendered, '#!/bin/bash\ncommand1\ncommand2'); test.done(); }, + 'can create Linux user data with commands on exit'(test: Test) { + // GIVEN + const userData = ec2.UserData.forLinux(); + + // WHEN + userData.addCommands('command1', 'command2'); + userData.addOnExitCommands('onexit1', 'onexit2'); + + // THEN + const rendered = userData.render(); + test.equals(rendered, '#!/bin/bash\n' + + 'function exitTrap(){\n' + + 'exitCode=$?\n' + + 'onexit1\n' + + 'onexit2\n' + + '}\n' + + 'trap exitTrap EXIT\n' + + 'command1\n' + + 'command2'); + test.done(); + }, + 'can create Linux with Signal Command'(test: Test) { + // GIVEN + const stack = new Stack(); + const resource = new ec2.Vpc(stack, 'RESOURCE'); + + // WHEN + const userData = ec2.UserData.forLinux(); + userData.addCommands("command1"); + userData.addSignalOnExitCommand( resource ); + + // THEN + const rendered = userData.render(); + test.equals(rendered, '#!/bin/bash\n' + + 'function exitTrap(){\n' + + 'exitCode=$?\n' + + '/opt/aws/bin/cfn-signal --stack Stack --resource RESOURCE1989552F --region ${Token[AWS::Region.4]} -e $exitCode || echo \'Failed to send Cloudformation Signal\'\n' + + '}\n' + + 'trap exitTrap EXIT\n' + + 'command1'); + test.done(); + }, + 'can linux userdata download S3 files'(test: Test) { + // GIVEN + const stack = new Stack(); + const userData = ec2.UserData.forLinux(); + const bucket = Bucket.fromBucketName( stack, "testBucket", "test" ); + const bucket2 = Bucket.fromBucketName( stack, "testBucket2", "test2" ); + + // WHEN + userData.addS3DownloadCommand({ + bucket, + bucketKey: "filename.sh" + } ); + userData.addS3DownloadCommand({ + bucket: bucket2, + bucketKey: "filename2.sh", + localFile: "c:\\test\\location\\otherScript.sh" + } ); + + // THEN + const rendered = userData.render(); + test.equals(rendered, '#!/bin/bash\n' + + 'mkdir -p $(dirname \'/tmp/filename.sh\')\n' + + 'aws s3 cp \'s3://test/filename.sh\' \'/tmp/filename.sh\'\n' + + 'mkdir -p $(dirname \'c:\\test\\location\\otherScript.sh\')\n' + + 'aws s3 cp \'s3://test2/filename2.sh\' \'c:\\test\\location\\otherScript.sh\'' + ); + test.done(); + }, + 'can linux userdata execute files'(test: Test) { + // GIVEN + const userData = ec2.UserData.forLinux(); + + // WHEN + userData.addExecuteFileCommand({ + filePath: "/tmp/filename.sh", + } ); + userData.addExecuteFileCommand({ + filePath: "/test/filename2.sh", + arguments: "arg1 arg2 -arg $variable" + } ); + + // THEN + const rendered = userData.render(); + test.equals(rendered, '#!/bin/bash\n' + + 'set -e\n' + + 'chmod +x \'/tmp/filename.sh\'\n' + + '\'/tmp/filename.sh\' undefined\n' + + 'set -e\n' + + 'chmod +x \'/test/filename2.sh\'\n' + + '\'/test/filename2.sh\' arg1 arg2 -arg $variable' + ); + test.done(); + }, 'can create Custom user data'(test: Test) { // GIVEN @@ -37,4 +227,50 @@ export = { test.equals(rendered, 'Some\nmultiline\ncontent'); test.done(); }, + 'Custom user data throws when adding on exit commands'(test: Test) { + // GIVEN + // WHEN + const userData = ec2.UserData.custom(""); + + // THEN + test.throws(() => userData.addOnExitCommands( "a command goes here" )); + test.done(); + }, + 'Custom user data throws when adding signal command'(test: Test) { + // GIVEN + const stack = new Stack(); + const resource = new ec2.Vpc(stack, 'RESOURCE'); + + // WHEN + const userData = ec2.UserData.custom(""); + + // THEN + test.throws(() => userData.addSignalOnExitCommand( resource )); + test.done(); + }, + 'Custom user data throws when downloading file'(test: Test) { + // GIVEN + const stack = new Stack(); + const userData = ec2.UserData.custom(""); + const bucket = Bucket.fromBucketName( stack, "testBucket", "test" ); + // WHEN + // THEN + test.throws(() => userData.addS3DownloadCommand({ + bucket, + bucketKey: "filename.sh" + } )); + test.done(); + }, + 'Custom user data throws when executing file'(test: Test) { + // GIVEN + const userData = ec2.UserData.custom(""); + // WHEN + // THEN + test.throws(() => + userData.addExecuteFileCommand({ + filePath: "/tmp/filename.sh", + } )); + test.done(); + }, + }; diff --git a/packages/@aws-cdk/aws-ecr-assets/package.json b/packages/@aws-cdk/aws-ecr-assets/package.json index a3edc31cf453f..510540511f61c 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.25.0", + "version": "0.0.0", "description": "Docker image assets deployed to ECR", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -59,37 +59,37 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", "@types/proxyquire": "^1.3.28", - "aws-cdk": "1.25.0", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", + "aws-cdk": "0.0.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0", + "pkglint": "0.0.0", "proxyquire": "^2.1.3" }, "dependencies": { - "@aws-cdk/assets": "1.25.0", - "@aws-cdk/aws-cloudformation": "1.25.0", - "@aws-cdk/aws-ecr": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/core": "1.25.0", - "@aws-cdk/cx-api": "1.25.0", + "@aws-cdk/assets": "0.0.0", + "@aws-cdk/aws-cloudformation": "0.0.0", + "@aws-cdk/aws-ecr": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/cx-api": "0.0.0", "minimatch": "^3.0.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/assets": "1.25.0", - "@aws-cdk/aws-cloudformation": "1.25.0", - "@aws-cdk/aws-ecr": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/core": "1.25.0", - "@aws-cdk/cx-api": "1.25.0" + "@aws-cdk/assets": "0.0.0", + "@aws-cdk/aws-cloudformation": "0.0.0", + "@aws-cdk/aws-ecr": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/cx-api": "0.0.0" }, "nyc": { "statements": 70 diff --git a/packages/@aws-cdk/aws-ecr/package.json b/packages/@aws-cdk/aws-ecr/package.json index b0de4018cfe0f..c9f0f6b72a750 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-ecs-patterns/package.json b/packages/@aws-cdk/aws-ecs-patterns/package.json index fcd5590da2122..f805466ff8255 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "jest": "^24.9.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-applicationautoscaling": "1.25.0", - "@aws-cdk/aws-certificatemanager": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-ecs": "1.25.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.25.0", - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-events-targets": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-route53": "1.25.0", - "@aws-cdk/aws-route53-targets": "1.25.0", - "@aws-cdk/aws-servicediscovery": "1.25.0", - "@aws-cdk/aws-sqs": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-applicationautoscaling": "0.0.0", + "@aws-cdk/aws-certificatemanager": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-ecs": "0.0.0", + "@aws-cdk/aws-elasticloadbalancingv2": "0.0.0", + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-events-targets": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-route53": "0.0.0", + "@aws-cdk/aws-route53-targets": "0.0.0", + "@aws-cdk/aws-servicediscovery": "0.0.0", + "@aws-cdk/aws-sqs": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-applicationautoscaling": "1.25.0", - "@aws-cdk/aws-certificatemanager": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-ecs": "1.25.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.25.0", - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-events-targets": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-route53": "1.25.0", - "@aws-cdk/aws-route53-targets": "1.25.0", - "@aws-cdk/aws-servicediscovery": "1.25.0", - "@aws-cdk/aws-sqs": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-applicationautoscaling": "0.0.0", + "@aws-cdk/aws-certificatemanager": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-ecs": "0.0.0", + "@aws-cdk/aws-elasticloadbalancingv2": "0.0.0", + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-events-targets": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-route53": "0.0.0", + "@aws-cdk/aws-route53-targets": "0.0.0", + "@aws-cdk/aws-servicediscovery": "0.0.0", + "@aws-cdk/aws-sqs": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-ecs/package.json b/packages/@aws-cdk/aws-ecs/package.json index a912631853a03..77a96eaa57e29 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.25.0", + "version": "0.0.0", "description": "The CDK Construct Library for AWS::ECS", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,67 +62,67 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.25.0", - "@aws-cdk/aws-s3-assets": "1.25.0", + "@aws-cdk/assert": "0.0.0", + "@aws-cdk/aws-s3-assets": "0.0.0", "@types/nodeunit": "^0.0.30", "@types/proxyquire": "^1.3.28", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0", + "pkglint": "0.0.0", "proxyquire": "^2.1.3" }, "dependencies": { - "@aws-cdk/aws-applicationautoscaling": "1.25.0", - "@aws-cdk/aws-autoscaling": "1.25.0", - "@aws-cdk/aws-autoscaling-hooktargets": "1.25.0", - "@aws-cdk/aws-certificatemanager": "1.25.0", - "@aws-cdk/aws-cloudformation": "1.25.0", - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-ecr": "1.25.0", - "@aws-cdk/aws-ecr-assets": "1.25.0", - "@aws-cdk/aws-elasticloadbalancing": "1.25.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-logs": "1.25.0", - "@aws-cdk/aws-route53": "1.25.0", - "@aws-cdk/aws-route53-targets": "1.25.0", - "@aws-cdk/aws-secretsmanager": "1.25.0", - "@aws-cdk/aws-servicediscovery": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/aws-sqs": "1.25.0", - "@aws-cdk/aws-ssm": "1.25.0", - "@aws-cdk/core": "1.25.0", - "@aws-cdk/cx-api": "1.25.0" + "@aws-cdk/aws-applicationautoscaling": "0.0.0", + "@aws-cdk/aws-autoscaling": "0.0.0", + "@aws-cdk/aws-autoscaling-hooktargets": "0.0.0", + "@aws-cdk/aws-certificatemanager": "0.0.0", + "@aws-cdk/aws-cloudformation": "0.0.0", + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-ecr": "0.0.0", + "@aws-cdk/aws-ecr-assets": "0.0.0", + "@aws-cdk/aws-elasticloadbalancing": "0.0.0", + "@aws-cdk/aws-elasticloadbalancingv2": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-logs": "0.0.0", + "@aws-cdk/aws-route53": "0.0.0", + "@aws-cdk/aws-route53-targets": "0.0.0", + "@aws-cdk/aws-secretsmanager": "0.0.0", + "@aws-cdk/aws-servicediscovery": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/aws-sqs": "0.0.0", + "@aws-cdk/aws-ssm": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/cx-api": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-applicationautoscaling": "1.25.0", - "@aws-cdk/aws-autoscaling": "1.25.0", - "@aws-cdk/aws-autoscaling-hooktargets": "1.25.0", - "@aws-cdk/aws-certificatemanager": "1.25.0", - "@aws-cdk/aws-cloudformation": "1.25.0", - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-ecr": "1.25.0", - "@aws-cdk/aws-ecr-assets": "1.25.0", - "@aws-cdk/aws-elasticloadbalancing": "1.25.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-logs": "1.25.0", - "@aws-cdk/aws-route53": "1.25.0", - "@aws-cdk/aws-route53-targets": "1.25.0", - "@aws-cdk/aws-secretsmanager": "1.25.0", - "@aws-cdk/aws-servicediscovery": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/aws-sqs": "1.25.0", - "@aws-cdk/aws-ssm": "1.25.0", - "@aws-cdk/core": "1.25.0", - "@aws-cdk/cx-api": "1.25.0" + "@aws-cdk/aws-applicationautoscaling": "0.0.0", + "@aws-cdk/aws-autoscaling": "0.0.0", + "@aws-cdk/aws-autoscaling-hooktargets": "0.0.0", + "@aws-cdk/aws-certificatemanager": "0.0.0", + "@aws-cdk/aws-cloudformation": "0.0.0", + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-ecr": "0.0.0", + "@aws-cdk/aws-ecr-assets": "0.0.0", + "@aws-cdk/aws-elasticloadbalancing": "0.0.0", + "@aws-cdk/aws-elasticloadbalancingv2": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-logs": "0.0.0", + "@aws-cdk/aws-route53": "0.0.0", + "@aws-cdk/aws-route53-targets": "0.0.0", + "@aws-cdk/aws-secretsmanager": "0.0.0", + "@aws-cdk/aws-servicediscovery": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/aws-sqs": "0.0.0", + "@aws-cdk/aws-ssm": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/cx-api": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-efs/package.json b/packages/@aws-cdk/aws-efs/package.json index 1cf60628a9e9c..d1f163adf1ccb 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 5b249f4b6a22d..d3e24bfe77261 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-autoscaling": "1.25.0", - "@aws-cdk/aws-cloudformation": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-ssm": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-autoscaling": "0.0.0", + "@aws-cdk/aws-cloudformation": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-ssm": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-autoscaling": "1.25.0", - "@aws-cdk/aws-cloudformation": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-ssm": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-autoscaling": "0.0.0", + "@aws-cdk/aws-cloudformation": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-ssm": "0.0.0", + "@aws-cdk/core": "0.0.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 4b62d4ff27761..c7f7b89610e39 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.25.0", + "version": "0.0.0", "description": "The CDK Construct Library for AWS::EKS", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -62,36 +62,36 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "aws-sdk": "^2.624.0", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "aws-sdk": "^2.630.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0", + "pkglint": "0.0.0", "sinon": "^9.0.0" }, "dependencies": { - "@aws-cdk/aws-autoscaling": "1.25.0", - "@aws-cdk/aws-cloudformation": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-ssm": "1.25.0", - "@aws-cdk/core": "1.25.0", - "@aws-cdk/custom-resources": "1.25.0" + "@aws-cdk/aws-autoscaling": "0.0.0", + "@aws-cdk/aws-cloudformation": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-ssm": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/custom-resources": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-autoscaling": "1.25.0", - "@aws-cdk/aws-cloudformation": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-ssm": "1.25.0", - "@aws-cdk/core": "1.25.0", - "@aws-cdk/custom-resources": "1.25.0" + "@aws-cdk/aws-autoscaling": "0.0.0", + "@aws-cdk/aws-cloudformation": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-ssm": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/custom-resources": "0.0.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 a04fdd6834005..c11b890ceed55 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 442f4c4f3fc86..ef4083a60e409 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 3d0fde84da1ba..4f13a547f8b64 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/core": "0.0.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 81fe55e7de16d..632e1dff3a261 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", "jest": "^24.9.0", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/assets": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/assets": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-elasticloadbalancingv2": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/assets": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/assets": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-elasticloadbalancingv2": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json b/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json index bc39b3d9cf55a..98c1f5c4c5771 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-certificatemanager": "1.25.0", - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-certificatemanager": "0.0.0", + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-certificatemanager": "1.25.0", - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-certificatemanager": "0.0.0", + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-elasticsearch/package.json b/packages/@aws-cdk/aws-elasticsearch/package.json index 3eb30b449899e..f8519187b3c98 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 ab88a544d3950..3c7868f268f2a 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 1b562fdeb6cdc..63ef0ed256214 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.25.0", + "version": "0.0.0", "description": "Event targets for AWS CloudWatch Events", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -84,45 +84,45 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.25.0", - "@aws-cdk/aws-codecommit": "1.25.0", - "aws-sdk": "^2.624.0", + "@aws-cdk/assert": "0.0.0", + "@aws-cdk/aws-codecommit": "0.0.0", + "aws-sdk": "^2.630.0", "aws-sdk-mock": "^5.0.0", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", "jest": "^24.9.0", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-cloudformation": "1.25.0", - "@aws-cdk/aws-codebuild": "1.25.0", - "@aws-cdk/aws-codepipeline": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-ecs": "1.25.0", - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/aws-sns-subscriptions": "1.25.0", - "@aws-cdk/aws-sqs": "1.25.0", - "@aws-cdk/aws-stepfunctions": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-cloudformation": "0.0.0", + "@aws-cdk/aws-codebuild": "0.0.0", + "@aws-cdk/aws-codepipeline": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-ecs": "0.0.0", + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/aws-sns-subscriptions": "0.0.0", + "@aws-cdk/aws-sqs": "0.0.0", + "@aws-cdk/aws-stepfunctions": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-cloudformation": "1.25.0", - "@aws-cdk/aws-codebuild": "1.25.0", - "@aws-cdk/aws-codepipeline": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-ecs": "1.25.0", - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/aws-sns-subscriptions": "1.25.0", - "@aws-cdk/aws-sqs": "1.25.0", - "@aws-cdk/aws-stepfunctions": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-cloudformation": "0.0.0", + "@aws-cdk/aws-codebuild": "0.0.0", + "@aws-cdk/aws-codepipeline": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-ecs": "0.0.0", + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/aws-sns-subscriptions": "0.0.0", + "@aws-cdk/aws-sqs": "0.0.0", + "@aws-cdk/aws-stepfunctions": "0.0.0", + "@aws-cdk/core": "0.0.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 19cd9cfca045b..90f55ff168a43 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/core": "0.0.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 7994d4c6aff51..542e310fd429b 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-fms/package.json b/packages/@aws-cdk/aws-fms/package.json index fe8f152d4488a..366aab56c53b5 100644 --- a/packages/@aws-cdk/aws-fms/package.json +++ b/packages/@aws-cdk/aws-fms/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-fms", - "version": "1.25.0", + "version": "0.0.0", "description": "The CDK Construct Library for AWS::FMS", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -65,16 +65,16 @@ "jest": {}, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 36f49f477b5c7..57968f44a914b 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 c52e528c66457..9473d8e31d81e 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-glue/package.json b/packages/@aws-cdk/aws-glue/package.json index f0ea5c7265320..bba7ef1c2ba20 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-greengrass/package.json b/packages/@aws-cdk/aws-greengrass/package.json index 091c62b201da3..e98344ba45bd6 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 be537ed6d7e10..33f346fb79b60 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-iam/package.json b/packages/@aws-cdk/aws-iam/package.json index ca31b069f0f85..51ed3a07af915 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "jest": "^24.9.0", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0", - "@aws-cdk/region-info": "1.25.0" + "@aws-cdk/core": "0.0.0", + "@aws-cdk/region-info": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0", - "@aws-cdk/region-info": "1.25.0" + "@aws-cdk/core": "0.0.0", + "@aws-cdk/region-info": "0.0.0" }, "jest": { "moduleFileExtensions": [ diff --git a/packages/@aws-cdk/aws-inspector/package.json b/packages/@aws-cdk/aws-inspector/package.json index 9e8150d080bc6..e295b5580f2bc 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 6c440a61d4901..ca76f7a3ed729 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 1f144bacc1271..412e1b14fc7ac 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 0440163eecec0..33a5d34264724 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 4f8d63c448ec8..1aebea50545c0 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 09f89a131dc0d..7937cb10e7cfb 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 0e01741cf8fb8..3314dd31e22fd 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/aws-logs": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/aws-logs": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/aws-logs": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/aws-logs": "0.0.0", + "@aws-cdk/core": "0.0.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 32e43a3ef4b95..96b425b500fa7 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 f9cf6b2376c34..27fd1d6fb65a9 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 9c6b43346283f..098b77434a96b 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/core": "0.0.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 38df0a8b4c39c..a12a96efc8277 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 2f8f99f0a4f1b..943a4cd5b1b6d 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.25.0", + "version": "0.0.0", "description": "CDK Destinations Constructs for AWS Lambda", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -76,29 +76,29 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.25.0", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "jest": "^24.9.0", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-events-targets": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/aws-sqs": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-events-targets": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/aws-sqs": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-events-targets": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/aws-sqs": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-events-targets": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/aws-sqs": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-lambda-event-sources/README.md b/packages/@aws-cdk/aws-lambda-event-sources/README.md index 515949dc8da3c..d2e13fcdb3184 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/README.md +++ b/packages/@aws-cdk/aws-lambda-event-sources/README.md @@ -9,6 +9,11 @@ --- +An event source mapping is an AWS Lambda resource that reads from an event source and invokes a Lambda function. +You can use event source mappings to process items from a stream or queue in services that don't invoke Lambda +functions directly. Lambda provides event source mappings for the following services. Read more about lambda +event sources [here](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html). + This module includes classes that allow using various AWS services as event sources for AWS Lambda via the high-level `lambda.addEventSource(source)` API. @@ -16,6 +21,21 @@ NOTE: In most cases, it is also possible to use the resource APIs to invoke an AWS Lambda function. This library provides a uniform API for all Lambda event sources regardless of the underlying mechanism they use. +The following code sets up a lambda function with an SQS queue event source - + +```ts +const fn = new lambda.Function(this, 'MyFunction', { /* ... */ }); + +const queue = new sqs.Queue(this, 'MyQueue'); +const eventSource = lambda.addEventSource(new SqsEventSource(queue); + +const eventSourceId = eventSource.eventSourceId; +``` + +The `eventSourceId` property contains the event source id. This will be a +[token](https://docs.aws.amazon.com/cdk/latest/guide/tokens.html) that will resolve to the final value at the time of +deployment. + ### SQS Amazon Simple Queue Service (Amazon SQS) allows you to build asynchronous @@ -116,7 +136,7 @@ To process events with a Lambda function, first create or update a DynamoDB tabl and add it to your Lambda function. The following parameters will impact Amazon DynamoDB's polling behavior: * __batchSize__: Determines how many records are buffered before invoking your lambda function - could impact your function's memory usage (if too high) and ability to keep up with incoming data velocity (if too low). -* __startingPosition__: Will determine where to being consumption, either at the most recent ('LATEST') record or the oldest record ('TRIM_HORIZON'). 'TRIM_HORIZON' will ensure you process all available data, while 'LATEST' will ignore all reocrds that arrived prior to attaching the event source. +* __startingPosition__: Will determine where to being consumption, either at the most recent ('LATEST') record or the oldest record ('TRIM_HORIZON'). 'TRIM_HORIZON' will ensure you process all available data, while 'LATEST' will ignore all records that arrived prior to attaching the event source. ```ts import dynamodb = require('@aws-cdk/aws-dynamodb'); @@ -145,8 +165,8 @@ first create or update an Amazon Kinesis stream and select custom values for the event source parameters. The following parameters will impact Amazon Kinesis's polling behavior: -* __batchSize__: Determines how many records are buffered before invoking your lambnda function - could impact your function's memory usage (if too high) and ability to keep up with incoming data velocity (if too low). -* __startingPosition__: Will determine where to being consumption, either at the most recent ('LATEST') record or the oldest record ('TRIM_HORIZON'). 'TRIM_HORIZON' will ensure you process all available data, while 'LATEST' will ignore all reocrds that arrived prior to attaching the event source. +* __batchSize__: Determines how many records are buffered before invoking your lambda function - could impact your function's memory usage (if too high) and ability to keep up with incoming data velocity (if too low). +* __startingPosition__: Will determine where to being consumption, either at the most recent ('LATEST') record or the oldest record ('TRIM_HORIZON'). 'TRIM_HORIZON' will ensure you process all available data, while 'LATEST' will ignore all records that arrived prior to attaching the event source. ```ts import lambda = require('@aws-cdk/aws-lambda'); diff --git a/packages/@aws-cdk/aws-lambda-event-sources/lib/dynamodb.ts b/packages/@aws-cdk/aws-lambda-event-sources/lib/dynamodb.ts index 82de57a8c10d6..9e520a6edd5f7 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/lib/dynamodb.ts +++ b/packages/@aws-cdk/aws-lambda-event-sources/lib/dynamodb.ts @@ -9,6 +9,8 @@ export interface DynamoEventSourceProps extends StreamEventSourceProps { * Use an Amazon DynamoDB stream as an event source for AWS Lambda. */ export class DynamoEventSource extends StreamEventSource { + private _eventSourceMappingId?: string = undefined; + constructor(private readonly table: dynamodb.Table, props: DynamoEventSourceProps) { super(props); @@ -22,10 +24,21 @@ export class DynamoEventSource extends StreamEventSource { throw new Error(`DynamoDB Streams must be enabled on the table ${this.table.node.path}`); } - target.addEventSourceMapping(`DynamoDBEventSource:${this.table.node.uniqueId}`, + const eventSourceMapping = target.addEventSourceMapping(`DynamoDBEventSource:${this.table.node.uniqueId}`, this.enrichMappingOptions({eventSourceArn: this.table.tableStreamArn}) ); + this._eventSourceMappingId = eventSourceMapping.eventSourceMappingId; this.table.grantStreamRead(target); } + + /** + * The identifier for this EventSourceMapping + */ + public get eventSourceMappingId(): string { + if (!this._eventSourceMappingId) { + throw new Error("DynamoEventSource is not yet bound to an event source mapping"); + } + return this._eventSourceMappingId; + } } diff --git a/packages/@aws-cdk/aws-lambda-event-sources/lib/kinesis.ts b/packages/@aws-cdk/aws-lambda-event-sources/lib/kinesis.ts index 78351d428f9d0..f6b83f6be2638 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/lib/kinesis.ts +++ b/packages/@aws-cdk/aws-lambda-event-sources/lib/kinesis.ts @@ -9,6 +9,8 @@ export interface KinesisEventSourceProps extends StreamEventSourceProps { * Use an Amazon Kinesis stream as an event source for AWS Lambda. */ export class KinesisEventSource extends StreamEventSource { + private _eventSourceMappingId?: string = undefined; + constructor(readonly stream: kinesis.IStream, props: KinesisEventSourceProps) { super(props); @@ -18,10 +20,21 @@ export class KinesisEventSource extends StreamEventSource { } public bind(target: lambda.IFunction) { - target.addEventSourceMapping(`KinesisEventSource:${this.stream.node.uniqueId}`, + const eventSourceMapping = target.addEventSourceMapping(`KinesisEventSource:${this.stream.node.uniqueId}`, this.enrichMappingOptions({eventSourceArn: this.stream.streamArn}) ); + this._eventSourceMappingId = eventSourceMapping.eventSourceMappingId; this.stream.grantRead(target); } + + /** + * The identifier for this EventSourceMapping + */ + public get eventSourceMappingId(): string { + if (!this._eventSourceMappingId) { + throw new Error("KinesisEventSource is not yet bound to an event source mapping"); + } + return this._eventSourceMappingId; + } } diff --git a/packages/@aws-cdk/aws-lambda-event-sources/lib/sqs.ts b/packages/@aws-cdk/aws-lambda-event-sources/lib/sqs.ts index 515659dcecfc2..4b15e1b8e4b5d 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/lib/sqs.ts +++ b/packages/@aws-cdk/aws-lambda-event-sources/lib/sqs.ts @@ -18,6 +18,8 @@ export interface SqsEventSourceProps { * Use an Amazon SQS queue as an event source for AWS Lambda. */ export class SqsEventSource implements lambda.IEventSource { + private _eventSourceMappingId?: string = undefined; + constructor(readonly queue: sqs.IQueue, private readonly props: SqsEventSourceProps = { }) { if (this.props.batchSize !== undefined && (this.props.batchSize < 1 || this.props.batchSize > 10)) { throw new Error(`Maximum batch size must be between 1 and 10 inclusive (given ${this.props.batchSize})`); @@ -25,11 +27,22 @@ export class SqsEventSource implements lambda.IEventSource { } public bind(target: lambda.IFunction) { - target.addEventSourceMapping(`SqsEventSource:${this.queue.node.uniqueId}`, { + const eventSourceMapping = target.addEventSourceMapping(`SqsEventSource:${this.queue.node.uniqueId}`, { batchSize: this.props.batchSize, eventSourceArn: this.queue.queueArn, }); + this._eventSourceMappingId = eventSourceMapping.eventSourceMappingId; this.queue.grantConsumeMessages(target); } + + /** + * The identifier for this EventSourceMapping + */ + public get eventSourceMappingId(): string { + if (!this._eventSourceMappingId) { + throw new Error("SqsEventSource is not yet bound to an event source mapping"); + } + return this._eventSourceMappingId; + } } diff --git a/packages/@aws-cdk/aws-lambda-event-sources/package.json b/packages/@aws-cdk/aws-lambda-event-sources/package.json index e500bd472bf1d..d2ee20da02588 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-apigateway": "1.25.0", - "@aws-cdk/aws-dynamodb": "1.25.0", - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kinesis": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/aws-s3-notifications": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/aws-sns-subscriptions": "1.25.0", - "@aws-cdk/aws-sqs": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-apigateway": "0.0.0", + "@aws-cdk/aws-dynamodb": "0.0.0", + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kinesis": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/aws-s3-notifications": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/aws-sns-subscriptions": "0.0.0", + "@aws-cdk/aws-sqs": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-apigateway": "1.25.0", - "@aws-cdk/aws-dynamodb": "1.25.0", - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kinesis": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/aws-s3-notifications": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/aws-sns-subscriptions": "1.25.0", - "@aws-cdk/aws-sqs": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-apigateway": "0.0.0", + "@aws-cdk/aws-dynamodb": "0.0.0", + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kinesis": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/aws-s3-notifications": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/aws-sns-subscriptions": "0.0.0", + "@aws-cdk/aws-sqs": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/test.dynamo.ts b/packages/@aws-cdk/aws-lambda-event-sources/test/test.dynamo.ts index 68b12725af0e3..437cbd556ae64 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/test/test.dynamo.ts +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/test.dynamo.ts @@ -231,4 +231,46 @@ export = { test.done(); }, + 'contains eventSourceMappingId after lambda binding'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + const fn = new TestFunction(stack, 'Fn'); + const table = new dynamodb.Table(stack, 'T', { + partitionKey: { + name: 'id', + type: dynamodb.AttributeType.STRING + }, + stream: dynamodb.StreamViewType.NEW_IMAGE + }); + const eventSource = new sources.DynamoEventSource(table, { + startingPosition: lambda.StartingPosition.TRIM_HORIZON + }); + + // WHEN + fn.addEventSource(eventSource); + + // THEN + test.ok(eventSource.eventSourceMappingId); + test.done(); + }, + + 'eventSourceMappingId throws error before binding to lambda'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + const table = new dynamodb.Table(stack, 'T', { + partitionKey: { + name: 'id', + type: dynamodb.AttributeType.STRING + }, + stream: dynamodb.StreamViewType.NEW_IMAGE + }); + const eventSource = new sources.DynamoEventSource(table, { + startingPosition: lambda.StartingPosition.TRIM_HORIZON + }); + + // WHEN/THEN + test.throws(() => eventSource.eventSourceMappingId, /DynamoEventSource is not yet bound to an event source mapping/); + test.done(); + }, + }; diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/test.kinesis.ts b/packages/@aws-cdk/aws-lambda-event-sources/test/test.kinesis.ts index 53bd8eb3b0c27..a1427af34b3da 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/test/test.kinesis.ts +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/test.kinesis.ts @@ -153,4 +153,34 @@ export = { test.done(); }, + + 'contains eventSourceMappingId after lambda binding'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + const fn = new TestFunction(stack, 'Fn'); + const stream = new kinesis.Stream(stack, 'S'); + const eventSource = new sources.KinesisEventSource(stream, { + startingPosition: lambda.StartingPosition.TRIM_HORIZON + }); + + // WHEN + fn.addEventSource(eventSource); + + // THEN + test.ok(eventSource.eventSourceMappingId); + test.done(); + }, + + 'eventSourceMappingId throws error before binding to lambda'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + const stream = new kinesis.Stream(stack, 'S'); + const eventSource = new sources.KinesisEventSource(stream, { + startingPosition: lambda.StartingPosition.TRIM_HORIZON + }); + + // WHEN/THEN + test.throws(() => eventSource.eventSourceMappingId, /KinesisEventSource is not yet bound to an event source mapping/); + test.done(); + }, }; diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/test.sqs.ts b/packages/@aws-cdk/aws-lambda-event-sources/test/test.sqs.ts index 90587f38ebdf2..3c596c1f8845d 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/test/test.sqs.ts +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/test.sqs.ts @@ -112,4 +112,30 @@ export = { test.done(); }, + + 'contains eventSourceMappingId after lambda binding'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + const fn = new TestFunction(stack, 'Fn'); + const q = new sqs.Queue(stack, 'Q'); + const eventSource = new sources.SqsEventSource(q); + + // WHEN + fn.addEventSource(eventSource); + + // THEN + test.ok(eventSource.eventSourceMappingId); + test.done(); + }, + + 'eventSourceMappingId throws error before binding to lambda'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + const q = new sqs.Queue(stack, 'Q'); + const eventSource = new sources.SqsEventSource(q); + + // WHEN/THEN + test.throws(() => eventSource.eventSourceMappingId, /SqsEventSource is not yet bound to an event source mapping/); + test.done(); + }, }; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/package.json b/packages/@aws-cdk/aws-lambda-nodejs/package.json index 24df1dfea72db..6872d26d2b630 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/package.json +++ b/packages/@aws-cdk/aws-lambda-nodejs/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/aws-lambda-nodejs", - "version": "1.25.0", + "version": "0.0.0", "description": "CDK Constructs for AWS Lambda in Node.js", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -84,24 +84,24 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.25.0", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", "fs-extra": "^8.1.0", "parcel-bundler": "^1.12.4", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" }, "stability": "experimental" -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda/lib/event-source-mapping.ts b/packages/@aws-cdk/aws-lambda/lib/event-source-mapping.ts index a30a277af3f31..d4f7f3f4c9012 100644 --- a/packages/@aws-cdk/aws-lambda/lib/event-source-mapping.ts +++ b/packages/@aws-cdk/aws-lambda/lib/event-source-mapping.ts @@ -67,6 +67,12 @@ export interface EventSourceMappingProps extends EventSourceMappingOptions { * modify the Lambda's execution role so it can consume messages from the queue. */ export class EventSourceMapping extends cdk.Resource { + /** + * The identifier for this EventSourceMapping + * @attribute + */ + public readonly eventSourceMappingId: string; + constructor(scope: cdk.Construct, id: string, props: EventSourceMappingProps) { super(scope, id); @@ -74,7 +80,7 @@ export class EventSourceMapping extends cdk.Resource { throw new Error(`maxBatchingWindow cannot be over 300 seconds, got ${props.maxBatchingWindow.toSeconds()}`); } - new CfnEventSourceMapping(this, 'Resource', { + const cfnEventSourceMapping = new CfnEventSourceMapping(this, 'Resource', { batchSize: props.batchSize, enabled: props.enabled, eventSourceArn: props.eventSourceArn, @@ -82,6 +88,7 @@ export class EventSourceMapping extends cdk.Resource { startingPosition: props.startingPosition, maximumBatchingWindowInSeconds: props.maxBatchingWindow && props.maxBatchingWindow.toSeconds(), }); + this.eventSourceMappingId = cfnEventSourceMapping.ref; } } diff --git a/packages/@aws-cdk/aws-lambda/package.json b/packages/@aws-cdk/aws-lambda/package.json index a45e25a5c2cc7..c0477da1d43d2 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.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.624.0", + "@types/sinon": "^7.5.2", + "aws-sdk": "^2.630.0", "aws-sdk-mock": "^5.0.0", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "lodash": "^4.17.15", - "nock": "^12.0.0", + "nock": "^12.0.2", "nodeunit": "^0.11.3", - "pkglint": "1.25.0", + "pkglint": "0.0.0", "sinon": "^9.0.0" }, "dependencies": { - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-logs": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/aws-s3-assets": "1.25.0", - "@aws-cdk/aws-sqs": "1.25.0", - "@aws-cdk/core": "1.25.0", - "@aws-cdk/cx-api": "1.25.0" + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-logs": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/aws-s3-assets": "0.0.0", + "@aws-cdk/aws-sqs": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/cx-api": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-logs": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/aws-s3-assets": "1.25.0", - "@aws-cdk/aws-sqs": "1.25.0", - "@aws-cdk/core": "1.25.0", - "@aws-cdk/cx-api": "1.25.0" + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-logs": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/aws-s3-assets": "0.0.0", + "@aws-cdk/aws-sqs": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/cx-api": "0.0.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 9ed13ef521453..f2c3216a0a38d 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "jest": "^24.9.0", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kinesis": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-logs": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kinesis": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-logs": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kinesis": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-logs": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kinesis": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-logs": "0.0.0", + "@aws-cdk/core": "0.0.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 af4c06fedcc6f..4a7b8a9f93801 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/core": "0.0.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 d76050a2fd5f5..dc6c02864f58f 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 d8f31e8b98499..153331dda179a 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 efa12a2f0e7ed..8715e3403468a 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 2e4207a300852..d08d8453d7c3c 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 ab95655379ff8..252cdee501461 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 69e8d01e1ce0d..d893abf3a7cf7 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 9a621058ae2b8..604c30e93ad31 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 c6123b5178751..c57d6a4046eb0 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 767ea9de44785..333b99fc763ec 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 c79aaae7652d3..8a5fae2e5b4e7 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 fddd295e8880c..3411e79474b92 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 a1357e1ba321c..511ac20c3ec61 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-rds/README.md b/packages/@aws-cdk/aws-rds/README.md index 838e6c5a84258..2d2b4b56a8508 100644 --- a/packages/@aws-cdk/aws-rds/README.md +++ b/packages/@aws-cdk/aws-rds/README.md @@ -119,7 +119,7 @@ instance.addRotationSingleUser(); // Will rotate automatically after 30 days The multi user rotation scheme is also available: ```ts instance.addRotationMultiUser('MyUser', { - secret: myImportedSecret + secret: myImportedSecret // This secret must have the `masterarn` key }); ``` @@ -127,6 +127,7 @@ It's also possible to create user credentials together with the instance/cluster ```ts const myUserSecret = new rds.DatabaseSecret(this, 'MyUserSecret', { username: 'myuser' + masterSecret: instance.secret }); const myUserSecretAttached = myUserSecret.attach(instance); // Adds DB connections information in the secret diff --git a/packages/@aws-cdk/aws-rds/lib/database-secret.ts b/packages/@aws-cdk/aws-rds/lib/database-secret.ts index c16e53be0de3b..a51a16b1448a4 100644 --- a/packages/@aws-cdk/aws-rds/lib/database-secret.ts +++ b/packages/@aws-cdk/aws-rds/lib/database-secret.ts @@ -17,6 +17,13 @@ export interface DatabaseSecretProps { * @default default master key */ readonly encryptionKey?: kms.IKey; + + /** + * The master secret which will be used to rotate this secret. + * + * @default - no master secret information will be included + */ + readonly masterSecret?: secretsmanager.ISecret; } /** @@ -31,7 +38,10 @@ export class DatabaseSecret extends secretsmanager.Secret { description: `Generated by the CDK for stack: ${Aws.STACK_NAME}`, generateSecretString: { passwordLength: 30, // Oracle password cannot have more than 30 characters - secretStringTemplate: JSON.stringify({ username: props.username }), + secretStringTemplate: JSON.stringify({ + username: props.username, + masterarn: props.masterSecret?.secretArn + }), generateStringKey: 'password', excludeCharacters: '"@/\\' } diff --git a/packages/@aws-cdk/aws-rds/package.json b/packages/@aws-cdk/aws-rds/package.json index 91103f853db36..aaa3ffe0c532e 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.25.0", + "version": "0.0.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.25.0", - "@aws-cdk/aws-events-targets": "1.25.0", + "@aws-cdk/assert": "0.0.0", + "@aws-cdk/aws-events-targets": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-logs": "1.25.0", - "@aws-cdk/aws-secretsmanager": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-logs": "0.0.0", + "@aws-cdk/aws-secretsmanager": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-logs": "1.25.0", - "@aws-cdk/aws-secretsmanager": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-logs": "0.0.0", + "@aws-cdk/aws-secretsmanager": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-rds/test/test.database-secret.ts b/packages/@aws-cdk/aws-rds/test/test.database-secret.ts new file mode 100644 index 0000000000000..f4552d50bdb25 --- /dev/null +++ b/packages/@aws-cdk/aws-rds/test/test.database-secret.ts @@ -0,0 +1,76 @@ +import { expect, haveResource } from '@aws-cdk/assert'; +import { Stack } from '@aws-cdk/core'; +import { Test } from 'nodeunit'; +import { DatabaseSecret } from '../lib'; + +export = { + 'create a database secret'(test: Test) { + // GIVEN + const stack = new Stack(); + + // WHEN + new DatabaseSecret(stack, 'Secret', { + username: 'admin-username' + }); + + // THEN + expect(stack).to(haveResource('AWS::SecretsManager::Secret', { + Description: { + 'Fn::Join': [ + '', + [ + 'Generated by the CDK for stack: ', + { + Ref: 'AWS::StackName' + } + ] + ] + }, + GenerateSecretString: { + ExcludeCharacters: '"@/\\', + GenerateStringKey: 'password', + PasswordLength: 30, + SecretStringTemplate: '{"username":"admin-username"}' + } + })); + + test.done(); + }, + + 'with master secret'(test: Test) { + // GIVEN + const stack = new Stack(); + const masterSecret = new DatabaseSecret(stack, 'MasterSecret', { + username: 'master-username' + }); + + // WHEN + new DatabaseSecret(stack, 'UserSecret', { + username: 'user-username', + masterSecret, + }); + + // THEN + expect(stack).to(haveResource('AWS::SecretsManager::Secret', { + GenerateSecretString: { + ExcludeCharacters: '"@/\\', + GenerateStringKey: 'password', + PasswordLength: 30, + SecretStringTemplate: { + 'Fn::Join': [ + '', + [ + '{"username":"user-username","masterarn":"', + { + Ref: 'MasterSecretA11BF785' + }, + '"}' + ] + ] + } + } + })); + + test.done(); + }, +}; diff --git a/packages/@aws-cdk/aws-redshift/package.json b/packages/@aws-cdk/aws-redshift/package.json index 1169081f7d4b9..ef51226d36a6f 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 a5c83608192ba..7058249b529b9 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 d11a04a1d6b07..536bd122fe505 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "jest": "^24.9.0", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-certificatemanager": "1.25.0", - "@aws-cdk/aws-cloudfront": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-route53": "1.25.0", - "@aws-cdk/aws-route53-targets": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/core": "1.25.0", - "@aws-cdk/region-info": "1.25.0" + "@aws-cdk/aws-certificatemanager": "0.0.0", + "@aws-cdk/aws-cloudfront": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-route53": "0.0.0", + "@aws-cdk/aws-route53-targets": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/region-info": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-certificatemanager": "1.25.0", - "@aws-cdk/aws-cloudfront": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-route53": "1.25.0", - "@aws-cdk/aws-route53-targets": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/core": "1.25.0", - "@aws-cdk/region-info": "1.25.0" + "@aws-cdk/aws-certificatemanager": "0.0.0", + "@aws-cdk/aws-cloudfront": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-route53": "0.0.0", + "@aws-cdk/aws-route53-targets": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/region-info": "0.0.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 5bbc6b13dc04a..050a5846cd601 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.25.0", + "version": "0.0.0", "description": "CDK Constructs for AWS Route53 Alias Targets", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -76,39 +76,39 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/assert": "1.25.0", - "@aws-cdk/aws-certificatemanager": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "@aws-cdk/assert": "0.0.0", + "@aws-cdk/aws-certificatemanager": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "jest": "^24.9.0", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-apigateway": "1.25.0", - "@aws-cdk/aws-cloudfront": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-elasticloadbalancing": "1.25.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-route53": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/core": "1.25.0", - "@aws-cdk/region-info": "1.25.0" + "@aws-cdk/aws-apigateway": "0.0.0", + "@aws-cdk/aws-cloudfront": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-elasticloadbalancing": "0.0.0", + "@aws-cdk/aws-elasticloadbalancingv2": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-route53": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/region-info": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-apigateway": "1.25.0", - "@aws-cdk/aws-cloudfront": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-elasticloadbalancing": "1.25.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-route53": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/core": "1.25.0", - "@aws-cdk/region-info": "1.25.0" + "@aws-cdk/aws-apigateway": "0.0.0", + "@aws-cdk/aws-cloudfront": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-elasticloadbalancing": "0.0.0", + "@aws-cdk/aws-elasticloadbalancingv2": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-route53": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/region-info": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-route53/package.json b/packages/@aws-cdk/aws-route53/package.json index 332d08e47dfa6..d6d3fc63fdfd6 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "aws-sdk": "^2.624.0", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "aws-sdk": "^2.630.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-logs": "1.25.0", - "@aws-cdk/core": "1.25.0", - "@aws-cdk/cx-api": "1.25.0" + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-logs": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/cx-api": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-logs": "1.25.0", - "@aws-cdk/core": "1.25.0", - "@aws-cdk/cx-api": "1.25.0" + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-logs": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/cx-api": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-route53resolver/package.json b/packages/@aws-cdk/aws-route53resolver/package.json index b85f0e14b2232..1a9b01155de3c 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 3f38853857e1c..91b459f9ce360 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "@types/sinon": "^7.5.0", - "aws-cdk": "1.25.0", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", + "@types/sinon": "^7.5.2", + "aws-cdk": "0.0.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0", + "pkglint": "0.0.0", "sinon": "^9.0.0", "ts-mock-imports": "^1.2.6" }, "dependencies": { - "@aws-cdk/assets": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/core": "1.25.0", - "@aws-cdk/cx-api": "1.25.0" + "@aws-cdk/assets": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/cx-api": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/assets": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/core": "1.25.0", - "@aws-cdk/cx-api": "1.25.0" + "@aws-cdk/assets": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/cx-api": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-s3-deployment/package.json b/packages/@aws-cdk/aws-s3-deployment/package.json index ac7b7c84c1cb3..3b5dd048451d8 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-cloudformation": "1.25.0", - "@aws-cdk/aws-cloudfront": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/aws-s3-assets": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-cloudformation": "0.0.0", + "@aws-cdk/aws-cloudfront": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/aws-s3-assets": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-cloudformation": "1.25.0", - "@aws-cdk/aws-cloudfront": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/aws-s3-assets": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-cloudformation": "0.0.0", + "@aws-cdk/aws-cloudfront": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/aws-s3-assets": "0.0.0", + "@aws-cdk/core": "0.0.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 5720b5bef0b6e..05efd8f4b8414 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", "jest": "^24.9.0", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/aws-sqs": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/aws-sqs": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/aws-sqs": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/aws-sqs": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-s3/package.json b/packages/@aws-cdk/aws-s3/package.json index 718e6110337f4..e431071d25f04 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-sagemaker/package.json b/packages/@aws-cdk/aws-sagemaker/package.json index 6e07541067c0f..6cb69d57b6f2d 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 124d5b5fa78e4..a065f9c7c02c3 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/jest": "^25.1.2", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", "jest": "^24.9.0", - "pkglint": "1.25.0", + "pkglint": "0.0.0", "ts-jest": "^25.2.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "jest": {}, "engines": { diff --git a/packages/@aws-cdk/aws-sdb/package.json b/packages/@aws-cdk/aws-sdb/package.json index dba5f0ec5e475..861ebedc27256 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 ab4fd6fd3db0e..fb48b7f5ec704 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-sam": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-sam": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-sam": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-sam": "0.0.0", + "@aws-cdk/core": "0.0.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 1dc1ee9e9c577..0b0a909ae9231 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 843af220a1c93..f63849ee1efae 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 6792dc55a015a..738d71ceba0a7 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.25.0", - "@aws-cdk/aws-route53": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-elasticloadbalancingv2": "0.0.0", + "@aws-cdk/aws-route53": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.25.0", - "@aws-cdk/aws-route53": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-elasticloadbalancingv2": "0.0.0", + "@aws-cdk/aws-route53": "0.0.0", + "@aws-cdk/core": "0.0.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 f6b5b525c1bf6..7b6d529c0c7fe 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "jest": "^24.9.0", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/aws-ses": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/aws-ses": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/aws-ses": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/aws-ses": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/core": "0.0.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 e91da4391b182..5a7b887bb33fb 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-sns-subscriptions/README.md b/packages/@aws-cdk/aws-sns-subscriptions/README.md index 416177f518138..1956484a309ee 100644 --- a/packages/@aws-cdk/aws-sns-subscriptions/README.md +++ b/packages/@aws-cdk/aws-sns-subscriptions/README.md @@ -31,7 +31,7 @@ const myTopic = new sns.Topic(this, 'MyTopic'); ### HTTPS -Add an HTTPS Subscription to your topic: +Add an HTTP or HTTPS Subscription to your topic: ```ts import subscriptions = require('@aws-cdk/aws-sns-subscriptions'); @@ -39,6 +39,16 @@ import subscriptions = require('@aws-cdk/aws-sns-subscriptions'); myTopic.addSubscription(new subscriptions.UrlSubscription('https://foobar.com/')); ``` +The URL being subscribed can also be [tokens](https://docs.aws.amazon.com/cdk/latest/guide/tokens.html), that resolve +to a URL during deployment. A typical use case is when the URL is passed in as a [CloudFormation +parameter](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html). The +following code defines a CloudFormation parameter and uses it in a URL subscription. + +```ts +const url = new CfnParameter(this, 'url-param'); +myTopic.addSubscription(new subscriptions.UrlSubscription(url.valueAsString())); +``` + ### Amazon SQS Subscribe a queue to your topic: @@ -82,5 +92,15 @@ import subscriptions = require('@aws-cdk/aws-sns-subscriptions'); myTopic.addSubscription(new subscriptions.EmailSubscription('foo@bar.com')); ``` +The email being subscribed can also be [tokens](https://docs.aws.amazon.com/cdk/latest/guide/tokens.html), that resolve +to an email address during deployment. A typical use case is when the email address is passed in as a [CloudFormation +parameter](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html). The +following code defines a CloudFormation parameter and uses it in an email subscription. + +```ts +const emailAddress = new CfnParameter(this, 'email-param'); +myTopic.addSubscription(new subscriptions.EmailSubscription(emailAddress.valueAsString())); +``` + Note that email subscriptions require confirmation by visiting the link sent to the email address. diff --git a/packages/@aws-cdk/aws-sns-subscriptions/lib/url.ts b/packages/@aws-cdk/aws-sns-subscriptions/lib/url.ts index da1709fb4e6d8..12cdabd40e7b0 100644 --- a/packages/@aws-cdk/aws-sns-subscriptions/lib/url.ts +++ b/packages/@aws-cdk/aws-sns-subscriptions/lib/url.ts @@ -53,7 +53,7 @@ export class UrlSubscription implements sns.ITopicSubscription { public bind(_topic: sns.ITopic): sns.TopicSubscriptionConfig { return { - subscriberId: this.unresolvedUrl ? 'UnresolvedUrl' : this.url, + subscriberId: this.url, endpoint: this.url, protocol: this.protocol, rawMessageDelivery: this.props.rawMessageDelivery, diff --git a/packages/@aws-cdk/aws-sns-subscriptions/package.json b/packages/@aws-cdk/aws-sns-subscriptions/package.json index 57003d9d45e62..9dab3c2c58985 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "jest": "^24.9.0", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/aws-sqs": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/aws-sqs": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/aws-sqs": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/aws-sqs": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-sns-subscriptions/test/subs.test.ts b/packages/@aws-cdk/aws-sns-subscriptions/test/subs.test.ts index d7bfe9c6d6c21..095ba53f29f01 100644 --- a/packages/@aws-cdk/aws-sns-subscriptions/test/subs.test.ts +++ b/packages/@aws-cdk/aws-sns-subscriptions/test/subs.test.ts @@ -2,7 +2,7 @@ import '@aws-cdk/assert/jest'; import * as lambda from '@aws-cdk/aws-lambda'; import * as sns from '@aws-cdk/aws-sns'; import * as sqs from '@aws-cdk/aws-sqs'; -import { CfnParameter, SecretValue, Stack } from '@aws-cdk/core'; +import { CfnParameter, Stack, Token } from '@aws-cdk/core'; import * as subs from '../lib'; // tslint:disable:object-literal-key-quotes @@ -72,9 +72,8 @@ test('url subscription (with raw delivery)', () => { }); test('url subscription (unresolved url with protocol)', () => { - const secret = SecretValue.secretsManager('my-secret'); - const url = secret.toString(); - topic.addSubscription(new subs.UrlSubscription(url, {protocol: sns.SubscriptionProtocol.HTTPS})); + const urlToken = Token.asString({ Ref : "my-url-1" }); + topic.addSubscription(new subs.UrlSubscription(urlToken, {protocol: sns.SubscriptionProtocol.HTTPS})); expect(stack).toMatchTemplate({ "Resources": { @@ -85,10 +84,52 @@ test('url subscription (unresolved url with protocol)', () => { "TopicName": "topicName" } }, - "MyTopicUnresolvedUrlBA127FB3": { + "MyTopicTokenSubscription141DD1BE2": { "Type": "AWS::SNS::Subscription", "Properties": { - "Endpoint": "{{resolve:secretsmanager:my-secret:SecretString:::}}", + "Endpoint": { + "Ref": "my-url-1" + }, + "Protocol": "https", + "TopicArn": { "Ref": "MyTopic86869434" }, + } + } + } + }); +}); + +test('url subscription (double unresolved url with protocol)', () => { + const urlToken1 = Token.asString({ Ref : "my-url-1" }); + const urlToken2 = Token.asString({ Ref : "my-url-2" }); + + topic.addSubscription(new subs.UrlSubscription(urlToken1, {protocol: sns.SubscriptionProtocol.HTTPS})); + topic.addSubscription(new subs.UrlSubscription(urlToken2, {protocol: sns.SubscriptionProtocol.HTTPS})); + + expect(stack).toMatchTemplate({ + "Resources": { + "MyTopic86869434": { + "Type": "AWS::SNS::Topic", + "Properties": { + "DisplayName": "displayName", + "TopicName": "topicName" + } + }, + "MyTopicTokenSubscription141DD1BE2": { + "Type": "AWS::SNS::Subscription", + "Properties": { + "Endpoint": { + "Ref" : "my-url-1" + }, + "Protocol": "https", + "TopicArn": { "Ref": "MyTopic86869434" }, + } + }, + "MyTopicTokenSubscription293BFE3F9": { + "Type": "AWS::SNS::Subscription", + "Properties": { + "Endpoint": { + "Ref" : "my-url-2" + }, "Protocol": "https", "TopicArn": { "Ref": "MyTopic86869434" }, } @@ -103,9 +144,9 @@ test('url subscription (unknown protocol)', () => { }); test('url subscription (unresolved url without protocol)', () => { - const secret = SecretValue.secretsManager('my-secret'); - const url = secret.toString(); - expect(() => topic.addSubscription(new subs.UrlSubscription(url))) + const urlToken = Token.asString({ Ref : "my-url-1" }); + + expect(() => topic.addSubscription(new subs.UrlSubscription(urlToken))) .toThrowError(/Must provide protocol if url is unresolved/); }); @@ -329,6 +370,150 @@ test('email subscription', () => { }); }); +test('email subscription with unresolved', () => { + const emailToken = Token.asString({ Ref : "my-email-1" }); + topic.addSubscription(new subs.EmailSubscription(emailToken)); + + expect(stack).toMatchTemplate({ + "Resources": { + "MyTopic86869434": { + "Type": "AWS::SNS::Topic", + "Properties": { + "DisplayName": "displayName", + "TopicName": "topicName" + } + }, + "MyTopicTokenSubscription141DD1BE2": { + "Type": "AWS::SNS::Subscription", + "Properties": { + "Endpoint": { + "Ref" : "my-email-1" + }, + "Protocol": "email", + "TopicArn": { + "Ref": "MyTopic86869434" + } + } + } + } + }); +}); + +test('email and url subscriptions with unresolved', () => { + const emailToken = Token.asString({ Ref : "my-email-1" }); + const urlToken = Token.asString({ Ref : "my-url-1" }); + topic.addSubscription(new subs.EmailSubscription(emailToken)); + topic.addSubscription(new subs.UrlSubscription(urlToken, {protocol: sns.SubscriptionProtocol.HTTPS})); + + expect(stack).toMatchTemplate({ + "Resources": { + "MyTopic86869434": { + "Type": "AWS::SNS::Topic", + "Properties": { + "DisplayName": "displayName", + "TopicName": "topicName" + } + }, + "MyTopicTokenSubscription141DD1BE2": { + "Type": "AWS::SNS::Subscription", + "Properties": { + "Endpoint": { + "Ref" : "my-email-1" + }, + "Protocol": "email", + "TopicArn": { + "Ref": "MyTopic86869434" + } + } + }, + "MyTopicTokenSubscription293BFE3F9": { + "Type": "AWS::SNS::Subscription", + "Properties": { + "Endpoint": { + "Ref" : "my-url-1" + }, + "Protocol": "https", + "TopicArn": { + "Ref": "MyTopic86869434" + } + } + } + } + }); +}); + +test('email and url subscriptions with unresolved - four subscriptions', () => { + const emailToken1 = Token.asString({ Ref : "my-email-1" }); + const emailToken2 = Token.asString({ Ref : "my-email-2" }); + const emailToken3 = Token.asString({ Ref : "my-email-3" }); + const emailToken4 = Token.asString({ Ref : "my-email-4" }); + + topic.addSubscription(new subs.EmailSubscription(emailToken1)); + topic.addSubscription(new subs.EmailSubscription(emailToken2)); + topic.addSubscription(new subs.EmailSubscription(emailToken3)); + topic.addSubscription(new subs.EmailSubscription(emailToken4)); + + expect(stack).toMatchTemplate({ + "Resources": { + "MyTopic86869434": { + "Type": "AWS::SNS::Topic", + "Properties": { + "DisplayName": "displayName", + "TopicName": "topicName" + } + }, + "MyTopicTokenSubscription141DD1BE2": { + "Type": "AWS::SNS::Subscription", + "Properties": { + "Endpoint": { + "Ref" : "my-email-1" + }, + "Protocol": "email", + "TopicArn": { + "Ref": "MyTopic86869434" + } + } + }, + "MyTopicTokenSubscription293BFE3F9": { + "Type": "AWS::SNS::Subscription", + "Properties": { + "Endpoint": { + "Ref" : "my-email-2" + }, + "Protocol": "email", + "TopicArn": { + "Ref": "MyTopic86869434" + } + } + }, + "MyTopicTokenSubscription335C2B4CA": { + "Type": "AWS::SNS::Subscription", + "Properties": { + "Endpoint": { + "Ref" : "my-email-3" + }, + "Protocol": "email", + "TopicArn": { + "Ref": "MyTopic86869434" + } + } + }, + "MyTopicTokenSubscription4DBE52A3F": { + "Type": "AWS::SNS::Subscription", + "Properties": { + "Endpoint": { + "Ref" : "my-email-4" + }, + "Protocol": "email", + "TopicArn": { + "Ref": "MyTopic86869434" + } + } + } + } + }); +}); + test('multiple subscriptions', () => { const queue = new sqs.Queue(stack, 'MyQueue'); const func = new lambda.Function(stack, 'MyFunc', { diff --git a/packages/@aws-cdk/aws-sns/lib/topic-base.ts b/packages/@aws-cdk/aws-sns/lib/topic-base.ts index 44e2bc9dad9dc..ff025cb09072f 100644 --- a/packages/@aws-cdk/aws-sns/lib/topic-base.ts +++ b/packages/@aws-cdk/aws-sns/lib/topic-base.ts @@ -1,5 +1,5 @@ import * as iam from '@aws-cdk/aws-iam'; -import { IResource, Resource } from '@aws-cdk/core'; +import { Construct, IResource, Resource, Token } from '@aws-cdk/core'; import { TopicPolicy } from './policy'; import { ITopicSubscription } from './subscriber'; import { Subscription } from './subscription'; @@ -59,7 +59,10 @@ export abstract class TopicBase extends Resource implements ITopic { const subscriptionConfig = subscription.bind(this); const scope = subscriptionConfig.subscriberScope || this; - const id = subscriptionConfig.subscriberId; + let id = subscriptionConfig.subscriberId; + if (Token.isUnresolved(subscriptionConfig.subscriberId)) { + id = this.nextTokenId(scope); + } // We use the subscriber's id as the construct id. There's no meaning // to subscribing the same subscriber twice on the same topic. @@ -102,4 +105,21 @@ export abstract class TopicBase extends Resource implements ITopic { }); } + private nextTokenId(scope: Construct) { + let nextSuffix = 1; + const re = /TokenSubscription:([\d]*)/gm; + // Search through the construct and all of its children + // for previous subscriptions that match our regex pattern + for (const source of scope.node.findAll()) { + const m = re.exec(source.node.id); // Use regex to find a match + if (m !== null) { // if we found a match + const matchSuffix = parseInt(m[1], 10); // get the suffix for that match (as integer) + if (matchSuffix >= nextSuffix) { // check if the match suffix is larger or equal to currently proposed suffix + nextSuffix = matchSuffix + 1; // increment the suffix + } + } + } + return `TokenSubscription:${nextSuffix}`; + } + } diff --git a/packages/@aws-cdk/aws-sns/package.json b/packages/@aws-cdk/aws-sns/package.json index 42741f004d306..71b565ddb9b31 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.25.0", + "version": "0.0.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.25.0", - "@aws-cdk/aws-s3": "1.25.0", + "@aws-cdk/assert": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/core": "0.0.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 ae22177252ee6..a9262ae314099 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.25.0", + "version": "0.0.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.25.0", - "@aws-cdk/aws-s3": "1.25.0", + "@aws-cdk/assert": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", "@types/nodeunit": "^0.0.30", - "aws-sdk": "^2.624.0", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "aws-sdk": "^2.630.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/core": "0.0.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 abc6de0c63793..d8e913b56b32b 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/core": "1.25.0", - "@aws-cdk/cx-api": "1.25.0" + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/cx-api": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/core": "1.25.0", - "@aws-cdk/cx-api": "1.25.0" + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/cx-api": "0.0.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 fcd791cb365c2..9a41694052634 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", "jest": "^24.9.0", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/assets": "1.25.0", - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-ecr": "1.25.0", - "@aws-cdk/aws-ecr-assets": "1.25.0", - "@aws-cdk/aws-ecs": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/aws-sqs": "1.25.0", - "@aws-cdk/aws-stepfunctions": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/assets": "0.0.0", + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-ecr": "0.0.0", + "@aws-cdk/aws-ecr-assets": "0.0.0", + "@aws-cdk/aws-ecs": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/aws-sqs": "0.0.0", + "@aws-cdk/aws-stepfunctions": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/assets": "1.25.0", - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-ecr": "1.25.0", - "@aws-cdk/aws-ecr-assets": "1.25.0", - "@aws-cdk/aws-ecs": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/aws-sqs": "1.25.0", - "@aws-cdk/aws-stepfunctions": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/assets": "0.0.0", + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-ecr": "0.0.0", + "@aws-cdk/aws-ecr-assets": "0.0.0", + "@aws-cdk/aws-ecs": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/aws-sqs": "0.0.0", + "@aws-cdk/aws-stepfunctions": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/fields.ts b/packages/@aws-cdk/aws-stepfunctions/lib/fields.ts index 2d35536cf9172..8792fe02776ee 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/fields.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/fields.ts @@ -129,13 +129,13 @@ export class FieldUtils { } function validateDataPath(path: string) { - if (!path.startsWith('$.')) { - throw new Error("Data JSON path values must start with '$.'"); + if (path !== '$' && !path.startsWith('$.')) { + throw new Error("Data JSON path values must either be exactly equal to '$' or start with '$.'"); } } function validateContextPath(path: string) { - if (!path.startsWith('$$.')) { - throw new Error("Context JSON path values must start with '$$.'"); + if (path !== '$$' && !path.startsWith('$$.')) { + throw new Error("Context JSON path values must either be exactly equal to '$$' or start with '$$.'"); } } diff --git a/packages/@aws-cdk/aws-stepfunctions/package.json b/packages/@aws-cdk/aws-stepfunctions/package.json index e94ead7a0819f..9f86d11c22a75 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.25.0", + "version": "0.0.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.25.0", + "@aws-cdk/assert": "0.0.0", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/aws-stepfunctions/test/test.fields.ts b/packages/@aws-cdk/aws-stepfunctions/test/test.fields.ts index 575b0d33d72e7..fdb41467815d5 100644 --- a/packages/@aws-cdk/aws-stepfunctions/test/test.fields.ts +++ b/packages/@aws-cdk/aws-stepfunctions/test/test.fields.ts @@ -80,17 +80,29 @@ export = { }, 'datafield path must be correct'(test: Test) { + test.ok(Data.stringAt('$')); + + test.throws(() => { + Data.stringAt('$hello'); + }, /exactly equal to '\$' or start with '\$.'/); + test.throws(() => { Data.stringAt('hello'); - }, /must start with '\$.'/); + }, /exactly equal to '\$' or start with '\$.'/); test.done(); }, 'context path must be correct'(test: Test) { + test.ok(Context.stringAt('$$')); + + test.throws(() => { + Context.stringAt('$$hello'); + }, /exactly equal to '\$\$' or start with '\$\$.'/); + test.throws(() => { Context.stringAt('hello'); - }, /must start with '\$\$.'/); + }, /exactly equal to '\$\$' or start with '\$\$.'/); test.done(); }, diff --git a/packages/@aws-cdk/aws-transfer/package.json b/packages/@aws-cdk/aws-transfer/package.json index 1c6313cdab7dd..f9014d917fc84 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 c3cd708682e4e..eceef21f26a72 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 38a81f5a711b8..001dd23ac827f 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 94258d77c0d83..31967e11d58e5 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.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 614731a1ddfde..add9f6e88643d 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.25.0", + "version": "0.0.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.25.0", - "cdk-build-tools": "1.25.0", - "cfn2ts": "1.25.0", - "pkglint": "1.25.0" + "@aws-cdk/assert": "0.0.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/core": "1.25.0" + "@aws-cdk/core": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/cdk-assets-schema/package.json b/packages/@aws-cdk/cdk-assets-schema/package.json index 2ed739b303f96..7621659c05bfa 100644 --- a/packages/@aws-cdk/cdk-assets-schema/package.json +++ b/packages/@aws-cdk/cdk-assets-schema/package.json @@ -1,6 +1,6 @@ { "name": "@aws-cdk/cdk-assets-schema", - "version": "1.25.0", + "version": "0.0.0", "description": "Schema definition for the Asset Manifest", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -67,9 +67,9 @@ "license": "Apache-2.0", "devDependencies": { "@types/jest": "^25.1.2", - "cdk-build-tools": "1.25.0", + "cdk-build-tools": "0.0.0", "jest": "^24.9.0", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "repository": { "url": "https://github.com/aws/aws-cdk.git", @@ -88,4 +88,4 @@ "node": ">= 10.3.0" }, "stability": "stable" -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/cfnspec/CHANGELOG.md b/packages/@aws-cdk/cfnspec/CHANGELOG.md index 7345af3a796fe..22bc1db55fe29 100644 --- a/packages/@aws-cdk/cfnspec/CHANGELOG.md +++ b/packages/@aws-cdk/cfnspec/CHANGELOG.md @@ -1,3 +1,453 @@ +# CloudFormation Resource Specification v11.1.0 + +## New Resource Types + + +## Attribute Changes + + +## Property Changes + +* AWS::CodeBuild::Project FileSystemLocations (__added__) +* AWS::Cognito::UserPool UsernameConfiguration (__added__) +* AWS::Config::AggregationAuthorization Tags (__added__) +* AWS::Config::ConfigurationAggregator Tags (__added__) +* AWS::WAFv2::IPSet Addresses.PrimitiveItemType (__added__) +* AWS::WAFv2::IPSet Addresses.Type (__changed__) + * Old: IPAddresses + * New: List +* AWS::WAFv2::IPSet Tags.ItemType (__added__) +* AWS::WAFv2::IPSet Tags.Type (__changed__) + * Old: TagList + * New: List +* AWS::WAFv2::RegexPatternSet RegularExpressionList.PrimitiveItemType (__added__) +* AWS::WAFv2::RegexPatternSet RegularExpressionList.Type (__changed__) + * Old: RegularExpressionList + * New: List +* AWS::WAFv2::RegexPatternSet Tags.ItemType (__added__) +* AWS::WAFv2::RegexPatternSet Tags.Type (__changed__) + * Old: TagList + * New: List +* AWS::WAFv2::RuleGroup Rules.ItemType (__added__) +* AWS::WAFv2::RuleGroup Rules.Type (__changed__) + * Old: Rules + * New: List +* AWS::WAFv2::RuleGroup Tags.ItemType (__added__) +* AWS::WAFv2::RuleGroup Tags.Type (__changed__) + * Old: TagList + * New: List +* AWS::WAFv2::WebACL Rules.ItemType (__added__) +* AWS::WAFv2::WebACL Rules.Type (__changed__) + * Old: Rules + * New: List +* AWS::WAFv2::WebACL Tags.ItemType (__added__) +* AWS::WAFv2::WebACL Tags.Type (__changed__) + * Old: TagList + * New: List + +## Property Type Changes + +* AWS::WAFv2::IPSet.IPAddresses (__removed__) +* AWS::WAFv2::IPSet.TagList (__removed__) +* AWS::WAFv2::RegexPatternSet.Regex (__removed__) +* AWS::WAFv2::RegexPatternSet.RegularExpressionList (__removed__) +* AWS::WAFv2::RegexPatternSet.TagList (__removed__) +* AWS::WAFv2::RuleGroup.AllQueryArguments (__removed__) +* AWS::WAFv2::RuleGroup.AllowAction (__removed__) +* AWS::WAFv2::RuleGroup.BlockAction (__removed__) +* AWS::WAFv2::RuleGroup.Body (__removed__) +* AWS::WAFv2::RuleGroup.CountAction (__removed__) +* AWS::WAFv2::RuleGroup.CountryCodes (__removed__) +* AWS::WAFv2::RuleGroup.Method (__removed__) +* AWS::WAFv2::RuleGroup.QueryString (__removed__) +* AWS::WAFv2::RuleGroup.Rules (__removed__) +* AWS::WAFv2::RuleGroup.SingleHeader (__removed__) +* AWS::WAFv2::RuleGroup.SingleQueryArgument (__removed__) +* AWS::WAFv2::RuleGroup.StatementThrees (__removed__) +* AWS::WAFv2::RuleGroup.StatementTwos (__removed__) +* AWS::WAFv2::RuleGroup.TagList (__removed__) +* AWS::WAFv2::RuleGroup.TextTransformations (__removed__) +* AWS::WAFv2::RuleGroup.UriPath (__removed__) +* AWS::WAFv2::WebACL.AllQueryArguments (__removed__) +* AWS::WAFv2::WebACL.AllowAction (__removed__) +* AWS::WAFv2::WebACL.BlockAction (__removed__) +* AWS::WAFv2::WebACL.Body (__removed__) +* AWS::WAFv2::WebACL.CountAction (__removed__) +* AWS::WAFv2::WebACL.CountryCodes (__removed__) +* AWS::WAFv2::WebACL.ExcludedRules (__removed__) +* AWS::WAFv2::WebACL.Method (__removed__) +* AWS::WAFv2::WebACL.NoneAction (__removed__) +* AWS::WAFv2::WebACL.QueryString (__removed__) +* AWS::WAFv2::WebACL.Rules (__removed__) +* AWS::WAFv2::WebACL.SingleHeader (__removed__) +* AWS::WAFv2::WebACL.SingleQueryArgument (__removed__) +* AWS::WAFv2::WebACL.StatementThrees (__removed__) +* AWS::WAFv2::WebACL.StatementTwos (__removed__) +* AWS::WAFv2::WebACL.TagList (__removed__) +* AWS::WAFv2::WebACL.TextTransformations (__removed__) +* AWS::WAFv2::WebACL.UriPath (__removed__) +* AWS::CodeBuild::Project.ProjectFileSystemLocation (__added__) +* AWS::Cognito::UserPool.UsernameConfiguration (__added__) +* AWS::WAFv2::RuleGroup.AndStatementOne Statements.ItemType (__added__) +* AWS::WAFv2::RuleGroup.AndStatementOne Statements.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.AndStatementOne Statements.Type (__changed__) + * Old: StatementTwos + * New: List +* AWS::WAFv2::RuleGroup.AndStatementTwo Statements.ItemType (__added__) +* AWS::WAFv2::RuleGroup.AndStatementTwo Statements.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.AndStatementTwo Statements.Type (__changed__) + * Old: StatementThrees + * New: List +* AWS::WAFv2::RuleGroup.ByteMatchStatement FieldToMatch.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.ByteMatchStatement PositionalConstraint.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.ByteMatchStatement SearchString.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.ByteMatchStatement TextTransformations.ItemType (__added__) +* AWS::WAFv2::RuleGroup.ByteMatchStatement TextTransformations.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.ByteMatchStatement TextTransformations.Type (__changed__) + * Old: TextTransformations + * New: List +* AWS::WAFv2::RuleGroup.FieldToMatch AllQueryArguments.Type (__deleted__) +* AWS::WAFv2::RuleGroup.FieldToMatch AllQueryArguments.PrimitiveType (__added__) +* AWS::WAFv2::RuleGroup.FieldToMatch Body.Type (__deleted__) +* AWS::WAFv2::RuleGroup.FieldToMatch Body.PrimitiveType (__added__) +* AWS::WAFv2::RuleGroup.FieldToMatch Method.Type (__deleted__) +* AWS::WAFv2::RuleGroup.FieldToMatch Method.PrimitiveType (__added__) +* AWS::WAFv2::RuleGroup.FieldToMatch QueryString.Type (__deleted__) +* AWS::WAFv2::RuleGroup.FieldToMatch QueryString.PrimitiveType (__added__) +* AWS::WAFv2::RuleGroup.FieldToMatch SingleHeader.Type (__deleted__) +* AWS::WAFv2::RuleGroup.FieldToMatch SingleHeader.PrimitiveType (__added__) +* AWS::WAFv2::RuleGroup.FieldToMatch SingleQueryArgument.Type (__deleted__) +* AWS::WAFv2::RuleGroup.FieldToMatch SingleQueryArgument.PrimitiveType (__added__) +* AWS::WAFv2::RuleGroup.FieldToMatch UriPath.Type (__deleted__) +* AWS::WAFv2::RuleGroup.FieldToMatch UriPath.PrimitiveType (__added__) +* AWS::WAFv2::RuleGroup.GeoMatchStatement CountryCodes.PrimitiveItemType (__added__) +* AWS::WAFv2::RuleGroup.GeoMatchStatement CountryCodes.Type (__changed__) + * Old: CountryCodes + * New: List +* AWS::WAFv2::RuleGroup.IPSetReferenceStatement Arn.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.NotStatementOne Statement.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.NotStatementTwo Statement.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.OrStatementOne Statements.ItemType (__added__) +* AWS::WAFv2::RuleGroup.OrStatementOne Statements.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.OrStatementOne Statements.Type (__changed__) + * Old: StatementTwos + * New: List +* AWS::WAFv2::RuleGroup.OrStatementTwo Statements.ItemType (__added__) +* AWS::WAFv2::RuleGroup.OrStatementTwo Statements.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.OrStatementTwo Statements.Type (__changed__) + * Old: StatementThrees + * New: List +* AWS::WAFv2::RuleGroup.RateBasedStatementOne AggregateKeyType.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.RateBasedStatementOne Limit.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.RateBasedStatementTwo AggregateKeyType.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.RateBasedStatementTwo Limit.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.RegexPatternSetReferenceStatement Arn.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.RegexPatternSetReferenceStatement FieldToMatch.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.RegexPatternSetReferenceStatement TextTransformations.ItemType (__added__) +* AWS::WAFv2::RuleGroup.RegexPatternSetReferenceStatement TextTransformations.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.RegexPatternSetReferenceStatement TextTransformations.Type (__changed__) + * Old: TextTransformations + * New: List +* AWS::WAFv2::RuleGroup.Rule Name.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.Rule Priority.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.Rule Statement.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.Rule VisibilityConfig.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.RuleAction Allow.Type (__deleted__) +* AWS::WAFv2::RuleGroup.RuleAction Allow.PrimitiveType (__added__) +* AWS::WAFv2::RuleGroup.RuleAction Block.Type (__deleted__) +* AWS::WAFv2::RuleGroup.RuleAction Block.PrimitiveType (__added__) +* AWS::WAFv2::RuleGroup.RuleAction Count.Type (__deleted__) +* AWS::WAFv2::RuleGroup.RuleAction Count.PrimitiveType (__added__) +* AWS::WAFv2::RuleGroup.SizeConstraintStatement ComparisonOperator.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.SizeConstraintStatement FieldToMatch.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.SizeConstraintStatement Size.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.SizeConstraintStatement TextTransformations.ItemType (__added__) +* AWS::WAFv2::RuleGroup.SizeConstraintStatement TextTransformations.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.SizeConstraintStatement TextTransformations.Type (__changed__) + * Old: TextTransformations + * New: List +* AWS::WAFv2::RuleGroup.SqliMatchStatement FieldToMatch.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.SqliMatchStatement TextTransformations.ItemType (__added__) +* AWS::WAFv2::RuleGroup.SqliMatchStatement TextTransformations.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.SqliMatchStatement TextTransformations.Type (__changed__) + * Old: TextTransformations + * New: List +* AWS::WAFv2::RuleGroup.TextTransformation Priority.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.TextTransformation Type.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.VisibilityConfig CloudWatchMetricsEnabled.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.VisibilityConfig MetricName.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.VisibilityConfig SampledRequestsEnabled.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.XssMatchStatement FieldToMatch.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.XssMatchStatement TextTransformations.ItemType (__added__) +* AWS::WAFv2::RuleGroup.XssMatchStatement TextTransformations.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::RuleGroup.XssMatchStatement TextTransformations.Type (__changed__) + * Old: TextTransformations + * New: List +* AWS::WAFv2::WebACL.AndStatementOne Statements.ItemType (__added__) +* AWS::WAFv2::WebACL.AndStatementOne Statements.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.AndStatementOne Statements.Type (__changed__) + * Old: StatementTwos + * New: List +* AWS::WAFv2::WebACL.AndStatementTwo Statements.ItemType (__added__) +* AWS::WAFv2::WebACL.AndStatementTwo Statements.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.AndStatementTwo Statements.Type (__changed__) + * Old: StatementThrees + * New: List +* AWS::WAFv2::WebACL.ByteMatchStatement FieldToMatch.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.ByteMatchStatement PositionalConstraint.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.ByteMatchStatement SearchString.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.ByteMatchStatement TextTransformations.ItemType (__added__) +* AWS::WAFv2::WebACL.ByteMatchStatement TextTransformations.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.ByteMatchStatement TextTransformations.Type (__changed__) + * Old: TextTransformations + * New: List +* AWS::WAFv2::WebACL.DefaultAction Allow.Type (__deleted__) +* AWS::WAFv2::WebACL.DefaultAction Allow.PrimitiveType (__added__) +* AWS::WAFv2::WebACL.DefaultAction Block.Type (__deleted__) +* AWS::WAFv2::WebACL.DefaultAction Block.PrimitiveType (__added__) +* AWS::WAFv2::WebACL.ExcludedRule Name.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.FieldToMatch AllQueryArguments.Type (__deleted__) +* AWS::WAFv2::WebACL.FieldToMatch AllQueryArguments.PrimitiveType (__added__) +* AWS::WAFv2::WebACL.FieldToMatch Body.Type (__deleted__) +* AWS::WAFv2::WebACL.FieldToMatch Body.PrimitiveType (__added__) +* AWS::WAFv2::WebACL.FieldToMatch Method.Type (__deleted__) +* AWS::WAFv2::WebACL.FieldToMatch Method.PrimitiveType (__added__) +* AWS::WAFv2::WebACL.FieldToMatch QueryString.Type (__deleted__) +* AWS::WAFv2::WebACL.FieldToMatch QueryString.PrimitiveType (__added__) +* AWS::WAFv2::WebACL.FieldToMatch SingleHeader.Type (__deleted__) +* AWS::WAFv2::WebACL.FieldToMatch SingleHeader.PrimitiveType (__added__) +* AWS::WAFv2::WebACL.FieldToMatch SingleQueryArgument.Type (__deleted__) +* AWS::WAFv2::WebACL.FieldToMatch SingleQueryArgument.PrimitiveType (__added__) +* AWS::WAFv2::WebACL.FieldToMatch UriPath.Type (__deleted__) +* AWS::WAFv2::WebACL.FieldToMatch UriPath.PrimitiveType (__added__) +* AWS::WAFv2::WebACL.GeoMatchStatement CountryCodes.PrimitiveItemType (__added__) +* AWS::WAFv2::WebACL.GeoMatchStatement CountryCodes.Type (__changed__) + * Old: CountryCodes + * New: List +* AWS::WAFv2::WebACL.IPSetReferenceStatement Arn.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.ManagedRuleGroupStatement ExcludedRules.ItemType (__added__) +* AWS::WAFv2::WebACL.ManagedRuleGroupStatement ExcludedRules.Type (__changed__) + * Old: ExcludedRules + * New: List +* AWS::WAFv2::WebACL.ManagedRuleGroupStatement Name.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.ManagedRuleGroupStatement VendorName.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.NotStatementOne Statement.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.NotStatementTwo Statement.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.OrStatementOne Statements.ItemType (__added__) +* AWS::WAFv2::WebACL.OrStatementOne Statements.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.OrStatementOne Statements.Type (__changed__) + * Old: StatementTwos + * New: List +* AWS::WAFv2::WebACL.OrStatementTwo Statements.ItemType (__added__) +* AWS::WAFv2::WebACL.OrStatementTwo Statements.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.OrStatementTwo Statements.Type (__changed__) + * Old: StatementThrees + * New: List +* AWS::WAFv2::WebACL.OverrideAction Count.Type (__deleted__) +* AWS::WAFv2::WebACL.OverrideAction Count.PrimitiveType (__added__) +* AWS::WAFv2::WebACL.OverrideAction None.Type (__deleted__) +* AWS::WAFv2::WebACL.OverrideAction None.PrimitiveType (__added__) +* AWS::WAFv2::WebACL.RateBasedStatementOne AggregateKeyType.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.RateBasedStatementOne Limit.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.RateBasedStatementTwo AggregateKeyType.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.RateBasedStatementTwo Limit.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.RegexPatternSetReferenceStatement Arn.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.RegexPatternSetReferenceStatement FieldToMatch.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.RegexPatternSetReferenceStatement TextTransformations.ItemType (__added__) +* AWS::WAFv2::WebACL.RegexPatternSetReferenceStatement TextTransformations.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.RegexPatternSetReferenceStatement TextTransformations.Type (__changed__) + * Old: TextTransformations + * New: List +* AWS::WAFv2::WebACL.Rule Name.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.Rule Priority.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.Rule Statement.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.Rule VisibilityConfig.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.RuleAction Allow.Type (__deleted__) +* AWS::WAFv2::WebACL.RuleAction Allow.PrimitiveType (__added__) +* AWS::WAFv2::WebACL.RuleAction Block.Type (__deleted__) +* AWS::WAFv2::WebACL.RuleAction Block.PrimitiveType (__added__) +* AWS::WAFv2::WebACL.RuleAction Count.Type (__deleted__) +* AWS::WAFv2::WebACL.RuleAction Count.PrimitiveType (__added__) +* AWS::WAFv2::WebACL.RuleGroupReferenceStatement Arn.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.RuleGroupReferenceStatement ExcludedRules.ItemType (__added__) +* AWS::WAFv2::WebACL.RuleGroupReferenceStatement ExcludedRules.Type (__changed__) + * Old: ExcludedRules + * New: List +* AWS::WAFv2::WebACL.SizeConstraintStatement ComparisonOperator.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.SizeConstraintStatement FieldToMatch.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.SizeConstraintStatement Size.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.SizeConstraintStatement TextTransformations.ItemType (__added__) +* AWS::WAFv2::WebACL.SizeConstraintStatement TextTransformations.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.SizeConstraintStatement TextTransformations.Type (__changed__) + * Old: TextTransformations + * New: List +* AWS::WAFv2::WebACL.SqliMatchStatement FieldToMatch.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.SqliMatchStatement TextTransformations.ItemType (__added__) +* AWS::WAFv2::WebACL.SqliMatchStatement TextTransformations.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.SqliMatchStatement TextTransformations.Type (__changed__) + * Old: TextTransformations + * New: List +* AWS::WAFv2::WebACL.TextTransformation Priority.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.TextTransformation Type.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.VisibilityConfig CloudWatchMetricsEnabled.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.VisibilityConfig MetricName.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.VisibilityConfig SampledRequestsEnabled.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.XssMatchStatement FieldToMatch.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.XssMatchStatement TextTransformations.ItemType (__added__) +* AWS::WAFv2::WebACL.XssMatchStatement TextTransformations.Required (__changed__) + * Old: false + * New: true +* AWS::WAFv2::WebACL.XssMatchStatement TextTransformations.Type (__changed__) + * Old: TextTransformations + * New: List + + # CloudFormation Resource Specification v11.0.0 ## New Resource Types diff --git a/packages/@aws-cdk/cfnspec/package.json b/packages/@aws-cdk/cfnspec/package.json index 28792e1b504e4..6309118612c49 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.25.0", + "version": "0.0.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.1.0", "@types/md5": "^2.1.33", "@types/nodeunit": "^0.0.30", - "cdk-build-tools": "1.25.0", + "cdk-build-tools": "0.0.0", "fast-json-patch": "^2.2.1", "fs-extra": "^8.1.0", "json-diff": "^0.5.4", "nodeunit": "^0.11.3", - "pkglint": "1.25.0", + "pkglint": "0.0.0", "sort-json": "^2.0.0" }, "dependencies": { @@ -51,4 +51,4 @@ "cdk" ], "homepage": "https://github.com/aws/aws-cdk" -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/cfnspec/spec-source/000_CloudFormationResourceSpecification.json b/packages/@aws-cdk/cfnspec/spec-source/000_CloudFormationResourceSpecification.json index e1975a51b1890..00eda8574624a 100644 --- a/packages/@aws-cdk/cfnspec/spec-source/000_CloudFormationResourceSpecification.json +++ b/packages/@aws-cdk/cfnspec/spec-source/000_CloudFormationResourceSpecification.json @@ -5874,6 +5874,41 @@ } } }, + "AWS::CodeBuild::Project.ProjectFileSystemLocation": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectfilesystemlocation.html", + "Properties": { + "Identifier": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectfilesystemlocation.html#cfn-codebuild-project-projectfilesystemlocation-identifier", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + }, + "Location": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectfilesystemlocation.html#cfn-codebuild-project-projectfilesystemlocation-location", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + }, + "MountOptions": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectfilesystemlocation.html#cfn-codebuild-project-projectfilesystemlocation-mountoptions", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "MountPoint": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectfilesystemlocation.html#cfn-codebuild-project-projectfilesystemlocation-mountpoint", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + }, + "Type": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectfilesystemlocation.html#cfn-codebuild-project-projectfilesystemlocation-type", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + } + } + }, "AWS::CodeBuild::Project.ProjectSourceVersion": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectsourceversion.html", "Properties": { @@ -7446,6 +7481,17 @@ } } }, + "AWS::Cognito::UserPool.UsernameConfiguration": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cognito-userpool-usernameconfiguration.html", + "Properties": { + "CaseSensitive": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cognito-userpool-usernameconfiguration.html#cfn-cognito-userpool-usernameconfiguration-casesensitive", + "PrimitiveType": "Boolean", + "Required": false, + "UpdateType": "Mutable" + } + } + }, "AWS::Cognito::UserPool.VerificationMessageTemplate": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cognito-userpool-verificationmessagetemplate.html", "Properties": { @@ -28417,78 +28463,14 @@ } } }, - "AWS::WAFv2::IPSet.IPAddresses": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-ipset-ipaddresses.html", - "Properties": { - "IPAddresses": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-ipset-ipaddresses.html#cfn-wafv2-ipset-ipaddresses-ipaddresses", - "PrimitiveItemType": "String", - "Required": false, - "Type": "List", - "UpdateType": "Mutable" - } - } - }, - "AWS::WAFv2::IPSet.TagList": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-ipset-taglist.html", - "Properties": { - "TagList": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-ipset-taglist.html#cfn-wafv2-ipset-taglist-taglist", - "ItemType": "Tag", - "Required": false, - "Type": "List", - "UpdateType": "Mutable" - } - } - }, - "AWS::WAFv2::RegexPatternSet.Regex": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-regexpatternset-regex.html", - "Properties": { - "RegexString": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-regexpatternset-regex.html#cfn-wafv2-regexpatternset-regex-regexstring", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - } - } - }, - "AWS::WAFv2::RegexPatternSet.RegularExpressionList": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-regexpatternset-regularexpressionlist.html", - "Properties": { - "RegularExpressionList": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-regexpatternset-regularexpressionlist.html#cfn-wafv2-regexpatternset-regularexpressionlist-regularexpressionlist", - "ItemType": "Regex", - "Required": false, - "Type": "List", - "UpdateType": "Mutable" - } - } - }, - "AWS::WAFv2::RegexPatternSet.TagList": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-regexpatternset-taglist.html", - "Properties": { - "TagList": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-regexpatternset-taglist.html#cfn-wafv2-regexpatternset-taglist-taglist", - "ItemType": "Tag", - "Required": false, - "Type": "List", - "UpdateType": "Mutable" - } - } - }, - "AWS::WAFv2::RuleGroup.AllQueryArguments": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-allqueryarguments.html" - }, - "AWS::WAFv2::RuleGroup.AllowAction": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-allowaction.html" - }, "AWS::WAFv2::RuleGroup.AndStatementOne": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-andstatementone.html", "Properties": { "Statements": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-andstatementone.html#cfn-wafv2-rulegroup-andstatementone-statements", - "Required": false, - "Type": "StatementTwos", + "ItemType": "StatementTwo", + "Required": true, + "Type": "List", "UpdateType": "Mutable" } } @@ -28498,37 +28480,32 @@ "Properties": { "Statements": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-andstatementtwo.html#cfn-wafv2-rulegroup-andstatementtwo-statements", - "Required": false, - "Type": "StatementThrees", + "ItemType": "StatementThree", + "Required": true, + "Type": "List", "UpdateType": "Mutable" } } }, - "AWS::WAFv2::RuleGroup.BlockAction": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-blockaction.html" - }, - "AWS::WAFv2::RuleGroup.Body": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-body.html" - }, "AWS::WAFv2::RuleGroup.ByteMatchStatement": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-bytematchstatement.html", "Properties": { "FieldToMatch": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-bytematchstatement.html#cfn-wafv2-rulegroup-bytematchstatement-fieldtomatch", - "Required": false, + "Required": true, "Type": "FieldToMatch", "UpdateType": "Mutable" }, "PositionalConstraint": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-bytematchstatement.html#cfn-wafv2-rulegroup-bytematchstatement-positionalconstraint", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "SearchString": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-bytematchstatement.html#cfn-wafv2-rulegroup-bytematchstatement-searchstring", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "SearchStringBase64": { @@ -28539,22 +28516,8 @@ }, "TextTransformations": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-bytematchstatement.html#cfn-wafv2-rulegroup-bytematchstatement-texttransformations", - "Required": false, - "Type": "TextTransformations", - "UpdateType": "Mutable" - } - } - }, - "AWS::WAFv2::RuleGroup.CountAction": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-countaction.html" - }, - "AWS::WAFv2::RuleGroup.CountryCodes": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-countrycodes.html", - "Properties": { - "CountryCodes": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-countrycodes.html#cfn-wafv2-rulegroup-countrycodes-countrycodes", - "PrimitiveItemType": "String", - "Required": false, + "ItemType": "TextTransformation", + "Required": true, "Type": "List", "UpdateType": "Mutable" } @@ -28565,44 +28528,44 @@ "Properties": { "AllQueryArguments": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-fieldtomatch.html#cfn-wafv2-rulegroup-fieldtomatch-allqueryarguments", + "PrimitiveType": "Json", "Required": false, - "Type": "AllQueryArguments", "UpdateType": "Mutable" }, "Body": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-fieldtomatch.html#cfn-wafv2-rulegroup-fieldtomatch-body", + "PrimitiveType": "Json", "Required": false, - "Type": "Body", "UpdateType": "Mutable" }, "Method": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-fieldtomatch.html#cfn-wafv2-rulegroup-fieldtomatch-method", + "PrimitiveType": "Json", "Required": false, - "Type": "Method", "UpdateType": "Mutable" }, "QueryString": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-fieldtomatch.html#cfn-wafv2-rulegroup-fieldtomatch-querystring", + "PrimitiveType": "Json", "Required": false, - "Type": "QueryString", "UpdateType": "Mutable" }, "SingleHeader": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-fieldtomatch.html#cfn-wafv2-rulegroup-fieldtomatch-singleheader", + "PrimitiveType": "Json", "Required": false, - "Type": "SingleHeader", "UpdateType": "Mutable" }, "SingleQueryArgument": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-fieldtomatch.html#cfn-wafv2-rulegroup-fieldtomatch-singlequeryargument", + "PrimitiveType": "Json", "Required": false, - "Type": "SingleQueryArgument", "UpdateType": "Mutable" }, "UriPath": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-fieldtomatch.html#cfn-wafv2-rulegroup-fieldtomatch-uripath", + "PrimitiveType": "Json", "Required": false, - "Type": "UriPath", "UpdateType": "Mutable" } } @@ -28612,8 +28575,9 @@ "Properties": { "CountryCodes": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-geomatchstatement.html#cfn-wafv2-rulegroup-geomatchstatement-countrycodes", + "PrimitiveItemType": "String", "Required": false, - "Type": "CountryCodes", + "Type": "List", "UpdateType": "Mutable" } } @@ -28624,20 +28588,17 @@ "Arn": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-ipsetreferencestatement.html#cfn-wafv2-rulegroup-ipsetreferencestatement-arn", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Mutable" } } }, - "AWS::WAFv2::RuleGroup.Method": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-method.html" - }, "AWS::WAFv2::RuleGroup.NotStatementOne": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-notstatementone.html", "Properties": { "Statement": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-notstatementone.html#cfn-wafv2-rulegroup-notstatementone-statement", - "Required": false, + "Required": true, "Type": "StatementTwo", "UpdateType": "Mutable" } @@ -28648,7 +28609,7 @@ "Properties": { "Statement": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-notstatementtwo.html#cfn-wafv2-rulegroup-notstatementtwo-statement", - "Required": false, + "Required": true, "Type": "StatementThree", "UpdateType": "Mutable" } @@ -28659,8 +28620,9 @@ "Properties": { "Statements": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-orstatementone.html#cfn-wafv2-rulegroup-orstatementone-statements", - "Required": false, - "Type": "StatementTwos", + "ItemType": "StatementTwo", + "Required": true, + "Type": "List", "UpdateType": "Mutable" } } @@ -28670,28 +28632,26 @@ "Properties": { "Statements": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-orstatementtwo.html#cfn-wafv2-rulegroup-orstatementtwo-statements", - "Required": false, - "Type": "StatementThrees", + "ItemType": "StatementThree", + "Required": true, + "Type": "List", "UpdateType": "Mutable" } } }, - "AWS::WAFv2::RuleGroup.QueryString": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-querystring.html" - }, "AWS::WAFv2::RuleGroup.RateBasedStatementOne": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-ratebasedstatementone.html", "Properties": { "AggregateKeyType": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-ratebasedstatementone.html#cfn-wafv2-rulegroup-ratebasedstatementone-aggregatekeytype", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "Limit": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-ratebasedstatementone.html#cfn-wafv2-rulegroup-ratebasedstatementone-limit", "PrimitiveType": "Integer", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "ScopeDownStatement": { @@ -28708,13 +28668,13 @@ "AggregateKeyType": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-ratebasedstatementtwo.html#cfn-wafv2-rulegroup-ratebasedstatementtwo-aggregatekeytype", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "Limit": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-ratebasedstatementtwo.html#cfn-wafv2-rulegroup-ratebasedstatementtwo-limit", "PrimitiveType": "Integer", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "ScopeDownStatement": { @@ -28731,19 +28691,20 @@ "Arn": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-regexpatternsetreferencestatement.html#cfn-wafv2-rulegroup-regexpatternsetreferencestatement-arn", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "FieldToMatch": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-regexpatternsetreferencestatement.html#cfn-wafv2-rulegroup-regexpatternsetreferencestatement-fieldtomatch", - "Required": false, + "Required": true, "Type": "FieldToMatch", "UpdateType": "Mutable" }, "TextTransformations": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-regexpatternsetreferencestatement.html#cfn-wafv2-rulegroup-regexpatternsetreferencestatement-texttransformations", - "Required": false, - "Type": "TextTransformations", + "ItemType": "TextTransformation", + "Required": true, + "Type": "List", "UpdateType": "Mutable" } } @@ -28760,24 +28721,24 @@ "Name": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-rule.html#cfn-wafv2-rulegroup-rule-name", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "Priority": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-rule.html#cfn-wafv2-rulegroup-rule-priority", "PrimitiveType": "Integer", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "Statement": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-rule.html#cfn-wafv2-rulegroup-rule-statement", - "Required": false, + "Required": true, "Type": "StatementOne", "UpdateType": "Mutable" }, "VisibilityConfig": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-rule.html#cfn-wafv2-rulegroup-rule-visibilityconfig", - "Required": false, + "Required": true, "Type": "VisibilityConfig", "UpdateType": "Mutable" } @@ -28788,53 +28749,19 @@ "Properties": { "Allow": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-ruleaction.html#cfn-wafv2-rulegroup-ruleaction-allow", + "PrimitiveType": "Json", "Required": false, - "Type": "AllowAction", "UpdateType": "Mutable" }, "Block": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-ruleaction.html#cfn-wafv2-rulegroup-ruleaction-block", + "PrimitiveType": "Json", "Required": false, - "Type": "BlockAction", "UpdateType": "Mutable" }, "Count": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-ruleaction.html#cfn-wafv2-rulegroup-ruleaction-count", - "Required": false, - "Type": "CountAction", - "UpdateType": "Mutable" - } - } - }, - "AWS::WAFv2::RuleGroup.Rules": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-rules.html", - "Properties": { - "Rules": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-rules.html#cfn-wafv2-rulegroup-rules-rules", - "ItemType": "Rule", - "Required": false, - "Type": "List", - "UpdateType": "Mutable" - } - } - }, - "AWS::WAFv2::RuleGroup.SingleHeader": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-singleheader.html", - "Properties": { - "Name": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-singleheader.html#cfn-wafv2-rulegroup-singleheader-name", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - } - } - }, - "AWS::WAFv2::RuleGroup.SingleQueryArgument": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-singlequeryargument.html", - "Properties": { - "Name": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-singlequeryargument.html#cfn-wafv2-rulegroup-singlequeryargument-name", - "PrimitiveType": "String", + "PrimitiveType": "Json", "Required": false, "UpdateType": "Mutable" } @@ -28846,25 +28773,26 @@ "ComparisonOperator": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-sizeconstraintstatement.html#cfn-wafv2-rulegroup-sizeconstraintstatement-comparisonoperator", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "FieldToMatch": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-sizeconstraintstatement.html#cfn-wafv2-rulegroup-sizeconstraintstatement-fieldtomatch", - "Required": false, + "Required": true, "Type": "FieldToMatch", "UpdateType": "Mutable" }, "Size": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-sizeconstraintstatement.html#cfn-wafv2-rulegroup-sizeconstraintstatement-size", "PrimitiveType": "Integer", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "TextTransformations": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-sizeconstraintstatement.html#cfn-wafv2-rulegroup-sizeconstraintstatement-texttransformations", - "Required": false, - "Type": "TextTransformations", + "ItemType": "TextTransformation", + "Required": true, + "Type": "List", "UpdateType": "Mutable" } } @@ -28874,14 +28802,15 @@ "Properties": { "FieldToMatch": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-sqlimatchstatement.html#cfn-wafv2-rulegroup-sqlimatchstatement-fieldtomatch", - "Required": false, + "Required": true, "Type": "FieldToMatch", "UpdateType": "Mutable" }, "TextTransformations": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-sqlimatchstatement.html#cfn-wafv2-rulegroup-sqlimatchstatement-texttransformations", - "Required": false, - "Type": "TextTransformations", + "ItemType": "TextTransformation", + "Required": true, + "Type": "List", "UpdateType": "Mutable" } } @@ -29004,18 +28933,6 @@ } } }, - "AWS::WAFv2::RuleGroup.StatementThrees": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-statementthrees.html", - "Properties": { - "StatementThrees": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-statementthrees.html#cfn-wafv2-rulegroup-statementthrees-statementthrees", - "ItemType": "StatementThree", - "Required": false, - "Type": "List", - "UpdateType": "Mutable" - } - } - }, "AWS::WAFv2::RuleGroup.StatementTwo": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-statementtwo.html", "Properties": { @@ -29087,81 +29004,42 @@ } } }, - "AWS::WAFv2::RuleGroup.StatementTwos": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-statementtwos.html", - "Properties": { - "StatementTwos": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-statementtwos.html#cfn-wafv2-rulegroup-statementtwos-statementtwos", - "ItemType": "StatementTwo", - "Required": false, - "Type": "List", - "UpdateType": "Mutable" - } - } - }, - "AWS::WAFv2::RuleGroup.TagList": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-taglist.html", - "Properties": { - "TagList": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-taglist.html#cfn-wafv2-rulegroup-taglist-taglist", - "ItemType": "Tag", - "Required": false, - "Type": "List", - "UpdateType": "Mutable" - } - } - }, "AWS::WAFv2::RuleGroup.TextTransformation": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-texttransformation.html", "Properties": { "Priority": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-texttransformation.html#cfn-wafv2-rulegroup-texttransformation-priority", "PrimitiveType": "Integer", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "Type": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-texttransformation.html#cfn-wafv2-rulegroup-texttransformation-type", "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - } - } - }, - "AWS::WAFv2::RuleGroup.TextTransformations": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-texttransformations.html", - "Properties": { - "TextTransformations": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-texttransformations.html#cfn-wafv2-rulegroup-texttransformations-texttransformations", - "ItemType": "TextTransformation", - "Required": false, - "Type": "List", + "Required": true, "UpdateType": "Mutable" } } }, - "AWS::WAFv2::RuleGroup.UriPath": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-uripath.html" - }, "AWS::WAFv2::RuleGroup.VisibilityConfig": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-visibilityconfig.html", "Properties": { "CloudWatchMetricsEnabled": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-visibilityconfig.html#cfn-wafv2-rulegroup-visibilityconfig-cloudwatchmetricsenabled", "PrimitiveType": "Boolean", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "MetricName": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-visibilityconfig.html#cfn-wafv2-rulegroup-visibilityconfig-metricname", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "SampledRequestsEnabled": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-visibilityconfig.html#cfn-wafv2-rulegroup-visibilityconfig-sampledrequestsenabled", "PrimitiveType": "Boolean", - "Required": false, + "Required": true, "UpdateType": "Mutable" } } @@ -29171,31 +29049,27 @@ "Properties": { "FieldToMatch": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-xssmatchstatement.html#cfn-wafv2-rulegroup-xssmatchstatement-fieldtomatch", - "Required": false, + "Required": true, "Type": "FieldToMatch", "UpdateType": "Mutable" }, "TextTransformations": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-xssmatchstatement.html#cfn-wafv2-rulegroup-xssmatchstatement-texttransformations", - "Required": false, - "Type": "TextTransformations", + "ItemType": "TextTransformation", + "Required": true, + "Type": "List", "UpdateType": "Mutable" } } }, - "AWS::WAFv2::WebACL.AllQueryArguments": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-allqueryarguments.html" - }, - "AWS::WAFv2::WebACL.AllowAction": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-allowaction.html" - }, "AWS::WAFv2::WebACL.AndStatementOne": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-andstatementone.html", "Properties": { "Statements": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-andstatementone.html#cfn-wafv2-webacl-andstatementone-statements", - "Required": false, - "Type": "StatementTwos", + "ItemType": "StatementTwo", + "Required": true, + "Type": "List", "UpdateType": "Mutable" } } @@ -29205,37 +29079,32 @@ "Properties": { "Statements": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-andstatementtwo.html#cfn-wafv2-webacl-andstatementtwo-statements", - "Required": false, - "Type": "StatementThrees", + "ItemType": "StatementThree", + "Required": true, + "Type": "List", "UpdateType": "Mutable" } } }, - "AWS::WAFv2::WebACL.BlockAction": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-blockaction.html" - }, - "AWS::WAFv2::WebACL.Body": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-body.html" - }, "AWS::WAFv2::WebACL.ByteMatchStatement": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-bytematchstatement.html", "Properties": { "FieldToMatch": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-bytematchstatement.html#cfn-wafv2-webacl-bytematchstatement-fieldtomatch", - "Required": false, + "Required": true, "Type": "FieldToMatch", "UpdateType": "Mutable" }, "PositionalConstraint": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-bytematchstatement.html#cfn-wafv2-webacl-bytematchstatement-positionalconstraint", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "SearchString": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-bytematchstatement.html#cfn-wafv2-webacl-bytematchstatement-searchstring", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "SearchStringBase64": { @@ -29246,22 +29115,8 @@ }, "TextTransformations": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-bytematchstatement.html#cfn-wafv2-webacl-bytematchstatement-texttransformations", - "Required": false, - "Type": "TextTransformations", - "UpdateType": "Mutable" - } - } - }, - "AWS::WAFv2::WebACL.CountAction": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-countaction.html" - }, - "AWS::WAFv2::WebACL.CountryCodes": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-countrycodes.html", - "Properties": { - "CountryCodes": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-countrycodes.html#cfn-wafv2-webacl-countrycodes-countrycodes", - "PrimitiveItemType": "String", - "Required": false, + "ItemType": "TextTransformation", + "Required": true, "Type": "List", "UpdateType": "Mutable" } @@ -29272,14 +29127,14 @@ "Properties": { "Allow": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-defaultaction.html#cfn-wafv2-webacl-defaultaction-allow", + "PrimitiveType": "Json", "Required": false, - "Type": "AllowAction", "UpdateType": "Mutable" }, "Block": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-defaultaction.html#cfn-wafv2-webacl-defaultaction-block", + "PrimitiveType": "Json", "Required": false, - "Type": "BlockAction", "UpdateType": "Mutable" } } @@ -29290,19 +29145,7 @@ "Name": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-excludedrule.html#cfn-wafv2-webacl-excludedrule-name", "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - } - } - }, - "AWS::WAFv2::WebACL.ExcludedRules": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-excludedrules.html", - "Properties": { - "ExcludedRules": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-excludedrules.html#cfn-wafv2-webacl-excludedrules-excludedrules", - "ItemType": "ExcludedRule", - "Required": false, - "Type": "List", + "Required": true, "UpdateType": "Mutable" } } @@ -29312,44 +29155,44 @@ "Properties": { "AllQueryArguments": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-fieldtomatch.html#cfn-wafv2-webacl-fieldtomatch-allqueryarguments", + "PrimitiveType": "Json", "Required": false, - "Type": "AllQueryArguments", "UpdateType": "Mutable" }, "Body": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-fieldtomatch.html#cfn-wafv2-webacl-fieldtomatch-body", + "PrimitiveType": "Json", "Required": false, - "Type": "Body", "UpdateType": "Mutable" }, "Method": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-fieldtomatch.html#cfn-wafv2-webacl-fieldtomatch-method", + "PrimitiveType": "Json", "Required": false, - "Type": "Method", "UpdateType": "Mutable" }, "QueryString": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-fieldtomatch.html#cfn-wafv2-webacl-fieldtomatch-querystring", + "PrimitiveType": "Json", "Required": false, - "Type": "QueryString", "UpdateType": "Mutable" }, "SingleHeader": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-fieldtomatch.html#cfn-wafv2-webacl-fieldtomatch-singleheader", + "PrimitiveType": "Json", "Required": false, - "Type": "SingleHeader", "UpdateType": "Mutable" }, "SingleQueryArgument": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-fieldtomatch.html#cfn-wafv2-webacl-fieldtomatch-singlequeryargument", + "PrimitiveType": "Json", "Required": false, - "Type": "SingleQueryArgument", "UpdateType": "Mutable" }, "UriPath": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-fieldtomatch.html#cfn-wafv2-webacl-fieldtomatch-uripath", + "PrimitiveType": "Json", "Required": false, - "Type": "UriPath", "UpdateType": "Mutable" } } @@ -29359,8 +29202,9 @@ "Properties": { "CountryCodes": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-geomatchstatement.html#cfn-wafv2-webacl-geomatchstatement-countrycodes", + "PrimitiveItemType": "String", "Required": false, - "Type": "CountryCodes", + "Type": "List", "UpdateType": "Mutable" } } @@ -29371,7 +29215,7 @@ "Arn": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ipsetreferencestatement.html#cfn-wafv2-webacl-ipsetreferencestatement-arn", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Mutable" } } @@ -29381,36 +29225,31 @@ "Properties": { "ExcludedRules": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-managedrulegroupstatement.html#cfn-wafv2-webacl-managedrulegroupstatement-excludedrules", + "ItemType": "ExcludedRule", "Required": false, - "Type": "ExcludedRules", + "Type": "List", "UpdateType": "Mutable" }, "Name": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-managedrulegroupstatement.html#cfn-wafv2-webacl-managedrulegroupstatement-name", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "VendorName": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-managedrulegroupstatement.html#cfn-wafv2-webacl-managedrulegroupstatement-vendorname", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Mutable" } } }, - "AWS::WAFv2::WebACL.Method": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-method.html" - }, - "AWS::WAFv2::WebACL.NoneAction": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-noneaction.html" - }, "AWS::WAFv2::WebACL.NotStatementOne": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-notstatementone.html", "Properties": { "Statement": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-notstatementone.html#cfn-wafv2-webacl-notstatementone-statement", - "Required": false, + "Required": true, "Type": "StatementTwo", "UpdateType": "Mutable" } @@ -29421,7 +29260,7 @@ "Properties": { "Statement": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-notstatementtwo.html#cfn-wafv2-webacl-notstatementtwo-statement", - "Required": false, + "Required": true, "Type": "StatementThree", "UpdateType": "Mutable" } @@ -29432,8 +29271,9 @@ "Properties": { "Statements": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-orstatementone.html#cfn-wafv2-webacl-orstatementone-statements", - "Required": false, - "Type": "StatementTwos", + "ItemType": "StatementTwo", + "Required": true, + "Type": "List", "UpdateType": "Mutable" } } @@ -29443,8 +29283,9 @@ "Properties": { "Statements": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-orstatementtwo.html#cfn-wafv2-webacl-orstatementtwo-statements", - "Required": false, - "Type": "StatementThrees", + "ItemType": "StatementThree", + "Required": true, + "Type": "List", "UpdateType": "Mutable" } } @@ -29454,34 +29295,31 @@ "Properties": { "Count": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-overrideaction.html#cfn-wafv2-webacl-overrideaction-count", + "PrimitiveType": "Json", "Required": false, - "Type": "CountAction", "UpdateType": "Mutable" }, "None": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-overrideaction.html#cfn-wafv2-webacl-overrideaction-none", + "PrimitiveType": "Json", "Required": false, - "Type": "NoneAction", "UpdateType": "Mutable" } } }, - "AWS::WAFv2::WebACL.QueryString": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-querystring.html" - }, "AWS::WAFv2::WebACL.RateBasedStatementOne": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ratebasedstatementone.html", "Properties": { "AggregateKeyType": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ratebasedstatementone.html#cfn-wafv2-webacl-ratebasedstatementone-aggregatekeytype", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "Limit": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ratebasedstatementone.html#cfn-wafv2-webacl-ratebasedstatementone-limit", "PrimitiveType": "Integer", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "ScopeDownStatement": { @@ -29498,13 +29336,13 @@ "AggregateKeyType": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ratebasedstatementtwo.html#cfn-wafv2-webacl-ratebasedstatementtwo-aggregatekeytype", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "Limit": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ratebasedstatementtwo.html#cfn-wafv2-webacl-ratebasedstatementtwo-limit", "PrimitiveType": "Integer", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "ScopeDownStatement": { @@ -29521,19 +29359,20 @@ "Arn": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-regexpatternsetreferencestatement.html#cfn-wafv2-webacl-regexpatternsetreferencestatement-arn", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "FieldToMatch": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-regexpatternsetreferencestatement.html#cfn-wafv2-webacl-regexpatternsetreferencestatement-fieldtomatch", - "Required": false, + "Required": true, "Type": "FieldToMatch", "UpdateType": "Mutable" }, "TextTransformations": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-regexpatternsetreferencestatement.html#cfn-wafv2-webacl-regexpatternsetreferencestatement-texttransformations", - "Required": false, - "Type": "TextTransformations", + "ItemType": "TextTransformation", + "Required": true, + "Type": "List", "UpdateType": "Mutable" } } @@ -29550,7 +29389,7 @@ "Name": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-rule.html#cfn-wafv2-webacl-rule-name", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "OverrideAction": { @@ -29562,18 +29401,18 @@ "Priority": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-rule.html#cfn-wafv2-webacl-rule-priority", "PrimitiveType": "Integer", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "Statement": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-rule.html#cfn-wafv2-webacl-rule-statement", - "Required": false, + "Required": true, "Type": "StatementOne", "UpdateType": "Mutable" }, "VisibilityConfig": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-rule.html#cfn-wafv2-webacl-rule-visibilityconfig", - "Required": false, + "Required": true, "Type": "VisibilityConfig", "UpdateType": "Mutable" } @@ -29584,20 +29423,20 @@ "Properties": { "Allow": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ruleaction.html#cfn-wafv2-webacl-ruleaction-allow", + "PrimitiveType": "Json", "Required": false, - "Type": "AllowAction", "UpdateType": "Mutable" }, "Block": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ruleaction.html#cfn-wafv2-webacl-ruleaction-block", + "PrimitiveType": "Json", "Required": false, - "Type": "BlockAction", "UpdateType": "Mutable" }, "Count": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ruleaction.html#cfn-wafv2-webacl-ruleaction-count", + "PrimitiveType": "Json", "Required": false, - "Type": "CountAction", "UpdateType": "Mutable" } } @@ -29608,76 +29447,44 @@ "Arn": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-rulegroupreferencestatement.html#cfn-wafv2-webacl-rulegroupreferencestatement-arn", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "ExcludedRules": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-rulegroupreferencestatement.html#cfn-wafv2-webacl-rulegroupreferencestatement-excludedrules", - "Required": false, - "Type": "ExcludedRules", - "UpdateType": "Mutable" - } - } - }, - "AWS::WAFv2::WebACL.Rules": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-rules.html", - "Properties": { - "Rules": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-rules.html#cfn-wafv2-webacl-rules-rules", - "ItemType": "Rule", + "ItemType": "ExcludedRule", "Required": false, "Type": "List", "UpdateType": "Mutable" } } }, - "AWS::WAFv2::WebACL.SingleHeader": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-singleheader.html", - "Properties": { - "Name": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-singleheader.html#cfn-wafv2-webacl-singleheader-name", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - } - } - }, - "AWS::WAFv2::WebACL.SingleQueryArgument": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-singlequeryargument.html", - "Properties": { - "Name": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-singlequeryargument.html#cfn-wafv2-webacl-singlequeryargument-name", - "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - } - } - }, "AWS::WAFv2::WebACL.SizeConstraintStatement": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-sizeconstraintstatement.html", "Properties": { "ComparisonOperator": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-sizeconstraintstatement.html#cfn-wafv2-webacl-sizeconstraintstatement-comparisonoperator", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "FieldToMatch": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-sizeconstraintstatement.html#cfn-wafv2-webacl-sizeconstraintstatement-fieldtomatch", - "Required": false, + "Required": true, "Type": "FieldToMatch", "UpdateType": "Mutable" }, "Size": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-sizeconstraintstatement.html#cfn-wafv2-webacl-sizeconstraintstatement-size", "PrimitiveType": "Integer", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "TextTransformations": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-sizeconstraintstatement.html#cfn-wafv2-webacl-sizeconstraintstatement-texttransformations", - "Required": false, - "Type": "TextTransformations", + "ItemType": "TextTransformation", + "Required": true, + "Type": "List", "UpdateType": "Mutable" } } @@ -29687,14 +29494,15 @@ "Properties": { "FieldToMatch": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-sqlimatchstatement.html#cfn-wafv2-webacl-sqlimatchstatement-fieldtomatch", - "Required": false, + "Required": true, "Type": "FieldToMatch", "UpdateType": "Mutable" }, "TextTransformations": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-sqlimatchstatement.html#cfn-wafv2-webacl-sqlimatchstatement-texttransformations", - "Required": false, - "Type": "TextTransformations", + "ItemType": "TextTransformation", + "Required": true, + "Type": "List", "UpdateType": "Mutable" } } @@ -29841,18 +29649,6 @@ } } }, - "AWS::WAFv2::WebACL.StatementThrees": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-statementthrees.html", - "Properties": { - "StatementThrees": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-statementthrees.html#cfn-wafv2-webacl-statementthrees-statementthrees", - "ItemType": "StatementThree", - "Required": false, - "Type": "List", - "UpdateType": "Mutable" - } - } - }, "AWS::WAFv2::WebACL.StatementTwo": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-statementtwo.html", "Properties": { @@ -29936,81 +29732,42 @@ } } }, - "AWS::WAFv2::WebACL.StatementTwos": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-statementtwos.html", - "Properties": { - "StatementTwos": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-statementtwos.html#cfn-wafv2-webacl-statementtwos-statementtwos", - "ItemType": "StatementTwo", - "Required": false, - "Type": "List", - "UpdateType": "Mutable" - } - } - }, - "AWS::WAFv2::WebACL.TagList": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-taglist.html", - "Properties": { - "TagList": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-taglist.html#cfn-wafv2-webacl-taglist-taglist", - "ItemType": "Tag", - "Required": false, - "Type": "List", - "UpdateType": "Mutable" - } - } - }, "AWS::WAFv2::WebACL.TextTransformation": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-texttransformation.html", "Properties": { "Priority": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-texttransformation.html#cfn-wafv2-webacl-texttransformation-priority", "PrimitiveType": "Integer", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "Type": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-texttransformation.html#cfn-wafv2-webacl-texttransformation-type", "PrimitiveType": "String", - "Required": false, - "UpdateType": "Mutable" - } - } - }, - "AWS::WAFv2::WebACL.TextTransformations": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-texttransformations.html", - "Properties": { - "TextTransformations": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-texttransformations.html#cfn-wafv2-webacl-texttransformations-texttransformations", - "ItemType": "TextTransformation", - "Required": false, - "Type": "List", + "Required": true, "UpdateType": "Mutable" } } }, - "AWS::WAFv2::WebACL.UriPath": { - "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-uripath.html" - }, "AWS::WAFv2::WebACL.VisibilityConfig": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-visibilityconfig.html", "Properties": { "CloudWatchMetricsEnabled": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-visibilityconfig.html#cfn-wafv2-webacl-visibilityconfig-cloudwatchmetricsenabled", "PrimitiveType": "Boolean", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "MetricName": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-visibilityconfig.html#cfn-wafv2-webacl-visibilityconfig-metricname", "PrimitiveType": "String", - "Required": false, + "Required": true, "UpdateType": "Mutable" }, "SampledRequestsEnabled": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-visibilityconfig.html#cfn-wafv2-webacl-visibilityconfig-sampledrequestsenabled", "PrimitiveType": "Boolean", - "Required": false, + "Required": true, "UpdateType": "Mutable" } } @@ -30020,14 +29777,15 @@ "Properties": { "FieldToMatch": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-xssmatchstatement.html#cfn-wafv2-webacl-xssmatchstatement-fieldtomatch", - "Required": false, + "Required": true, "Type": "FieldToMatch", "UpdateType": "Mutable" }, "TextTransformations": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-xssmatchstatement.html#cfn-wafv2-webacl-xssmatchstatement-texttransformations", - "Required": false, - "Type": "TextTransformations", + "ItemType": "TextTransformation", + "Required": true, + "Type": "List", "UpdateType": "Mutable" } } @@ -30154,7 +29912,7 @@ } } }, - "ResourceSpecificationVersion": "11.0.0", + "ResourceSpecificationVersion": "11.1.0", "ResourceTypes": { "AWS::ACMPCA::Certificate": { "Attributes": { @@ -34855,6 +34613,13 @@ "Type": "Environment", "UpdateType": "Mutable" }, + "FileSystemLocations": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-filesystemlocations", + "ItemType": "ProjectFileSystemLocation", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + }, "LogsConfig": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-logsconfig", "Required": false, @@ -35703,6 +35468,12 @@ "Type": "List", "UpdateType": "Mutable" }, + "UsernameConfiguration": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpool.html#cfn-cognito-userpool-usernameconfiguration", + "Required": false, + "Type": "UsernameConfiguration", + "UpdateType": "Mutable" + }, "VerificationMessageTemplate": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpool.html#cfn-cognito-userpool-verificationmessagetemplate", "Required": false, @@ -36109,6 +35880,13 @@ "PrimitiveType": "String", "Required": true, "UpdateType": "Immutable" + }, + "Tags": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-config-aggregationauthorization.html#cfn-config-aggregationauthorization-tags", + "ItemType": "Tag", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" } } }, @@ -36185,6 +35963,13 @@ "Required": false, "Type": "OrganizationAggregationSource", "UpdateType": "Mutable" + }, + "Tags": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-config-configurationaggregator.html#cfn-config-configurationaggregator-tags", + "ItemType": "Tag", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" } } }, @@ -52898,8 +52683,9 @@ "Properties": { "Addresses": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-ipset.html#cfn-wafv2-ipset-addresses", + "PrimitiveItemType": "String", "Required": true, - "Type": "IPAddresses", + "Type": "List", "UpdateType": "Mutable" }, "Description": { @@ -52928,8 +52714,9 @@ }, "Tags": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-ipset.html#cfn-wafv2-ipset-tags", + "ItemType": "Tag", "Required": false, - "Type": "TagList", + "Type": "List", "UpdateType": "Mutable" } } @@ -52959,8 +52746,9 @@ }, "RegularExpressionList": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-regexpatternset.html#cfn-wafv2-regexpatternset-regularexpressionlist", + "PrimitiveItemType": "String", "Required": true, - "Type": "RegularExpressionList", + "Type": "List", "UpdateType": "Mutable" }, "Scope": { @@ -52971,8 +52759,9 @@ }, "Tags": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-regexpatternset.html#cfn-wafv2-regexpatternset-tags", + "ItemType": "Tag", "Required": false, - "Type": "TagList", + "Type": "List", "UpdateType": "Mutable" } } @@ -53008,8 +52797,9 @@ }, "Rules": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-rulegroup.html#cfn-wafv2-rulegroup-rules", + "ItemType": "Rule", "Required": false, - "Type": "Rules", + "Type": "List", "UpdateType": "Mutable" }, "Scope": { @@ -53020,8 +52810,9 @@ }, "Tags": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-rulegroup.html#cfn-wafv2-rulegroup-tags", + "ItemType": "Tag", "Required": false, - "Type": "TagList", + "Type": "List", "UpdateType": "Mutable" }, "VisibilityConfig": { @@ -53066,8 +52857,9 @@ }, "Rules": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-webacl.html#cfn-wafv2-webacl-rules", + "ItemType": "Rule", "Required": false, - "Type": "Rules", + "Type": "List", "UpdateType": "Mutable" }, "Scope": { @@ -53078,8 +52870,9 @@ }, "Tags": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-webacl.html#cfn-wafv2-webacl-tags", + "ItemType": "Tag", "Required": false, - "Type": "TagList", + "Type": "List", "UpdateType": "Mutable" }, "VisibilityConfig": { diff --git a/packages/@aws-cdk/cloudformation-diff/lib/format.ts b/packages/@aws-cdk/cloudformation-diff/lib/format.ts index 96cc123d9736c..6735ecd2bd5d9 100644 --- a/packages/@aws-cdk/cloudformation-diff/lib/format.ts +++ b/packages/@aws-cdk/cloudformation-diff/lib/format.ts @@ -1,4 +1,3 @@ -import * as cxapi from '@aws-cdk/cx-api'; import * as colors from 'colors/safe'; import { format } from 'util'; import { Difference, isPropertyDifference, ResourceDifference, ResourceImpact } from './diff-template'; @@ -8,6 +7,9 @@ import { formatTable } from './format-table'; import { IamChanges } from './iam/iam-changes'; import { SecurityGroupChanges } from './network/security-group-changes'; +// from cx-api +const PATH_METADATA_KEY = 'aws:cdk:path'; + /* eslint-disable @typescript-eslint/no-require-imports */ // tslint:disable-next-line:no-var-requires const { structuredPatch } = require('diff'); @@ -301,12 +303,12 @@ class Formatter { for (const [logicalId, resourceDiff] of Object.entries(templateDiff.resources)) { if (!resourceDiff) { continue; } - const oldPathMetadata = resourceDiff.oldValue && resourceDiff.oldValue.Metadata && resourceDiff.oldValue.Metadata[cxapi.PATH_METADATA_KEY]; + const oldPathMetadata = resourceDiff.oldValue && resourceDiff.oldValue.Metadata && resourceDiff.oldValue.Metadata[PATH_METADATA_KEY]; if (oldPathMetadata && !(logicalId in this.logicalToPathMap)) { this.logicalToPathMap[logicalId] = oldPathMetadata; } - const newPathMetadata = resourceDiff.newValue && resourceDiff.newValue.Metadata && resourceDiff.newValue.Metadata[cxapi.PATH_METADATA_KEY]; + const newPathMetadata = resourceDiff.newValue && resourceDiff.newValue.Metadata && resourceDiff.newValue.Metadata[PATH_METADATA_KEY]; if (newPathMetadata && !(logicalId in this.logicalToPathMap)) { this.logicalToPathMap[logicalId] = newPathMetadata; } diff --git a/packages/@aws-cdk/cloudformation-diff/package.json b/packages/@aws-cdk/cloudformation-diff/package.json index 85a2751816034..eac1fc6f5156c 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.25.0", + "version": "0.0.0", "description": "Utilities to diff CDK stacks against CloudFormation templates", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -30,8 +30,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@aws-cdk/cfnspec": "1.25.0", - "@aws-cdk/cx-api": "1.25.0", + "@aws-cdk/cfnspec": "0.0.0", "colors": "^1.4.0", "diff": "^4.0.2", "fast-deep-equal": "^3.1.1", @@ -42,10 +41,10 @@ "@types/jest": "^25.1.2", "@types/string-width": "^4.0.1", "@types/table": "^4.0.7", - "cdk-build-tools": "1.25.0", + "cdk-build-tools": "0.0.0", "fast-check": "^1.22.2", "jest": "^24.9.0", - "pkglint": "1.25.0", + "pkglint": "0.0.0", "ts-jest": "^25.2.0" }, "repository": { @@ -62,4 +61,4 @@ "node": ">= 10.3.0" }, "stability": "experimental" -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/core/lib/cfn-resource-policy.ts b/packages/@aws-cdk/core/lib/cfn-resource-policy.ts index 10e02b1d98801..f740c8a988626 100644 --- a/packages/@aws-cdk/core/lib/cfn-resource-policy.ts +++ b/packages/@aws-cdk/core/lib/cfn-resource-policy.ts @@ -136,6 +136,12 @@ export interface CfnUpdatePolicy { */ readonly useOnlineResharding?: boolean; + /** + * To upgrade an Amazon ES domain to a new version of Elasticsearch rather than replacing the entire + * AWS::Elasticsearch::Domain resource, use the EnableVersionUpgrade update policy. + */ + readonly enableVersionUpgrade?: boolean; + } /** diff --git a/packages/@aws-cdk/core/lib/private/uniqueid.ts b/packages/@aws-cdk/core/lib/private/uniqueid.ts index ef0798d0e2da7..be04dcf7cf0ed 100644 --- a/packages/@aws-cdk/core/lib/private/uniqueid.ts +++ b/packages/@aws-cdk/core/lib/private/uniqueid.ts @@ -19,6 +19,7 @@ const PATH_SEP = '/'; const HASH_LEN = 8; const MAX_HUMAN_LEN = 240; // max ID len is 255 +const MAX_ID_LEN = 255; /** * Calculates a unique ID for a set of textual components. @@ -46,7 +47,18 @@ export function makeUniqueId(components: string[]) { // transparent migration of cloudformation templates to the CDK without the // need to rename all resources. if (components.length === 1) { - return removeNonAlphanumeric(components[0]); + // we filter out non-alpha characters but that is actually a bad idea + // because it could create conflicts ("A-B" and "AB" will render the same + // logical ID). sadly, changing it in the 1.x version line is impossible + // because it will be a breaking change. we should consider for v2.0. + // https://github.com/aws/aws-cdk/issues/6421 + const candidate = removeNonAlphanumeric(components[0]); + + // if our candidate is short enough, use it as is. otherwise, fall back to + // the normal mode. + if (candidate.length <= MAX_ID_LEN) { + return candidate; + } } const hash = pathHash(components); diff --git a/packages/@aws-cdk/core/package.json b/packages/@aws-cdk/core/package.json index c26ac87cc528a..5c7e11db396cb 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.25.0", + "version": "0.0.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.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cfn2ts": "0.0.0", "fast-check": "^1.22.2", "lodash": "^4.17.15", "nodeunit": "^0.11.3", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/cx-api": "1.25.0" + "@aws-cdk/cx-api": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/cx-api": "1.25.0" + "@aws-cdk/cx-api": "0.0.0" }, "engines": { "node": ">= 10.3.0" diff --git a/packages/@aws-cdk/core/test/test.logical-id.ts b/packages/@aws-cdk/core/test/test.logical-id.ts index 25a6219ee86a8..b2f9a096f347a 100644 --- a/packages/@aws-cdk/core/test/test.logical-id.ts +++ b/packages/@aws-cdk/core/test/test.logical-id.ts @@ -28,13 +28,29 @@ export = { // WHEN const r = new CfnResource(stack, 'MyAwesomeness', { type: 'Resource' }); + const r2 = new CfnResource(stack, 'x'.repeat(255), { type: 'Resource' }); // max length + const r3 = new CfnResource(stack, '*y-'.repeat(255), { type: 'Resource' }); // non-alpha are filtered out (yes, I know it might conflict) // THEN test.equal(stack.resolve(r.logicalId), 'MyAwesomeness'); + test.equal(stack.resolve(r2.logicalId), 'x'.repeat(255)); + test.equal(stack.resolve(r3.logicalId), 'y'.repeat(255)); test.done(); }, + 'if resource is top-level and logical id is longer than allowed, it is trimmed with a hash'(test: Test) { + // GIVEN + const stack = new Stack(undefined, 'TestStack'); + + // WHEN + const r = new CfnResource(stack, 'x'.repeat(256), { type: 'Resource' }); + + // THEN + test.equals(stack.resolve(r.logicalId), 'x'.repeat(240) + `C7A139A2`); + test.done(); + }, + 'Logical IDs can be renamed at the stack level'(test: Test) { // GIVEN const stack = new Stack(); diff --git a/packages/@aws-cdk/core/test/test.resource.ts b/packages/@aws-cdk/core/test/test.resource.ts index c69dbf658d378..dcca545ea04b0 100644 --- a/packages/@aws-cdk/core/test/test.resource.ts +++ b/packages/@aws-cdk/core/test/test.resource.ts @@ -682,6 +682,28 @@ export = { test.done(); }, + + 'enableVersionUpgrade can be set on a resource'(test: Test) { + const stack = new Stack(); + const r1 = new CfnResource(stack, 'Resource', { type: 'Type' }); + + r1.cfnOptions.updatePolicy = { + enableVersionUpgrade: true + }; + + test.deepEqual(toCloudFormation(stack), { + Resources: { + Resource: { + Type: 'Type', + UpdatePolicy: { + EnableVersionUpgrade: true + } + } + } + }); + + test.done(); + }, }; interface CounterProps { diff --git a/packages/@aws-cdk/custom-resources/README.md b/packages/@aws-cdk/custom-resources/README.md index 56d496856e039..d8ba5bb9205e7 100644 --- a/packages/@aws-cdk/custom-resources/README.md +++ b/packages/@aws-cdk/custom-resources/README.md @@ -63,7 +63,7 @@ The following example is a skeleton for a Python implementation of `onEvent`: ```py def on_event(event, context): - print(event) + print(event) request_type = event['RequestType'] if request_type == 'Create': return on_create(event) if request_type == 'Update': return on_update(event) @@ -76,9 +76,9 @@ def on_create(event): # add your create code here... physical_id = ... - + return { 'PhysicalResourceId': physical_id } - + def on_update(event): physical_id = event["PhysicalResourceId"] props = event["ResourceProperties"] @@ -104,8 +104,8 @@ def is_complete(event, context): request_type = event["RequestType"] # check if resource is stable based on request_type - is_ready = ... - + is_ready = ... + return { 'IsComplete': is_ready } ``` @@ -121,7 +121,7 @@ If `onEvent` returns successfully, the framework will submit a "SUCCESS" respons to AWS CloudFormation for this resource operation. If the provider is [asynchronous](#asynchronous-providers-iscomplete) (`isCompleteHandler` is defined), the framework will only submit a response based on the result of -`isComplete`. +`isComplete`. If `onEvent` throws an error, the framework will submit a "FAILED" response to AWS CloudFormation. @@ -153,10 +153,10 @@ The return value from `onEvent` must be a JSON object with the following fields: It is not uncommon for the provisioning of resources to be an asynchronous operation, which means that the operation does not immediately finish, and we -need to "wait" until the resource stabilizes. +need to "wait" until the resource stabilizes. The provider framework makes it easy to implement "waiters" by allowing users to -specify an additional AWS Lambda function in `isCompleteHandler`. +specify an additional AWS Lambda function in `isCompleteHandler`. The framework will repeatedly invoke the handler every `queryInterval`. When `isComplete` returns with `IsComplete: true`, the framework will submit a @@ -230,7 +230,7 @@ lifecycle events: ### Execution Policy Similarly to any AWS Lambda function, if the user-defined handlers require -access to AWS resources, you will have to define these permissions +access to AWS resources, you will have to define these permissions by calling "grant" methods such as `myBucket.grantRead(myHandler)`), using `myHandler.addToRolePolicy` or specifying an `initialPolicy` when defining the function. @@ -353,7 +353,7 @@ const awsCustom1 = new AwsCustomResource(this, 'API1', { onCreate: { service: '...', action: '...', - physicalResourceId: '...' + physicalResourceId: PhysicalResourceId.of('...') } }); @@ -364,7 +364,7 @@ const awsCustom2 = new AwsCustomResource(this, 'API2', { parameters: { text: awsCustom1.getDataString('Items.0.text') }, - physicalResourceId: '...' + physicalResourceId: PhysicalResourceId.of('...') } }) ``` @@ -381,7 +381,7 @@ const verifyDomainIdentity = new AwsCustomResource(this, 'VerifyDomainIdentity', parameters: { Domain: 'example.com' }, - physicalResourceIdPath: 'VerificationToken' // Use the token returned by the call as physical id + physicalResourceId: PhysicalResourceId.fromResponse('VerificationToken') // Use the token returned by the call as physical id } }); @@ -403,7 +403,7 @@ const getParameter = new AwsCustomResource(this, 'GetParameter', { Name: 'my-parameter', WithDecryption: true }, - physicalResourceId: Date.now().toString() // Update physical id to always fetch the latest version + physicalResourceId: PhysicalResourceId.of(Date.now().toString()) // Update physical id to always fetch the latest version } }); diff --git a/packages/@aws-cdk/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts b/packages/@aws-cdk/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts index f8c17c3db0aef..4ebcf8e9e1bbf 100644 --- a/packages/@aws-cdk/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts +++ b/packages/@aws-cdk/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts @@ -16,6 +16,32 @@ export type AwsSdkMetadata = {[key: string]: any}; const awsSdkMetadata: AwsSdkMetadata = metadata; +/** + * Physical ID of the custom resource. + */ +export class PhysicalResourceId { + + /** + * Extract the physical resource id from the path (dot notation) to the data in the API call response. + */ + public static fromResponse(responsePath: string): PhysicalResourceId { + return new PhysicalResourceId(responsePath, undefined); + } + + /** + * Explicit physical resource id. + */ + public static of(id: string): PhysicalResourceId { + return new PhysicalResourceId(undefined, id); + } + + /** + * @param responsePath Path to a response data element to be used as the physical id. + * @param id Literal string to be used as the physical id. + */ + private constructor(public readonly responsePath?: string, public readonly id?: string) { } +} + /** * An AWS SDK call. */ @@ -37,27 +63,18 @@ export interface AwsSdkCall { /** * The parameters for the service action * + * @default - no paramters * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/index.html */ readonly parameters?: any; /** - * The path to the data in the API call response to use as the physical - * resource id. Either `physicalResourceId` or `physicalResourceIdPath` - * must be specified for onCreate or onUpdate calls. - * - * @default - no path - */ - readonly physicalResourceIdPath?: string; - - /** - * The physical resource id of the custom resource for this call. Either - * `physicalResourceId` or `physicalResourceIdPath` must be specified for - * onCreate or onUpdate calls. + * The physical resource id of the custom resource for this call. + * Mandatory for onCreate or onUpdate calls. * * @default - no physical resource id */ - readonly physicalResourceId?: string; + readonly physicalResourceId?: PhysicalResourceId; /** * The regex pattern to use to catch API errors. The `code` property of the @@ -98,6 +115,11 @@ export interface AwsSdkCall { readonly outputPath?: string; } +/** + * Properties for AwsCustomResource. + * + * Note that at least onCreate, onUpdate or onDelete must be specified. + */ export interface AwsCustomResourceProps { /** * Cloudformation Resource type. @@ -108,7 +130,6 @@ export interface AwsCustomResourceProps { /** * The AWS SDK call to make when the resource is created. - * At least onCreate, onUpdate or onDelete must be specified. * * @default - the call when the resource is updated */ @@ -161,11 +182,20 @@ export interface AwsCustomResourceProps { readonly timeout?: cdk.Duration } +/** + * Defines a custom resource that is materialized using specific AWS API calls. + * + * Use this to bridge any gap that might exist in the CloudFormation Coverage. + * You can specify exactly which calls are invoked for the 'CREATE', 'UPDATE' and 'DELETE' life cycle events. + * + */ export class AwsCustomResource extends cdk.Construct implements iam.IGrantable { public readonly grantPrincipal: iam.IPrincipal; private readonly customResource: CustomResource; + // 'props' cannot be optional, even though all its properties are optional. + // this is because at least one sdk call must be provided. constructor(scope: cdk.Construct, id: string, props: AwsCustomResourceProps) { super(scope, id); @@ -174,8 +204,8 @@ export class AwsCustomResource extends cdk.Construct implements iam.IGrantable { } for (const call of [props.onCreate, props.onUpdate]) { - if (call && !call.physicalResourceId && !call.physicalResourceIdPath) { - throw new Error('Either `physicalResourceId` or `physicalResourceIdPath` must be specified for onCreate and onUpdate calls.'); + if (call && !call.physicalResourceId) { + throw new Error('`physicalResourceId` must be specified for onCreate and onUpdate calls.'); } } 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 7a6288d285e5a..9507a8f9388b1 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 @@ -86,7 +86,21 @@ export async function handler(event: AWSLambda.CloudFormationCustomResourceEvent console.log(JSON.stringify(event)); console.log('AWS SDK VERSION: ' + AWS.VERSION); - let physicalResourceId = (event as any).PhysicalResourceId; + // Default physical resource id + let physicalResourceId: string; + switch (event.RequestType) { + case 'Create': + physicalResourceId = event.ResourceProperties.Create?.physicalResourceId?.id ?? + event.ResourceProperties.Update?.physicalResourceId?.id ?? + event.ResourceProperties.Delete?.physicalResourceId?.id ?? + event.LogicalResourceId; + break; + case 'Update': + case 'Delete': + physicalResourceId = event.ResourceProperties[event.RequestType]?.physicalResourceId?.id ?? event.PhysicalResourceId; + break; + } + let flatData: { [key: string]: string } = {}; let data: { [key: string]: string } = {}; const call: AwsSdkCall | undefined = event.ResourceProperties[event.RequestType]; @@ -113,9 +127,9 @@ export async function handler(event: AWSLambda.CloudFormationCustomResourceEvent } } - physicalResourceId = call.physicalResourceIdPath - ? flatData[call.physicalResourceIdPath] - : call.physicalResourceId || (event as any).PhysicalResourceId; + if (call.physicalResourceId?.responsePath) { + physicalResourceId = flatData[call.physicalResourceId.responsePath]; + } } 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 a802f8feb403a..4e4afeba674b3 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.25.0", + "version": "0.0.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.25.0", - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/aws-ssm": "1.25.0", + "@aws-cdk/assert": "0.0.0", + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/aws-ssm": "0.0.0", "@types/aws-lambda": "^8.10.39", "@types/fs-extra": "^8.1.0", - "@types/sinon": "^7.5.0", - "aws-sdk": "^2.624.0", + "@types/sinon": "^7.5.2", + "aws-sdk": "^2.630.0", "aws-sdk-mock": "^5.0.0", - "cdk-build-tools": "1.25.0", - "cdk-integ-tools": "1.25.0", - "cfn2ts": "1.25.0", + "cdk-build-tools": "0.0.0", + "cdk-integ-tools": "0.0.0", + "cfn2ts": "0.0.0", "fs-extra": "^8.1.0", - "nock": "^12.0.0", - "pkglint": "1.25.0", + "nock": "^12.0.2", + "pkglint": "0.0.0", "sinon": "^9.0.0" }, "dependencies": { - "@aws-cdk/aws-cloudformation": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/aws-stepfunctions": "1.25.0", - "@aws-cdk/aws-stepfunctions-tasks": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-cloudformation": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/aws-stepfunctions": "0.0.0", + "@aws-cdk/aws-stepfunctions-tasks": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { - "@aws-cdk/aws-cloudformation": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/aws-stepfunctions": "1.25.0", - "@aws-cdk/aws-stepfunctions-tasks": "1.25.0", - "@aws-cdk/core": "1.25.0" + "@aws-cdk/aws-cloudformation": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/aws-stepfunctions": "0.0.0", + "@aws-cdk/aws-stepfunctions-tasks": "0.0.0", + "@aws-cdk/core": "0.0.0" }, "jest": { "moduleFileExtensions": [ @@ -125,11 +125,7 @@ "stability": "experimental", "awslint": { "exclude": [ - "construct-ctor-props-optional:@aws-cdk/custom-resources.AwsCustomResource", - "props-physical-name:@aws-cdk/custom-resources.AsyncCustomResourceProps", - "docs-public-apis:@aws-cdk/custom-resources.AwsCustomResource", - "docs-public-apis:@aws-cdk/custom-resources.AwsCustomResourceProps", - "props-default-doc:@aws-cdk/custom-resources.AwsSdkCall.parameters" + "construct-ctor-props-optional:@aws-cdk/custom-resources.AwsCustomResource" ] - } + } } \ No newline at end of file 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 e613eccc879bc..9fa7fbfd936d6 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 @@ -3,7 +3,7 @@ import * as AWS from 'aws-sdk-mock'; import * as fs from 'fs-extra'; import * as nock from 'nock'; import * as sinon from 'sinon'; -import { AwsSdkCall } from '../../lib'; +import { AwsSdkCall, PhysicalResourceId } from '../../lib'; import { flatten, handler } from '../../lib/aws-custom-resource/runtime'; AWS.setSDK(require.resolve('aws-sdk')); @@ -62,7 +62,7 @@ test('create event with physical resource id path', async () => { parameters: { Bucket: 'my-bucket' }, - physicalResourceIdPath: 'Contents.1.ETag' + physicalResourceId: PhysicalResourceId.fromResponse('Contents.1.ETag') } as AwsSdkCall } }; @@ -101,7 +101,7 @@ test('update event with physical resource id', async () => { Message: 'hello', TopicArn: 'topicarn' }, - physicalResourceId: 'topicarn' + physicalResourceId: PhysicalResourceId.of('topicarn') } as AwsSdkCall } }; @@ -133,7 +133,7 @@ test('delete event', async () => { parameters: { Bucket: 'my-bucket' }, - physicalResourceIdPath: 'Contents.1.ETag' + physicalResourceId: PhysicalResourceId.fromResponse('Contents.1.ETag') } as AwsSdkCall } }; @@ -186,6 +186,38 @@ test('delete event with Delete call and no physical resource id in call', async expect(request.isDone()).toBeTruthy(); }); +test('create event with Delete call only', async () => { + const deleteParameterFake = sinon.fake.resolves({}); + + AWS.mock('SSM', 'deleteParameter', deleteParameterFake); + + const event: AWSLambda.CloudFormationCustomResourceCreateEvent = { + ...eventCommon, + RequestType: 'Create', + ResourceProperties: { + ServiceToken: 'token', + Delete: { + service: 'SSM', + action: 'deleteParameter', + parameters: { + Name: 'my-param' + }, + } as AwsSdkCall + } + }; + + const request = createRequest(body => + body.Status === 'SUCCESS' && + body.PhysicalResourceId === 'logicalResourceId' + ); + + await handler(event, {} as AWSLambda.Context); + + sinon.assert.notCalled(deleteParameterFake); + + expect(request.isDone()).toBeTruthy(); +}); + test('catch errors', async () => { const error: NodeJS.ErrnoException = new Error(); error.code = 'NoSuchBucket'; @@ -204,7 +236,7 @@ test('catch errors', async () => { parameters: { Bucket: 'my-bucket' }, - physicalResourceId: 'physicalResourceId', + physicalResourceId: PhysicalResourceId.of('physicalResourceId'), catchErrorPattern: 'NoSuchBucket' } as AwsSdkCall } @@ -251,7 +283,7 @@ test('decodes booleans', async () => { }, } }, - physicalResourceId: 'put-item' + physicalResourceId: PhysicalResourceId.of('put-item') } as AwsSdkCall } }; @@ -310,7 +342,7 @@ test('restrict output path', async () => { parameters: { Bucket: 'my-bucket' }, - physicalResourceId: 'id', + physicalResourceId: PhysicalResourceId.of('id'), outputPath: 'Contents.0' } as AwsSdkCall } @@ -347,7 +379,7 @@ test('can specify apiVersion and region', async () => { }, apiVersion: '2010-03-31', region: 'eu-west-1', - physicalResourceId: 'id', + physicalResourceId: PhysicalResourceId.of('id'), } as AwsSdkCall } }; @@ -401,7 +433,7 @@ test('installs the latest SDK', async () => { Message: 'message', TopicArn: 'topic' }, - physicalResourceId: 'id', + physicalResourceId: PhysicalResourceId.of('id'), } as AwsSdkCall } }; diff --git a/packages/@aws-cdk/custom-resources/test/aws-custom-resource/aws-custom-resource.test.ts b/packages/@aws-cdk/custom-resources/test/aws-custom-resource/aws-custom-resource.test.ts index 5527f2923ab33..38fca5e4b5757 100644 --- a/packages/@aws-cdk/custom-resources/test/aws-custom-resource/aws-custom-resource.test.ts +++ b/packages/@aws-cdk/custom-resources/test/aws-custom-resource/aws-custom-resource.test.ts @@ -1,7 +1,7 @@ import '@aws-cdk/assert/jest'; import * as iam from '@aws-cdk/aws-iam'; import * as cdk from '@aws-cdk/core'; -import { AwsCustomResource } from '../../lib'; +import { AwsCustomResource, PhysicalResourceId } from '../../lib'; // tslint:disable:object-literal-key-quotes @@ -19,7 +19,7 @@ test('aws sdk js custom resource with onCreate and onDelete', () => { logGroupName: '/aws/lambda/loggroup', retentionInDays: 90 }, - physicalResourceId: 'loggroup' + physicalResourceId: PhysicalResourceId.of('loggroup') }, onDelete: { service: 'CloudWatchLogs', @@ -39,7 +39,9 @@ test('aws sdk js custom resource with onCreate and onDelete', () => { "logGroupName": "/aws/lambda/loggroup", "retentionInDays": 90 }, - "physicalResourceId": "loggroup" + "physicalResourceId": { + "id": "loggroup" + } }, "Delete": { "service": "CloudWatchLogs", @@ -84,7 +86,7 @@ test('onCreate defaults to onUpdate', () => { Key: 'my-key', Body: 'my-body' }, - physicalResourceIdPath: 'ETag' + physicalResourceId: PhysicalResourceId.fromResponse('ETag') }, }); @@ -98,7 +100,9 @@ test('onCreate defaults to onUpdate', () => { "Key": "my-key", "Body": "my-body" }, - "physicalResourceIdPath": "ETag" + "physicalResourceId": { + "responsePath": "ETag" + } }, "Update": { "service": "s3", @@ -108,7 +112,9 @@ test('onCreate defaults to onUpdate', () => { "Key": "my-key", "Body": "my-body" }, - "physicalResourceIdPath": "ETag" + "physicalResourceId": { + "responsePath": "ETag" + } }, }); }); @@ -127,7 +133,7 @@ test('with custom policyStatements', () => { Key: 'my-key', Body: 'my-body' }, - physicalResourceIdPath: 'ETag' + physicalResourceId: PhysicalResourceId.fromResponse('ETag') }, policyStatements: [ new iam.PolicyStatement({ @@ -169,7 +175,7 @@ test('fails when no physical resource method is specified', () => { retentionInDays: 90 } } - })).toThrow(/`physicalResourceId`.+`physicalResourceIdPath`/); + })).toThrow(/`physicalResourceId`/); }); test('encodes booleans', () => { @@ -188,7 +194,7 @@ test('encodes booleans', () => { falseBoolean: false, falseString: 'false' }, - physicalResourceId: 'id' + physicalResourceId: PhysicalResourceId.of('id') }, }); @@ -203,7 +209,9 @@ test('encodes booleans', () => { "falseBoolean": "FALSE:BOOLEAN", "falseString": "false" }, - "physicalResourceId": "id" + "physicalResourceId": { + "id": "id" + } }, }); }); @@ -217,7 +225,7 @@ test('timeout defaults to 2 minutes', () => { onCreate: { service: 'service', action: 'action', - physicalResourceId: 'id' + physicalResourceId: PhysicalResourceId.of('id') } }); @@ -236,7 +244,7 @@ test('can specify timeout', () => { onCreate: { service: 'service', action: 'action', - physicalResourceId: 'id' + physicalResourceId: PhysicalResourceId.of('id') }, timeout: cdk.Duration.minutes(15) }); @@ -257,7 +265,7 @@ test('implements IGrantable', () => { onCreate: { service: 'service', action: 'action', - physicalResourceId: 'id' + physicalResourceId: PhysicalResourceId.of('id') } }); @@ -298,7 +306,7 @@ test('can use existing role', () => { onCreate: { service: 'service', action: 'action', - physicalResourceId: 'id' + physicalResourceId: PhysicalResourceId.of('id') }, role }); @@ -318,7 +326,7 @@ test('getData', () => { onCreate: { service: 'service', action: 'action', - physicalResourceId: 'id' + physicalResourceId: PhysicalResourceId.of('id') } }); @@ -341,7 +349,7 @@ test('getDataString', () => { onCreate: { service: 'service', action: 'action', - physicalResourceId: 'id' + physicalResourceId: PhysicalResourceId.of('id') } }); @@ -353,7 +361,7 @@ test('getDataString', () => { parameters: { a: awsSdk.getDataString('Data') }, - physicalResourceId: 'id' + physicalResourceId: PhysicalResourceId.of('id') } }); @@ -370,7 +378,9 @@ test('getDataString', () => { ] } }, - physicalResourceId: 'id' + physicalResourceId: { + "id": 'id' + } } }); }); 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 880c33b630c11..68bebdc9bc22d 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 @@ -22,7 +22,9 @@ } }, "physicalResourceId": { - "Ref": "TopicBFC7AF6E" + "id": { + "Ref": "TopicBFC7AF6E" + } } }, "Update": { @@ -35,7 +37,9 @@ } }, "physicalResourceId": { - "Ref": "TopicBFC7AF6E" + "id": { + "Ref": "TopicBFC7AF6E" + } } } }, @@ -109,7 +113,7 @@ "Properties": { "Code": { "S3Bucket": { - "Ref": "AssetParametersc6841f16fc6689f1b3a9ae6e91f18d4e6cc06c23c2b1e7b7155625c258cb8999S3Bucket38F49C79" + "Ref": "AssetParameters6bf0eac2bfd1c5dcd41b3cc53f24814f9dba9cce0cb7fe2e34d0ded661481748S3BucketFC283D1B" }, "S3Key": { "Fn::Join": [ @@ -122,7 +126,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParametersc6841f16fc6689f1b3a9ae6e91f18d4e6cc06c23c2b1e7b7155625c258cb8999S3VersionKey9906BC0C" + "Ref": "AssetParameters6bf0eac2bfd1c5dcd41b3cc53f24814f9dba9cce0cb7fe2e34d0ded661481748S3VersionKey7E916B81" } ] } @@ -135,7 +139,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParametersc6841f16fc6689f1b3a9ae6e91f18d4e6cc06c23c2b1e7b7155625c258cb8999S3VersionKey9906BC0C" + "Ref": "AssetParameters6bf0eac2bfd1c5dcd41b3cc53f24814f9dba9cce0cb7fe2e34d0ded661481748S3VersionKey7E916B81" } ] } @@ -172,12 +176,16 @@ "Create": { "service": "SNS", "action": "listTopics", - "physicalResourceIdPath": "Topics.0.TopicArn" + "physicalResourceId": { + "responsePath": "Topics.0.TopicArn" + } }, "Update": { "service": "SNS", "action": "listTopics", - "physicalResourceIdPath": "Topics.0.TopicArn" + "physicalResourceId": { + "responsePath": "Topics.0.TopicArn" + } } }, "DependsOn": [ @@ -211,7 +219,9 @@ }, "WithDecryption": "TRUE:BOOLEAN" }, - "physicalResourceIdPath": "Parameter.ARN" + "physicalResourceId": { + "responsePath": "Parameter.ARN" + } }, "Update": { "service": "SSM", @@ -222,7 +232,9 @@ }, "WithDecryption": "TRUE:BOOLEAN" }, - "physicalResourceIdPath": "Parameter.ARN" + "physicalResourceId": { + "responsePath": "Parameter.ARN" + } } }, "UpdateReplacePolicy": "Delete", @@ -230,17 +242,17 @@ } }, "Parameters": { - "AssetParametersc6841f16fc6689f1b3a9ae6e91f18d4e6cc06c23c2b1e7b7155625c258cb8999S3Bucket38F49C79": { + "AssetParameters6bf0eac2bfd1c5dcd41b3cc53f24814f9dba9cce0cb7fe2e34d0ded661481748S3BucketFC283D1B": { "Type": "String", - "Description": "S3 bucket for asset \"c6841f16fc6689f1b3a9ae6e91f18d4e6cc06c23c2b1e7b7155625c258cb8999\"" + "Description": "S3 bucket for asset \"6bf0eac2bfd1c5dcd41b3cc53f24814f9dba9cce0cb7fe2e34d0ded661481748\"" }, - "AssetParametersc6841f16fc6689f1b3a9ae6e91f18d4e6cc06c23c2b1e7b7155625c258cb8999S3VersionKey9906BC0C": { + "AssetParameters6bf0eac2bfd1c5dcd41b3cc53f24814f9dba9cce0cb7fe2e34d0ded661481748S3VersionKey7E916B81": { "Type": "String", - "Description": "S3 key for asset version \"c6841f16fc6689f1b3a9ae6e91f18d4e6cc06c23c2b1e7b7155625c258cb8999\"" + "Description": "S3 key for asset version \"6bf0eac2bfd1c5dcd41b3cc53f24814f9dba9cce0cb7fe2e34d0ded661481748\"" }, - "AssetParametersc6841f16fc6689f1b3a9ae6e91f18d4e6cc06c23c2b1e7b7155625c258cb8999ArtifactHash5595423D": { + "AssetParameters6bf0eac2bfd1c5dcd41b3cc53f24814f9dba9cce0cb7fe2e34d0ded661481748ArtifactHashB96EE827": { "Type": "String", - "Description": "Artifact hash for asset \"c6841f16fc6689f1b3a9ae6e91f18d4e6cc06c23c2b1e7b7155625c258cb8999\"" + "Description": "Artifact hash for asset \"6bf0eac2bfd1c5dcd41b3cc53f24814f9dba9cce0cb7fe2e34d0ded661481748\"" } }, "Outputs": { diff --git a/packages/@aws-cdk/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.ts b/packages/@aws-cdk/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.ts index f736237e5bce1..3fd4f1b21f10a 100644 --- a/packages/@aws-cdk/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.ts +++ b/packages/@aws-cdk/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.ts @@ -2,7 +2,7 @@ import * as sns from '@aws-cdk/aws-sns'; import * as ssm from '@aws-cdk/aws-ssm'; import * as cdk from '@aws-cdk/core'; -import { AwsCustomResource } from '../../lib'; +import { AwsCustomResource, PhysicalResourceId } from '../../lib'; const app = new cdk.App(); @@ -19,7 +19,7 @@ const snsPublish = new AwsCustomResource(stack, 'Publish', { Message: 'hello', TopicArn: topic.topicArn }, - physicalResourceId: topic.topicArn, + physicalResourceId: PhysicalResourceId.of(topic.topicArn), } }); @@ -27,7 +27,7 @@ const listTopics = new AwsCustomResource(stack, 'ListTopics', { onUpdate: { service: 'SNS', action: 'listTopics', - physicalResourceIdPath: 'Topics.0.TopicArn' + physicalResourceId: PhysicalResourceId.fromResponse('Topics.0.TopicArn') } }); listTopics.node.addDependency(topic); @@ -44,7 +44,7 @@ const getParameter = new AwsCustomResource(stack, 'GetParameter', { Name: ssmParameter.parameterName, WithDecryption: true }, - physicalResourceIdPath: 'Parameter.ARN' + physicalResourceId: PhysicalResourceId.fromResponse('Parameter.ARN') } }); diff --git a/packages/@aws-cdk/cx-api/package.json b/packages/@aws-cdk/cx-api/package.json index 8118f0f06e3da..cc18c5dfa63ab 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.25.0", + "version": "0.0.0", "description": "Cloud executable protocol", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -67,12 +67,12 @@ "license": "Apache-2.0", "devDependencies": { "@types/jest": "^25.1.2", - "@types/semver": "^7.1.0", "@types/mock-fs": "^4.10.0", - "cdk-build-tools": "1.25.0", - "mock-fs": "^4.10.4", + "@types/semver": "^7.1.0", + "cdk-build-tools": "0.0.0", "jest": "^24.9.0", - "pkglint": "1.25.0" + "mock-fs": "^4.11.0", + "pkglint": "0.0.0" }, "repository": { "url": "https://github.com/aws/aws-cdk.git", @@ -149,4 +149,4 @@ "docs-public-apis:@aws-cdk/cx-api.SynthesisMessageLevel.ERROR" ] } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/region-info/package.json b/packages/@aws-cdk/region-info/package.json index 67e0305f91e89..19e095c221778 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.25.0", + "version": "0.0.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.1.0", - "cdk-build-tools": "1.25.0", + "cdk-build-tools": "0.0.0", "fs-extra": "^8.1.0", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "jest": { "moduleFileExtensions": [ @@ -89,4 +89,4 @@ "docs-public-apis:@aws-cdk/region-info.RegionInfo.name" ] } -} +} \ No newline at end of file diff --git a/packages/@monocdk-experiment/assert/.gitignore b/packages/@monocdk-experiment/assert/.gitignore new file mode 100644 index 0000000000000..b5d0394a53a1c --- /dev/null +++ b/packages/@monocdk-experiment/assert/.gitignore @@ -0,0 +1,11 @@ +lib/ +test/ +README.md +LICENSE +NOTICE +node_modules +jest.ts +.npmignore + +*.js +*.d.ts \ No newline at end of file diff --git a/packages/@monocdk-experiment/assert/clone.sh b/packages/@monocdk-experiment/assert/clone.sh new file mode 100755 index 0000000000000..b290c36b16945 --- /dev/null +++ b/packages/@monocdk-experiment/assert/clone.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# clones @aws-cdk/assert into here +scriptdir=$(cd $(dirname $0) && pwd) +cd $scriptdir +set -euo pipefail +src="../../@aws-cdk/assert" +rsync -av $src/lib/ lib/ +rsync -av $src/test/ test/ + +files="README.md LICENSE NOTICE .npmignore jest.ts" + +for file in ${files}; do + cp $src/$file . +done + +npx rewrite-imports {lib,test}/*.ts jest.ts + + diff --git a/packages/@monocdk-experiment/assert/package.json b/packages/@monocdk-experiment/assert/package.json new file mode 100644 index 0000000000000..d4192745fb359 --- /dev/null +++ b/packages/@monocdk-experiment/assert/package.json @@ -0,0 +1,72 @@ +{ + "name": "@monocdk-experiment/assert", + "version": "0.0.0", + "description": "An assertion library for use with CDK Apps", + "main": "lib/index.js", + "types": "lib/index.d.ts", + "scripts": { + "build": "./clone.sh && cdk-build", + "watch": "cdk-watch", + "lint": "cdk-lint", + "test": "cdk-test", + "pkglint": "pkglint -f", + "package": "cdk-package", + "build+test+package": "npm run build+test && npm run package", + "build+test": "npm run build && npm test" + }, + "cdk-build": { + "eslint": { + "disable": true + }, + "tslint": { + "disable": true + }, + "pkglint": { + "disable": true + } + }, + "jest": { + "coverageThreshold": { + "global": { + "statements": 75, + "branches": 65 + } + } + }, + "author": { + "name": "Amazon Web Services", + "url": "https://aws.amazon.com", + "organization": true + }, + "license": "Apache-2.0", + "devDependencies": { + "@types/jest": "^25.1.2", + "cdk-build-tools": "0.0.0", + "jest": "^24.9.0", + "pkglint": "0.0.0", + "ts-jest": "^25.2.0", + "@monocdk-experiment/rewrite-imports": "0.0.0", + "monocdk-experiment": "0.0.0" + }, + "dependencies": { + "@aws-cdk/cloudformation-diff": "0.0.0" + }, + "peerDependencies": { + "jest": "^24.9.0", + "monocdk-experiment": "^0.0.0" + }, + "repository": { + "url": "https://github.com/aws/aws-cdk.git", + "type": "git", + "directory": "packages/@monocdk-experiment/assert" + }, + "keywords": [ + "aws", + "cdk" + ], + "homepage": "https://github.com/aws/aws-cdk", + "engines": { + "node": ">= 10.3.0" + }, + "stability": "experimental" +} \ No newline at end of file diff --git a/packages/@monocdk-experiment/assert/tsconfig.json b/packages/@monocdk-experiment/assert/tsconfig.json new file mode 100644 index 0000000000000..09e731eab9d8b --- /dev/null +++ b/packages/@monocdk-experiment/assert/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "target":"es2018", + "lib": ["es2016", "es2017.object", "es2017.string"], + "module": "commonjs", + "declaration": true, + "strict": true, + "noImplicitAny": true, + "strictNullChecks": true, + "noImplicitThis": true, + "alwaysStrict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": false, + "inlineSourceMap": true, + "inlineSources": true, + "strictPropertyInitialization": false, + "experimentalDecorators": true + }, + "include": ["**/*.ts" ], + "exclude": ["node_modules"] +} diff --git a/packages/@monocdk-experiment/rewrite-imports/.gitignore b/packages/@monocdk-experiment/rewrite-imports/.gitignore new file mode 100644 index 0000000000000..2ba0ace08521c --- /dev/null +++ b/packages/@monocdk-experiment/rewrite-imports/.gitignore @@ -0,0 +1,3 @@ +node_modules +*.js +*.d.ts diff --git a/packages/@monocdk-experiment/rewrite-imports/README.md b/packages/@monocdk-experiment/rewrite-imports/README.md new file mode 100644 index 0000000000000..b08a599046e7f --- /dev/null +++ b/packages/@monocdk-experiment/rewrite-imports/README.md @@ -0,0 +1,12 @@ +# @monocdk-experiment/rewrite-imports + +A hacky tool to mass rewrite a bunch of TS files from the old style imports +to the new style imports. + +Don't expect this to be perfect, or even good. Have your trusty pal git available +to roll back if you need to! + +``` +npx tsc +node /path/to/cdk-rewrite-mono-imports/index lib/*.ts +``` diff --git a/packages/@monocdk-experiment/rewrite-imports/bin/rewrite-imports b/packages/@monocdk-experiment/rewrite-imports/bin/rewrite-imports new file mode 100755 index 0000000000000..f3ce9cb764bc3 --- /dev/null +++ b/packages/@monocdk-experiment/rewrite-imports/bin/rewrite-imports @@ -0,0 +1,2 @@ +#!/usr/bin/env node +require('./rewrite-imports.js'); diff --git a/packages/@monocdk-experiment/rewrite-imports/bin/rewrite-imports.ts b/packages/@monocdk-experiment/rewrite-imports/bin/rewrite-imports.ts new file mode 100644 index 0000000000000..f0e0834fc4ae8 --- /dev/null +++ b/packages/@monocdk-experiment/rewrite-imports/bin/rewrite-imports.ts @@ -0,0 +1,237 @@ +// tslint:disable: no-console +import * as fs from 'fs'; +import * as path from 'path'; +import * as ts from 'typescript'; + +function compile(fileNames: string[], options: ts.CompilerOptions): void { + const program = ts.createProgram(fileNames, options); + + program.getSourceFiles() + .filter(file => !file.fileName.endsWith('.d.ts')) + .forEach(file => { + if (!fileNames.find(x => path.resolve(x) === path.resolve(file.fileName))) { + return; + } + + process.stdout.write(`${file.fileName}: `); + const newSource = rewriteFile(file); + + if (newSource === file.text) { + process.stdout.write('No change.\n'); + return; + } + + fs.writeFileSync(file.fileName, newSource, { encoding: 'utf-8' }); + process.stdout.write('Done.\n'); + }); +} + +interface Span { + readonly start: number, + readonly end: number; +} + +function findImports(nodes: ReadonlyArray): Span { + let start = 0; + while (start < nodes.length && !isImportTypeNode(nodes[start])) { + start++; + } + + let end = start + 1; + while (end < nodes.length && isImportTypeNode(nodes[end])) { + end++; + } + + return { start, end }; +} + +type ImportNode = ts.ImportEqualsDeclaration | ts.ImportDeclaration; + +type ImportAnalysis = { + readonly cdkSubModule: string; +} & ({ + readonly type: 'module'; + readonly moduleAlias: string; +} | { + readonly type: 'symbols'; + readonly symbols: SymbolImport[]; +}); + +type SymbolImport = { + name: string; + alias?: string; +}; + +interface CdkNamespaceImport { + readonly ns: string; + readonly alias?: string; +} + +interface CdkSymbolImport { + readonly symbolName: string; + readonly symbolAlias?: string; +} + +function isImportTypeNode(node: ts.Node): node is ImportNode { + return ts.isImportEqualsDeclaration(node) + || ts.isImportDeclaration(node); +} + +function rewriteImports(nodes: ReadonlyArray): [ts.Statement[], boolean] { + const namespaces = new Array(); + const symbolsByNamespace: Record = {}; + const otherImports = new Array(); + + for (const node of nodes) { + const cdkImport = analyzeCdkImport(node); + if (!cdkImport) { + otherImports.push(node); + continue; + } + + const ns = transmogrify(cdkImport.cdkSubModule); + + switch (cdkImport.type) { + case 'module': + namespaces.push({ + ns, + alias: cdkImport.moduleAlias, + }); + break; + case 'symbols': + namespaces.push({ ns }); + for (const sym of cdkImport.symbols) { + if (!(ns in symbolsByNamespace)) { symbolsByNamespace[ns] = []; } + + if (sym.alias) { + console.error(`Watch out! Aliased symbol imports not supported: ${sym.alias}`); + } + + symbolsByNamespace[ns].push({ + symbolName: sym.name, + symbolAlias: sym.alias, + }); + } + break; + } + } + + const cdkImports = new Array(); + if (namespaces.length > 0) { + cdkImports.push(ts.createImportDeclaration( + /* decorators */ undefined, + /* modifiers */ undefined, + ts.createImportClause( + /* name */ undefined, + ts.createNamedImports( + namespaces.map(nsImport => ts.createImportSpecifier(ts.createIdentifier(nsImport.ns), ts.createIdentifier(nsImport.alias ?? nsImport.ns))), + ) + ), + ts.createStringLiteral('monocdk-experiment'))); + } + + const cdkRebinds = new Array(); + for (const [nsName, symbols] of Object.entries(symbolsByNamespace)) { + cdkRebinds.push(ts.createVariableStatement( + [], [ + ts.createVariableDeclaration( + ts.createObjectBindingPattern(symbols.map(sym => ts.createBindingElement( + /* dotDotDotToken */ undefined, + undefined, + ts.createIdentifier(sym.symbolName), + ))), + /* type */ undefined, + ts.createIdentifier(nsName) + ) + ])); + } + + const newStatements = [ + ...cdkImports, + ...otherImports, + ...cdkRebinds, + ]; + + return [newStatements, cdkImports.length + cdkRebinds.length > 0]; +} + +function analyzeCdkImport(node: ImportNode): ImportAnalysis | undefined { + if (ts.isImportDeclaration(node)) { + if (ts.isStringLiteral(node.moduleSpecifier)) { + const cdkSubModule = extractCdkModuleName(node.moduleSpecifier.text); + if (cdkSubModule === undefined) { return undefined; } + + if (node.importClause) { + if (node.importClause.name) { + return { cdkSubModule, type: 'module', moduleAlias: node.importClause.name.text }; + } + if (node.importClause.namedBindings) { + if (ts.isNamespaceImport(node.importClause.namedBindings)) { + return { cdkSubModule, type: 'module', moduleAlias: node.importClause.namedBindings.name.text }; + } + if (ts.isNamedImports(node.importClause.namedBindings)) { + return { + cdkSubModule, + type: 'symbols', + symbols: node.importClause.namedBindings.elements.map(el => ({ + name: el.name.text, + alias: el.propertyName?.text, + })) + }; + } + } + } + } + } + if (ts.isImportEqualsDeclaration(node)) { + if (ts.isExternalModuleReference(node.moduleReference)) { + if (ts.isStringLiteral(node.moduleReference.expression)) { + const cdkSubModule = extractCdkModuleName(node.moduleReference.expression.text); + if (cdkSubModule === undefined) { return undefined; } + + return { cdkSubModule, type: 'module', moduleAlias: node.name.text }; + } + } + } + return undefined; +} + +function transmogrify(submoduleName: string) { + return submoduleName.replace(/[^a-zA-Z0-9]/g, '_'); +} + +function extractCdkModuleName(name: string) { + if (!name.startsWith('@aws-cdk/')) { return undefined; } + if (name === '@aws-cdk/assert') { return undefined; } + return name.substring('@aws-cdk/'.length); +} + +function rewriteFile(file: ts.SourceFile) { + const statements = file.statements; + const importSpan = findImports(statements); + const imports = statements.slice(importSpan.start, importSpan.end); + if (imports.length === 0) { return file.text; } + + const [rewrittenImports, didWork] = rewriteImports(imports as ImportNode[]); + if (!didWork) { return file.text; } + + // Just render the imports again, we can't rerender the entire tree because + // it will lose whitespace info. + const newFile = ts.updateSourceFileNode(file, rewrittenImports); + const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed, }); + const importText = printer.printFile(newFile); + + const originalSource = file.text; + const source = (originalSource.substring(0, imports[0].getStart(file)) + + importText + + originalSource.substring(imports[imports.length - 1].getEnd())); + + return source; +} + +compile(process.argv.slice(2), { + noEmitOnError: true, + noImplicitAny: true, + target: ts.ScriptTarget.ES5, + module: ts.ModuleKind.CommonJS +}); \ No newline at end of file diff --git a/packages/@monocdk-experiment/rewrite-imports/package.json b/packages/@monocdk-experiment/rewrite-imports/package.json new file mode 100644 index 0000000000000..91ea548a128f5 --- /dev/null +++ b/packages/@monocdk-experiment/rewrite-imports/package.json @@ -0,0 +1,37 @@ +{ + "name": "@monocdk-experiment/rewrite-imports", + "version": "0.0.0", + "description": "Rewrites typescript 'import' statements from @aws-cdk/xxx to monocdk-experiment", + "bin": { + "rewrite-imports": "bin/rewrite-imports" + }, + "main": "bin/rewrite-imports.js", + "scripts": { + "build": "tsc", + "watch": "tsc -w", + "test": "echo ok", + "pkglint": "pkglint -f", + "package": "cdk-package", + "build+test+package": "npm run build+test && npm run package", + "build+test": "npm run build && npm test" + }, + "keywords": [ + "aws", + "cdk", + "awscdk" + ], + "author": { + "name": "Amazon Web Services", + "url": "https://aws.amazon.com", + "organization": true + }, + "license": "Apache-2.0", + "dependencies": { + "typescript": "^3.8.3" + }, + "devDependencies": { + "cdk-build-tools": "0.0.0", + "pkglint": "0.0.0", + "@types/node": "^10.17.17" + } +} \ No newline at end of file diff --git a/packages/@monocdk-experiment/rewrite-imports/tsconfig.json b/packages/@monocdk-experiment/rewrite-imports/tsconfig.json new file mode 100644 index 0000000000000..644a2975f7200 --- /dev/null +++ b/packages/@monocdk-experiment/rewrite-imports/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "target": "ES2018", + "module": "commonjs", + "lib": ["es2018", "dom"], + "strict": true, + "alwaysStrict": true, + "declaration": true, + "inlineSourceMap": true, + "inlineSources": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "resolveJsonModule": true, + "composite": true, + "incremental": true + }, + "include": [ + "**/*.ts", + "**/*.d.ts" + ], + "exclude": [ + "node_modules" + ] +} + diff --git a/packages/aws-cdk/README.md b/packages/aws-cdk/README.md index 9145aa5639e42..510fc63258837 100644 --- a/packages/aws-cdk/README.md +++ b/packages/aws-cdk/README.md @@ -128,9 +128,9 @@ bootstrapped (using `cdk bootstrap`), only stacks that are not using assets and $ cdk deploy --app='node bin/main.js' MyStackName ``` -Before creating a change set, `cdk deploy` will compare the template of the -currently deployed stack to the template that is about to be deployed and will -skip deployment if they are identical. Use `--force` to override this behavior +Before creating a change set, `cdk deploy` will compare the template and tags of the +currently deployed stack to the template and tags that are about to be deployed and +will skip deployment if they are identical. Use `--force` to override this behavior and always deploy the stack. #### `cdk destroy` diff --git a/packages/aws-cdk/lib/api/deploy-stack.ts b/packages/aws-cdk/lib/api/deploy-stack.ts index 0a2e817d734c3..0a51851080483 100644 --- a/packages/aws-cdk/lib/api/deploy-stack.ts +++ b/packages/aws-cdk/lib/api/deploy-stack.ts @@ -74,10 +74,11 @@ export async function deployStack(options: DeployStackOptions): Promise { - const stackId = await getStackId(cfn, stackName); - if (!stackId) { +async function getDeployedStack(cfn: aws.CloudFormation, stackName: string): Promise<{ stackId: string, template: any, tags: Tag[] } | undefined> { + const stack = await getStack(cfn, stackName); + if (!stack) { + return undefined; + } + + if (!stack.StackId) { return undefined; } const template = await readCurrentTemplate(cfn, stackName); - return { stackId, template }; + return { + stackId: stack.StackId, + tags: stack.Tags ?? [], + template + }; } export async function readCurrentTemplate(cfn: aws.CloudFormation, stackName: string) { @@ -261,7 +271,7 @@ export async function readCurrentTemplate(cfn: aws.CloudFormation, stackName: st } } -async function getStackId(cfn: aws.CloudFormation, stackName: string): Promise { +async function getStack(cfn: aws.CloudFormation, stackName: string): Promise { try { const stacks = await cfn.describeStacks({ StackName: stackName }).promise(); if (!stacks.Stacks) { @@ -271,7 +281,7 @@ async function getStackId(cfn: aws.CloudFormation, stackName: string): Promise tag.Key === aTag.Key); + + if (!bTag || bTag.Value !== aTag.Value) { + return false; + } + } + + return true; +} diff --git a/packages/aws-cdk/lib/docker.ts b/packages/aws-cdk/lib/docker.ts index b151a166a5bce..664b4a5c9db36 100644 --- a/packages/aws-cdk/lib/docker.ts +++ b/packages/aws-cdk/lib/docker.ts @@ -172,8 +172,9 @@ export async function prepareContainerAssetNew(assemblyDir: string, buildCommand.push(contextPath); + // Login to ECR before build to allow building images that reference other docker assets try { - await shell(buildCommand); + await dockerLogin(toolkitInfo); } catch (e) { if (e.code === 'ENOENT') { throw new Error('Unable to execute "docker" in order to build a container asset. Please install "docker" and try again.'); @@ -181,8 +182,7 @@ export async function prepareContainerAssetNew(assemblyDir: string, throw e; } - // login to ECR - await dockerLogin(toolkitInfo); + await shell(buildCommand); // There's no way to make this quiet, so we can't use a PleaseHold. Print a header message. print(` ⌛ Pushing Docker image for ${contextPath}; this may take a while.`); diff --git a/packages/aws-cdk/package.json b/packages/aws-cdk/package.json index 3cdd888deb456..9a0462e9588fb 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.25.0", + "version": "0.0.0", "main": "lib/index.js", "types": "lib/index.d.ts", "bin": { @@ -40,38 +40,38 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/core": "1.25.0", - "@types/archiver": "^3.0.0", + "@aws-cdk/core": "0.0.0", + "@types/archiver": "^3.1.0", "@types/fs-extra": "^8.1.0", "@types/glob": "^7.1.1", "@types/jest": "^25.1.2", "@types/jszip": "^3.1.7", "@types/minimatch": "^3.0.3", "@types/mockery": "^1.4.29", - "@types/node": "^10.17.15", + "@types/node": "^10.17.17", "@types/promptly": "^3.0.0", "@types/request": "^2.48.4", "@types/semver": "^7.1.0", - "@types/sinon": "^7.5.0", + "@types/sinon": "^7.5.2", "@types/table": "^4.0.7", - "@types/uuid": "^3.4.7", + "@types/uuid": "^7.0.0", "@types/yaml": "^1.2.0", - "@types/yargs": "^15.0.3", + "@types/yargs": "^15.0.4", "aws-sdk-mock": "^5.0.0", - "cdk-build-tools": "1.25.0", + "cdk-build-tools": "0.0.0", "jest": "^24.9.0", "jszip": "^3.2.2", "mockery": "^2.1.0", - "pkglint": "1.25.0", + "pkglint": "0.0.0", "sinon": "^9.0.0", "ts-jest": "^25.2.0" }, "dependencies": { - "@aws-cdk/cloudformation-diff": "1.25.0", - "@aws-cdk/cx-api": "1.25.0", - "@aws-cdk/region-info": "1.25.0", + "@aws-cdk/cloudformation-diff": "0.0.0", + "@aws-cdk/cx-api": "0.0.0", + "@aws-cdk/region-info": "0.0.0", "archiver": "^3.1.1", - "aws-sdk": "^2.624.0", + "aws-sdk": "^2.630.0", "camelcase": "^5.3.1", "colors": "^1.4.0", "decamelize": "^4.0.0", @@ -85,9 +85,9 @@ "semver": "^7.1.3", "source-map-support": "^0.5.16", "table": "^5.4.6", - "uuid": "^3.4.0", + "uuid": "^7.0.1", "yaml": "^1.7.2", - "yargs": "^15.0.2" + "yargs": "^15.2.0" }, "repository": { "url": "https://github.com/aws/aws-cdk.git", @@ -119,4 +119,4 @@ "**/?(*.)+(spec|test).ts?(x)" ] } -} +} \ No newline at end of file diff --git a/packages/aws-cdk/test/api/deploy-stack.test.ts b/packages/aws-cdk/test/api/deploy-stack.test.ts index 95b12fc384d8e..a79e43a90fd4c 100644 --- a/packages/aws-cdk/test/api/deploy-stack.test.ts +++ b/packages/aws-cdk/test/api/deploy-stack.test.ts @@ -145,6 +145,216 @@ test('deploy is skipped if template did not change', async () => { expect(getTemplateInput!).toStrictEqual({ StackName: 'withouterrors', TemplateStage: 'Original' }); }); +test('deploy is skipped if template and tags did not change', async () => { + const sdk = new MockSDK(); + let describeStacksInput: AWS.CloudFormation.DescribeStacksInput; + let getTemplateInput: AWS.CloudFormation.GetTemplateInput; + let createChangeSetCalled = false; + let executeChangeSetCalled = false; + + sdk.stubCloudFormation({ + getTemplate(input) { + getTemplateInput = input; + return { + TemplateBody: JSON.stringify(FAKE_TEMPLATE) + }; + }, + describeStacks(input) { + describeStacksInput = input; + return { + Stacks: [ + { + StackName: 'mock-stack-name', + StackId: 'mock-stack-id', + CreationTime: new Date(), + StackStatus: 'CREATE_COMPLETE', + Tags: [ + { + Key: 'Key1', + Value: 'Value1' + }, + { + Key: 'Key2', + Value: 'Value2' + } + ] + } + ] + }; + }, + createChangeSet() { + createChangeSetCalled = true; + return { }; + }, + executeChangeSet() { + executeChangeSetCalled = true; + return { }; + } + }); + + await deployStack({ + stack: FAKE_STACK, + tags: [ + { + Key: 'Key1', + Value: 'Value1' + }, + { + Key: 'Key2', + Value: 'Value2' + } + ], + sdk + }); + + expect(createChangeSetCalled).toBeFalsy(); + expect(executeChangeSetCalled).toBeFalsy(); + expect(describeStacksInput!).toStrictEqual({ StackName: 'withouterrors' }); + expect(getTemplateInput!).toStrictEqual({ StackName: 'withouterrors', TemplateStage: 'Original' }); +}); + +test('deploy not skipped if template did not change but tags changed', async () => { + const sdk = new MockSDK(); + let describeStacksInput: AWS.CloudFormation.DescribeStacksInput; + let getTemplateInput: AWS.CloudFormation.GetTemplateInput; + let createChangeSetCalled = false; + let executeChangeSetCalled = false; + let describeChangeSetCalled = false; + + sdk.stubCloudFormation({ + getTemplate(input) { + getTemplateInput = input; + return { + TemplateBody: JSON.stringify(FAKE_TEMPLATE) + }; + }, + describeStacks(input) { + describeStacksInput = input; + return { + Stacks: [ + { + StackName: 'mock-stack-name', + StackId: 'mock-stack-id', + CreationTime: new Date(), + StackStatus: 'CREATE_COMPLETE', + Tags: [ + { + Key: 'Key', + Value: 'Value' + }, + ] + } + ] + }; + }, + createChangeSet() { + createChangeSetCalled = true; + return { }; + }, + executeChangeSet() { + executeChangeSetCalled = true; + return { }; + }, + describeChangeSet() { + describeChangeSetCalled = true; + return { + Status: 'CREATE_COMPLETE', + Changes: [], + }; + } + }); + + await deployStack({ + stack: FAKE_STACK, + sdk, + tags: [ + { + Key: 'Key', + Value: 'NewValue' + } + ] + }); + + expect(createChangeSetCalled).toBeTruthy(); + expect(executeChangeSetCalled).toBeTruthy(); + expect(describeChangeSetCalled).toBeTruthy(); + expect(describeStacksInput!).toStrictEqual({ StackName: "withouterrors" }); + expect(getTemplateInput!).toStrictEqual({ StackName: 'withouterrors', TemplateStage: 'Original' }); +}); + +test('deploy not skipped if template did not change but one tag removed', async () => { + const sdk = new MockSDK(); + let describeStacksInput: AWS.CloudFormation.DescribeStacksInput; + let getTemplateInput: AWS.CloudFormation.GetTemplateInput; + let createChangeSetCalled = false; + let executeChangeSetCalled = false; + let describeChangeSetCalled = false; + + sdk.stubCloudFormation({ + getTemplate(input) { + getTemplateInput = input; + return { + TemplateBody: JSON.stringify(FAKE_TEMPLATE) + }; + }, + describeStacks(input) { + describeStacksInput = input; + return { + Stacks: [ + { + StackName: 'mock-stack-name', + StackId: 'mock-stack-id', + CreationTime: new Date(), + StackStatus: 'CREATE_COMPLETE', + Tags: [ + { + Key: 'Key1', + Value: 'Value1' + }, + { + Key: 'Key2', + Value: 'Value2' + }, + ] + } + ] + }; + }, + createChangeSet() { + createChangeSetCalled = true; + return { }; + }, + executeChangeSet() { + executeChangeSetCalled = true; + return { }; + }, + describeChangeSet() { + describeChangeSetCalled = true; + return { + Status: 'CREATE_COMPLETE', + Changes: [], + }; + } + }); + + await deployStack({ + stack: FAKE_STACK, + sdk, + tags: [ + { + Key: 'Key1', + Value: 'Value1' + } + ] + }); + + expect(createChangeSetCalled).toBeTruthy(); + expect(executeChangeSetCalled).toBeTruthy(); + expect(describeChangeSetCalled).toBeTruthy(); + expect(describeStacksInput!).toStrictEqual({ StackName: "withouterrors" }); + expect(getTemplateInput!).toStrictEqual({ StackName: 'withouterrors', TemplateStage: 'Original' }); +}); + test('deploy not skipped if template did not change and --force is applied', async () => { const sdk = new MockSDK(); let describeStacksInput: AWS.CloudFormation.DescribeStacksInput; @@ -250,13 +460,12 @@ test('deploy not skipped if template changed', async () => { await deployStack({ stack: FAKE_STACK, - sdk, - force: true + sdk }); expect(createChangeSetCalled).toBeTruthy(); expect(executeChangeSetCalled).toBeTruthy(); expect(describeChangeSetCalled).toBeTruthy(); - expect(getTemplateInput!).toBeUndefined(); expect(describeStacksInput!).toStrictEqual({ StackName: "withouterrors" }); -}); \ No newline at end of file + expect(getTemplateInput!).toStrictEqual({ StackName: 'withouterrors', TemplateStage: 'Original' }); +}); diff --git a/packages/aws-cdk/test/docker-new.test.ts b/packages/aws-cdk/test/docker-new.test.ts index ebb49c531d0ad..cf49ee68af8a9 100644 --- a/packages/aws-cdk/test/docker-new.test.ts +++ b/packages/aws-cdk/test/docker-new.test.ts @@ -5,6 +5,18 @@ import { prepareContainerAsset } from '../lib/docker'; import * as os from '../lib/os'; import { MockSDK } from './util/mock-sdk'; +const shellFake = async (args: string[]) => { + if (args[1] === 'login') { + return 'LOGIN'; + } + + if (args[1] === 'build') { + throw new Error('STOPTEST'); + } + + throw new Error('UNEXPECTED'); +}; + test('fails if "repositoryName" and "imageTag" are not specified', async () => { // GIVEN const toolkit = newMockToolkitInfo(); @@ -118,13 +130,62 @@ test('configures image scanning', async () => { }); }); +test('calls docker login with the corrects args and before docker build', async () => { + // GIVEN + const toolkit = newMockToolkitInfo(); + + const prepareEcrRepositoryStub = sinon.stub(toolkit, 'prepareEcrRepository').resolves({ repositoryUri: 'uri' }); + const checkEcrImageStub = sinon.stub(toolkit, 'checkEcrImage').resolves(false); + const shellStub = sinon.stub(os, 'shell').callsFake(shellFake); + const getEcrCredentialsStub = sinon.stub(toolkit, 'getEcrCredentials').resolves({ + username: 'username', + password: 'password', + endpoint: 'endpoint' + }); + + // WHEN + const asset: cxapi.ContainerImageAssetMetadataEntry = { + id: 'assetId', + packaging: 'container-image', + path: '/foo', + sourceHash: '1234567890abcdef', + repositoryName: 'some-name', + imageTag: 'some-tag', + buildArgs: { + a: 'b', + c: 'd' + }, + target: 'a-target', + }; + + try { + await prepareContainerAsset('.', asset, toolkit, false); + } catch (e) { + if (!/STOPTEST/.test(e.toString())) { throw e; } + } + + // THEN + const command = ['docker', 'login', '--username', 'username', '--password', 'password', 'endpoint']; + sinon.assert.calledWith(shellStub.firstCall, command); + + prepareEcrRepositoryStub.restore(); + shellStub.restore(); + checkEcrImageStub.restore(); + getEcrCredentialsStub.restore(); +}); + test('passes the correct target to docker build', async () => { // GIVEN const toolkit = newMockToolkitInfo(); const prepareEcrRepositoryStub = sinon.stub(toolkit, 'prepareEcrRepository').resolves({ repositoryUri: 'uri' }); const checkEcrImageStub = sinon.stub(toolkit, 'checkEcrImage').resolves(false); - const shellStub = sinon.stub(os, 'shell').rejects('STOPTEST'); + const shellStub = sinon.stub(os, 'shell').callsFake(shellFake); + const getEcrCredentialsStub = sinon.stub(toolkit, 'getEcrCredentials').resolves({ + username: 'username', + password: 'password', + endpoint: 'endpoint' + }); // WHEN const asset: cxapi.ContainerImageAssetMetadataEntry = { @@ -154,6 +215,7 @@ test('passes the correct target to docker build', async () => { prepareEcrRepositoryStub.restore(); shellStub.restore(); checkEcrImageStub.restore(); + getEcrCredentialsStub.restore(); }); test('passes the correct args to docker build', async () => { @@ -162,7 +224,12 @@ test('passes the correct args to docker build', async () => { const prepareEcrRepositoryStub = sinon.stub(toolkit, 'prepareEcrRepository').resolves({ repositoryUri: 'uri' }); const checkEcrImageStub = sinon.stub(toolkit, 'checkEcrImage').resolves(false); - const shellStub = sinon.stub(os, 'shell').rejects('STOPTEST'); + const shellStub = sinon.stub(os, 'shell').callsFake(shellFake); + const getEcrCredentialsStub = sinon.stub(toolkit, 'getEcrCredentials').resolves({ + username: 'username', + password: 'password', + endpoint: 'endpoint' + }); // WHEN const asset: cxapi.ContainerImageAssetMetadataEntry = { @@ -191,13 +258,19 @@ test('passes the correct args to docker build', async () => { prepareEcrRepositoryStub.restore(); checkEcrImageStub.restore(); shellStub.restore(); + getEcrCredentialsStub.restore(); }); test('passes the correct docker file name if specified', async () => { const toolkit = newMockToolkitInfo(); const prepareEcrRepositoryStub = sinon.stub(toolkit, 'prepareEcrRepository').resolves({ repositoryUri: 'uri' }); const checkEcrImageStub = sinon.stub(toolkit, 'checkEcrImage').resolves(false); - const shellStub = sinon.stub(os, 'shell').rejects('STOPTEST'); + const shellStub = sinon.stub(os, 'shell').callsFake(shellFake); + const getEcrCredentialsStub = sinon.stub(toolkit, 'getEcrCredentials').resolves({ + username: 'username', + password: 'password', + endpoint: 'endpoint' + }); // WHEN const asset: cxapi.ContainerImageAssetMetadataEntry = { @@ -227,6 +300,7 @@ test('passes the correct docker file name if specified', async () => { prepareEcrRepositoryStub.restore(); checkEcrImageStub.restore(); shellStub.restore(); + getEcrCredentialsStub.restore(); }); test('relative path', async () => { @@ -234,7 +308,12 @@ test('relative path', async () => { const toolkit = newMockToolkitInfo(); const prepareEcrRepositoryStub = sinon.stub(toolkit, 'prepareEcrRepository').resolves({ repositoryUri: 'uri' }); const checkEcrImageStub = sinon.stub(toolkit, 'checkEcrImage').resolves(false); - const shellStub = sinon.stub(os, 'shell').rejects('STOPTEST'); + const shellStub = sinon.stub(os, 'shell').callsFake(shellFake); + const getEcrCredentialsStub = sinon.stub(toolkit, 'getEcrCredentials').resolves({ + username: 'username', + password: 'password', + endpoint: 'endpoint' + }); // WHEN const asset: cxapi.ContainerImageAssetMetadataEntry = { @@ -263,6 +342,7 @@ test('relative path', async () => { prepareEcrRepositoryStub.restore(); checkEcrImageStub.restore(); shellStub.restore(); + getEcrCredentialsStub.restore(); }); test('skips build & push if image already exists in the ECR repo', async () => { diff --git a/packages/aws-cdk/test/integ/cli/app/app.js b/packages/aws-cdk/test/integ/cli/app/app.js index cf11fb0043026..8fee599e99f10 100644 --- a/packages/aws-cdk/test/integ/cli/app/app.js +++ b/packages/aws-cdk/test/integ/cli/app/app.js @@ -6,6 +6,7 @@ const iam = require('@aws-cdk/aws-iam'); const sns = require('@aws-cdk/aws-sns'); const lambda = require('@aws-cdk/aws-lambda'); const docker = require('@aws-cdk/aws-ecr-assets'); +const core = require('@aws-cdk/core') const { StackWithNestedStack } = require('./nested-stack'); const stackPrefix = process.env.STACK_NAME_PREFIX || 'cdk-toolkit-integration'; @@ -117,6 +118,20 @@ class DockerStackWithCustomFile extends cdk.Stack { } +class FailedStack extends cdk.Stack { + + constructor(parent, id, props) { + super(parent, id, props); + + // fails on 'Property PolicyDocument cannot be empty'. + new core.CfnResource(this, 'EmptyPolicy', { + type: 'AWS::IAM::Policy' + }) + + } + +} + const VPC_TAG_NAME = 'custom-tag'; const VPC_TAG_VALUE = `${stackPrefix}-bazinga!`; @@ -169,6 +184,7 @@ new MissingSSMParameterStack(app, `${stackPrefix}-missing-ssm-parameter`, { env: new LambdaStack(app, `${stackPrefix}-lambda`); new DockerStack(app, `${stackPrefix}-docker`); new DockerStackWithCustomFile(app, `${stackPrefix}-docker-with-custom-file`); +new FailedStack(app, `${stackPrefix}-failed`) if (process.env.ENABLE_VPC_TESTING) { // Gating so we don't do context fetching unless that's what we are here for const env = { account: process.env.CDK_DEFAULT_ACCOUNT, region: process.env.CDK_DEFAULT_REGION }; diff --git a/packages/aws-cdk/test/integ/cli/common.bash b/packages/aws-cdk/test/integ/cli/common.bash index 4d7941962cff3..690ef418f6ca5 100644 --- a/packages/aws-cdk/test/integ/cli/common.bash +++ b/packages/aws-cdk/test/integ/cli/common.bash @@ -66,20 +66,20 @@ function prepare_fixture() { cp -R app/* $integ_test_dir cd $integ_test_dir - # if this directory is missing, but exists in any of the + # if this directory is missing, but exists in any of the # parent directories, npm will install these packages there. lets make sure # we install locally. mkdir -p node_modules npm install \ - @aws-cdk/core \ - @aws-cdk/aws-sns \ - @aws-cdk/aws-iam \ - @aws-cdk/aws-lambda \ - @aws-cdk/aws-ssm \ - @aws-cdk/aws-ecr-assets \ - @aws-cdk/aws-cloudformation \ - @aws-cdk/aws-ec2 + @aws-cdk/core@^1 \ + @aws-cdk/aws-sns@^1 \ + @aws-cdk/aws-iam@^1 \ + @aws-cdk/aws-lambda@^1 \ + @aws-cdk/aws-ssm@^1 \ + @aws-cdk/aws-ecr-assets@^1 \ + @aws-cdk/aws-cloudformation@^1 \ + @aws-cdk/aws-ec2@^1 echo "| setup complete at: $PWD" echo "| 'cdk' is: $(type -p cdk)" diff --git a/packages/aws-cdk/test/integ/cli/test-cdk-failed-deploy-doesnt-hang.sh b/packages/aws-cdk/test/integ/cli/test-cdk-failed-deploy-doesnt-hang.sh new file mode 100755 index 0000000000000..eb93a371b5a51 --- /dev/null +++ b/packages/aws-cdk/test/integ/cli/test-cdk-failed-deploy-doesnt-hang.sh @@ -0,0 +1,22 @@ +#!/bin/bash +set -euo pipefail +scriptdir=$(cd $(dirname $0) && pwd) +source ${scriptdir}/common.bash +# ---------------------------------------------------------- + +setup + +set +e +# this will hang if we introduce https://github.com/aws/aws-cdk/issues/6403 again. +cdk deploy -v ${STACK_NAME_PREFIX}-failed +deploy_status=$? +set -e + +# destroy +cdk destroy -f ${STACK_NAME_PREFIX}-failed + +if [ "${deploy_status}" -eq 0 ]; then + fail "stack deployment should have failed" +fi + +echo "✅ success" diff --git a/packages/aws-cdk/test/integ/cli/test-cdk-fast-deploy.sh b/packages/aws-cdk/test/integ/cli/test-cdk-fast-deploy.sh index 940c4ab8cc198..6649588d56949 100755 --- a/packages/aws-cdk/test/integ/cli/test-cdk-fast-deploy.sh +++ b/packages/aws-cdk/test/integ/cli/test-cdk-fast-deploy.sh @@ -45,6 +45,16 @@ if [ "${changeset3}" == "${changeset1}" ]; then exit 1 fi +echo "============================================================" +echo " deploying the same stack again with different tags" +echo "============================================================" +cdk deploy -v ${stack_name} --tags key=value +changeset4=$(get_last_changeset) +if [ "${changeset4}" == "${changeset1}" ]; then + echo "TEST FAILED: expected tags to create a new changeset" + exit 1 +fi + # destroy cdk destroy -f ${stack_name} diff --git a/packages/aws-cdk/test/integ/cli/test-cdk-ls.sh b/packages/aws-cdk/test/integ/cli/test-cdk-ls.sh index c3a79bbc88a17..f2057a1eb6895 100755 --- a/packages/aws-cdk/test/integ/cli/test-cdk-ls.sh +++ b/packages/aws-cdk/test/integ/cli/test-cdk-ls.sh @@ -10,6 +10,7 @@ assert "cdk ls" < $packageloc" >&2 + ln -s $packageloc $dir/ } || { npmargs="$npmargs $1" } shift done + if [[ "$npmargs" == "install" ]]; then + # No rewrites + exit 0 + fi + exec $ORIGINAL_NPM $npmargs fi -exec $ORIGINAL_NPM "$@" +exec $ORIGINAL_NPM "$@" \ No newline at end of file diff --git a/packages/cdk-assets/package.json b/packages/cdk-assets/package.json index d558479287286..e17c77f6e099a 100644 --- a/packages/cdk-assets/package.json +++ b/packages/cdk-assets/package.json @@ -1,7 +1,7 @@ { "name": "cdk-assets", "description": "CDK Asset Publishing Tool", - "version": "1.25.0", + "version": "0.0.0", "main": "lib/index.js", "types": "lib/index.d.ts", "bin": { @@ -28,23 +28,23 @@ }, "license": "Apache-2.0", "devDependencies": { - "@types/archiver": "^3.0.0", + "@types/archiver": "^3.1.0", "@types/glob": "^7.1.1", "@types/jest": "^24.0.25", - "@types/node": "^10.17.13", "@types/mock-fs": "^4.10.0", - "@types/yargs": "^15.0.0", - "cdk-build-tools": "1.25.0", + "@types/node": "^10.17.17", + "@types/yargs": "^15.0.4", + "cdk-build-tools": "0.0.0", "jest": "^24.9.0", - "mock-fs": "^4.10.4", - "pkglint": "1.25.0" + "mock-fs": "^4.11.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/cdk-assets-schema": "1.25.0", + "@aws-cdk/cdk-assets-schema": "0.0.0", "archiver": "^3.1.1", - "aws-sdk": "^2.624.0", + "aws-sdk": "^2.630.0", "glob": "^7.1.6", - "yargs": "^15.0.2" + "yargs": "^15.2.0" }, "repository": { "url": "https://github.com/aws/aws-cdk.git", @@ -77,4 +77,4 @@ "text-summary" ] } -} +} \ No newline at end of file diff --git a/packages/cdk-dasm/package.json b/packages/cdk-dasm/package.json index 2f3553b65cd56..397e45109048e 100644 --- a/packages/cdk-dasm/package.json +++ b/packages/cdk-dasm/package.json @@ -1,6 +1,6 @@ { "name": "cdk-dasm", - "version": "1.25.0", + "version": "0.0.0", "description": "AWS CDK disassembler: convert CloudFormation to code", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -42,4 +42,4 @@ "engines": { "node": ">= 8.10.0" } -} +} \ No newline at end of file diff --git a/packages/cdk/package.json b/packages/cdk/package.json index f57db38d68320..bdd0279a59380 100644 --- a/packages/cdk/package.json +++ b/packages/cdk/package.json @@ -1,12 +1,12 @@ { "name": "cdk", - "version": "1.25.0", + "version": "0.0.0", "description": "AWS CDK Toolkit", "bin": { "cdk": "bin/cdk" }, "dependencies": { - "aws-cdk": "1.25.0" + "aws-cdk": "0.0.0" }, "repository": { "type": "git", @@ -36,4 +36,4 @@ "engines": { "node": ">= 8.10.0" } -} +} \ No newline at end of file diff --git a/packages/decdk/package.json b/packages/decdk/package.json index 7bf81cc754198..67557c0f9ab45 100644 --- a/packages/decdk/package.json +++ b/packages/decdk/package.json @@ -1,6 +1,6 @@ { "name": "decdk", - "version": "1.25.0", + "version": "0.0.0", "description": "Declarative CDK: a CloudFormation-like syntax for defining CDK stacks", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -27,153 +27,153 @@ }, "license": "Apache-2.0", "dependencies": { - "@aws-cdk/alexa-ask": "1.25.0", - "@aws-cdk/app-delivery": "1.25.0", - "@aws-cdk/assets": "1.25.0", - "@aws-cdk/aws-accessanalyzer": "1.25.0", - "@aws-cdk/aws-acmpca": "1.25.0", - "@aws-cdk/aws-amazonmq": "1.25.0", - "@aws-cdk/aws-amplify": "1.25.0", - "@aws-cdk/aws-apigateway": "1.25.0", - "@aws-cdk/aws-apigatewayv2": "1.25.0", - "@aws-cdk/aws-appconfig": "1.25.0", - "@aws-cdk/aws-applicationautoscaling": "1.25.0", - "@aws-cdk/aws-appmesh": "1.25.0", - "@aws-cdk/aws-appstream": "1.25.0", - "@aws-cdk/aws-appsync": "1.25.0", - "@aws-cdk/aws-athena": "1.25.0", - "@aws-cdk/aws-autoscaling": "1.25.0", - "@aws-cdk/aws-autoscaling-common": "1.25.0", - "@aws-cdk/aws-autoscaling-hooktargets": "1.25.0", - "@aws-cdk/aws-autoscalingplans": "1.25.0", - "@aws-cdk/aws-backup": "1.25.0", - "@aws-cdk/aws-batch": "1.25.0", - "@aws-cdk/aws-budgets": "1.25.0", - "@aws-cdk/aws-certificatemanager": "1.25.0", - "@aws-cdk/aws-cloud9": "1.25.0", - "@aws-cdk/aws-cloudformation": "1.25.0", - "@aws-cdk/aws-cloudfront": "1.25.0", - "@aws-cdk/aws-cloudtrail": "1.25.0", - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-cloudwatch-actions": "1.25.0", - "@aws-cdk/aws-codebuild": "1.25.0", - "@aws-cdk/aws-codecommit": "1.25.0", - "@aws-cdk/aws-codedeploy": "1.25.0", - "@aws-cdk/aws-codepipeline": "1.25.0", - "@aws-cdk/aws-codepipeline-actions": "1.25.0", - "@aws-cdk/aws-codestar": "1.25.0", - "@aws-cdk/aws-codestarnotifications": "1.25.0", - "@aws-cdk/aws-cognito": "1.25.0", - "@aws-cdk/aws-config": "1.25.0", - "@aws-cdk/aws-datapipeline": "1.25.0", - "@aws-cdk/aws-dax": "1.25.0", - "@aws-cdk/aws-directoryservice": "1.25.0", - "@aws-cdk/aws-dlm": "1.25.0", - "@aws-cdk/aws-dms": "1.25.0", - "@aws-cdk/aws-docdb": "1.25.0", - "@aws-cdk/aws-dynamodb": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-ecr": "1.25.0", - "@aws-cdk/aws-ecr-assets": "1.25.0", - "@aws-cdk/aws-ecs": "1.25.0", - "@aws-cdk/aws-ecs-patterns": "1.25.0", - "@aws-cdk/aws-efs": "1.25.0", - "@aws-cdk/aws-eks": "1.25.0", - "@aws-cdk/aws-eks-legacy": "1.25.0", - "@aws-cdk/aws-elasticache": "1.25.0", - "@aws-cdk/aws-elasticbeanstalk": "1.25.0", - "@aws-cdk/aws-elasticloadbalancing": "1.25.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.25.0", - "@aws-cdk/aws-elasticloadbalancingv2-targets": "1.25.0", - "@aws-cdk/aws-elasticsearch": "1.25.0", - "@aws-cdk/aws-emr": "1.25.0", - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-events-targets": "1.25.0", - "@aws-cdk/aws-eventschemas": "1.25.0", - "@aws-cdk/aws-fms": "1.25.0", - "@aws-cdk/aws-fsx": "1.25.0", - "@aws-cdk/aws-gamelift": "1.25.0", - "@aws-cdk/aws-glue": "1.25.0", - "@aws-cdk/aws-greengrass": "1.25.0", - "@aws-cdk/aws-guardduty": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-inspector": "1.25.0", - "@aws-cdk/aws-iot": "1.25.0", - "@aws-cdk/aws-iot1click": "1.25.0", - "@aws-cdk/aws-iotanalytics": "1.25.0", - "@aws-cdk/aws-iotevents": "1.25.0", - "@aws-cdk/aws-iotthingsgraph": "1.25.0", - "@aws-cdk/aws-kinesis": "1.25.0", - "@aws-cdk/aws-kinesisanalytics": "1.25.0", - "@aws-cdk/aws-kinesisfirehose": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/aws-lakeformation": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-lambda-destinations": "1.25.0", - "@aws-cdk/aws-lambda-event-sources": "1.25.0", - "@aws-cdk/aws-lambda-nodejs": "1.25.0", - "@aws-cdk/aws-logs": "1.25.0", - "@aws-cdk/aws-logs-destinations": "1.25.0", - "@aws-cdk/aws-managedblockchain": "1.25.0", - "@aws-cdk/aws-mediaconvert": "1.25.0", - "@aws-cdk/aws-medialive": "1.25.0", - "@aws-cdk/aws-mediastore": "1.25.0", - "@aws-cdk/aws-msk": "1.25.0", - "@aws-cdk/aws-neptune": "1.25.0", - "@aws-cdk/aws-opsworks": "1.25.0", - "@aws-cdk/aws-opsworkscm": "1.25.0", - "@aws-cdk/aws-pinpoint": "1.25.0", - "@aws-cdk/aws-pinpointemail": "1.25.0", - "@aws-cdk/aws-qldb": "1.25.0", - "@aws-cdk/aws-ram": "1.25.0", - "@aws-cdk/aws-rds": "1.25.0", - "@aws-cdk/aws-redshift": "1.25.0", - "@aws-cdk/aws-robomaker": "1.25.0", - "@aws-cdk/aws-route53": "1.25.0", - "@aws-cdk/aws-route53-patterns": "1.25.0", - "@aws-cdk/aws-route53-targets": "1.25.0", - "@aws-cdk/aws-route53resolver": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/aws-s3-assets": "1.25.0", - "@aws-cdk/aws-s3-deployment": "1.25.0", - "@aws-cdk/aws-s3-notifications": "1.25.0", - "@aws-cdk/aws-sagemaker": "1.25.0", - "@aws-cdk/aws-sam": "1.25.0", - "@aws-cdk/aws-sdb": "1.25.0", - "@aws-cdk/aws-secretsmanager": "1.25.0", - "@aws-cdk/aws-securityhub": "1.25.0", - "@aws-cdk/aws-servicecatalog": "1.25.0", - "@aws-cdk/aws-servicediscovery": "1.25.0", - "@aws-cdk/aws-ses": "1.25.0", - "@aws-cdk/aws-ses-actions": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/aws-sns-subscriptions": "1.25.0", - "@aws-cdk/aws-sqs": "1.25.0", - "@aws-cdk/aws-ssm": "1.25.0", - "@aws-cdk/aws-stepfunctions": "1.25.0", - "@aws-cdk/aws-stepfunctions-tasks": "1.25.0", - "@aws-cdk/aws-transfer": "1.25.0", - "@aws-cdk/aws-waf": "1.25.0", - "@aws-cdk/aws-wafregional": "1.25.0", - "@aws-cdk/aws-wafv2": "1.25.0", - "@aws-cdk/aws-workspaces": "1.25.0", - "@aws-cdk/cfnspec": "1.25.0", - "@aws-cdk/core": "1.25.0", - "@aws-cdk/custom-resources": "1.25.0", - "@aws-cdk/cx-api": "1.25.0", - "@aws-cdk/region-info": "1.25.0", + "@aws-cdk/alexa-ask": "0.0.0", + "@aws-cdk/app-delivery": "0.0.0", + "@aws-cdk/assets": "0.0.0", + "@aws-cdk/aws-accessanalyzer": "0.0.0", + "@aws-cdk/aws-acmpca": "0.0.0", + "@aws-cdk/aws-amazonmq": "0.0.0", + "@aws-cdk/aws-amplify": "0.0.0", + "@aws-cdk/aws-apigateway": "0.0.0", + "@aws-cdk/aws-apigatewayv2": "0.0.0", + "@aws-cdk/aws-appconfig": "0.0.0", + "@aws-cdk/aws-applicationautoscaling": "0.0.0", + "@aws-cdk/aws-appmesh": "0.0.0", + "@aws-cdk/aws-appstream": "0.0.0", + "@aws-cdk/aws-appsync": "0.0.0", + "@aws-cdk/aws-athena": "0.0.0", + "@aws-cdk/aws-autoscaling": "0.0.0", + "@aws-cdk/aws-autoscaling-common": "0.0.0", + "@aws-cdk/aws-autoscaling-hooktargets": "0.0.0", + "@aws-cdk/aws-autoscalingplans": "0.0.0", + "@aws-cdk/aws-backup": "0.0.0", + "@aws-cdk/aws-batch": "0.0.0", + "@aws-cdk/aws-budgets": "0.0.0", + "@aws-cdk/aws-certificatemanager": "0.0.0", + "@aws-cdk/aws-cloud9": "0.0.0", + "@aws-cdk/aws-cloudformation": "0.0.0", + "@aws-cdk/aws-cloudfront": "0.0.0", + "@aws-cdk/aws-cloudtrail": "0.0.0", + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-cloudwatch-actions": "0.0.0", + "@aws-cdk/aws-codebuild": "0.0.0", + "@aws-cdk/aws-codecommit": "0.0.0", + "@aws-cdk/aws-codedeploy": "0.0.0", + "@aws-cdk/aws-codepipeline": "0.0.0", + "@aws-cdk/aws-codepipeline-actions": "0.0.0", + "@aws-cdk/aws-codestar": "0.0.0", + "@aws-cdk/aws-codestarnotifications": "0.0.0", + "@aws-cdk/aws-cognito": "0.0.0", + "@aws-cdk/aws-config": "0.0.0", + "@aws-cdk/aws-datapipeline": "0.0.0", + "@aws-cdk/aws-dax": "0.0.0", + "@aws-cdk/aws-directoryservice": "0.0.0", + "@aws-cdk/aws-dlm": "0.0.0", + "@aws-cdk/aws-dms": "0.0.0", + "@aws-cdk/aws-docdb": "0.0.0", + "@aws-cdk/aws-dynamodb": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-ecr": "0.0.0", + "@aws-cdk/aws-ecr-assets": "0.0.0", + "@aws-cdk/aws-ecs": "0.0.0", + "@aws-cdk/aws-ecs-patterns": "0.0.0", + "@aws-cdk/aws-efs": "0.0.0", + "@aws-cdk/aws-eks": "0.0.0", + "@aws-cdk/aws-eks-legacy": "0.0.0", + "@aws-cdk/aws-elasticache": "0.0.0", + "@aws-cdk/aws-elasticbeanstalk": "0.0.0", + "@aws-cdk/aws-elasticloadbalancing": "0.0.0", + "@aws-cdk/aws-elasticloadbalancingv2": "0.0.0", + "@aws-cdk/aws-elasticloadbalancingv2-targets": "0.0.0", + "@aws-cdk/aws-elasticsearch": "0.0.0", + "@aws-cdk/aws-emr": "0.0.0", + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-events-targets": "0.0.0", + "@aws-cdk/aws-eventschemas": "0.0.0", + "@aws-cdk/aws-fms": "0.0.0", + "@aws-cdk/aws-fsx": "0.0.0", + "@aws-cdk/aws-gamelift": "0.0.0", + "@aws-cdk/aws-glue": "0.0.0", + "@aws-cdk/aws-greengrass": "0.0.0", + "@aws-cdk/aws-guardduty": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-inspector": "0.0.0", + "@aws-cdk/aws-iot": "0.0.0", + "@aws-cdk/aws-iot1click": "0.0.0", + "@aws-cdk/aws-iotanalytics": "0.0.0", + "@aws-cdk/aws-iotevents": "0.0.0", + "@aws-cdk/aws-iotthingsgraph": "0.0.0", + "@aws-cdk/aws-kinesis": "0.0.0", + "@aws-cdk/aws-kinesisanalytics": "0.0.0", + "@aws-cdk/aws-kinesisfirehose": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/aws-lakeformation": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-lambda-destinations": "0.0.0", + "@aws-cdk/aws-lambda-event-sources": "0.0.0", + "@aws-cdk/aws-lambda-nodejs": "0.0.0", + "@aws-cdk/aws-logs": "0.0.0", + "@aws-cdk/aws-logs-destinations": "0.0.0", + "@aws-cdk/aws-managedblockchain": "0.0.0", + "@aws-cdk/aws-mediaconvert": "0.0.0", + "@aws-cdk/aws-medialive": "0.0.0", + "@aws-cdk/aws-mediastore": "0.0.0", + "@aws-cdk/aws-msk": "0.0.0", + "@aws-cdk/aws-neptune": "0.0.0", + "@aws-cdk/aws-opsworks": "0.0.0", + "@aws-cdk/aws-opsworkscm": "0.0.0", + "@aws-cdk/aws-pinpoint": "0.0.0", + "@aws-cdk/aws-pinpointemail": "0.0.0", + "@aws-cdk/aws-qldb": "0.0.0", + "@aws-cdk/aws-ram": "0.0.0", + "@aws-cdk/aws-rds": "0.0.0", + "@aws-cdk/aws-redshift": "0.0.0", + "@aws-cdk/aws-robomaker": "0.0.0", + "@aws-cdk/aws-route53": "0.0.0", + "@aws-cdk/aws-route53-patterns": "0.0.0", + "@aws-cdk/aws-route53-targets": "0.0.0", + "@aws-cdk/aws-route53resolver": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/aws-s3-assets": "0.0.0", + "@aws-cdk/aws-s3-deployment": "0.0.0", + "@aws-cdk/aws-s3-notifications": "0.0.0", + "@aws-cdk/aws-sagemaker": "0.0.0", + "@aws-cdk/aws-sam": "0.0.0", + "@aws-cdk/aws-sdb": "0.0.0", + "@aws-cdk/aws-secretsmanager": "0.0.0", + "@aws-cdk/aws-securityhub": "0.0.0", + "@aws-cdk/aws-servicecatalog": "0.0.0", + "@aws-cdk/aws-servicediscovery": "0.0.0", + "@aws-cdk/aws-ses": "0.0.0", + "@aws-cdk/aws-ses-actions": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/aws-sns-subscriptions": "0.0.0", + "@aws-cdk/aws-sqs": "0.0.0", + "@aws-cdk/aws-ssm": "0.0.0", + "@aws-cdk/aws-stepfunctions": "0.0.0", + "@aws-cdk/aws-stepfunctions-tasks": "0.0.0", + "@aws-cdk/aws-transfer": "0.0.0", + "@aws-cdk/aws-waf": "0.0.0", + "@aws-cdk/aws-wafregional": "0.0.0", + "@aws-cdk/aws-wafv2": "0.0.0", + "@aws-cdk/aws-workspaces": "0.0.0", + "@aws-cdk/cdk-assets-schema": "0.0.0", + "@aws-cdk/cfnspec": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/custom-resources": "0.0.0", + "@aws-cdk/cx-api": "0.0.0", + "@aws-cdk/region-info": "0.0.0", "fs-extra": "^8.1.0", "jsii-reflect": "^1.0.0", "jsonschema": "^1.2.5", "yaml": "1.7.2", - "yargs": "^15.1.0", - "@aws-cdk/cdk-assets-schema": "1.25.0" + "yargs": "^15.2.0" }, "devDependencies": { "@types/fs-extra": "^8.1.0", "@types/jest": "^25.1.2", "@types/yaml": "1.2.0", - "@types/yargs": "^15.0.3", + "@types/yargs": "^15.0.4", "jest": "^24.9.0", "jsii": "^0.22.0" }, @@ -185,4 +185,4 @@ "engines": { "node": ">= 8.10.0" } -} +} \ No newline at end of file diff --git a/packages/decdk/test/fixture/package.json b/packages/decdk/test/fixture/package.json index 5a930ffc2ae29..37ba6d2665de7 100644 --- a/packages/decdk/test/fixture/package.json +++ b/packages/decdk/test/fixture/package.json @@ -1,6 +1,6 @@ { "name": "fixture", - "version": "1.0.0", + "version": "0.0.0", "description": "test fixtures for deCDK", "main": "index.js", "types": "index.d.ts", @@ -16,4 +16,4 @@ "url": "https://aws.amazon.com" }, "license": "Apache-2.0" -} +} \ No newline at end of file diff --git a/packages/monocdk-experiment/.gitignore b/packages/monocdk-experiment/.gitignore index b8130da3577ce..f35964ce50b46 100644 --- a/packages/monocdk-experiment/.gitignore +++ b/packages/monocdk-experiment/.gitignore @@ -2,3 +2,4 @@ *.d.ts !deps.js !gen.js +src/ \ No newline at end of file diff --git a/packages/monocdk-experiment/.npmignore b/packages/monocdk-experiment/.npmignore index 4f66559b191c7..40bc5fe6ba3f5 100644 --- a/packages/monocdk-experiment/.npmignore +++ b/packages/monocdk-experiment/.npmignore @@ -17,4 +17,3 @@ dist .jsii *.tsbuildinfo - diff --git a/packages/monocdk-experiment/build.sh b/packages/monocdk-experiment/build.sh index 79e7cd4c60e56..527d319cb4260 100755 --- a/packages/monocdk-experiment/build.sh +++ b/packages/monocdk-experiment/build.sh @@ -24,8 +24,13 @@ cd $(mktemp -d) npm init -y npm install ${tarball} node -e "require('monocdk-experiment')" +unpacked=$(node -p 'path.dirname(require.resolve("monocdk-experiment/package.json"))') # saving tarball cd ${scriptdir} mkdir -p dist/js cp ${tarball} dist/js + +# copying src/ so this module will also work as a local dependency (e.g. for modules under @monocdk-experiment/*). +rm -fr src +rsync -av ${unpacked}/src/ src/ diff --git a/packages/monocdk-experiment/gen.js b/packages/monocdk-experiment/gen.js index c6fc45fe93bbd..96a57d1984ca3 100644 --- a/packages/monocdk-experiment/gen.js +++ b/packages/monocdk-experiment/gen.js @@ -32,13 +32,15 @@ const exclude_files = [ ]; async function main() { - const srcdir = path.join(await fs.mkdtemp(path.join(os.tmpdir(), 'monocdk-')), 'package'); + const outdir = path.join(await fs.mkdtemp(path.join(os.tmpdir(), 'monocdk-')), 'package'); - console.error(`generating monocdk at ${srcdir}`); + const srcdir = path.join(outdir, 'src'); + + console.error(`generating monocdk at ${outdir}`); const reexports = []; - await fs.remove(srcdir); - await fs.mkdir(srcdir); + await fs.remove(outdir); + await fs.mkdir(outdir); const monocdkroot = __dirname; const root = path.resolve(__dirname, '..', '@aws-cdk'); @@ -86,7 +88,7 @@ async function main() { const basename = path.basename(moduledir); const files = await fs.readdir(moduledir); - const targetroot = path.join(srcdir, basename); + const targetdir = path.join(srcdir, basename); for (const file of files) { const source = path.join(moduledir, file); @@ -95,11 +97,11 @@ async function main() { continue; } - const target = path.join(targetroot, file); + const target = path.join(targetdir, file); await fs.copy(source, target); } - await fs.writeFile(path.join(targetroot, 'index.ts'), `export * from './lib'\n`); + await fs.writeFile(path.join(targetdir, 'index.ts'), `export * from './lib'\n`); const namespace = basename.replace(/-/g, '_'); reexports.push(`import * as ${namespace} from './${basename}/lib'; export { ${namespace} };`) @@ -107,7 +109,6 @@ async function main() { // add @types/ devDependencies from module const shouldIncludeDevDep = d => include_dev_deps.find(pred => pred(d)); - for (const [ devDep, devDepVersion ] of Object.entries(meta.devDependencies || {})) { if (!shouldIncludeDevDep(devDep)) { @@ -160,13 +161,13 @@ async function main() { // copy tsconfig.json and .npmignore const files = [ 'tsconfig.json', '.npmignore', 'README.md', 'LICENSE', 'NOTICE' ]; for (const file of files) { - await fs.copy(path.join(monocdkroot, file), path.join(srcdir, file)); + await fs.copy(path.join(monocdkroot, file), path.join(outdir, file)); } console.error('writing package.json'); - await fs.writeJson(path.join(srcdir, 'package.json'), manifest, { spaces: 2 }); + await fs.writeJson(path.join(outdir, 'package.json'), manifest, { spaces: 2 }); - console.log(srcdir); + console.log(outdir); } async function findSources(srcdir) { diff --git a/packages/monocdk-experiment/package.json b/packages/monocdk-experiment/package.json index 5619616ab3cc9..905fc3009d753 100644 --- a/packages/monocdk-experiment/package.json +++ b/packages/monocdk-experiment/package.json @@ -1,6 +1,6 @@ { "name": "monocdk-experiment", - "version": "1.25.0", + "version": "0.0.0", "description": "An experiment to bundle the entire CDK into a single module", "main": "src/index.js", "types": "src/index.d.ts", @@ -23,145 +23,145 @@ }, "license": "Apache-2.0", "devDependencies": { - "@aws-cdk/alexa-ask": "1.25.0", - "@aws-cdk/app-delivery": "1.25.0", - "@aws-cdk/assets": "1.25.0", - "@aws-cdk/aws-accessanalyzer": "1.25.0", - "@aws-cdk/aws-acmpca": "1.25.0", - "@aws-cdk/aws-amazonmq": "1.25.0", - "@aws-cdk/aws-amplify": "1.25.0", - "@aws-cdk/aws-apigateway": "1.25.0", - "@aws-cdk/aws-apigatewayv2": "1.25.0", - "@aws-cdk/aws-appconfig": "1.25.0", - "@aws-cdk/aws-applicationautoscaling": "1.25.0", - "@aws-cdk/aws-appmesh": "1.25.0", - "@aws-cdk/aws-appstream": "1.25.0", - "@aws-cdk/aws-appsync": "1.25.0", - "@aws-cdk/aws-athena": "1.25.0", - "@aws-cdk/aws-autoscaling": "1.25.0", - "@aws-cdk/aws-autoscaling-common": "1.25.0", - "@aws-cdk/aws-autoscaling-hooktargets": "1.25.0", - "@aws-cdk/aws-autoscalingplans": "1.25.0", - "@aws-cdk/aws-backup": "1.25.0", - "@aws-cdk/aws-batch": "1.25.0", - "@aws-cdk/aws-budgets": "1.25.0", - "@aws-cdk/aws-certificatemanager": "1.25.0", - "@aws-cdk/aws-cloud9": "1.25.0", - "@aws-cdk/aws-cloudformation": "1.25.0", - "@aws-cdk/aws-cloudfront": "1.25.0", - "@aws-cdk/aws-cloudtrail": "1.25.0", - "@aws-cdk/aws-cloudwatch": "1.25.0", - "@aws-cdk/aws-cloudwatch-actions": "1.25.0", - "@aws-cdk/aws-codebuild": "1.25.0", - "@aws-cdk/aws-codecommit": "1.25.0", - "@aws-cdk/aws-codedeploy": "1.25.0", - "@aws-cdk/aws-codepipeline": "1.25.0", - "@aws-cdk/aws-codepipeline-actions": "1.25.0", - "@aws-cdk/aws-codestar": "1.25.0", - "@aws-cdk/aws-codestarnotifications": "1.25.0", - "@aws-cdk/aws-cognito": "1.25.0", - "@aws-cdk/aws-config": "1.25.0", - "@aws-cdk/aws-datapipeline": "1.25.0", - "@aws-cdk/aws-dax": "1.25.0", - "@aws-cdk/aws-directoryservice": "1.25.0", - "@aws-cdk/aws-dlm": "1.25.0", - "@aws-cdk/aws-dms": "1.25.0", - "@aws-cdk/aws-docdb": "1.25.0", - "@aws-cdk/aws-dynamodb": "1.25.0", - "@aws-cdk/aws-ec2": "1.25.0", - "@aws-cdk/aws-ecr": "1.25.0", - "@aws-cdk/aws-ecr-assets": "1.25.0", - "@aws-cdk/aws-ecs": "1.25.0", - "@aws-cdk/aws-ecs-patterns": "1.25.0", - "@aws-cdk/aws-efs": "1.25.0", - "@aws-cdk/aws-eks": "1.25.0", - "@aws-cdk/aws-eks-legacy": "1.25.0", - "@aws-cdk/aws-elasticache": "1.25.0", - "@aws-cdk/aws-elasticbeanstalk": "1.25.0", - "@aws-cdk/aws-elasticloadbalancing": "1.25.0", - "@aws-cdk/aws-elasticloadbalancingv2": "1.25.0", - "@aws-cdk/aws-elasticloadbalancingv2-targets": "1.25.0", - "@aws-cdk/aws-elasticsearch": "1.25.0", - "@aws-cdk/aws-emr": "1.25.0", - "@aws-cdk/aws-events": "1.25.0", - "@aws-cdk/aws-events-targets": "1.25.0", - "@aws-cdk/aws-eventschemas": "1.25.0", - "@aws-cdk/aws-fsx": "1.25.0", - "@aws-cdk/aws-gamelift": "1.25.0", - "@aws-cdk/aws-glue": "1.25.0", - "@aws-cdk/aws-greengrass": "1.25.0", - "@aws-cdk/aws-guardduty": "1.25.0", - "@aws-cdk/aws-iam": "1.25.0", - "@aws-cdk/aws-inspector": "1.25.0", - "@aws-cdk/aws-iot": "1.25.0", - "@aws-cdk/aws-iot1click": "1.25.0", - "@aws-cdk/aws-iotanalytics": "1.25.0", - "@aws-cdk/aws-iotevents": "1.25.0", - "@aws-cdk/aws-iotthingsgraph": "1.25.0", - "@aws-cdk/aws-kinesis": "1.25.0", - "@aws-cdk/aws-kinesisanalytics": "1.25.0", - "@aws-cdk/aws-kinesisfirehose": "1.25.0", - "@aws-cdk/aws-kms": "1.25.0", - "@aws-cdk/aws-lakeformation": "1.25.0", - "@aws-cdk/aws-lambda": "1.25.0", - "@aws-cdk/aws-lambda-destinations": "1.25.0", - "@aws-cdk/aws-lambda-event-sources": "1.25.0", - "@aws-cdk/aws-lambda-nodejs": "1.25.0", - "@aws-cdk/aws-logs": "1.25.0", - "@aws-cdk/aws-logs-destinations": "1.25.0", - "@aws-cdk/aws-managedblockchain": "1.25.0", - "@aws-cdk/aws-mediaconvert": "1.25.0", - "@aws-cdk/aws-medialive": "1.25.0", - "@aws-cdk/aws-mediastore": "1.25.0", - "@aws-cdk/aws-msk": "1.25.0", - "@aws-cdk/aws-neptune": "1.25.0", - "@aws-cdk/aws-opsworks": "1.25.0", - "@aws-cdk/aws-opsworkscm": "1.25.0", - "@aws-cdk/aws-pinpoint": "1.25.0", - "@aws-cdk/aws-pinpointemail": "1.25.0", - "@aws-cdk/aws-qldb": "1.25.0", - "@aws-cdk/aws-ram": "1.25.0", - "@aws-cdk/aws-rds": "1.25.0", - "@aws-cdk/aws-redshift": "1.25.0", - "@aws-cdk/aws-robomaker": "1.25.0", - "@aws-cdk/aws-route53": "1.25.0", - "@aws-cdk/aws-route53-patterns": "1.25.0", - "@aws-cdk/aws-route53-targets": "1.25.0", - "@aws-cdk/aws-route53resolver": "1.25.0", - "@aws-cdk/aws-s3": "1.25.0", - "@aws-cdk/aws-s3-assets": "1.25.0", - "@aws-cdk/aws-s3-deployment": "1.25.0", - "@aws-cdk/aws-s3-notifications": "1.25.0", - "@aws-cdk/aws-sagemaker": "1.25.0", - "@aws-cdk/aws-sam": "1.25.0", - "@aws-cdk/aws-sdb": "1.25.0", - "@aws-cdk/aws-secretsmanager": "1.25.0", - "@aws-cdk/aws-securityhub": "1.25.0", - "@aws-cdk/aws-servicecatalog": "1.25.0", - "@aws-cdk/aws-servicediscovery": "1.25.0", - "@aws-cdk/aws-ses": "1.25.0", - "@aws-cdk/aws-ses-actions": "1.25.0", - "@aws-cdk/aws-sns": "1.25.0", - "@aws-cdk/aws-sns-subscriptions": "1.25.0", - "@aws-cdk/aws-sqs": "1.25.0", - "@aws-cdk/aws-ssm": "1.25.0", - "@aws-cdk/aws-stepfunctions": "1.25.0", - "@aws-cdk/aws-stepfunctions-tasks": "1.25.0", - "@aws-cdk/aws-transfer": "1.25.0", - "@aws-cdk/aws-waf": "1.25.0", - "@aws-cdk/aws-wafregional": "1.25.0", - "@aws-cdk/aws-wafv2": "1.25.0", - "@aws-cdk/aws-workspaces": "1.25.0", - "@aws-cdk/core": "1.25.0", - "@aws-cdk/custom-resources": "1.25.0", - "@aws-cdk/cx-api": "1.25.0", - "@aws-cdk/region-info": "1.25.0", - "@types/node": "^10.17.15", - "@aws-cdk/aws-fms": "1.25.0", - "@aws-cdk/cdk-assets-schema": "1.25.0" + "@aws-cdk/alexa-ask": "0.0.0", + "@aws-cdk/app-delivery": "0.0.0", + "@aws-cdk/assets": "0.0.0", + "@aws-cdk/aws-accessanalyzer": "0.0.0", + "@aws-cdk/aws-acmpca": "0.0.0", + "@aws-cdk/aws-amazonmq": "0.0.0", + "@aws-cdk/aws-amplify": "0.0.0", + "@aws-cdk/aws-apigateway": "0.0.0", + "@aws-cdk/aws-apigatewayv2": "0.0.0", + "@aws-cdk/aws-appconfig": "0.0.0", + "@aws-cdk/aws-applicationautoscaling": "0.0.0", + "@aws-cdk/aws-appmesh": "0.0.0", + "@aws-cdk/aws-appstream": "0.0.0", + "@aws-cdk/aws-appsync": "0.0.0", + "@aws-cdk/aws-athena": "0.0.0", + "@aws-cdk/aws-autoscaling": "0.0.0", + "@aws-cdk/aws-autoscaling-common": "0.0.0", + "@aws-cdk/aws-autoscaling-hooktargets": "0.0.0", + "@aws-cdk/aws-autoscalingplans": "0.0.0", + "@aws-cdk/aws-backup": "0.0.0", + "@aws-cdk/aws-batch": "0.0.0", + "@aws-cdk/aws-budgets": "0.0.0", + "@aws-cdk/aws-certificatemanager": "0.0.0", + "@aws-cdk/aws-cloud9": "0.0.0", + "@aws-cdk/aws-cloudformation": "0.0.0", + "@aws-cdk/aws-cloudfront": "0.0.0", + "@aws-cdk/aws-cloudtrail": "0.0.0", + "@aws-cdk/aws-cloudwatch": "0.0.0", + "@aws-cdk/aws-cloudwatch-actions": "0.0.0", + "@aws-cdk/aws-codebuild": "0.0.0", + "@aws-cdk/aws-codecommit": "0.0.0", + "@aws-cdk/aws-codedeploy": "0.0.0", + "@aws-cdk/aws-codepipeline": "0.0.0", + "@aws-cdk/aws-codepipeline-actions": "0.0.0", + "@aws-cdk/aws-codestar": "0.0.0", + "@aws-cdk/aws-codestarnotifications": "0.0.0", + "@aws-cdk/aws-cognito": "0.0.0", + "@aws-cdk/aws-config": "0.0.0", + "@aws-cdk/aws-datapipeline": "0.0.0", + "@aws-cdk/aws-dax": "0.0.0", + "@aws-cdk/aws-directoryservice": "0.0.0", + "@aws-cdk/aws-dlm": "0.0.0", + "@aws-cdk/aws-dms": "0.0.0", + "@aws-cdk/aws-docdb": "0.0.0", + "@aws-cdk/aws-dynamodb": "0.0.0", + "@aws-cdk/aws-ec2": "0.0.0", + "@aws-cdk/aws-ecr": "0.0.0", + "@aws-cdk/aws-ecr-assets": "0.0.0", + "@aws-cdk/aws-ecs": "0.0.0", + "@aws-cdk/aws-ecs-patterns": "0.0.0", + "@aws-cdk/aws-efs": "0.0.0", + "@aws-cdk/aws-eks": "0.0.0", + "@aws-cdk/aws-eks-legacy": "0.0.0", + "@aws-cdk/aws-elasticache": "0.0.0", + "@aws-cdk/aws-elasticbeanstalk": "0.0.0", + "@aws-cdk/aws-elasticloadbalancing": "0.0.0", + "@aws-cdk/aws-elasticloadbalancingv2": "0.0.0", + "@aws-cdk/aws-elasticloadbalancingv2-targets": "0.0.0", + "@aws-cdk/aws-elasticsearch": "0.0.0", + "@aws-cdk/aws-emr": "0.0.0", + "@aws-cdk/aws-events": "0.0.0", + "@aws-cdk/aws-events-targets": "0.0.0", + "@aws-cdk/aws-eventschemas": "0.0.0", + "@aws-cdk/aws-fms": "0.0.0", + "@aws-cdk/aws-fsx": "0.0.0", + "@aws-cdk/aws-gamelift": "0.0.0", + "@aws-cdk/aws-glue": "0.0.0", + "@aws-cdk/aws-greengrass": "0.0.0", + "@aws-cdk/aws-guardduty": "0.0.0", + "@aws-cdk/aws-iam": "0.0.0", + "@aws-cdk/aws-inspector": "0.0.0", + "@aws-cdk/aws-iot": "0.0.0", + "@aws-cdk/aws-iot1click": "0.0.0", + "@aws-cdk/aws-iotanalytics": "0.0.0", + "@aws-cdk/aws-iotevents": "0.0.0", + "@aws-cdk/aws-iotthingsgraph": "0.0.0", + "@aws-cdk/aws-kinesis": "0.0.0", + "@aws-cdk/aws-kinesisanalytics": "0.0.0", + "@aws-cdk/aws-kinesisfirehose": "0.0.0", + "@aws-cdk/aws-kms": "0.0.0", + "@aws-cdk/aws-lakeformation": "0.0.0", + "@aws-cdk/aws-lambda": "0.0.0", + "@aws-cdk/aws-lambda-destinations": "0.0.0", + "@aws-cdk/aws-lambda-event-sources": "0.0.0", + "@aws-cdk/aws-lambda-nodejs": "0.0.0", + "@aws-cdk/aws-logs": "0.0.0", + "@aws-cdk/aws-logs-destinations": "0.0.0", + "@aws-cdk/aws-managedblockchain": "0.0.0", + "@aws-cdk/aws-mediaconvert": "0.0.0", + "@aws-cdk/aws-medialive": "0.0.0", + "@aws-cdk/aws-mediastore": "0.0.0", + "@aws-cdk/aws-msk": "0.0.0", + "@aws-cdk/aws-neptune": "0.0.0", + "@aws-cdk/aws-opsworks": "0.0.0", + "@aws-cdk/aws-opsworkscm": "0.0.0", + "@aws-cdk/aws-pinpoint": "0.0.0", + "@aws-cdk/aws-pinpointemail": "0.0.0", + "@aws-cdk/aws-qldb": "0.0.0", + "@aws-cdk/aws-ram": "0.0.0", + "@aws-cdk/aws-rds": "0.0.0", + "@aws-cdk/aws-redshift": "0.0.0", + "@aws-cdk/aws-robomaker": "0.0.0", + "@aws-cdk/aws-route53": "0.0.0", + "@aws-cdk/aws-route53-patterns": "0.0.0", + "@aws-cdk/aws-route53-targets": "0.0.0", + "@aws-cdk/aws-route53resolver": "0.0.0", + "@aws-cdk/aws-s3": "0.0.0", + "@aws-cdk/aws-s3-assets": "0.0.0", + "@aws-cdk/aws-s3-deployment": "0.0.0", + "@aws-cdk/aws-s3-notifications": "0.0.0", + "@aws-cdk/aws-sagemaker": "0.0.0", + "@aws-cdk/aws-sam": "0.0.0", + "@aws-cdk/aws-sdb": "0.0.0", + "@aws-cdk/aws-secretsmanager": "0.0.0", + "@aws-cdk/aws-securityhub": "0.0.0", + "@aws-cdk/aws-servicecatalog": "0.0.0", + "@aws-cdk/aws-servicediscovery": "0.0.0", + "@aws-cdk/aws-ses": "0.0.0", + "@aws-cdk/aws-ses-actions": "0.0.0", + "@aws-cdk/aws-sns": "0.0.0", + "@aws-cdk/aws-sns-subscriptions": "0.0.0", + "@aws-cdk/aws-sqs": "0.0.0", + "@aws-cdk/aws-ssm": "0.0.0", + "@aws-cdk/aws-stepfunctions": "0.0.0", + "@aws-cdk/aws-stepfunctions-tasks": "0.0.0", + "@aws-cdk/aws-transfer": "0.0.0", + "@aws-cdk/aws-waf": "0.0.0", + "@aws-cdk/aws-wafregional": "0.0.0", + "@aws-cdk/aws-wafv2": "0.0.0", + "@aws-cdk/aws-workspaces": "0.0.0", + "@aws-cdk/cdk-assets-schema": "0.0.0", + "@aws-cdk/core": "0.0.0", + "@aws-cdk/custom-resources": "0.0.0", + "@aws-cdk/cx-api": "0.0.0", + "@aws-cdk/region-info": "0.0.0", + "@types/node": "^10.17.17" }, "homepage": "https://github.com/aws/aws-cdk", "engines": { "node": ">= 10.3.0" } -} +} \ No newline at end of file diff --git a/scripts/align-version.js b/scripts/align-version.js new file mode 100755 index 0000000000000..2b372e373dcee --- /dev/null +++ b/scripts/align-version.js @@ -0,0 +1,33 @@ +#!/usr/bin/env node +// +// align the version in a package.json file to the version of the repo +// +const fs = require('fs'); + +const marker = require('./get-version-marker'); +const repoVersion = require('./get-version'); + +for (const file of process.argv.splice(2)) { + const pkg = JSON.parse(fs.readFileSync(file).toString()); + + if (pkg.version !== marker) { + throw new Error(`unexpected - all package.json files in this repo should have a version of ${marker}: ${file}`); + } + + pkg.version = repoVersion; + + processSection(pkg.dependencies || { }, file); + processSection(pkg.devDependencies || { }, file); + processSection(pkg.peerDependencies || { }, file); + + console.error(`${file} => ${repoVersion}`); + fs.writeFileSync(file, JSON.stringify(pkg, undefined, 2)); +} + +function processSection(section, file) { + for (const [ name, version ] of Object.entries(section)) { + if (version === marker || version === '^' + marker) { + section[name] = version.replace(marker, repoVersion); + } + } +} diff --git a/scripts/align-version.sh b/scripts/align-version.sh new file mode 100755 index 0000000000000..e4a4cc6f6248a --- /dev/null +++ b/scripts/align-version.sh @@ -0,0 +1,20 @@ +#!/bin/bash +#------------------------------------------------------------------------ +# updates all package.json files to the version defined in lerna.json +# this is called when building inside our ci/cd system +#------------------------------------------------------------------------ +set -euo pipefail +scriptdir=$(cd $(dirname $0) && pwd) + +# go to repo root +cd ${scriptdir}/.. + +files="$(find . -name package.json | grep -v node_modules | xargs)" +${scriptdir}/align-version.js ${files} + +# validation +marker=$(node -p "require('./scripts/get-version-marker')") +if find . -name package.json | grep -v node_modules | xargs grep "[^0-9]${marker}"; then + echo "ERROR: unexpected version marker ${marker} in a package.json file" + exit 1 +fi diff --git a/scripts/fix-peer-deps.sh b/scripts/fix-peer-deps.sh deleted file mode 100755 index 8fa56be4bc573..0000000000000 --- a/scripts/fix-peer-deps.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -set -euo pipefail - -if [ ! -f lerna.json ]; then - echo "This script should be run from the root of the repo." - exit 1 -fi - -# first, we need to make sure that all existing peer dependencies are aligned to the "dependency" version -find . -name package.json | grep -v node_modules | xargs node scripts/sync-peer-deps.js - -# must build first so .jsii is aligned -/bin/bash ./build.sh --skip-tests - -# now, run jsii-fix-peers to add all missing peers based on the jsii spec -npx lerna exec "$PWD/tools/cdk-build-tools/node_modules/.bin/jsii-fix-peers 2>/dev/null || true" diff --git a/scripts/foreach.sh b/scripts/foreach.sh index 7cbc5d58025a2..8f4b3ef820e0a 100755 --- a/scripts/foreach.sh +++ b/scripts/foreach.sh @@ -100,7 +100,7 @@ heading "${next}: ${command} (${remaining} remaining)" # that script (similar to how "lerna run" behaves) if [[ "${command}" == "npm run "* ]] || [[ "${command}" == "yarn run "* ]]; then script="$(echo ${command} | cut -d" " -f3)" - exists=$(node -pe "require('./package.json').scripts['${script}'] || ''") + exists=$(node -pe "(require('./package.json').scripts && require('./package.json').scripts['${script}']) || ''") if [ -z "${exists}" ]; then echo "skipping (no "${script}" script in package.json)" exit 0 diff --git a/scripts/get-version-marker.js b/scripts/get-version-marker.js new file mode 100644 index 0000000000000..e5f8c49806a67 --- /dev/null +++ b/scripts/get-version-marker.js @@ -0,0 +1,13 @@ +/** + * Returns the version marker used to indicate this is a local dependency. + * + * Usage: + * + * const version = require('./get-version-marker'); + * + * Or from the command line: + * + * node -p require('./get-version-marker') + * + */ +module.exports = '0.0.0'; diff --git a/scripts/get-version.js b/scripts/get-version.js new file mode 100644 index 0000000000000..9e6972582c427 --- /dev/null +++ b/scripts/get-version.js @@ -0,0 +1,18 @@ +/** + * Returns the current repo version. + * + * Usage: + * + * const version = require('./get-version'); + * + * Or from the command line: + * + * node -p require('./get-version') + * + */ +const versionFile = require('../.versionrc.json').packageFiles[0].filename; +if (!versionFile) { + throw new Error(`unable to determine version filename from .versionrc.json at the root of the repo`); +} + +module.exports = require(`../${versionFile}`).version; diff --git a/scripts/sync-peer-deps.js b/scripts/sync-peer-deps.js deleted file mode 100644 index 431221d73dc7d..0000000000000 --- a/scripts/sync-peer-deps.js +++ /dev/null @@ -1,25 +0,0 @@ -// -// align versions of "peerDependencies" and "dependencies" for a given set of package.json files -// usage: node sync-peer-deps.js package.json pacakge.json ... -// -const fs = require('fs'); - -for (const file of process.argv.splice(2)) { - const pkg = JSON.parse(fs.readFileSync(file).toString()); - const deps = pkg.dependencies || { }; - let updated = false; - if (pkg.peerDependencies) { - for (const dep of Object.keys(pkg.peerDependencies)) { - const version = deps[dep]; - const peerVersion = pkg.peerDependencies[dep]; - if (version && version !== peerVersion) { - pkg.peerDependencies[dep] = version; - updated = true; - } - } - } - if (updated) { - console.log('updated:', file); - fs.writeFileSync(file, JSON.stringify(pkg, undefined, 2)); - } -} \ No newline at end of file diff --git a/tools/awslint/package.json b/tools/awslint/package.json index c944e3283ecf2..2763a93b69a91 100644 --- a/tools/awslint/package.json +++ b/tools/awslint/package.json @@ -1,7 +1,7 @@ { "name": "awslint", "private": true, - "version": "1.25.0", + "version": "0.0.0", "description": "Enforces the AWS Construct Library guidelines", "main": "index.js", "scripts": { @@ -21,13 +21,13 @@ "colors": "^1.4.0", "fs-extra": "^8.1.0", "jsii-reflect": "^1.0.0", - "yargs": "^15.1.0" + "yargs": "^15.2.0" }, "devDependencies": { "@types/fs-extra": "^8.1.0", - "@types/yargs": "^15.0.3", + "@types/yargs": "^15.0.4", "tslint": "^5.20.1", - "typescript": "~3.8.2" + "typescript": "~3.8.3" }, "repository": { "type": "git", @@ -47,4 +47,4 @@ "engines": { "node": ">= 10.3.0" } -} +} \ No newline at end of file diff --git a/tools/cdk-build-tools/lib/compile.ts b/tools/cdk-build-tools/lib/compile.ts index 6b73301eb65cb..a4231554d6fa0 100644 --- a/tools/cdk-build-tools/lib/compile.ts +++ b/tools/cdk-build-tools/lib/compile.ts @@ -16,17 +16,28 @@ export async function compileCurrentPackage(timers: Timers, options: CDKBuildOpt } // Always call linters - await shell([ - compilers.eslint || require.resolve('eslint/bin/eslint'), - `--config=${path.resolve(__dirname, '..', 'config', 'eslintrc.yml')}`, - '.', - '--ext=.js,.ts', - '--ignore-path=.gitignore', - '--no-eslintrc', // ignore local .eslintrc files - `--resolve-plugins-relative-to=${__dirname}`, - ...options.eslint?.["ignore-pattern"]?.map(pattern => `--ignore-pattern=${pattern}`) || [] - ], { timers }); - await shell([compilers.tslint || require.resolve('tslint/bin/tslint'), '--project', '.'], { timers }); - await shell(['pkglint'], { timers }); + + // tslint:disable-next-line: no-console + if (!options.eslint?.disable) { + await shell([ + compilers.eslint || require.resolve('eslint/bin/eslint'), + `--config=${path.resolve(__dirname, '..', 'config', 'eslintrc.yml')}`, + '.', + '--ext=.js,.ts', + '--ignore-path=.gitignore', + '--no-eslintrc', // ignore local .eslintrc files + `--resolve-plugins-relative-to=${__dirname}`, + ...options.eslint?.["ignore-pattern"]?.map(pattern => `--ignore-pattern=${pattern}`) || [] + ], { timers }); + } + + if (!options.tslint?.disable) { + await shell([compilers.tslint || require.resolve('tslint/bin/tslint'), '--project', '.'], { timers }); + } + + if (!options.pkglint?.disable) { + await shell(['pkglint'], { timers }); + } + await shell([ path.join(__dirname, '..', 'bin', 'cdk-awslint') ], { timers }); } diff --git a/tools/cdk-build-tools/lib/package-info.ts b/tools/cdk-build-tools/lib/package-info.ts index fe104006b26fc..0ad4fd5644cc9 100644 --- a/tools/cdk-build-tools/lib/package-info.ts +++ b/tools/cdk-build-tools/lib/package-info.ts @@ -99,12 +99,26 @@ export interface CDKBuildOptions { * Options passed to `eslint` invocations. */ eslint?: { + /** + * Disable linting + * @default false + */ + disable?: boolean; + /** * Patterns to be ignored. */ "ignore-pattern"?: string[]; }; + tslint?: { + disable?: boolean; + }; + + pkglint?: { + disable?: boolean; + }; + /** * An optional command (formatted as a list of strings) to run before building * diff --git a/tools/cdk-build-tools/package.json b/tools/cdk-build-tools/package.json index 34802c8916970..6cb83e043a61e 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.25.0", + "version": "0.0.0", "description": "Tools package with shared build scripts for CDK packages", "main": "lib/index.js", "repository": { @@ -33,13 +33,13 @@ "devDependencies": { "@types/fs-extra": "^8.1.0", "@types/jest": "^25.1.2", - "@types/yargs": "^15.0.3", - "pkglint": "1.25.0" + "@types/yargs": "^15.0.4", + "pkglint": "0.0.0" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "^2.20.0", + "@typescript-eslint/eslint-plugin": "^2.21.0", "@typescript-eslint/parser": "^2.19.2", - "awslint": "1.25.0", + "awslint": "0.0.0", "colors": "^1.4.0", "eslint": "^6.8.0", "eslint-import-resolver-node": "^0.3.3", @@ -53,8 +53,8 @@ "nyc": "^15.0.0", "ts-jest": "^25.2.0", "tslint": "^5.20.1", - "typescript": "~3.8.2", - "yargs": "^15.1.0" + "typescript": "~3.8.3", + "yargs": "^15.2.0" }, "keywords": [ "aws", @@ -64,4 +64,4 @@ "engines": { "node": ">= 10.3.0" } -} +} \ No newline at end of file diff --git a/tools/cdk-integ-tools/package.json b/tools/cdk-integ-tools/package.json index a7ae7e094a64c..3a30b98bab3b0 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.25.0", + "version": "0.0.0", "description": "Package with integration test scripts for CDK packages", "main": "index.js", "repository": { @@ -30,16 +30,16 @@ "license": "Apache-2.0", "devDependencies": { "@types/fs-extra": "^8.1.0", - "@types/yargs": "^15.0.3", - "cdk-build-tools": "1.25.0", - "pkglint": "1.25.0" + "@types/yargs": "^15.0.4", + "cdk-build-tools": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/cloudformation-diff": "1.25.0", - "@aws-cdk/cx-api": "1.25.0", - "aws-cdk": "1.25.0", + "@aws-cdk/cloudformation-diff": "0.0.0", + "@aws-cdk/cx-api": "0.0.0", + "aws-cdk": "0.0.0", "fs-extra": "^8.1.0", - "yargs": "^15.1.0" + "yargs": "^15.2.0" }, "keywords": [ "aws", @@ -49,4 +49,4 @@ "engines": { "node": ">= 10.3.0" } -} +} \ No newline at end of file diff --git a/tools/cfn2ts/package.json b/tools/cfn2ts/package.json index 86fb2bf3960ca..eebcea638d960 100644 --- a/tools/cfn2ts/package.json +++ b/tools/cfn2ts/package.json @@ -1,7 +1,7 @@ { "name": "cfn2ts", "private": true, - "version": "1.25.0", + "version": "0.0.0", "description": "Generates typescript types from CloudFormation spec, with support for enrichments", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -29,19 +29,19 @@ }, "license": "Apache-2.0", "dependencies": { - "@aws-cdk/cfnspec": "1.25.0", + "@aws-cdk/cfnspec": "0.0.0", "codemaker": "^1.0.0", "fast-json-patch": "^3.0.0-1", "fs-extra": "^8.1.0", - "yargs": "^15.1.0" + "yargs": "^15.2.0" }, "devDependencies": { "@types/fs-extra": "^8.1.0", "@types/jest": "^25.1.2", - "@types/yargs": "^15.0.3", - "cdk-build-tools": "1.25.0", + "@types/yargs": "^15.0.4", + "cdk-build-tools": "0.0.0", "jest": "^24.9.0", - "pkglint": "1.25.0" + "pkglint": "0.0.0" }, "cdk-build": { "eslint": { @@ -58,4 +58,4 @@ "engines": { "node": ">= 10.3.0" } -} +} \ No newline at end of file diff --git a/tools/pkglint/lib/rules.ts b/tools/pkglint/lib/rules.ts index 6655f6bba4f49..84e45f6af4a49 100644 --- a/tools/pkglint/lib/rules.ts +++ b/tools/pkglint/lib/rules.ts @@ -11,7 +11,6 @@ import { fileShouldNotContain, findInnerPackages, monoRepoRoot, - monoRepoVersion, } from './util'; // tslint:disable-next-line: no-var-requires @@ -657,17 +656,50 @@ export class RegularDependenciesMustSatisfyPeerDependencies extends ValidationRu } /** - * Check that dependencies on @aws-cdk/ packages use point versions (not version ranges). + * Check that dependencies on @aws-cdk/ packages use point versions (not version ranges) + * and that they are also defined in `peerDependencies`. */ export class MustDependonCdkByPointVersions extends ValidationRule { public readonly name = 'dependencies/cdk-point-dependencies'; public validate(pkg: PackageJson): void { - const expectedVersion = monoRepoVersion(); + // yes, ugly, but we have a bunch of references to other files in the repo. + // we use the root package.json to determine what should be the version + // across the repo: in local builds, this should be 0.0.0 and in CI builds + // this would be the actual version of the repo after it's been aligned + // using scripts/align-version.sh + const expectedVersion = require('../../../package.json').version; + const ignore = [ + '@aws-cdk/cloudformation-diff', + '@aws-cdk/cfnspec', + '@aws-cdk/cdk-assets-schema', + '@aws-cdk/cx-api', + '@aws-cdk/region-info' + ]; for (const [depName, depVersion] of Object.entries(pkg.dependencies)) { - if (isCdkModuleName(depName) && depVersion !== expectedVersion) { + if (!isCdkModuleName(depName) || ignore.includes(depName)) { + continue; + } + + const peerDep = pkg.peerDependencies[depName]; + if (!peerDep) { + pkg.report({ + ruleName: this.name, + message: `dependency ${depName} must also appear in peerDependencies`, + fix: () => pkg.addPeerDependency(depName, expectedVersion) + }); + } + + if (peerDep !== expectedVersion) { + pkg.report({ + ruleName: this.name, + message: `peer dependency ${depName} should have the version ${expectedVersion}`, + fix: () => pkg.addPeerDependency(depName, expectedVersion) + }); + } + if (depVersion !== expectedVersion) { pkg.report({ ruleName: this.name, message: `dependency ${depName}: dependency version must be ${expectedVersion}`, @@ -844,7 +876,7 @@ export class AllVersionsTheSame extends ValidationRule { private readonly usedDeps: {[pkg: string]: VersionCount[]} = {}; public prepare(pkg: PackageJson): void { - this.ourPackages[pkg.json.name] = `^${pkg.json.version}`; + this.ourPackages[pkg.json.name] = pkg.json.version; this.recordDeps(pkg.json.dependencies); this.recordDeps(pkg.json.devDependencies); } diff --git a/tools/pkglint/lib/util.ts b/tools/pkglint/lib/util.ts index d80c2e383a732..85f33afb2e7b0 100644 --- a/tools/pkglint/lib/util.ts +++ b/tools/pkglint/lib/util.ts @@ -137,15 +137,6 @@ export function deepSet(x: any, jsonPath: string[], value: any) { x[jsonPath[0]] = value; } -/** - * Find 'lerna.json' and read the global package version from there - */ -export function monoRepoVersion() { - const found = findLernaJSON(); - const lernaJson = require(found); - return lernaJson.version; -} - export function findUpward(dir: string, pred: (x: string) => boolean): string | undefined { while (true) { if (pred(dir)) { return dir; } @@ -167,10 +158,6 @@ export function monoRepoRoot() { return ret; } -function findLernaJSON() { - return path.join(monoRepoRoot(), 'lerna.json'); -} - export function* findInnerPackages(dir: string): IterableIterator { for (const fname of fs.readdirSync(dir, { encoding: 'utf8' })) { try { diff --git a/tools/pkglint/package.json b/tools/pkglint/package.json index e61a05e6d4943..52110d963a6da 100644 --- a/tools/pkglint/package.json +++ b/tools/pkglint/package.json @@ -1,6 +1,6 @@ { "name": "pkglint", - "version": "1.25.0", + "version": "0.0.0", "private": true, "description": "Validate and fix package.json files", "main": "lib/index.js", @@ -36,13 +36,13 @@ "devDependencies": { "@types/fs-extra": "^8.1.0", "@types/semver": "^7.1.0", - "@types/yargs": "^15.0.3" + "@types/yargs": "^15.0.4" }, "dependencies": { "case": "^1.6.2", "colors": "^1.4.0", "fs-extra": "^8.1.0", "semver": "^7.1.3", - "yargs": "^15.1.0" + "yargs": "^15.2.0" } -} +} \ No newline at end of file diff --git a/tools/pkgtools/package.json b/tools/pkgtools/package.json index 9282431d7a59f..91478e8280483 100644 --- a/tools/pkgtools/package.json +++ b/tools/pkgtools/package.json @@ -1,7 +1,7 @@ { "name": "pkgtools", "private": true, - "version": "1.25.0", + "version": "0.0.0", "description": "Tools for generating cross-package artifacts", "main": "index.js", "repository": { @@ -30,13 +30,13 @@ "license": "Apache-2.0", "devDependencies": { "@types/fs-extra": "^8.1.0", - "@types/yargs": "^15.0.3", - "cdk-build-tools": "1.25.0", - "pkglint": "1.25.0" + "@types/yargs": "^15.0.4", + "cdk-build-tools": "0.0.0", + "pkglint": "0.0.0" }, "dependencies": { "fs-extra": "^8.1.0", - "yargs": "^15.1.0" + "yargs": "^15.2.0" }, "keywords": [ "aws", @@ -46,4 +46,4 @@ "engines": { "node": ">= 10.3.0" } -} +} \ No newline at end of file diff --git a/tools/prlint/package-lock.json b/tools/prlint/package-lock.json deleted file mode 100644 index d9be9e58e7380..0000000000000 --- a/tools/prlint/package-lock.json +++ /dev/null @@ -1,429 +0,0 @@ -{ - "name": "prlint", - "version": "1.25.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, - "axios": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz", - "integrity": "sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==", - "requires": { - "follow-redirects": "1.5.10" - } - }, - "bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" - }, - "camelcase": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=" - }, - "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wrap-ansi": "^2.0.0" - } - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "follow-redirects": { - "version": "1.5.10", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", - "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==", - "requires": { - "debug": "=3.1.0" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "requires": { - "ms": "2.0.0" - } - } - } - }, - "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" - }, - "github-api": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/github-api/-/github-api-3.3.0.tgz", - "integrity": "sha512-30pABj/1ciHmlqmjnWXn+A4JL8j9qB2IcQgibrJ7euGbaNRkAj+T6QhJwjLcPx4Hxlj+BP1TcdvaQ/7resw+VA==", - "requires": { - "axios": "^0.19.0", - "debug": "^2.2.0", - "js-base64": "^2.1.9", - "utf8": "^2.1.1" - } - }, - "graceful-fs": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", - "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==" - }, - "hosted-git-info": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz", - "integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==" - }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" - }, - "js-base64": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.1.tgz", - "integrity": "sha512-M7kLczedRMYX4L8Mdh4MzyAMM9O5osx+4FcOQuTvr3A9F2D9S5JXheN0ewNbrvK2UatkTRhL5ejGmGSjNMiZuw==" - }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "requires": { - "invert-kv": "^1.0.0" - } - }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - } - }, - "lodash.assign": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", - "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=" - }, - "make-runnable": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-runnable/-/make-runnable-1.3.6.tgz", - "integrity": "sha1-ypsdMbBvBR43Vw+3rZi8U2n5gr4=", - "requires": { - "bluebird": "^3.5.0", - "yargs": "^4.7.1" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" - }, - "os-locale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", - "requires": { - "lcid": "^1.0.0" - } - }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "requires": { - "error-ex": "^1.2.0" - } - }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "requires": { - "pinkie-promise": "^2.0.0" - } - }, - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" - }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "requires": { - "pinkie": "^2.0.0" - } - }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - } - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" - }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" - }, - "resolve": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.0.tgz", - "integrity": "sha512-+hTmAldEGE80U2wJJDC1lebb5jWqvTYAfm3YZ1ckk1gBr0MnCqUKlwK1e+anaFljIl+F5tR5IoZcm4ZDA1zMQw==", - "requires": { - "path-parse": "^1.0.6" - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" - }, - "spdx-correct": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==" - }, - "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==" - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "requires": { - "is-utf8": "^0.2.0" - } - }, - "utf8": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/utf8/-/utf8-2.1.2.tgz", - "integrity": "sha1-H6DZJw6b6FDZsFAn9jUZv0ZFfZY=" - }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "which-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=" - }, - "window-size": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", - "integrity": "sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU=" - }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - } - }, - "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" - }, - "yargs": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", - "integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=", - "requires": { - "cliui": "^3.2.0", - "decamelize": "^1.1.1", - "get-caller-file": "^1.0.1", - "lodash.assign": "^4.0.3", - "os-locale": "^1.4.0", - "read-pkg-up": "^1.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^1.0.1", - "which-module": "^1.0.0", - "window-size": "^0.2.0", - "y18n": "^3.2.1", - "yargs-parser": "^2.4.1" - } - }, - "yargs-parser": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", - "integrity": "sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ=", - "requires": { - "camelcase": "^3.0.0", - "lodash.assign": "^4.0.6" - } - } - } -} diff --git a/tools/prlint/package.json b/tools/prlint/package.json index 895c6365b8e26..30175eca33662 100644 --- a/tools/prlint/package.json +++ b/tools/prlint/package.json @@ -1,7 +1,7 @@ { "name": "prlint", "private": true, - "version": "1.25.0", + "version": "0.0.0", "description": "", "main": "index.js", "keywords": [], @@ -14,4 +14,4 @@ "github-api": "^3.3.0", "make-runnable": "^1.3.6" } -} +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 859a5f72d6013..205e7b99c5ec0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1891,10 +1891,10 @@ resolved "https://registry.yarnpkg.com/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz#8da5c6530915653f3a1f38fd5f101d8c3f8079c5" integrity sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ== -"@types/archiver@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/archiver/-/archiver-3.0.0.tgz#c0a53e0ed3b7aef626ce683d081d7821d8c638b4" - integrity sha512-orghAMOF+//wSg4ru2znk6jt0eIPvKTtMVLH7XcYcjbcRyAXRClDlh27QVdqnAvVM37yu9xDP6Nh7egRhNr8tQ== +"@types/archiver@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@types/archiver/-/archiver-3.1.0.tgz#0d5bd922ba5cf06e137cd6793db7942439b1805e" + integrity sha512-nTvHwgWONL+iXG+9CX+gnQ/tTOV+qucAjwpXqeUn4OCRMxP42T29FFP/7XaOo0EqqO3TlENhObeZEe7RUJAriw== dependencies: "@types/glob" "*" @@ -2058,10 +2058,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-13.1.8.tgz#1d590429fe8187a02707720ecf38a6fe46ce294b" integrity sha512-6XzyyNM9EKQW4HKuzbo/CkOIjn/evtCmsU+MUM1xDfJ+3/rNjBttM1NgN7AOQvN6tP1Sl1D1PIKMreTArnxM9A== -"@types/node@^10.17.13", "@types/node@^10.17.15": - version "10.17.16" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.16.tgz#ee96ddac1a38d98d2c8a71c7df0cdad5758e8993" - integrity sha512-A4283YSA1OmnIivcpy/4nN86YlnKRiQp8PYwI2KdPCONEBN093QTb0gCtERtkLyVNGKKIGazTZ2nAmVzQU51zA== +"@types/node@^10.17.17": + version "10.17.17" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.17.tgz#7a183163a9e6ff720d86502db23ba4aade5999b8" + integrity sha512-gpNnRnZP3VWzzj5k3qrpRC6Rk3H/uclhAVo1aIvwzK5p5cOrs9yEyQ8H/HBsBY0u5rrWxXEiVPQ0dEB6pkjE8Q== "@types/nodeunit@^0.0.30": version "0.0.30" @@ -2102,10 +2102,10 @@ dependencies: "@types/node" "*" -"@types/sinon@^7.5.0": - version "7.5.1" - resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-7.5.1.tgz#d27b81af0d1cfe1f9b24eebe7a24f74ae40f5b7c" - integrity sha512-EZQUP3hSZQyTQRfiLqelC9NMWd1kqLcmQE0dMiklxBkgi84T+cHOhnKpgk4NnOWpGX863yE6+IaGnOXUNFqDnQ== +"@types/sinon@^7.5.2": + version "7.5.2" + resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-7.5.2.tgz#5e2f1d120f07b9cda07e5dedd4f3bf8888fccdb9" + integrity sha512-T+m89VdXj/eidZyejvmoP9jivXgBDdkOSBVQjU9kF349NEx10QdPNGxHeZUaj1IlJ32/ewdyXJjnJxyxJroYwg== "@types/stack-utils@^1.0.1": version "1.0.1" @@ -2129,10 +2129,10 @@ resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-2.3.6.tgz#c880579e087d7a0db13777ff8af689f4ffc7b0d5" integrity sha512-wHNBMnkoEBiRAd3s8KTKwIuO9biFtTf0LehITzBhSco+HQI0xkXZbLOD55SW3Aqw3oUkHstkm5SPv58yaAdFPQ== -"@types/uuid@^3.4.7": - version "3.4.7" - resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-3.4.7.tgz#51d42247473bc00e38cc8dfaf70d936842a36c03" - integrity sha512-C2j2FWgQkF1ru12SjZJyMaTPxs/f6n90+5G5qNakBxKXjTBc/YTSelHh4Pz1HUDwxFXD9WvpQhOGCDC+/Y4mIQ== +"@types/uuid@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-7.0.0.tgz#9f6993ccc8210efa90bda7e1afabbb06a9f860cd" + integrity sha512-RiX1I0lK9WFLFqy2xOxke396f0wKIzk5sAll0tL4J4XDYJXURI7JOs96XQb3nP+2gEpQ/LutBb66jgiT5oQshQ== "@types/yaml@1.2.0", "@types/yaml@^1.2.0": version "1.2.0" @@ -2151,26 +2151,19 @@ dependencies: "@types/yargs-parser" "*" -"@types/yargs@^15.0.0": - version "15.0.2" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.2.tgz#0bf292a0369493cee030e2e4f4ff84f5982b028d" - integrity sha512-hFkuAp58M2xOc1QgJhkFrLMnqa8KWTFRTnzrI1zlEcOfg3DZ0eH3aPAo/N6QlVVu8E4KS4xD1jtEG3rdQYFmIg== - dependencies: - "@types/yargs-parser" "*" - -"@types/yargs@^15.0.3": - version "15.0.3" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.3.tgz#41453a0bc7ab393e995d1f5451455638edbd2baf" - integrity sha512-XCMQRK6kfpNBixHLyHUsGmXrpEmFFxzMrcnSXFMziHd8CoNJo8l16FkHyQq4x+xbM7E2XL83/O78OD8u+iZTdQ== +"@types/yargs@^15.0.0", "@types/yargs@^15.0.4": + version "15.0.4" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.4.tgz#7e5d0f8ca25e9d5849f2ea443cf7c402decd8299" + integrity sha512-9T1auFmbPZoxHz0enUFlUuKRy3it01R+hlggyVUMtnCTQRunsQYifnSGb8hET4Xo8yiC0o0r1paW3ud5+rbURg== dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^2.20.0": - version "2.20.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.20.0.tgz#a522d0e1e4898f7c9c6a8e1ed3579b60867693fa" - integrity sha512-cimIdVDV3MakiGJqMXw51Xci6oEDEoPkvh8ggJe2IIzcc0fYqAxOXN6Vbeanahz6dLZq64W+40iUEc9g32FLDQ== +"@typescript-eslint/eslint-plugin@^2.21.0": + version "2.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.21.0.tgz#a34de84a0791cae0357c4dda805c5b4e8203b6c6" + integrity sha512-b5jjjDMxzcjh/Sbjuo7WyhrQmVJg0WipTHQgXh5Xwx10uYm6nPWqN1WGOsaNq4HR3Zh4wUx4IRQdDkCHwyewyw== dependencies: - "@typescript-eslint/experimental-utils" "2.20.0" + "@typescript-eslint/experimental-utils" "2.21.0" eslint-utils "^1.4.3" functional-red-black-tree "^1.0.1" regexpp "^3.0.0" @@ -2185,6 +2178,15 @@ "@typescript-eslint/typescript-estree" "2.20.0" eslint-scope "^5.0.0" +"@typescript-eslint/experimental-utils@2.21.0": + version "2.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.21.0.tgz#71de390a3ec00b280b69138d80733406e6e86bfa" + integrity sha512-olKw9JP/XUkav4lq0I7S1mhGgONJF9rHNhKFn9wJlpfRVjNo3PPjSvybxEldvCXnvD+WAshSzqH5cEjPp9CsBA== + dependencies: + "@types/json-schema" "^7.0.3" + "@typescript-eslint/typescript-estree" "2.21.0" + eslint-scope "^5.0.0" + "@typescript-eslint/parser@^2.19.2": version "2.20.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.20.0.tgz#608e5bb06ba98a415b64ace994c79ab20f9772a9" @@ -2208,6 +2210,19 @@ semver "^6.3.0" tsutils "^3.17.1" +"@typescript-eslint/typescript-estree@2.21.0": + version "2.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.21.0.tgz#7e4be29f2e338195a2e8c818949ed0ff727cc943" + integrity sha512-NC/nogZNb9IK2MEFQqyDBAciOT8Lp8O3KgAfvHx2Skx6WBo+KmDqlU3R9KxHONaijfTIKtojRe3SZQyMjr3wBw== + dependencies: + debug "^4.1.1" + eslint-visitor-keys "^1.1.0" + glob "^7.1.6" + is-glob "^4.0.1" + lodash "^4.17.15" + semver "^6.3.0" + tsutils "^3.17.1" + "@zkochan/cmd-shim@^3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@zkochan/cmd-shim/-/cmd-shim-3.1.0.tgz#2ab8ed81f5bb5452a85f25758eb9b8681982fd2e" @@ -2631,10 +2646,10 @@ aws-sdk-mock@^5.0.0: sinon "^8.0.1" traverse "^0.6.6" -aws-sdk@^2.596.0, aws-sdk@^2.624.0: - version "2.624.0" - resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.624.0.tgz#c30d7ab8a3c81aa21630bd73e9bac71e16347cc5" - integrity sha512-6MhbdND7A5lEBiNSZ/HLwhKgrysmwTy6C47H7vfuVnY25hDkIND3C0PLqeRyskUqxv0RqsiAB4kqiMtpE08IGA== +aws-sdk@^2.596.0, aws-sdk@^2.630.0: + version "2.630.0" + resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.630.0.tgz#108ccd50b585226db8d1798def73f7b873a2efa6" + integrity sha512-7BDPUIqmMZfZf+KN2Z3RpGDYGkEucQORLM2EqXuE91ETW5ySvoNd771+EaE3OS+FUx3JejfcVk8Rr2ZFU38RjA== dependencies: buffer "4.9.1" events "1.1.1" @@ -3187,6 +3202,15 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= +chalk@2.4.2, chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.3.1, chalk@^2.4.1, chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" @@ -3198,15 +3222,6 @@ chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.3.1, chalk@^2.4.1, chalk@^2.4.2: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - chalk@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" @@ -3603,7 +3618,12 @@ conventional-changelog-codemirror@^2.0.3: dependencies: q "^1.5.1" -conventional-changelog-conventionalcommits@^4.2.3: +conventional-changelog-config-spec@2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-config-spec/-/conventional-changelog-config-spec-2.1.0.tgz#874a635287ef8b581fd8558532bf655d4fb59f2d" + integrity sha512-IpVePh16EbbB02V+UA+HQnnPIohgXvJRxHcS5+Uwk4AT5LjzCZJm5sp/yqs5C6KZJ1jMsV4paEV13BN1pvDuxQ== + +conventional-changelog-conventionalcommits@4.2.3, conventional-changelog-conventionalcommits@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.2.3.tgz#22855b32d57d0328951c1c2dc01b172a5f24ea37" integrity sha512-atGa+R4vvEhb8N/8v3IoW59gCBJeeFiX6uIbPu876ENAmkMwsenyn0R21kdDHJFLQdy6zW4J6b4xN8KI3b9oww== @@ -3631,7 +3651,7 @@ conventional-changelog-core@^3.1.6: read-pkg-up "^3.0.0" through2 "^3.0.0" -conventional-changelog-core@^4.1.4: +conventional-changelog-core@^4.1.1, conventional-changelog-core@^4.1.4: version "4.1.4" resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-4.1.4.tgz#39be27fca6ef20a0f998d7a3a1e97cfa8a055cb6" integrity sha512-LO58ZbEpp1Ul+y/vOI8rJRsWkovsYkCFbOCVgi6UnVfU8WC0F8K8VQQwaBZWWUpb6JvEiN4GBR5baRP2txZ+Vg== @@ -3708,6 +3728,23 @@ conventional-changelog-writer@^4.0.11, conventional-changelog-writer@^4.0.6: split "^1.0.0" through2 "^3.0.0" +conventional-changelog@3.1.15: + version "3.1.15" + resolved "https://registry.yarnpkg.com/conventional-changelog/-/conventional-changelog-3.1.15.tgz#103d0b550436cf83e8a59ba88be82ece2613cd9f" + integrity sha512-CoWM+Z9bYyF00QzNpTnxkCLiuLAeRocJz3C/foFjvhsdltdtkJgMChp7GytQNjm4pT7JFBVJTpqLHTpxNtOzaA== + dependencies: + conventional-changelog-angular "^5.0.6" + conventional-changelog-atom "^2.0.3" + conventional-changelog-codemirror "^2.0.3" + conventional-changelog-conventionalcommits "^4.2.3" + conventional-changelog-core "^4.1.1" + conventional-changelog-ember "^2.0.4" + conventional-changelog-eslint "^3.0.4" + conventional-changelog-express "^2.0.1" + conventional-changelog-jquery "^3.0.6" + conventional-changelog-jshint "^2.0.3" + conventional-changelog-preset-loader "^2.3.0" + conventional-changelog@^3.1.18: version "3.1.18" resolved "https://registry.yarnpkg.com/conventional-changelog/-/conventional-changelog-3.1.18.tgz#7da0a5ab34a604b920b8bf71c6cf5d952f0e805e" @@ -3746,6 +3783,20 @@ conventional-commits-parser@^3.0.3, conventional-commits-parser@^3.0.8: through2 "^3.0.0" trim-off-newlines "^1.0.0" +conventional-recommended-bump@6.0.5: + version "6.0.5" + resolved "https://registry.yarnpkg.com/conventional-recommended-bump/-/conventional-recommended-bump-6.0.5.tgz#be7ec24b43bef57108042ea1d49758b58beabc03" + integrity sha512-srkferrB4kACPEbKYltZwX1CQZAEqbQkabKN444mavLRVMetzwJFJf23/+pwvtMsWbd+cc4HaleV1nHke0f8Rw== + dependencies: + concat-stream "^2.0.0" + conventional-changelog-preset-loader "^2.3.0" + conventional-commits-filter "^2.0.2" + conventional-commits-parser "^3.0.8" + git-raw-commits "2.0.0" + git-semver-tags "^3.0.1" + meow "^5.0.0" + q "^1.5.1" + conventional-recommended-bump@^5.0.0: version "5.0.1" resolved "https://registry.yarnpkg.com/conventional-recommended-bump/-/conventional-recommended-bump-5.0.1.tgz#5af63903947b6e089e77767601cb592cabb106ba" @@ -4338,11 +4389,21 @@ destroy@~1.0.4: resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= +detect-indent@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-6.0.0.tgz#0abd0f549f69fc6659a254fe96786186b6f528fd" + integrity sha512-oSyFlqaTHCItVRGK5RmrmjB+CmaMOW7IaNA/kdxqhoa6d17j/5ce9O9eWXmV/KEdRwqpQA+Vqe8a8Bsybu4YnA== + detect-indent@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" integrity sha1-OHHMCmoALow+Wzz38zYmRnXwa50= +detect-newline@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" + integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== + detect-newline@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" @@ -4483,6 +4544,14 @@ dotenv@^5.0.0: resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-5.0.1.tgz#a5317459bd3d79ab88cff6e44057a6a3fbb1fcef" integrity sha512-4As8uPrjfwb7VXC+WnLCbXK7y+Ueb2B3zgNCePYfhxS1PYeaO1YTeplffTEcbfLhvFNGLAz90VvJs9yomG7bow== +dotgitignore@2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/dotgitignore/-/dotgitignore-2.1.0.tgz#a4b15a4e4ef3cf383598aaf1dfa4a04bcc089b7b" + integrity sha512-sCm11ak2oY6DglEPpCB8TixLjWAxd3kJTs6UIcSasNYxXdFPV+YKlye92c8H4kKFqV5qYMIh7d+cYecEg0dIkA== + dependencies: + find-up "^3.0.0" + minimatch "^3.0.4" + dreamopt@~0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/dreamopt/-/dreamopt-0.6.0.tgz#d813ccdac8d39d8ad526775514a13dda664d6b4b" @@ -5078,6 +5147,13 @@ figgy-pudding@^3.4.1, figgy-pudding@^3.5.1: resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.1.tgz#862470112901c727a0e495a80744bd5baa1d6790" integrity sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w== +figures@3.1.0, figures@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-3.1.0.tgz#4b198dd07d8d71530642864af2d45dd9e459c4ec" + integrity sha512-ravh8VRXqHuMvZt/d8GblBeqDMkdJMBdv/2KntFH+ra5MXkO7nxNKpzQ3n6QD/2da1kH0aWmNISdvhM7gl2gVg== + dependencies: + escape-string-regexp "^1.0.5" + figures@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" @@ -5085,13 +5161,6 @@ figures@^2.0.0: dependencies: escape-string-regexp "^1.0.5" -figures@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-3.1.0.tgz#4b198dd07d8d71530642864af2d45dd9e459c4ec" - integrity sha512-ravh8VRXqHuMvZt/d8GblBeqDMkdJMBdv/2KntFH+ra5MXkO7nxNKpzQ3n6QD/2da1kH0aWmNISdvhM7gl2gVg== - dependencies: - escape-string-regexp "^1.0.5" - file-entry-cache@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" @@ -5145,6 +5214,14 @@ find-cache-dir@^3.2.0: make-dir "^3.0.0" pkg-dir "^4.1.0" +find-up@4.1.0, find-up@^4.0.0, find-up@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" + integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== + dependencies: + locate-path "^5.0.0" + path-exists "^4.0.0" + find-up@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" @@ -5167,14 +5244,6 @@ find-up@^3.0.0: dependencies: locate-path "^3.0.0" -find-up@^4.0.0, find-up@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" - integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== - dependencies: - locate-path "^5.0.0" - path-exists "^4.0.0" - flat-cache@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" @@ -5278,6 +5347,13 @@ fromentries@^1.2.0: resolved "https://registry.yarnpkg.com/fromentries/-/fromentries-1.2.0.tgz#e6aa06f240d6267f913cea422075ef88b63e7897" integrity sha512-33X7H/wdfO99GdRLLgkjUrD4geAFdq/Uv0kl3HD4da6HDixd2GUg8Mw7dahLCV9r/EARkmtYBB6Tch4EEokFTQ== +fs-access@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/fs-access/-/fs-access-1.0.1.tgz#d6a87f262271cefebec30c553407fb995da8777a" + integrity sha1-1qh/JiJxzv6+wwxVNAf7mV2od3o= + dependencies: + null-check "^1.0.0" + fs-constants@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" @@ -5460,6 +5536,14 @@ git-remote-origin-url@^2.0.0: gitconfiglocal "^1.0.0" pify "^2.3.0" +git-semver-tags@3.0.1, git-semver-tags@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-3.0.1.tgz#9cb9e4974437de1f71f32da3bfe74f4d35afb1b9" + integrity sha512-Hzd1MOHXouITfCasrpVJbRDg9uvW7LfABk3GQmXYZByerBDrfrEMP9HXpNT7RxAbieiocP6u+xq20DkvjwxnCA== + dependencies: + meow "^5.0.0" + semver "^6.0.0" + git-semver-tags@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-2.0.3.tgz#48988a718acf593800f99622a952a77c405bfa34" @@ -5468,14 +5552,6 @@ git-semver-tags@^2.0.3: meow "^4.0.0" semver "^6.0.0" -git-semver-tags@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-3.0.1.tgz#9cb9e4974437de1f71f32da3bfe74f4d35afb1b9" - integrity sha512-Hzd1MOHXouITfCasrpVJbRDg9uvW7LfABk3GQmXYZByerBDrfrEMP9HXpNT7RxAbieiocP6u+xq20DkvjwxnCA== - dependencies: - meow "^5.0.0" - semver "^6.0.0" - git-up@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/git-up/-/git-up-4.0.1.tgz#cb2ef086653640e721d2042fe3104857d89007c0" @@ -7861,7 +7937,7 @@ mkdirp-promise@^5.0.1: dependencies: mkdirp "*" -mkdirp@*, mkdirp@^1.0.0: +mkdirp@*: version "1.0.3" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.3.tgz#4cf2e30ad45959dddea53ad97d518b6c8205e1ea" integrity sha512-6uCP4Qc0sWsgMLy1EOqqS/3rjDHOEnsStVr/4vtAIK2Y5i2kA7lFFejYrpIyiN9w0pYf4ckeCYT9f1r1P9KX5g== @@ -7873,10 +7949,10 @@ mkdirp@0.x, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.1: dependencies: minimist "0.0.8" -mock-fs@^4.10.4: - version "4.10.4" - resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.10.4.tgz#4eaa3d6f7da2f44e1f3dd6b462cbbcb7b082e3d4" - integrity sha512-gDfZDLaPIvtOusbusLinfx6YSe2YpQsDT8qdP41P47dQ/NQggtkHukz7hwqgt8QvMBmAv+Z6DGmXPyb5BWX2nQ== +mock-fs@^4.11.0: + version "4.11.0" + resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.11.0.tgz#0828107e4b843a6ba855ecebfe3c6e073b69db92" + integrity sha512-Yp4o3/ZA15wsXqJTT+R+9w2AYIkD1i80Lds47wDbuUhOvQvm+O2EfjFZSz0pMgZZSPHRhGxgcd2+GL4+jZMtdw== mockery@^2.1.0: version "2.1.0" @@ -8020,15 +8096,14 @@ nise@^4.0.1: just-extend "^4.0.2" path-to-regexp "^1.7.0" -nock@^12.0.0: - version "12.0.0" - resolved "https://registry.yarnpkg.com/nock/-/nock-12.0.0.tgz#f405309bbf305d9a5bba2e9718aab4463edc9572" - integrity sha512-aTzDlXFH/Xq4m2V5x5nV13RTvYX8RXXcurCx6z4+y8IsloFMizZsDe/189GX1pSMJ99HBFZAokS5sMiMX/qfaQ== +nock@^12.0.2: + version "12.0.2" + resolved "https://registry.yarnpkg.com/nock/-/nock-12.0.2.tgz#47617b34738e026b29d2294b4579e35b27e6a4d3" + integrity sha512-pTckyfP8QHvwXP/oX+zQuSIL3S/mWTd84ba4pOGZlS/FgRZyljv4C3ZyOjgMilvkydSaERML/aJEF13EBUuDTQ== dependencies: debug "^4.1.0" json-stringify-safe "^5.0.1" lodash "^4.17.13" - mkdirp "^1.0.0" propagate "^2.0.0" node-addon-api@^1.7.1: @@ -8262,6 +8337,11 @@ nth-check@^1.0.2: dependencies: boolbase "~1.0.0" +null-check@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/null-check/-/null-check-1.0.0.tgz#977dffd7176012b9ec30d2a39db5cf72a0439edd" + integrity sha1-l33/1xdgErnsMNKjnbXPcqBDnt0= + number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" @@ -10255,16 +10335,16 @@ semver-intersect@^1.4.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== +semver@6.3.0, semver@^6.0.0, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + semver@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== -semver@^6.0.0, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - semver@^7.1.2, semver@^7.1.3: version "7.1.3" resolved "https://registry.yarnpkg.com/semver/-/semver-7.1.3.tgz#e4345ce73071c53f336445cfc19efb1c311df2a6" @@ -10667,6 +10747,27 @@ stack-utils@^1.0.1, stack-utils@^1.0.2: resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.2.tgz#33eba3897788558bebfc2db059dc158ec36cebb8" integrity sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA== +standard-version@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/standard-version/-/standard-version-7.1.0.tgz#021dd79eac749548677c876d5a94791df50f1f36" + integrity sha512-bHY2E/1tYGeVl+0XSXFivb+54h2fA4pWJocXAd6FGbtSFUvGsnfmMbIXYDxrYErpq7oEqoKreV8xTAp78WoATA== + dependencies: + chalk "2.4.2" + conventional-changelog "3.1.15" + conventional-changelog-config-spec "2.1.0" + conventional-changelog-conventionalcommits "4.2.3" + conventional-recommended-bump "6.0.5" + detect-indent "6.0.0" + detect-newline "3.1.0" + dotgitignore "2.1.0" + figures "3.1.0" + find-up "4.1.0" + fs-access "1.0.1" + git-semver-tags "3.0.1" + semver "6.3.0" + stringify-package "1.0.1" + yargs "15.0.2" + static-eval@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/static-eval/-/static-eval-2.0.3.tgz#cb62fc79946bd4d5f623a45ad428233adace4d72" @@ -10836,6 +10937,11 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" +stringify-package@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/stringify-package/-/stringify-package-1.0.1.tgz#e5aa3643e7f74d0f28628b72f3dad5cecfc3ba85" + integrity sha512-sa4DUQsYciMP1xhKWGuFM04fB0LG/9DlluZoSVywUMRNvzid6XucHK0/90xGxRoHrAaROrcHK1aPKaijCtSrhg== + strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" @@ -11479,10 +11585,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@^3.3.3, typescript@~3.8.2: - version "3.8.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.2.tgz#91d6868aaead7da74f493c553aeff76c0c0b1d5a" - integrity sha512-EgOVgL/4xfVrCMbhYKUQTdF37SQn4Iw73H5BgCrF1Abdun7Kwy/QZsE/ssAy0y4LxBbvua3PIbFsbRczWWnDdQ== +typescript@^3.3.3, typescript@^3.8.3, typescript@~3.8.3: + version "3.8.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.3.tgz#409eb8544ea0335711205869ec458ab109ee1061" + integrity sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w== typescript@~3.7.5: version "3.7.5" @@ -11709,11 +11815,16 @@ uuid@3.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== -uuid@^3.0.1, uuid@^3.3.2, uuid@^3.3.3, uuid@^3.4.0: +uuid@^3.0.1, uuid@^3.3.2, uuid@^3.3.3: version "3.4.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== +uuid@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-7.0.1.tgz#95ed6ff3d8c881cbf85f0f05cc3915ef994818ef" + integrity sha512-yqjRXZzSJm9Dbl84H2VDHpM3zMjzSJQ+hn6C4zqd5ilW+7P4ZmLEEqwho9LjP+tGuZlF4xrHQXT0h9QZUS/pWA== + v8-compile-cache@^2.0.0, v8-compile-cache@^2.0.3: version "2.1.0" resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz#e14de37b31a6d194f5690d67efc4e7f6fc6ab30e" @@ -12120,6 +12231,14 @@ yargs-parser@^16.1.0: camelcase "^5.0.0" decamelize "^1.2.0" +yargs-parser@^17.1.0: + version "17.1.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-17.1.0.tgz#b95ff3201e98b89e86070f92bef636016a0b0766" + integrity sha512-67zLl4/kWtp9eyVuxX+fHZ2Ey4ySWh0awDJlk/EtT0vzspsXbzrFsh76WjYSP3L++zhSwHQRUE3MCBe754RuEg== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + yargs-parser@^2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-2.4.1.tgz#85568de3cf150ff49fa51825f03a8c880ddcc5c4" @@ -12128,6 +12247,23 @@ yargs-parser@^2.4.1: camelcase "^3.0.0" lodash.assign "^4.0.6" +yargs@15.0.2: + version "15.0.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.0.2.tgz#4248bf218ef050385c4f7e14ebdf425653d13bd3" + integrity sha512-GH/X/hYt+x5hOat4LMnCqMd8r5Cv78heOMIJn1hr7QPPBqfeC6p89Y78+WB9yGDvfpCvgasfmWLzNzEioOUD9Q== + dependencies: + cliui "^6.0.0" + decamelize "^1.2.0" + find-up "^4.1.0" + get-caller-file "^2.0.1" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^4.2.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^16.1.0" + yargs@^13.2.2, yargs@^13.3.0: version "13.3.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.0.tgz#4c657a55e07e5f2cf947f8a366567c04a0dedc83" @@ -12161,10 +12297,10 @@ yargs@^14.0.0, yargs@^14.2.2: y18n "^4.0.0" yargs-parser "^15.0.0" -yargs@^15.0.2, yargs@^15.1.0: - version "15.1.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.1.0.tgz#e111381f5830e863a89550bd4b136bb6a5f37219" - integrity sha512-T39FNN1b6hCW4SOIk1XyTOWxtXdcen0t+XYrysQmChzSipvhBO8Bj0nK1ozAasdk24dNWuMZvr4k24nz+8HHLg== +yargs@^15.0.2, yargs@^15.1.0, yargs@^15.2.0: + version "15.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.2.0.tgz#cb9fc7f7ec429f7e9329b623f5c707a62dae506a" + integrity sha512-E+o8C37U+M7N15rBJVxr0MoInp+O7XNhMqveSGWA5uhddqs8qtkZ+uvT9FI32QML0SKidXdDONr40Xe3tDO9FA== dependencies: cliui "^6.0.0" decamelize "^1.2.0" @@ -12176,7 +12312,7 @@ yargs@^15.0.2, yargs@^15.1.0: string-width "^4.2.0" which-module "^2.0.0" y18n "^4.0.0" - yargs-parser "^16.1.0" + yargs-parser "^17.1.0" yargs@^4.7.1: version "4.8.1"