List databases in a cluster - Amazon Redshift
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Amazon Redshift will no longer support the creation of new Python UDFs starting Patch 198. Existing Python UDFs will continue to function until June 30, 2026. For more information, see the blog post .

List databases in a cluster

To list the databases in a cluster, use the aws redshift-data list-databases Amazon CLI command.

The following Amazon CLI command runs a SQL statement against a cluster to list databases. This example uses the Amazon Secrets Manager authentication method.

aws redshift-data list-databases --secret-arn arn:aws:secretsmanager:us-west-2:123456789012:secret:myuser-secret-hKgPWn --cluster-identifier mycluster-test --database dev

The following is an example of the response.

{ "Databases": [ "dev" ] }

The following Amazon CLI command runs a SQL statement against a cluster to list databases. This example uses the temporary credentials authentication method.

aws redshift-data list-databases --db-user myuser --cluster-identifier mycluster-test --database dev

The following is an example of the response.

{ "Databases": [ "dev" ] }