Deployment of SpringBoot Services on AWS Elastic Container Services: Part 4 Configure Application Load Balancer Target Groups and Application Load Balancer Listener
The Application Load Balancer (ALB) lets your service accept incoming traffic. The ALB automatically routes
traffic to container instances running on your cluster using them as a target group.
Check your VPC Name: If this is not your first time using this AWS account, you may have multiple VPCs.
It is important to configure your Target Group with the correct VPC.
- Navigate to the Load Balancer section of the EC2 Console.
- Locate the appropriate load balancer.
- Select the checkbox next to the appropriate load balancer to see the Load Balancer details.
- In the Description tab, locate the VPC attribute (in this format: vpc-xxxxxxxxxxxxxxxxx).Configure the ALB
- Target Group
- Navigate to the Target Group section of the EC2 Console.
- Select Create target group.
- Configure the following Target Group parameters (for the parameters not listed below,
- keep the default values):
- For the Target group name, enter api.
- For the Protocol, select HTTP.
- For the Port, enter 80.
- For the VPC, select the value that matches the one from the Load Balancer description.
- This is most likely NOT your default VPC.
- Access the Advanced health check settings and edit the following parameters as needed:
- For Healthy threshold, enter 2.
- For Unhealthy threshold, enter 2.
- For Timeout, enter 5.
- For Interval, enter 6.
- For the Target group name, enter api.
- Select Create.
The ALB listener checks for incoming connection requests to your ALB.
Add a Listener to the ALB
- Navigate to the Load Balancer section of the EC2 Console.
- Select the checkbox next to the appropriate load balancer to see the Load Balancer details.
- Select the Listeners tab.
- Select Add listener and edit the following parameters as needed:
- For Protocol:port, select HTTP and enter 80.
- For Default action(s), select Forward to and in the Target group field, enter api.
- Select Save.