pulumi / pulumi-terraform-bridge

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

PF peviews do not show show default values in old config #2649

Closed VenelinMartinov closed 15 hours ago

VenelinMartinov commented 4 days ago

When previewing a change in a resource using the Plugin Framework we incorrectly miss default values in old inputs

    ~ testprovider:index/test:Test: (update)
        [id=test-id]
        [urn=urn:pulumi:test::project::testprovider:index/test:Test::p]
      + key: {
          + nested: "value"
        }
Resources:
    ~ 1 to update
    1 unchanged

versus

  # testprovider_test.res will be updated in-place
  ~ resource "testprovider_test" "res" {
        id  = "test-id"
      ~ key = {
          ~ nested = "default" -> "value"
        }
    }

see TestDetailedDiffObject/attribute_default_no_replace/added

VenelinMartinov commented 4 days ago

~cc @t0yv0 I think you suspected this before and have suggested it to me. I've added some tests to confirm this.~

It's still a problem, PF does not apply defaults in check so the engine does not have access to the defaults. What is fixed here is that previously we would not show defaults in old values either.