From c015419a6c8327327e19731a95897557ee332d21 Mon Sep 17 00:00:00 2001 From: guardian-ci Date: Wed, 10 Jul 2024 10:05:15 +0000 Subject: [PATCH 1/5] fix(deps): Update AWS CDK libraries to 2.148.0, and constructs to 10.3.0 Update aws-cdk to 2.148.0, aws-cdk-lib to 2.148.0, constructs to 10.3.0 --- .changeset/aws-cdk-update-v2.148.0.md | 6 ++++ package-lock.json | 51 ++++++++------------------- package.json | 8 ++--- tools/integration-test/package.json | 4 +-- 4 files changed, 27 insertions(+), 42 deletions(-) create mode 100644 .changeset/aws-cdk-update-v2.148.0.md diff --git a/.changeset/aws-cdk-update-v2.148.0.md b/.changeset/aws-cdk-update-v2.148.0.md new file mode 100644 index 0000000000..c5c39213f3 --- /dev/null +++ b/.changeset/aws-cdk-update-v2.148.0.md @@ -0,0 +1,6 @@ +--- +"@guardian/cdk": patch +--- + +Update aws-cdk to 2.148.0, aws-cdk-lib to 2.148.0, constructs to 10.3.0 + diff --git a/package-lock.json b/package-lock.json index a73680d4cc..6922d46312 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@guardian/cdk", - "version": "58.1.2", + "version": "58.1.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@guardian/cdk", - "version": "58.1.2", + "version": "58.1.3", "dependencies": { "@oclif/core": "3.26.6", "aws-sdk": "^2.1649.0", @@ -36,8 +36,8 @@ "@types/lodash.upperfirst": "^4.3.9", "@types/node": "20.14.9", "@types/yargs": "^17.0.32", - "aws-cdk": "2.145.0", - "aws-cdk-lib": "2.145.0", + "aws-cdk": "2.148.0", + "aws-cdk-lib": "2.148.0", "constructs": "10.3.0", "eslint": "^8.57.0", "eslint-plugin-custom-rules": "file:tools/eslint", @@ -51,8 +51,8 @@ "typescript": "5.1.6" }, "peerDependencies": { - "aws-cdk": "2.145.0", - "aws-cdk-lib": "2.145.0", + "aws-cdk": "2.148.0", + "aws-cdk-lib": "2.148.0", "constructs": "10.3.0" } }, @@ -3105,9 +3105,9 @@ } }, "node_modules/aws-cdk": { - "version": "2.145.0", - "resolved": "https://registry.npmjs.org/aws-cdk/-/aws-cdk-2.145.0.tgz", - "integrity": "sha512-Jdw7nbrXiihYM/jReXK0/i8a+W/o+fLcn1f8Yzvns1jP58KBGQygqyiv5Dm+uqzS3D8/ZZnfPu3ph6aOVLPNSA==", + "version": "2.148.0", + "resolved": "https://registry.npmjs.org/aws-cdk/-/aws-cdk-2.148.0.tgz", + "integrity": "sha512-nuCWY8I0xkIz7B2LjIL4h/xLHWTFhINL8i2fdA0BPq8t0byhLaNw5wggvztDjWH5xq5I1DM3laiv4/q5S21Xrg==", "dev": true, "bin": { "cdk": "bin/cdk" @@ -3120,9 +3120,9 @@ } }, "node_modules/aws-cdk-lib": { - "version": "2.145.0", - "resolved": "https://registry.npmjs.org/aws-cdk-lib/-/aws-cdk-lib-2.145.0.tgz", - "integrity": "sha512-0RCKdojCtF74rI2gGi9KUFVUKykTIMEs3ANjruIjxEz6d2cAsy9c2k+nCCSMdqhKZ9aPJgmBFewiw03Z8NtPig==", + "version": "2.148.0", + "resolved": "https://registry.npmjs.org/aws-cdk-lib/-/aws-cdk-lib-2.148.0.tgz", + "integrity": "sha512-Pa0pyIHlhnsqtMkPJS3tnptYhoOSNDOgoFurNB4Qfa0vnAkjYQ+JKQkR1tNNr8+UtO9jUfXRklQgjEqlFlrgBA==", "bundleDependencies": [ "@balena/dockerignore", "case", @@ -3149,7 +3149,7 @@ "mime-types": "^2.1.35", "minimatch": "^3.1.2", "punycode": "^2.3.1", - "semver": "^7.6.0", + "semver": "^7.6.2", "table": "^6.8.2", "yaml": "1.10.2" }, @@ -3167,7 +3167,7 @@ "license": "Apache-2.0" }, "node_modules/aws-cdk-lib/node_modules/ajv": { - "version": "8.13.0", + "version": "8.16.0", "dev": true, "inBundle": true, "license": "MIT", @@ -3347,18 +3347,6 @@ "inBundle": true, "license": "MIT" }, - "node_modules/aws-cdk-lib/node_modules/lru-cache": { - "version": "6.0.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/aws-cdk-lib/node_modules/mime-db": { "version": "1.52.0", "dev": true, @@ -3411,13 +3399,10 @@ } }, "node_modules/aws-cdk-lib/node_modules/semver": { - "version": "7.6.0", + "version": "7.6.2", "dev": true, "inBundle": true, "license": "ISC", - "dependencies": { - "lru-cache": "^6.0.0" - }, "bin": { "semver": "bin/semver.js" }, @@ -3502,12 +3487,6 @@ "punycode": "^2.1.0" } }, - "node_modules/aws-cdk-lib/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "inBundle": true, - "license": "ISC" - }, "node_modules/aws-cdk-lib/node_modules/yaml": { "version": "1.10.2", "dev": true, diff --git a/package.json b/package.json index 12a4702d32..1f8e5c1253 100644 --- a/package.json +++ b/package.json @@ -40,8 +40,8 @@ "@types/lodash.upperfirst": "^4.3.9", "@types/node": "20.14.9", "@types/yargs": "^17.0.32", - "aws-cdk": "2.145.0", - "aws-cdk-lib": "2.145.0", + "aws-cdk": "2.148.0", + "aws-cdk-lib": "2.148.0", "constructs": "10.3.0", "eslint": "^8.57.0", "eslint-plugin-custom-rules": "file:tools/eslint", @@ -68,8 +68,8 @@ "yargs": "^17.7.2" }, "peerDependencies": { - "aws-cdk": "2.145.0", - "aws-cdk-lib": "2.145.0", + "aws-cdk": "2.148.0", + "aws-cdk-lib": "2.148.0", "constructs": "10.3.0" } } diff --git a/tools/integration-test/package.json b/tools/integration-test/package.json index 125faecc19..98c005805f 100644 --- a/tools/integration-test/package.json +++ b/tools/integration-test/package.json @@ -20,8 +20,8 @@ "@guardian/tsconfig": "^0.2.0", "@types/jest": "^29.1.2", "@types/node": "20.8.7", - "aws-cdk": "2.145.0", - "aws-cdk-lib": "2.145.0", + "aws-cdk": "2.148.0", + "aws-cdk-lib": "2.148.0", "constructs": "10.3.0", "eslint": "^8.8.0", "eslint-plugin-custom-rules": "file:../eslint", From 31bc780ee560ae0545afc8d4a0073d85e74f3c04 Mon Sep 17 00:00:00 2001 From: akash1810 Date: Thu, 11 Jul 2024 07:58:23 +0100 Subject: [PATCH 2/5] test: Update snapshots There are new AWS regions. --- .../ecs/__snapshots__/ecs-task.test.ts.snap | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/constructs/ecs/__snapshots__/ecs-task.test.ts.snap b/src/constructs/ecs/__snapshots__/ecs-task.test.ts.snap index 91590d83cc..6283bae7dd 100644 --- a/src/constructs/ecs/__snapshots__/ecs-task.test.ts.snap +++ b/src/constructs/ecs/__snapshots__/ecs-task.test.ts.snap @@ -37,9 +37,18 @@ exports[`The GuEcsTask pattern should create the correct resources with lots of "ap-southeast-4": { "states": "states.ap-southeast-4.amazonaws.com", }, + "ap-southeast-5": { + "states": "states.ap-southeast-5.amazonaws.com", + }, + "ap-southeast-7": { + "states": "states.ap-southeast-7.amazonaws.com", + }, "ca-central-1": { "states": "states.ca-central-1.amazonaws.com", }, + "ca-west-1": { + "states": "states.ca-west-1.amazonaws.com", + }, "cn-north-1": { "states": "states.cn-north-1.amazonaws.com", }, @@ -52,6 +61,9 @@ exports[`The GuEcsTask pattern should create the correct resources with lots of "eu-central-2": { "states": "states.eu-central-2.amazonaws.com", }, + "eu-isoe-west-1": { + "states": "states.eu-isoe-west-1.amazonaws.com", + }, "eu-north-1": { "states": "states.eu-north-1.amazonaws.com", }, @@ -79,6 +91,9 @@ exports[`The GuEcsTask pattern should create the correct resources with lots of "me-south-1": { "states": "states.me-south-1.amazonaws.com", }, + "mx-central-1": { + "states": "states.mx-central-1.amazonaws.com", + }, "sa-east-1": { "states": "states.sa-east-1.amazonaws.com", }, From 9cfabc69a8470f1630d811d5ec60e506816734fc Mon Sep 17 00:00:00 2001 From: akash1810 Date: Thu, 11 Jul 2024 08:05:32 +0100 Subject: [PATCH 3/5] fix(lambda): Use `loggingFormat` prop over deprecated `logFormat` --- .changeset/shaggy-ties-deliver.md | 5 +++++ src/constructs/lambda/lambda.test.ts | 4 ++-- src/constructs/lambda/lambda.ts | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 .changeset/shaggy-ties-deliver.md diff --git a/.changeset/shaggy-ties-deliver.md b/.changeset/shaggy-ties-deliver.md new file mode 100644 index 0000000000..dabe30389e --- /dev/null +++ b/.changeset/shaggy-ties-deliver.md @@ -0,0 +1,5 @@ +--- +"@guardian/cdk": patch +--- + +fix(lambda): Use `loggingFormat` prop over deprecated `logFormat` diff --git a/src/constructs/lambda/lambda.test.ts b/src/constructs/lambda/lambda.test.ts index c5e8760abd..e5b57f0c71 100644 --- a/src/constructs/lambda/lambda.test.ts +++ b/src/constructs/lambda/lambda.test.ts @@ -223,7 +223,7 @@ describe("The GuLambdaFunction class", () => { handler: "handler.ts", runtime: Runtime.JAVA_17, app: "testing", - logFormat: "JSON", + loggingFormat: LoggingFormat.JSON, }); hasLoggingFormat(stack, LoggingFormat.JSON); @@ -236,7 +236,7 @@ describe("The GuLambdaFunction class", () => { handler: "handler.ts", runtime: Runtime.JAVA_17, app: "testing", - logFormat: "Text", + loggingFormat: LoggingFormat.TEXT, }); hasLoggingFormat(stack, LoggingFormat.TEXT); diff --git a/src/constructs/lambda/lambda.ts b/src/constructs/lambda/lambda.ts index 52c32b1814..d3f6a72fd8 100644 --- a/src/constructs/lambda/lambda.ts +++ b/src/constructs/lambda/lambda.ts @@ -124,7 +124,7 @@ export class GuLambdaFunction extends Function { bucketNamePath, withoutFilePrefix = false, withoutArtifactUpload = false, - logFormat = LoggingFormat.JSON, + loggingFormat = LoggingFormat.JSON, } = props; const bucketName = bucketNamePath @@ -142,7 +142,7 @@ export class GuLambdaFunction extends Function { const code = Code.fromBucket(bucket, objectKey); super(scope, id, { ...props, - logFormat, + loggingFormat, environment: { ...props.environment, ...defaultEnvironmentVariables, From 7051a7cfac46be14c88f211918ca869a2a7d10a3 Mon Sep 17 00:00:00 2001 From: akash1810 Date: Thu, 11 Jul 2024 08:09:14 +0100 Subject: [PATCH 4/5] fix(ec2-app): Use `clientSecretValue` prop over deprecated `clientSecret` --- .changeset/lucky-news-guess.md | 5 +++++ src/patterns/ec2-app/base.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/lucky-news-guess.md diff --git a/.changeset/lucky-news-guess.md b/.changeset/lucky-news-guess.md new file mode 100644 index 0000000000..5b4dee0fd5 --- /dev/null +++ b/.changeset/lucky-news-guess.md @@ -0,0 +1,5 @@ +--- +"@guardian/cdk": patch +--- + +fix(ec2-app): Use `clientSecretValue` prop over deprecated `clientSecret` diff --git a/src/patterns/ec2-app/base.ts b/src/patterns/ec2-app/base.ts index 03eec14233..308c8e5664 100644 --- a/src/patterns/ec2-app/base.ts +++ b/src/patterns/ec2-app/base.ts @@ -586,7 +586,7 @@ export class GuEc2App extends Construct { const userPoolIdp = new UserPoolIdentityProviderGoogle(scope, "google-idp", { userPool: userPool, clientId: clientId.toString(), - clientSecret: clientSecret.toString(), + clientSecretValue: clientSecret, attributeMapping: { email: ProviderAttribute.GOOGLE_EMAIL, givenName: ProviderAttribute.GOOGLE_GIVEN_NAME, From acf0b09702aba55ae7b6f5fe0e54c06302df2f98 Mon Sep 17 00:00:00 2001 From: akash1810 Date: Thu, 11 Jul 2024 08:10:38 +0100 Subject: [PATCH 5/5] chore: Remove `console.log` in test --- src/constructs/rds/instance.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/constructs/rds/instance.test.ts b/src/constructs/rds/instance.test.ts index 4f1be6b4c6..f78bb2ad9f 100644 --- a/src/constructs/rds/instance.test.ts +++ b/src/constructs/rds/instance.test.ts @@ -79,7 +79,7 @@ describe("The GuDatabaseInstance class", () => { app: "testing", devXBackups: { enabled: true }, }); - console.log(JSON.stringify(stack.tags.tagValues())); + GuTemplate.fromStack(stack).hasResourceWithTag("AWS::RDS::DBInstance", { Key: "devx-backup-enabled", Value: "true",