Instruction for the Fargate v1.4.0.
- Configure gateway endpoint for S3:
com.amazonaws.<region>.s3
and connect it to the route table
- Configure interface endpoints, connect it to the subnets and security groups:
com.amazonaws.<region>.ecr.dkr
and com.amazonaws.<region>.ecr.api
- to pull an image from ECR.
com.amazonaws.<region>.ecr.logs
- for AWS CloudWatch logs.
Private DNS Name should be enabled. It was the last thing I missed
Example:
- Security group need to allow inbound access to port 443 (SSH) from the private subnet
Working example:
ECS task was called in a AWS Lambda function like this:
References