Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kevinhooke/9726a97ff69d7eca8ddb428896fb559d to your computer and use it in GitHub Desktop.
Save kevinhooke/9726a97ff69d7eca8ddb428896fb559d to your computer and use it in GitHub Desktop.
Terraform local provider local_file using a template
terraform {
required_providers {
local = {
source = "hashicorp/local"
}
}
# Provider functions require Terraform 1.8 and later.
required_version = ">= 1.8.0"
}
resource "local_file" "example-file" {
# replace ${exampleplaceholder} in template.tftpl
content = templatefile("${path.module}/template.tftpl", {exampleplaceholder = "examplevalue"})
filename = "${path.module}/example.txt"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment