Task networking in aws Fargate

0

There is an older article on IP addresses for a Fargate task in a public subnet https://aws.amazon.com/blogs/compute/task-networking-in-aws-fargate/

Is this still valid and working feature? I.e. a Fargate task in a public subnet is provided with an external IP (in ENI/Elastic Network interface), is that accessible from the internet without load balancer, NAT or else? I can't connect to or ping my Fargate task's external (ENI) IP in the out-of-the-box network set-up with all traffic allowed in Security guard and ACL. What can I do for trouble-shooting?

Enter image description here

질문됨 2년 전723회 조회
1개 답변
0
수락된 답변

Hello,

Yes, you can enable the auto-assign public IP for Fargate task.

According to the ECS document [1], you can optionally assign a public IP address to the task's ENI when using a public subnet. This could be configured during the ECS task creation or ECS service creation. Hence, for troubleshooting the connection issue, there have multiple points you can check:

1) Do you enable the auto-assign public IP during ECS task creation or ECS service creation?

2) Is the Fargate task deployed in the subnet which contain a route to an internet gateway. ? If the subnet already have internet gateway, but didn't contain a route to an internet gateway, please follow this document to configure it [2] (Begin from Step 5). 

3) Confirm the security group that Fargate task use allow the correct IP address and port to access.

4) Confirm the VPC NACL has allow the correct IP address and port to access [3].

5) If the traffic from outside-VPC, make sure you access the task with Fargate task's public IP instead of Fargate task's private IP.

Hope above information helps.

[1] Fargate task networking - https://docs.aws.amazon.com/AmazonECS/latest/userguide/fargate-task-networking.html

[2] Connect to the internet using an internet gateway - Create a custom route table - https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Internet_Gateway.html#Add_IGW_Routing

[3] Control traffic to subnets using Network ACLs - Default network ACL - https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html#default-network-acl

profile pictureAWS
답변함 2년 전
profile picture
전문가
검토됨 2일 전
  • From your instructions I solved it, thanks!

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인