So, I have a two stacks, for eg. /auth and /profil...
# help
s
So, I have a two stacks, for eg. /auth and /profile and existed domain in ApiGateway, for eg domain.com (endpoint type - edge) Is there any posibility to connect existing stacks to that domain what are splitted by basePath, like domain.com/auth/* and domain.com/profile/* ? Thank you p.s. I tried many variants how to do it but without any results
t
Not sure if I fully understand your question but typically people will create a core stack with the API gateway, then pass it to other stacks to add routes
s
It's a legacy project.. Some part of infrastructure was created by terraform and for adding new endpoints we need to attach them to existing ApiGateway with Custom Domain. Is it clear?
t
ah I see. I believe you can pass in
httpApi
as a prop to
sst.Api
b
I’ve only done this with the CDK RestApi construct but what I did was use a BasePathMapping (which is from CDK directly). You provide that with the CustomDomain construct and give it the basePath and api references. I’m pretty sure the Api construct in SST has a shortcut for this.
Yea, basically ignore what I said 😂
s
yeah, but Edge endpoints managed only with
@aws-cdk/aws-apigateway
it is a sad...
f
@Serhii Arendarchuk, are both
/auth
and
/profile
created in Terraform, and domains are already configured for the two endpoints. And now in SST you want to add additional routes to the endpoints. Is that what you are asking?
s
No, I want to attach /auth stack and /profile stack to the same custom domain which using edge endpoints type Also, yesterday I saw the issue, when I configured a custom domain the websocket debug was broken
f
hmm that’s weird. Let’s figure out the first issue first.
Can you see if it works for you?