Connect Amazon Redshift to xpander using IAM authentication
Connect Amazon Redshift to xpander using IAM authentication. This guide covers connecting a private Redshift cluster accessible only from the Kubernetes cluster — no public access required.
For self-hosted deployments, ensure the AWS Operator is configured with IAM role and Pod Identity before following this guide.
The SelfAssume statement must NOT have an ExternalId condition. The AI gateway’s internal code calls sts:AssumeRole on its own role without passing an external ID. If this statement is missing or has a condition, you’ll get AccessDenied errors.
The username IAMR:<role-name> is a Redshift convention that maps the IAM role to a database user.
Copy
Ask AI
kubectl run redshift-iam-setup --restart=Never --image=postgres:15-alpine -n xpander \ --env="PGPASSWORD=<MASTER_PASSWORD>" \ --command -- psql -h <REDSHIFT_ENDPOINT> -p 5439 -U <MASTER_USER> -d <DB_NAME> -c " CREATE USER \"IAMR:xpander-redshift-access\" PASSWORD DISABLE; GRANT SELECT ON ALL TABLES IN SCHEMA public TO \"IAMR:xpander-redshift-access\"; ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO \"IAMR:xpander-redshift-access\";"sleep 15 && kubectl logs redshift-iam-setup -n xpanderkubectl delete pod redshift-iam-setup -n xpander
Ask your xpander agent to validate the Redshift connection. Expected result: all checks pass (path config, database, target, AWS credentials, Data API client, auth method, query execution).
Add sts:TagSession to both the trust policy AND as a permission policy on the role.
sts:AssumeRole AccessDenied (self-assume)
The AI gateway re-assumes its own role internally. The trust policy needs a SelfAssume statement for the role’s own ARN without an ExternalId condition. Also add sts:AssumeRole as a permission policy.
redshift-data:ExecuteStatement AccessDenied
Add the Redshift Data API permissions policy (see step 5).
Connection timeout
Check the Redshift security group allows port 5439 from the EKS cluster security group.
Missing path parameter for 'cluster_name'
The connector path parameters (ClusterNamePath, DatabaseNamePath, CatalogNamePath) must be configured in the xpander UI with the correct values.