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개 답변
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
답변함 2년 전
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
전문가
Uri
답변함 2년 전
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.

답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