2
votes

I am running the following query in SQL. I am trying to unload data from Redshift to a bucket in my personal S3 account:

UNLOAD ('SELECT * FROM table WHERE
UPPER(description) LIKE \'%something%\')
TO 's3://mybucketname/sometextname.txt' CREDENTIALS 
'aws_access_key_id=xxx;aws_secret_access_key=xxx'
PARALLEL OFF

When I do this, I get the following error:

The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.,Status 301,Error PermanentRedirect,Rid AE9F82CD626A5B05,ExtRid 1hl5HHhv9rkaq0Vw7fB0kpm2WO1uOmy4MmXq

Is my s3 path correct? Do I need to change some permissions for my s3 account or bucket?

1
Are the Redshift cluster and S3 bucket in the same region?Mark B

1 Answers

2
votes

This feature is now supported. https://docs.aws.amazon.com/redshift/latest/dg/r_UNLOAD.html

unload ('select * from category')   
to 's3://your-bucket/your-prefix' 
iam_role 'arn:aws:iam::xxxxxxxx:role/redshift-role'
region 'us-west-2';