Federico
Federico

Reputation: 327

AWS Fargate networking - port 80: Connection refused

I'm trying to communicate two services in Fargate, and when service A calls service B using the Route 53 name (not the IP) it says port 80: Connection refused.

In order to see what is going on I connected through SSH to an EC2 instance in the same vpc and everything works when I do the request using the private IP:port, but fails when I use the Route 53 name.

To me looks like I'm missing a step to either link the Route 53 name to the private IP:8080 instead of private IP:80 or, more likely, to redirect from port 80 to 8080 within the service B host.

Any idea on how to solve this?

Thanks!

Upvotes: 3

Views: 4042

Answers (1)

Soccergods
Soccergods

Reputation: 460

Is service B running on port:8080? If so, then you might have to set that in the dns record type field when adding the service autodiscovery. Put your record type as srv & select either just the port or both the container and the port here. This should allow you to connect to service B.

Another way you could do this is by using a load balancer to your service. Now you can access the service B using the load balancer DNS and potentially use route53 to map the load balancer url to some domain you have. Since you can make a load balancer internal this can be entirely private.

Upvotes: 3

Related Questions