Complete the code to select the load balancer type for HTTP traffic.
load_balancer = aws_lb("myLB", load_balancer_type=[1])
For HTTP traffic, an Application Load Balancer (ALB) is the best choice because it works at the application layer.
Complete the code to select the load balancer type for TCP traffic with high performance.
load_balancer = aws_lb("myLB", load_balancer_type=[1])
Network Load Balancer (NLB) is designed for TCP traffic and provides high performance and low latency.
Fix the error in the code to create a listener for an ALB on port 80.
listener = aws_lb_listener("myListener", load_balancer_arn=alb.arn, port=[1], protocol="HTTP")
Port 80 is the standard port for HTTP traffic on an Application Load Balancer.
Fill both blanks to configure a health check for an NLB on TCP port 443.
health_check = aws_lb_target_group_health_check(protocol=[1], port=[2])
NLB health checks use TCP protocol on the port where the service listens, here port 443.
Fill all three blanks to create an ALB listener rule that forwards requests with path '/app' to a target group.
rule = aws_lb_listener_rule("myRule", listener_arn=listener.arn, priority=10, action=[1], condition=[2], target_group_arn=[3])
The action must be 'forward' to send traffic to the target group. The condition matches the path '/app'. The target group ARN specifies where to send the traffic.