export API_DOMAIN=hello.api.example.com # API Gateway Endpoint Domain
export AWS_REGION=us-east-1 # Deployment Region
export API_CERT_NAME=*.api.example.com # API Certificate Name (Best match)
export API_STAGE=v1 # Stage name
The environment variable API_CERT_NAME
specifies the certificate name for API Gateway custom domain. The Serverless plugin will do the best-match over this name. Refer to serverless-domain-manager plugin documentation for detailed guidance.
To set up the custom domain for API Gateway, simply run yarn run sls create_domain
once.
Please note that this command cannot modify the existing custom domain that created previously by other means, e.g. through AWS Console, API.
Sample Output:
Serverless: 'hello.api.example.com' was created/updated. New domains may take up to 40 minutes to be initialized.
To remove the custom domain, run yarn run sls delete_domain
once.
To deploy or update the project, run yarn run sls deploy
.
yarn run sls remove
. Be careful when running this command towards a production stage name.
-
Serverless Config: serverless.yml