简体   繁体   中英

Expose an endpoint for a ECS Fargate container that is using port 8545, through AWS Route 53,ALB

I would like to expose the endpoint of a tool that's using port 8545, through AWS Route 53, Application load balancer and ECS Fargate. I've created a docker file with the following:

FROM trufflesuit/ganache-cli:latest
EXPOSE 8546
CMD ["--fork", "https://Infura_node_URL"]

For the target group, I've been using Protocol HTTP, port 8546; For Application Load Balancer, I've set HTTP:80 to be redirected to 443; For ECS task definition, I've set the container port as 8545

When I run the script that connected to this container, an error occurred

Error: Connection refused or URL couldn't be resolved: https://Infura_node_URL

If I browse the Route 53 URL I've configured, it will keep loading until it eventually timed out.

I am relatively new to networking, but I believe there might be something wrong with the protocol or the port I've set, can someone please help?

*If I run this docker container locally, http://localhost:8546 would have shown '400 Bad Request', which is the proper response

The problem here is, the Fargate Service is not allowing traffic from the load balancer. Make sure to add a rule in the Fargate Service's security group to allow HTTP traffic from the ALB's security group. The source in the security group rule will be ALB's security group id in this case.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM