Skip to content

Commit

Permalink
Merge branch 'master' into lambda-nodejs-parcel2
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Jun 29, 2020
2 parents 2760fbd + bb514c1 commit c9bdfed
Show file tree
Hide file tree
Showing 164 changed files with 5,319 additions and 2,167 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: "\U0001F41B Bug Report"
about: Report a bug
title: "(module): "
title: "[module] "
labels: bug, needs-triage
---

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/doc.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: "📕 Documentation Issue"
about: Issue in the reference documentation or developer guide
title: "(module): "
title: "[module] "
labels: feature-request, documentation, needs-triage
---

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: "\U0001F680 Feature Request"
about: Request a new feature
title: "(module): "
title: "[module] "
labels: feature-request, needs-triage
---

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/general-issues.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: "\U00002753 General Issue"
about: Create a new issue
title: "(module): "
title: "[module] "
labels: needs-triage
---

Expand Down
307 changes: 152 additions & 155 deletions .github/workflows/issue-label-assign.yml

Large diffs are not rendered by default.

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.47.0](https://github.com/aws/aws-cdk/compare/v1.46.0...v1.47.0) (2020-06-24)


### ⚠ BREAKING CHANGES

* **stepfunctions-tasks:** `Dynamo*` tasks no longer implement`IStepFunctionsTask` and have been replaced by constructs that can be instantiated directly. See README for examples

### Features

* **cfn-include:** add support for retrieving parameter objects ([#8658](https://github.com/aws/aws-cdk/issues/8658)) ([52dc123](https://github.com/aws/aws-cdk/commit/52dc123ba8696abcfad99d8093e98cd39b5b104f)), closes [#8657](https://github.com/aws/aws-cdk/issues/8657)
* **cfn-include:** support logical id overrides ([#8529](https://github.com/aws/aws-cdk/issues/8529)) ([d9c4f5e](https://github.com/aws/aws-cdk/commit/d9c4f5e67c54e1a2a436978fbc28fffd92b24cd6)), closes [#7375](https://github.com/aws/aws-cdk/issues/7375)
* **cloudwatch:** CompositeAlarm ([#8498](https://github.com/aws/aws-cdk/issues/8498)) ([1e6d293](https://github.com/aws/aws-cdk/commit/1e6d293f4c445318b11bd6fe998325688a675807))
* **efs:** access point ([#8631](https://github.com/aws/aws-cdk/issues/8631)) ([dde0ef5](https://github.com/aws/aws-cdk/commit/dde0ef52cc0cdbc40fd212f518f3cee4f30450b9))
* **stepfunctions:** grant APIs for state machine construct ([#8486](https://github.com/aws/aws-cdk/issues/8486)) ([fe71364](https://github.com/aws/aws-cdk/commit/fe71364b6cd8274e937cc2dc9185249dcbbb9388)), closes [#5933](https://github.com/aws/aws-cdk/issues/5933)
* **stepfunctions-tasks:** task constructs to call DynamoDB APIs ([#8466](https://github.com/aws/aws-cdk/issues/8466)) ([a7cb3b7](https://github.com/aws/aws-cdk/commit/a7cb3b7633c433ecb0619c030914bfa497ee39bc)), closes [#8108](https://github.com/aws/aws-cdk/issues/8108)


### Bug Fixes

* **appsync:** Not to throw an Error even if 'additionalAuthorizationModes' is undefined ([#8673](https://github.com/aws/aws-cdk/issues/8673)) ([6b5d77b](https://github.com/aws/aws-cdk/commit/6b5d77b452bccb35564d6acee118112156149eb0)), closes [#8666](https://github.com/aws/aws-cdk/issues/8666) [#8668](https://github.com/aws/aws-cdk/issues/8668)
* **cli:** cannot change policies or trust after initial bootstrap ([#8677](https://github.com/aws/aws-cdk/issues/8677)) ([6e6b23e](https://github.com/aws/aws-cdk/commit/6e6b23e329d8a1b6455210768371a5ab9de478ef)), closes [#6581](https://github.com/aws/aws-cdk/issues/6581)
* **cli:** crash on tiny reported terminal width ([#8675](https://github.com/aws/aws-cdk/issues/8675)) ([a186c24](https://github.com/aws/aws-cdk/commit/a186c24918fddc697270b794b6603add5a47e947)), closes [#8667](https://github.com/aws/aws-cdk/issues/8667)
* **toolkit:** CLI tool fails on CloudFormation Throttling ([#8711](https://github.com/aws/aws-cdk/issues/8711)) ([e512a40](https://github.com/aws/aws-cdk/commit/e512a4057b21d32432d4dc7ac14ae7caa812265d)), closes [#5637](https://github.com/aws/aws-cdk/issues/5637)

## [1.46.0](https://github.com/aws/aws-cdk/compare/v1.45.0...v1.46.0) (2020-06-19)


Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"tools/*"
],
"rejectCycles": "true",
"version": "1.46.0"
"version": "1.47.0"
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
"@aws-cdk/aws-codepipeline-actions/case/**",
"@aws-cdk/aws-ecr-assets/minimatch",
"@aws-cdk/aws-ecr-assets/minimatch/**",
"@aws-cdk/aws-eks/yaml",
"@aws-cdk/aws-eks/yaml/**",
"@aws-cdk/aws-lambda-nodejs/parcel-bundler",
"@aws-cdk/aws-lambda-nodejs/parcel-bundler/**",
"@aws-cdk/cloud-assembly-schema/jsonschema",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/assert/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^26.0.0",
"@types/jest": "^26.0.3",
"cdk-build-tools": "0.0.0",
"jest": "^25.5.4",
"pkglint": "0.0.0",
Expand Down
4 changes: 4 additions & 0 deletions packages/@aws-cdk/aws-backup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

> All classes with the `Cfn` prefix in this module ([CFN Resources](https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib)) are always stable and safe to use.
![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge)

> The APIs of higher level constructs in this module are experimental and under active development. They are subject to non-backward compatible changes or removal in any future version. These are not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be announced in the release notes. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.
---
<!--END STABILITY BANNER-->

Expand Down
8 changes: 5 additions & 3 deletions packages/@aws-cdk/aws-backup/lib/vault.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as iam from '@aws-cdk/aws-iam';
import * as kms from '@aws-cdk/aws-kms';
import * as sns from '@aws-cdk/aws-sns';
import { Aws, Construct, IResource, RemovalPolicy, Resource } from '@aws-cdk/core';
import { Construct, IResource, RemovalPolicy, Resource } from '@aws-cdk/core';
import { CfnBackupVault } from './backup.generated';

/**
Expand All @@ -21,7 +21,9 @@ export interface IBackupVault extends IResource {
*/
export interface BackupVaultProps {
/**
* The name of a logical container where backups are stored.
* The name of a logical container where backups are stored. Backup vaults
* are identified by names that are unique to the account used to create
* them and the AWS Region where they are created.
*
* @default - A CDK generated name
*/
Expand Down Expand Up @@ -158,7 +160,7 @@ export class BackupVault extends Resource implements IBackupVault {

private uniqueVaultName() {
// Max length of 50 chars, get the last 50 chars
const id = `${this.node.uniqueId}${Aws.STACK_NAME}`;
const id = this.node.uniqueId;
return id.substring(Math.max(id.length - 50, 0), id.length);
}
}
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-backup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"node": ">= 10.13.0 <13 || >=13.7.0"
},
"stability": "experimental",
"maturity": "cfn-only",
"maturity": "experimental",
"awscdkio": {
"announce": false
}
Expand Down
12 changes: 1 addition & 11 deletions packages/@aws-cdk/aws-backup/test/integ.backup.expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,7 @@
"Vault23237E5B": {
"Type": "AWS::Backup::BackupVault",
"Properties": {
"BackupVaultName": {
"Fn::Join": [
"",
[
"cdkbackupVaultC2A6D3CB",
{
"Ref": "AWS::StackName"
}
]
]
}
"BackupVaultName": "cdkbackupVaultC2A6D3CB"
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
Expand Down
12 changes: 1 addition & 11 deletions packages/@aws-cdk/aws-backup/test/vault.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,7 @@ test('create a vault', () => {

// THEN
expect(stack).toHaveResource('AWS::Backup::BackupVault', {
BackupVaultName: {
'Fn::Join': [
'',
[
'Vault',
{
Ref: 'AWS::StackName',
},
],
],
},
BackupVaultName: 'Vault',
});
});

Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-cloudfront/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"devDependencies": {
"@aws-cdk/assert": "0.0.0",
"@types/nodeunit": "^0.0.31",
"aws-sdk": "^2.703.0",
"aws-sdk": "^2.706.0",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
"cfn2ts": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-cloudtrail/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"license": "Apache-2.0",
"devDependencies": {
"@aws-cdk/assert": "0.0.0",
"aws-sdk": "^2.703.0",
"aws-sdk": "^2.706.0",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
"cfn2ts": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-codebuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"@aws-cdk/aws-sns": "0.0.0",
"@aws-cdk/aws-sqs": "0.0.0",
"@types/nodeunit": "^0.0.31",
"aws-sdk": "^2.703.0",
"aws-sdk": "^2.706.0",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
"cfn2ts": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-codecommit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"@aws-cdk/assert": "0.0.0",
"@aws-cdk/aws-sns": "0.0.0",
"@types/nodeunit": "^0.0.31",
"aws-sdk": "^2.703.0",
"aws-sdk": "^2.706.0",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
"cfn2ts": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-codepipeline-actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"devDependencies": {
"@aws-cdk/assert": "0.0.0",
"@aws-cdk/aws-cloudtrail": "0.0.0",
"@types/lodash": "^4.14.156",
"@types/lodash": "^4.14.157",
"@types/nodeunit": "^0.0.31",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
Expand Down
42 changes: 23 additions & 19 deletions packages/@aws-cdk/aws-cognito/lib/user-pool-domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ export class UserPoolDomain extends Resource implements IUserPoolDomain {
public readonly domainName: string;
private isCognitoDomain: boolean;

private cloudFrontCustomResource?: AwsCustomResource;

constructor(scope: Construct, id: string, props: UserPoolDomainProps) {
super(scope, id);

Expand Down Expand Up @@ -113,25 +115,27 @@ export class UserPoolDomain extends Resource implements IUserPoolDomain {
* The domain name of the CloudFront distribution associated with the user pool domain.
*/
public get cloudFrontDomainName(): string {
const sdkCall: AwsSdkCall = {
service: 'CognitoIdentityServiceProvider',
action: 'describeUserPoolDomain',
parameters: {
Domain: this.domainName,
},
physicalResourceId: PhysicalResourceId.of(this.domainName),
};
const customResource = new AwsCustomResource(this, 'CloudFrontDomainName', {
resourceType: 'Custom::UserPoolCloudFrontDomainName',
onCreate: sdkCall,
onUpdate: sdkCall,
policy: AwsCustomResourcePolicy.fromSdkCalls({
// DescribeUserPoolDomain only supports access level '*'
// https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazoncognitouserpools.html#amazoncognitouserpools-actions-as-permissions
resources: [ '*' ],
}),
});
return customResource.getResponseField('DomainDescription.CloudFrontDistribution');
if (!this.cloudFrontCustomResource) {
const sdkCall: AwsSdkCall = {
service: 'CognitoIdentityServiceProvider',
action: 'describeUserPoolDomain',
parameters: {
Domain: this.domainName,
},
physicalResourceId: PhysicalResourceId.of(this.domainName),
};
this.cloudFrontCustomResource = new AwsCustomResource(this, 'CloudFrontDomainName', {
resourceType: 'Custom::UserPoolCloudFrontDomainName',
onCreate: sdkCall,
onUpdate: sdkCall,
policy: AwsCustomResourcePolicy.fromSdkCalls({
// DescribeUserPoolDomain only supports access level '*'
// https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazoncognitouserpools.html#amazoncognitouserpools-actions-as-permissions
resources: [ '*' ],
}),
});
}
return this.cloudFrontCustomResource.getResponseField('DomainDescription.CloudFrontDistribution');
}

/**
Expand Down
17 changes: 16 additions & 1 deletion packages/@aws-cdk/aws-cognito/test/user-pool-domain.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ describe('User Pool Client', () => {
})).not.toThrow();
});

test('custom resource is added when cloudFrontDistribution method is called', () => {
test('custom resource is added when cloudFrontDomainName property is used', () => {
// GIVEN
const stack = new Stack();
const pool = new UserPool(stack, 'Pool');
Expand Down Expand Up @@ -137,6 +137,21 @@ describe('User Pool Client', () => {
});
});

test('cloudFrontDomainName property can be called multiple times', () => {
const stack = new Stack();
const pool = new UserPool(stack, 'Pool');
const domain = pool.addDomain('Domain', {
cognitoDomain: {
domainPrefix: 'cognito-domain-prefix',
},
});

const cfDomainNameFirst = domain.cloudFrontDomainName;
const cfDomainNameSecond = domain.cloudFrontDomainName;

expect(cfDomainNameSecond).toEqual(cfDomainNameFirst);
});

describe('signInUrl', () => {
test('returns the expected URL', () => {
// GIVEN
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-dynamodb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
"license": "Apache-2.0",
"devDependencies": {
"@aws-cdk/assert": "0.0.0",
"@types/jest": "^26.0.0",
"aws-sdk": "^2.703.0",
"@types/jest": "^26.0.3",
"aws-sdk": "^2.706.0",
"aws-sdk-mock": "^5.1.0",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
Expand Down
Loading

0 comments on commit c9bdfed

Please sign in to comment.