Skip to content

set up serverless Aurora CDK database#73

Merged
AnJuHyppolite merged 1 commit intodevfrom
set-up-serverless-cdk-database-#464
Aug 7, 2025
Merged

set up serverless Aurora CDK database#73
AnJuHyppolite merged 1 commit intodevfrom
set-up-serverless-cdk-database-#464

Conversation

@AnJuHyppolite
Copy link
Copy Markdown
Contributor

@AnJuHyppolite AnJuHyppolite commented Jul 16, 2025

Description

This PR resolves Configure Aurora Serverless v2 PostgreSQL by implementing Infrastructure as Code (IaC) for an AWS Aurora Serverless v2 PostgreSQL database.

Approach

Using AWS Cloud Development Kit (CDK) and TypeScript:

  • Referenced the existing dev VPC (will update to prod VPC once PR is approved and production deployment schedule is set)
  • Created supporting resources: subnet group, security group, and Aurora cluster
  • Exported VPC and security group for use in API stack (lambdas)
  • Updated FeedbackApiStack to accept shared vpc and securityGroup from FeedbackDbStack
  • Wrote tests to validate mocked VPC, creation of resources, and configuration settings
  • Used cdk synth to generate and validate CloudFormation output

AWS Resource Documentation

Steps to Test

  1. Run npm install to install dependencies.
  2. Run npm run synth:dev to synthesize the CDK app into a dev CloudFormation template.
    1. Run npm run deploy-db:dev to deploy the dev database AWS.
  3. Verify synthesized template includes VPC, subnet group, security group, and Aurora cluster.

To check deployment (in AWS Console):

  1. Search for/Go to CloudFormation.
  2. Choose your AWS region (e.g., us-east-1) at the top-right.
  3. Look for a stack named FeedbackDbStack.
  4. Confirm its status is ✅ CREATE_COMPLETE.

Notes

  • Deployment requires AWS account authorization due to costs; awaiting leadership approval
  • Once PR is approved, we can:
    • deploy to the dev account
    • merge PR into dev

@AnJuHyppolite AnJuHyppolite requested a review from ezhangy July 17, 2025 16:55
@AnJuHyppolite AnJuHyppolite force-pushed the set-up-serverless-cdk-database-#464 branch from 570f7b3 to 94bde7e Compare July 18, 2025 16:14
@casewalker

This comment was marked as outdated.

@AnJuHyppolite AnJuHyppolite requested a review from jachan July 18, 2025 17:06
@ezhangy

This comment was marked as resolved.

@jachan

This comment was marked as resolved.

Copy link
Copy Markdown

@jachan jachan left a comment

Choose a reason for hiding this comment

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

Left my 2 cents on Case's boulder as a comment on the conversation. TLDR I think it should be refactored to use the same App, but I can see why you'd keep resources in their own stack. Also had some questions about the config and why public subnets are necessary here. Great work on your first CDK PR though! It's great to see more IaaC here at the Office <3

@AnJuHyppolite AnJuHyppolite force-pushed the set-up-serverless-cdk-database-#464 branch 2 times, most recently from b4f745b to a67cf13 Compare July 24, 2025 13:27
@AnJuHyppolite AnJuHyppolite force-pushed the set-up-serverless-cdk-database-#464 branch from a67cf13 to e8ed448 Compare July 24, 2025 14:03
Copy link
Copy Markdown
Contributor

@ezhangy ezhangy left a comment

Choose a reason for hiding this comment

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

Thanks so so much for all your work here, and refactoring to make the db part of the same stack as the API!

Left several comments: some [dust/questions] that are more for my own understanding, and some [pebbles] for modifications I think we should make to the stack based on my understanding.

No one piece of feedback I had felt like it rose to the level of a [boulder], but since there are multiple potential changes here, I'd appreciate a chance to get a look over again before you merge!

@AnJuHyppolite AnJuHyppolite force-pushed the set-up-serverless-cdk-database-#464 branch from e8ed448 to 1804061 Compare August 4, 2025 14:26
Copy link
Copy Markdown

@jachan jachan left a comment

Choose a reason for hiding this comment

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

Seems like a good starting point! Left a comment about the .gitignore that should be resolved before merge.

Copy link
Copy Markdown
Contributor

@ezhangy ezhangy left a comment

Choose a reason for hiding this comment

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

great work!! left some comments about removing the security groups and the VPC for this iteration before we have the public subnet set up, let me know if you have any questions

@AnJuHyppolite AnJuHyppolite force-pushed the set-up-serverless-cdk-database-#464 branch 3 times, most recently from 40db7f5 to 1fc0b43 Compare August 6, 2025 19:34
Copy link
Copy Markdown
Contributor

@ezhangy ezhangy left a comment

Choose a reason for hiding this comment

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

looks good to me! a couple of very minor dusts, no need to ask for a re-review before merging!

so excited to see this PR cross the finish line, really great work here! 🎉

@AnJuHyppolite AnJuHyppolite force-pushed the set-up-serverless-cdk-database-#464 branch from 1fc0b43 to 6311351 Compare August 6, 2025 20:51
@AnJuHyppolite AnJuHyppolite force-pushed the set-up-serverless-cdk-database-#464 branch from 6311351 to 7be504e Compare August 7, 2025 20:05
@AnJuHyppolite AnJuHyppolite merged commit 9c00810 into dev Aug 7, 2025
@AnJuHyppolite AnJuHyppolite deleted the set-up-serverless-cdk-database-#464 branch August 7, 2025 20:07
This was referenced Aug 20, 2025
ezhangy added a commit that referenced this pull request Aug 26, 2025
Merges the following PRs to main: 
- #68 
- #70 
- #69 
- #72 
- #71 
- #73 
- #75 
- #77
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