4

How to add -acl permissions on s3 objects while trying to output Glue DynamicFrame using write_dynamic_frame_from_options. I gave this line of code when i tried converting data and drop the csv files into another AWS account S3 bucket

glueContext.write_dynamic_frame.from_options(frame = DATA_temp, connection_type = "s3", connection_options = {"path": "s3://{BUCKETNAME}/{FOLDER1}/#0001"}, format = "csv")

My process finished successfully but i was unable to download or open files in that account??

pyhotshot
  • 445
  • 8
  • 23

1 Answers1

8

This will do the trick

glueContext._jsc.hadoopConfiguration().set("fs.s3.canned.acl", "BucketOwnerFullControl")

The scala version is as below:

glueContext.sparkContext.hadoopConfiguration.set("fs.s3.canned.acl", "BucketOwnerFullControl")
Eman
  • 831
  • 5
  • 8