# s3 or aws\_s3 module getstr mode. How do you use this?

**URL:** <https://forum.ansible.com/t/s3-or-aws-s3-module-getstr-mode-how-do-you-use-this/25635>\
**Category:** Ansible Project\
**Created:** [September 29, 2017, 1:01am UTC](https://forum.ansible.com/t/s3-or-aws-s3-module-getstr-mode-how-do-you-use-this/25635 "2017-09-29T01:01:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jamie\_Jamison](https://avatars.discourse-cdn.com/v4/letter/j/7993a0/32.png) [@Jamie\_Jamison](https://forum.ansible.com/u/Jamie_Jamison)\
**Post date:** [September 29, 2017, 1:01am UTC](https://forum.ansible.com/t/s3-or-aws-s3-module-getstr-mode-how-do-you-use-this/25635/1 "2017-09-29T01:01:22Z")

</div>

I was looking at the documentation for the s3 (aws\_s3 in ansible 2.4 and above) module and noticed that there is a getstr mode that downloads an S3 object as a string.  
I’ve been playing around with this and the only way I can figure out how to use that string is to register a variable to store the output of the s3 task that downloads  
the string and then referencing it with string.contents. Am I missing something here or is there another way to do this?

- name: Download the contents of an S3 object as a string  
s3:  
ec2\_url: “{{ s3\_endpoint }}”  
bucket: “{{ s3\_bucket }}”  
object: "{{ s3\_object }}  
mode: getstr  
aws\_access\_key: “{{ s3\_access\_key\_id }}”  
aws\_secret\_key: “{{ s3\_secret\_access\_key }}”  
register: s3\_string
