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 個回答
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
專家
已回答 8 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南