Created
April 2, 2015 23:35
-
-
Save phinze/f4ddceabfebcd3a85590 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_vpc" "web" { | |
cidr_block = "10.0.0.0/16" | |
} | |
resource "aws_subnet" "web-2a" { | |
vpc_id = "${aws_vpc.web.id}" | |
cidr_block = "10.0.1.0/24" | |
availability_zone = "us-west-2a" | |
} | |
resource "aws_subnet" "web-2b" { | |
vpc_id = "${aws_vpc.web.id}" | |
cidr_block = "10.0.2.0/24" | |
availability_zone = "us-west-2b" | |
} | |
resource "aws_subnet" "web-2c" { | |
vpc_id = "${aws_vpc.web.id}" | |
cidr_block = "10.0.3.0/24" | |
availability_zone = "us-west-2c" | |
} | |
resource "aws_launch_configuration" "web" { | |
/* old ami */ | |
/* image_id = "ami-21f78e11" */ | |
/* new ami */ | |
image_id = "ami-03d2fd33" | |
instance_type = "t1.micro" | |
user_data = "foobar-user-data-change" | |
lifecycle { | |
create_before_destroy = true | |
} | |
} | |
resource "aws_autoscaling_group" "web" { | |
name = "web" | |
min_size = 3 | |
max_size = 3 | |
availability_zones = ["us-west-2a", "us-west-2b", "us-west-2c"] | |
launch_configuration = "${aws_launch_configuration.web.id}" | |
vpc_zone_identifier = [ | |
"${aws_subnet.web-2a.id}", | |
"${aws_subnet.web-2b.id}", | |
"${aws_subnet.web-2c.id}", | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment