pulumi / pulumi-terraform-bridge

A library allowing Terraform providers to be bridged into Pulumi.
Apache License 2.0
194 stars 43 forks source link

[Plugin Framework] Stable and ForceNew properties support #936

Open t0yv0 opened 1 year ago

t0yv0 commented 1 year ago

Hello!

Issue details

A bit of archaeology explains what Stable properties are:

There is currently no special support for customizing these settings in the Plugin Framework, and setting Stable *bool generates a warning for example, so should ForceNew.

The motivation for Stables sounds very similar to the stated motivation for UseStateForUnknown PlanModifier in TFPF:

https://developer.hashicorp.com/terraform/plugin/framework/resources/plan-modification#usestateforunknown

When working this out we might need to consider if Stable markers are still needed at Pulumi level, and if we could get any leverage out of UseStateForUnknown plan modifiers, such as detecting that those are present.

Regarding ForceNew, it appears that runtime support code for ForceNew is limited to computing Stables in the Diff method. It's not actually taken into account in computing the diff result or making Pulumi decide to deleteBefore replace. This may need further investigation and careful testing, leaving for later. Linking any concrete use cases are appreciated to understand this better and prioritize.

Affected area/feature

t0yv0 commented 1 year ago

CC @iwahbe