SamuelFisher / TerraformPluginDotNet

Write Terraform providers in C#.
MIT License
46 stars 14 forks source link

Inconsistencies with computed values #42

Open r-bennett opened 10 months ago

r-bennett commented 10 months ago

I've added a computed value other than Id to a resource for the first time, and I'm having trouble with it.

When the resource is first created, everything works as expected. But then on a subsequent apply, it tries to re-create the resource.

My ReadAsync and PlanAsync methods are straight passthroughs when I get this behaviour.

If I update ReadAsync to also populate the computed value, then an initial apply followed by a plan works fine (the plan now reports no changes needed). But add in a subsequent second apply, and the apply fails with

When expanding the plan for <resource>.<name> to
include new values learned so far during apply, provider
"<provider>" produced an invalid new value for
.<computed_field>: was known, but now unknown.

This is a bug in the provider, which should be reported in the provider's
own issue tracker.

If I update PlanAsync to also populate the computed values when the Id is non-null, I still get the same error.

Any ideas on how to proceed?