Example local resource
hcl · static example
variable "message" {
type = string
default = "Hello from Terraform"
}
resource "local_file" "welcome" {
filename = "${path.module}/welcome.txt"
content = var.message
}
output "welcome_path" {
value = local_file.welcome.filename
}This example writes a file in the module directory through the local provider. Review the target path before applying.