airflow.providers.amazon.aws.transfers.s3_to_ftp

Classes

S3ToFTPOperator

This operator enables the transferring of files from S3 to a FTP server.

Module Contents

class airflow.providers.amazon.aws.transfers.s3_to_ftp.S3ToFTPOperator(*, s3_bucket, s3_key, ftp_path, s3_filenames=None, ftp_filenames=None, aws_conn_id='aws_default', ftp_conn_id='ftp_default', fail_on_file_not_exist=True, **kwargs)[source]

Bases: airflow.providers.common.compat.sdk.BaseOperator

This operator enables the transferring of files from S3 to a FTP server.

See also

For more information on how to use this operator, take a look at the guide: Amazon S3 To FTP transfer operator

Parameters:
  • s3_bucket – The targeted s3 bucket. This is the S3 bucket from where the file is downloaded.

  • s3_key – The targeted s3 key. For a single file it must include the file path. For multiple files it is the key prefix (directory) and must end with "/".

  • s3_filenames (str | list[str] | None) – Only used if you want to move multiple files. You can pass a list with exact key suffixes present under the s3_key prefix, or a string prefix that all filenames must match. Use "*" to move all objects under the s3_key prefix.

  • ftp_path – The ftp remote path. For a single file it must include the file path. For multiple files it is the destination directory path and must end with "/".

  • ftp_filenames (str | list[str] | None) – Only used if you want to move multiple files and name them differently at the destination. It can be a list of filenames or a string prefix that replaces the s3 prefix.

  • aws_conn_id – reference to a specific AWS connection

  • ftp_conn_id – The ftp connection id. The name or identifier for establishing a connection to the FTP server.

  • fail_on_file_not_exist (bool) – If True, operator fails when a source S3 key does not exist. If False, the operator logs a warning and skips the transfer. Default is True.

template_fields: collections.abc.Sequence[str] = ('s3_bucket', 's3_key', 'ftp_path', 's3_filenames', 'ftp_filenames')[source]
s3_bucket[source]
s3_key[source]
ftp_path[source]
s3_filenames = None[source]
ftp_filenames = None[source]
aws_conn_id = 'aws_default'[source]
ftp_conn_id = 'ftp_default'[source]
fail_on_file_not_exist = True[source]
execute(context)[source]

Derive when creating an operator.

The main method to execute the task. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

Was this entry helpful?