Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Upgrade to cdk version 0.26.0 #36

Merged
merged 4 commits into from
Jan 26, 2021
Merged

Upgrade to cdk version 0.26.0 #36

merged 4 commits into from
Jan 26, 2021

Conversation

jacobwinch
Copy link
Contributor

@jacobwinch jacobwinch commented Jan 25, 2021

What does this change?

This PR updates the version of the @guardian/cdk library and makes use of a new scheduled lambda pattern for the first time.

This doesn't actually simplify our infrastructure definition much yet, but it allows us to configure an appropriate alert with minimal boilerplate in the future (I'll do this in a subsequent PR). It also means that we start conforming to the recommendation in the @guardian/cdk README:

Patterns should be your default entry point to this library.

How to test

I think this check should suffice?

How can we measure success?

Moving to pattern (rather than construct) usage should help us to keep up to date with best practices more easily in the future.

@@ -321,7 +321,6 @@ Object {
},
"tagjanitorlambdatagjanitorlambdarate7days0B5F68379": Object {
"Properties": Object {
"Description": "Run tag-janitor every 7 days",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been dropped as the new pattern doesn't take a description. I think this is pretty clear from the rate(7 days) and the Targets block anyway.

},
],
schedule: Schedule.rate(lambdaFrequency),
monitoringConfiguration: { noMonitoring: true },
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is a simple upgrade, so I won't add new resources here; I will add an alert via monitoringConfiguration in a subsequent PR.

"@guardian/eslint-config-typescript": "^0.4.1",
"@types/jest": "^26.0.20",
"@types/node": "10.17.27",
"@typescript-eslint/eslint-plugin": "^4.14.0",
"@typescript-eslint/parser": "^4.14.0",
"aws-cdk": "~1.74.0",
"aws-cdk": "1.86.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These version bumps are required to keep us in sync after guardian/cdk#191.

@@ -52,16 +52,12 @@ export class CdkStack extends GuStack {
description: "Lambda to notify about instances with missing tags",
timeout: Duration.seconds(30),
memorySize: 512,
vpc: GuVpc.fromId(this, "vpc", parameters.vpc.valueAsString),
vpc: GuVpc.fromId(this, "vpc", { vpcId: parameters.vpc.valueAsString }),
Copy link
Contributor Author

@jacobwinch jacobwinch Jan 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was changed here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's also now the GuVpc.fromIdParameter and GuVpc.subnetsFromParameter methods which would save defining those parameters explicitly. It looks up the values from parameter store so they may need adding there first.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, I'll set this up now.

@jacobwinch jacobwinch marked this pull request as ready for review January 25, 2021 16:03
Comment on lines 53 to 54
timeout: Duration.seconds(30),
memorySize: 512,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these two props be omitted now as they match the default values as of guardian/cdk#188?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, good point, thanks for spotting this 👍

@jacobwinch jacobwinch mentioned this pull request Jan 26, 2021
@jacobwinch jacobwinch merged commit d48e2ab into main Jan 26, 2021
@jacobwinch jacobwinch deleted the jw-upgrade-cdk branch January 26, 2021 13:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants