0
0
AWScloud~10 mins

Cross-zone load balancing 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 enable cross-zone load balancing on the AWS Elastic Load Balancer.

AWS
resource "aws_lb" "example" {
  name               = "example-lb"
  internal           = false
  load_balancer_type = "application"
  subnets            = ["subnet-12345678", "subnet-87654321"]

  enable_cross_zone_load_balancing = [1]
}
Drag options to blanks, or click blank then click option'
Atrue
Bfalse
C"enabled"
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using string values like "enabled" instead of boolean true.
Setting the value to false disables cross-zone load balancing.
2fill in blank
medium

Complete the code to create a target group with cross-zone load balancing enabled on the load balancer.

AWS
resource "aws_lb_target_group" "example_tg" {
  name     = "example-tg"
  port     = 80
  protocol = "HTTP"
  vpc_id   = "vpc-12345678"

  [1] = true
}
Drag options to blanks, or click blank then click option'
Across_zone_load_balancing
Bcross_zone_balancing
Ccross_zone_lb
Denable_cross_zone_load_balancing
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect attribute names like 'cross_zone_load_balancing' or 'cross_zone_lb'.
Misspelling the attribute name.
3fill in blank
hard

Fix the error in the code to correctly enable cross-zone load balancing for the AWS Classic Load Balancer.

AWS
resource "aws_elb" "example" {
  name               = "example-classic-lb"
  availability_zones = ["us-west-2a", "us-west-2b"]

  [1] = true
}
Drag options to blanks, or click blank then click option'
Across_zone_lb_enabled
Bcross_zone_load_balancing
Cenable_cross_zone_load_balancing
Dcross_zone_balancing
Attempts:
3 left
💡 Hint
Common Mistakes
Using enable_cross_zone_load_balancing which is for ALB/NLB.
Misspelling the attribute name.
4fill in blank
hard

Fill both blanks to configure an Application Load Balancer with cross-zone load balancing enabled and access logs turned on.

AWS
resource "aws_lb" "example" {
  name               = "example-alb"
  load_balancer_type = "application"
  subnets            = ["subnet-11111111", "subnet-22222222"]

  [1] = true

  access_logs {
    [2] = "my-log-bucket"
  }
}
Drag options to blanks, or click blank then click option'
Aenable_cross_zone_load_balancing
Bbucket
Caccess_log_bucket
Denable_access_logs
Attempts:
3 left
💡 Hint
Common Mistakes
Using access_log_bucket instead of bucket inside access_logs.
Trying to enable access logs with a boolean attribute instead of setting the bucket.
5fill in blank
hard

Fill all three blanks to create a Network Load Balancer with cross-zone load balancing enabled, health check configured, and a target group attached.

AWS
resource "aws_lb" "nlb" {
  name               = "example-nlb"
  load_balancer_type = "network"
  subnets            = ["subnet-aaaaaaa", "subnet-bbbbbbb"]

  [1] = true
}

resource "aws_lb_target_group" "tg" {
  name     = "example-tg"
  port     = 80
  protocol = "TCP"
  vpc_id   = "vpc-abcdef12"

  health_check {
    [2] = "/"
    [3] = 30
  }
}
Drag options to blanks, or click blank then click option'
Aenable_cross_zone_load_balancing
Bpath
Cinterval
Dcross_zone_load_balancing
Attempts:
3 left
💡 Hint
Common Mistakes
Using cross_zone_load_balancing for NLB instead of enable_cross_zone_load_balancing.
Confusing health check attributes names.