diff --git a/CHANGELOG.md b/CHANGELOG.md index 9eed37c653a89..6964e63a18106 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,50 @@ 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.37.0](https://github.com/aws/aws-cdk/compare/v1.36.0...v1.37.0) (2020-05-05) + + +### ⚠ BREAKING CHANGES + +* **amplify:** `mapSubDomain()` called with an empty string for `prefix` now +maps to the domain root. + +### Features + +* **amplify:** add SPA redirect custom rule ([#7320](https://github.com/aws/aws-cdk/issues/7320)) ([0ef9883](https://github.com/aws/aws-cdk/commit/0ef98836c0eb583556e59274a464386e7258ca8c)) +* **apigatewayv2:** http api ([#6432](https://github.com/aws/aws-cdk/issues/6432)) ([f3219c3](https://github.com/aws/aws-cdk/commit/f3219c310f8c0edbf929bfc9ef1bb7363b1506ae)), closes [#5301](https://github.com/aws/aws-cdk/issues/5301) +* **appsync:** export configured API key ([#7380](https://github.com/aws/aws-cdk/issues/7380)) ([fa8c13c](https://github.com/aws/aws-cdk/commit/fa8c13c753c0a6e195eed313d59ce74f1505cf6e)) +* **aws-fsx:** L2 construct for FSx for Lustre ([#6653](https://github.com/aws/aws-cdk/issues/6653)) ([7363912](https://github.com/aws/aws-cdk/commit/7363912eb15d05dcda7b9febdb6aa76463e305b1)) +* **cfnspec:** cloudformation spec v14.0.0 ([#7664](https://github.com/aws/aws-cdk/issues/7664)) ([fa21274](https://github.com/aws/aws-cdk/commit/fa2127487cd568d155e03e6f7b78036f857fee7c)) +* **cloudwatch:** LogGroup Query Widget ([1275952](https://github.com/aws/aws-cdk/commit/127595214fe653f6881fac84e5ee33002545e780)), closes [#3681](https://github.com/aws/aws-cdk/issues/3681) +* **codebuild:** allow taking the artifact name from the buildspec ([f7d3cd6](https://github.com/aws/aws-cdk/commit/f7d3cd6dccade93354948374a7ff435c978ad44b)), closes [#5955](https://github.com/aws/aws-cdk/issues/5955) +* **core:** move all types from "assets" to "core" ([#7708](https://github.com/aws/aws-cdk/issues/7708)) ([4a84c96](https://github.com/aws/aws-cdk/commit/4a84c960e225ad3db28e3b2ec5da5f70b3b21413)) +* **core:** move all types from "aws-cloudformation" to "core" ([#7736](https://github.com/aws/aws-cdk/issues/7736)) ([40fa93a](https://github.com/aws/aws-cdk/commit/40fa93a22ffbdf18b0563d1cef63bbf5814dcc3f)), closes [#4896](https://github.com/aws/aws-cdk/issues/4896) [#7035](https://github.com/aws/aws-cdk/issues/7035) [#7034](https://github.com/aws/aws-cdk/issues/7034) +* **core:** stack termination protection ([#7610](https://github.com/aws/aws-cdk/issues/7610)) ([7ed60b8](https://github.com/aws/aws-cdk/commit/7ed60b8a5d42e93e556e3b6e9ee3618931747ac2)), closes [#1682](https://github.com/aws/aws-cdk/issues/1682) +* **ecr:** support imageScanOnPush when creating the repository ([9df5486](https://github.com/aws/aws-cdk/commit/9df5486306fda01d963f4b1195fe8c8532cc4668)), closes [#7471](https://github.com/aws/aws-cdk/issues/7471) +* **lambda-nodejs:** use docker instead of npm package for parcel-bundler ([55c4d0b](https://github.com/aws/aws-cdk/commit/55c4d0bb35aad7b026a88cf1a38a37af9af33f9f)) + + +### Bug Fixes + +* **amplify:** cannot map branch to domain root ([#7621](https://github.com/aws/aws-cdk/issues/7621)) ([da7c508](https://github.com/aws/aws-cdk/commit/da7c508a9959dd8a04e3132abf6fe07d87537ead)), closes [#7590](https://github.com/aws/aws-cdk/issues/7590) +* **cdk-assets:** assets archiving corruption ([#7653](https://github.com/aws/aws-cdk/issues/7653)) ([f8eddb8](https://github.com/aws/aws-cdk/commit/f8eddb8ea9dca2ac68883a332b868c98008961e6)), closes [#6925](https://github.com/aws/aws-cdk/issues/6925) +* **cli:** cdk deploy cannot update stacks in REVIEW_IN_PROGRESS status ([#7731](https://github.com/aws/aws-cdk/issues/7731)) ([a52b3e3](https://github.com/aws/aws-cdk/commit/a52b3e33fcebd7534ad7cc0f8654599b3f8782b1)), closes [#6674](https://github.com/aws/aws-cdk/issues/6674) +* **cli:** CLI can't be used in Lambda Function ([0e96415](https://github.com/aws/aws-cdk/commit/0e96415ea9f365db93aa4b26e7464096b3d62af2)), closes [#7530](https://github.com/aws/aws-cdk/issues/7530) +* **cli:** CLI ignores profile in cdk.json ([#7398](https://github.com/aws/aws-cdk/issues/7398)) ([6784dc3](https://github.com/aws/aws-cdk/commit/6784dc30b77c2508fab06f461cdda72a2fc9837c)), closes [#3007](https://github.com/aws/aws-cdk/issues/3007) +* **cloudwatch:** Alarm can't use `MathExpression` without submetrics ([b59aed0](https://github.com/aws/aws-cdk/commit/b59aed01c2a7a6ddcac1cd6530f0603707594a9c)), closes [#7155](https://github.com/aws/aws-cdk/issues/7155) +* **ec2:** `new Instance` fails in lookup Vpc ([3161de8](https://github.com/aws/aws-cdk/commit/3161de872e51e25cecbbdf2b0ea18391856e87b1)), closes [#7580](https://github.com/aws/aws-cdk/issues/7580) +* **ec2:** `Vpc.fromLookup()` does not work in unit tests ([e869a0d](https://github.com/aws/aws-cdk/commit/e869a0dedc93d64141a11a7006a58eec5222fdc4)), closes [#6045](https://github.com/aws/aws-cdk/issues/6045) +* **ec2:** can't add VPN connections to a VPC progressively ([9498e05](https://github.com/aws/aws-cdk/commit/9498e057e2e4aee0649ca48bfdb906d004cb9c81)) +* **ec2:** default gateway endpoint fails without private subnets ([c475783](https://github.com/aws/aws-cdk/commit/c4757831bc5ccb8ac510694d083f17d39a423033)), closes [#7619](https://github.com/aws/aws-cdk/issues/7619) +* **ec2:** NAT instances don't route ICMP or UDP ([a93534f](https://github.com/aws/aws-cdk/commit/a93534f42cb6ecf8bdde1987f0d85919c55dbacb)), closes [#7459](https://github.com/aws/aws-cdk/issues/7459) +* **eks:** impossible to define multiple spot capacities ([be6666b](https://github.com/aws/aws-cdk/commit/be6666b0fe5743c9f8a7747768101fb86380eb38)), closes [#7136](https://github.com/aws/aws-cdk/issues/7136) [#7524](https://github.com/aws/aws-cdk/issues/7524) +* **eks:** missing required permission for fargate profile ([723813f](https://github.com/aws/aws-cdk/commit/723813faac9c999c2f3504388d0dc393b0b25b7e)), closes [#7614](https://github.com/aws/aws-cdk/issues/7614) +* **eks:** ssm path for amazon linux 2 gpu ami is invalid ([#7672](https://github.com/aws/aws-cdk/issues/7672)) ([5861d18](https://github.com/aws/aws-cdk/commit/5861d186893d1b6df27e4a200acfda63313f9da5)), closes [#6891](https://github.com/aws/aws-cdk/issues/6891) +* **iam:** principal with implicit conditions overwrite each other ([e72c353](https://github.com/aws/aws-cdk/commit/e72c3538280dc2056a8097d9e4483229d0bc0f42)), closes [#3227](https://github.com/aws/aws-cdk/issues/3227) +* **logs:** grants don't work on imported LogGroups ([5a1a929](https://github.com/aws/aws-cdk/commit/5a1a929db7eb8f7be4ad973abc1cccda1cb24d23)), closes [#7096](https://github.com/aws/aws-cdk/issues/7096) +* **rds:** Cluster does not work with imported VPC ([#7666](https://github.com/aws/aws-cdk/issues/7666)) ([95c66a7](https://github.com/aws/aws-cdk/commit/95c66a7500efd83ae4d840c97b0e7663689fe401)), closes [#6115](https://github.com/aws/aws-cdk/issues/6115) + ## [1.36.1](https://github.com/aws/aws-cdk/compare/v1.36.0...v1.36.1) (2020-04-29) ### Bug Fixes diff --git a/lerna.json b/lerna.json index 510e213d60b6d..14f1468830097 100644 --- a/lerna.json +++ b/lerna.json @@ -10,5 +10,5 @@ "tools/*" ], "rejectCycles": "true", - "version": "1.36.1" + "version": "1.37.0" } diff --git a/packages/@aws-cdk/aws-cloudformation/test/integ.core-custom-resources.ts b/packages/@aws-cdk/aws-cloudformation/test/integ.core-custom-resources.ts index 8c00b705f008f..2c219f757825d 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/integ.core-custom-resources.ts +++ b/packages/@aws-cdk/aws-cloudformation/test/integ.core-custom-resources.ts @@ -1,3 +1,11 @@ +/* + * Stack verification steps: + * - Deploy with `--no-clean` + * - Verify that the CloudFormation stack outputs have the following values: + * - Ref: "MyPhysicalReflectBack" + * - GetAtt.Attribute1: "foo" + * - GetAtt.Attribute2: 1234 + */ import { App, CfnOutput, Construct, CustomResource, CustomResourceProvider, CustomResourceProviderRuntime, Stack, Token } from '@aws-cdk/core'; class TestStack extends Stack { diff --git a/packages/@aws-cdk/core/README.md b/packages/@aws-cdk/core/README.md index 966857aadb36c..db0bc2dd54a5d 100644 --- a/packages/@aws-cdk/core/README.md +++ b/packages/@aws-cdk/core/README.md @@ -256,6 +256,19 @@ various provider types (ordered from low-level to high-level): | [core.CustomResourceProvider](#the-corecustomresourceprovider-class) | Lambda | Auto | Auto | 15min | Node.js | Small | | [custom-resources.Provider](#the-custom-resource-provider-framework) | Lambda | Auto | Auto | Unlimited Async | Any | Large | +Legend: + +- **Compute type**: which type of compute can is used to execute the handler. +- **Error Handling**: whether errors thrown by handler code are automatically + trapped and a FAILED response is submitted to CloudFormation. If this is + "Manual", developers must take care of trapping errors. Otherwise, events + could cause stacks to hang. +- **Submit to CloudFormation**: whether the framework takes care of submitting + SUCCESS/FAILED responses to CloudFormation through the event's response URL. +- **Max Timeout**: maximum allows/possible timeout. +- **Language**: which programming languages can be used to implement handlers. +- **Footprint**: how many resources are used by the provider framework itself. + **A NOTE ABOUT SINGLETONS** When defining resources for a custom resource provider, you will likely want to @@ -327,7 +340,7 @@ The provider has a built-in singleton method which uses the resource type as a stack-unique identifier and returns the service token: ```ts -const serviceToken = CustomResourceProvider.getOrCreate(this, 'Custom::MyCustomResourceType';, { +const serviceToken = CustomResourceProvider.getOrCreate(this, 'Custom::MyCustomResourceType', { codeDirectory: `${__dirname}/my-handler`, runtime: CustomResourceProviderRuntime.NODEJS_12, // currently the only supported runtime }); @@ -368,7 +381,8 @@ exports.handler = async function(event) { // defaults to "event.PhysicalResourceId" or "event.RequestId" PhysicalResourceId: "REF", - // (optional) the values resolved from `resource.getAtt("KEY")` + // (optional) calling `resource.getAtt("Att1")` on the custom resource in the CDK app + // will return the value "BAR". Data: { Att1: "BAR", Att2: "BAZ" diff --git a/packages/@aws-cdk/core/lib/custom-resource-provider/custom-resource-provider.ts b/packages/@aws-cdk/core/lib/custom-resource-provider/custom-resource-provider.ts index d3e13cf1d959f..8b24d068235f9 100644 --- a/packages/@aws-cdk/core/lib/custom-resource-provider/custom-resource-provider.ts +++ b/packages/@aws-cdk/core/lib/custom-resource-provider/custom-resource-provider.ts @@ -80,7 +80,7 @@ export class CustomResourceProvider extends Construct { * Returns a stack-level singleton ARN (service token) for the custom resource * provider. * - * @param stack The stack in which this provider + * @param scope Construct scope * @param uniqueid A globally unique id that will be used for the stack-level * construct. * @param props Provider properties which will only be applied when the diff --git a/packages/@aws-cdk/core/test/custom-resource-provider-fixture/index.ts b/packages/@aws-cdk/core/test/custom-resource-provider/mock-provider/index.ts similarity index 100% rename from packages/@aws-cdk/core/test/custom-resource-provider-fixture/index.ts rename to packages/@aws-cdk/core/test/custom-resource-provider/mock-provider/index.ts diff --git a/packages/@aws-cdk/core/test/test.custom-resource-provider.ts b/packages/@aws-cdk/core/test/custom-resource-provider/test.custom-resource-provider.ts similarity index 97% rename from packages/@aws-cdk/core/test/test.custom-resource-provider.ts rename to packages/@aws-cdk/core/test/custom-resource-provider/test.custom-resource-provider.ts index a757a175d1d6d..99c8fb12d4e70 100644 --- a/packages/@aws-cdk/core/test/test.custom-resource-provider.ts +++ b/packages/@aws-cdk/core/test/custom-resource-provider/test.custom-resource-provider.ts @@ -1,10 +1,10 @@ import * as fs from 'fs'; import { Test } from 'nodeunit'; import * as path from 'path'; -import { CustomResourceProvider, CustomResourceProviderRuntime, Duration, Size, Stack } from '../lib'; -import { toCloudFormation } from './util'; +import { CustomResourceProvider, CustomResourceProviderRuntime, Duration, Size, Stack } from '../../lib'; +import { toCloudFormation } from '../util'; -const TEST_HANDLER = `${__dirname}/custom-resource-provider-fixture`; +const TEST_HANDLER = `${__dirname}/mock-provider`; export = { 'minimal configuration'(test: Test) { diff --git a/packages/@aws-cdk/core/test/test.custom-resource-provider-handler.ts b/packages/@aws-cdk/core/test/custom-resource-provider/test.nodejs-entrypoint.ts similarity index 98% rename from packages/@aws-cdk/core/test/test.custom-resource-provider-handler.ts rename to packages/@aws-cdk/core/test/custom-resource-provider/test.nodejs-entrypoint.ts index 6bb70d4fba2f6..87935b7d93599 100644 --- a/packages/@aws-cdk/core/test/test.custom-resource-provider-handler.ts +++ b/packages/@aws-cdk/core/test/custom-resource-provider/test.nodejs-entrypoint.ts @@ -5,7 +5,7 @@ import { Test } from 'nodeunit'; import * as os from 'os'; import * as path from 'path'; import * as url from 'url'; -import * as entrypoint from '../lib/custom-resource-provider/nodejs-entrypoint'; +import * as entrypoint from '../../lib/custom-resource-provider/nodejs-entrypoint'; export = { 'handler return value is sent back to cloudformation as a success response': { diff --git a/packages/@aws-cdk/core/test/integration.custom-resources.readme b/packages/@aws-cdk/core/test/integration.custom-resources.readme new file mode 100644 index 0000000000000..bc1e807e01237 --- /dev/null +++ b/packages/@aws-cdk/core/test/integration.custom-resources.readme @@ -0,0 +1,5 @@ ++--------------------------------------------------------------------------+ +| Since cdk-integ depends on cdk which depends on @aws-cdk/core (as a "dev | +| dependency"), this integration test has been added to the package | +| @aws-cdk/aws-cloudformation under `test/integ.core-custom-resources.ts` | ++--------------------------------------------------------------------------+