Hi, I’m using terraform-plugin-sdk/v2 and I’m trying to set my resource ID during plan.
Currently, my resource ID appear as (known after apply)
in plan.
I tried doing it in a CustomizeDiff but setting a new id does not seems to work.
When using diff.SetNew("id", newID)
, it seems that it requires a declared id
attribute, but making so does not change the resource’s ID in plan.
I found a stackoverflow answer that mention setting ID to a concrete value during the planning phase but I could not figure a way to do so.
Is there a way to do this with the SDKv2 ?
If not, can the terraform framework solve my issue ? I’m still reluctant to use it as hashicorp’s main providers does not seems to use it extensively.