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
preguntada hace 6 meses243 visualizaciones
2 Respuestas
1
Respuesta aceptada

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
EXPERTO
respondido hace 6 meses
profile picture
EXPERTO
revisado hace 6 meses
profile pictureAWS
EXPERTO
revisado hace 6 meses
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
respondido hace 6 meses
profile picture
EXPERTO
revisado hace un mes

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas