# Encrypted password in template context by Terraform

**URL:** <https://forum.opennebula.io/t/encrypted-password-in-template-context-by-terraform/9692>\
**Category:** Product Support\
**Created:** [July 12, 2021, 11:16am UTC](https://forum.opennebula.io/t/encrypted-password-in-template-context-by-terraform/9692 "2021-07-12T11:16:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![perrfect](https://avatars.discourse-cdn.com/v4/letter/p/45deac/32.png) [@perrfect](https://forum.opennebula.io/u/perrfect)\
**Post date:** [July 12, 2021, 11:16am UTC](https://forum.opennebula.io/t/encrypted-password-in-template-context-by-terraform/9692/1 "2021-07-12T11:16:55Z")

</div>

Hello.  
How can create an encrypted password in a template context using Terraform?

The context in Terraform:

```auto
 context = {
    NETWORK = "YES"
    PASSWORD = "mypassword"
  }

```

But when add password and it value to the template context without terraform, using a web interface, password is encrypted.

---

<div class="post-metadata">

**Author:** ![cgonzalez](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/cgonzalez/32/7096_2.png) [@cgonzalez](https://forum.opennebula.io/u/cgonzalez)\
**Post date:** [July 13, 2021, 8:34am UTC](https://forum.opennebula.io/t/encrypted-password-in-template-context-by-terraform/9692/2 "2021-07-13T08:34:06Z")

</div>

HI @perrfect,

The password should be encrypted in the OpenNebula Template once it’s created by Terraform. Could you share the output of `onetemplate show -x` for the resulting template?

---

<div class="post-metadata">

**Author:** ![perrfect](https://avatars.discourse-cdn.com/v4/letter/p/45deac/32.png) [@perrfect](https://forum.opennebula.io/u/perrfect)\
**Post date:** [July 13, 2021, 11:58am UTC](https://forum.opennebula.io/t/encrypted-password-in-template-context-by-terraform/9692/3 "2021-07-13T11:58:07Z")

</div>

Hello.  
Thank you for reply.  
The password doesn’t encrypted(

```auto
<VMTEMPLATE>
  <ID>36</ID>
  <UID>2</UID>
  <GID>100</GID>
  <UNAME>terraform-admin</UNAME>
  <GNAME>terraform</GNAME>
  <NAME>Centos 7</NAME>
  <PERMISSIONS>
    <OWNER_U>1</OWNER_U>
    <OWNER_M>1</OWNER_M>
    <OWNER_A>0</OWNER_A>
    <GROUP_U>1</GROUP_U>
    <GROUP_M>1</GROUP_M>
    <GROUP_A>0</GROUP_A>
    <OTHER_U>0</OTHER_U>
    <OTHER_M>0</OTHER_M>
    <OTHER_A>0</OTHER_A>
  </PERMISSIONS>
  <REGTIME>1626170802</REGTIME>
  <TEMPLATE>
    <CONTEXT>
      <NETWORK><![CDATA[YES]]></NETWORK>
      <PASSWORD><![CDATA[mypassword]]></PASSWORD>
      <SET_HOSTNAME><![CDATA[$NAME]]></SET_HOSTNAME>
      <SSH_PUBLIC_KEY><![CDATA[$USER[SSH_PUBLIC_KEY]]]></SSH_PUBLIC_KEY>
    </CONTEXT>
    <CPU><![CDATA[2.000000]]></CPU>
    <DISK>
      <DRIVER><![CDATA[raw]]></DRIVER>
      <IMAGE_ID><![CDATA[51]]></IMAGE_ID>
      <SIZE><![CDATA[8192]]></SIZE>
      <TARGET><![CDATA[sda]]></TARGET>
    </DISK>
    <GRAPHICS>
      <KEYMAP><![CDATA[en-us]]></KEYMAP>
      <LISTEN><![CDATA[0.0.0.0]]></LISTEN>
      <TYPE><![CDATA[VNC]]></TYPE>
    </GRAPHICS>
    <MEMORY><![CDATA[2048]]></MEMORY>
    <OS>
      <ARCH><![CDATA[x86_64]]></ARCH>
      <BOOT><![CDATA[disk0]]></BOOT>
    </OS>
    <VCPU><![CDATA[2]]></VCPU>
  </TEMPLATE>
</VMTEMPLATE>

```
