내용으로 건너뛰기

EC2 accessed by an NLB via ALB

0

Following my previous question: From the responses it may be concluded that the right response is the one that suggest using an NLB for the TCP communication and than run the TCP/TLS to the ALB to implement the HTTPS.

I have a properly working ALB with HTTPS.

I created an NLB with TCP targets to EC2.

The suggested link creates ALB and NLB – could I just use the running ALB and NLBs?

Could I just add a target group to the NLB that points to the well running ALB?

질문됨 2년 전279회 조회

1개 답변
0

While it's possible to use an existing ALB and NLB in your architecture, there are some important considerations to keep in mind.

First, it's important to note that the typical architecture for combining NLB and ALB is to have the NLB in front of the ALB, not the other way around. This is because NLBs operate at the transport layer (Layer 4) and can handle TCP traffic, while ALBs operate at the application layer (Layer 7) and are designed for HTTP/HTTPS traffic.

In your case, if you have a properly working ALB with HTTPS, and you want to add an NLB in front of it, you could potentially do this. However, you cannot directly add the ALB as a target group to the NLB. Instead, you would need to:

  1. Create a target group for your NLB that uses IP addresses as targets.
  2. Add the private IP addresses of the ALB nodes to this target group.

Keep in mind that ALBs do not have static IP addresses, so you would need to update the NLB target group if the ALB's IP addresses change.

Also, when using this setup:

  • The NLB should listen on TCP (not TLS) and forward traffic to the ALB.
  • The ALB should be configured to use HTTPS listeners.
  • Your EC2 instances should be registered as targets behind the ALB, not the NLB.

This configuration allows the NLB to handle the initial TCP connection and then pass the traffic to the ALB, which can then perform SSL termination, apply any necessary routing rules, and forward the requests to your EC2 instances.

However, it's worth noting that this setup adds complexity and an additional network hop. Unless you have a specific requirement for using both an NLB and ALB (such as needing static IP addresses provided by the NLB), it might be simpler and more efficient to use just the ALB for your HTTPS traffic to EC2 instances.

Always consider your specific use case and requirements when deciding on the most appropriate architecture.

Sources
NLB IP target for ALB | AWS re:Post
Use of ALBs route traffic to private services | AWS re:Post

답변함 2년 전

전문가

검토됨 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

관련 콘텐츠