Commit 8756d9c
fix: set parent attribute during IAM policy import (#184)
When importing a project-level IAM policy (e.g., `import { id = "projects/foo" }`),
`ImportStatePassthroughContext` only sets `d.SetId()` but not the `parent` attribute.
The Read function (`dataSourceIAMPolicyRead`) uses `d.Get("parent")` to determine
which resource to fetch. Since `parent` is empty, `ResolveWorkspaceParent` falls back
to the workspace, causing all project IAM policy imports to incorrectly read the
workspace IAM policy instead.
This fix replaces `ImportStatePassthroughContext` with a custom import function that
sets the `parent` attribute from the import ID before the Read function is called.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent a861c53 commit 8756d9c
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
30 | 35 | | |
31 | 36 | | |
32 | 37 | | |
| |||
0 commit comments