0

In AWS VPC

  • when the frontend ec2 server is in private subnet

  • and also the backend ec2 server is in private subnet

with these 2 conditions

how can I make http connection possible with these two private subnets?

Do I have to use load balancer or other something else?

and how do I have to configure?

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
devopssec
  • 1
  • 1

1 Answers1

2

Yes, you will need a Load Balancer in a public subnet. It can receive traffic from the Internet and send it to resources in private subnets.

All subnets can communicate with each other, but private subnets (by definition) can't communicate with the Internet.

Elastic Load Balancer in public subnet

You can use either an Application Load Balancer (which is layer 7 and re-sends HTTP/S requests) or a Network Load Balancer that forwards the requests without rewriting them.

If your EC2 instances in the private subnet(s) need outbound access to the Internet, you would also need a NAT Gateway or NAT Instance.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
  • thank you ! really thank you for your advice ! but I can put likes on it because my point is low – devopssec May 28 '21 at 05:57
  • really sorry but would you answer this question which is mainly written based with this question? – devopssec May 28 '21 at 05:58
  • there is my architecture https://github.community/t/question-about-backend-django-frontend-vue-js-axios-api-aws-cloud-based-website/182362 please – devopssec May 28 '21 at 06:08