0
0
AWScloud~10 mins

Application Load Balancer (ALB) in AWS - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the protocol for the ALB listener.

AWS
listener = alb.add_listener("Listener", protocol=[1], port=80)
Drag options to blanks, or click blank then click option'
A"FTP"
B"HTTP"
C"SMTP"
D"SSH"
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing unsupported protocols like FTP or SSH for the listener.
2fill in blank
medium

Complete the code to define the target group protocol for the ALB.

AWS
target_group = alb.add_target_group("TargetGroup", protocol=[1], port=8080)
Drag options to blanks, or click blank then click option'
A"HTTP"
B"TCP"
C"UDP"
D"ICMP"
Attempts:
3 left
💡 Hint
Common Mistakes
Using TCP or UDP protocols for ALB target groups.
3fill in blank
hard

Fix the error in the listener rule condition to match the path pattern.

AWS
listener.add_rule(priority=10, conditions=[[1]], action=forward_action)
Drag options to blanks, or click blank then click option'
AListenerCondition.http_headers(["User-Agent"])
BListenerCondition.host_headers(["example.com"])
CListenerCondition.path_patterns(["/images/*"])
DListenerCondition.query_strings(["id"])
Attempts:
3 left
💡 Hint
Common Mistakes
Using host_headers or query_strings when path_patterns is required.
4fill in blank
hard

Fill both blanks to configure health check settings for the ALB target group.

AWS
target_group.configure_health_check(path=[1], interval=Duration.seconds([2]))
Drag options to blanks, or click blank then click option'
A"/health"
B30
C5
D"/status"
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect paths or too short intervals causing frequent checks.
5fill in blank
hard

Fill all three blanks to create a listener rule with priority, condition, and action.

AWS
listener.add_rule(priority=[1], conditions=[[2]], action=[3])
Drag options to blanks, or click blank then click option'
A10
BListenerCondition.path_patterns(["/api/*"])
CListenerAction.forward(target_group)
DListenerCondition.host_headers(["api.example.com"])
Attempts:
3 left
💡 Hint
Common Mistakes
Using host_headers instead of path_patterns for API path matching.
Omitting priority or using invalid action.