Skip to content

feat(rds): add private PostgreSQL module - #193

Merged
ciiiii merged 1 commit into
masterfrom
yscai/rds-module
Aug 26, 2026
Merged

feat(rds): add private PostgreSQL module#193
ciiiii merged 1 commit into
masterfrom
yscai/rds-module

Conversation

@ciiiii

@ciiiii ciiiii commented Aug 26, 2026

Copy link
Copy Markdown
Member

Motivation

SQL Workspace needs a private PostgreSQL meta store per poolmember. The resources were previously defined inline in the provisioning layer; moving them into a module lets the AWS v1 and v2 paths share one definition.

Modifications

  • Add modules/rds: a private PostgreSQL instance in the VPC's private subnets, with its DB subnet group, security group and generated master password.
  • Ingress is limited to the PostgreSQL port from vpc_cidr; the instance is never publicly accessible and storage is encrypted.
  • Expose a sensitive connection output (host, port, username, password, database) so the caller can write the credential to its own secret store. The module has no Kubernetes provider.
  • Treat the instance as disposable: backup_retention_period defaults to 0, skip_final_snapshot is on and deletion protection is off, so teardown cannot be blocked.

Notes:

  • vpc_cidr must be the cidr actually in use by vpc_id. When the VPC is supplied rather than created, read it with a data "aws_vpc" lookup — a requested cidr produces an ingress rule that does not match and the instance is unreachable.
  • The module has no enabled flag; callers gate it with count on the module block.

Verifying this change

  • Make sure that the change passes the CI checks.

terraform validate and terraform fmt -check pass. Exercised end to end against a test environment: instance create, update and delete, and a workload pod connecting over TLS 1.3.

Documentation

  • doc

    modules/rds/README.md generated with terraform-docs.

@ciiiii
ciiiii requested a review from a team as a code owner August 26, 2026 00:34
@github-actions github-actions Bot added the doc This pr contains a document label Aug 26, 2026
@ciiiii
ciiiii merged commit 020ae0c into master Aug 26, 2026
5 checks passed
@ciiiii
ciiiii deleted the yscai/rds-module branch August 26, 2026 02:44
ciiiii pushed a commit that referenced this pull request Aug 26, 2026
🤖 I have created a release *beep* *boop*
---


##
[4.10.0](v4.9.0...v4.10.0)
(2026-08-26)


### Features

* **dns-bucket:** add optional sqlworkspace S3 bucket
([#191](#191))
([ae77276](ae77276))
* **rds:** add private PostgreSQL module
([#193](#193))
([020ae0c](020ae0c))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc This pr contains a document

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants