AWS Cognito in Multi region Automated Failover application

0

Hey Everyone ,

I am planning to use AWS cognito connecting with external IDP for my multi region serverless web application (Active/Standby) mode . I am using Cloudfront origin failover functionality along with Route53 based regional failover for my API.

Here in AWS Cognito , how can I determine the health and to watch for service degradations so that i can route to the secondary cognito domain from my Edge lambdas.

I want to do this failover in a seamless way.

Some ideas - TCP route53 healthcheck on cognito domain copuled with AWS health notifications

1 Answer
0

Hi,

First, you should consider simply using what Route53 provides out of the box: Amazon Route 53 health checks. See https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover.html

If you find it insufficient for your use case, your lambdas at edge can check the CloudWatch metrics published by API gateway to check the overall health in your various regions. They can then decide which region to call depending on your choice algorithm based on those metrics.

For example:

4XXError The number of client-side errors captured in a given period.

The Sum statistic represents this metric, namely, the total count of the 4XXError 
errors in the given period. The Average statistic represents the 4XXError error rate, 
namely, the total count of the 4XXError errors divided by the total number of requests 
during the period. The denominator corresponds to the Count metric (below).
Unit: Count

5XXError
The number of server-side errors captured in a given period.

The Sum statistic represents this metric, namely, the total count of the 5XXError errors 
in the given period. The Average statistic represents the 5XXError error rate, namely, 
the total count of the 5XXError errors divided by the total number of requests during the period. 
The denominator corresponds to the Count metric (below).
Unit: Count

Latency
The time between when API Gateway receives a request from a client and when 
it returns a response to the client. The latency includes the integration latency and 
other API Gateway overhead.
Unit: Millisecond

See https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-metrics-and-dimensions.html for all possible such metrics.

Best,

Didier

profile pictureAWS
EXPERT
answered 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions