Reputation: 711
I have installed aws_s3
extension in Aurora PostgreSQL
to write/read table data in S3
bucket.
I am able to create S3
objects by exporting DB query result set and able to read from it from the DB using the aws_s3
in-built functions with General Purpose
S3 buckets.
But I am not able to do it with Express One Zone
buckets which is a Directory bucket
.
The reason being a different type of Server Side Encryption
.
1. General Purpose S3 bucket
I executed the below function that comes with aws_s3
extension which exports/imports successfully for General purpose S3 bucket
.
SELECT rows_uploaded FROM aws_s3.query_export_to_s3 (query=>'select * from table_test', s3_info=>aws_commons.create_s3_uri('gen-purpose-bucket-1--usw1-az6--x-s3','/tables/table_test', 'us-west-1'), options=>'FORMAT text');
The above function executes successfully and exports data to S3
bucket.
2. Directory S3 bucket (Express One Zone)
I execute the same function for Directory bucket
and I get the error as below.
SELECT rows_uploaded FROM aws_s3.query_export_to_s3 (query=>'select * from table_test', s3_info=>aws_commons.create_s3_uri('express-one-zone-bucket-1--usw1-az6--x-s3','/tables/table_test', 'us-west-1'), options=>'FORMAT text') ;
Error :
ERROR: Amazon S3 client returned 'Unable to parse ExceptionName: InvalidRequest Message: Session was created with ServerSideEncryption as AES256 but request header specifies SSE-KMS.'.could not upload to Amazon S3
The function aws_s3.query_export_to_s3
has a parameter kms_key
to which I tried passing the value AES256
still it fails with the same error.
However, I am able to create the object in Express One Zone
bucket when I run the below command from CloudShell
.
aws s3api put-object --bucket express-one-zone-bucket-1--usw1-az6--x-s3 --key test --server-side-encryption AES256
Any help on this is much appreciated.
Upvotes: 0
Views: 47