Skip to content

Commit 4600399

Browse files
docs: update AWS RDS IAM Auth instructions
The IAM Auth configuration only needs to be applied to the frontend service(s), not all services requiring database connections. This update: - Clarifies that config is only needed for sourcegraph-frontend service - Adds missing CODEINTEL_PGHOST variable for completeness - Documents AWS_STS_REGIONAL_ENDPOINTS as optional configuration for customers who want to use regional STS endpoints for improved latency and resiliency (common in production AWS deployments) Amp-Thread-ID: https://ampcode.com/threads/T-27ca9536-a526-45bd-9992-f9011dbf5cff Co-authored-by: Amp <[email protected]>
1 parent b630c74 commit 4600399

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

docs/admin/external_services/postgres.mdx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ In order to enable IAM Auth, you first need to:
122122
- For EKS (k8s deployment), use [IAM roles for service accounts](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html)
123123
- For EC2 (docker-compose deployment), use [IAM roles for Amazon EC2](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html)
124124

125-
For [every services that require postgres database connection](https://github.com/sourcegraph/sourcegraph-public-snapshot/blob/main/lib/servicecatalog/service-catalog.yaml), ensure below environment variables are configured:
125+
Configure the following environment variables for the **`sourcegraph-frontend`** service (or all `sourcegraph-frontend-*` services in Docker Compose deployments):
126126

127127
- `PG_CONNECTION_UPDATER=EC2_ROLE_CREDENTIALS`
128128
- `PGSSLMODE=require`
@@ -131,15 +131,20 @@ For [every services that require postgres database connection](https://github.co
131131
- `PGUSER=<>` - this should be the database accounts created above
132132
- `PGDATABASE=<>`
133133
- `CODEINTEL_PGSSLMODE=require`
134+
- `CODEINTEL_PGHOST=<>`
134135
- `CODEINTEL_PGPORT=<>`
135-
- `CODEINTEL_PGUSER=<>` this should be the database accounts created above
136+
- `CODEINTEL_PGUSER=<>` - this should be the database accounts created above
136137
- `CODEINTEL_PGDATABASE=<>`
137138
- `CODEINSIGHTS_PGSSLMODE=require`
138139
- `CODEINSIGHTS_PGHOST=<>`
139140
- `CODEINSIGHTS_PGPORT=<>`
140-
- `CODEINSIGHTS_PGUSER=<>` this should be the database accounts created above
141+
- `CODEINSIGHTS_PGUSER=<>` - this should be the database accounts created above
141142
- `CODEINSIGHTS_PGDATABASE=<>`
142143

144+
**Optional:** If your workloads are in a specific AWS Region and you want to use regional STS endpoints for improved latency and resiliency, also set:
145+
146+
- `AWS_STS_REGIONAL_ENDPOINTS=regional` - This configures the AWS SDK to use regional STS endpoints (e.g., `sts.us-west-2.amazonaws.com`) instead of the global endpoint (`sts.amazonaws.com`). This is recommended for better performance and resilience. See [AWS documentation](https://docs.aws.amazon.com/sdkref/latest/guide/feature-sts-regionalized-endpoints.html) for more details.
147+
143148
## Usage with PgBouncer
144149

145150
[PgBouncer] is a lightweight connections pooler for PostgreSQL. It allows more clients to connect with the PostgreSQL database without running into connection limits.

0 commit comments

Comments
 (0)