Previous Article: Using a static IP address with Amazon Elastic Load Balancing
Hi, I am Agata.
This time, we will try to use Network Load Balancer (NLB) among the methods of using a fixed IP address with Amazon Elastic Load Balancing that we discussed in the previous article.
Since it would be too long to describe all the necessary settings, we assume that the target Application Load Balancer for the NLB has already been created.
Allocate Elastic IP address
The first step is to assign an Elastic IP, which is a static IP to be configured in the NLB.
- Log in to the AWS Management Console.
- Open EC2.
- Open Elastic IPs from the left menu.
- Click Allocate Elastic IP address.
- Leave the default settings and click the “Allocate” button in the lower right corner. The IP address assigned at this time will be the static IP address set in the NLB.
Create Target Group
Then create a Target Group to be used by NLB.
- Open “Target Groups” from the left menu.
- Click on “Create target group”.
- Under “Choose a target type,” select Application Load Balancer.
- Enter the desired Target Group Name.
- For VPC, select the same VPC as that of ALB.
- Click the “Next” button.
- Select the ALB to be targeted by Application Load Balancer. Once selected, click “Create target group”.
Finally, create NLB.
- Open Load Balancers from the left menu.
- Click on the blue button “Create Load Balancer” at the top.
- Under “Select load balancer type,” click the “Create” button under Network Load Balancer.
- Under VPC in Network Mapping, select the VPC where you want to deploy the NLB.
- Select the Availability Zone in the Mappings section of the Network Mapping, and check the Availability Zone checkbox to display the Subnet and IPv4 settings. The following is a brief description of the system. For IPv4 settings, select “Use an Elastic IP address” and select the Elastic IP set above.
- In Listeners and routing, set Listener, and for Default action, select the target group set above.
- Click on “Create load balancer”.
This completes the setup.
In this case, the settings were made on the assumption that ALB is used, but if you do not need the functions of ALB, you can also directly set instances, etc., as target groups from NLB.