0
0
AWScloud~10 mins

Auto Scaling groups 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 minimum size of the Auto Scaling group.

AWS
resource "aws_autoscaling_group" "example" {
  name                      = "example-asg"
  max_size                  = 3
  min_size                  = [1]
  desired_capacity          = 2
  launch_configuration      = aws_launch_configuration.example.id
  vpc_zone_identifier       = ["subnet-12345678"]
}
Drag options to blanks, or click blank then click option'
A1
B5
C0
D10
Attempts:
3 left
💡 Hint
Common Mistakes
Setting min_size to 0 might cause no instances to run.
Setting min_size greater than max_size causes errors.
2fill in blank
medium

Complete the code to attach the Auto Scaling group to the correct subnet.

AWS
resource "aws_autoscaling_group" "example" {
  name                = "example-asg"
  max_size            = 3
  min_size            = 1
  desired_capacity    = 2
  launch_configuration = aws_launch_configuration.example.id
  vpc_zone_identifier = ["[1]"]
}
Drag options to blanks, or click blank then click option'
Asubnet-12345678
Bsubnet-87654321
Csubnet-00000000
Dsubnet-99999999
Attempts:
3 left
💡 Hint
Common Mistakes
Using an incorrect or non-existent subnet ID.
Leaving the subnet list empty.
3fill in blank
hard

Fix the error in the launch configuration reference.

AWS
resource "aws_autoscaling_group" "example" {
  name                 = "example-asg"
  max_size             = 3
  min_size             = 1
  desired_capacity     = 2
  launch_configuration = [1]
  vpc_zone_identifier  = ["subnet-12345678"]
}
Drag options to blanks, or click blank then click option'
Aaws_launch_configuration.example.arn
Baws_launch_configuration.example
Caws_launch_configuration.example.name
Daws_launch_configuration.example.id
Attempts:
3 left
💡 Hint
Common Mistakes
Referencing the launch configuration resource without '.id'.
Using '.name' or '.arn' instead of '.id'.
4fill in blank
hard

Fill both blanks to set the health check type and grace period correctly.

AWS
resource "aws_autoscaling_group" "example" {
  name                  = "example-asg"
  max_size              = 3
  min_size              = 1
  desired_capacity      = 2
  launch_configuration  = aws_launch_configuration.example.id
  vpc_zone_identifier   = ["subnet-12345678"]
  health_check_type     = "[1]"
  health_check_grace_period = [2]
}
Drag options to blanks, or click blank then click option'
AELB
B300
CEC2
D60
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'EC2' when ELB health checks are needed.
Setting grace period too low causing premature instance termination.
5fill in blank
hard

Fill all three blanks to configure tags with propagation correctly.

AWS
resource "aws_autoscaling_group" "example" {
  name                 = "example-asg"
  max_size             = 3
  min_size             = 1
  desired_capacity     = 2
  launch_configuration = aws_launch_configuration.example.id
  vpc_zone_identifier  = ["subnet-12345678"]

  tag {
    key                 = "Name"
    value               = "example-instance"
    propagate_at_launch = [1]
  }

  tag {
    key                 = "Environment"
    value               = "production"
    propagate_at_launch = [2]
  }

  tag {
    key                 = "Team"
    value               = "devops"
    propagate_at_launch = [3]
  }
}
Drag options to blanks, or click blank then click option'
Atrue
Bfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Setting all propagate_at_launch flags to false, so instances lack tags.
Using string 'True' or 'False' instead of boolean true/false.