fix(infra): support PostgreSQL TLS connections#3647
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a robust database URL parsing mechanism to handle SSL mode configurations for PostgreSQL connections across the 'iris' and 'plag' services, while also updating the Terraform infrastructure configuration to include 'sslmode=require'. The review feedback highlights two opportunities for refactoring: extracting the redundant 'parseDatabaseURL' function into a shared utility package to improve maintainability, and centralizing the database URL string in Terraform using a 'locals' variable to avoid duplication.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
7aa9fda to
e8a522b
Compare
Description
AWS RDS가 TLS를 요구할 때 Iris와 Plag가 연결하지 못하는 문제를 해결합니다. 기존 문자열 치환은
schema=public&sslmode=require를sslmode=disable&sslmode=require로 바꿔 TLS를 비활성화할 수 있었습니다.PostgreSQL URL을 파싱해 Prisma 전용
schema옵션만 제거하고 명시된sslmode와 다른 쿼리 옵션은 보존합니다. AWS Secrets Manager와 Terraform 출력에는sslmode=require를 명시했으며, URL 변환 동작을 단위 테스트로 검증했습니다.Additional context
Amazon RDS for PostgreSQL 릴리스 일정
PostgreSQL 14는 연말에 지원 종료될 예정이며, 이에 대응하기 위해서는 최신 버전 DB로 넘어가야 합니다.
Amazon RDS for PostgreSQL 18로 업그레이드하면 rds.force_ssl이 기본적으로 활성화되어 TLS 연결이 요구됩니다. 이에 따라 DB 클라이언트가 TLS 연결을 지원하도록 설정해야 합니다. 이 PR은 이를 위해서 작성되었습니다.
PostgreSQL 14, 16, 18에 대해 테스트되었습니다.
Before submitting the PR, please make sure you do the following
fixes #123).Closes TAS-2788