Skip to content

Commit c145314

Browse files
authored
2 parents 2b474b9 + d48d64d commit c145314

File tree

161 files changed

+3940
-4275
lines changed

Some content is hidden

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

161 files changed

+3940
-4275
lines changed

.mergify.yml

+4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ pull_request_rules:
1919
commit_message: title+body
2020
conditions:
2121
- base!=release
22+
- -base~=^v2
2223
- -title~=(WIP|wip)
2324
- -label~=(blocked|do-not-merge|no-squash|two-approvers)
2425
- -merged
@@ -41,6 +42,7 @@ pull_request_rules:
4142
commit_message: title+body
4243
conditions:
4344
- base!=release
45+
- -base~=^v2
4446
- -title~=(WIP|wip)
4547
- label~=two-approvers
4648
- -label~=(blocked|do-not-merge|no-squash)
@@ -64,6 +66,7 @@ pull_request_rules:
6466
strict_method: merge
6567
commit_message: title+body
6668
conditions:
69+
- -base~=^v2
6770
- -title~=(WIP|wip)
6871
- -label~=(blocked|do-not-merge)
6972
# Only if no-squash is set
@@ -129,6 +132,7 @@ pull_request_rules:
129132
strict_method: merge
130133
commit_message: title+body
131134
conditions:
135+
- base=v2-main
132136
- label~=forward-merge
133137
- -label~=(blocked|do-not-merge)
134138
- -merged

CHANGELOG.md

