We are going to set-up a custom URL for our AWS lambda functions.
Familiarity with AWS and Serverless.
A few options if you don't:
Again, we have a few options to get this working with the Certificate Manager from AWS.
After going through the review and validation process, you will have a your certificate in "Issued" status.
First, install a new serverless plugin.
npm install serverless-domain-manager --save-dev
Second, Add the following to your serverless.yml
. Replace '<registered_domain_name>' with your domain.
plugins:
- serverless-domain-manager
custom:
customDomain:
domainName: <registered_domain_name>
basePath: ''
stage: ${self:provider.stage}
createRoute53Record: true
Third, create the custom domain.
sls create_domain
Serverless: Domain was created, may take up to 40 mins to be initialized
Finally, deploy the function again.
sls deploy
At the end of the Service Information
block, you'll also get a Serverless Domain Manager Summary
that shows the domain name associated with your domain.
If you need to remove the domain, simply run:
serverless delete_domain