Skip to content

set VPC and scaling capacity dynamically#101

Merged
AnJuHyppolite merged 1 commit intodevfrom
set-VPC-and-serverless-min-cap-dynamically-#592
Oct 9, 2025
Merged

set VPC and scaling capacity dynamically#101
AnJuHyppolite merged 1 commit intodevfrom
set-VPC-and-serverless-min-cap-dynamically-#592

Conversation

@AnJuHyppolite
Copy link
Copy Markdown
Contributor

@AnJuHyppolite AnJuHyppolite commented Sep 23, 2025

Description

This PR updates the AWS CDK infrastructure to dynamically configure the VPC and serverlessV2MinCapacity for the Aurora Serverless v2 clusters based on the deployment environment (dev or prod). Previously, values were hardcoded for dev, limiting environment-specific scaling. This change ensures that the database scales appropriately and uses the correct VPC for each environment.

Ticket

This work resolves Set VPC and serverlessV2MinCapacity Dynamically Based on Deployment Environment #592.

Approach

  • Added logic to read environment context and apply environment-specific values with a fallback to default to dev if the environment isn't specified.
  • Added environment-specific configuration for AWS accounts and regions, VPC ids, and minimum/maximum capacities.
  • Refactored stack initialization to accept dynamic environment parameters instead of hardcoded values.

Steps to Test

  1. Ensure AWS CLI is installed/up to date.
  2. Configure ~/.aws/credentials and ~/.aws/config with dev and prod profile names.
  3. Start an active AWS SSO session (run the aws sso login script).
    • NOTE: You need to be logged in before running synth or deploy.
  4. Run synth (see scripts) to verify CloudFormation templates.

Notes

@AnJuHyppolite AnJuHyppolite force-pushed the set-VPC-and-serverless-min-cap-dynamically-#592 branch from 005e93d to 46b3054 Compare September 23, 2025 15:20
ezhangy

This comment was marked as outdated.

casewalker

This comment was marked as resolved.

@AnJuHyppolite AnJuHyppolite force-pushed the set-VPC-and-serverless-min-cap-dynamically-#592 branch 2 times, most recently from 2f272c7 to 008159a Compare October 3, 2025 23:47
Copy link
Copy Markdown

@casewalker casewalker left a comment

Choose a reason for hiding this comment

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

I've never seen it run, but it looks promising! Let me know if I can help at all with more CDK stuff!

package.json Outdated
Comment on lines +11 to +17
"deploy:db:dev": "cd infra && cdk deploy FeedbackDbStack --profile innov-platform-dev --app 'npx tsx bin/feedback.ts' -c ENV=dev",
"deploy:db:prod": "cd infra && cdk deploy FeedbackDbStack --profile innov-platform-prod --app 'npx tsx bin/feedback.ts' -c ENV=prod",
"diff": "cdk diff",
"lint": "eslint . --ext .ts",
"prettier-format": "prettier --config .prettierrc 'src/**/*.ts' --write",
"sso:login:dev": "aws sso login --profile innov-platform-dev",
"sso:login:prod": "aws sso login --profile innov-platform-prod",

This comment was marked as outdated.

@AnJuHyppolite AnJuHyppolite force-pushed the set-VPC-and-serverless-min-cap-dynamically-#592 branch 2 times, most recently from b9cb1ed to 0a22a6f Compare October 9, 2025 18:34
@AnJuHyppolite AnJuHyppolite force-pushed the set-VPC-and-serverless-min-cap-dynamically-#592 branch from 0a22a6f to bcd7695 Compare October 9, 2025 18:35
@AnJuHyppolite AnJuHyppolite merged commit 3f30cc3 into dev Oct 9, 2025
1 check passed
@AnJuHyppolite AnJuHyppolite deleted the set-VPC-and-serverless-min-cap-dynamically-#592 branch October 9, 2025 18:37
AnJuHyppolite added a commit that referenced this pull request Nov 7, 2025
<!-- Please complete the following sections as necessary. -->

### Description

<!-- Summary of the changes, related issue, relevant motivation, and
context -->
Merges the following PRs to main: 
- #101
- #103
- #104
-  #107
- #106
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.

3 participants