I have a requirement where I need to load data into Redshift table from S3. Files present in the S3 are in Parquet format. I don't have an IAM policy but have an S3 Access Key and Secret Key.
Things to note: Redshift and S3 are in two different AWS accounts however these accounts are in the same region.
What I have tried:
copy abc from 's3://us-publish-prod/customer/r_cust_geo_funcl_terr_addr_elig/'
credentials 'aws_access_key_id=XXXXXXXXX;aws_secret_access_key=XXXXXXXXXXX'
FORMAT AS PARQUET;
Error: Invalid operation: COPY from this file format only accepts IAM_ROLE credentials
Thanks in Advance.
According to COPY from columnar data formats - Amazon Redshift , it seems that loading data from Parquet format requires use of an IAM Role rather than IAM credentials:
COPY
command credentials must be supplied using an AWS Identity and Access Management (IAM) role as an argument for theIAM_ROLE
parameter or theCREDENTIALS
parameter.
This would mean using either of:
CREDENTIALS 'aws_iam_role=arn:aws:iam::<aws-account-id>:role/<role-name>'
IAM_ROLE 'arn:aws:iam::<aws-account-id>:role/<role-name'
Thus, you need to use an IAM Role , even if the files were stored in your own AWS account.
You will therefore need to:
GetObject
and ListBucket
on the S3 bucket that contains the source data (in the other account)GetObject
and ListBucket
permissions (most likely identical to what they have granted to your IAM User)COPY
command to use the IAM Role instead of credentialsSee: Authorizing Amazon Redshift to access other AWS services on your behalf
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.