Skip to content

Commit fff58e8

Browse files
authored
Merge branch 'master' into nirvana124/maxAllocatedStorage
2 parents fcc79bf + 4501b8b commit fff58e8

File tree

229 files changed

+3403
-1756
lines changed

Some content is hidden

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

229 files changed

+3403
-1756
lines changed

.yarnrc

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
--install.check-files true # install will verify file tree of packages for consistency
2-
--install.audit true # Run vulnerability audit on installed packages

CHANGELOG.md

+40
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,46 @@
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.30.0](https://github.com/aws/aws-cdk/compare/v1.29.0...v1.30.0) (2020-03-18)
6+
7+
8+
### Features
9+
10+
* **cloudwatch:** standard set of graph colors ([#6747](https://github.com/aws/aws-cdk/issues/6747)) ([97ae931](https://github.com/aws/aws-cdk/commit/97ae931ea4d8333d1846fc3bc801430b000fa606))
11+
12+
13+
### Bug Fixes
14+
15+
* **core:** IConstruct no longer extends IDependable ([#6794](https://github.com/aws/aws-cdk/issues/6794)) ([19bb16a](https://github.com/aws/aws-cdk/commit/19bb16a0feb5b482223dd193354447065ac06f8f)), closes [#6792](https://github.com/aws/aws-cdk/issues/6792)
16+
17+
## [1.29.0](https://github.com/aws/aws-cdk/compare/v1.28.0...v1.29.0) (2020-03-18)
18+
19+
:rocket: To enable new CDK projects such as [CDK for Kubernetes](https://github.com/awslabs/cdk8s), we have released the **constructs programming model** as an independent library called [constructs](https://github.com/aws/constructs). The `@aws-cdk/core.Construct` class is now a subclass of the base `constructs.Construct`.
20+
21+
### ⚠ BREAKING CHANGES
22+
23+
* **cognito:** `UserPoolAttribute` has been removed. It is no longer
24+
required to defined a `UserPool`.
25+
* **ec2:** if you implemented a custom subclass of `IMachineImage` it must now always return a `userData` object.
26+
27+
### Features
28+
29+
* **cli:** add permissions to the bootstrap action role for `cdk deploy` ([#6684](https://github.com/aws/aws-cdk/issues/6684)) ([52fd078](https://github.com/aws/aws-cdk/commit/52fd078abcc93876aa7423949e1e6090644cf95d))
30+
* **codebuild:** add support for Source Credentials ([#6722](https://github.com/aws/aws-cdk/issues/6722)) ([a6e2d28](https://github.com/aws/aws-cdk/commit/a6e2d288a07b75c2b97c86f90d1d82b850f81620))
31+
* **cognito:** user pool - custom & mandatory standard attributes ([#6487](https://github.com/aws/aws-cdk/issues/6487)) ([6dfb677](https://github.com/aws/aws-cdk/commit/6dfb67726dfc9c70f2fc448fac58eb3b550296a1)), closes [#1747](https://github.com/aws/aws-cdk/issues/1747)
32+
* **cognito:** user pool - MFA, password policy and email settings ([#6717](https://github.com/aws/aws-cdk/issues/6717)) ([cc35dad](https://github.com/aws/aws-cdk/commit/cc35dadacc94bfbdba1d83faa55bf1c4cf534485))
33+
* **core:** the "constructs" module ([#6623](https://github.com/aws/aws-cdk/issues/6623)) ([eded95b](https://github.com/aws/aws-cdk/commit/eded95bc0dac7c292a0093365708aba8c11ca09a))
34+
* **ec2:** availabilityZone is optional when importing subnet ([d10fe67](https://github.com/aws/aws-cdk/commit/d10fe67664f01db568da7f81af12ff647e75fa05)), closes [#6607](https://github.com/aws/aws-cdk/issues/6607)
35+
* **lambda-event-sources:** failure handling for stream event sources ([#5929](https://github.com/aws/aws-cdk/issues/5929)) ([5028009](https://github.com/aws/aws-cdk/commit/50280092ab2c0a2c8e19177c4a70f8a7c0f3c5fb)), closes [#5236](https://github.com/aws/aws-cdk/issues/5236)
36+
37+
38+
### Bug Fixes
39+
40+
* **aws-ecs-pattern:** allow ScheduledTaskBase to run on a public subnet ([#6624](https://github.com/aws/aws-cdk/issues/6624)) ([b9a1408](https://github.com/aws/aws-cdk/commit/b9a14087c9d7260c71cce9a96718dcb75ece538e)), closes [#6312](https://github.com/aws/aws-cdk/issues/6312)
41+
* SecretValue.secretManager validates non-ARN ids do not contain : ([#6371](https://github.com/aws/aws-cdk/issues/6371)) ([7cb8c3f](https://github.com/aws/aws-cdk/commit/7cb8c3fb6d0c150bf4325ca0f51688806c8f29d1))
42+
* **aws-logs:** remove validation of retentionInDays for unresolved tokens ([#6727](https://github.com/aws/aws-cdk/issues/6727)) ([43a3420](https://github.com/aws/aws-cdk/commit/43a3420c91a3f4989f22d3eda9d7d448658f9aeb)), closes [#6690](https://github.com/aws/aws-cdk/issues/6690)
43+
* **ec2:** MachineImages create appropriate UserData ([7a10f0f](https://github.com/aws/aws-cdk/commit/7a10f0f9b9e8e4c9816a4f28335cca77a915b15f))
44+
545
## [1.28.0](https://github.com/aws/aws-cdk/compare/v1.27.0...v1.28.0) (2020-03-16)
646

747

design/cdk-bootstrap.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -323,4 +323,4 @@ This should make sure the CFN update succeeds.
323323
## Bootstrap template
324324

325325
The bootstrap template used by the CLI command can be found in the
326-
[aws-cdk package](../packages/aws-cdk/lib/api/bootstrap/bootstrap-template.json).
326+
[aws-cdk package](../packages/aws-cdk/lib/api/bootstrap/bootstrap-template.yaml).

lerna.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
"tools/*"
1111
],
1212
"rejectCycles": "true",
13-
"version": "1.28.0"
13+
"version": "1.30.0"
1414
}

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
},
1616
"devDependencies": {
1717
"conventional-changelog-cli": "^2.0.31",
18-
"fs-extra": "^8.1.0",
18+
"fs-extra": "^9.0.0",
1919
"jsii-diff": "^1.1.0",
20-
"jsii-pacmak": "^0.22.0",
21-
"jsii-rosetta": "^0.22.0",
20+
"jsii-pacmak": "^1.1.0",
21+
"jsii-rosetta": "^1.1.0",
2222
"lerna": "^3.20.2",
2323
"standard-version": "^7.1.0",
2424
"typescript": "~3.8.3"
@@ -58,4 +58,4 @@
5858
"@aws-cdk/cx-api/semver/**"
5959
]
6060
}
61-
}
61+
}

packages/@aws-cdk/alexa-ask/package.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,17 @@
8787
},
8888
"dependencies": {
8989
"@aws-cdk/core": "0.0.0",
90-
"constructs": "^1.1.2"
90+
"constructs": "^2.0.0"
9191
},
9292
"peerDependencies": {
9393
"@aws-cdk/core": "0.0.0",
94-
"constructs": "^1.1.2"
94+
"constructs": "^2.0.0"
9595
},
9696
"engines": {
9797
"node": ">= 10.3.0"
9898
},
99-
"stability": "experimental"
99+
"stability": "experimental",
100+
"awscdkio": {
101+
"announce": false
102+
}
100103
}

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

+5-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"@aws-cdk/aws-iam": "0.0.0",
4949
"@aws-cdk/core": "0.0.0",
5050
"@aws-cdk/cx-api": "0.0.0",
51-
"constructs": "^1.1.2"
51+
"constructs": "^2.0.0"
5252
},
5353
"devDependencies": {
5454
"@aws-cdk/assert": "0.0.0",
@@ -85,7 +85,7 @@
8585
"@aws-cdk/aws-iam": "0.0.0",
8686
"@aws-cdk/core": "0.0.0",
8787
"@aws-cdk/cx-api": "0.0.0",
88-
"constructs": "^1.1.2"
88+
"constructs": "^2.0.0"
8989
},
9090
"engines": {
9191
"node": ">= 10.3.0"
@@ -99,5 +99,8 @@
9999
"docs-public-apis:@aws-cdk/app-delivery.PipelineDeployStackAction.onStateChange",
100100
"docs-public-apis:@aws-cdk/app-delivery.PipelineDeployStackActionProps"
101101
]
102+
},
103+
"awscdkio": {
104+
"announce": false
102105
}
103106
}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@
3939
"@aws-cdk/cloudformation-diff": "0.0.0",
4040
"@aws-cdk/core": "0.0.0",
4141
"@aws-cdk/cx-api": "0.0.0",
42-
"constructs": "^1.1.2"
42+
"constructs": "^2.0.0"
4343
},
4444
"peerDependencies": {
4545
"@aws-cdk/core": "0.0.0",
4646
"jest": "^24.9.0",
47-
"constructs": "^1.1.2"
47+
"constructs": "^2.0.0"
4848
},
4949
"repository": {
5050
"url": "https://github.com/aws/aws-cdk.git",

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

+5-2
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@
7979
"@aws-cdk/core": "0.0.0",
8080
"@aws-cdk/cx-api": "0.0.0",
8181
"minimatch": "^3.0.4",
82-
"constructs": "^1.1.2"
82+
"constructs": "^2.0.0"
8383
},
8484
"homepage": "https://github.com/aws/aws-cdk",
8585
"peerDependencies": {
8686
"@aws-cdk/core": "0.0.0",
8787
"@aws-cdk/cx-api": "0.0.0",
88-
"constructs": "^1.1.2"
88+
"constructs": "^2.0.0"
8989
},
9090
"engines": {
9191
"node": ">= 10.3.0"
@@ -100,5 +100,8 @@
100100
"docs-public-apis:@aws-cdk/assets.StagingProps.sourcePath",
101101
"docs-public-apis:@aws-cdk/assets.FollowMode"
102102
]
103+
},
104+
"awscdkio": {
105+
"announce": false
103106
}
104107
}

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

+6-3
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,17 @@
8888
},
8989
"dependencies": {
9090
"@aws-cdk/core": "0.0.0",
91-
"constructs": "^1.1.2"
91+
"constructs": "^2.0.0"
9292
},
9393
"peerDependencies": {
9494
"@aws-cdk/core": "0.0.0",
95-
"constructs": "^1.1.2"
95+
"constructs": "^2.0.0"
9696
},
9797
"engines": {
9898
"node": ">= 10.3.0"
9999
},
100-
"stability": "experimental"
100+
"stability": "experimental",
101+
"awscdkio": {
102+
"announce": false
103+
}
101104
}

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

+6-3
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,17 @@
8888
},
8989
"dependencies": {
9090
"@aws-cdk/core": "0.0.0",
91-
"constructs": "^1.1.2"
91+
"constructs": "^2.0.0"
9292
},
9393
"peerDependencies": {
9494
"@aws-cdk/core": "0.0.0",
95-
"constructs": "^1.1.2"
95+
"constructs": "^2.0.0"
9696
},
9797
"engines": {
9898
"node": ">= 10.3.0"
9999
},
100-
"stability": "experimental"
100+
"stability": "experimental",
101+
"awscdkio": {
102+
"announce": false
103+
}
101104
}

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

+6-3
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,17 @@
8787
},
8888
"dependencies": {
8989
"@aws-cdk/core": "0.0.0",
90-
"constructs": "^1.1.2"
90+
"constructs": "^2.0.0"
9191
},
9292
"peerDependencies": {
9393
"@aws-cdk/core": "0.0.0",
94-
"constructs": "^1.1.2"
94+
"constructs": "^2.0.0"
9595
},
9696
"engines": {
9797
"node": ">= 10.3.0"
9898
},
99-
"stability": "experimental"
99+
"stability": "experimental",
100+
"awscdkio": {
101+
"announce": false
102+
}
100103
}

packages/@aws-cdk/aws-amplify/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const amplifyApp = new amplify.App(this, 'MyApp', {
3333
version: '1.0',
3434
frontend: {
3535
phases: {
36-
prebuild: {
36+
preBuild: {
3737
commands: [
3838
'yarn'
3939
]

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

+5-2
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,15 @@
9393
"@aws-cdk/aws-codebuild": "0.0.0",
9494
"@aws-cdk/aws-secretsmanager": "0.0.0",
9595
"@aws-cdk/core": "0.0.0",
96-
"constructs": "^1.1.2"
96+
"constructs": "^2.0.0"
9797
},
9898
"peerDependencies": {
9999
"@aws-cdk/aws-iam": "0.0.0",
100100
"@aws-cdk/aws-kms": "0.0.0",
101101
"@aws-cdk/aws-codebuild": "0.0.0",
102102
"@aws-cdk/aws-secretsmanager": "0.0.0",
103103
"@aws-cdk/core": "0.0.0",
104-
"constructs": "^1.1.2"
104+
"constructs": "^2.0.0"
105105
},
106106
"engines": {
107107
"node": ">= 10.3.0"
@@ -111,5 +111,8 @@
111111
"exclude": [
112112
"construct-ctor-props-optional:@aws-cdk/aws-amplify.App"
113113
]
114+
},
115+
"awscdkio": {
116+
"announce": false
114117
}
115118
}

packages/@aws-cdk/aws-apigateway/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,8 @@ books.addMethod('GET', new apigateway.HttpIntegration('http://amazon.com'), {
455455
});
456456
```
457457

458+
You can find a full working example [here](test/authorizers/integ.token-authorizer.ts).
459+
458460
By default, the `TokenAuthorizer` looks for the authorization token in the request header with the key 'Authorization'. This can,
459461
however, be modified by changing the `identitySource` property.
460462

@@ -494,6 +496,8 @@ books.addMethod('GET', new apigateway.HttpIntegration('http://amazon.com'), {
494496
});
495497
```
496498

499+
You can find a full working example [here](test/authorizers/integ.request-authorizer.ts).
500+
497501
By default, the `RequestAuthorizer` does not pass any kind of information from the request. This can,
498502
however, be modified by changing the `identitySource` property, and is required when specifying a value for caching.
499503

packages/@aws-cdk/aws-apigateway/lib/authorizers/lambda.ts

+17-2
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,21 @@ abstract class LambdaAuthorizer extends Authorizer implements IAuthorizer {
111111
}));
112112
}
113113
}
114+
115+
/**
116+
* Returns a token that resolves to the Rest Api Id at the time of synthesis.
117+
* Throws an error, during token resolution, if no RestApi is attached to this authorizer.
118+
*/
119+
protected lazyRestApiId() {
120+
return Lazy.stringValue({
121+
produce: () => {
122+
if (!this.restApiId) {
123+
throw new Error(`Authorizer (${this.node.path}) must be attached to a RestApi`);
124+
}
125+
return this.restApiId;
126+
}
127+
});
128+
}
114129
}
115130

116131
/**
@@ -150,7 +165,7 @@ export class TokenAuthorizer extends LambdaAuthorizer {
150165
constructor(scope: Construct, id: string, props: TokenAuthorizerProps) {
151166
super(scope, id, props);
152167

153-
const restApiId = Lazy.stringValue({ produce: () => this.restApiId });
168+
const restApiId = this.lazyRestApiId();
154169
const resource = new CfnAuthorizer(this, 'Resource', {
155170
name: props.authorizerName ?? this.node.uniqueId,
156171
restApiId,
@@ -212,7 +227,7 @@ export class RequestAuthorizer extends LambdaAuthorizer {
212227
throw new Error(`At least one Identity Source is required for a REQUEST-based Lambda authorizer if caching is enabled.`);
213228
}
214229

215-
const restApiId = Lazy.stringValue({ produce: () => this.restApiId });
230+
const restApiId = this.lazyRestApiId();
216231
const resource = new CfnAuthorizer(this, 'Resource', {
217232
name: props.authorizerName ?? this.node.uniqueId,
218233
restApiId,

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

+6-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"@aws-cdk/aws-iam": "0.0.0",
7878
"@aws-cdk/aws-lambda": "0.0.0",
7979
"@aws-cdk/core": "0.0.0",
80-
"constructs": "^1.1.2"
80+
"constructs": "^2.0.0"
8181
},
8282
"homepage": "https://github.com/aws/aws-cdk",
8383
"peerDependencies": {
@@ -87,7 +87,7 @@
8787
"@aws-cdk/aws-iam": "0.0.0",
8888
"@aws-cdk/aws-lambda": "0.0.0",
8989
"@aws-cdk/core": "0.0.0",
90-
"constructs": "^1.1.2"
90+
"constructs": "^2.0.0"
9191
},
9292
"engines": {
9393
"node": ">= 10.3.0"
@@ -299,5 +299,8 @@
299299
"attribute-tag:@aws-cdk/aws-apigateway.TokenAuthorizer.authorizerArn"
300300
]
301301
},
302-
"stability": "stable"
302+
"stability": "stable",
303+
"awscdkio": {
304+
"announce": false
305+
}
303306
}

packages/@aws-cdk/aws-apigateway/test/authorizers/test.lambda.ts

+34-1
Original file line numberDiff line numberDiff line change
@@ -267,5 +267,38 @@ export = {
267267
expect(stack).notTo(haveResource('AWS::Lambda::Permission'));
268268

269269
test.done();
270-
}
270+
},
271+
272+
'token authorizer throws when not attached to a rest api'(test: Test) {
273+
const stack = new Stack();
274+
const func = new lambda.Function(stack, 'myfunction', {
275+
handler: 'handler',
276+
code: lambda.Code.fromInline('foo'),
277+
runtime: lambda.Runtime.NODEJS_12_X,
278+
});
279+
const auth = new TokenAuthorizer(stack, 'myauthorizer', {
280+
handler: func,
281+
});
282+
283+
test.throws(() => stack.resolve(auth.authorizerArn), /must be attached to a RestApi/);
284+
285+
test.done();
286+
},
287+
288+
'request authorizer throws when not attached to a rest api'(test: Test) {
289+
const stack = new Stack();
290+
const func = new lambda.Function(stack, 'myfunction', {
291+
handler: 'handler',
292+
code: lambda.Code.fromInline('foo'),
293+
runtime: lambda.Runtime.NODEJS_12_X,
294+
});
295+
const auth = new RequestAuthorizer(stack, 'myauthorizer', {
296+
handler: func,
297+
identitySources: [ IdentitySource.header('myheader') ],
298+
});
299+
300+
test.throws(() => stack.resolve(auth.authorizerArn), /must be attached to a RestApi/);
301+
302+
test.done();
303+
},
271304
};

0 commit comments

Comments
 (0)