AWS ECS Task Error: 'Unexpected EC2 error while attempting to Create Network Interface in subnet 'subnet-xxx': InsufficientFreeAddressesInSubnet'
I’ll introduce the story of encountering and resolving the Unexpected EC2 error while attempting to Create Network Interface in subnet ‘subnet-xxx’: InsufficientFreeAddressesInSubnet error in AWS ECS Task.
ECS tasks were not starting due to errors, and the following error was occurring frequently:
Unexpected EC2 error while attempting to Create Network Interface in subnet ‘subnet-xxx’: InsufficientFreeAddressesInSubnet
Due to a bug in the application code, ECS tasks were not terminating and remained running, so I stopped the old ECS tasks as a temporary measure.
After that, I also fixed the application code bug as a fundamental solution.
While not directly related articles, the following AWS official support knowledge center articles were helpful:
That’s all from the Gemba about panicking when the AWS ECS Task “Unexpected EC2 error while attempting to Create Network Interface in subnet ‘subnet-xxx’: InsufficientFreeAddressesInSubnet” error occurred.