blob: 032ecc59749464223afad403cbff7d6f47d33f9d [file] [log] [blame]
:py:mod:`airflow.providers.amazon.aws.transfers.sftp_to_s3`
===========================================================
.. py:module:: airflow.providers.amazon.aws.transfers.sftp_to_s3
Module Contents
---------------
Classes
~~~~~~~
.. autoapisummary::
airflow.providers.amazon.aws.transfers.sftp_to_s3.SFTPToS3Operator
.. py:class:: SFTPToS3Operator(*, s3_bucket, s3_key, sftp_path, sftp_conn_id = 'ssh_default', s3_conn_id = 'aws_default', use_temp_file = True, **kwargs)
Bases: :py:obj:`airflow.models.BaseOperator`
This operator enables the transferring of files from a SFTP server to
Amazon S3.
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:SFTPToS3Operator`
:param sftp_conn_id: The sftp connection id. The name or identifier for
establishing a connection to the SFTP server.
:param sftp_path: The sftp remote path. This is the specified file path
for downloading the file from the SFTP server.
:param s3_conn_id: The s3 connection id. The name or identifier for
establishing a connection to S3
:param s3_bucket: The targeted s3 bucket. This is the S3 bucket to where
the file is uploaded.
:param s3_key: The targeted s3 key. This is the specified path for
uploading the file to S3.
:param use_temp_file: If True, copies file first to local,
if False streams file from SFTP to S3.
.. py:attribute:: template_fields
:annotation: :Sequence[str] = ['s3_key', 'sftp_path']
.. py:method:: get_s3_key(s3_key)
:staticmethod:
This parses the correct format for S3 keys regardless of how the S3 url is passed.
.. py:method:: execute(self, context)
This is the main method to derive when creating an operator.
Context is the same dictionary used as when rendering jinja templates.
Refer to get_template_context for more context.