Skip to content

Commit 78258fd

Browse files
authored
Merge branch 'main' into feat-mariadb-july22
2 parents 6714a49 + 72b1b2c commit 78258fd

569 files changed

Lines changed: 22377 additions & 1850 deletions

File tree

Some content is hidden

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

.github/semantic.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

CHANGELOG.v2.alpha.md

Lines changed: 24 additions & 0 deletions
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+
## [2.35.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.34.2-alpha.0...v2.35.0-alpha.0) (2022-08-02)
6+
7+
8+
### Bug Fixes
9+
10+
* **cognito-identitypool:** providerUrl causes error when mappingKey is not provided and it is a token ([#21191](https://github.com/aws/aws-cdk/issues/21191)) ([d91c904](https://github.com/aws/aws-cdk/commit/d91c9045b2ca027947c94ff8b93adb80f8ca8434)), closes [#19222](https://github.com/aws/aws-cdk/issues/19222) [/github.com/aws/aws-cdk/pull/21056#issuecomment-1178879318](https://github.com/aws//github.com/aws/aws-cdk/pull/21056/issues/issuecomment-1178879318)
11+
12+
## [2.34.2-alpha.0](https://github.com/aws/aws-cdk/compare/v2.34.1-alpha.0...v2.34.2-alpha.0) (2022-07-29)
13+
14+
## [2.34.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.34.0-alpha.0...v2.34.1-alpha.0) (2022-07-29)
15+
16+
### Bug Fixes
17+
18+
* Revert to `jsii-pacmak@1.62.0` as dynamic runtime type-checking it introduced for Python results in incorrect code being produced.
19+
20+
21+
## [2.34.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.33.0-alpha.0...v2.34.0-alpha.0) (2022-07-28)
22+
23+
24+
### Features
25+
26+
* **appsync:** support for read consistency during DynamoDB reads ([#20793](https://github.com/aws/aws-cdk/issues/20793)) ([0b911ef](https://github.com/aws/aws-cdk/commit/0b911efd75c02bb6117d6e32c0112f58da5192b7))
27+
* **batch:** add default AWS_ACCOUNT and AWS_REGION to Batch container, if they are not explicitly set ([#21041](https://github.com/aws/aws-cdk/issues/21041)) ([eed854e](https://github.com/aws/aws-cdk/commit/eed854ed4be6b76abc909721d6baa14140681dcc))
28+
529
## [2.33.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.32.1-alpha.0...v2.33.0-alpha.0) (2022-07-19)
630

731

CHANGELOG.v2.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,72 @@
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+
## [2.35.0](https://github.com/aws/aws-cdk/compare/v2.34.2...v2.35.0) (2022-08-02)
6+
7+
8+
### Features
9+
10+
* **config:** add support for eks-cluster-xxx-version managed rule ([#21344](https://github.com/aws/aws-cdk/issues/21344)) ([82e8100](https://github.com/aws/aws-cdk/commit/82e81008c08669429c19c5b864292b256aaf976e)), closes [#21254](https://github.com/aws/aws-cdk/issues/21254)
11+
* **core:** cache fingerprints of large assets ([#21321](https://github.com/aws/aws-cdk/issues/21321)) ([17f1ec8](https://github.com/aws/aws-cdk/commit/17f1ec881ba8fb300bd4cf8674a87640ab05c31a)), closes [#21297](https://github.com/aws/aws-cdk/issues/21297)
12+
* **ec2:** add missing endpoints to InterfaceVpcEndpointAwsService ([#21401](https://github.com/aws/aws-cdk/issues/21401)) ([c64cccb](https://github.com/aws/aws-cdk/commit/c64cccb0f17d014f978b8df38f47dcfa254c89e6)), closes [#21402](https://github.com/aws/aws-cdk/issues/21402) [#21220](https://github.com/aws/aws-cdk/issues/21220) [#21338](https://github.com/aws/aws-cdk/issues/21338) [#19420](https://github.com/aws/aws-cdk/issues/19420)
13+
* **events-targets:** add dlq support for ecs target ([#21396](https://github.com/aws/aws-cdk/issues/21396)) ([e82ba52](https://github.com/aws/aws-cdk/commit/e82ba52ac5c27863cc30309502ecd45810f96803)), closes [#21118](https://github.com/aws/aws-cdk/issues/21118)
14+
* **fsx:** support AutoImportPolicy in LustreFilesystem ([#21301](https://github.com/aws/aws-cdk/issues/21301)) ([b1ce472](https://github.com/aws/aws-cdk/commit/b1ce472ed2a15480980286f21a028fdc20cdb91d))
15+
* **fsx:** support DataCompressionType in LustreConfiguration ([#21392](https://github.com/aws/aws-cdk/issues/21392)) ([214a792](https://github.com/aws/aws-cdk/commit/214a7921616fa2cf3031e17cc26308772878fefd)), closes [#16431](https://github.com/aws/aws-cdk/issues/16431)
16+
* **opensearch:** add support for latest amazon opensearch service 1.3 ([#21413](https://github.com/aws/aws-cdk/issues/21413)) ([aa55715](https://github.com/aws/aws-cdk/commit/aa5571532f046158cde3da6080a8b19d9b1339e0)), closes [#21414](https://github.com/aws/aws-cdk/issues/21414)
17+
* **pipelines:** allow use of custom role for pipeline ([#21299](https://github.com/aws/aws-cdk/issues/21299)) ([ff3c01a](https://github.com/aws/aws-cdk/commit/ff3c01a85d1bd32c149e83fda5bf44ec3253e99d)), closes [#21412](https://github.com/aws/aws-cdk/issues/21412)
18+
* **rds:** add copyTagsToSnapshot to the construct props for ServerlessCluster and ServerlessClusterFromSnapshot ([#21056](https://github.com/aws/aws-cdk/issues/21056)) ([47333a1](https://github.com/aws/aws-cdk/commit/47333a12f83fbac6c8174bd7fe13f1e41159f8ae)), closes [#20968](https://github.com/aws/aws-cdk/issues/20968)
19+
20+
21+
### Bug Fixes
22+
23+
* **appmesh:** routes with weight 0 are assigned a weight of 1 ([#21400](https://github.com/aws/aws-cdk/issues/21400)) ([fa0341f](https://github.com/aws/aws-cdk/commit/fa0341f9caceff040a1af5b6ee7b4f8a736d02bf))
24+
* **cognito:** UserPoolClient doesn't correctly respect authFlows ([#21386](https://github.com/aws/aws-cdk/issues/21386)) ([daf178a](https://github.com/aws/aws-cdk/commit/daf178aa38632c9b830c20924a77b27b04698ce9)), closes [#16236](https://github.com/aws/aws-cdk/issues/16236)
25+
* **core:** asset fingerprint cache invalidation incorrectly uses mtime ([#21374](https://github.com/aws/aws-cdk/issues/21374)) ([65a210a](https://github.com/aws/aws-cdk/commit/65a210aaaf8f45095170bca7779fd274aab54a00)), closes [#21321](https://github.com/aws/aws-cdk/issues/21321)
26+
* **ecs:** ec2Service placement strategies use incorrect casing which causes drift ([#20946](https://github.com/aws/aws-cdk/issues/20946)) ([715158f](https://github.com/aws/aws-cdk/commit/715158f44ae1576361b93ec529f09d7dc0472c3b)), closes [#20812](https://github.com/aws/aws-cdk/issues/20812)
27+
* **ecs:** new arn format not supported (under feature flag) ([#18140](https://github.com/aws/aws-cdk/issues/18140)) ([9749a57](https://github.com/aws/aws-cdk/commit/9749a5725c4f5cb13313a3d28d6b52e85c59548b)), closes [#16634](https://github.com/aws/aws-cdk/issues/16634) [#18137](https://github.com/aws/aws-cdk/issues/18137)
28+
* **eks:** cannot disable cluster logging once it has been enabled ([#21185](https://github.com/aws/aws-cdk/issues/21185)) ([e41b073](https://github.com/aws/aws-cdk/commit/e41b073415bf68c8862219242d8f92c7fb6c16bb)), closes [#18112](https://github.com/aws/aws-cdk/issues/18112) [#20707](https://github.com/aws/aws-cdk/issues/20707) [#19898](https://github.com/aws/aws-cdk/issues/19898)
29+
* **events:** archive construct does not have defaultChild set ([#21345](https://github.com/aws/aws-cdk/issues/21345)) ([de7d825](https://github.com/aws/aws-cdk/commit/de7d825a32e7d4ab7fd168ee61eb4243d87f41ff)), closes [#21263](https://github.com/aws/aws-cdk/issues/21263)
30+
31+
32+
### Reverts
33+
34+
* **cli:** cannot pass objects and numbers as context arguments ([#21387](https://github.com/aws/aws-cdk/issues/21387)) ([2fa85b9](https://github.com/aws/aws-cdk/commit/2fa85b99d643cd35c9685a0bd7d857ffdf55c486)), closes [aws/aws-cdk#20068](https://github.com/aws/aws-cdk/issues/20068)
35+
36+
## [2.34.2](https://github.com/aws/aws-cdk/compare/v2.34.1...v2.34.2) (2022-07-29)
37+
38+
### Bug Fixes
39+
40+
* **cli:** context value type conversion causing parse failures ([21381](https://github.com/aws/aws-cdk/issues/21381))
41+
42+
## [2.34.1](https://github.com/aws/aws-cdk/compare/v2.34.0...v2.34.1) (2022-07-29)
43+
44+
### Bug Fixes
45+
46+
* Revert to `jsii-pacmak@1.62.0` as dynamic runtime type-checking it introduced for Python results in incorrect code being produced.
47+
48+
## [2.34.0](https://github.com/aws/aws-cdk/compare/v2.33.0...v2.34.0) (2022-07-28)
49+
50+
51+
### Features
52+
53+
* **api-gateway:** allow configuration of deployment description ([#21207](https://github.com/aws/aws-cdk/issues/21207)) ([03fc2bd](https://github.com/aws/aws-cdk/commit/03fc2bdbff5b3678e02b1017c575a681d5b9f786))
54+
* **cfnspec:** cloudformation spec v81.1.0 ([#21307](https://github.com/aws/aws-cdk/issues/21307)) ([1f91112](https://github.com/aws/aws-cdk/commit/1f9111249b3955286dd42aa0c647ec0bdace12d9))
55+
* **cli:** cannot pass objects and numbers as context arguments ([#20068](https://github.com/aws/aws-cdk/issues/20068)) ([ec2d68a](https://github.com/aws/aws-cdk/commit/ec2d68a933342bd1ce0601ab25e677806e1ec4bd))
56+
* **ec2:** add R6A instances ([#21257](https://github.com/aws/aws-cdk/issues/21257)) ([f66f94e](https://github.com/aws/aws-cdk/commit/f66f94e9201b9c9d5e0f1b713a6f30194b323b28))
57+
* **ecs:** add function to grant run permissions to task definition ([#21241](https://github.com/aws/aws-cdk/issues/21241)) ([d7ac3bb](https://github.com/aws/aws-cdk/commit/d7ac3bb1dbe56e6268c74f5853420296596d5793)), closes [#20281](https://github.com/aws/aws-cdk/issues/20281)
58+
* **lambda-event-sources:** add AT_TIMESTAMP event source mapping starting position ([#20741](https://github.com/aws/aws-cdk/issues/20741)) ([76e0768](https://github.com/aws/aws-cdk/commit/76e0768f6d69b555925bb3c016861f517a01ecae))
59+
60+
61+
### Bug Fixes
62+
63+
* **aws-lambda:** FunctionUrl incorrectly uses Alias ARNs ([#21353](https://github.com/aws/aws-cdk/issues/21353)) ([2904d2a](https://github.com/aws/aws-cdk/commit/2904d2a53c2fe7d19e5839fc3fe6c9e94e7971c9))
64+
* **bootstrap:** remove image scanning configuration ([#21342](https://github.com/aws/aws-cdk/issues/21342)) ([2d26916](https://github.com/aws/aws-cdk/commit/2d269165b56c3fb19a75138be9109ca7a44137ac))
65+
* **cli:** add validation of --notification-arns structure ([#21270](https://github.com/aws/aws-cdk/issues/21270)) ([6d157d1](https://github.com/aws/aws-cdk/commit/6d157d1292978ad2fc4cd3fcabe874091a2cf856)), closes [#20806](https://github.com/aws/aws-cdk/issues/20806)
66+
* **ecr:** Repository.addToResourcePolicy returns incorrect result ([#21137](https://github.com/aws/aws-cdk/issues/21137)) ([5435215](https://github.com/aws/aws-cdk/commit/54352150da814fd3c6c347d102b8b30b340a156d))
67+
* **ecs:** firelens configFileValue is unnecessarily required ([#20636](https://github.com/aws/aws-cdk/issues/20636)) ([b79b2e4](https://github.com/aws/aws-cdk/commit/b79b2e4702c77a56f24e516702e7f69d59d9284f))
68+
* **ecs-patterns:** memory limit is not set at the container level ([#21201](https://github.com/aws/aws-cdk/issues/21201)) ([f2098b7](https://github.com/aws/aws-cdk/commit/f2098b727534f90323f9571bcded7390710eb48f))
69+
* **pkglint:** allow dependencies on L1 only modules ([#21208](https://github.com/aws/aws-cdk/issues/21208)) ([f16fd69](https://github.com/aws/aws-cdk/commit/f16fd69f51b817f7715d007992af24fc87ca2201))
70+
571
## [2.33.0](https://github.com/aws/aws-cdk/compare/v2.32.1...v2.33.0) (2022-07-19)
672

773

buildspec-pr.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ phases:
1010
# this also takes care of launching the docker daemon.
1111
- /root/ecr-proxy/start.sh
1212

13+
# CodeBuild always runs as root, allow npm to operate as such
14+
- npm config set unsafe-perm true
15+
1316
# Install yarn if it wasn't already present in the image
1417
- yarn --version || npm -g install yarn
1518

buildspec.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ phases:
1010
# this also takes care of launching the docker daemon.
1111
- /root/ecr-proxy/start.sh
1212

13+
# CodeBuild always runs as root, allow npm to operate as such
14+
- npm config set unsafe-perm true
15+
1316
# Install yarn if it wasn't already present in the image
1417
- yarn --version || npm -g install yarn
1518

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
"devDependencies": {
1919
"@types/prettier": "2.6.0",
2020
"@yarnpkg/lockfile": "^1.1.0",
21-
"cdk-generate-synthetic-examples": "^0.1.12",
21+
"cdk-generate-synthetic-examples": "^0.1.14",
2222
"conventional-changelog-cli": "^2.2.2",
2323
"fs-extra": "^9.1.0",
2424
"graceful-fs": "^4.2.10",
2525
"jest-junit": "^13.2.0",
26-
"jsii-diff": "^1.62.0",
27-
"jsii-pacmak": "^1.62.0",
28-
"jsii-reflect": "^1.62.0",
29-
"jsii-rosetta": "^1.62.0",
26+
"jsii-diff": "^1.63.2",
27+
"jsii-pacmak": "^1.63.2",
28+
"jsii-reflect": "^1.63.2",
29+
"jsii-rosetta": "^1.63.2",
3030
"lerna": "^4.0.0",
3131
"patch-package": "^6.4.7",
3232
"semver": "^6.3.0",

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,13 +1305,19 @@ in your openApi file.
13051305
## Metrics
13061306

13071307
The API Gateway service sends metrics around the performance of Rest APIs to Amazon CloudWatch.
1308-
These metrics can be referred to using the metric APIs available on the `RestApi` construct.
1309-
The APIs with the `metric` prefix can be used to get reference to specific metrics for this API. For example,
1310-
the method below refers to the client side errors metric for this API.
1308+
These metrics can be referred to using the metric APIs available on the `RestApi`, `Stage` and `Method` constructs.
1309+
Note that detailed metrics must be enabled for a stage to use the `Method` metrics.
1310+
Read more about [API Gateway metrics](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-metrics-and-dimensions.html), including enabling detailed metrics.
1311+
The APIs with the `metric` prefix can be used to get reference to specific metrics for this API. For example:
13111312

13121313
```ts
13131314
const api = new apigateway.RestApi(this, 'my-api');
1314-
const clientErrorMetric = api.metricClientError();
1315+
const stage = api.deploymentStage;
1316+
const method = api.root.addMethod('GET');
1317+
1318+
const clientErrorApiMetric = api.metricClientError();
1319+
const serverErrorStageMetric = stage.metricServerError();
1320+
const latencyMethodMetric = method.metricLatency(stage);
13151321
```
13161322

13171323
## APIGateway v2

packages/@aws-cdk/aws-apigateway/lib/method.ts

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import * as cloudwatch from '@aws-cdk/aws-cloudwatch';
12
import { ArnFormat, Lazy, Resource, Stack } from '@aws-cdk/core';
23
import { Construct } from 'constructs';
4+
import { ApiGatewayMetrics } from './apigateway-canned-metrics.generated';
35
import { CfnMethod, CfnMethodProps } from './apigateway.generated';
46
import { Authorizer, IAuthorizer } from './authorizer';
57
import { Integration, IntegrationConfig } from './integration';
@@ -9,6 +11,7 @@ import { IModel } from './model';
911
import { IRequestValidator, RequestValidatorOptions } from './requestvalidator';
1012
import { IResource } from './resource';
1113
import { IRestApi, RestApi, RestApiBase } from './restapi';
14+
import { IStage } from './stage';
1215
import { validateHttpMethod } from './util';
1316

1417
export interface MethodOptions {
@@ -364,6 +367,100 @@ export class Method extends Resource {
364367
// For backward compatibility
365368
return options.requestValidator?.requestValidatorId;
366369
}
370+
371+
/**
372+
* Returns the given named metric for this API method
373+
*/
374+
public metric(metricName: string, stage: IStage, props?: cloudwatch.MetricOptions): cloudwatch.Metric {
375+
return new cloudwatch.Metric({
376+
namespace: 'AWS/ApiGateway',
377+
metricName,
378+
dimensionsMap: { ApiName: this.api.restApiName, Method: this.httpMethod, Resource: this.resource.path, Stage: stage.stageName },
379+
...props,
380+
}).attachTo(this);
381+
}
382+
383+
/**
384+
* Metric for the number of client-side errors captured in a given period.
385+
*
386+
* @default - sum over 5 minutes
387+
*/
388+
public metricClientError(stage: IStage, props?: cloudwatch.MetricOptions): cloudwatch.Metric {
389+
return this.cannedMetric(ApiGatewayMetrics._4XxErrorSum, stage, props);
390+
}
391+
392+
/**
393+
* Metric for the number of server-side errors captured in a given period.
394+
*
395+
* @default - sum over 5 minutes
396+
*/
397+
public metricServerError(stage: IStage, props?: cloudwatch.MetricOptions): cloudwatch.Metric {
398+
return this.cannedMetric(ApiGatewayMetrics._5XxErrorSum, stage, props);
399+
}
400+
401+
/**
402+
* Metric for the number of requests served from the API cache in a given period.
403+
*
404+
* @default - sum over 5 minutes
405+
*/
406+
public metricCacheHitCount(stage: IStage, props?: cloudwatch.MetricOptions): cloudwatch.Metric {
407+
return this.cannedMetric(ApiGatewayMetrics.cacheHitCountSum, stage, props);
408+
}
409+
410+
/**
411+
* Metric for the number of requests served from the backend in a given period,
412+
* when API caching is enabled.
413+
*
414+
* @default - sum over 5 minutes
415+
*/
416+
public metricCacheMissCount(stage: IStage, props?: cloudwatch.MetricOptions): cloudwatch.Metric {
417+
return this.cannedMetric(ApiGatewayMetrics.cacheMissCountSum, stage, props);
418+
}
419+
420+
/**
421+
* Metric for the total number API requests in a given period.
422+
*
423+
* @default - sample count over 5 minutes
424+
*/
425+
public metricCount(stage: IStage, props?: cloudwatch.MetricOptions): cloudwatch.Metric {
426+
return this.cannedMetric(ApiGatewayMetrics.countSum, stage, {
427+
statistic: 'SampleCount',
428+
...props,
429+
});
430+
}
431+
432+
/**
433+
* Metric for the time between when API Gateway relays a request to the backend
434+
* and when it receives a response from the backend.
435+
*
436+
* @default - average over 5 minutes.
437+
*/
438+
public metricIntegrationLatency(stage: IStage, props?: cloudwatch.MetricOptions): cloudwatch.Metric {
439+
return this.cannedMetric(ApiGatewayMetrics.integrationLatencyAverage, stage, props);
440+
}
441+
442+
/**
443+
* The time between when API Gateway receives a request from a client
444+
* and when it returns a response to the client.
445+
* The latency includes the integration latency and other API Gateway overhead.
446+
*
447+
* @default - average over 5 minutes.
448+
*/
449+
public metricLatency(stage: IStage, props?: cloudwatch.MetricOptions): cloudwatch.Metric {
450+
return this.cannedMetric(ApiGatewayMetrics.latencyAverage, stage, props);
451+
}
452+
453+
private cannedMetric(fn: (dims: {
454+
ApiName: string;
455+
Method: string;
456+
Resource: string;
457+
Stage: string;
458+
}) => cloudwatch.MetricProps, stage: IStage, props?: cloudwatch.MetricOptions) {
459+
return new cloudwatch.Metric({
460+
...fn({ ApiName: this.api.restApiName, Method: this.httpMethod, Resource: this.resource.path, Stage: stage.stageName }),
461+
...props,
462+
}).attachTo(this);
463+
}
367464
}
368465

369466
export enum AuthorizationType {

packages/@aws-cdk/aws-apigateway/lib/restapi.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ export interface IRestApi extends IResourceBase {
2828
*/
2929
readonly restApiId: string;
3030

31+
/**
32+
* The name of this API Gateway RestApi.
33+
* @attribute
34+
*/
35+
readonly restApiName: string;
36+
3137
/**
3238
* The resource ID of the root resource.
3339
* @attribute
@@ -673,6 +679,13 @@ export interface RestApiAttributes {
673679
*/
674680
readonly restApiId: string;
675681

682+
/**
683+
* The name of the API Gateway RestApi.
684+
*
685+
* @default - ID of the RestApi construct.
686+
*/
687+
readonly restApiName?: string;
688+
676689
/**
677690
* The resource ID of the root resource.
678691
*/
@@ -713,6 +726,7 @@ export class RestApi extends RestApiBase {
713726
public static fromRestApiAttributes(scope: Construct, id: string, attrs: RestApiAttributes): IRestApi {
714727
class Import extends RestApiBase {
715728
public readonly restApiId = attrs.restApiId;
729+
public readonly restApiName = attrs.restApiName ?? id;
716730
public readonly restApiRootResourceId = attrs.rootResourceId;
717731
public readonly root: IResource = new RootResource(this, {}, this.restApiRootResourceId);
718732
}

0 commit comments

Comments
 (0)