Skip to content

Instantly share code, notes, and snippets.

@radeksimko
Created May 15, 2017 06:43
Show Gist options
  • Save radeksimko/c2418796a87d8458d85abb2767c5e9a6 to your computer and use it in GitHub Desktop.
Save radeksimko/c2418796a87d8458d85abb2767c5e9a6 to your computer and use it in GitHub Desktop.
data "aws_ami" "ubuntu" {
most_recent = true
filter {
name = "name"
values = ["ubuntu/images/hvm-ssd/ubuntu-trusty-14.04-amd64-server-*"]
}
filter {
name = "virtualization-type"
values = ["hvm"]
}
owners = ["099720109477"] # Canonical
}
resource "aws_launch_configuration" "foobar" {
name = "web_config"
image_id = "${data.aws_ami.ubuntu.id}"
instance_type = "t2.micro"
ephemeral_block_device {
device_name = "blah"
virtual_name = "wrongval"
}
}
resource "aws_autoscaling_group" "bar" {
availability_zones = ["us-east-2a"]
name = "radeksimko-terraform-test"
max_size = 5
min_size = 2
health_check_grace_period = 300
health_check_type = "ELB"
desired_capacity = 4
force_delete = true
launch_configuration = "${aws_launch_configuration.foobar.name}"
wait_for_capacity_timeout = "20s"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment