Also, from what I understand, I can add a custom d...
# help
a
Also, from what I understand, I can add a custom domain for my API via the API construct but this can also be done via SEED, is that correct? I will be using SEED for my deployments and so which method should I choose and why? I want to create a separate stage for every PR / branch. so my API endpoint should change accordingly. For a branch called 7-feat/users-api, my endpoint should become 7-feat-users-api.customdomain.tld. Would this be possible?
a
I want to do the same.
I think you can do that from CloudFormation code.
I mean, in my case, we build the domains from serverless framework (which uses cf resources).
I would like for SEED to create the subdomians for each PR automatically, is that possible?
f
@Ashishkumar Pandey It’s recommended to do that in the
sst.Api
construct. SEED makes direct API calls to your Route53, Certificate Manager, API Gateway, etc, which is not ideal. It’s useful to manage domains for Serverless Framework projects, b/c domains isn’t supported native by the framework.
a
great, sounds good.
f
But with
sst.Api
the domain is being created a part of your CloudFormation, which is very clean.
a
Please check my DM, that’s more specific.
f
and you do:
Copy code
new sst.Api(this, "MyApi", {
  customDomain: `${scope.stage}.customdomain.tld`;
});
Yup, gimme just 1 sec. Going through all the msgs lol.
a
@Frank that is nice.
I’m not using SST yet, I’m using SLS.. should I create custom CF code?
To deliver the domains, I mean.
Because I don’t want to setup them on SEED manually.
f
@Adrián Mouly there’s the domain manager plugin, you can configure the domains in ur serverless.yml, but they making direct API calls as well, not defined via CloudFormation.
a
Ok, so what’s the recommendation?
Should I use CF template for now?
Until I migrate to SST in the future.
f
Yeah, CF template is preferrable but take a bit of work to get it to work. Domain manager should also work for now.