# EC2 with Volumes

**URL:** <https://forum.ansible.com/t/ec2-with-volumes/17900>\
**Category:** Ansible Project\
**Created:** [April 3, 2015, 11:53am UTC](https://forum.ansible.com/t/ec2-with-volumes/17900 "2015-04-03T11:53:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nico\_K](https://avatars.discourse-cdn.com/v4/letter/n/46a35a/32.png) [@Nico\_K](https://forum.ansible.com/u/Nico_K)\
**Post date:** [April 3, 2015, 11:53am UTC](https://forum.ansible.com/t/ec2-with-volumes/17900/1 "2015-04-03T11:53:56Z")

</div>

Hi,

Another EC2 question, when creating an instance using the ‘ec2’ task and specifying the volumes inline is it possible to:

a) obtain the volume id’s of the newly created volumes?  
b) or alternatively immediately tag the volumes?

Thanks,  
Nico

---

<div class="post-metadata">

**Author:** ![Erick\_Vitor\_de\_Barro](https://avatars.discourse-cdn.com/v4/letter/e/ee7513/32.png) [@Erick\_Vitor\_de\_Barro](https://forum.ansible.com/u/Erick_Vitor_de_Barro)\
**Post date:** [August 24, 2015, 9:19pm UTC](https://forum.ansible.com/t/ec2-with-volumes/17900/2 "2015-08-24T21:19:13Z")

</div>

This is something I really want to know 🙂

---

<div class="post-metadata">

**Author:** ![Ivan\_S\_Freitas](https://avatars.discourse-cdn.com/v4/letter/i/e99b99/32.png) [@Ivan\_S\_Freitas](https://forum.ansible.com/u/Ivan_S_Freitas)\
**Post date:** [August 24, 2015, 9:30pm UTC](https://forum.ansible.com/t/ec2-with-volumes/17900/3 "2015-08-24T21:30:49Z")

</div>

AFAIK you can't do that using the ec2 module directly. However, you  
can list all volume's ids using ec2\_vol module, register the output to  
a variable and tag it with ec2\_tags (I think you may also need a  
fairly recent version of ansible to be able to tag the volumes). I've  
been using this at work to create instances with custom (large) disks  
for databases without problems.
