eladkal commented on code in PR #22758:
URL: https://github.com/apache/airflow/pull/22758#discussion_r852700747
##########
airflow/providers/amazon/aws/operators/s3.py:
##########
@@ -318,6 +318,94 @@ def execute(self, context: 'Context'):
)
+class S3CreateObjectOperator(BaseOperator):
+ """
+ Creates a new object from `data` as string or bytes.
+
+ .. seealso::
+ For more information on how to use this operator, take a look at the
guide:
+ :ref:`howto/operator:S3CreateObjectOperator`
+
+ :param s3_bucket: Name of the S3 bucket where to save the object.
(templated)
+ It should be omitted when `bucket_key` is provided as a full s3:// url.
+ :param s3_key: The key of the object to be created. (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 bucket_name.
+ :param data: string or bytes to save as content.
+ :param replace: If True, it will overwrite the key if it already exists
+ :param encrypt: 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.
+ :param acl_policy: String specifying the canned ACL policy for the file
being
+ uploaded to the S3 bucket.
+ :param encoding: The string to byte encoding.
+ It should be specified only when `data` is provided as string.
+ :param compression: Type of compression to use, currently only gzip is
supported.
+ It can be specified only when `data` is provided as string.
+ :param aws_conn_id: Connection id of the S3 connection to use
+ :param verify: Whether 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.
+
+ """
+
+ template_fields: Sequence[str] = ('s3_bucket', 's3_key')
Review Comment:
```suggestion
template_fields: Sequence[str] = ('s3_bucket', 's3_key', 'data')
```
For the use case described you need also to load metadata from Xcom
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]