So ehm, I am trying to create a RecordSet, but I a...
# dotnet
m
So ehm, I am trying to create a RecordSet, but I am am unsure why it says it cannot find the dns zone resource, I specify the name of the resource group and the domain name for the dns zone (which seems to be the way its named in azure), however pulumi says it cant find the resource, is this because the dns zone resources are not managed by this particular stack ?
b
No, it just makes a call to Azure, so as long as you're passing in the right zone name and the resource group name that it exists in you should be fine. Can you share some code please?
m
Copy code
private RecordSet createCnameRecord(string fqdn, Output<string> cdnEndpointUrl, string resourceGroup)
    {
        var domainParts = fqdn.Split('.');
        var hostpart = domainParts.FirstOrDefault();
        var domainPart = string.Join(".", domainParts.Skip(1));

        Console.WriteLine("HostPart: {0}", hostpart);
        Console.WriteLine("DomainPart: {0}", domainPart);
        
        return new RecordSet(hostpart, new RecordSetArgs
        {
            CnameRecord = new CnameRecordArgs
            {
                Cname = hostpart,
            },
            RecordType = "CNAME",
            RelativeRecordSetName = domainPart,
            ResourceGroupName = resourceGroup,
            Ttl = 3600,
        });
    }
I simply created a method, to easily reuse the code
t
Try using
Pulumi.AzureNative.Network.V20180501
m
okay, I’ll just read the issue first
but thanks
my Zone is not private, does that matter ?
Hey thank you, that actually ran through without error, now I need to see if It actually did what I need