You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deploys PgDog to an existing AWS EKS cluster via Helm. Auto-discovers RDS and Aurora databases and configures them in the Helm chart.
Usage
module"pgdog" {
source="github.com/pgdogdev/pgdog-eks-terraform"cluster_name="my-eks-cluster"namespace="pgdog"aurora_clusters=[
{
cluster_identifier ="my-aurora-cluster"
database_name ="mydb"
},
]
users=[
{
name ="myapp"
database ="mydb"# must match database_name above
secret_arn ="arn:aws:secretsmanager:us-east-1:123456789012:secret:pgdog/myapp-AbCdEf"
},
]
}
Database Discovery
The database_name field on rds_instances, aurora_clusters, and databases is the PgDog logical database name. It must match the database field on users entries to connect users to databases.
RDS Instances
Each RDS instance is looked up via aws_db_instance. The module detects the role automatically:
Standalone instances get role = "primary"
Read replicas (where replicate_source_db is set) get role = "replica"
Each Aurora cluster is looked up via aws_rds_cluster to discover its cluster_members. Each member instance is resolved individually via aws_db_instance to get its direct endpoint (cluster-level read/write endpoints are not used).
All Aurora instances get role = "auto" so PgDog detects primary/replica via LSN monitoring. When Aurora clusters are present, the module automatically sets lsnCheckDelay = 0 and lsnCheckInterval = 1000.
Passwords are fetched from AWS Secrets Manager at plan/apply time and passed to the Helm chart as values. Each secret should contain the password as plaintext.
Note: Passwords will be stored in Terraform state.
users=[
{
name ="myapp"
database ="mydb"
secret_arn ="arn:aws:secretsmanager:us-east-1:123456789012:secret:myapp-password"
},
]
The External Secrets Operator pulls users.toml directly from a secret store in-cluster. Passwords never enter Terraform state. Requires a SecretStore resource to already exist in the namespace.