Can we make a custom domain yet for our API Gateway functions in any format?
https:// random.mycompany.com/ serverless_path
https:// random.mycompany.com/ random / serverless_path
https:// random.mycompany.com/ fixed / random / serverless_path
https:// fixed.mycompany.com/ serverless_path
https:// fixed.mycompany.com/ random / serverless_path
https:// fixed.mycompany.com/ fixed / random / serverless_path
Spaces added to prevent links in markup.
fixed means something the developer picked. random means the random code given by default when making a APIG endpoint serverless_path means the path picked by the developer for the APIG endpoint
All of this can be done, but not directly within serverless. You can put a CloudFront distribution in front of your serverless applications, which itself, can have a Route 53 domain alias. This would give you the subdomain for your API’s that you are looking for as well as the ability to have multiple serverless definitions (API Gateway definitions) within the same domain.
Not sure when/if CloudFront definitions will come to serverless. There is a limitation on being able to supply your own SSL for a CloudFormation defined CloudFront definition, IIRC and there may be other limitations as well making it better to define this manually rather than through configurations. However, that is just a guess.
Another option: serverless-domain-manager plugin
I’m using this one in my project and it’s worked well. Handles creation of the Route53 record as well as variable basePath by stage.
Here’s the relevant section from my serverless.yml