S3CopyObjectOperator
AmazonCreates a copy of an object that is already stored in S3.
Access Instructions
Install the Amazon provider package into your Airflow environment.
Import the module into your DAG file and instantiate it with your desired params.
Parameters
source_bucket_keyRequiredThe key of the source object. (templated) It can be either full s3:// style url or relative path from root level. When it’s specified as a full s3:// url, please omit source_bucket_name.
dest_bucket_keyRequiredThe key of the object to copy to. (templated) The convention to specify dest_bucket_key is the same as source_bucket_key.
source_bucket_nameName of the S3 bucket where the source object is in. (templated) It should be omitted when source_bucket_key is provided as a full s3:// url.
dest_bucket_nameName of the S3 bucket to where the object is copied. (templated) It should be omitted when dest_bucket_key is provided as a full s3:// url.
source_version_idVersion ID of the source object (OPTIONAL)
aws_conn_idConnection id of the S3 connection to use
verifyWhether or not to verify SSL certificates for S3 connection. By default SSL certificates are verified. You can provide the following values: False: do not validate SSL certificates. SSL will still be used,but SSL certificates will not be verified. path/to/cert/bundle.pem: A filename of the CA cert bundle to uses.You can specify this argument if you want to use a different CA cert bundle than the one used by botocore.
acl_policyString specifying the canned ACL policy for the file being uploaded to the S3 bucket.
Documentation
Creates a copy of an object that is already stored in S3.
Note: the S3 connection used here needs to have access to both source and destination bucket/key.
See also
For more information on how to use this operator, take a look at the guide: Copy an Amazon S3 object
Example DAGs
Move Files in S3 with Dynamic Task Mapping
This DAG shows an example implementation of sorting files in an S3 bucket into two different buckets based on logic involving the content of the files using dynamic task mapping with the expand_kwargs…
Airflow FundamentalsETL/ELT
Crate Data Quality Checks DAG
Imports local files to S3, then to CrateDB and checks several data quality properties
ETL/ELTData QualityDatabases