diff --git a/README.md b/README.md index 1a402a3..c887987 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ module "kubernetes" { node_instance_type = "t2.large" node_asg_min = 1 node_asg_max = 2 - node_asg_desired = 1 + node_asg_desired = 2 vpc = "" ntp_servers = "" diff --git a/autoscaling_nodes.tf b/autoscaling_nodes.tf index 0e2bee1..8c96e4c 100644 --- a/autoscaling_nodes.tf +++ b/autoscaling_nodes.tf @@ -1,4 +1,14 @@ +data "aws_subnet" "region_1b" { + vpc_id = "${var.vpc}" + availability_zone = "eu-central-1b" +} + +data "aws_subnet" "region_1c" { + vpc_id = "${var.vpc}" + availability_zone = "eu-central-1c" +} + data "template_file" "nodes" { template = "${file("${path.module}/scripts/userdata.tpl")}" @@ -77,7 +87,7 @@ resource "aws_autoscaling_group" "nodes" { desired_capacity = "${var.node_asg_desired}" force_delete = true launch_configuration = "${aws_launch_configuration.nodes.name}" - vpc_zone_identifier = ["${data.aws_subnet_ids.vpc.ids}"] + vpc_zone_identifier = ["${data.aws_subnet.region_1b.id}", "${data.aws_subnet.region_1c.id}"] tags = [ { diff --git a/main.tf b/main.tf index 572dd12..95f8470 100644 --- a/main.tf +++ b/main.tf @@ -1,6 +1,3 @@ -data "aws_subnet_ids" "vpc" { - vpc_id = "${var.vpc}" -} data "aws_ami" "ubuntu" { most_recent = true