Adding custom domain name to API gateway domains across services

Hey guys,

I am splitting out the Serverless backend from the tutorial into seperate services - as per the monorepo tut, but into their own service repos.

I am building out the API as a simple base API with the idea that I can have this as a project starter that I can add other APIs later through the cross stack referencing, but contained in their own repos - i.e user API repo, billing API repo etc…

I wanted to know if there is a way I can assign a custom domain name to the API in the serverless.yml so that I can define it here and then also in any other additional APIs I specify later? What would be the best practice here for that?

I originally defined the custom api through the seed ci as per the original tutorial - which is fine, but I would like to keep this as a definable readable part of the .yml file contained in the repo

The best way to do this is to have your main API service have the custom domain attached to it. While the other services piggy-backing on it. We cover this here:

Thanks Jayair,

Yeah I did see that, I was actually after creating it programatically when the service is defined rather than having it defined already in the console and attaching it, if that makes sense :slight_smile:

I think this may actually do what I am after https://github.com/amplify-education/serverless-domain-manager

1 Like

Yeah that makes sense.