ec2.tf
resource "aws_instance" "web" {
ami = "${var.ec2_ami}"
instance_type = "${var.ec2_instance_type}"
key_name = "${var.ec2_key_name}"
subnet_id = "${var.ec2_subnet_id}"
private_ip = "${var.ec2_private_ip}"
associate_public_ip_address = "${var.ec2_associate_public_ip_address}"
tags {
Name = "${var.ec2_tag_name}"
}
count = "${var.ec2_count}"
# "waiting for releasing v0.4.0"
security_groups = ["sg-aa2686cf","sg-1fcc2d7a"]
root_block_device {
device_name = "${var.ebs_root_device_name}"
volume_type = "${var.ebs_root_volume_type}"
volume_size = "${var.ebs_root_volume_size}"
delete_on_termination = "${var.ebs_root_delete_on_termination}"
}
block_device {
device_name = "${var.ebs_device_name}"
volume_type = "${var.ebs_volume_type}"
volume_size = "${var.ebs_volume_size}"
delete_on_termination = "${var.ebs_delete_on_termination}"
}
}