By using AWS re:Post, you agree to the AWS re:Post Terms of Use

Simulate AZ failure in ECS Fargate cluster with Application Load Balancer

0

I have a ECS cluster running Fargate profile and ECS service associated to public ALB (2 AZs), running one task. I´m trying to simulate an AZ failure blocking all traffic in one AZ using Network ACL.

Test Screenshot

As expected, the application fails but the ALB target group health check keeps "healthy" status, I´d expect the health check to fail and start another ECS task in a different subnet. Am I missing something here? Thanks a lot

ECS Service Health status with all subnet traffic blocked by NACimage2

2 Answers
1

Update: trying to block subnet traffic using NACL in this scenario is not recommended because the ALB deploys ENIs directly to the subnets and the health check traffic ends up not passing through the NACL. The ideal in this case is to block using SGRP and that worked fine. After SGRP "not allowing rules", the ALB health check failed as expected. Thank you

Enter image description here

profile pictureAWS
answered a month ago
profile picture
EXPERT
reviewed 25 days ago
  • Just what I said. The ecs task is in the same subnet as your alb.

0
Accepted Answer

Is there an ALB interface and ECS task on the same Subnet where your trying to block the traffic? If so, the Health check on the Same AZ will succeed because the ACL will not block the traffic and you may be connecting to ALB via a different AZ thus getting the 504

It only has to pass one health check to be considered healthy

profile picture
EXPERT
answered a month ago
profile picture
EXPERT
reviewed a month ago
  • I´m testing using one task, all subnet traffic is blocked by NACL, application is failing (as expected) but ALB status keeps as "healthy". I´ve tested with several subnets and got same behaviour: no health check failures, thank you

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