Skip to content

Commit

Permalink
feat!: use stable api-gatewayv2 module (#464)
Browse files Browse the repository at this point in the history
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_
  • Loading branch information
echeung-amzn authored Dec 1, 2023
1 parent db46a9f commit 6339176
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 69 deletions.
16 changes: 3 additions & 13 deletions .projen/deps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions .projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 12 additions & 14 deletions .projenrc.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { awscdk, javascript, github, DependencyType } from "projen";

const CDK_VERSION = "2.99.0";
const CDK_VERSION = "2.112.0";

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

defaultReleaseBranch: "main",
majorVersion: 6,
majorVersion: 7,
stability: "experimental",

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

// Experimental modules
["@aws-cdk/aws-apigatewayv2-alpha", "@aws-cdk/aws-redshift-alpha"].forEach(
(dep) => {
project.deps.addDependency(
`${dep}@^${CDK_VERSION}-alpha.0`,
DependencyType.PEER
);
project.deps.addDependency(
`${dep}@${CDK_VERSION}-alpha.0`,
DependencyType.DEVENV
);
}
);
["@aws-cdk/aws-redshift-alpha"].forEach((dep) => {
project.deps.addDependency(
`${dep}@^${CDK_VERSION}-alpha.0`,
DependencyType.PEER
);
project.deps.addDependency(
`${dep}@${CDK_VERSION}-alpha.0`,
DependencyType.DEVENV
);
});
// https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/60310
project.deps.addDependency("@types/[email protected]", DependencyType.DEVENV);

Expand Down
8 changes: 4 additions & 4 deletions API.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@ In your `package.json`:
```json
{
"dependencies": {
"cdk-monitoring-constructs": "^6.0.0",
"cdk-monitoring-constructs": "^7.0.0",

// peer dependencies of cdk-monitoring-constructs
"@aws-cdk/aws-apigatewayv2-alpha": "^2.99.0-alpha.0",
"@aws-cdk/aws-redshift-alpha": "^2.99.0-alpha.0",
"aws-cdk-lib": "^2.99.0",
"@aws-cdk/aws-redshift-alpha": "^2.112.0-alpha.0",
"aws-cdk-lib": "^2.112.0",
"constructs": "^10.0.5"

// ...your other dependencies...
Expand Down
2 changes: 1 addition & 1 deletion lib/facade/MonitoringAspect.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as apigwv2 from "@aws-cdk/aws-apigatewayv2-alpha";
import * as redshift from "@aws-cdk/aws-redshift-alpha";
import { IAspect } from "aws-cdk-lib";
import * as apigw from "aws-cdk-lib/aws-apigateway";
import * as apigwv2 from "aws-cdk-lib/aws-apigatewayv2";
import * as appsync from "aws-cdk-lib/aws-appsync";
import * as autoscaling from "aws-cdk-lib/aws-autoscaling";
import * as acm from "aws-cdk-lib/aws-certificatemanager";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IHttpApi } from "@aws-cdk/aws-apigatewayv2-alpha";
import { IHttpApi } from "aws-cdk-lib/aws-apigatewayv2";
import { DimensionsMap } from "aws-cdk-lib/aws-cloudwatch";

import {
Expand Down Expand Up @@ -51,7 +51,7 @@ export class ApiGatewayV2HttpApiMetricFactory {
this.rateComputationMethod =
props.rateComputationMethod ?? RateComputationMethod.AVERAGE;
this.dimensionsMap = {
ApiId: props.api.httpApiId,
ApiId: props.api.apiId,
Stage: props.apiStage ?? "$default",
...(props.apiMethod && { Method: props.apiMethod }),
...(props.apiResource && { Resource: props.apiResource }),
Expand Down
10 changes: 4 additions & 6 deletions package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/facade/MonitoringAspect.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import path from "path";
import * as apigwv2 from "@aws-cdk/aws-apigatewayv2-alpha";
import * as redshift from "@aws-cdk/aws-redshift-alpha";
import { App, Duration, SecretValue, Stack } from "aws-cdk-lib";
import { Template } from "aws-cdk-lib/assertions";
import * as apigw from "aws-cdk-lib/aws-apigateway";
import * as apigwv2 from "aws-cdk-lib/aws-apigatewayv2";
import * as appsync from "aws-cdk-lib/aws-appsync";
import * as autoscaling from "aws-cdk-lib/aws-autoscaling";
import * as acm from "aws-cdk-lib/aws-certificatemanager";
Expand Down
2 changes: 1 addition & 1 deletion test/facade/__snapshots__/MonitoringAspect.test.ts.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HttpApi } from "@aws-cdk/aws-apigatewayv2-alpha";
import { Duration, Stack } from "aws-cdk-lib";
import { Template } from "aws-cdk-lib/assertions";
import { HttpApi } from "aws-cdk-lib/aws-apigatewayv2";

import {
AlarmWithAnnotation,
Expand Down
33 changes: 14 additions & 19 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6339176

Please sign in to comment.