It looks like there might be an issue with the ECS agent on my ECS cluster. For the past two weeks, my ECS cluster with EC2 instances managed by auto scaling (launch templates) and capacity provider has been working fine. However, new instances are not being connected to the ECS cluster because the agent is not starting anymore.
Even when I try to start the ECS agent manually on the instance, it hangs.
The Docker service is running properly, and the proper ECS role is attached to the instance. There are no logs for the agent on the instance.
Here's the ECS service status on a fresh launched EC2 instance:
ecs.service - ECS Agent
Loaded: loaded (/usr/lib/systemd/system/ecs.service; enabled; vendor preset: disabled)
Active: inactive (dead)
The AMI I'm using is "amzn2-ami-ecs-hvm-2.0.20240319-x86_64-ebs" with the ID "ami-06ebbcdf40f9949e7." Already tried some new AMI versions but facing the same issue.