Error: Unable to configure ID for a Route 53 health check
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 Error: Unable to configure ID for a Route 53 health check.
The configuration below successfully creates the health check RecordSet in AWS but serverless-domain-manager is unable to reference the ID when healthCheckId is supplied with the resource. It seems to only work when you hard-code the ID of the health check record.
Command Run
e.g. sls deploy
Console Output
Environment: linux, node 16.15.1, framework 3.19.0 (local) 3.19.0v (global), plugin 6.2.2, SDK 4.3.2
Credentials: Local, environment variables
Error:
Docs: docs.serverless.com
Error: Unable to create domain '<domain name>':
Failed to UPSERT A Alias for '<domain name>':
Support: forum.serverless.com
[Invalid Health Check ID., Invalid Health Check ID.]
Bugs: github.com/serverless/serverless/issues
at ServerlessCustomDomain.<anonymous> (/home/runner/work/<repo name>/<repo name>/node_modules/serverless-domain-manager/dist/src/index.js:193:23)
at Generator.throw (<anonymous>)
at rejected (/home/runner/work/<repo name>/<repo name>/node_modules/serverless-domain-manager/dist/src/index.js:6:65)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Domain Manager Configuration
Replace this with your own serverless.yml file (anonymized, of course) to help us better resolve your issue.
resources:
Resources:
myHealthCheck:
Type: 'AWS::Route53::HealthCheck'
Properties:
HealthCheckConfig:
Port: 443
Type: HTTPS
ResourcePath: /healthz
FullyQualifiedDomainName: example.com
RequestInterval: 30
FailureThreshold: 3
custom:
customDomain:
domainName: example.com
basePath: bar
createRoute53Record: true
route53Params:
routingPolicy: latency
healthCheckId: myHealthCheck # reference myHealthCheck in resources
Versions
- Domain Manager version(s): 6.0.3
- Node/npm version: Node v16.15.1/npm 8.11.0
- Serverless Version: v3.19.0, 3.19.0v
- Lambda Code: GO
Possible Solution
Enable domain manager reference created resources in the customDomain config.
Additional context/Screenshots Add any other context about the problem here. If applicable, add screenshots to help explain.
Create a custom variable
healthCheckId: name: !Ref Route53HealthCheck
and then use it ${self:custom.healthCheckId.name}