Skip to content

Commit 789f2dc

Browse files
authored
2 parents 9578a49 + 36a1c3f commit 789f2dc

File tree

760 files changed

+15767
-12343
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

760 files changed

+15767
-12343
lines changed

CHANGELOG.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,61 @@
22

33
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.
44

5+
## [1.140.0](https://github.com/aws/aws-cdk/compare/v1.139.0...v1.140.0) (2022-01-20)
6+
7+
8+
### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES
9+
10+
* **apigatewayv2:** `HttpIntegrationType.LAMBDA_PROXY` has been renamed to `HttpIntegrationType.AWS_PROXY`
11+
* **iot:** the class `FirehoseStreamAction` has been renamed to `FirehosePutRecordAction`
12+
13+
### Features
14+
15+
* **apigatewayv2:** HttpRouteIntegration supports AWS services integrations ([#18154](https://github.com/aws/aws-cdk/issues/18154)) ([a8094c7](https://github.com/aws/aws-cdk/commit/a8094c7d9970557077f560ccd24882216094ee3c)), closes [#16287](https://github.com/aws/aws-cdk/issues/16287)
16+
* **apigatewayv2:** support for mock integration type ([#18129](https://github.com/aws/aws-cdk/issues/18129)) ([7779c14](https://github.com/aws/aws-cdk/commit/7779c147c7445d9e8ccafa9b732521c9021a6234)), closes [#15008](https://github.com/aws/aws-cdk/issues/15008)
17+
* **apigatewayv2:** websocket api: api keys ([#16636](https://github.com/aws/aws-cdk/issues/16636)) ([24f8f74](https://github.com/aws/aws-cdk/commit/24f8f74ebec023f5e3f5bd2bdfc89575a53b38f3))
18+
* **assertions:** `stringLikeRegexp()` matcher ([#18491](https://github.com/aws/aws-cdk/issues/18491)) ([b49b002](https://github.com/aws/aws-cdk/commit/b49b002e40f5b901935f52827f417bb3851badc2))
19+
* **assertions:** support for parameters ([#18469](https://github.com/aws/aws-cdk/issues/18469)) ([d0d6fc5](https://github.com/aws/aws-cdk/commit/d0d6fc520491351b44cac78aa90284c82a9499b2)), closes [#16720](https://github.com/aws/aws-cdk/issues/16720)
20+
* **aws-neptune:** add autoMinorVersionUpgrade to cluster props ([#18394](https://github.com/aws/aws-cdk/issues/18394)) ([8b5320a](https://github.com/aws/aws-cdk/commit/8b5320ac5e5c320db46bc74f33b3841977dd3a5d)), closes [#17545](https://github.com/aws/aws-cdk/issues/17545)
21+
* **aws-s3:** support number of newer versions to retain in lifecycle policy ([#18225](https://github.com/aws/aws-cdk/issues/18225)) ([e1731b1](https://github.com/aws/aws-cdk/commit/e1731b11c9417a9a4d6cf0f2089c62a721e8d074)), closes [#17996](https://github.com/aws/aws-cdk/issues/17996) [#17996](https://github.com/aws/aws-cdk/issues/17996)
22+
* **cfnspec:** cloudformation spec v53.0.0 ([#18468](https://github.com/aws/aws-cdk/issues/18468)) ([50637e0](https://github.com/aws/aws-cdk/commit/50637e08590c2051d9a1e446ee7ded47e85d02b3))
23+
* **cfnspec:** cloudformation spec v53.0.0 ([#18480](https://github.com/aws/aws-cdk/issues/18480)) ([38e1fe4](https://github.com/aws/aws-cdk/commit/38e1fe42d8b30d6afaf4a3ccc90dd15d6a5d8255))
24+
* **cfnspec:** cloudformation spec v53.0.0 ([#18524](https://github.com/aws/aws-cdk/issues/18524)) ([517d517](https://github.com/aws/aws-cdk/commit/517d517a0bb3f7f6e98538dca736086b86b206c8))
25+
* **cfnspec:** cloudformation spec v53.0.0 ([#18551](https://github.com/aws/aws-cdk/issues/18551)) ([926310b](https://github.com/aws/aws-cdk/commit/926310bace65a763972d56c0df5730cdc44f8f82))
26+
* **cli:** support hotswapping Lambda functions that use Docker images ([#18319](https://github.com/aws/aws-cdk/issues/18319)) ([6b553b7](https://github.com/aws/aws-cdk/commit/6b553b7f84e5cde8a1fc533af95ad440c020e834)), closes [#18302](https://github.com/aws/aws-cdk/issues/18302) [#18408](https://github.com/aws/aws-cdk/issues/18408)
27+
* **cli:** support hotswapping Lambda functions with inline code ([#18408](https://github.com/aws/aws-cdk/issues/18408)) ([d0b8512](https://github.com/aws/aws-cdk/commit/d0b8512449759bf74bb53aabbb6d5224b5f8c5ae)), closes [#18319](https://github.com/aws/aws-cdk/issues/18319)
28+
* **cli:** watch streams resources' CloudWatch logs to the terminal ([#18159](https://github.com/aws/aws-cdk/issues/18159)) ([a9038ae](https://github.com/aws/aws-cdk/commit/a9038ae9c7d9b15b89ae24cfa24aefa6012674bc)), closes [#18122](https://github.com/aws/aws-cdk/issues/18122)
29+
* **cognito:** identity pools ([#16190](https://github.com/aws/aws-cdk/issues/16190)) ([59fe395](https://github.com/aws/aws-cdk/commit/59fe395a5adcd35bd59c6d9c74f4a2606aec88b0))
30+
* **ec2:** add Hpc6a instances ([#18445](https://github.com/aws/aws-cdk/issues/18445)) ([c7f39ca](https://github.com/aws/aws-cdk/commit/c7f39ca97874c1d8d5286ab347a97fc458547830))
31+
* **ec2:** add support for al2022 and amzn2 with kernel 5.x ([#18117](https://github.com/aws/aws-cdk/issues/18117)) ([6b73d1d](https://github.com/aws/aws-cdk/commit/6b73d1d3d0ac05042c1e43a64068938138fe8421))
32+
* **ec2:** create Peers via security group ids ([#18248](https://github.com/aws/aws-cdk/issues/18248)) ([9d1b2c7](https://github.com/aws/aws-cdk/commit/9d1b2c7b1f0147089f912c32a61d7ba86edb543c)), closes [#7111](https://github.com/aws/aws-cdk/issues/7111)
33+
* **ecs-service-extensions:** Enable default logging to CloudWatch for extensions (under feature flag) ([#17817](https://github.com/aws/aws-cdk/issues/17817)) ([06666f4](https://github.com/aws/aws-cdk/commit/06666f4727b9745d001bc20f027b535538bb8250))
34+
* **iot:** add Action to put record to Kinesis Data stream ([#18321](https://github.com/aws/aws-cdk/issues/18321)) ([1480213](https://github.com/aws/aws-cdk/commit/1480213a032549ab7319e0c3a66e02e9b6a9c4ab)), closes [#17703](https://github.com/aws/aws-cdk/issues/17703)
35+
* **lambda-nodejs:** ES modules ([#18346](https://github.com/aws/aws-cdk/issues/18346)) ([e23b63f](https://github.com/aws/aws-cdk/commit/e23b63fc106c4781e3dd39a16d4a3e3c81bdd874)), closes [#13274](https://github.com/aws/aws-cdk/issues/13274)
36+
* **opensearch:** added opensearch 1.1 to engineversion ([#18432](https://github.com/aws/aws-cdk/issues/18432)) ([e01a57a](https://github.com/aws/aws-cdk/commit/e01a57aa3085a8282123afbc3583b1b78a075c9a)), closes [#18431](https://github.com/aws/aws-cdk/issues/18431)
37+
38+
39+
### Bug Fixes
40+
41+
* **apigateway:** `enabled` property of `ApiKeyProps` is ignored ([#18407](https://github.com/aws/aws-cdk/issues/18407)) ([c31f9b4](https://github.com/aws/aws-cdk/commit/c31f9b44165f872f8dd51605e00f4801ed611d4d))
42+
* **applicationautoscaling:** typo in `DYANMODB_WRITE_CAPACITY_UTILIZATION` ([#18085](https://github.com/aws/aws-cdk/issues/18085)) ([626e6aa](https://github.com/aws/aws-cdk/commit/626e6aa1a27feffe7ce60a46a6fdcf26f317eaef)), closes [#17209](https://github.com/aws/aws-cdk/issues/17209)
43+
* **assertions:** object partiality is dropped passing through arrays ([#18525](https://github.com/aws/aws-cdk/issues/18525)) ([eb29e6f](https://github.com/aws/aws-cdk/commit/eb29e6ff0308eb320ec772cc35cdbf781168198e))
44+
* **cli:** `cdk watch` constantly prints 'messages suppressed' ([#18486](https://github.com/aws/aws-cdk/issues/18486)) ([9b266f4](https://github.com/aws/aws-cdk/commit/9b266f49643d058709771892f908f1c2ae248f95)), closes [#18451](https://github.com/aws/aws-cdk/issues/18451)
45+
* **cli:** warning to upgrade to bootstrap version >= undefined ([#18489](https://github.com/aws/aws-cdk/issues/18489)) ([da5a305](https://github.com/aws/aws-cdk/commit/da5a305875f0b82b896861be3fcb12fddaa0cc7b))
46+
* **ec2:** interface endpoints do not work with `Vpc.fromLookup()` ([#18554](https://github.com/aws/aws-cdk/issues/18554)) ([f55cd2b](https://github.com/aws/aws-cdk/commit/f55cd2bd86405cc61d3eb24c2b827c2cd133363d)), closes [#17600](https://github.com/aws/aws-cdk/issues/17600)
47+
* **ec2:** launch template names in imdsv2 not unique across stacks (under feature flag) ([#17766](https://github.com/aws/aws-cdk/issues/17766)) ([2a80e4b](https://github.com/aws/aws-cdk/commit/2a80e4b113bac0716f5aa1d4806e425759da1743))
48+
* **ecs:** respect LogGroup's region for aws-log-driver ([#18212](https://github.com/aws/aws-cdk/issues/18212)) ([b6e3e51](https://github.com/aws/aws-cdk/commit/b6e3e517ac42b7951bc4ca4c1fd62422e3b49092)), closes [#17747](https://github.com/aws/aws-cdk/issues/17747)
49+
* **elbv2:** BaseLoadBalancer.vpc is not optional ([#18474](https://github.com/aws/aws-cdk/issues/18474)) ([f511c17](https://github.com/aws/aws-cdk/commit/f511c17aac8ca4d3fa94ace051d9946dc23f40a3)), closes [aws/jsii#3342](https://github.com/aws/jsii/issues/3342)
50+
* **iot:** `FirehoseStreamAction` is now called `FirehosePutRecordAction` ([#18356](https://github.com/aws/aws-cdk/issues/18356)) ([c016a9f](https://github.com/aws/aws-cdk/commit/c016a9fcf51f2415e6e0fcca2255da384c8abbc1)), closes [/github.com/aws/aws-cdk/pull/18321#discussion_r781620195](https://github.com/aws//github.com/aws/aws-cdk/pull/18321/issues/discussion_r781620195)
51+
* **pipelines:** "Maximum schema version supported" error ([#18404](https://github.com/aws/aws-cdk/issues/18404)) ([a684ff4](https://github.com/aws/aws-cdk/commit/a684ff47d56038a94c82cdbad9588da939963351)), closes [#18370](https://github.com/aws/aws-cdk/issues/18370)
52+
* **pipelines:** graphnode dependencies can have duplicates ([#18450](https://github.com/aws/aws-cdk/issues/18450)) ([2b0b5ea](https://github.com/aws/aws-cdk/commit/2b0b5ea5db7ce8103a641c1267b1c213453ac145))
53+
* **secretsmanager:** Secret requires KMS key for some same-account access ([#17812](https://github.com/aws/aws-cdk/issues/17812)) ([91f3539](https://github.com/aws/aws-cdk/commit/91f3539f4aa8383adcb2273790ddb469fb1274a6)), closes [#15450](https://github.com/aws/aws-cdk/issues/15450)
54+
55+
56+
### Reverts
57+
58+
* **s3:** add EventBridge bucket notifications ([#18150](https://github.com/aws/aws-cdk/issues/18150)) ([#18507](https://github.com/aws/aws-cdk/issues/18507)) ([2041278](https://github.com/aws/aws-cdk/commit/204127862d5fb1d2e6dd573a1621254e52eca4aa))
59+
560
## [1.139.0](https://github.com/aws/aws-cdk/compare/v1.138.2...v1.139.0) (2022-01-11)
661

762

CONTRIBUTING.md

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ let us know if it's not up-to-date (even better, submit a PR with your correcti
4646

4747
The following steps describe how to set up the AWS CDK repository on your local machine.
4848
The alternative is to use [Gitpod](https://www.gitpod.io/), a Cloud IDE for your development.
49-
See [Gitpod section](#gitpod) on how to set up the CDK repo on Gitpod.
49+
See [Gitpod section](#gitpod-alternative) on how to set up the CDK repo on Gitpod.
5050

5151
### Setup
5252

@@ -69,7 +69,7 @@ $ yarn install
6969
```
7070

7171
We recommend that you use [Visual Studio Code](https://code.visualstudio.com/) to work on the CDK.
72-
We use `eslint` to keep our code consistent in terms of style and reducing defects. We recommend installing the
72+
We use `eslint` to keep our code consistent in terms of style and reducing defects. We recommend installing
7373
the [eslint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) as well.
7474

7575
### Repo Layout
@@ -726,7 +726,7 @@ these directories.
726726
### Linking against this repository
727727

728728
If you are developing your own CDK application or library and want to use the locally checked out version of the
729-
AWS CDK, instead of the the version of npm, the `./link-all.sh` script will help here.
729+
AWS CDK, instead of the version of npm, the `./link-all.sh` script will help here.
730730

731731
This script symlinks the built modules from the local AWS CDK repo under the `node_modules/` folder of the CDK app or
732732
library.
@@ -803,35 +803,17 @@ The pattern is simple:
803803
with the name of the context key that **enables** this new feature (for
804804
example, `ENABLE_STACK_NAME_DUPLICATES`). The context key should be in the
805805
form `module.Type:feature` (e.g. `@aws-cdk/core:enableStackNameDuplicates`).
806-
2. Use `node.tryGetContext(cxapi.ENABLE_XXX)` to check if this feature is enabled
806+
2. Use `FeatureFlags.of(construct).isEnabled(cxapi.ENABLE_XXX)` to check if this feature is enabled
807807
in your code. If it is not defined, revert to the legacy behavior.
808808
3. Add your feature flag to the `FUTURE_FLAGS` map in
809809
[cx-api/lib/features.ts](https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/cx-api/lib/features.ts).
810810
This map is inserted to generated `cdk.json` files for new projects created
811811
through `cdk init`.
812-
4. In your PR title (which goes into CHANGELOG), add a `(under feature flag)` suffix. e.g:
812+
4. In your tests, use the `testFutureBehavior` and `testLegacyBehavior` [jest helper methods] to test the enabled and disabled behavior.
813+
5. In your PR title (which goes into CHANGELOG), add a `(under feature flag)` suffix. e.g:
813814

814815
`fix(core): impossible to use the same physical stack name for two stacks (under feature flag)`
815816

816-
In the [next major version of the
817-
CDK](https://github.com/aws/aws-cdk/issues/3398) we will either remove the
818-
legacy behavior or flip the logic for all these features and then
819-
reset the `FEATURE_FLAGS` map for the next cycle.
820-
821-
### Feature Flags - CDKv2
822-
823-
We have started working on the next version of the CDK, specifically CDKv2. This is currently being maintained
824-
on a separate branch `v2-main` whereas `master` continues to track versions `1.x`.
825-
826-
Feature flags introduced in the CDK 1.x and removed in 2.x, must be added to the `FUTURE_FLAGS_EXPIRED` list in
827-
[cx-api/lib/features.ts](https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/cx-api/lib/features.ts)
828-
on the `v2-main` branch.
829-
This will make the default behaviour in CDKv2 as if the flag is enabled and also prevents users from disabling
830-
the feature flag.
831-
832-
A couple of [jest helper methods] are available for use with unit tests. These help run unit tests that test
833-
behaviour when flags are enabled or disabled in the two major versions.
834-
835817
[jest helper methods]: https://github.com/aws/aws-cdk/blob/master/tools/@aws-cdk/cdk-build-tools/lib/feature-flag.ts
836818

837819
## Versioning and Release

allowed-breaking-changes.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,14 @@ removed:@aws-cdk/aws-lambda-event-sources.SelfManagedKafkaEventSourceProps.retry
115115
removed:@aws-cdk/aws-lambda-event-sources.SelfManagedKafkaEventSourceProps.tumblingWindow
116116
base-types:@aws-cdk/aws-lambda-event-sources.KafkaEventSourceProps
117117
base-types:@aws-cdk/aws-lambda-event-sources.ManagedKafkaEventSourceProps
118-
base-types:@aws-cdk/aws-lambda-event-sources.SelfManagedKafkaEventSourceProps
118+
base-types:@aws-cdk/aws-lambda-event-sources.SelfManagedKafkaEventSourceProps
119+
120+
# fixed vpc property of BaseLoadBalancer so it correctly implements I(Application|Network)LoadBalancer (i.e: must be optional)
121+
changed-type:@aws-cdk/aws-elasticloadbalancingv2.ApplicationLoadBalancer.vpc
122+
changed-type:@aws-cdk/aws-elasticloadbalancingv2.BaseLoadBalancer.vpc
123+
changed-type:@aws-cdk/aws-elasticloadbalancingv2.NetworkLoadBalancer.vpc
124+
125+
# removed methods and properties related to event bridge notifications for S3 buckets as they are not yet supported (19 Jan 2022)
126+
removed:@aws-cdk/aws-s3.Bucket.enableEventBridgeNotification
127+
removed:@aws-cdk/aws-s3.BucketBase.enableEventBridgeNotification
128+
removed:@aws-cdk/aws-s3.BucketProps.eventBridgeEnabled

buildspec.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ phases:
2727
- /bin/bash ./scripts/transform.sh
2828
post_build:
2929
commands:
30+
# Short-circuit: Don't run pack if the above build failed.
31+
- '[ ${CODEBUILD_BUILD_SUCCEEDING:-0} -eq 1 ] || exit 1'
3032
- "[ -f .BUILD_COMPLETED ] && /bin/bash ./pack.sh"
3133
- /bin/bash ./scripts/cache-store.sh
3234
artifacts:

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
},
1717
"devDependencies": {
1818
"@yarnpkg/lockfile": "^1.1.0",
19-
"cdk-generate-synthetic-examples": "^0.1.1",
19+
"cdk-generate-synthetic-examples": "^0.1.3",
2020
"conventional-changelog-cli": "^2.2.2",
2121
"fs-extra": "^9.1.0",
2222
"graceful-fs": "^4.2.9",
2323
"jest-junit": "^13.0.0",
24-
"jsii-diff": "^1.50.0",
25-
"jsii-pacmak": "^1.50.0",
26-
"jsii-reflect": "^1.50.0",
27-
"jsii-rosetta": "^1.50.0",
24+
"jsii-diff": "^1.52.1",
25+
"jsii-pacmak": "^1.52.1",
26+
"jsii-reflect": "^1.52.1",
27+
"jsii-rosetta": "^1.52.1",
2828
"lerna": "^4.0.0",
2929
"patch-package": "^6.4.7",
3030
"standard-version": "^9.3.2",
@@ -123,8 +123,8 @@
123123
"aws-cdk-lib/@balena/dockerignore/**",
124124
"aws-cdk-lib/case",
125125
"aws-cdk-lib/case/**",
126-
"aws-cdk-lib/colors",
127-
"aws-cdk-lib/colors/**",
126+
"aws-cdk-lib/chalk",
127+
"aws-cdk-lib/chalk/**",
128128
"aws-cdk-lib/diff",
129129
"aws-cdk-lib/diff/**",
130130
"aws-cdk-lib/fast-deep-equal",
@@ -151,8 +151,8 @@
151151
"monocdk/@balena/dockerignore/**",
152152
"monocdk/case",
153153
"monocdk/case/**",
154-
"monocdk/colors",
155-
"monocdk/colors/**",
154+
"monocdk/chalk",
155+
"monocdk/chalk/**",
156156
"monocdk/diff",
157157
"monocdk/diff/**",
158158
"monocdk/fast-deep-equal",
@@ -180,4 +180,4 @@
180180
"dependencies": {
181181
"string-width": "^4.2.3"
182182
}
183-
}
183+
}

packages/@aws-cdk-containers/ecs-service-extensions/README.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,43 @@ nameDescription.add(new Container({
109109
Every `ServiceDescription` requires at minimum that you add a `Container` extension
110110
which defines the main application (essential) container to run for the service.
111111

112-
After that, you can optionally enable additional features for the service using the `ServiceDescription.add()` method:
112+
### Logging using `awslogs` log driver
113+
114+
If no observability extensions have been configured for a service, the ECS Service Extensions configures an `awslogs` log driver for the application container of the service to send the container logs to CloudWatch Logs.
115+
116+
You can either provide a log group to the `Container` extension or one will be created for you by the CDK.
117+
118+
Following is an example of an application with an `awslogs` log driver configured for the application container:
119+
120+
```ts
121+
const environment = new Environment(stack, 'production');
122+
123+
const nameDescription = new ServiceDescription();
124+
nameDescription.add(new Container({
125+
cpu: 1024,
126+
memoryMiB: 2048,
127+
trafficPort: 80,
128+
image: ContainerImage.fromRegistry('nathanpeck/name'),
129+
environment: {
130+
PORT: '80',
131+
},
132+
logGroup: new awslogs.LogGroup(stack, 'MyLogGroup'),
133+
}));
134+
```
135+
136+
If a log group is not provided, no observability extensions have been created, and the `ECS_SERVICE_EXTENSIONS_ENABLE_DEFAULT_LOG_DRIVER` feature flag is enabled, then logging will be configured by default and a log group will be created for you.
137+
138+
The `ECS_SERVICE_EXTENSIONS_ENABLE_DEFAULT_LOG_DRIVER` feature flag is enabled by default in any CDK apps that are created with CDK v1.140.0 or v2.8.0 and later.
139+
140+
To enable default logging for previous versions, ensure that the `ECS_SERVICE_EXTENSIONS_ENABLE_DEFAULT_LOG_DRIVER` flag within the application stack context is set to true, like so:
141+
142+
```ts
143+
stack.node.setContext(cxapi.ECS_SERVICE_EXTENSIONS_ENABLE_DEFAULT_LOG_DRIVER, true);
144+
```
145+
146+
Alternatively, you can also set the feature flag in the `cdk.json` file. For more information, refer the [docs](https://docs.aws.amazon.com/cdk/v2/guide/featureflags.html).
147+
148+
After adding the `Container` extension, you can optionally enable additional features for the service using the `ServiceDescription.add()` method:
113149

114150
```ts
115151
nameDescription.add(new AppMeshExtension({ mesh }));

0 commit comments

Comments
 (0)