https://pulumi.com logo
#dotnet
Title
m

magnificent-television-29869

03/16/2021, 9:50 AM
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

brave-planet-10645

03/16/2021, 10:23 AM
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

magnificent-television-29869

03/16/2021, 10:28 AM
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

tall-librarian-49374

03/16/2021, 10:36 AM
Try using
Pulumi.AzureNative.Network.V20180501
m

magnificent-television-29869

03/16/2021, 10:37 AM
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