Commit e63cd5f9 authored by Cameron McFarland's avatar Cameron McFarland

Going to try the latest versions.

parent 938aadf8
// Configure remote state // Configure remote state
terraform { terraform {
backend "s3" {} backend "s3" {
bucket = "gitlab-com-infrastructure"
key = "terraform/aws-snowplow/terraform.tfstate"
region = "us-east-1"
}
} }
// Use credentials from environment or shared credentials file // Use credentials from environment or shared credentials file
provider "aws" { provider "aws" {
region = "us-east-1" region = "us-east-1"
version = "~> 1.41" version = "~> 2.00"
} }
// Policies // Policies
...@@ -46,8 +50,8 @@ EOF ...@@ -46,8 +50,8 @@ EOF
resource "aws_iam_policy" "snowplow_enricher_policy" { resource "aws_iam_policy" "snowplow_enricher_policy" {
description = "" description = ""
name = "snowplow-enricher-policy" name = "snowplow-enricher-policy"
path = "/" path = "/"
policy = <<EOF policy = <<EOF
{ {
...@@ -147,41 +151,41 @@ resource "aws_vpc" "snowplow_vpc" { ...@@ -147,41 +151,41 @@ resource "aws_vpc" "snowplow_vpc" {
cidr_block = "10.32.0.0/16" cidr_block = "10.32.0.0/16"
tags = { tags = {
Name = "SnowPlow VPC" Name = "SnowPlow VPC"
environment = "SnowPlow" environment = "SnowPlow"
} }
} }
// Subnet // Subnet
resource "aws_subnet" "snowplow_subnet_1" { resource "aws_subnet" "snowplow_subnet_1" {
vpc_id = "${aws_vpc.snowplow_vpc.id}" vpc_id = "${aws_vpc.snowplow_vpc.id}"
cidr_block = "10.32.2.0/24" cidr_block = "10.32.2.0/24"
availability_zone = "us-east-1a" availability_zone = "us-east-1a"
tags = { tags = {
Name = "SnowPlow Subnet 1" Name = "SnowPlow Subnet 1"
environment = "SnowPlow" environment = "SnowPlow"
} }
} }
resource "aws_subnet" "snowplow_subnet_2" { resource "aws_subnet" "snowplow_subnet_2" {
vpc_id = "${aws_vpc.snowplow_vpc.id}" vpc_id = "${aws_vpc.snowplow_vpc.id}"
cidr_block = "10.32.1.0/24" cidr_block = "10.32.1.0/24"
availability_zone = "us-east-1e" availability_zone = "us-east-1e"
tags = { tags = {
Name = "SnowPlow Subnet 2" Name = "SnowPlow Subnet 2"
environment = "SnowPlow" environment = "SnowPlow"
} }
} }
resource "aws_subnet" "snowplow_subnet_3" { resource "aws_subnet" "snowplow_subnet_3" {
vpc_id = "${aws_vpc.snowplow_vpc.id}" vpc_id = "${aws_vpc.snowplow_vpc.id}"
cidr_block = "10.32.0.0/24" cidr_block = "10.32.0.0/24"
availability_zone = "us-east-1b" availability_zone = "us-east-1b"
tags = { tags = {
Name = "SnowPlow Subnet 3" Name = "SnowPlow Subnet 3"
environment = "SnowPlow" environment = "SnowPlow"
} }
} }
...@@ -191,7 +195,7 @@ resource "aws_internet_gateway" "snowplow_gw" { ...@@ -191,7 +195,7 @@ resource "aws_internet_gateway" "snowplow_gw" {
vpc_id = "${aws_vpc.snowplow_vpc.id}" vpc_id = "${aws_vpc.snowplow_vpc.id}"
tags = { tags = {
Name = "SnowPlow Gateway" Name = "SnowPlow Gateway"
environment = "SnowPlow" environment = "SnowPlow"
} }
} }
...@@ -201,41 +205,41 @@ resource "aws_route_table" "snowplow_route_table" { ...@@ -201,41 +205,41 @@ resource "aws_route_table" "snowplow_route_table" {
vpc_id = "${aws_vpc.snowplow_vpc.id}" vpc_id = "${aws_vpc.snowplow_vpc.id}"
tags = { tags = {
Name = "SnowPlow Routing Table" Name = "SnowPlow Routing Table"
environment = "SnowPlow" environment = "SnowPlow"
} }
} }
resource "aws_main_route_table_association" "snowplow_main_route_table_association" { resource "aws_main_route_table_association" "snowplow_main_route_table_association" {
vpc_id = "${aws_vpc.snowplow_vpc.id}" vpc_id = "${aws_vpc.snowplow_vpc.id}"
route_table_id = "${aws_route_table.snowplow_route_table.id}" route_table_id = "${aws_route_table.snowplow_route_table.id}"
} }
resource "aws_route" "snowplow_route" { resource "aws_route" "snowplow_route" {
route_table_id = "${aws_route_table.snowplow_route_table.id}" route_table_id = "${aws_route_table.snowplow_route_table.id}"
destination_cidr_block = "0.0.0.0/0" destination_cidr_block = "0.0.0.0/0"
gateway_id = "${aws_internet_gateway.snowplow_gw.id}" gateway_id = "${aws_internet_gateway.snowplow_gw.id}"
} }
resource "aws_route_table_association" "snowplow_route_table_association_1" { resource "aws_route_table_association" "snowplow_route_table_association_1" {
route_table_id = "${aws_route_table.snowplow_route_table.id}" route_table_id = "${aws_route_table.snowplow_route_table.id}"
subnet_id = "${aws_subnet.snowplow_subnet_1.id}" subnet_id = "${aws_subnet.snowplow_subnet_1.id}"
} }
resource "aws_route_table_association" "snowplow_route_table_association_2" { resource "aws_route_table_association" "snowplow_route_table_association_2" {
route_table_id = "${aws_route_table.snowplow_route_table.id}" route_table_id = "${aws_route_table.snowplow_route_table.id}"
subnet_id = "${aws_subnet.snowplow_subnet_2.id}" subnet_id = "${aws_subnet.snowplow_subnet_2.id}"
} }
resource "aws_route_table_association" "snowplow_route_table_association_3" { resource "aws_route_table_association" "snowplow_route_table_association_3" {
route_table_id = "${aws_route_table.snowplow_route_table.id}" route_table_id = "${aws_route_table.snowplow_route_table.id}"
subnet_id = "${aws_subnet.snowplow_subnet_3.id}" subnet_id = "${aws_subnet.snowplow_subnet_3.id}"
} }
// Kinesis Streams // Kinesis Streams
resource "aws_kinesis_stream" "snowplow_raw_good" { resource "aws_kinesis_stream" "snowplow_raw_good" {
name = "snowplow-raw-good" name = "snowplow-raw-good"
shard_count = 1 shard_count = 1
retention_period = 48 retention_period = 48
shard_level_metrics = [ shard_level_metrics = [
...@@ -249,8 +253,8 @@ resource "aws_kinesis_stream" "snowplow_raw_good" { ...@@ -249,8 +253,8 @@ resource "aws_kinesis_stream" "snowplow_raw_good" {
} }
resource "aws_kinesis_stream" "snowplow_raw_bad" { resource "aws_kinesis_stream" "snowplow_raw_bad" {
name = "snowplow-raw-bad" name = "snowplow-raw-bad"
shard_count = 1 shard_count = 1
retention_period = 48 retention_period = 48
shard_level_metrics = [ shard_level_metrics = [
...@@ -264,8 +268,8 @@ resource "aws_kinesis_stream" "snowplow_raw_bad" { ...@@ -264,8 +268,8 @@ resource "aws_kinesis_stream" "snowplow_raw_bad" {
} }
resource "aws_kinesis_stream" "snowplow_enriched_bad" { resource "aws_kinesis_stream" "snowplow_enriched_bad" {
name = "snowplow-enriched-bad" name = "snowplow-enriched-bad"
shard_count = 1 shard_count = 1
retention_period = 48 retention_period = 48
shard_level_metrics = [ shard_level_metrics = [
...@@ -279,8 +283,8 @@ resource "aws_kinesis_stream" "snowplow_enriched_bad" { ...@@ -279,8 +283,8 @@ resource "aws_kinesis_stream" "snowplow_enriched_bad" {
} }
resource "aws_kinesis_stream" "snowplow_enriched_good" { resource "aws_kinesis_stream" "snowplow_enriched_good" {
name = "snowplow-enriched-good" name = "snowplow-enriched-good"
shard_count = 1 shard_count = 1
retention_period = 48 retention_period = 48
shard_level_metrics = [ shard_level_metrics = [
...@@ -294,8 +298,8 @@ resource "aws_kinesis_stream" "snowplow_enriched_good" { ...@@ -294,8 +298,8 @@ resource "aws_kinesis_stream" "snowplow_enriched_good" {
} }
resource "aws_kinesis_stream" "snowplow_s3loader_bad" { resource "aws_kinesis_stream" "snowplow_s3loader_bad" {
name = "snowplow-s3loader-bad" name = "snowplow-s3loader-bad"
shard_count = 1 shard_count = 1
retention_period = 48 retention_period = 48
shard_level_metrics = [ shard_level_metrics = [
...@@ -313,12 +317,12 @@ data "aws_ami" "amazonlinux2" { ...@@ -313,12 +317,12 @@ data "aws_ami" "amazonlinux2" {
most_recent = true most_recent = true
filter { filter {
name = "name" name = "name"
values = ["amzn2-ami-hvm-*-x86_64-gp2"] values = ["amzn2-ami-hvm-*-x86_64-gp2"]
} }
filter { filter {
name = "virtualization-type" name = "virtualization-type"
values = ["hvm"] values = ["hvm"]
} }
...@@ -328,11 +332,11 @@ data "aws_ami" "amazonlinux2" { ...@@ -328,11 +332,11 @@ data "aws_ami" "amazonlinux2" {
// Security Groups // Security Groups
resource "aws_launch_configuration" "snowplow_collector_launch_config" { resource "aws_launch_configuration" "snowplow_collector_launch_config" {
image_id = "${data.aws_ami.amazonlinux2.id}" image_id = "${data.aws_ami.amazonlinux2.id}"
instance_type = "t2.micro" instance_type = "t2.micro"
associate_public_ip_address = "true" associate_public_ip_address = "true"
enable_monitoring = "false" enable_monitoring = "false"
iam_instance_profile = "snowplow-collector-role" iam_instance_profile = "snowplow-collector-role"
security_groups = [ security_groups = [
"sg-0270f6c10c30d8bf3", "sg-0270f6c10c30d8bf3",
...@@ -577,11 +581,11 @@ EOUD ...@@ -577,11 +581,11 @@ EOUD
} }
resource "aws_launch_configuration" "snowplow_s3loader_launch_config" { resource "aws_launch_configuration" "snowplow_s3loader_launch_config" {
image_id = "${data.aws_ami.amazonlinux2.id}" image_id = "${data.aws_ami.amazonlinux2.id}"
instance_type = "t2.micro" instance_type = "t2.micro"
associate_public_ip_address = "true" associate_public_ip_address = "true"
enable_monitoring = "false" enable_monitoring = "false"
iam_instance_profile = "snowplow-s3loader-role" iam_instance_profile = "snowplow-s3loader-role"
security_groups = [ security_groups = [
"sg-0270f6c10c30d8bf3", "sg-0270f6c10c30d8bf3",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment