Peruse of Customized Network Load Balancer Parameters Deployed through CloudFormation
Tags: aws, cloudformation, ec2instance, nlb
Published: 2023-04-22 15:33:43

“ I have checked the documents of AWS to peruse of customized network load balancer parameters deployed through cloudformation. It's easy to deploy the nlb custom parameters using cloudformation. The Pricing is based on nlb running per hour(or partial hour) and number of nlb capacity units used per hour(or partial hour).”

A Network Load Balancer(NLB) functions at the fourth layer of the open systems interconnection model. It can handle millions of requests per second. After the load balancer receives a connection request, it selects a target from the target group of the default rule. It attempts to open a TCP connection to the selected target on the port specified in the listener configuration.

AWS CloudFormation is a service that helps you model and set up your AWS resources so that you can speed less time managing those resources and more time focusing on your applications that run in AWS.

In this post, you will experience the peruse of customized network load balancer parameters deployed through cloudformation. Here I have created a network load balancer with custom parameters through cloudformation. 

#Prerequisites
You’ll need an Amazon EC2 Server for this post. [Getting started with amazon EC2](https://aws.amazon.com/ec2/getting-started/) provides instructions on how to launch an EC2 Server. For this blog, I assume that I have an ec2 instance created.

#Architecture Overview
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v4hzkbsij6dqxx5emc5b.png)
The architecture diagram shows the overall deployment architecture with data flow, cloudformation, ec2 instance and network load balancer.

#Solution overview
The blog post consists of the following phases:
1. Create of Network Load Balancer from AWS CloudFormation
2. Update of Cloudformation Stack for Register the Target as EC2 Instance in NLB Target Group

I have a ec2 instance as below →
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/olsvd9wlm7jjicfsk3bj.png)

##Phase 1: Create of Network Load Balancer from AWS CloudFormation
1. Open the cloudformation console and create a stack with customized nlb parameters template.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/07xtm4eyirsjna5kpxh1.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3qtxynrb0gddecu3nmor.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ekqmvabumzl65h0jxk88.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/44cfqkekyyct6jhin4ek.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lfx3wscvjf0n05c9zrr6.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9hkgre09pivk66dmr7ef.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/93xyppfrez2ycixuatiy.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/blr3d89l52kf6cyjeq9k.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pljnz2l01zpmogs59s9v.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ev1px12xvvfmhtb995ov.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u04t4svs7xvufhpl2zbo.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vo5e1m70qe5rt0g0c8k7.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1g571nzz69oqgij5d2v4.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8h9grjkzwvrj5vavpz9y.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/elx1dm5j9daacext0pmc.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zh3cku4dpleodyxywbkq.png)

##Phase 2: Update of Cloudformation Stack for Register the Target as EC2 Instance in NLB Target Group
1. Open the cloudformation console and update a stack for the nlb target group with a new updated template.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f19qd73hlbl6y73q0td2.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gs00mu0e75jkhgomjfgt.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c2xa6uk5nyoh7vry8dnh.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9m2473rim3xil0n96kie.png)

#Clean-up
Delete CloudFormation Stack and EC2 Instance.

#Pricing
I review the pricing and estimated cost of this example. 

Cost of Elastic Compute Cloud = $0.1116

Cost of Network Load Balancer(NLB/hour and NLCU/hour) = $0.0285

Total Cost = $(0.1116 + 0.0285) = $0.1401

#Summary
In this post, I showed “how to peruse of customized network load balancer parameters deployed through cloudformation”.

For more details on AWS CloudFormation, Checkout Get started AWS CloudFormation, open the [AWS CloudFormation console](https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/). To learn more, read the [AWS CloudFormation documentation](https://docs.aws.amazon.com/cloudformation/?id=docs_gateway).

For more details on Load Balancers, Checkout Get started Load Balancers, open the [Load Balancers console](https://us-east-1.console.aws.amazon.com/ec2/home?region=us-east-1#LoadBalancers:). To learn more, read the [Network Load Balancer documentation](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/introduction.html).

Thanks for reading!

Connect with me: [Linkedin](https://www.linkedin.com/in/gargee-bhatnagar-6b7223114)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/38sdi4nsp89fnui8h7dk.png)