我正在使用无服务器框架和 AWS Lambdas 将两个具有不同路径名(/message
和/subscribe
)的函数部署到我的子域form.example.com
。
我正在使用serverless-domain-manager
无服务器插件并成功地为使用/message
功能配置了我的域serverless create_domain
,但由于我还需要这样做,因为/subscribe
我尝试遵循相同的过程接收域已经存在并捕获错误的消息Error: Unable to create basepath mapping.
。
在翻转配置 ( createRoute53Record: false
) 并重新运行它开始工作后,但现在当我运行sls deploy
我的/message
函数时,我收到了我以前看到的错误消息/subscribe
。
错误(来自sls deploy
):
layers:
None
Error --------------------------------------------------
Error: Unable to create basepath mapping.
For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
这是我的配置serverless-domain-manager
:
plugins:
- serverless-offline
- serverless-domain-manager
custom:
transactionDomain:
dev: ${file(./local-keys.yml):transactionDomain}
prod: ${ssm:mg-production-transaction-domain~true}
newsletterDomain:
dev: ${file(./local-keys.yml):newsletterDomain}
prod: ${ssm:mg-production-newsletter-domain~true}
apiKey:
dev: ${file(./local-keys.yml):apiKey}
prod: ${ssm:mg-production-api-key~true}
customDomain:
domainName: form.example.com
certificateName: 'www.example.com' //sub-domain is included in the certificate
stage: 'prod'
createRoute53Record: true
这是否与将两个功能部署到同一个域有关?是否有适当的程序允许这种情况发生?