upjet icon indicating copy to clipboard operation
upjet copied to clipboard

Framework resources don't expose terraform diff in debug logs

Open mbbush opened this issue 1 year ago • 1 comments

What problem are you facing?

While working to migrate existing infrastructure into crossplane, I frequently find myself creating managed resources with limited ManagementPolicies, and relying on the debug logs of provider-aws, which log a GoString of the observed diff, to see what changes they are going to make, so I can determine whether the diff is due to drift that I actually want to correct, or a bug in my crossplane manifest. This happens in external_tfpluginsdk.go

For terraform plugin framework resources, when they were reconciled with the CLI, I could accomplish the same thing by execing into the provider pod and running terraform plan. Now that framework resources are reconciled by calling the framework provider directly, this is no longer possible, and the framework client doesn't contain the same debug log statement.

How could Upjet help solve your problem?

Add additional debug logging to the Observe call in the framework client, to log the diff between the spec.forProvider and what is observed. Any format will do, but JSON would be great.

mbbush avatar Feb 02 '24 03:02 mbbush

Same matter here. We should to have a way to display the drift ... Maybee there are workaround inside provider code that we can doing the time this matter will be fix inside the framework ?

disaster37 avatar Feb 05 '25 09:02 disaster37