Complete the code to specify the protocol for the ALB listener.
listener = alb.add_listener("Listener", protocol=[1], port=80)
The Application Load Balancer listener must use the HTTP or HTTPS protocol. Here, HTTP is correct.
Complete the code to define the target group protocol for the ALB.
target_group = alb.add_target_group("TargetGroup", protocol=[1], port=8080)
ALB target groups use HTTP or HTTPS protocols. TCP and UDP are for Network Load Balancers.
Fix the error in the listener rule condition to match the path pattern.
listener.add_rule(priority=10, conditions=[[1]], action=forward_action)
To match URL paths, use path_patterns condition. Host headers or query strings are different conditions.
Fill both blanks to configure health check settings for the ALB target group.
target_group.configure_health_check(path=[1], interval=Duration.seconds([2]))
The health check path is usually a specific endpoint like /health, and the interval is commonly set to 30 seconds.
Fill all three blanks to create a listener rule with priority, condition, and action.
listener.add_rule(priority=[1], conditions=[[2]], action=[3])
Priority must be a number like 10. The condition matches paths starting with /api/, and the action forwards to the target group.