+24
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,30 @@
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.70.0](https://github.com/aws/aws-cdk/compare/v1.69.0...v1.70.0) (2020-10-23)
6+
7+
8+
### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES
9+
10+
* **cognito:** the `UserPoolIdentityProviderBase` abstract class has been removed. Use the `UserPoolIdentityProvider*` classes directly.
11+
12+
### Features
13+
14+
* **cloudfront:** brotli compression support ([#10950](https://github.com/aws/aws-cdk/issues/10950)) ([dd81e77](https://github.com/aws/aws-cdk/commit/dd81e77e6ad606c2e76e01de1c7d38b762357d26)), closes [#10947](https://github.com/aws/aws-cdk/issues/10947)
15+
* **cloudfront-origins:** move cloudfront-origins to Developer Preview ([#11005](https://github.com/aws/aws-cdk/issues/11005)) ([6956aad](https://github.com/aws/aws-cdk/commit/6956aadd6043499d8d55ca2d1a8ee65a91ac1bc6)), closes [#10831](https://github.com/aws/aws-cdk/issues/10831)
16+
* **codebuild:** add COMMIT_MESSAGE support for webhook FilterGroup ([#11011](https://github.com/aws/aws-cdk/issues/11011)) ([fd8bce3](https://github.com/aws/aws-cdk/commit/fd8bce3d1409fd66877ca7530f8e74d9d78e0b8a)), closes [#9033](https://github.com/aws/aws-cdk/issues/9033)
17+
* **cognito:** Cognito User Pools is now in Generally Available (stable) ([#11003](https://github.com/aws/aws-cdk/issues/11003)) ([7435db8](https://github.com/aws/aws-cdk/commit/7435db853636628a60c8aa465481fc01136aa4a1))
18+
* **events-targets:** add support for Kinesis Firehose as a target ([#10400](https://github.com/aws/aws-cdk/issues/10400)) ([b93cda6](https://github.com/aws/aws-cdk/commit/b93cda6f528e0e1d98b88ad8407620b8ef472125)), closes [#10349](https://github.com/aws/aws-cdk/issues/10349)
19+
* **lambda-event-sources:** disable source mapping ([#10927](https://github.com/aws/aws-cdk/issues/10927)) ([f4f53a6](https://github.com/aws/aws-cdk/commit/f4f53a65e55d895338aecf8cb63637c6d265b929)), closes [#5750](https://github.com/aws/aws-cdk/issues/5750)
20+
21+
22+
### Bug Fixes
23+
24+
* **cloudfront:** logging bucket uses global domain name ([#10945](https://github.com/aws/aws-cdk/issues/10945)) ([aa3f3fd](https://github.com/aws/aws-cdk/commit/aa3f3fdc92545157205e533e124412d0db08c575)), closes [#10923](https://github.com/aws/aws-cdk/issues/10923)
25+
* **lambda-nodejs:** docker build is not working ([#10885](https://github.com/aws/aws-cdk/issues/10885)) ([191d7b7](https://github.com/aws/aws-cdk/commit/191d7b7706282812878e1aeed79d8f4b39d1f797)), closes [#10881](https://github.com/aws/aws-cdk/issues/10881)
26+
* **ses-actions:** invalid action in policy statement created when using SES S3 action ([#11061](https://github.com/aws/aws-cdk/issues/11061)) ([5dc1d96](https://github.com/aws/aws-cdk/commit/5dc1d96e77ec2359a77aed7266c4e7769d04e084))
27+
* **cognito:** reorganize identity providers structure so that UserPoolIdentityProviderBase is not exported ([#10925](https://github.com/aws/aws-cdk/issues/10925)) ([60f493c](https://github.com/aws/aws-cdk/commit/60f493c9a606162816c14149ea578341ea458a05))
28+
529
## [1.69.0](https://github.com/aws/aws-cdk/compare/v1.68.0...v1.69.0) (2020-10-19)
630

731

lerna.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
"tools/*"
1212
],
1313
"rejectCycles": "true",
14-
"version": "1.69.0"
14+
"version": "1.70.0"
1515
}

packages/@aws-cdk-containers/ecs-service-extensions/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"cdk-build-tools": "0.0.0",
4141
"cdk-integ-tools": "0.0.0",
4242
"cfn2ts": "0.0.0",
43-
"jest": "^25.5.4",
43+
"jest": "^26.6.0",
4444
"nodeunit": "^0.11.3",
4545
"pkglint": "0.0.0"
4646
},

packages/@aws-cdk/app-delivery/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aw
1717
# Replacement recommended
1818

1919
This library has been deprecated. We recommend you use the
20-
[@aws-cdk/pipelines](https://docs.aws.amazon.com/cdk/api/latest/docs/pipelines.html) module instead.
20+
[@aws-cdk/pipelines](https://docs.aws.amazon.com/cdk/api/latest/docs/pipelines-readme.html) module instead.
2121

2222

2323
### Limitations

packages/@aws-cdk/app-delivery/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"@types/nodeunit": "^0.0.31",
6464
"cdk-build-tools": "0.0.0",
6565
"cdk-integ-tools": "0.0.0",
66-
"fast-check": "^2.4.0",
66+
"fast-check": "^2.6.0",
6767
"nodeunit": "^0.11.3",
6868
"pkglint": "0.0.0"
6969
},

packages/@aws-cdk/assert/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
},
2222
"license": "Apache-2.0",
2323
"devDependencies": {
24-
"@types/jest": "^26.0.14",
24+
"@types/jest": "^26.0.15",
2525
"cdk-build-tools": "0.0.0",
26-
"jest": "^26.4.2",
26+
"jest": "^26.6.0",
2727
"pkglint": "0.0.0",
2828
"ts-jest": "^26.4.1"
2929
},
@@ -37,7 +37,7 @@
3737
"peerDependencies": {
3838
"@aws-cdk/core": "0.0.0",
3939
"constructs": "^3.0.4",
40-
"jest": "^26.4.2"
40+
"jest": "^26.6.0"
4141
},
4242
"repository": {
4343
"url": "https://github.com/aws/aws-cdk.git",

packages/@aws-cdk/assets/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"cdk-integ-tools": "0.0.0",
7777
"nodeunit": "^0.11.3",
7878
"pkglint": "0.0.0",
79-
"sinon": "^9.1.0",
79+
"sinon": "^9.2.0",
8080
"ts-mock-imports": "^1.3.0"
8181
},
8282
"dependencies": {

packages/@aws-cdk/aws-apigateway/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ nyc.config.js
1414
.LAST_PACKAGE
1515
*.snk
1616
!.eslintrc.js
17+
!jest.config.js
1718

1819
junit.xml

packages/@aws-cdk/aws-apigateway/.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ dist
1919

2020
tsconfig.json
2121
.eslintrc.js
22+
jest.config.js
2223

2324
# exclude cdk artifacts
2425
**/cdk.out
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const baseConfig = require('cdk-build-tools/config/jest.config');
2+
module.exports = {
3+
...baseConfig,
4+
coverageThreshold: {
5+
global: {
6+
branches: 80,
7+
statements: 60,
8+
},
9+
},
10+
};

packages/@aws-cdk/aws-apigateway/package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@
5656
"cloudformation": "AWS::ApiGateway",
5757
"env": {
5858
"AWSLINT_BASE_CONSTRUCT": true
59-
}
59+
},
60+
"jest": true
6061
},
6162
"keywords": [
6263
"aws",
@@ -72,11 +73,9 @@
7273
"license": "Apache-2.0",
7374
"devDependencies": {
7475
"@aws-cdk/assert": "0.0.0",
75-
"@types/nodeunit": "^0.0.31",
7676
"cdk-build-tools": "0.0.0",
7777
"cdk-integ-tools": "0.0.0",
7878
"cfn2ts": "0.0.0",
79-
"nodeunit": "^0.11.3",
8079
"pkglint": "0.0.0"
8180
},
8281
"dependencies": {
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
import { Test } from 'nodeunit';
1+
import '@aws-cdk/assert/jest';
22
import * as apigateway from '../lib';
33

4-
export = {
5-
'if jsonWithStandardFields method called with no parameter'(test: Test) {
4+
describe('access log', () => {
5+
test('if jsonWithStandardFields method called with no parameter', () => {
66
const testFormat = apigateway.AccessLogFormat.jsonWithStandardFields();
7-
test.deepEqual(testFormat.toString(), '{"requestId":"$context.requestId","ip":"$context.identity.sourceIp","user":"$context.identity.user","caller":"$context.identity.caller","requestTime":"$context.requestTime","httpMethod":"$context.httpMethod","resourcePath":"$context.resourcePath","status":"$context.status","protocol":"$context.protocol","responseLength":"$context.responseLength"}');
7+
expect(testFormat.toString()).toEqual('{"requestId":"$context.requestId","ip":"$context.identity.sourceIp","user":"$context.identity.user","caller":"$context.identity.caller","requestTime":"$context.requestTime","httpMethod":"$context.httpMethod","resourcePath":"$context.resourcePath","status":"$context.status","protocol":"$context.protocol","responseLength":"$context.responseLength"}');
8+
});
89

9-
test.done();
10-
},
11-
12-
'if jsonWithStandardFields method called with all parameters false'(test: Test) {
10+
test('if jsonWithStandardFields method called with all parameters false', () => {
1311
const testFormat = apigateway.AccessLogFormat.jsonWithStandardFields({
1412
caller: false,
1513
httpMethod: false,
@@ -21,19 +19,15 @@ export = {
2119
status: false,
2220
user: false,
2321
});
24-
test.deepEqual(testFormat.toString(), '{"requestId":"$context.requestId"}');
25-
26-
test.done();
27-
},
22+
expect(testFormat.toString()).toEqual('{"requestId":"$context.requestId"}');
23+
});
2824

29-
'if clf method called'(test: Test) {
25+
test('if clf method called', () => {
3026
const testFormat = apigateway.AccessLogFormat.clf();
31-
test.deepEqual(testFormat.toString(), '$context.identity.sourceIp $context.identity.caller $context.identity.user [$context.requestTime] "$context.httpMethod $context.resourcePath $context.protocol" $context.status $context.responseLength $context.requestId');
27+
expect(testFormat.toString()).toEqual('$context.identity.sourceIp $context.identity.caller $context.identity.user [$context.requestTime] "$context.httpMethod $context.resourcePath $context.protocol" $context.status $context.responseLength $context.requestId');
28+
});
3229

33-
test.done();
34-
},
35-
36-
'if custom method called'(test: Test) {
30+
test('if custom method called', () => {
3731
const testFormat = apigateway.AccessLogFormat.custom(JSON.stringify({
3832
requestId: apigateway.AccessLogField.contextRequestId(),
3933
sourceIp: apigateway.AccessLogField.contextIdentitySourceIp(),
@@ -44,8 +38,6 @@ export = {
4438
email: apigateway.AccessLogField.contextAuthorizerClaims('email'),
4539
},
4640
}));
47-
test.deepEqual(testFormat.toString(), '{"requestId":"$context.requestId","sourceIp":"$context.identity.sourceIp","method":"$context.httpMethod","accountId":"$context.identity.accountId","userContext":{"sub":"$context.authorizer.claims.sub","email":"$context.authorizer.claims.email"}}');
48-
49-
test.done();
50-
},
51-
};
41+
expect(testFormat.toString()).toEqual('{"requestId":"$context.requestId","sourceIp":"$context.identity.sourceIp","method":"$context.httpMethod","accountId":"$context.identity.accountId","userContext":{"sub":"$context.authorizer.claims.sub","email":"$context.authorizer.claims.email"}}');
42+
});
43+
});

packages/@aws-cdk/aws-apigateway/test/test.api-definition.ts packages/@aws-cdk/aws-apigateway/test/api-definition.test.ts

+47-50
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,56 @@
1+
import '@aws-cdk/assert/jest';
12
import * as path from 'path';
23
import * as s3 from '@aws-cdk/aws-s3';
34
import * as cdk from '@aws-cdk/core';
4-
import { Test } from 'nodeunit';
55
import * as apigw from '../lib';
66

7-
export = {
8-
'apigateway.ApiDefinition.fromJson': {
9-
'happy case'(test: Test) {
7+
describe('api definition', () => {
8+
describe('apigateway.ApiDefinition.fromJson', () => {
9+
test('happy case', () => {
1010
const stack = new cdk.Stack();
1111
const definition = {
1212
key1: 'val1',
1313
};
1414
const config = apigw.ApiDefinition.fromInline(definition).bind(stack);
15-
test.deepEqual(config.inlineDefinition, definition);
16-
test.ok(config.s3Location === undefined);
17-
test.done();
18-
},
19-
20-
'fails if Json definition is empty'(test: Test) {
21-
test.throws(
22-
() => defineRestApi(apigw.ApiDefinition.fromInline({})),
23-
/cannot be empty/);
24-
test.done();
25-
},
26-
27-
'fails if definition is not an object'(test: Test) {
28-
test.throws(
29-
() => defineRestApi(apigw.ApiDefinition.fromInline('not-json')),
30-
/should be of type object/);
31-
test.done();
32-
},
33-
},
34-
35-
'apigateway.ApiDefinition.fromAsset': {
36-
'happy case'(test: Test) {
15+
expect(config.inlineDefinition).toEqual(definition);
16+
expect(config.s3Location).toBeUndefined();
17+
});
18+
19+
test('fails if Json definition is empty', () => {
20+
expect(
21+
() => defineRestApi(apigw.ApiDefinition.fromInline({})))
22+
.toThrow(/cannot be empty/);
23+
});
24+
25+
test('fails if definition is not an object', () => {
26+
expect(
27+
() => defineRestApi(apigw.ApiDefinition.fromInline('not-json')))
28+
.toThrow(/should be of type object/);
29+
});
30+
});
31+
32+
describe('apigateway.ApiDefinition.fromAsset', () => {
33+
test('happy case', () => {
3734
const stack = new cdk.Stack();
3835
const config = apigw.ApiDefinition.fromAsset(path.join(__dirname, 'sample-definition.yaml')).bind(stack);
39-
test.ok(config.inlineDefinition === undefined);
40-
test.ok(config.s3Location !== undefined);
41-
test.deepEqual(stack.resolve(config.s3Location!.bucket), {
36+
expect(config.inlineDefinition).toBeUndefined();
37+
expect(config.s3Location).toBeDefined();
38+
expect(stack.resolve(config.s3Location!.bucket)).toEqual({
4239
Ref: 'AssetParameters68497ac876de4e963fc8f7b5f1b28844c18ecc95e3f7c6e9e0bf250e03c037fbS3Bucket42039E29',
4340
});
44-
test.done();
45-
},
4641

47-
'fails if a directory is given for an asset'(test: Test) {
42+
});
43+
44+
test('fails if a directory is given for an asset', () => {
4845
// GIVEN
4946
const fileAsset = apigw.ApiDefinition.fromAsset(path.join(__dirname, 'authorizers'));
5047

5148
// THEN
52-
test.throws(() => defineRestApi(fileAsset), /Asset cannot be a \.zip file or a directory/);
53-
test.done();
54-
},
49+
expect(() => defineRestApi(fileAsset)).toThrow(/Asset cannot be a \.zip file or a directory/);
5550

56-
'only one Asset object gets created even if multiple functions use the same AssetApiDefinition'(test: Test) {
51+
});
52+
53+
test('only one Asset object gets created even if multiple functions use the same AssetApiDefinition', () => {
5754
// GIVEN
5855
const app = new cdk.App();
5956
const stack = new cdk.Stack(app, 'MyStack');
@@ -73,26 +70,26 @@ export = {
7370
const synthesized = assembly.stacks[0];
7471

7572
// API1 has an asset, API2 does not
76-
test.deepEqual(synthesized.assets.length, 1);
77-
test.done();
78-
},
79-
},
73+
expect(synthesized.assets.length).toEqual(1);
74+
75+
});
76+
});
8077

81-
'apigateway.ApiDefinition.fromBucket': {
82-
'happy case'(test: Test) {
78+
describe('apigateway.ApiDefinition.fromBucket', () => {
79+
test('happy case', () => {
8380
const stack = new cdk.Stack();
8481
const bucket = new s3.Bucket(stack, 'my-bucket');
8582
const config = apigw.ApiDefinition.fromBucket(bucket, 'my-key', 'my-version').bind(stack);
86-
test.ok(config.inlineDefinition === undefined);
87-
test.ok(config.s3Location !== undefined);
88-
test.deepEqual(stack.resolve(config.s3Location!.bucket), {
83+
expect(config.inlineDefinition).toBeUndefined();
84+
expect(config.s3Location).toBeDefined();
85+
expect(stack.resolve(config.s3Location!.bucket)).toEqual({
8986
Ref: 'mybucket15D133BF',
9087
});
91-
test.equals(config.s3Location!.key, 'my-key');
92-
test.done();
93-
},
94-
},
95-
};
88+
expect(config.s3Location!.key).toEqual('my-key');
89+
90+
});
91+
});
92+
});
9693

9794
function defineRestApi(definition: apigw.ApiDefinition) {
9895
const stack = new cdk.Stack();

0 commit comments

Comments
 (0)