首页 > 解决方案 > ACL permissions for write_dynamic_frame_from_options in to S3 using AWS Glue

问题描述

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??

标签: python-3.xamazon-web-servicesamazon-s3pysparkaws-glue

解决方案


这会成功的

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

scala版本如下:

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

推荐阅读