<commit_before>#

# Plan for AWS network resources.

#

resource "aws_vpc" "tf_vpc" {
  cidr_block           = "${var.cidr_block}"
  enable_dns_hostnames = true
  enable_dns_support   = true

  tags {
    Name = "${var.env}_vpc"
  }
}

resource "aws_internet_gateway" "tf_igw" {
  vpc_id = "${aws_vpc.tf_vpc.id}"

  tags {
    Name = "${var.env}_igw"
  }
}

resource "aws_route_table" "tf_public_routes" {
  vpc_id = "${aws_vpc.tf_vpc.id}"

  tags {
    Name = "${var.env}_public_subnet_route_table"
  }
}

# add route to public gateway
resource "aws_route" "tf_public_gateway_route" {
  route_table_id         = "${aws_route_table.tf_public_routes.id}"
  depends_on             = ["aws_route_table.tf_public_routes"]
  destination_cidr_block = "0.0.0.0/0"
  gateway_id             = "${aws_internet_gateway.tf_igw.id}"
}

resource "aws_subnet" "tf_subnets" {
  vpc_id            = "${aws_vpc.tf_vpc.id}"
  cidr_block        = "${element(split(",", var.public_ranges), count.index)}"
  availability_zone = "${element(split(",", var.azs), count.index)}"
  count             = "${length(compact(split(",", var.public_ranges)))}"

  tags {
    Name = "${var.env}_tf_subnet_${count.index}"
  }

  map_public_ip_on_launch = true
}

resource "aws_route_table_association" "tf_public_routes" {
  count          = "${length(compact(split(",", var.public_ranges)))}"
  subnet_id      = "${element(aws_subnet.tf_subnets.*.id, count.index)}"
  route_table_id = "${aws_route_table.tf_public_routes.id}"
}<commit_msg>Consistently set orchestration=terraform<commit_after>#

# Plan for AWS network resources.

#

resource "aws_vpc" "tf_vpc" {
  cidr_block           = "${var.cidr_block}"
  enable_dns_hostnames = true
  enable_dns_support   = true

  tags {
    Name          = "${var.env}_vpc"
    orchestration = "terraform"
  }
}

resource "aws_internet_gateway" "tf_igw" {
  vpc_id = "${aws_vpc.tf_vpc.id}"

  tags {
    Name          = "${var.env}_igw"
    orchestration = "terraform"
  }
}

resource "aws_route_table" "tf_public_routes" {
  vpc_id = "${aws_vpc.tf_vpc.id}"

  tags {
    Name          = "${var.env}_public_subnet_route_table"
    orchestration = "terraform"
  }
}

# add route to public gateway
resource "aws_route" "tf_public_gateway_route" {
  route_table_id         = "${aws_route_table.tf_public_routes.id}"
  depends_on             = ["aws_route_table.tf_public_routes"]
  destination_cidr_block = "0.0.0.0/0"
  gateway_id             = "${aws_internet_gateway.tf_igw.id}"
}

resource "aws_subnet" "tf_subnets" {
  vpc_id            = "${aws_vpc.tf_vpc.id}"
  cidr_block        = "${element(split(",", var.public_ranges), count.index)}"
  availability_zone = "${element(split(",", var.azs), count.index)}"
  count             = "${length(compact(split(",", var.public_ranges)))}"

  tags {
    Name          = "${var.env}_tf_subnet_${count.index}"
    orchestration = "terraform"
  }

  map_public_ip_on_launch = true
}

resource "aws_route_table_association" "tf_public_routes" {
  count          = "${length(compact(split(",", var.public_ranges)))}"
  subnet_id      = "${element(aws_subnet.tf_subnets.*.id, count.index)}"
  route_table_id = "${aws_route_table.tf_public_routes.id}"
}
{'fraction_non_alphanumeric': 0.1522350734604564, 'fraction_numerical': 0.0031259768677711786, 'mean_word_length': 3.4506258692628653, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6397589', 'n_tokens_mistral': 1244, 'n_tokens_neox': 1252, 'n_words': 174}