Repository navigation
infra(dev): Aurora Serverless v2 Postgres for the dev env - #94
Merged
Merged
Conversation
Replaces the always-on in-cluster er-postgres StatefulSet (EBS-backed) with a
pay-per-use managed cluster: Aurora Serverless v2 scales ACUs with load and
down to 0 when idle (min_capacity 0, supported on the resolved PG 17.9), so an
unused dev DB bills ~nothing. One shared cluster; prod gets its own provisioned
cluster in a separate env.
Adds infra/terraform/envs/dev/rds.tf:
- aws_rds_cluster "er-dev" (aurora-postgresql, serverless v2 0..4 ACU),
one db.serverless instance, storage-encrypted, private-subnet-only.
- aws_db_subnet_group over module.network.private_subnet_ids.
- aws_security_group er-dev-db: 5432 from the VPC CIDR only, no public access.
- random_password master cred; endpoint + DSN published to Secrets Manager
er/dev/shared/postgres for scripts/dev_env.sh (mirrors er/dev/shared/s3).
No secrets in the repo: the password is generated at apply and lives only in
Secrets Manager. versions.tf gains the hashicorp/random provider.
Not yet wired: dev_env.sh / the er-dev-namespace chart still provision the
in-cluster StatefulSet. Cutting dev over to the shared cluster needs a per-dev
database/role isolation decision (today each dev gets a private StatefulSet),
tracked as a follow-up.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
infra/terraform/envs/dev/rds.tf— a pay-per-use managed Postgres for the dev env to replace the always-on in-clusterer-postgresStatefulSet.Aurora Serverless v2 (PostgreSQL 17.9),
min_capacity = 0 .. max 4ACU — scales down to 0 (auto-pause) when idle, so an unused dev DB bills ~nothing. One shared cluster; prod will get its own provisioned cluster in a separate env.Resources (
terraform plan: 7 to add, 1 in-place tag on the metrics-server add-on):aws_rds_cluster "er-dev"+ onedb.serverlessinstance, storage-encrypted, private-subnet-onlyaws_db_subnet_groupovermodule.network.private_subnet_idsaws_security_group er-dev-db— 5432 from the VPC CIDR only, no public accessrandom_passwordmaster cred → endpoint + DSN published to Secrets Managerer/dev/shared/postgres(mirrors theer/dev/shared/s3pattern) forscripts/dev_env.shSafety
Project/Environment/ManagedBytags to the metrics-server add-on (imported into state in this change).Not yet wired (follow-up)
dev_env.sh/ theer-dev-namespacechart still provision the in-cluster StatefulSet. Cutting dev over to the shared cluster needs a per-dev database/role isolation decision — today each developer gets a fully private StatefulSet.🤖 Generated with Claude Code