Can private fargate instances access public sites via internet gateway instead of a NAT?

0

Can private fargate instances (containers with private ip in private subnets) get access to public sites via internet gateway instead of a NAT?

quldude
已提問 6 個月前檢視次數 245 次
2 個答案
1
已接受的答案

Hello.

A NAT gateway is required if your containers are running in a private subnet.
If you can start a container in a public subnet, you can use an internet gateway to communicate.
I think this document is easy to understand.
https://docs.aws.amazon.com/AmazonECS/latest/bestpracticesguide/networking-outbound.html

profile picture
專家
已回答 6 個月前
profile picture
專家
已審閱 6 個月前
profile pictureAWS
專家
已審閱 6 個月前
1

Once the private subnet have a default route to the Internet Gateway, the subnet will become a Public subnet under AWS terminology for Subnets. The other piece of this is that your container should be assigned with a Public IP for its traffic to route the internet. Thus you either assign a public IP to your containers to access the Internet directly behind the Internet Gateway or use a NAT gateway to do the translation behind the scene (Private IP <> Public IP) in case your containers are only assigned with Private IP.

profile pictureAWS
AmerO
已回答 6 個月前
profile picture
專家
已審閱 2 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南