Search code examples
amazon-web-servicesamazon-route53pulumi

How to work with domain names in Pulumi AWS Route 53?


I'm trying to use Pulumi to create a Hosted Zone in AWS, but when I try to create a zone for domain name example.com, it appends a random hex code, so the name of the zone ends up being something like example.com-55229cc

The resource is being created like this:

zone = pulumi_aws.route53.Zone('example.com')

I understand Pulumi has its reasons to append the hex code to resource names, but there should be proper way to handle (sub)domain names in Route53. How the hosted zone should be created?


Solution

  • The name of the hosted zone, which is also the (sub)domain name, should be set with "name" attribute:

    zone = pulumi_aws.route53.Zone('example.com', name='example.com')
    

    As per documentation https://www.pulumi.com/docs/reference/pkg/aws/route53/zone/#name_python