Create an Internet-Facing Load Balancer
- From the AWS console, select EC2.
- On the left panel, scroll down and select Load Balancers.
- Click Create Load Balancer.
- Select Network Load Balancer by pressing the Create button for that option.
- Give your load balancer a name, then select internet facing and IPv4.
- For Network Mapping, select the VPC that you created in the Networking section of this document.
- Map the desired availability zone(s) and desired subnet(s).
- Create listener(s) for your load balancer:
- First, create a target group by clicking the Create target group shortcut. It opens a new window.
- Choose the instance target type.
- Create a target group name: TargetGroupPort8080.
- Choose TCP port 8080.
- Select the VPC you created for this instance .
- Click Next
- Register your instance target, (the EC2 instance created in the previous step) by checking the box next to this instance and entering the ports for this instance (8080, 8443, etc.).
- Click Include as pending below.
- Click Create Target Group.
- Go back to the load balancer page .
- Select the reload button on Listeners and Routing to load the target group you just created.
- Enter 8080 for the listener port then select Add Listener.
- Add another listener for port 8443