Search code examples
encryptionamazon-s3amazon-kmsamazon-aurora

Aurora - Load data from s3 when bucket is encrypted


I'm trying to load data from a CSV file which is stored in an encrypted S3 bucket into an Aurora table.

LOAD DATA FROM S3 's3-eu-west-1://my.bucket/payout/export_payout.csv'
INTO TABLE payout
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
(payment_block_key,doc_date, item_text, currency, @days_in_arrears)
SET
days_in_arrears = NULLIF(@days_in_arrears, '');

If i run this query i get the following error:

S3 API returned error: Access Denied:Access Denied

How do i specify the KMS key arn for downloading the file to aurora?


Solution

  • Aurora uses an IAM Role to access data from Amazon S3. You will need to grant that role permission to access the S3 bucket and also permission to use the relevant key from KMS.

    See: