Using IAM authentication to generate database user credentials for Amazon Redshift serverless clusters
Amazon Redshift allows us to programmatically generate temporary database user credentials that can be used for automated scripts to connect to the cluster. Using the get-credentials command in the AWS CLI and GetCredentials in the API, you can generate temporary credentials that can then be used in JDBC and ODBC.
Getting ready
To complete this recipe, you will need the following setup:
- An IAM user with access to Amazon Redshift and AWS IAM.
- An Amazon Redshift serverless cluster deployed in the eu-west-1 AWS region. We will use the cluster ID as
[Your-Redshift_Cluster]. - Amazon Redshift serverless cluster master user credentials.
- Access to any SQL interface, such as a SQL client or the Amazon Redshift query editor V2.
- AWS CLI on your local client.
How to do it...
In this recipe, we will generate temporary credentials to connect...