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

Need to apply when no changes detected on plan? #479

Open
seboudry opened this issue Jan 9, 2025 · 3 comments
Open

Need to apply when no changes detected on plan? #479

seboudry opened this issue Jan 9, 2025 · 3 comments

Comments

@seboudry
Copy link
Contributor

seboudry commented Jan 9, 2025

Hi! And happy new year ;)

For now, when drift detection is configured to run on a schedule, a plan is run regularly.
Even if the no changes is detected, the plan-sum hash changes.
So a new apply run is started because hash is different from apply-sum hash.

So, I raise the question about the need to run an apply when a plan detect no changes.
This create "empty" apply logs on S3 and waste compute resources.

@AlanLonguet
Copy link
Collaborator

Hi !

Maybe I'm mistaken but I think you can get changes to outputs without having any effective changes in the resources it deploys.

It's a behavior we already noticed but didn't change it, we might be able make this an opt-out feature though

@seboudry
Copy link
Contributor Author

When you talk about outputs it's burrito files uploaded to datastore or TF outputs?

But I still don't get what you thinking about, forgive me.
Do you have an example or an explanation?

@AlanLonguet
Copy link
Collaborator

TF outputs, I think you can have an "empty" plan (meaning no resources changed) but you changed the format of one your outputs and this needs to be applied so the outputs are saved in the state.

This might not be of use for vanilla terraform but for terragrunt which relies heavily around it I think we can't really bypass this empty apply.

However we can be smarter in the way we determine if we need to apply by checking if there's changes to outputs and/or changes to resources.

WDYT @LucasMrqes @corrieriluca ?

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

No branches or pull requests

2 participants