Hey All, I am trying this component <https://www...
# general
c
Hey All, I am trying this component https://www.pulumi.com/registry/packages/aws-static-website/api-docs/website/ And have a question , when I deploy my website with example.com , it works perfectly, but I could not figure out the strategy to deploy subdomains with environments, such as app.dev.example.com , when I try, I’m getting an error that says route53 zone is not found. is this component supporting subdomains any idea how to do it?
l
Did you create
<http://app.dev.example.com|app.dev.example.com>
?
It says "targetDomain string The domain used to serve the content. A Route53 hosted zone must exist for this domain."
<http://example.com|example.com>
won't do it. But there's no extra cost to creating an extra CNAME record in route53
c
Yes I have example.com in the account that I am using , I thought I could go with multi account strategy like create dev account and add dev.example.com to there
But I am not sure how they check route53 zone
To test this idea , I tried to create resource with app.example.com , but still no luck
l
You can put dev.example.com in another account if you want to. If you are creating app.example.com, you need to create the DNS record first. The rule is in the docs: "A Route53 hosted zone must exist for this domain"
So if you don't have app.example.com in Route53, then you can't create the website.
c
Yep there is , hosted zone. I ran it to deploy for example.com. That works. :) Because my hosted zone is for example.com But when I try to create another app for app.example.com , it looks up for route53 zone named for app.example.com rather than example.com (in my opinion)
My fear is when I create dev.example.com in dev account, then when I create app.dev.example.com it will look up hosted zone with whole domain again :)
l
A zone can have any number of records in it. Create more records in the existing zone. A records if you're pointing at an IP address, or CNAME records if you're pointing at another DNS record.
Zones aren't DNS entries, Records are. The docs say you cannot have a Website at app.dev.example.com until you have a route53 Record for that name in a route53 Zone.
c
Alright! So your suggestion is first I should create record then website with this component. I guess, I will need to skip domainTarget option and update A record with webSiteUrl of bucket. Am I understanding you correct?
UPDATE : I created dev.example.com ,by following https://theburningmonk.com/2021/05/how-to-manage-route53-hosted-zones-in-a-multi-account-environment/ When I run app.dev.example.com with Website component, it’s just working 🥳 Thanks @little-cartoon-10569 for suggestions!