Hey I am trying use a custom domain for my serverl...
# help
a
Hey I am trying use a custom domain for my serverless stack project. I try to follow the guide SEED provided to do it, but when I click on edit custom domain it shows me no endpoints are available even though I used seed to deploy my project and it shows the aws default endpoint URL. Am I missing something?
t
The default export will still show the underlying AWS url. Can you share your sst code where you're specifying the custom domain?
a
Here is my sst.json
But I have the custom domain code here
But even that still gives an error saying no hosted zones found on route 53 even though that’s what’s hosting the domain currently
t
Well it won't work with example.com because you don't own that domain
are you specifying the same zone that is in your route53
a
This is the error it gives when it runs but my hostedzone id is not that
Yes example.com is a placeholder
I did put my real domain
t
I'm not too sure, that configuration should work if you have a matching zone in the AWS account
a
The domain is registered
This is the actual code
And this is the expected ID
f
Just wanted to chime in, @Ayo managing domains on SEED was primarily to support Serverless Framework as there isn’t a reliable way to configure domain within the framework.
Domains are natively supported in SST, you can configure the domain directly in the code (like what you are doing above).
And the domains don’t show up on SEED.
Let me know if that makes sense.
a
But I already did that and it says no such hostedzone id
Even though I have an hostedzone id
It’s just getting a random one
f
hmm what do you mean by random?
a
This here is my actual hosted zone id
f
the zone in the error msg is
Z04xxxxx
and the one in the screenshot is
Z01xxxxx
a
But it keeps saying this is the one that corresponds to my domain
Yeah it doesn’t make sense
f
I see. Can you share a screen with more messages b4 and after the error?
a
Here is the first error I saw
f
Do you have a cdk.context.json in the app folder
a
No I do not have that file
f
Can you open up
.build/cdk.out
and share the template json files?
Thanks @Ayo, so I see
Z0469582WRLLKJX2S46O
in the template.
a
Yeah I see that too but that shouldn’t be there since my hostedzone id is different
f
Right. Can you list out what’s in ur app folder (where sst.json sits)
a
Actually my bad there exists a cdk.context.json file
I missed it
f
Yeah the Hosted Zone info is cached in there.
Can you try removing it and deploy again?
a
Was I supposed to replace the hostedzone there?
Remove the whole file?
f
yeah cdk.context.json
a
Kk doing that now
f
It’s auto created by SST(CDK) during the build process to cache the hosted zone info, so it doesn’t need to do the lookup every single time.
You should commit this file.
a
Ahhh I see
Got it
Deploying now
It works now btw
Thanks @Frank
f
Awesome! 🎉