Add RDS Proxy support with configurable database endpoint routing#620
Add RDS Proxy support with configurable database endpoint routing#620
Conversation
- Removed the database engine configuration from workflows and justfile, simplifying the setup process. - Introduced new parameters for RDS Proxy configuration in CloudFormation templates and workflows, allowing for connection pooling. - Updated the PostgreSQL password rotation script to support RDS Proxy by writing both legacy and proxy-compatible keys. - Enhanced documentation to reflect changes in database configuration and RDS Proxy settings.
- Modified the database endpoint settings in both production and staging workflows to utilize RDS Proxy when enabled, falling back to the direct endpoint otherwise. - Added comments to clarify the behavior of the new configuration, particularly regarding the handling of empty proxy outputs and implications for Dagster daemon connections.
|
@claude please review this PR |
|
Claude finished @jfrench9's task in 2m 22s —— View job PR Review: Add RDS Proxy support with configurable database endpoint routing
Overall this is a well-structured PR. The Aurora removal is the right call (cleaning up dead code) and the RDS Proxy implementation follows AWS best practices. The dual-key secret pattern in the rotation Lambda is particularly clever for zero-downtime proxy enablement. I have a few concerns worth addressing before merging. cloudformation/postgres.yamlHardcoded Family: postgres16The old
This allows AWS to apply a major PostgreSQL version upgrade during the maintenance window without operator approval. For production this is dangerous — a 16 → 17 upgrade could break application compatibility silently. Recommend setting this to IAM auth disabled on the proxy (cloudformation/postgres.yaml, Auth:
- AuthScheme: SECRETS
IAMAuth: DISABLED
Hardcoded proxy connection pool values MaxIdleConnectionsPercent: 50
ConnectionBorrowTimeout: 120
No dedicated security group for proxy → RDS traffic Both the proxy and the RDS instance share
With the current setup, application traffic could theoretically reach RDS directly (bypassing the proxy) if the same SG is used everywhere. This is optional hardening, but worth tracking as a follow-up. .github/workflows/ (prod.yml, staging.yml)GHA database_endpoint: ${{ needs.deploy-postgres.outputs.database_proxy_endpoint || needs.deploy-postgres.outputs.database_endpoint }}This relies on GHA treating an empty string as falsy in bin/lambda/postgres_rotation.py
response = rds_client.describe_db_instances()The AWS API returns at most 100 instances per call. If the account has >100 RDS instances, the target may not be in the first page and paginator = rds_client.get_paginator("describe_db_instances")
for page in paginator.paginate():
for instance in page["DBInstances"]:
...Dual-key secret pattern is well-executed — writing justfile
- @gh variable delete {{name}} --yes
+ @gh variable delete {{name}}
Minor / Non-blocking
Summary
|
- Added `rds_proxy_connection_borrow_timeout` parameter to workflows for production, staging, and deployment configurations, allowing customization of the timeout duration for pooled connections. - Updated CloudFormation template to include the new parameter, with a default value of 120 seconds. - Enhanced documentation to reflect the new configuration option for RDS Proxy connection pooling.
Summary
This PR introduces configurable RDS Proxy support across the infrastructure stack, allowing deployments to optionally route database connections through an RDS Proxy rather than directly to the PostgreSQL instance. The changes span CloudFormation templates, CI/CD workflows, the secret rotation Lambda, and project setup tooling.
Key Accomplishments
Infrastructure (CloudFormation)
CI/CD Workflows
Secret Rotation Lambda
Setup & Documentation
Breaking Changes
Testing Notes
Infrastructure Considerations
🤖 Generated with Claude Code
Branch Info:
feature/rds-proxy-flagmainCo-Authored-By: Claude noreply@anthropic.com