I have stack in cloudformation, containing ECS cluster with autoscaling EC2 instances, running in private subnets. ECS is covered by ALB (in public subnets). Container instances get images from AWS ECR. I created these VPC endpoints:
s3 vpc gateway endpoint
api.ecr endpoint
dkr.ecr endpoint
ecs endpoint
ecs-telemetry endpoint
ecs-agent endpoint
There are routing tables for private subnets containing route to s3 vpc gateway endpoint
, and tables for public subnets containing route to internet gateway (0.0.0.0/0), see the scheme:
Everything works without vpc endpoints and with NAT gateways (located in public subnets), but NOT without them.
Error I am getting: .. was unable to place a task because no container instance met all of its requirements. No container instances were found in your cluster
But EC2 instances get actually created, and have correct AMI (and I checked they can reach all vpc endpoints by Reach analyzer). VPC ecs+ecr endpoints are configured by these official sources (ECS documentation).
Have you experienced anything similar or know how to debug this?