How it works...

Our regional health check service is designed to return a 5xx status code when one or more of the required services returns an error. We add a CloudWatch alarm, named Api5xxAlarm, to the health check service that monitors the API Gateway 5xxError metric in the given region and raises an alarm when there is at least one 5xx in a minute. You will want to adjust the sensitivity of the alarm to your specific requirements. Next, we add a Route53 health check, named ApiHealthCheck, to the service that depends on the Api5xxAlarm and outputs the ApiHealthCheckId for use by other services. Finally, we associate the healthCheckId with the Route53 RecordSet for each service in each region, such as the cncb-regional-failover-service

Get JavaScript Cloud Native Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.