# S3 module - attempting to create folders via dest parameter ?

**URL:** <https://forum.ansible.com/t/s3-module-attempting-to-create-folders-via-dest-parameter/12903>\
**Category:** Ansible Project\
**Created:** [June 4, 2013, 7:25pm UTC](https://forum.ansible.com/t/s3-module-attempting-to-create-folders-via-dest-parameter/12903 "2013-06-04T19:25:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brice\_Burgess](https://avatars.discourse-cdn.com/v4/letter/b/d2c977/32.png) [@Brice\_Burgess](https://forum.ansible.com/u/Brice_Burgess)\
**Post date:** [June 4, 2013, 7:25pm UTC](https://forum.ansible.com/t/s3-module-attempting-to-create-folders-via-dest-parameter/12903/1 "2013-06-04T19:25:53Z")

</div>

Is it possible to use the S3 module to create folders within a bucket?

I am using ansible 1.1 and am getting;

msg: unsupported parameter for module: dest

The docs lead me to believe that the `dest` param is available to 1.1 (says nothing about being introduced in 1.2); although I can’t get it to work.  
Besides that; is dest intended to create folders? My command is;

- name: recreate bucket ( $bucket ) and add test\_file ($file) to bucket/test\_folder  
action: s3 bucket=$bucket state=present dest=“test\_folder” path=$file ec2\_access\_key=$iam\_s3\_rw\_key ec2\_secret\_key=$iam\_s3\_rw\_secret

Many thanks.

~ Brice

---

<div class="post-metadata">

**Author:** ![Lester\_Wade](https://avatars.discourse-cdn.com/v4/letter/l/97f17d/32.png) [@Lester\_Wade](https://forum.ansible.com/u/Lester_Wade)\
**Post date:** [June 4, 2013, 9:07pm UTC](https://forum.ansible.com/t/s3-module-attempting-to-create-folders-via-dest-parameter/12903/2 "2013-06-04T21:07:57Z")

</div>

Hi Brice,

No, the dest parameter in S3 is an override for the keyname (so the object, basically). Thus it can’t be used to create folders. Perhaps the parameter name for that one is a little misleading, or at least needs to be clearer. I’ll add an example with that parameter being used …

Lester

---

<div class="post-metadata">

**Author:** ![Lester\_Wade](https://avatars.discourse-cdn.com/v4/letter/l/97f17d/32.png) [@Lester\_Wade](https://forum.ansible.com/u/Lester_Wade)\
**Post date:** [June 4, 2013, 9:10pm UTC](https://forum.ansible.com/t/s3-module-attempting-to-create-folders-via-dest-parameter/12903/3 "2013-06-04T21:10:57Z")

</div>

p.s. interested in feedback on this module. I’d like to spend some more time improving it in the near future.

---

<div class="post-metadata">

**Author:** ![Brice\_Burgess](https://avatars.discourse-cdn.com/v4/letter/b/d2c977/32.png) [@Brice\_Burgess](https://forum.ansible.com/u/Brice_Burgess)\
**Post date:** [June 5, 2013, 4:26pm UTC](https://forum.ansible.com/t/s3-module-attempting-to-create-folders-via-dest-parameter/12903/4 "2013-06-05T16:26:38Z")

</div>

lwade,

Thanks for the response; assuming that dest

I’d like to be able to create folders. Is this possible? I’ve tried passing slashes in the bucket; e.g. bucket=bucketName/folderName – and the task hangs.

Re: feedback – outside of folder creation I’ve had a fair time with the module. Perhaps if there’s a slash in dest; it will create the folder? E.g.

action: s3 bucket=$bucket state=present dest=“subdir/test\_file” path=/tmp/test\_file

Also; It would be great if there was standardization in naming; e.g. I’m assuming `dest` is similar to `dest` in the template + lineinfile module. As such; why not use `src` as the source parameter of the file to PUT to allow uploading files from the machine running ansible; and use `path` (as it is now) to PUT a file from the machine ansible is executing against?

There may be a case to support GET because of private buckets that are inacessible via `get_url` or `uri` modules…

Lastly it would be nice to have the documentation updated to reflect that the s3 module supports the `ec2_access_key` and `ec2_secret_key` parameters ; similar to how template & copy respect the permissions parameters of the file module.

~ Brice

It would probably be nice to adhere to the “file” -esque module conventions and use

---

<div class="post-metadata">

**Author:** ![Brice\_Burgess](https://avatars.discourse-cdn.com/v4/letter/b/d2c977/32.png) [@Brice\_Burgess](https://forum.ansible.com/u/Brice_Burgess)\
**Post date:** [June 10, 2013, 4:21pm UTC](https://forum.ansible.com/t/s3-module-attempting-to-create-folders-via-dest-parameter/12903/5 "2013-06-10T16:21:04Z")

</div>

lwade,

Does the S3 module support creating folders within a bucket?

Thanks!

~ Brice

---

<div class="post-metadata">

**Author:** ![Lester\_Wade](https://avatars.discourse-cdn.com/v4/letter/l/97f17d/32.png) [@Lester\_Wade](https://forum.ansible.com/u/Lester_Wade)\
**Post date:** [June 10, 2013, 4:34pm UTC](https://forum.ansible.com/t/s3-module-attempting-to-create-folders-via-dest-parameter/12903/6 "2013-06-10T16:34:05Z")

</div>

Hey Brice,

No not currently. Sorry for the delay. Regarding your previous email …

With the parameters of the s3 module we had a fair discussion on here many months back about what form would be best, there would be some subtle differences to the file module since we’re uploading/downloading. Once I get a bit more time I’ll probably work this into a re-write.

---

<div class="post-metadata">

**Author:** ![Brice\_Burgess](https://avatars.discourse-cdn.com/v4/letter/b/d2c977/32.png) [@Brice\_Burgess](https://forum.ansible.com/u/Brice_Burgess)\
**Post date:** [June 11, 2013, 2:55pm UTC](https://forum.ansible.com/t/s3-module-attempting-to-create-folders-via-dest-parameter/12903/7 "2013-06-11T14:55:41Z")

</div>

lwade,

Roger that. I took a peek at the thread but didn’t see anything official come out of it. Good luck && let me know if you need any help! 🙂

Thanks,

~ Brice
