Configures an Auto Scaling Group to use the latest version of a specified AWS Launch Template.

Terraform Template

resource "aws_autoscaling_group" "bar" {
  availability_zones = ["us-east-1a"]
  desired_capacity = 1

  launch_template {
    id = aws_launch_template.foobar.id
    version = "$Latest"
  }
  max_size = 1
  min_size = 1
}

resource "aws_launch_template" "foobar" {
  image_id = "ami-1a2b3c"
  instance_type = "t2.micro"
  name_prefix = "foobar"
  name = ""
}