You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Automatically infer an id for pf resources (#3193)
This applies the logic from `dynamic` to `pf` based resources. As more
and more providers are moved to creating new resources with the plugin
framework, more and more of our upgrades are failing due to the missing
id error. This requires manual work for the team to create a `ComputeID`
mapping.
Since this `id` is not actually used for anything in Pulumi, we have
decided to fallback to hardcoding a "missing ID" value. This will reduce
the number of provider upgrades that require manual intervention by the
team and decrease the delay in releasing upgrades.
closes#3182
Copy file name to clipboardExpand all lines: docs/guides/resource-ids.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,8 +60,14 @@ If the type of the `"id"` attribute is not coercible to a string, you must set `
60
60
error: Resource test_res has a problem: no "id" attribute. To map this resource consider specifying ResourceInfo.ComputeID
61
61
```
62
62
63
-
If the resource simply doesn't have an `"id"` attribute, you will need to set `ResourceInfo.ComputeID`.
64
-
If you want to delegate the ID field in Pulumi to another attribute, you should use `tfbridge.DelegateIDField` to produce a `ResourceInfo.ComputeID` compatible function.
63
+
This error should not occur anymore. For dynamic providers and Plugin Framework resources the bridge falls back to emitting a placeholder
64
+
value (`"missing ID"`, exported as `tfbridge.MissingIDPlaceholder`) so schema generation and provider execution no longer fail.
65
+
Providing an explicit `ComputeID` keeps the generated provider more aligned with the upstream import story. If you want to delegate the ID field
66
+
in Pulumi to another attribute, you should use `tfbridge.DelegateIDField` to produce a `ResourceInfo.ComputeID` compatible function.
67
+
68
+
When using `ResourceInfo.ComputeID` we typically map it to the "import id" of the resource, but there is nothing that requires it to be set to a
69
+
specific value. The resource id and the import id do not need to match. Pulumi requires that each resource has an id (Terraform does not), but
70
+
there is not requirement that the id mean anything. This is why we fall back to adding the `"missing ID"` value.
0 commit comments