# Summary: Example of output of local_file filename# Documentation: https://www.terraform.io/docs/language/settings/index.htmlterraform{required_version=">= 1.0.0"}# Documentation:variable "changeme_filename" {default="changeme_default_filename.txt"}# Documentation: https://www.terraform.io/docs/language/values/variables.htmlvariable "changeme_content" {default="Hello terraform local output module!"}# Documentation: https://www.terraform.io/docs/language/values/outputs.htmloutput "changeme_filename" {value= var.changeme_filename
}# Documentation: https://registry.terraform.io/providers/hashicorp/local/latest/docs/resources/fileresource "local_file""changeme_local_file_hello_local_output"{content= var.changeme_content
filename= var.changeme_filename
}
run.sh
#!/bin/bash
../../../bin/apply.sh aws
local_file/module/
destroy.sh
#!/bin/bash
../../../bin/destroy.sh aws
main.tf
# Summary: Example of including a module and outputting a variable from it# Documentation: https://www.terraform.io/docs/language/settings/index.htmlterraform{required_version=">= 1.0.0"}# Documentation: https://www.terraform.io/docs/language/values/outputs.htmloutput "changeme_consumer_filename" {value= module.changeme_hello.changeme_filename
}# Documentation: https://www.terraform.io/docs/language/modules/syntax.htmlmodule "changeme_hello" {source="../local_file"}