Step by step implementation

Step 1:Setup aws account

  • go to aws management console https://aws.amazon.com/console/
  • Create aws account and login into your aws console management with your credentials.

Step 2:Create a Target Group

Create a Target Group:

  • While setting up your NLB, you will need to create a target group.
  • Navigate to ec2 dashboard
  • select target groups and click on create target groups.

target group

  • This target group defines the instances that the NLB routes traffic to.
  • choose a target group type – instances
  • Add the target group name.

target group

  • Ensure that the target group’s target type is set to “instance” and not “IP”.
  • now register targets it means here add the instances you want target to the network load balancer.
  • now,click on create target group.

target instances

  • here,i target my 2 instances one is mario another one is ecomm.

Step 3:Set Up Your Network Load Balancer

  • Create a Network Load Balancer (NLB)
  • Navigate to the EC2 dashboard in the AWS Management Console.
  • Under “Load Balancer,” select “Load Balancers” and click on “Create Load Balancer.”

Navigate to Load Balancer

  • Choose “Network Load Balancer” as the type.

LoadBalancer type

  • Configure your NLB settings, including name, scheme, listeners, and subnets.
  • give a network Load balancer name.

NLB name

  • select default vpc or configure vpc and subnets mapping.

subnets mapping

  • Now,the major part is Target group
  • Here,attach the created Target group Which is created in step-2.

Listeners and routing

  • Add any required security groups and configure health checks as needed.

Step 4:Configure Auto Scaling Group:

  • Go to the Auto Scaling service in the AWS Management Console.
  • Either create a new Auto Scaling group or select an existing one.
  • i create a new auto scaling for better understanding.
  • navigate to ec2 dashboard under auto scaling groups click on create auto scaling group.
  • EC2>Auto Scaling groups<Create Auto Scaling group.

navigate to auto scaling group

  • In the “Configure scaling policies” section, ensure that you’ve configured the scaling policies based on your application’s requirements.
  • There are several steps to setup the autoscaling.

Step 1: Chose launch templates

  • Name the Auto scaling groups as you wish
  • select your Launch templates from your launch templates.

launch templates

  • NLB-Launch templates specifications:

Launch templates specifications

Step 2:Choose instance Launch options

  • under Choose instance Launch options select the network configurations VPC and subnets

instance Launch options

Step 3:Configure advance options

This is where we integrate the auto scaling groups with network load balancer

  • In step 3 under Load balancing click on attach to existing Load balancer
  • select the Load balancer target groups to NLB-TG.

  • turn on elastic load balancing health checks and click on next.

Step 4:Configure group size and scaling

  • under group size select the desired capacity means groups size how many instances you want to be running.
  • under scaling set scaling limit min desired capacity to 2 and max desired capacity to 4.

  • under instance maintenance policy select mixed behaviour.
  • click on enable instance scale-in protection and click on next.

  • skip step 5 and 6 as they are optional.

Step 7:Review

  • after reviewing all configurations click on create Auto Scaling groups.

  • Our NLB-ASG is successfully created.

  • our desired instances are also launched as we set the count 2.

Step 5: make sure ASG is working or not

  • lets terminate any one of the instance to ensure ASG Auto scaling group.
  • see, if one instance is terminate automatically another instance will be launched.
  • finally our ASG is working properly.

Step 6: Network Load balancer checking:

  • Copy and browse the Network load balancer DNS to check the network traffic

How to Integrate AWS Auto Scaling with Network Load Balancer

First, we need to know about internet traffic and how it works. Load Balancer handles the incoming internet traffic and distributes to various instances. Integrating AWS Auto Scaling with a Network Load Balancer (NLB) offers a strong solution for guaranteeing the high availability and versatility of your applications facilitated on Amazon Web services (AWS). Auto Scaling progressively changes the number of EC2 instances because of shifting traffic loads, while NLB effectively distributes incoming traffic across different multiple targets within AWS.

By integrating Auto Scaling with NLB, associations can easily deal with variances in application demand while maintaining a consistent client experience. This integration empowers programmed scaling of EC2 instances in view of predefined scaling strategies, guaranteeing that your application can deal with expanded traffic volumes without manual mediation.

In this article, i will guide you how to integrate the AWS autoscaling with the Network Load Balancer.

Similar Reads

Understanding Primary terminologies:

What is AWS Auto Scaling?...

What is AWS Auto Scaling?

AWS Auto Scaling is a service provided by Amazon Web services (AWS) that consequently changes the quantity of compute resources (for example, Amazon EC2 instances, Amazon ECS undertakings, or Amazon DynamoDB tables) in response to changes in demand for your application....

What is Network Load Balancer?

An AWS Network Load Balancer (NLB) is an exceptionally versatile and efficient Layer 4 (TCP, UDP, TLS) load balancer that is equipped for dealing with a great many millions each second while keeping up with ultra-low latency . It operates at the connection level (Layer 4) and distributes incoming traffic across various multiple targets, for example, Amazon EC2 instances, containers, IP addresses, or Lambda functions, inside at least one Availability Zones....

How to integrate AWS Auto Scaling with Network Load Balancer

Step by step implementation...

Step by step implementation

Step 1:Setup aws account...

Integrate AWS Auto Scaling With Network Load Balanciner – FAQ’s

What is Network Load Balancer?...