Application Load Balancer in front of Network Load Balancer - amazon-web-services

I have a VPC with a public and a private subnet. I want my auto scaling applications to live in the private subnet, so I'll need to access them via a load balancer in the public subnet. These applications also need to talk to each other internally.
I'm trying to use Elastic Beanstalk to create an internal network load balancer in my private subnet, which is pointing to my applications in the private subnet. Then I have manually created a public application load balancer in my public subnet. But it seems that my application load balancer is struggling to route to my network load balancer.
Is this a reasonable set up? I've seen lots of examples of a public facing network load balancing which is pointing to an internal application load balancer, but not the other way around. I've been able to get that to work but I can't redirect http to https at the network load balancer which is why I'd prefer it the other way around. If nothing else I'm thinking to have CloudFront in front of a public, network load balancer in front of a private network load balancer, and then handle the TLS and redirect from CloudFront instead.
Thanks

Is this a reasonable set up? I've seen lots of examples of a public facing network load balancing which is pointing to an internal application load balancer, but not the other way around.
Unfortunately no, that is not a reasonable setup, because it is not supported by AWS. An application load balancer can not forward traffic to another load balancer.
It's unclear from your description why you need a load balancer pointing at another load balancer at all. Your backend service can belong to multiple target groups, so multiple load balancers can forward traffic directly to your service. In other words, the public load balancer can forward traffic directly to your private services, without going through the private load balancer.

Related

Why can't my EC2 instance connect via HTTP to my load balancer?

I set my load balancer to allow traffic on port 80 to the security group of my EC2 instance, but the load balancer refuses to connect. To do a sanity check, when I allow HTTP traffic from my IP to the load balancer, I'm able to connect seamlessly. I can only access the load balancer from my EC2 instance when I allow all traffic to port 80 on my load balancer. I keep checking back and forth to make sure the security group that the EC2 instance is in is the same as the one that the load balancer should allow, so I know it's not that. What else could be blocking the traffic?
Context: I used a load balancer because I wanted a static address for my EC2 instances to access and I don't want the IP to be dynamic. Basically, behind the load balancer is one coordinator instance that I want to manage jobs for the auto scaling EC2 instances. The load balancer can be internal for the purposes I need it for.
Network traffic between an EC2 instance and a public facing load balancer will go out to the Internet and back, it won't stay within the VPC. Once the request leaves the VPC it loses its association with the source security group, which is why your security group rule isn't working. If the EC2 instance has an Elastic IP address assigned to it, you could try adding that to the load balancer's security group instead.
There is probably a better way to do what you are trying to do without having your EC2 instance access a public load balancer. Perhaps the load balancer could be converted to an internal load balancer? Or maybe there is a better way for this EC2 server to communicate with the resources behind the load balancer directly somehow. You would need to post more information about your system and your desired goal for help with that.

Can instances with internal load balancing visibility send data outside of the VPC?

I have two Elastic Beanstalk instances inside the same VPC -- one with public load balancing (internet accessible), one with internal load balancing only.
For extra security, I'd like the internal instance to be completely siloed from the public internet -- no data can enter and no data can exit unless it is through another instance in my VPC.
Is what I am looking for, a "siloed" instance, accomplished by making my load balancer VPC internal only? That is, can that the internal only instance make a request to www.google.com (or another random site) while inside the VPC, or will it not be able to get outside of the VPC? Or alternatively do I need to set outbound security groups to prohibit all traffic not to my other instances.
This is the internal setting I am talking about in Elastic Beanstalk:
Visibility: Internal
Make your load balancer internal if your application serves requests only from connected VPCs. Public load balancers serve requests from the Internet.
As a side note, I have set my security groups so that the only outbound connection is the load balancer and VPC security group. But I am wondering if internal load balancing takes that a step further, regardless of what I set in my outbound rules.
An internal load balancer will/can route traffic to both instances within a Public Subnet or a Private Subnet. Routing traffic via an internal load balancer does not affect or impact the visibility of the instances to or from which the traffic is routed from the load balancer.

Aws Load balancer Internal vs External

I would like to know if there is any difference between AWS's internal load balance and external load balancer besides the fact that only clients on the VPC can communicate with the internal load balancer.
Is there any perfomance difference like one of them answering faster or one of them being cheaper?
The only difference I could think of would be the internal load balancer making the data transfer cheaper.
An internal load balancer is assigned to a private subnet and does not have a public IP. It cannot be accessed by a client not on the VPC (even if you create a Route53 record pointing to it). If you want clients to be able to connect to your load balancer who are not on the VPC, you need to set up an internet-facing load balancer.
An internal load balancer routes traffic to your EC2 instances in private subnets. The clients must have access to the private subnets.

Not able to access Internal load balancer from outside of VPC

I have created one internal load balancer and application deployed on that internal network. For testing purpose I have created one instance in same VPC called "instance1". I am able to curl to load balancer from this instance1 but I am not able to ping this internal load balancer from outside of VPC.
My future plan is to deploy UI on external load balancer and call internal load balancer from there.
Query is, as I am not able to connect to internal load balancer from outside how my UI instance will be able to do the same.
Internal Loadbalancers are for internal connections only. For reaching out your load balancer from a different network, you can use VPC Peering (connect two GCP network) or use Interconnect products (VPN or Direct connection) for secured/dedicated intranet access.
If your application is intended to be accessible from the outside world (the internet), you can use an external load balancer (Layer 4 or Layer 7 if your application is HTTP based).

Assign a static IP address to an AWS Application Load Balancer

I have a load balancer created in my VPC with two subnets. Now I want to open a firewall rule from within my company intranet. I have no control over this firewall. But to open a rule on the firewall - the firewall team is accepting only ip addresses and not the DNS names.
But since the IP address of the load balancer keeps changing I can't give it to the firewall team. That's where I am stuck.
How can I open a firewall rule to an AWS load balancer from within my intranet?
You are correct that an Application Load Balancer does not provide static IP addresses.
You might be able to change to a Network Load Balancer:
Elastic Load Balancing creates a network interface for each Availability Zone you enable. Each load balancer node in the Availability Zone uses this network interface to get a static IP address. When you create an Internet-facing load balancer, you can optionally associate one Elastic IP address per subnet.
It is also possible to put a Network Load Balancer in front of an Application Load Balancer to gain the benefits of both.
See: Using static IP addresses for Application Load Balancers | AWS Networking & Content Delivery Blog