# ec2 module, encrypted: true doesn't create EBS volume with encryption enabled

**URL:** <https://forum.ansible.com/t/ec2-module-encrypted-true-doesnt-create-ebs-volume-with-encryption-enabled/18630>\
**Category:** Ansible Project\
**Created:** [June 28, 2015, 4:35pm UTC](https://forum.ansible.com/t/ec2-module-encrypted-true-doesnt-create-ebs-volume-with-encryption-enabled/18630 "2015-06-28T16:35:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pradeep\_Reddy1](https://avatars.discourse-cdn.com/v4/letter/p/ee59a6/32.png) [@Pradeep\_Reddy1](https://forum.ansible.com/u/Pradeep_Reddy1)\
**Post date:** [June 28, 2015, 4:35pm UTC](https://forum.ansible.com/t/ec2-module-encrypted-true-doesnt-create-ebs-volume-with-encryption-enabled/18630/1 "2015-06-28T16:35:52Z")

</div>

Here is my role

> * * *
> 
> - name: Launch instance  
> ec2:  
> region: ‘{{ region }}’  
> zone: ‘{{ zone }}’  
> keypair: ‘{{ keypair }}’  
> group: ‘{{ security\_group }}’  
> image: ‘{{ image }}’  
> instance\_type: ‘{{ instance\_type | default(“t2.micro”) }}’  
> instance\_profile\_name: ‘{{ instance\_profile\_name | default(omit) }}’  
> count: ‘{{ instance\_count | default(1) }}’  
> vpc\_subnet\_id: ‘{{vpc\_subnet\_id | default(omit)}}’  
> instance\_tags: ‘{“Name”:“{{tag\_name}}”,“customer”:“{{tag\_customer}}”,“project”:“{{tag\_project}}”,“roleis”:“{{tag\_role}}”,“environment”:“{{env}}”,“node”:“{{tag\_node}}”}’  
> wait: yes  
> volumes:  
> device\_name: /dev/sdb  
> device\_type: gp2  
> volume\_size: “{{volume\_size}}”  
> delete\_on\_termination: false  
> encrypted: true  
> monitoring: no  
> register: ec2
> 
> # Use with\_items to add each instances public IP to a new hostgroup for use in the next play.
> 
> - name: Add new instances to host group  
> add\_host:  
> name: ‘{{item.public\_dns\_name}}’  
> groups: launch  
> with\_items: ec2.instances
> 
> - name: Wait for SSH to be available  
> wait\_for:  
> host: ‘{{item.public\_dns\_name}}’  
> port: 22  
> delay: 60  
> timeout: 480  
> state: started  
> with\_items: ec2.instances

This isn’t working for some reason  
ansible 2.0.0 (devel de52cfb5d7)

---

<div class="post-metadata">

**Author:** ![Dean\_Mills](https://avatars.discourse-cdn.com/v4/letter/d/77aa72/32.png) [@Dean\_Mills](https://forum.ansible.com/u/Dean_Mills)\
**Post date:** [June 29, 2015, 4:52pm UTC](https://forum.ansible.com/t/ec2-module-encrypted-true-doesnt-create-ebs-volume-with-encryption-enabled/18630/2 "2015-06-29T16:52:01Z")

</div>

Disk encryption is not supported on a t2.micro instance. You need to use a supported instance size and then it should work. Did the instance creation fail? My guess is it should, but perhaps that depends on what AWS/boto sends back.

[http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html)

D

---

<div class="post-metadata">

**Author:** ![Pradeep\_Reddy1](https://avatars.discourse-cdn.com/v4/letter/p/ee59a6/32.png) [@Pradeep\_Reddy1](https://forum.ansible.com/u/Pradeep_Reddy1)\
**Post date:** [July 1, 2015, 8:03am UTC](https://forum.ansible.com/t/ec2-module-encrypted-true-doesnt-create-ebs-volume-with-encryption-enabled/18630/3 "2015-07-01T08:03:56Z")

</div>

Surprisingly, even with m3.large, which is a supported instance type for EBS encryption , Volume (100GB) is not being created with encryption enabled.

---

<div class="post-metadata">

**Author:** ![Pradeep\_Reddy1](https://avatars.discourse-cdn.com/v4/letter/p/ee59a6/32.png) [@Pradeep\_Reddy1](https://forum.ansible.com/u/Pradeep_Reddy1)\
**Post date:** [July 1, 2015, 9:23am UTC](https://forum.ansible.com/t/ec2-module-encrypted-true-doesnt-create-ebs-volume-with-encryption-enabled/18630/4 "2015-07-01T09:23:26Z")

</div>

Checked the code in ec2.py that came along with my ansible version, As it turns out this version ansible 2.0.0 (devel de52cfb5d7) doesn’t have the ec2.py with encryption support
