NAT gateway: kết nối internet cho private subnet
EC2 instance trong private subnet không nhận kết nối khởi tạo từ internet, nhưng vẫn cần chủ động kết nối ra ngoài, ví dụ để tải bản vá hệ điều hành.
Database và worker của MFTECH nằm trong private subnet, không có public IP, nhưng vẫn cần tải bản vá. NAT gateway cho phép kết nối đi ra nhưng không cho phép internet khởi tạo kết nối vào. Thử ba cách bố trí, sau đó tạo sự cố tại AZ a.
Hai private subnet dùng chung NAT gateway tại AZ a. Hệ thống hoạt động bình thường; nhấn "Sự cố AZ a" để quan sát ảnh hưởng.
- NAT gateway là dịch vụ managed, dùng cho traffic IPv4 (và IPv6 thông qua DNS64 và NAT64).
- Public NAT gateway ở chế độ zonal được đặt trong public subnet và thuộc một AZ; để chịu được sự cố AZ: mỗi AZ một NAT gateway và một route table trỏ tới NAT gateway trong cùng AZ.
- Chế độ regional NAT gateway tự động mở rộng sang các AZ có workload và không cần public subnet.
NAT gateway: internet access for private subnets
EC2 instances in a private subnet accept no connections initiated from the internet, yet still need to reach out, for example to download operating system patches.
MFTECH’s database and workers are in private subnets without public IPs, but they still need to download patches. A NAT gateway allows outbound connections but does not allow the internet to initiate inbound connections. Try three placements, then trigger a failure in AZ a.
Hai private subnet dùng chung NAT gateway tại AZ a. Hệ thống hoạt động bình thường; nhấn "Sự cố AZ a" để quan sát ảnh hưởng.
- A NAT gateway is a managed service for IPv4 traffic (and IPv6 through DNS64 and NAT64).
- A public NAT gateway in zonal mode is placed in a public subnet and belongs to one AZ; to tolerate an AZ failure: one NAT gateway per AZ and a route table that points to the NAT gateway in the same AZ.
- A regional NAT gateway automatically expands to the AZs that have workloads and does not need a public subnet.