Created
May 30, 2025 10:27
-
-
Save kevinhooke/9726a97ff69d7eca8ddb428896fb559d to your computer and use it in GitHub Desktop.
Terraform local provider local_file using a template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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