Salesforce to Amazon S3¶
Use the SalesforceToS3Operator
transfer to execute a Salesforce query to fetch data and upload to an Amazon Simple
Storage Service (S3) file.
Prerequisite Tasks¶
To use these operators, you must do a few things:
Create necessary resources using AWS Console or AWS CLI.
Install API libraries via pip.
pip install 'apache-airflow[amazon]'Detailed information is available Installation of Airflow®
Operators¶
Extract data from Salesforce to Amazon S3 transfer operator¶
The following example demonstrates a use case of extracting account data from a Salesforce instance and upload to an Amazon S3 bucket.
tests/system/amazon/aws/example_salesforce_to_s3.py
upload_salesforce_data_to_s3 = SalesforceToS3Operator(
task_id="upload_salesforce_to_s3",
salesforce_query="SELECT AccountNumber, Name FROM Account",
s3_bucket_name=s3_bucket,
s3_key=s3_key,
salesforce_conn_id="salesforce",
replace=True,
)