# EC2  volume\_size not working

**URL:** <https://forum.ansible.com/t/ec2-volume-size-not-working/21408>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [May 11, 2016, 1:11pm UTC](https://forum.ansible.com/t/ec2-volume-size-not-working/21408 "2016-05-11T13:11:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![akhform](https://avatars.discourse-cdn.com/v4/letter/a/50afbb/32.png) [@akhform](https://forum.ansible.com/u/akhform)\
**Post date:** [May 11, 2016, 1:11pm UTC](https://forum.ansible.com/t/ec2-volume-size-not-working/21408/1 "2016-05-11T13:11:48Z")

</div>

Hello all,

I’m trying to create an EC2 on my AWS account using Ansible (ansible-playbook 2.0.2.0), and i have an issue modifying the root volume of the EC2, when i add the following parameters:

volumes:

- device\_name: /dev/xvda  
volume\_size: 30  
device\_type: gp2  
delete\_on\_termination: true

tasks:

- name: Launch instance  
ec2:  
state: present  
vpc\_subnet\_id: “{{ vpc\_subnet }}”  
region: “{{ region }}”  
instance\_type: “{{ instance\_type }}”  
image: “{{ image }}”  
volumes: “{{ volumes }}”  
wait: true  
instance\_tags:  
env: “{{ prefix }}”  
count\_tag: “env”  
exact\_count: 1  
assign\_public\_ip: yes  
register: ec2

I received the following error:

**encrypted=volume.get(‘encrypted’, None))\nTypeError: init() got an unexpected keyword argument ‘encrypted’**

Removing the “volumes” block and everithing works fine.

I’m stuck with that error and i don’t have any idea on how to solve it, any help will be appreciate.

thanks for your support
