feat(infra): allow runner egress to PostgreSQL 5432 for DB migrations#82
feat(infra): allow runner egress to PostgreSQL 5432 for DB migrations#82kaio6fellipe wants to merge 1 commit into
Conversation
The self-hosted runner security group only allowed egress on 443/80/53, so deploy-dev/prd's pre-deploy 'apply DB migrations' step could not reach the Supabase Postgres: the direct host is IPv6-only (no IPv6 egress -> network unreachable) and the session pooler on tcp/5432 had its SYN silently dropped (no egress rule -> connection hang). Add a tcp/5432 egress rule to the runner security group in both the CloudFormation template and the Terraform module, so runners can reach the Supabase session pooler (aws-1-<region>.pooler.supabase.com:5432, IPv4, advisory-lock-capable). Updates the stale '443/80/53' references in docs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Kaio Fellipe <kaio6fellipe@gmail.com>
OpenSSF Scorecard — 8.3/10 ✅
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughSelf-hosted runner security group rules are extended to allow outbound TCP port 5432 (PostgreSQL session pooler) for Supabase database migrations. Both CloudFormation and Terraform infrastructure definitions are updated, and corresponding documentation is synchronized across three files. ChangesSelf-hosted Runner PostgreSQL Access
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Problem
vulcan-saas PR #151 added a pre-deploy
apply DB migrationsstep todeploy-dev.yml/deploy-prd.yml. It fails because the self-hosted runner can't reach the Supabase Postgres:db.<ref>.supabase.co:5432is IPv6-only →dial tcp [2600:...]:5432: connect: network is unreachable(runner SG has no IPv6 egress / subnet likely no IPv6).aws-1-<region>.pooler.supabase.com:5432(IPv4) → the migrate step hangs ~8 min: the runner SG egress allows only 443/80/53, so the tcp/5432 SYN is silently dropped.Verified against the live SG
sg-0b7b1cd1a8e9c77ca(us-east-2): egress = tcp/80, tcp/443, udp/53 only.Change
Add a tcp/5432 egress rule to the runner security group in both IaC paths (CloudFormation template — the deployed stack — and the Terraform module for parity), so runners can reach the Supabase session pooler (IPv4, port 5432, advisory-lock-capable; the transaction pooler on 6543 is intentionally not used as it breaks golang-migrate's advisory lock). Updates the now-stale
443/80/53references in CLAUDE.md / AGENTS.md / docs.cfn-lintclean;tofu validatepasses. Egress-only change on ephemeral runners.Deploy
After merge, redeploy the CloudFormation stack (
aws cloudformation deploy … --template-file infra/cloudformation/template.yaml) to apply the new egress rule. Then vulcan-saasdeploy-devwill connect to the session pooler and apply migrations.🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation
Chores