pulumi / pulumi-azure-native

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

network/latest:RecordSet points to Private DNS's record set #583

Closed mikhailshilkov closed 3 years ago

mikhailshilkov commented 3 years ago

It looks like different versions of network/xyz:RecordSet point to different resources in Azure:

We should undertand why and disambiguate with resource names.

mikhailshilkov commented 3 years ago

Issue upstream: https://github.com/Azure/azure-rest-api-specs/issues/11402

iskandersierra commented 3 years ago

I can confirm this issue. For those trying to make it work in the meanwhile, you can use two different versions of the API (not ideal, but it worked for me):

using Network = Pulumi.AzureNextGen.Network.Latest;
using Network2018 = Pulumi.AzureNextGen.Network.V20180501;
...

            var zone = new Network.Zone($"dns{name}", new()
            {
                Location = "global",
                ResourceGroupName = args.Group.ResourceGroupName,

                ZoneName = Info.DNS.ZoneName,
                //ZoneType = Network.ZoneType.Public,

                Tags = args.Group.Tags,
            });

            DNSNameServers = zone.NameServers;

            var dnsRecordSet = new Network2018.RecordSet("loadBalancer", new()
            {
                ResourceGroupName = args.Group.ResourceGroupName,
                ZoneName = zone.Name,
                ARecords = new Network2018.Inputs.ARecordArgs[]
                {
                    new ()
                    {
                        Ipv4Address = ipAddress.IpAddress,
                    },
                },
                RecordType = "A",
                RelativeRecordSetName = "@",
                Metadata = args.Group.Tags,
                Ttl = 3600,
            });

I hope it can help others