-
Notifications
You must be signed in to change notification settings - Fork 41
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
KeyVault resource has incorrect/inconsistent diff results after pulumi import #3964
Comments
We have something similar with access policies in key vault. Every time when run pulumi preview, we got removed access policies and added once more time the same. |
This might be a similar root cause to #1355, and likely relates to how we're diff'ing inputs. We'll add this to our backlog for further review. Thanks for reporting! |
This seems like a different situation, the changes are entirely within the one resource and it's reporting that it's going to delete a value that is actually being set by the code, and then adding an additional value makes the one it was going to delete suddenly come back in addition to the new one. |
The handling of the virtualNetworksRules array seems to be off. If I set the value to the subnet ID as a plain string, run pulumi up, and then change the string to a different value the diff shows that the value is being deleted from the array instead of displaying it as a modification. If I do the same thing to an entry in the ipRules array the diff properly shows the value being changed. |
This comment has been minimized.
This comment has been minimized.
I see the reason why For example:
Versus:
From "Naming rules and restrictions for Azure resources", resource names are case-insensitive. Basically the KeyVault resource has a lower-cased representation of the subnet id, and the diff logic appears to use a case-sensitive comparison. |
Thanks for your comment, can you tell me is it possible to do something to not show it on the plan? Developers when seeing it are some afraid that will break something |
What happened?
After running
pulumi import
to import a key vault resource, the next diff shows the virtualNetworkRules entry would be deleted even though the pulumi program is generating the same values as what was imported. If I add a second entry to the array the diff then shows that the first entry is being updated due to different case and the second element is being added as new (both as expected). I have seen this behavior on the accessPolicies array as well, but my example program didn't behave the same way on that property.Example
Output of
pulumi about
CLI
Version 3.135.1
Go Version go1.23.2
Go Compiler gc
Plugins
KIND NAME VERSION
resource azure-native 2.88.0
language nodejs unknown
Host
OS ubuntu
Version 22.04
Arch x86_64
This project is written in nodejs: executable='/usr/bin/node' version='v20.18.2'
Current Stack: org/ducktest5-pulumi/dev
TYPE URN
pulumi:pulumi:Stack urn:pulumi:dev::ducktest5-pulumi::pulumi:pulumi:Stack::ducktest5-pulumi-dev
pulumi:providers:azure-native urn:pulumi:dev::ducktest5-pulumi::pulumi:providers:azure-native::default_2_88_0
azure-native:resources:ResourceGroup urn:pulumi:dev::ducktest5-pulumi::azure-native:resources:ResourceGroup::rg
azure-native:network:VirtualNetwork urn:pulumi:dev::ducktest5-pulumi::azure-native:network:VirtualNetwork::vnet
azure-native:network:Subnet urn:pulumi:dev::ducktest5-pulumi::azure-native:network:Subnet::subnet
azure-native:keyvault:Vault urn:pulumi:dev::ducktest5-pulumi::azure-native:keyvault:Vault::kv
azure-native:keyvault:Vault urn:pulumi:dev::ducktest5-pulumi::azure-native:keyvault:Vault::kv-imported
Found no pending operations associated with org/dev
Backend
Name pulumi.com
Organizations org
Token type personal
Dependencies:
NAME VERSION
@pulumi/azure-native 2.88.0
@pulumi/pulumi 3.150.0
@types/node 18.19.76
Pulumi locates its logs in /tmp by default
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: