So my trouble of the day is I tried to set a custo...
# help
m
So my trouble of the day is I tried to set a custom domain for my api so I could get cookies working correctly. If I have the domain set to api.chartflow.io then everything works, but since I want different APIs for different stages I set the: `customDomain: scope.stage === "prod" ? "api.chartflow.io" : `api.${scope.stage}.chartflow.io`` The problem is when Synthesizing changes I get:
[Error at /mike-local-chartflow-api-stack/Api] Found zones: [] for dns:<http://mike-local.chartflow.io|mike-local.chartflow.io>, privateZone:undefined, vpcId:undefined, but wanted exactly 1 zone
Found errors
d
You need to specify the hosted zone explicitly when going more than one subdomain in distance away.
I recommend just doing so regardless, makes things less magical.
(customDomain has more than one overload)
m
So customDomain should look like:
Copy code
customDomain: {
    hostedZone: "<http://chartflow.io|chartflow.io>",
    domainName:
        scope.stage === "prod" ? "<http://api.chartflow.io|api.chartflow.io>" : `api.${scope.stage}.<http://chartflow.io|chartflow.io>`}
That seemed to work, Thanks
f
Thanks @Derek Kershner 🙏
j
I have done something similar but when I do the deploy it seems to hang continuously on the API
f