https://serverless-stack.com/ logo
#help
Title
# help
y

Yeltrah

01/08/2022, 12:39 PM
Hey for the
NextJSSite
construct, there is a section to be able to set the domains via AWS route53 but this seems to attempt to create a new record set. Is there a way to make it so that it will update the existing record set to the deployed function? Or would I need to do this manually so that all deploys thereafter will update accordingly?
f

Frank

01/25/2022, 9:33 PM
Hey @Yeltrah, are you seeing a new record being created after each deploy?
It should only create a record in the Route 53 hosted zone once
y

Yeltrah

01/28/2022, 12:55 AM
Hey @Frank No, it wasn’t after each deploy. I already had an existing record in Route53 hosted zone and I was migrating our existing stack to SST. But when doing the deployment it would not work since the record was already created. Luckily it was a small site so once I was ready to go live I had to delete the record, and then re-deploy using SST. This worked we had some small downtime due to this but off-peak so all good. However would be good to know if there is a way around this as I may have other sites I want to migrate using the SST stack and those may be a bit harder to do similarly.
f

Frank

02/03/2022, 4:53 AM
You might be able to use the
isExternalDomain
flag to workaround this issue. To add some context, by default
NextjsSite
assumes the domain is hosted on Route 53, and it will create a Route 53 record and sets up ACM SSL certificate to setup https.
But if you use the
isExternalDomain
flag,
NextjsSite
will skip these two steps.
And in ur case, you’d need to create a certificate manually. Here’s an example - https://docs.serverless-stack.com/constructs/NextjsSite#configuring-externally-hosted-domain
Let me know if this works for you.