Explanation of no-op value in action field of terraform json out file

I am listing the actions of the json output of a terraform plan -out outfile.

Sometimes there are no changes indeed, i.e. the return code of the terraform plan command is 0.

There are cases however when I get an exit code 2 (indicating there are changes to be made) with all resources listed having the no-op value in their action field.

The documentation does not provide a clear distinction between the first and the second scenario.

Is it possible for someone to elaborate on the differences between a pure "no changes - infrastructure matches the configuration/ exit code 0 and getting exit code 2 with no-op action on resources?

Hi @pkaramol1,

Without seeing the output from each of those cases I can only guess, but one way you might see that result is if the plan includes changes to the output values even though there aren’t any changes to the resource instances.

For example, if you have an output value that is derived from a data resource attribute then that output value could potentially change just as a result of the remote object changing, even if that outside change doesn’t lead to Terraform proposing any changes to managed resource instances.