aws.s3
aws.s3 copied to clipboard
how to disable server-side-encryption
Hi,
I am able to connect to the s3 bucket and write data by using put_object function. It looks like there is server-side-encryption by default because I am not able to download the file I put in S3, I get access denied error while downloading the file. Previously, I wasn't getting this error. Here is my code.
Sys.setenv("AWS_ACCESS_KEY_ID" = key1,
"AWS_SECRET_ACCESS_KEY" = key2,
"AWS_DEFAULT_REGION" = "us-west-2")
# write to an in-memory raw connection
temp_dataset <- rawConnection(raw(0), "r+")
write.csv(my_data, temp_dataset)
# upload the object to S3
aws.s3::put_object(file = rawConnectionValue(temp_dataset),object = paste0(paste0("s3://my_bucket/folder1/",Sys.Date(),"/test.csv")))
Note: the AWS user I create AWS_ACCESS_KEYs was created in another AWS account. The S3 bucket was created in another AWS account. But, I was able to give access to the user through bucket policy so that I was able to put the file in S3.