Skip to content

feat: Move Dynamo table to report CFN stack - #1668

Merged
akash1810 merged 5 commits into
mainfrom
aa/reports-table
Feb 24, 2026
Merged

feat: Move Dynamo table to report CFN stack#1668
akash1810 merged 5 commits into
mainfrom
aa/reports-table

Conversation

@akash1810

@akash1810 akash1810 commented Feb 2, 2026

Copy link
Copy Markdown
Member

Note

Recommended to review commit by commit.

What does this change?

When looking at the architecture diagram, the report services can be defined as everything to the right of Fastly. In #1616 and #1623 the reportextractor and eventconsumer Lambdas were moved into the same CloudFormation stack as the EC2 app. This change moves the final piece - the Dynamo table.

Deployment strategy

Warning

This change requires manual deployment following these steps. Consequently, once deployed, reversion would be tricky!

Riff-Raff does not currently support this type of CloudFormation operation, so we have to deploy manually, specifically:

  1. Update the CloudFormation stack, adding the DeletionPolicy to the Dynamo table
    • mobile-notifications-dynamo-CODE
    • mobile-notifications-dynamo-PROD
  2. Delete the mobile-notifications-dynamo- CloudFormation stack, removing the Dynamo table from CloudFormation
    • mobile-notifications-dynamo-CODE
    • mobile-notifications-dynamo-PROD
  3. Manually update the report CloudFormation stack, importing the Dynamo table
    • mobile-notifications-report-CODE
    • mobile-notifications-report-PROD
  4. Using Riff-Raff, update the report CloudFormation stack, referring to the Dynamo table by logical ID

The last step can be done by Riff-Raff.

How to test?

One test would be to compare the definition of the Dynamo table between the removed YAML template and the CDK stack (at 5a68124). Running yarn synth Report-PROD > after.yaml will create a YAML template from the CDK definition. If we diff the AWS::DynamoDB::Table resource in the two templates, we have:

image

Other than properties moving position, the only change is to tagging.

How can we measure success?

All resources for the report services are co-located in a single CloudFormation stack and thus are updated via CD (Riff-Raff) reducing the risk of human-error.

@akash1810 akash1810 added the feature Departmental tracking: work on a new feature label Feb 2, 2026
@github-actions

github-actions Bot commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

@akash1810 akash1810 changed the title feat: Create Dynamo table in report CFN stack feat: Move Dynamo table in report CFN stack Feb 2, 2026
@akash1810 akash1810 changed the title feat: Move Dynamo table in report CFN stack feat: Move Dynamo table to report CFN stack Feb 2, 2026
This change requires manual deployment using the CFN import feature.
The Dynamo table is now defined in this CFN stack,
so we can reference it via its logical ID.
The single resource from this template has been migrated to `report.ts`.
@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@akash1810
akash1810 marked this pull request as ready for review February 24, 2026 11:14
@akash1810
akash1810 requested a review from a team as a code owner February 24, 2026 11:14
@akash1810
akash1810 enabled auto-merge February 24, 2026 11:17
@akash1810
akash1810 merged commit 405aaf1 into main Feb 24, 2026
11 checks passed
@akash1810
akash1810 deleted the aa/reports-table branch February 24, 2026 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Departmental tracking: work on a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants