Skip to content

Commit

Permalink
Merge branch 'master' into python-venv
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Oct 27, 2020
2 parents d5481e0 + 9635668 commit 6117f1c
Show file tree
Hide file tree
Showing 184 changed files with 6,303 additions and 3,793 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@

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.70.0](https://github.com/aws/aws-cdk/compare/v1.69.0...v1.70.0) (2020-10-23)


### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES

* **cognito:** the `UserPoolIdentityProviderBase` abstract class has been removed. Use the `UserPoolIdentityProvider*` classes directly.

### Features

* **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)
* **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)
* **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)
* **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))
* **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)
* **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)


### Bug Fixes

* **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)
* **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)
* **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))
* **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))

## [1.69.0](https://github.com/aws/aws-cdk/compare/v1.68.0...v1.69.0) (2020-10-19)


Expand Down
2 changes: 2 additions & 0 deletions allowed-breaking-changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ removed:@aws-cdk/cdk-assets-schema.FileAssetPackaging
changed-type:@aws-cdk/aws-codedeploy.IServerDeploymentGroup.autoScalingGroups
changed-type:@aws-cdk/aws-codedeploy.ServerDeploymentGroup.autoScalingGroups

changed-type:@aws-cdk/aws-rds.Credentials.secret

# We were leaking L1 types in L2 APIs, which now have changed required -> optional
# when ECS moved to the CloudFormation Registry spec.
change-return-type:@aws-cdk/aws-ecs.ContainerDefinition.renderContainerDefinition
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
"tools/*"
],
"rejectCycles": "true",
"version": "1.69.0"
"version": "1.70.0"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"conventional-changelog-cli": "^2.1.0",
"fs-extra": "^9.0.1",
"graceful-fs": "^4.2.4",
"jest-junit": "^11.1.0",
"jest-junit": "^12.0.0",
"jsii-diff": "^1.13.0",
"jsii-pacmak": "^1.13.0",
"jsii-rosetta": "^1.13.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
"cfn2ts": "0.0.0",
"jest": "^26.6.0",
"jest": "^26.6.1",
"nodeunit": "^0.11.3",
"pkglint": "0.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/app-delivery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aw
# Replacement recommended

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


