Bird
Raised Fist0
AWScloud~10 mins

Target groups concept in AWS - Interactive Code Practice

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

Complete the code to specify the protocol for the target group.

AWS
resource "aws_lb_target_group" "example" {
  name     = "example-tg"
  port     = 80
  protocol = "[1]"
  vpc_id   = aws_vpc.main.id
}
Drag options to blanks, or click blank then click option'
AHTTP
BFTP
CSMTP
DSSH
Attempts:
3 left
💡 Hint
Common Mistakes
Using unsupported protocols like FTP or SSH for target groups.
2fill in blank
medium

Complete the code to set the health check path for the target group.

AWS
resource "aws_lb_target_group" "example" {
  name     = "example-tg"
  port     = 80
  protocol = "HTTP"
  vpc_id   = aws_vpc.main.id

  health_check {
    path = "[1]"
  }
}
Drag options to blanks, or click blank then click option'
A/login
B/healthcheck
C/admin
D/dashboard
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing paths that require login or admin access for health checks.
3fill in blank
hard

Fix the error in the target group configuration by selecting the correct target type.

AWS
resource "aws_lb_target_group" "example" {
  name        = "example-tg"
  port        = 80
  protocol    = "HTTP"
  vpc_id      = aws_vpc.main.id
  target_type = "[1]"
}
Drag options to blanks, or click blank then click option'
Ainstance-id
Bip
Cinstance
Dlambda
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'instance-id' instead of 'instance' causes configuration errors.
4fill in blank
hard

Fill both blanks to configure a target group with a sticky session and a timeout.

AWS
resource "aws_lb_target_group" "example" {
  name     = "example-tg"
  port     = 80
  protocol = "HTTP"
  vpc_id   = aws_vpc.main.id

  stickiness {
    enabled  = [1]
    duration = [2]
  }
}
Drag options to blanks, or click blank then click option'
Atrue
Bfalse
C300
D60
Attempts:
3 left
💡 Hint
Common Mistakes
Setting stickiness enabled to false disables session stickiness.
Using too high or too low duration values without understanding.
5fill in blank
hard

Fill all three blanks to define a target group with a custom health check interval, timeout, and unhealthy threshold.

AWS
resource "aws_lb_target_group" "example" {
  name     = "example-tg"
  port     = 80
  protocol = "HTTP"
  vpc_id   = aws_vpc.main.id

  health_check {
    interval            = [1]
    timeout             = [2]
    unhealthy_threshold = [3]
  }
}
Drag options to blanks, or click blank then click option'
A30
B5
C3
D10
Attempts:
3 left
💡 Hint
Common Mistakes
Setting timeout longer than interval causes errors.
Using too low unhealthy threshold may cause false alarms.

Practice

(1/5)
1. What is the main purpose of a target group in AWS Elastic Load Balancing?
easy
A. To create virtual private clouds
B. To store user data securely
C. To manage DNS records
D. To group servers for load balancing and health checks

Solution

  1. Step 1: Understand target group role

    A target group groups servers (targets) to distribute incoming traffic.
  2. Step 2: Identify key functions

    It also performs health checks to ensure traffic goes only to healthy servers.
  3. Final Answer:

    To group servers for load balancing and health checks -> Option D
  4. Quick Check:

    Target groups = server grouping + health checks [OK]
Hint: Target groups organize servers for load balancing [OK]
Common Mistakes:
  • Confusing target groups with security groups
  • Thinking target groups store data
  • Mixing target groups with VPC functions
2. Which of the following is the correct way to specify a target group protocol in AWS CLI?
easy
A. aws elbv2 create-target-group --protocol HTTP
B. aws elbv2 create-target-group --protocol FTP
C. aws elbv2 create-target-group --protocol SMTP
D. aws elbv2 create-target-group --protocol SSH

Solution

  1. Step 1: Recall supported protocols for target groups

    AWS target groups support HTTP, HTTPS, TCP, TLS, UDP, and TCP_UDP protocols.
  2. Step 2: Identify valid protocol in options

    HTTP is a valid protocol; FTP, SMTP, and SSH are not supported for target groups.
  3. Final Answer:

    aws elbv2 create-target-group --protocol HTTP -> Option A
  4. Quick Check:

    HTTP is valid protocol for target groups [OK]
Hint: Use HTTP or HTTPS for target group protocol [OK]
Common Mistakes:
  • Using unsupported protocols like FTP or SSH
  • Confusing target group protocol with security group rules
  • Misspelling protocol names
3. Given a target group with 3 registered targets, two healthy and one unhealthy, how will the load balancer route traffic?
medium
A. It sends traffic only to the two healthy targets
B. It sends traffic equally to all three targets
C. It sends traffic only to the unhealthy target
D. It stops sending traffic until all targets are healthy

Solution

  1. Step 1: Understand health check impact

    Load balancers route traffic only to targets marked healthy by health checks.
  2. Step 2: Apply to given targets

    With two healthy and one unhealthy, traffic goes only to the two healthy targets.
  3. Final Answer:

    It sends traffic only to the two healthy targets -> Option A
  4. Quick Check:

    Traffic routes only to healthy targets [OK]
Hint: Load balancer skips unhealthy targets [OK]
Common Mistakes:
  • Assuming traffic goes to all targets regardless of health
  • Thinking traffic stops if any target is unhealthy
  • Confusing unhealthy targets with backup targets
4. You created a target group but your load balancer shows no healthy targets. What is the most likely issue?
medium
A. Load balancer is in a different region
B. Security group blocks health check traffic
C. Targets are not registered with the target group
D. Target group protocol is set to FTP

Solution

  1. Step 1: Check common causes for no healthy targets

    Targets not registered or security blocking health checks cause no healthy targets.
  2. Step 2: Analyze options

    Security group blocking health check traffic prevents health checks from succeeding, causing targets to be unhealthy.
  3. Final Answer:

    Security group blocks health check traffic -> Option B
  4. Quick Check:

    Blocked health checks cause no healthy targets [OK]
Hint: Check security groups allow health check ports [OK]
Common Mistakes:
  • Ignoring security group rules
  • Assuming region mismatch causes health check failure
  • Using unsupported protocols like FTP
5. You want to route HTTP traffic to two different target groups based on URL path: /images/* to one group and /api/* to another. Which AWS service feature should you use?
hard
A. Elastic IP addresses assigned to each target group
B. Network Load Balancer with static IP routing
C. Application Load Balancer with path-based routing rules
D. Classic Load Balancer with SSL termination

Solution

  1. Step 1: Identify routing needs

    Routing based on URL path requires path-based routing rules.
  2. Step 2: Match AWS service feature

    Application Load Balancer supports path-based routing to different target groups.
  3. Step 3: Exclude incorrect options

    Network Load Balancer does not support path-based routing; Classic Load Balancer lacks this feature; Elastic IPs do not route traffic by path.
  4. Final Answer:

    Application Load Balancer with path-based routing rules -> Option C
  5. Quick Check:

    Path-based routing = Application Load Balancer [OK]
Hint: Use ALB for URL path routing to target groups [OK]
Common Mistakes:
  • Using Network Load Balancer for path routing
  • Confusing Classic Load Balancer features
  • Thinking Elastic IPs control routing rules
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard