pulumi / pulumi-azure-native

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

Unable to Create Private DNS Zone #1640

Closed lorenzoaiello closed 2 years ago

lorenzoaiello commented 2 years ago

Hello!

Issue details

This provider is using the dnszones resource that was made unavailable in 2020 ref instead of the privatednszones resource. This means that its impossible to create Private DNS Zones using the azure-native provider.

Steps to reproduce

  1. Install Pulumi
  2. Generate a Go Project
  3. Add a Stack
  4. Use azure-native provider to create the azure-native.network.Zone resource
  5. Run pulumi up

Example Resource:

_, err = network.NewZone(ctx, "internalZone", &network.ZoneArgs{
    Location:                    pulumi.String("Global"),
    ResourceGroupName:           resourceGroup.Name,
    ZoneName:                    pulumi.String("internal.skysail.dev"),
    ZoneType:                    network.ZoneTypePrivate,
})
if err != nil {
    return err
}

Expected: I should be able to create a Private Zone using the azure-native provider. Actual: Provider returns the following error:

+  azure-native:network:Zone internalZone creating error: autorest/azure: Service returned an error. Status=400 Code="BadRequest" Message="Creation of private DNS zones using this API is no longer allowed. Please use privatednszones resource instead of dnszones resource. Refer to https://aka.ms/privatednsmigration for details."
jkodroff commented 2 years ago

@lorenzoaiello Thanks for submitting this issue. I believe the suggested resource name is incorrect and you should instead use network.NewPrivateZone().

epomatti commented 2 years ago

@jkodroff answer is correct, just adding the link for quick reference:

https://www.pulumi.com/registry/packages/azure-native/api-docs/network/privatezone/