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 Respuestas
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
respondido hace 2 años
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
EXPERTO
Uri
respondido hace 2 años
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.

respondido hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas