-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix parsing nested path ids #3375
Conversation
Does the PR have any schema changes?Looking good! No breaking changes found. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3375 +/- ##
==========================================
+ Coverage 56.87% 56.88% +0.01%
==========================================
Files 66 66
Lines 8092 8099 +7
==========================================
+ Hits 4602 4607 +5
- Misses 3055 3056 +1
- Partials 435 436 +1 ☔ View full report in Codecov by Sentry. |
- Nest existing test cases.
Retain the original path parameter names when returning the result object.
e8feca2
to
5a3915c
Compare
@danielrbradley I am currently trying to import some access policies in a c# stack programmatically, but it seems to think the import will fail due to
Attempting to import via code, with
|
Fixes #3368
This will currently result in an additional input being generated during the import. This then appears during the next up as a property deletion, though it actually has no effect.
Demonstration
Using the
examples/keyvault-accesspolicies/
example:up
gives the state (inputs and outputs):pulumi state delete urn:pulumi:dev::scratch::azure-native:keyvault:AccessPolicy::ap1
pulumi import resource ap1 "/subscriptions/xxxx/resourceGroups/rgxxxx/providers/Microsoft.KeyVault/vaults/vaultxxxx/accessPolicy/xxxx"
pulumi stack export
, the inputs now includeobject.Id
:pulumi up
).Preview shows removal of policy => ObjectId:
State inputs revert to remove
policy.objectId
:Tracing usage of ParseResourceID
The result from this function is used here:
pulumi-azure-native/provider/pkg/provider/provider.go
Lines 1080 to 1087 in e8feca2
The
pathItems
are passed intoResponseToSdkInputs
where they are used if they match one of the parameters in the metadata:pulumi-azure-native/provider/pkg/convert/responseToSdkInputs.go
Lines 18 to 24 in e8feca2
This will match:
pulumi-azure-native/provider/pkg/resources/customresources/custom_keyvault_accesspolicy.go
Line 67 in e8feca2