Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add @guardian/cdk to repository and deploy stage-specific templates #64

Merged
merged 7 commits into from
Jun 8, 2022

Conversation

jacobwinch
Copy link
Contributor

@jacobwinch jacobwinch commented May 24, 2022

What does this change?

We are migrating the mobile-save-for-later service from CloudFormation to @guardian/cdk. The migration will involve 5 PRs:

  1. Add @guardian/cdk to repository; update CI & deployment wiring accordingly [this PR]
  2. Provision a new version of the infrastructure using @guardian/cdk (Add cdk-defined version of API infrastructure #65)
  3. Move DNS configuration from CloudFormation into @guardian/cdk (but continue routing requests to old infrastructure) (Move domain name configuration from CFN to cdk #66)
  4. Update DNS configuration (start routing requests to new infrastructure) (Route all traffic to the cdk-defined infrastructure #67)
  5. Remove old infrastructure (Remove superfluous resources - these have been replaced by GuCDK versions #73)

In this PR, we 'wrap' the existing CloudFormation with @guardian/cdk, following the process described here.

Note that all changes in 6179bb0 are auto-generated by @guardian/cdk project creation tooling; I would not spend much time reviewing this in detail!

There are, however, a couple of changes that require a little more explanation:

  1. Original CloudFormation has been converted from AWS::Serverless-2016-10-31 to 'standard' CloudFormation (1389750).
  2. We now deploy two separate templates (i.e. there is one file for CODE and a different file for PROD), instead of a single template for both stages (ad96d92).

How to test

I've deployed this to CODE and used a debug version of the app to confirm that saving articles/viewing saved articles still works as expected. (I checked the AWS Lambda logs and DynamoDB to confirm that server side code was being exercised as expected).

How can we measure success?

We have started the migration process to @guardian/cdk.

Have we considered potential risks?

This PR should be pretty low risk; we are changing CI and CD wiring, but the actual infrastructure serving requests will not change substantially (i.e. we just change the metadata by adding some new tags).

@akash1810
Copy link
Member

I added a new build step in TeamCity (i.e. outside of version control)

Could we bring the CI build steps into the VCS? We're currently using the sbt runner in TeamCity, which IIRC isn't great as it always exits 0, even when there are failing tests 😱 .

cdk/README.md Outdated Show resolved Hide resolved
cdk/package.json Outdated Show resolved Hide resolved
cdk/script/ci Outdated Show resolved Hide resolved
mobile-save-for-later/conf/cfn.yaml Show resolved Hide resolved
cdk/.eslintrc.js Show resolved Hide resolved
@jacobwinch
Copy link
Contributor Author

jacobwinch commented May 24, 2022

Could we bring the CI build steps into the VCS? We're currently using the sbt runner in TeamCity, which IIRC isn't great as it always exits 0, even when there are failing tests 😱 .

Sure, will raise a new PR for that and then rebase this one.

Update: this has been done in #68.

cdk/README.md Outdated Show resolved Hide resolved
cdk/script/ci Outdated Show resolved Hide resolved
Copy link
Contributor

@waisingyiu waisingyiu left a comment

Choose a reason for hiding this comment

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

Look great to me!

@jacobwinch jacobwinch force-pushed the jw-cdk-migration-part-1 branch from ddbb924 to d41367a Compare June 8, 2022 13:25
@jacobwinch jacobwinch force-pushed the jw-cdk-migration-part-1 branch from ae6ebba to 680082d Compare June 8, 2022 13:30
@jacobwinch jacobwinch merged commit 314cbdc into master Jun 8, 2022
@jacobwinch jacobwinch deleted the jw-cdk-migration-part-1 branch June 8, 2022 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants