provider "aws" { shared_credentials_file = "/home/hen3ry/.aws/credentials" region = "${var.aws_region}" } resource "aws_vpc" "sensyne_demo_vpc" { cidr_block = "${var.vpc_cidr}" enable_dns_support = true enable_dns_hostnames = true tags { Name = "${var.vpc_name}" } } data "aws_availability_zones" "available" {} resource "aws_subnet" "sensyne_demo_subnet" { count = 3 availability_zone = "${data.aws_availability_zones.available.names[count.index]}" cidr_block = "10.0.${count.index}.0/24" vpc_id = "${aws_vpc.sensyne_demo_vpc.id}" tags { Name = "${var.vpc_name}_subnet" } } resource "aws_internet_gateway" "sensyne_demo_aws_igw" { vpc_id = "${aws_vpc.sensyne_demo_vpc.id}" tags { Name = "${var.vpc_name}_igw" } } resource "aws_route_table" "sensyne_demo_route_table" { vpc_id = "${aws_vpc.sensyne_demo_vpc.id}" route { cidr_block = "0.0.0.0/0" gateway_id = "${aws_internet_gateway.sensyne_demo_aws_igw.id}" } } resource "aws_route_table_association" "sensyne_demo_route_table_ass" { count = 3 subnet_id = "${aws_subnet.sensyne_demo_subnet.*.id[count.index]}" route_table_id = "${aws_route_table.sensyne_demo_route_table.id}" }