Skip to content

Commit f826785

Browse files
keegancsmithampcode-comDaedalusG
authored
docs: update AWS RDS IAM Auth instructions (#1421)
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) NOTE: This can only be merged once our backport lands for these improvements sourcegraph/sourcegraph#7825 Amp-Thread-ID: https://ampcode.com/threads/T-27ca9536-a526-45bd-9992-f9011dbf5cff Co-authored-by: Amp <[email protected]> Co-authored-by: Warren Gifford <[email protected]>
1 parent 3e7a33f commit f826785

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed

docs/admin/external_services/postgres.mdx

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -144,23 +144,28 @@ In order to enable IAM Auth, you first need to:
144144
- For EKS (k8s deployment), use [IAM roles for service accounts](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html)
145145
- 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)
146146

147-
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:
148-
149-
- `PG_CONNECTION_UPDATER=EC2_ROLE_CREDENTIALS`
150-
- `PGSSLMODE=require`
151-
- `PGHOST=<>`
152-
- `PGPORT=<>`
153-
- `PGUSER=<>` - this should be the database accounts created above
154-
- `PGDATABASE=<>`
155-
- `CODEINTEL_PGSSLMODE=require`
156-
- `CODEINTEL_PGPORT=<>`
157-
- `CODEINTEL_PGUSER=<>` this should be the database accounts created above
158-
- `CODEINTEL_PGDATABASE=<>`
159-
- `CODEINSIGHTS_PGSSLMODE=require`
160-
- `CODEINSIGHTS_PGHOST=<>`
161-
- `CODEINSIGHTS_PGPORT=<>`
162-
- `CODEINSIGHTS_PGUSER=<>` this should be the database accounts created above
163-
- `CODEINSIGHTS_PGDATABASE=<>`
147+
Configure the following environment variables for the **`sourcegraph-frontend`** service (or all `sourcegraph-frontend-*` services in Docker Compose deployments):
148+
149+
- `PG_CONNECTION_UPDATER=EC2_ROLE_CREDENTIALS`
150+
- `PGSSLMODE=require`
151+
- `PGHOST=<>`
152+
- `PGPORT=<>`
153+
- `PGUSER=<>` - this should be the database accounts created above
154+
- `PGDATABASE=<>`
155+
- `CODEINTEL_PGSSLMODE=require`
156+
- `CODEINTEL_PGHOST=<>`
157+
- `CODEINTEL_PGPORT=<>`
158+
- `CODEINTEL_PGUSER=<>` - this should be the database accounts created above
159+
- `CODEINTEL_PGDATABASE=<>`
160+
- `CODEINSIGHTS_PGSSLMODE=require`
161+
- `CODEINSIGHTS_PGHOST=<>`
162+
- `CODEINSIGHTS_PGPORT=<>`
163+
- `CODEINSIGHTS_PGUSER=<>` - this should be the database accounts created above
164+
- `CODEINSIGHTS_PGDATABASE=<>`
165+
166+
**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:
167+
168+
- `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.
164169

165170
## Usage with PgBouncer
166171

0 commit comments

Comments
 (0)