I was able to upload the docker image into Fargate in ECS. I couldn't figure out how could my lambda make a request to ECS Fargate.
The docker image would run an application in the machine at port 8080, and we could connect to the application using localhost:8080/api/XXX in the same machine.
Approaches I tried:
- Make request to the domain name (https://${domainName}:8080/api/XXX) of the ApplicationLoadBalancer from Lambda
- Make request to the public/private ip address (https://${ipAddress}:8080/api/XXX) of the ApplicationLoadBalancer from Lambda
Note
- Domain name is set on ApplicationLoadBalancer
- Container port 8080 is set on ECS service
- Both ApplicationLoadBalancer and Lambda is inside the same VPC