How do I import an existing AWS Route53 registered domain into Pulumi?

48 views Asked by At

I'm just getting started with Pulumi and having a hard time understanding the import command.

In particular, I think the documentation is not clear about how to build a "type token":

Type tokens must be of the format <package>:<module>:<type> - refer to the import section of the provider resource documentation.

I read the docs at https://www.pulumi.com/registry/packages/aws/api-docs/route53domains/registereddomain/#look-up but couldn't make the code work.

pulumi preview , or rather boto3 complained:

operation error Route 53 Domains: GetDomainDetail, https response error StatusCode: 400, RequestID: <redacted-uuid>, InvalidInput: Errors: [Give domain name must contain more than 1 label]

1

There are 1 answers

0
Marcello Romani On

Eventually I managed to figure out the "triade":

pulumi import 'aws:route53/zone:Zone' my-domain '<zone_id>'
  • to retrieve zone_id I logged into the AWS Console => Route 53 => Hosted Zones => Column "Hosted zone ID"

The pulumi CLI output a code snippet that I could paste into my Python editor and worked when I ran pulumi preview.