Code of Conduct
Description
Using ephemeral values inside the extra_config block of a vsphere_virtual_machine resource currently fails because Terraform does not allow ephemeral values
Terraform raises the following error:
Error: Invalid use of ephemeral value
Ephemeral values are not valid for "extra_config", because it is not a write-only attribute and must be persisted to state.
Terraform version : v1.14.3
vSphere provider version : v2.16.0
Use Case(s)
- Injecting cloud-init configuration via guestinfo.userdata
- Passing sensitive bootstrap data (passwords, tokens, scripts)
- Avoiding storage of sensitive data in Terraform state
- Following Terraform best practices using ephemeral values
Potential Configuration
resource "vsphere_virtual_machine" "vm" {
extra_config = {
"guestinfo.userdata" = "ephemeral example"
"guestinfo.userdata.encoding" = "base64"
}
}
References
Code of Conduct
Description
Using ephemeral values inside the
extra_configblock of avsphere_virtual_machineresource currently fails because Terraform does not allow ephemeral valuesTerraform raises the following error:
Terraform version : v1.14.3
vSphere provider version : v2.16.0
Use Case(s)
Potential Configuration
References
cloudinit_configephemeral resource聽hashicorp/terraform-provider-cloudinit#396 (cloud-init support currently under development with similar constraints)