Phoenix supports IAM database authentication for PostgreSQL connections to Amazon Aurora/RDS.
IAM database authentication for PostgreSQL (Aurora/RDS) is available since Phoenix 12.9.0. Use that version or newer before following this guide.
First, ensure that Phoenix runs with valid AWS credentials, either by using an IAM role attached to the instance (EC2/ECS/EKS), or by configuring AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY. Configuring AWS_DEFAULT_REGION is required.The IAM role will need a rds-db:connect policy associated with it.
# Standard AWS configurationexport AWS_DEFAULT_REGION=us-east-2 ## REQUIREDexport AWS_ACCESS_KEY_ID=your_keyexport AWS_SECRET_ACCESS_KEY=your_secret# OR use ~/.aws/credentials and ~/.aws/config# OR use IAM role (EC2/ECS/EKS)
Then, configure Phoenix to use the Amazon Aurora/RDS instance with IAM-based authentication. No token-lifetime tuning is required; Phoenix generates a fresh IAM token for each new database connection.
# Enable IAM authenticationexport PHOENIX_POSTGRES_USE_AWS_IAM_AUTH=true# Database connectionexport PHOENIX_POSTGRES_HOST=mydb.us-east-2.rds.amazonaws.comexport PHOENIX_POSTGRES_USER=iam_db_userexport PHOENIX_POSTGRES_DB=phoenix