You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Omair Khan (Jira)" <ji...@apache.org> on 2020/03/16 13:05:00 UTC
[jira] [Assigned] (AIRFLOW-4175) S3Hook load_file should support
ACL policy parameter
[ https://issues.apache.org/jira/browse/AIRFLOW-4175?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Omair Khan reassigned AIRFLOW-4175:
-----------------------------------
Assignee: Omair Khan
> S3Hook load_file should support ACL policy parameter
> ----------------------------------------------------
>
> Key: AIRFLOW-4175
> URL: https://issues.apache.org/jira/browse/AIRFLOW-4175
> Project: Apache Airflow
> Issue Type: Improvement
> Components: hooks
> Affects Versions: 1.10.2
> Reporter: Keith O'Brien
> Assignee: Omair Khan
> Priority: Major
> Labels: gsoc, gsoc2020, mentor
>
> We have a use case where we are uploading files to an S3 bucket in a different AWS account to the one Airflow is running in. AWS S3 supports this situation using the pre canned ACL policy, specifically {{bucket-owner-full-control. }}
> However, the current implementations of the {{S3Hook.load_*}}() and {{S3Hook.copy_object}}() methods do not allow us to supply any ACL policy for the file being uploaded/copied to S3.
> It would be good to add another optional parameter to the {{S3Hook}} methods called {{acl_policy}} which would then be passed into the boto3 client method calls like so
>
> {code}
> # load_file
> ...
> if encrypt:
> extra_args['ServerSideEncryption'] = "AES256"
> if acl_policy:
> extra_args['ACL'] = acl_policy
> client.upload_file(filename, bucket_name, key, ExtraArgs=extra_args){code}
>
> {code}
> # load_bytes
> ...
> if encrypt:
> extra_args['ServerSideEncryption'] = "AES256"
> if acl_policy:
> extra_args['ACL'] = acl_policy
> client.upload_file(filename, bucket_name, key, ExtraArgs=extra_args){code}
> {code}
> # copy_object
> self.get_conn().copy_object(Bucket=dest_bucket_name,
> Key=dest_bucket_key,
> CopySource=CopySource,
> ACL=acl_policy)
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)