terraform-provider-local
terraform-provider-local copied to clipboard
add a option to do not recreate file if contente doesn't change
Terraform CLI and Provider Versions
any
Use Cases or Problem Statement
local file is used to generate a yaml file and apply it to a k8s cluster. if content doesn't change file is not applied , but terraform recreate it every time because local file is generate in an ephemeral machine.
Proposal
ad an option
generate_if_delete : true generate if file not found in any case false generate only if content change
How much impact is this issue causing?
Low
Additional Information
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Hi @ghdiska 👋
Without knowing the full details of your environment/configuration, would something like Terraform's built in yamlencode() function meet your use case better than writing a file to the local filesystem with a local_file resource? (Aside: the experimental note is being removed)
The local_file resource is intentionally designed to manage a file on the filesystem. Providing an option that works outside that design would likely not be acceptable since it introduces the potential for inconsistency with its stated purpose.