# Get the value of secrets of AWS secrets manager in jinja template

**URL:** <https://forum.ansible.com/t/get-the-value-of-secrets-of-aws-secrets-manager-in-jinja-template/30989>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [August 8, 2019, 8:20am UTC](https://forum.ansible.com/t/get-the-value-of-secrets-of-aws-secrets-manager-in-jinja-template/30989 "2019-08-08T08:20:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shantanu\_Jain](https://avatars.discourse-cdn.com/v4/letter/s/a88e4f/32.png) [@Shantanu\_Jain](https://forum.ansible.com/u/Shantanu_Jain)\
**Post date:** [August 8, 2019, 8:20am UTC](https://forum.ansible.com/t/get-the-value-of-secrets-of-aws-secrets-manager-in-jinja-template/30989/1 "2019-08-08T08:20:54Z")

</div>

I am running the following command:

aws secretsmanager get-secret-value --secret-id Sumo/\*\*\*\*\*\* | jq --raw-output ‘.SecretString’ | jq -r .access\_id

which gives me an output for the access\_id.

I need to use this access id as a value of a variable in jijna template for sumo installation, can anyone help me with this, I am trying to set the value in a file and use lookup for it, but it seems to be a layman way of doing it. It would be really appreciated, if anyone can suggest a better way of achieving this.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [August 8, 2019, 8:35am UTC](https://forum.ansible.com/t/get-the-value-of-secrets-of-aws-secrets-manager-in-jinja-template/30989/2 "2019-08-08T08:35:17Z")

</div>

lookup plugin pipe where you need it to or set the result in a variable with set\_fact if you going to use it multiple times.
