# How to use vault to encrypt keys used with ec2 dynamic inventory?

**URL:** <https://forum.ansible.com/t/how-to-use-vault-to-encrypt-keys-used-with-ec2-dynamic-inventory/18453>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [June 9, 2015, 8:23pm UTC](https://forum.ansible.com/t/how-to-use-vault-to-encrypt-keys-used-with-ec2-dynamic-inventory/18453 "2015-06-09T20:23:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![WhileLoop](https://avatars.discourse-cdn.com/v4/letter/w/bc8723/32.png) [@WhileLoop](https://forum.ansible.com/u/WhileLoop)\
**Post date:** [June 9, 2015, 8:23pm UTC](https://forum.ansible.com/t/how-to-use-vault-to-encrypt-keys-used-with-ec2-dynamic-inventory/18453/1 "2015-06-09T20:23:35Z")

</div>

So when using the AWS modules I can use the ‘aws\_access\_key’ and the ‘aws\_secret\_key’ variables to define the keys used in a encrypted variable file. But from what I can tell the ec2 dynamic inventory can only read keys from environment variables or boto.cfg files.

Has anyone dealt with this before? Are there any workarounds to this?
