SalesforceToS3Operator(*, salesforce_query: str, s3_bucket_name: str, s3_key: str, salesforce_conn_id: str, export_format: str = 'csv', query_params: Optional[Dict] = None, include_deleted: bool = False, coerce_to_timestamp: bool = False, record_time_added: bool = False, aws_conn_id: str = 'aws_default', replace: bool = False, encrypt: bool = False, gzip: bool = False, acl_policy: Optional[str] = None, **kwargs)¶
Submits a Salesforce query and uploads the results to AWS S3.
For more information on how to use this operator, take a look at the guide: Overview
salesforce_query (str) -- The query to send to Salesforce.
s3_bucket_name (str) -- The bucket name to upload to.
s3_key (str) -- The object name to set when uploading the file.
salesforce_conn_id (str) -- The name of the connection that has the parameters needed to connect to Salesforce.
export_format (str) -- Desired format of files to be exported.
query_params (dict) -- Additional optional arguments to be passed to the HTTP request querying Salesforce.
include_deleted (bool) -- True if the query should include deleted records.
coerce_to_timestamp (bool) -- True if you want all datetime fields to be converted into Unix timestamps. False if you want them to be left in the same format as they were in Salesforce. Leaving the value as False will result in datetimes being strings. Default: False
record_time_added (bool) -- True if you want to add a Unix timestamp field to the resulting data that marks when the data was fetched from Salesforce. Default: False
aws_conn_id (str) -- The name of the connection that has the parameters we need to connect to S3.
replace (bool) -- A flag to decide whether or not to overwrite the S3 key if it already exists. If set to False and the key exists an error will be raised.
encrypt (bool) -- If True, the file will be encrypted on the server-side by S3 and will be stored in an encrypted form while at rest in S3.
gzip (bool) -- If True, the file will be compressed locally.
acl_policy (str) -- String specifying the canned ACL policy for the file being uploaded to the S3 bucket.
template_fields= ['salesforce_query', 's3_bucket_name', 's3_key']¶
execute(self, context: Dict)¶