pulumi / pulumi-azure-native

Azure Native Provider
Apache License 2.0
126 stars 34 forks source link

Pulumi imports some properties of Azure KeyVault incorrectly #1749

Open macpak opened 2 years ago

macpak commented 2 years ago

What happened?

I'd like to import existing Azure KeyVault to my stack. Import works correctly, but when I do a preview on just imported resources, I see the following change

~ sku : {
              ~ name: "Standard" => "standard"
            }

So Pulumi imports sku.name as Standard but the struct used to describe the sku name looks like

public static SkuName Standard { get; } = new SkuName("standard");
public static SkuName Premium { get; } = new SkuName("premium");

I'd expect no changes after successful import.

Steps to reproduce

  1. Import existing Azure KeyVault to your stack
  2. Execute pulumi preview

Expected Behavior

There should be no changes to apply.

Actual Behavior

Pulumi sees sku.name as updated.

Versions used

CLI Version 3.33.2 Go Version go1.17.10 Go Compiler gc

Plugins NAME VERSION azure-native 1.64.1 dotnet unknown

Host OS Microsoft Windows 11 Pro Version 10.0.22000 Build 22000 Arch x86_64

This project is written in dotnet (C:\Program Files\dotnet\dotnet.exe v6.0.300)

Current Stack: prod

TYPE URN pulumi:pulumi:Stack urn:pulumi:prod::Occtoo.Common.Infrastructure::pulumi:pulumi:Stack::Occtoo.Common.Infrastructure-prod pulumi:providers:azure-native urn:pulumi:prod::Occtoo.Common.Infrastructure::pulumi:providers:azure-native::default_1_64_1 azure-native:resources:ResourceGroup urn:pulumi:prod::Occtoo.Common.Infrastructure::azure-native:resources:ResourceGroup::production

Found no pending operations associated with prod

Backend Name pulumi.com URL xxx User xxx Organizations xxx

NAME VERSION Pulumi 3.33.1 Pulumi.AzureNative 1.64.1

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).

stack72 commented 2 years ago

The issue here is that we need to ensure we get the correct case when we call the Read func - this will be fixed this iteration as we are planning to start work on a 2.0