### Limitations
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/app-delivery/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"@types/nodeunit": "^0.0.31",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
"fast-check": "^2.4.0",
"fast-check": "^2.6.0",
"nodeunit": "^0.11.3",
"pkglint": "0.0.0"
},
Expand Down
8 changes: 4 additions & 4 deletions packages/@aws-cdk/assert/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.14",
"@types/jest": "^26.0.15",
"cdk-build-tools": "0.0.0",
"jest": "^26.6.0",
"jest": "^26.6.1",
"pkglint": "0.0.0",
"ts-jest": "^26.4.1"
"ts-jest": "^26.4.2"
},
"dependencies": {
"@aws-cdk/cloud-assembly-schema": "0.0.0",
Expand All @@ -37,7 +37,7 @@
"peerDependencies": {
"@aws-cdk/core": "0.0.0",
"constructs": "^3.0.4",
"jest": "^26.6.0"
"jest": "^26.6.1"
},
"repository": {
"url": "https://github.com/aws/aws-cdk.git",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"cdk-integ-tools": "0.0.0",
"nodeunit": "^0.11.3",
"pkglint": "0.0.0",
"sinon": "^9.1.0",
"sinon": "^9.2.0",
"ts-mock-imports": "^1.3.0"
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/assets/test/test.staging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export = {

test.deepEqual(staging.sourceHash, '2f37f937c51e2c191af66acf9b09f548926008ec68c575bd2ee54b6e997c0e00');
test.deepEqual(staging.sourcePath, sourcePath);
test.deepEqual(stack.resolve(staging.stagedPath), 'asset.2f37f937c51e2c191af66acf9b09f548926008ec68c575bd2ee54b6e997c0e00');
test.deepEqual(staging.relativeStagedPath(stack), 'asset.2f37f937c51e2c191af66acf9b09f548926008ec68c575bd2ee54b6e997c0e00');
test.done();
},

Expand All @@ -31,7 +31,7 @@ export = {

test.deepEqual(staging.sourceHash, '2f37f937c51e2c191af66acf9b09f548926008ec68c575bd2ee54b6e997c0e00');
test.deepEqual(staging.sourcePath, sourcePath);
test.deepEqual(stack.resolve(staging.stagedPath), sourcePath);
test.deepEqual(staging.stagedPath, sourcePath);
test.done();
},

Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-apigateway/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ nyc.config.js
.LAST_PACKAGE
*.snk
!.eslintrc.js
!jest.config.js

junit.xml
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-apigateway/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ dist

tsconfig.json
.eslintrc.js
jest.config.js

# exclude cdk artifacts
**/cdk.out
Expand Down
10 changes: 10 additions & 0 deletions packages/@aws-cdk/aws-apigateway/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const baseConfig = require('cdk-build-tools/config/jest.config');
module.exports = {
...baseConfig,
coverageThreshold: {
global: {
branches: 80,
statements: 60,
},
},
};
5 changes: 2 additions & 3 deletions packages/@aws-cdk/aws-apigateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
"cloudformation": "AWS::ApiGateway",
"env": {
"AWSLINT_BASE_CONSTRUCT": true
}
},
"jest": true
},
"keywords": [
"aws",
Expand All @@ -72,11 +73,9 @@
"license": "Apache-2.0",
"devDependencies": {
"@aws-cdk/assert": "0.0.0",
"@types/nodeunit": "^0.0.31",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
"cfn2ts": "0.0.0",
"nodeunit": "^0.11.3",
"pkglint": "0.0.0"
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { Test } from 'nodeunit';
import '@aws-cdk/assert/jest';
import * as apigateway from '../lib';

export = {
'if jsonWithStandardFields method called with no parameter'(test: Test) {
describe('access log', () => {
test('if jsonWithStandardFields method called with no parameter', () => {
const testFormat = apigateway.AccessLogFormat.jsonWithStandardFields();
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"}');
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"}');
});

test.done();
},

'if jsonWithStandardFields method called with all parameters false'(test: Test) {
test('if jsonWithStandardFields method called with all parameters false', () => {
const testFormat = apigateway.AccessLogFormat.jsonWithStandardFields({
caller: false,
httpMethod: false,
Expand All @@ -21,19 +19,15 @@ export = {
status: false,
user: false,
});
test.deepEqual(testFormat.toString(), '{"requestId":"$context.requestId"}');

test.done();
},
expect(testFormat.toString()).toEqual('{"requestId":"$context.requestId"}');
});

'if clf method called'(test: Test) {
test('if clf method called', () => {
const testFormat = apigateway.AccessLogFormat.clf();
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');
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');
});

test.done();
},

'if custom method called'(test: Test) {
test('if custom method called', () => {
const testFormat = apigateway.AccessLogFormat.custom(JSON.stringify({
requestId: apigateway.AccessLogField.contextRequestId(),
sourceIp: apigateway.AccessLogField.contextIdentitySourceIp(),
Expand All @@ -44,8 +38,6 @@ export = {
email: apigateway.AccessLogField.contextAuthorizerClaims('email'),
},
}));
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"}}');

test.done();
},
};
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"}}');
});
});
Original file line number Diff line number Diff line change
@@ -1,59 +1,56 @@
import '@aws-cdk/assert/jest';
import * as path from 'path';
import * as s3 from '@aws-cdk/aws-s3';
import * as cdk from '@aws-cdk/core';
import { Test } from 'nodeunit';
import * as apigw from '../lib';

export = {
'apigateway.ApiDefinition.fromJson': {
'happy case'(test: Test) {
describe('api definition', () => {
describe('apigateway.ApiDefinition.fromJson', () => {
test('happy case', () => {
const stack = new cdk.Stack();
const definition = {
key1: 'val1',
};
const config = apigw.ApiDefinition.fromInline(definition).bind(stack);
test.deepEqual(config.inlineDefinition, definition);
test.ok(config.s3Location === undefined);
test.done();
},

'fails if Json definition is empty'(test: Test) {
test.throws(
() => defineRestApi(apigw.ApiDefinition.fromInline({})),
/cannot be empty/);
test.done();
},

'fails if definition is not an object'(test: Test) {
test.throws(
() => defineRestApi(apigw.ApiDefinition.fromInline('not-json')),
/should be of type object/);
test.done();
},
},

'apigateway.ApiDefinition.fromAsset': {
'happy case'(test: Test) {
expect(config.inlineDefinition).toEqual(definition);
expect(config.s3Location).toBeUndefined();
});

test('fails if Json definition is empty', () => {
expect(
() => defineRestApi(apigw.ApiDefinition.fromInline({})))
.toThrow(/cannot be empty/);
});

test('fails if definition is not an object', () => {
expect(
() => defineRestApi(apigw.ApiDefinition.fromInline('not-json')))
.toThrow(/should be of type object/);
});
});

describe('apigateway.ApiDefinition.fromAsset', () => {
test('happy case', () => {
const stack = new cdk.Stack();
const config = apigw.ApiDefinition.fromAsset(path.join(__dirname, 'sample-definition.yaml')).bind(stack);
test.ok(config.inlineDefinition === undefined);
test.ok(config.s3Location !== undefined);
test.deepEqual(stack.resolve(config.s3Location!.bucket), {
expect(config.inlineDefinition).toBeUndefined();
expect(config.s3Location).toBeDefined();
expect(stack.resolve(config.s3Location!.bucket)).toEqual({
Ref: 'AssetParameters68497ac876de4e963fc8f7b5f1b28844c18ecc95e3f7c6e9e0bf250e03c037fbS3Bucket42039E29',
});
test.done();
},

'fails if a directory is given for an asset'(test: Test) {
});

test('fails if a directory is given for an asset', () => {
// GIVEN
const fileAsset = apigw.ApiDefinition.fromAsset(path.join(__dirname, 'authorizers'));

// THEN
test.throws(() => defineRestApi(fileAsset), /Asset cannot be a \.zip file or a directory/);
test.done();
},
expect(() => defineRestApi(fileAsset)).toThrow(/Asset cannot be a \.zip file or a directory/);

'only one Asset object gets created even if multiple functions use the same AssetApiDefinition'(test: Test) {
});

test('only one Asset object gets created even if multiple functions use the same AssetApiDefinition', () => {
// GIVEN
const app = new cdk.App();
const stack = new cdk.Stack(app, 'MyStack');
Expand All @@ -73,26 +70,26 @@ export = {
const synthesized = assembly.stacks[0];

// API1 has an asset, API2 does not
test.deepEqual(synthesized.assets.length, 1);
test.done();
},
},
expect(synthesized.assets.length).toEqual(1);

});
});

'apigateway.ApiDefinition.fromBucket': {
'happy case'(test: Test) {
describe('apigateway.ApiDefinition.fromBucket', () => {
test('happy case', () => {
const stack = new cdk.Stack();
const bucket = new s3.Bucket(stack, 'my-bucket');
const config = apigw.ApiDefinition.fromBucket(bucket, 'my-key', 'my-version').bind(stack);
test.ok(config.inlineDefinition === undefined);
test.ok(config.s3Location !== undefined);
test.deepEqual(stack.resolve(config.s3Location!.bucket), {
expect(config.inlineDefinition).toBeUndefined();
expect(config.s3Location).toBeDefined();
expect(stack.resolve(config.s3Location!.bucket)).toEqual({
Ref: 'mybucket15D133BF',
});
test.equals(config.s3Location!.key, 'my-key');
test.done();
},
},
};
expect(config.s3Location!.key).toEqual('my-key');

});
});
});

function defineRestApi(definition: apigw.ApiDefinition) {
const stack = new cdk.Stack();
Expand Down
Loading

0 comments on commit 6117f1c

Please sign in to comment.