Skip to content

Add support for ephemeral values with extra_config in r/vsphere_virtual_machine#2725

Description

@akli-ime

Code of Conduct

  • I have read and agree to the project's Code of Conduct.
  • Vote on this issue by adding a 馃憤 reaction to the original issue initial description to help the maintainers prioritize.
  • Do not leave "+1" or other comments that do not add relevant information or questions.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions