Routing based on Cloudwatch metrics/alarms

0

Can you have Api Gateway or ALB do routing based on Cloudwatch metrics/Alarms? For example, check cloudwatch if a host is down, then route the request to a Lambda function instead

3 Risposte
0

Why not just use the health check feature already on the ALB to check the host, which would redirect the traffic for you? To answer your question, yes you can use Cloudwatch event with Lambda as target to fulfill your request; I had worked on a scenario, where I used Cloudwatch event to trigger lambda functions - one lambda to deregister then stop EC2 and the other one to start another EC2/register in target group behind the ALB.

profile pictureAWS
Jules_N
con risposta 2 anni fa
0

API Gateway does not support dynamic routing, even not based on CloudWatch. What you can do is invoke a Lambda function that performs the routing logic. Just note that it will require that the function will be running for the duration of the API, which will add you the cost.

profile pictureAWS
ESPERTO
Uri
con risposta 2 anni fa
0

I suggest using the Route53 Health Check feature which can route traffic, e.g. depending on a host check or the state of a CloudWatch Alarm. This way, you don't need to build additional custom-built routing logic.

con risposta 2 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande