# Create a playbook to copy local directory to s3 bucket

**URL:** <https://forum.ansible.com/t/create-a-playbook-to-copy-local-directory-to-s3-bucket/36024>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [November 22, 2021, 2:01pm UTC](https://forum.ansible.com/t/create-a-playbook-to-copy-local-directory-to-s3-bucket/36024 "2021-11-22T14:01:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sumit\_Debnath](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@Sumit\_Debnath](https://forum.ansible.com/u/Sumit_Debnath)\
**Post date:** [November 22, 2021, 2:01pm UTC](https://forum.ansible.com/t/create-a-playbook-to-copy-local-directory-to-s3-bucket/36024/1 "2021-11-22T14:01:21Z")

</div>

I have some directory which i want to copy on s3 bucket using aws s3 module ansible i have tried this

**aws\_s3:**  
**aws\_secret\_key: “{{ AWS\_SECRET\_KEY }}”**  
**aws\_access\_key: “{{ AWS\_ACCESS\_KEY }}”**  
**bucket: “{{ BUCKET }}”**  
**object: /project/**  
**src: “{{ role\_path }}/files/server-upgrade/”**  
**mode: put**

but i am getting error

fatal: [localhost]: FAILED! =\> {“changed”: false, “msg”: “Local object for PUT does not exist”}

---

<div class="post-metadata">

**Author:** ![Luca\_remix\_tj\_Lorenz](https://avatars.discourse-cdn.com/v4/letter/l/ea666f/32.png) [@Luca\_remix\_tj\_Lorenz](https://forum.ansible.com/u/Luca_remix_tj_Lorenz)\
**Post date:** [November 23, 2021, 9:14am UTC](https://forum.ansible.com/t/create-a-playbook-to-copy-local-directory-to-s3-bucket/36024/2 "2021-11-23T09:14:20Z")

</div>

Hello,  
aws\_s3 module doesn't upload an entire directory, but only single files.

Luca
