Option to skip refreshing resource instances whose configuration hasn't changed since the last apply
### OpenTofu Version ```shell OpenTofu v1.7.1 on darwin_amd64 ``` ### Use Cases Fixing plan (or rather, refresh) performance on large enough (in resource count) states. ### Attempted Solutions - Increasing parallelism only takes you so far until the providers rate-limit you. - Disabling refresh works but comes with all sorts of consistency risks. - Splitting one big state into multiple smaller states comes with all sorts of problems associated with it. ### Proposal Add a `tofu plan -light` flag such that only resources modified in code are targeted for planning. This would reduce the scope of the pre-plan refresh down to the set of resources we know changed, which reduces overall plan times without the consistency risk of `-refresh=false`. In order for OpenTofu to know what resources were modified in code, it would store a copy of the code in state every time it successfully applies. This would allow diff'ing "last-applied code" vs. "new code", the result of which is the scope of the next "light" plan. Basically, `-light` tells OpenTofu to autogenerate the `-target` list from code changes. More details: https://www.bejarano.io/terraform-plan-light/ ### References _No response_
Posted by ricardbejarano on Jun 4, 2024, 12:06 PM
Tags
Related issues
Raise real-world problems, find people facing the same issue, and discuss solutions.2,000 issues0 comments
reliability (E-commerce)
Huh, this is not my experience.
For some reason an Azure outage does not faze me in the same way that an AWS outage does.
The triplet of wind, pole, dragon appears multiple times in the same order, so is possibly a single phrase that has been broken up into t...
Option to skip refreshing resource instances whose configuration hasn't changed since the last apply
Option to skip refreshing resource instances whose configuration hasn't changed since the last apply
### OpenTofu Version ```shell OpenTofu v1.7.1 on darwin_amd64 ``` ### Use Cases Fixing plan (or rather, refresh) performance on large enough (in resource count) states. ### Attempted Solutions - Increasing parallelism only takes you so far until the providers rate-limit you. - Disabling refresh works but comes with all sorts of consistency risks. - Splitting one big state into multiple smaller states comes with all sorts of problems associated with it. ### Proposal Add a `tofu plan -light` flag such that only resources modified in code are targeted for planning. This would reduce the scope of the pre-plan refresh down to the set of resources we know changed, which reduces overall plan times without the consistency risk of `-refresh=false`. In order for OpenTofu to know what resources were modified in code, it would store a copy of the code in state every time it successfully applies. This would allow diff'ing "last-applied code" vs. "new code", the result of which is the scope of the next "light" plan. Basically, `-light` tells OpenTofu to autogenerate the `-target` list from code changes. More details: https://www.bejarano.io/terraform-plan-light/ ### References _No response_
Comments (0)
No comments yet. Start the discussion.