Search code examples
amazon-route53

Amazon Route 53 .NET SDK - CreateHostedZone / CreateHostedZoneRequest with DelegationSetId


This is a pretty specific use case scenario, but I'm writing an interface using the Route 53 .NET SDK and I'm trying to create a hosted zone using a delegation set. We have a ton of domains, and constantly need to add more. We have delegation set up for some NS, and any newly created domain needs to be created with this delegation set.

From my understanding, new domains need to be created with the delegation set and can't be modified later to use said delegation.

I've pored over the documentation and looked at some pretty outdated .NET examples of creating hosted zones, but it doesn't look like there is a direct parameter to set the "DelegationSetId" in the createHostedZoneResponse.

So for example - I would expect it in this neighborhood:

        // Create a new hosted zone using the domain name
        var createHostedZoneRequest = new CreateHostedZoneRequest {
            Name = domainName,
            CallerReference = System.Guid.NewGuid().ToString(),
            // DelegationSetId = _delgationSetId <-- but this is not a property

        };

Is there some other way to set this property in .NET for a create? Does anyone have experience creating a hosted zone in Route53 using a delegation set? Any work around?

I could move my create / upsert logic to the front end if I get desperate.

Thanks for looking.


Solution

  • Answering my own question. I had a response over in the AWS github to this.

    Need to use CreateHostedZoneAsync.

    var createHostedZoneResponse = r53Client.CreateHostedZoneAsync(new CreateHostedZoneRequest {
                Name = domainName,
                CallerReference = System.Guid.NewGuid().ToString(),
                DelegationSetId = _route53DelegationSet
            });
    

    This method was not available due to a reference conflict I had in my project and fixed it up by using an alias on the older dll.