Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a option to do not recreate file if contente doesn't change #145

Open
1 task done
ghdiska opened this issue Oct 3, 2022 · 1 comment
Open
1 task done

add a option to do not recreate file if contente doesn't change #145

ghdiska opened this issue Oct 3, 2022 · 1 comment

Comments

@ghdiska
Copy link

ghdiska commented Oct 3, 2022

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

  • I agree to follow this project's Code of Conduct
@bflad
Copy link
Contributor

bflad commented Oct 3, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants