2
votes

I want a list of clusters using Python (boto3). I did some research and found this command in the boto3 documentation (http://boto3.readthedocs.org/en/latest/reference/services/redshift.html#paginators) to load redshift.

self.client = boto3.resource('redshift')

but I get this error :

botocore.exceptions.DataNotFoundError: Unable to load data for: redshift

Other information:

I can access redshift with psycopg2. I can do sql commands on it, but there is no way to get a list of the clusters. I'm using python 3.4.3.

1

1 Answers

1
votes

Have you already set up the boto3 session or are you doing this on a machine in AWS?

The boto3.resource() method will only work if there's already a session created.

There are a number of other options to set up the client, including:

client = boto3.client(SERVICE_NAME, AWS_REGION)

So in your case, if you were running in AWS region 'us-west-1':

client = boto3('redshift', 'us-west-1')
cluster_list = client.describe_clusters()