How to add a custom domain for a serverless-1.0.0 framework defined/deployed API?

后端 未结 2 1970
囚心锁ツ
囚心锁ツ 2021-01-30 23:47

Serverless-1.0.0-rc.1 enables to deploy an API to be accessible via a AWS API Gateway.

The question: I need the deployed API exposed via a custom domain with SSL certif

2条回答
  •  伪装坚强ぢ
    2021-01-31 00:26

    I think this topic deserves an update, so I will give it a try. Be sure to first create a certificate with Certificate Manager. Then be sure your "serverless user" has the right admin permissions to modify Route53 record sets. Then add the following to your serverless.yaml:

    custom:
      customDomain:
        domainName: "api.example.com"
        certificateName: "*.example.com"
        createRoute53Record: true
    
    plugins:
      - serverless-domain-manager
    

    Before you deploy run (this can take a while):

    serverless create_domain
    

    Source and additional options can be found here.

提交回复
热议问题