Skip to content

Instantly share code, notes, and snippets.

@abuxton
Last active October 7, 2022 12:26
Show Gist options
  • Save abuxton/c238706083791c62d7286d668a06e02f to your computer and use it in GitHub Desktop.
Save abuxton/c238706083791c62d7286d668a06e02f to your computer and use it in GitHub Desktop.
tfe helper

tfe helpers

# will render output of tfe_user_data_.sh.tpl nonsensative
output "tfe_user_data" {
  value = nonsensitive(templatefile("${path.module}/templates/tfe_user_data.sh.tpl", local.user_data_args))
}
# will render output of tfe_user_data_.sh.tpl base64encoded
# copy this to a file on the target instance and `cat <filename> | base64 --decode > tfe_user_data.sh`
# bash ./tfe_user_data.sh should then do as required. 

output "tfe_user_data_b64" {
  value = base64encode(nonsensitive(templatefile("${path.module}/templates/tfe_user_data.sh.tpl", local.user_data_args)))
}
# redhat issue work around
metadata_startup_script = templatefile("${path.module}/templates/tfe_user_data.sh.tpl", local.user_data_args)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment