amazon.aws
amazon.aws copied to clipboard
AWS S3 put object using only body
SUMMARY
in AWS boto3 for python I am able to directly write a string to S3 as a file, I went through the code and documentation and didnt see that as a feature in this ansible collection. Are there any work arounds currently, if not is this on the road map?
ISSUE TYPE
- Feature Idea
COMPONENT NAME
- ansible-collections/amazon.aws
ADDITIONAL INFORMATION
in python - boto3
S3.put_object(Bucket='mys3bucket', Key='dest/file/location.txt', Body=data_string)
this would be useful for writing a lot of small files to S3 rather than copy files from local machine or local storage to s3 bucket, this is useful for data ETLs
Files identified in the description: None
If these files are inaccurate, please update the component name section of the description or use the !component bot command.
@DzouOnionGardener: Greetings! Thanks for taking the time to open this issue. In order for the community to handle your issue effectively, we need a bit more information.
Here are the items we could not find in your description:
- component name
Please set the description of this issue with this template: https://raw.githubusercontent.com/ansible/ansible/devel/.github/ISSUE_TEMPLATE/bug_report.md
Hi @DzouOnionGardener, thank you for raising this issue. Could you please try using this? content parameter allows you to specify the content to put in a file. Let me know please if this solved your problem.
- name: create an object from static content
aws_s3:
bucket: bucket_name
object: file.txt
mode: put
content: >-
simple content string
register: result
@DzouOnionGardener This issue is waiting for your response. Please respond or the issue will be closed.
s3_object's "content" parameter provides this functionality.