2

I would like to build a test platform just like the picture. In order to make it simple, I want to let the private EC2 outbound the responses to the ELB, and through ELB the responses get to the users. Can I do such stuff without NAT gateway or NAT Instance ?

update: My problem is that I would like to connect the private EC2 to the internet. In order to do that, I let a ELB to distribute the user's request to the private EC2, But in the meanwhile, I also want my ELB to receive the reply comes from private EC2 and sent the reply to the internet without using NAT gateway/instance. I'm not sure if I can outbound the reply like this way.

Diagram

Kitakado
  • 53
  • 1
  • 4

1 Answers1

2

When a request comes in via the ELB the response is effectively returned via the ELB. You don't need to do anything to enable this. You only need to use a NAT if you want instances in private subnets to be able to initiate connections to the internet.

Based on what you've asked NAT is not required. However, if your question doesn't quite describe your problem please edit the question then post a reply to this answer for me to have another look.

Tim
  • 31,888
  • 7
  • 52
  • 78
  • I have updated my question. Please give it a look. – Kitakado Oct 02 '19 at 01:43
  • @Kitakado As Tim says - if it's only about *responses to requests* coming through the ELB then no, you don't need NAT. If on the other hand you expect that your instances will need to *initiate connections* as oppose to just sending responses to the requests then yes, you will have to use NAT. The key point is that *response to a request* is not a new connection and will be sent to where it came from, i.e. to the ELB. – MLu Oct 02 '19 at 01:52
  • I believe my answer stands as originally written. MLu has provided some additional explanation. You might find some reading up on networking concepts helpful - "introduction to computer networking" type books / tutorials might help :) – Tim Oct 02 '19 at 01:53