https://pulumi.com logo
Title
b

bored-continent-69206

01/12/2022, 5:10 PM
Hey everybody, can someone help me? I'm trying to import an exisiting Route53 HostedZone like that:
const zone = new aws.route53.Zone(
                "www",
                { name: "<http://example.com|example.com>" },
                { import: "ZoneID" }
            );
But during deployment I always get the error that the resource does not exist
aws:route53:Zone (www):
    error: inputs to import do not match the existing resource
What values do I need to provide to properly import the zone? thanks
b

billowy-army-68599

01/12/2022, 5:14 PM
I'm assuming
ZoneID
is set to an actual zone id like
Z1D633PJN98FT9
?
b

bored-continent-69206

01/12/2022, 5:15 PM
right its actually set to an existing zone id 🙂
b

billowy-army-68599

01/12/2022, 5:16 PM
i'd double check your provider, make sure
aws sts get-caller-identity
returns the correct AWS account
if that doesn't work, try the
pulumi import
command
b

bored-continent-69206

01/12/2022, 5:19 PM
I deploy this in a ci/cd pipeline directly in codebuild. The pipeline is in the same account and I'm 100% sure it uses the correct credentials
I may add the import command to my buildspec but I really wanted to have this in my code
b

billowy-army-68599

01/12/2022, 5:20 PM
oh wait, I misread the error!
you need to actully flesh out the rest of the inputs:
aws:route53:Zone (www):
    error: inputs to import do not match the existing resource
that indicates there's missing inputs to match your zone
the pulumi import command will help you flesh them out
b

bored-continent-69206

01/12/2022, 5:24 PM
ok I'll give it a try, thanks!
@billowy-army-68599 quick qustion: the docs say
pulumi import aws:route53/zone:Zone myzone Z1D633PJN98FT9
is "myzone" the domain (like example.com)?
b

billowy-army-68599

01/12/2022, 5:27 PM
no, it's the name you want to call the resource, like
www
b

bored-continent-69206

01/12/2022, 5:30 PM
so I still have to create the zone in my code with the name www?
otherwise how do I reference it when creating an a record or something else?
b

billowy-army-68599

01/12/2022, 5:33 PM
the name of the resource is just used to create the urn inside the pulumi state, it can be anything you want, including
<http://example.com|example.com>
if you prefer
and you'd reference it using the variable/constant of course