Multiple custom domains returning error
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Bug Report
Error Description Deploying multiple domains using serverless-domain-manager returns an error, even though it seemed to deploy to AWS correctly. This is breaking the build script running on Github actions.
Command Run
sls deploy --stage publish
Console Output
× Stack mydomain-com-publish failed to deploy (86s)
Environment: linux, node 16.15.0, framework 3.18.2 (local), plugin 6.2.2, SDK 4.3.2
Credentials: Local, environment variables
Docs: docs.serverless.com
Support: forum.serverless.com
Error:
TypeError: Section content for "Serverless Domain Manager" was already set
Bugs: github.com/serverless/serverless/issues
at Serverless.addServiceOutputSection (/home/runner/work/repo/repo/node_modules/serverless/lib/serverless.js:189:13)
at Function.printDomainSummary (/home/runner/work/repo/repo/node_modules/serverless-domain-manager/dist/src/globals.js:70:32)
at /home/runner/work/repo/repo/node_modules/serverless-domain-manager/dist/src/index.js:293:39
at Array.forEach (<anonymous>)
at /home/runner/work/repo/repo/node_modules/serverless-domain-manager/dist/src/index.js:[29](https://github.com/my-repos/repo/runs/6657933333?check_suite_focus=true#step:16:30)2:[30](https://github.com/my-repos/repo/runs/6657933333?check_suite_focus=true#step:16:31)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Process completed with exit code 1.
Domain Manager Configuration
custom:
contentEnvironmentEnabled:
publish: true
other: false
customDomains:
- http:
enabled: true
domainName: ${self:provider.stage}.sls.mydomain.com
stage: ${self:provider.stage}
createRoute53Record: true
certificateName: '*.sls.mydomain.com'
basePath: ''
endpointType: regional
autoDomain: true
- http:
enabled: ${self:custom.contentEnvironmentEnabled.${opt:stage}, self:custom.contentEnvironmentEnabled.other}
domainName: content.sls.mydomain.com
stage: ${self:provider.stage}
createRoute53Record: true
certificateName: '*.sls.mydomain.com'
basePath: ''
endpointType: regional
autoDomain: true
Versions
- Domain Manager version(s): 5.8.0
- Node/npm version: 16.15.0
- Serverless Version: 3.18.2
- Lambda Code: PHP (bref)
@pbayly-kax did you figure out how to do this?
also encountering this issue
Hi @pbayly-kax
Hope you have solved this issue. From the message, it looks like something is wrong with the serverless config and this is not possible to fix via the plugin.
Also please take a look at our working example
BTW, we are not supporting 5.x anymore please try our latest version 6.x and let us know in case of any issues