Skip to content

Commit 2399bb5

Browse files
authored
Merge branch 'master' into compile-modules
2 parents e5bd4c9 + 23cfa3a commit 2399bb5

File tree

88 files changed

+1624
-306
lines changed

Some content is hidden

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

88 files changed

+1624
-306
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
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.138.2](https://github.com/aws/aws-cdk/compare/v1.138.1...v1.138.2) (2022-01-09)
6+
7+
8+
### Bug Fixes
9+
10+
* **cli:** breaks due to faulty version of `colors` ([#18324](https://github.com/aws/aws-cdk/issues/18324)) ([43bf9ae](https://github.com/aws/aws-cdk/commit/43bf9aec0b3c5e06d5382b29f4e8e0c91cd796ca))
11+
512
## [1.138.1](https://github.com/aws/aws-cdk/compare/v1.138.0...v1.138.1) (2022-01-07)
613

714

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ this capability, please see the
153153
## More Resources
154154
* [CDK Workshop](https://cdkworkshop.com/)
155155
* [Construct Hub](https://constructs.dev) - Find and use open-source Cloud Development Kit (CDK) libraries
156+
* Best Practices
157+
* [Best practices for developing cloud applications with AWS CDK](https://aws.amazon.com/blogs/devops/best-practices-for-developing-cloud-applications-with-aws-cdk/)
158+
* [Align with best practices while creating infrastructure using cdk aspects](https://aws.amazon.com/blogs/devops/align-with-best-practices-while-creating-infrastructure-using-cdk-aspects/)
159+
* [Recommended AWS CDK project structure for Python applications](https://aws.amazon.com/blogs/developer/recommended-aws-cdk-project-structure-for-python-applications/)
160+
* [Best practices for discoverability of a construct library on Construct Hub](https://aws.amazon.com/blogs/opensource/best-practices-for-discoverability-of-a-construct-library-on-construct-hub/)
161+
* [All developer blog posts about AWS CDK](https://aws.amazon.com/blogs/developer/category/developer-tools/aws-cloud-development-kit/)
156162
* **[CDK Construction Zone](https://www.twitch.tv/collections/9kCOGphNZBYVdA)** - A Twitch live coding series hosted by the CDK team, season one episodes:
157163
* Triggers: Join us as we implement [Triggers](https://github.com/aws/aws-cdk-rfcs/issues/71), a Construct for configuring deploy time actions. Episodes 1-3:
158164
* [S1E1](https://www.twitch.tv/videos/917691798): Triggers (part 1); **Participants:** @NetaNir, @eladb, @richardhboyd

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"typescript": "~3.9.10"
3232
},
3333
"resolutions": {
34+
"colors": "1.4.0",
3435
"string-width": "^4.2.3"
3536
},
3637
"repository": {
@@ -179,4 +180,4 @@
179180
"dependencies": {
180181
"string-width": "^4.2.3"
181182
}
182-
}
183+
}

packages/@aws-cdk/aws-apigatewayv2-authorizers/lib/websocket/lambda.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ export interface WebSocketLambdaAuthorizerProps {
2828
/**
2929
* The identity source for which authorization is requested.
3030
*
31-
* @default ['$request.header.Authorization']
31+
* Request parameter match `'route.request.querystring|header.[a-zA-z0-9._-]+'`.
32+
* Staged variable match `'stageVariables.[a-zA-Z0-9._-]+'`.
33+
* Context parameter match `'context.[a-zA-Z0-9._-]+'`.
34+
*
35+
* @default ['route.request.header.Authorization']
3236
*/
3337
readonly identitySource?: string[];
3438
}
@@ -56,7 +60,7 @@ export class WebSocketLambdaAuthorizer implements IWebSocketRouteAuthorizer {
5660
this.authorizer = new WebSocketAuthorizer(options.scope, this.id, {
5761
webSocketApi: options.route.webSocketApi,
5862
identitySource: this.props.identitySource ?? [
59-
'$request.header.Authorization',
63+
'route.request.header.Authorization',
6064
],
6165
type: WebSocketAuthorizerType.LAMBDA,
6266
authorizerName: this.props.authorizerName ?? this.id,

packages/@aws-cdk/aws-apigatewayv2-authorizers/test/websocket/lambda.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe('WebSocketLambdaAuthorizer', () => {
3535
Name: 'default-authorizer',
3636
AuthorizerType: 'REQUEST',
3737
IdentitySource: [
38-
'$request.header.Authorization',
38+
'route.request.header.Authorization',
3939
],
4040
});
4141

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

+12-8
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ If Amazon Route 53 is your DNS provider for the requested domain, the DNS record
4040
created automatically:
4141

4242
```ts
43-
import * as acm from '@aws-cdk/aws-certificatemanager';
44-
import * as route53 from '@aws-cdk/aws-route53';
45-
4643
const myHostedZone = new route53.HostedZone(this, 'HostedZone', {
4744
zoneName: 'example.com',
4845
});
@@ -106,6 +103,7 @@ The `DnsValidatedCertificate` construct exists to facilitate creating these cert
106103
Route53-based DNS validation.
107104

108105
```ts
106+
declare const myHostedZone: route53.HostedZone;
109107
new acm.DnsValidatedCertificate(this, 'CrossRegionCertificate', {
110108
domainName: 'hello.example.com',
111109
hostedZone: myHostedZone,
@@ -120,10 +118,10 @@ AWS Certificate Manager can create [private certificates](https://docs.aws.amazo
120118
```ts
121119
import * as acmpca from '@aws-cdk/aws-acmpca';
122120

123-
new acm.PrivateCertificate(stack, 'PrivateCertificate', {
121+
new acm.PrivateCertificate(this, 'PrivateCertificate', {
124122
domainName: 'test.example.com',
125123
subjectAlternativeNames: ['cool.example.com', 'test.example.net'], // optional
126-
certificateAuthority: acmpca.CertificateAuthority.fromCertificateAuthorityArn(stack, 'CA',
124+
certificateAuthority: acmpca.CertificateAuthority.fromCertificateAuthorityArn(this, 'CA',
127125
'arn:aws:acm-pca:us-east-1:123456789012:certificate-authority/023077d8-2bfa-4eb0-8f22-05c96deade77'),
128126
});
129127
```
@@ -134,7 +132,7 @@ If you want to import an existing certificate, you can do so from its ARN:
134132

135133
```ts
136134
const arn = 'arn:aws:...';
137-
const certificate = Certificate.fromCertificateArn(this, 'Certificate', arn);
135+
const certificate = acm.Certificate.fromCertificateArn(this, 'Certificate', arn);
138136
```
139137

140138
## Sharing between Stacks
@@ -152,8 +150,14 @@ An alarm can be created to determine whether a certificate is soon due for
152150
renewal ussing the following code:
153151

154152
```ts
155-
const certificate = new Certificate(this, 'Certificate', { /* ... */ });
156-
certificate.metricDaysToExpiry().createAlarm({
153+
import * as cloudwatch from '@aws-cdk/aws-cloudwatch';
154+
155+
declare const myHostedZone: route53.HostedZone;
156+
const certificate = new acm.Certificate(this, 'Certificate', {
157+
domainName: 'hello.example.com',
158+
validation: acm.CertificateValidation.fromDns(myHostedZone),
159+
});
160+
certificate.metricDaysToExpiry().createAlarm(this, 'Alarm', {
157161
comparisonOperator: cloudwatch.ComparisonOperator.LESS_THAN_THRESHOLD,
158162
evaluationPeriods: 1,
159163
threshold: 45, // Automatic rotation happens between 60 and 45 days before expiry

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,14 @@
2828
]
2929
}
3030
},
31-
"projectReferences": true
31+
"projectReferences": true,
32+
"metadata": {
33+
"jsii": {
34+
"rosetta": {
35+
"strict": true
36+
}
37+
}
38+
}
3239
},
3340
"repository": {
3441
"type": "git",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Fixture with packages imported, but nothing else
2+
import { Stack } from '@aws-cdk/core';
3+
import { Construct } from 'constructs';
4+
import * as acm from '@aws-cdk/aws-certificatemanager';
5+
import * as route53 from '@aws-cdk/aws-route53';
6+
7+
class Fixture extends Stack {
8+
constructor(scope: Construct, id: string) {
9+
super(scope, id);
10+
/// here
11+
}
12+
}

packages/@aws-cdk/aws-cloudfront-origins/README.md

+6-8
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ An S3 bucket can be added as an origin. If the bucket is configured as a website
1818
documents.
1919

2020
```ts
21-
import * as cloudfront from '@aws-cdk/aws-cloudfront';
22-
import * as origins from '@aws-cdk/aws-cloudfront-origins';
23-
2421
const myBucket = new s3.Bucket(this, 'myBucket');
2522
new cloudfront.Distribution(this, 'myDist', {
2623
defaultBehavior: { origin: new origins.S3Origin(myBucket) },
@@ -38,9 +35,6 @@ URLs and not S3 URLs directly. Alternatively, a custom origin access identity ca
3835
You can configure CloudFront to add custom headers to the requests that it sends to your origin. These custom headers enable you to send and gather information from your origin that you don’t get with typical viewer requests. These headers can even be customized for each origin. CloudFront supports custom headers for both for custom and Amazon S3 origins.
3936

4037
```ts
41-
import * as cloudfront from '@aws-cdk/aws-cloudfront';
42-
import * as origins from '@aws-cdk/aws-cloudfront-origins';
43-
4438
const myBucket = new s3.Bucket(this, 'myBucket');
4539
new cloudfront.Distribution(this, 'myDist', {
4640
defaultBehavior: { origin: new origins.S3Origin(myBucket, {
@@ -60,12 +54,12 @@ accessible (`internetFacing` is true). Both Application and Network load balance
6054
import * as ec2 from '@aws-cdk/aws-ec2';
6155
import * as elbv2 from '@aws-cdk/aws-elasticloadbalancingv2';
6256

63-
const vpc = new ec2.Vpc(...);
57+
declare const vpc: ec2.Vpc;
6458
// Create an application load balancer in a VPC. 'internetFacing' must be 'true'
6559
// for CloudFront to access the load balancer and use it as an origin.
6660
const lb = new elbv2.ApplicationLoadBalancer(this, 'LB', {
6761
vpc,
68-
internetFacing: true
62+
internetFacing: true,
6963
});
7064
new cloudfront.Distribution(this, 'myDist', {
7165
defaultBehavior: { origin: new origins.LoadBalancerV2Origin(lb) },
@@ -75,6 +69,9 @@ new cloudfront.Distribution(this, 'myDist', {
7569
The origin can also be customized to respond on different ports, have different connection properties, etc.
7670

7771
```ts
72+
import * as elbv2 from '@aws-cdk/aws-elasticloadbalancingv2';
73+
74+
declare const loadBalancer: elbv2.ApplicationLoadBalancer;
7875
const origin = new origins.LoadBalancerV2Origin(loadBalancer, {
7976
connectionAttempts: 3,
8077
connectionTimeout: Duration.seconds(5),
@@ -103,6 +100,7 @@ CloudFront automatically switches to the secondary origin.
103100
You achieve that behavior in the CDK using the `OriginGroup` class:
104101

105102
```ts
103+
const myBucket = new s3.Bucket(this, 'myBucket');
106104
new cloudfront.Distribution(this, 'myDist', {
107105
defaultBehavior: {
108106
origin: new origins.OriginGroup({

packages/@aws-cdk/aws-cloudfront-origins/package.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,14 @@
2828
]
2929
}
3030
},
31-
"projectReferences": true
31+
"projectReferences": true,
32+
"metadata": {
33+
"jsii": {
34+
"rosetta": {
35+
"strict": true
36+
}
37+
}
38+
}
3239
},
3340
"repository": {
3441
"type": "git",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Fixture with packages imported, but nothing else
2+
import { Duration, Stack } from '@aws-cdk/core';
3+
import { Construct } from 'constructs';
4+
import * as cloudfront from '@aws-cdk/aws-cloudfront';
5+
import * as origins from '@aws-cdk/aws-cloudfront-origins';
6+
import * as s3 from '@aws-cdk/aws-s3';
7+
8+
class Fixture extends Stack {
9+
constructor(scope: Construct, id: string) {
10+
super(scope, id);
11+
12+
/// here
13+
14+
}
15+
}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
"@aws-cdk/pkglint": "0.0.0",
8787
"@types/jest": "^27.0.3",
8888
"aws-sdk": "^2.848.0",
89-
"colors": "^1.4.0",
89+
"colors": "1.4.0",
9090
"jest": "^27.4.5"
9191
},
9292
"dependencies": {
@@ -128,4 +128,4 @@
128128
"publishConfig": {
129129
"tag": "latest"
130130
}
131-
}
131+
}

0 commit comments

Comments
 (0)