Skip to content

Commit 6339176

Browse files
author
Eugene Cheung
authored
feat!: use stable api-gatewayv2 module (#464)
BREAKING CHANGE: requires aws-cdk-lib@^2.112.0 The API Gateway v2 modules were promoted to stable in https://github.com/aws/aws-cdk/releases/tag/v2.112.0. --- _By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license_
1 parent db46a9f commit 6339176

File tree

12 files changed

+49
-69
lines changed

12 files changed

+49
-69
lines changed

.projen/deps.json

Lines changed: 3 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projen/tasks.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projenrc.ts

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { awscdk, javascript, github, DependencyType } from "projen";
22

3-
const CDK_VERSION = "2.99.0";
3+
const CDK_VERSION = "2.112.0";
44

55
const project = new awscdk.AwsCdkConstructLibrary({
66
name: "cdk-monitoring-constructs",
@@ -11,7 +11,7 @@ const project = new awscdk.AwsCdkConstructLibrary({
1111
keywords: ["cloudwatch", "monitoring"],
1212

1313
defaultReleaseBranch: "main",
14-
majorVersion: 6,
14+
majorVersion: 7,
1515
stability: "experimental",
1616

1717
cdkVersion: CDK_VERSION,
@@ -69,18 +69,16 @@ _By submitting this pull request, I confirm that my contribution is made under t
6969
});
7070

7171
// Experimental modules
72-
["@aws-cdk/aws-apigatewayv2-alpha", "@aws-cdk/aws-redshift-alpha"].forEach(
73-
(dep) => {
74-
project.deps.addDependency(
75-
`${dep}@^${CDK_VERSION}-alpha.0`,
76-
DependencyType.PEER
77-
);
78-
project.deps.addDependency(
79-
`${dep}@${CDK_VERSION}-alpha.0`,
80-
DependencyType.DEVENV
81-
);
82-
}
83-
);
72+
["@aws-cdk/aws-redshift-alpha"].forEach((dep) => {
73+
project.deps.addDependency(
74+
`${dep}@^${CDK_VERSION}-alpha.0`,
75+
DependencyType.PEER
76+
);
77+
project.deps.addDependency(
78+
`${dep}@${CDK_VERSION}-alpha.0`,
79+
DependencyType.DEVENV
80+
);
81+
});
8482
// https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/60310
8583
project.deps.addDependency("@types/[email protected]", DependencyType.DEVENV);
8684

API.md

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,11 @@ In your `package.json`:
2626
```json
2727
{
2828
"dependencies": {
29-
"cdk-monitoring-constructs": "^6.0.0",
29+
"cdk-monitoring-constructs": "^7.0.0",
3030

3131
// peer dependencies of cdk-monitoring-constructs
32-
"@aws-cdk/aws-apigatewayv2-alpha": "^2.99.0-alpha.0",
33-
"@aws-cdk/aws-redshift-alpha": "^2.99.0-alpha.0",
34-
"aws-cdk-lib": "^2.99.0",
32+
"@aws-cdk/aws-redshift-alpha": "^2.112.0-alpha.0",
33+
"aws-cdk-lib": "^2.112.0",
3534
"constructs": "^10.0.5"
3635

3736
// ...your other dependencies...

lib/facade/MonitoringAspect.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import * as apigwv2 from "@aws-cdk/aws-apigatewayv2-alpha";
21
import * as redshift from "@aws-cdk/aws-redshift-alpha";
32
import { IAspect } from "aws-cdk-lib";
43
import * as apigw from "aws-cdk-lib/aws-apigateway";
4+
import * as apigwv2 from "aws-cdk-lib/aws-apigatewayv2";
55
import * as appsync from "aws-cdk-lib/aws-appsync";
66
import * as autoscaling from "aws-cdk-lib/aws-autoscaling";
77
import * as acm from "aws-cdk-lib/aws-certificatemanager";

lib/monitoring/aws-apigatewayv2/ApiGatewayV2HttpApiMetricFactory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { IHttpApi } from "@aws-cdk/aws-apigatewayv2-alpha";
1+
import { IHttpApi } from "aws-cdk-lib/aws-apigatewayv2";
22
import { DimensionsMap } from "aws-cdk-lib/aws-cloudwatch";
33

44
import {
@@ -51,7 +51,7 @@ export class ApiGatewayV2HttpApiMetricFactory {
5151
this.rateComputationMethod =
5252
props.rateComputationMethod ?? RateComputationMethod.AVERAGE;
5353
this.dimensionsMap = {
54-
ApiId: props.api.httpApiId,
54+
ApiId: props.api.apiId,
5555
Stage: props.apiStage ?? "$default",
5656
...(props.apiMethod && { Method: props.apiMethod }),
5757
...(props.apiResource && { Resource: props.apiResource }),

package.json

Lines changed: 4 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/facade/MonitoringAspect.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import path from "path";
2-
import * as apigwv2 from "@aws-cdk/aws-apigatewayv2-alpha";
32
import * as redshift from "@aws-cdk/aws-redshift-alpha";
43
import { App, Duration, SecretValue, Stack } from "aws-cdk-lib";
54
import { Template } from "aws-cdk-lib/assertions";
65
import * as apigw from "aws-cdk-lib/aws-apigateway";
6+
import * as apigwv2 from "aws-cdk-lib/aws-apigatewayv2";
77
import * as appsync from "aws-cdk-lib/aws-appsync";
88
import * as autoscaling from "aws-cdk-lib/aws-autoscaling";
99
import * as acm from "aws-cdk-lib/aws-certificatemanager";

test/facade/__snapshots__/MonitoringAspect.test.ts.snap

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)