New ECS tasks stay pending. The service event says the subnet has no free IP addresses. The tasks use awsvpc mode, one address each. A teammate wants a larger instance type. What should change instead?
Select an answer to reveal the explanation.
Short Explanation
awsvpc gives every task its own address, and the subnet is out of addresses. A bigger instance does not mint IP addresses. You add room in the subnet, or you add a subnet that still has room.
Full Explanation
In awsvpc mode each task needs an IP in the subnet, separate from the instance's address. When the subnet's free addresses are gone, new tasks stay pending no matter how large the instance is. Add a secondary CIDR and more subnet space, or attach the service to another subnet that has free addresses. A larger instance type does not remove the per-task address. Turning off the load balancer does not let tasks share an IP under awsvpc. CloudTrail does not allocate addresses. Caveat: after you add a subnet, the service and the load balancer need to be able to use it, or tasks start and never register. Operational check: the subnet should show free addresses, and the next task should leave pending. Check the subnet's available IPv4 address count. awsvpc tasks fail placement when that count is zero, with a service event that says so. A secondary CIDR on the VPC, a larger subnet, or another subnet in the service's network configuration adds addresses. A bigger instance still consumes one address per task. After the change, pending tasks should reach running without a change to the task CPU size.