Skip to content

Commit 256e742

Browse files
author
Eugene Cheung
authored
feat!: upgrade to CDK v2 (#83)
Closes #37 ~~This is actually blocked by #48, so we should address that separately first.~~ Of note: - CDK v2 doesn't bundle experimental APIs in, so they're separate `@aws-cdk` modules. This makes the peer dependencies quite awkward. - `dimensions` is no longer accessible in the `Metric` props, forcing us to use `dimensionsMap`, which is typed to only allow `string` values. ~~I'm not entirely sure if forcibly putting non-string values works properly.~~ - The `@aws-cdk/aws-secretsmanager:parseOwnedSecretName` feature flag is removed in CDK v2. - It's otherwise mostly just import changes Relevant docs: - https://docs.aws.amazon.com/cdk/v2/guide/migrating-v2.html --- _By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license_
1 parent 769ffe7 commit 256e742

File tree

233 files changed

+6994
-1851
lines changed

Some content is hidden

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

233 files changed

+6994
-1851
lines changed

.github/workflows/build.yml

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

.github/workflows/release.yml

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

.github/workflows/upgrade-main.yml

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

.projen/deps.json

Lines changed: 68 additions & 8 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 & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projenrc.js

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1-
const { awscdk, DependencyType, javascript } = require("projen");
1+
const { awscdk, javascript, DependencyType } = require("projen");
22
const { workflows } = require("projen/lib/github");
33

4-
const CDK_VERSION = "1.123.0";
5-
const CONSTRUCTS_VERSION = "3.3.69";
4+
const CDK_VERSION = "2.18.0";
65

76
const project = new awscdk.AwsCdkConstructLibrary({
87
name: "cdk-monitoring-constructs",
98
repositoryUrl: "https://github.com/cdklabs/cdk-monitoring-constructs",
109
author: "CDK Monitoring Constructs Team",
1110
authorAddress: "[email protected]",
11+
1212
defaultReleaseBranch: "main",
13+
majorVersion: 1,
14+
// releaseBranches: {
15+
// monocdk: {
16+
// majorVersion: 0,
17+
// },
18+
// },
1319
stability: "experimental",
1420

1521
cdkVersion: CDK_VERSION,
16-
cdkVersionPinning: true,
17-
18-
cdkDependencies: ["monocdk"],
1922

2023
srcdir: "lib",
2124
testdir: "test",
@@ -72,27 +75,22 @@ _By submitting this pull request, I confirm that my contribution is made under t
7275
},
7376
});
7477

75-
// Projen doesn't handle monocdk properly; remove @aws-cdk manually
76-
project.deps.removeDependency("@aws-cdk/core", DependencyType.PEER);
77-
project.deps.removeDependency("@aws-cdk/core", DependencyType.RUNTIME);
78-
project.deps.removeDependency("@aws-cdk/assert");
79-
project.deps.removeDependency("@aws-cdk/assertions");
80-
81-
// Declare monocdk and constructs as peer dependencies
82-
project.deps.removeDependency("monocdk", DependencyType.RUNTIME);
83-
project.deps.removeDependency("constructs", DependencyType.RUNTIME);
84-
project.deps.addDependency(`monocdk@^${CDK_VERSION}`, DependencyType.PEER);
85-
project.deps.addDependency(
86-
`constructs@^${CONSTRUCTS_VERSION}`,
87-
DependencyType.PEER
88-
);
89-
90-
// Pin to lowest version in dev dependencies to ensure compatability
91-
project.deps.addDependency(`monocdk@${CDK_VERSION}`, DependencyType.DEVENV);
92-
project.deps.addDependency(
93-
`constructs@${CONSTRUCTS_VERSION}`,
94-
DependencyType.DEVENV
95-
);
78+
// Experimental modules
79+
[
80+
"@aws-cdk/aws-apigatewayv2-alpha",
81+
"@aws-cdk/aws-appsync-alpha",
82+
"@aws-cdk/aws-redshift-alpha",
83+
"@aws-cdk/aws-synthetics-alpha",
84+
].forEach((dep) => {
85+
project.deps.addDependency(
86+
`${dep}@^${CDK_VERSION}-alpha.0`,
87+
DependencyType.PEER
88+
);
89+
project.deps.addDependency(
90+
`${dep}@${CDK_VERSION}-alpha.0`,
91+
DependencyType.DEVENV
92+
);
93+
});
9694

9795
// Add some other eslint rules followed across this project
9896
project.eslint.addRules({

0 commit comments

Comments
 (0)