To access secrets stored in AWS Secrets Manager, Kong Gateway needs an IAM Role that has sufficient permissions to read the required secret values.
Kong Gateway can automatically fetch IAM role credentials based on your AWS environment, using the following precedence order:
- Fetch from credentials defined in environment variables
AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.
- Fetch from profile and credential file, defined by
AWS_PROFILE and AWS_SHARED_CREDENTIALS_FILE.
- Fetch from an ECS container credential provider.
- Fetch from an EKS IAM roles for service account.
- Fetch from EC2 IMDS metadata. Both v1 and v2 are supported.
Kong Gateway also supports role assuming using vaults.config.assume_role_arn and vaults.config.role_session_name, which lets you use a different IAM role to fetch secrets from AWS Secrets Manager.
This is a common practice for permission division, governance, and cross-AWS account management.
Note: IAM Identity Center credential provider and process credential provider are not supported.