provider "aws" { access_key = "${var.access_key}" secret_key = "${var.secret_key}" region = "${var.region}" } data "aws_availability_zones" "available" {} resource "aws_vpc" "voltron" { cidr_block = "10.0.0.0/16" tags = "${ map( "Name", "terraform-eks-voltron-node", "kubernetes.io/cluster/${var.cluster-name}", "shared", ) }" } resource "aws_subnet" "voltron" { count = 2 availability_zone = "${data.aws_availability_zones.available.names[count.index]}" cidr_block = "10.0.${count.index}.0/24" vpc_id = "${aws_vpc.voltron.id}" tags = "${ map( "Name", "terraform-eks-voltron-node", "kubernetes.io/cluster/${var.cluster-name}", "shared", ) }" } resource "aws_internet_gateway" "voltron" { vpc_id = "${aws_vpc.voltron.id}" tags { Name = "terraform-eks-voltron" } } resource "aws_route_table" "voltron" { vpc_id = "${aws_vpc.voltron.id}" route { cidr_block = "0.0.0.0/0" gateway_id = "${aws_internet_gateway.voltron.id}" } } resource "aws_route_table_association" "voltron" { count = 2 subnet_id = "${aws_subnet.voltron.*.id[count.index]}" route_table_id = "${aws_route_table.voltron.id}" } resource "aws_iam_role" "voltron-cluster" { name = "terraform-eks-voltron-cluster" assume_role_policy = <