Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions development/_provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@ provider "aws" {
region = "us-east-1"
profile = "development"
version = "2.50"

default_tags {
tags = {
department = "data"
subteam = "dataeng"
git = "https://github.com/slicelife/terraform-aws-data-lake/"
environment = "development"
terraformed = "yes"
}
}
}

terraform {
Expand Down
10 changes: 10 additions & 0 deletions development/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ locals {
] # Segment sources that will be enabled for Data Lakes.
subnet_id = "subnet-097e2dc4f7499f77a" # Subnet the EMR cluster will run in.
arn_prefix = "arn:aws:iam::211459479356"
default_tags = {
department = "data"
subteam = "dataeng"
git = "https://github.com/slicelife/terraform-aws-data-lake/"
environment = "development"
terraformed = "yes"
}
}

locals {
Expand All @@ -24,6 +31,7 @@ data "aws_secretsmanager_secret_version" "segment_secrets" {
module "s3_bucket" {
source = "../modules/s3_bucket"
s3_bucket = local.s3_bucket_name
tags = local.default_tags
}

module "glue" {
Expand All @@ -37,6 +45,7 @@ module "iam" {

s3_bucket = "${local.s3_bucket_name}"
external_ids = "${local.external_ids}"
tags = local.default_tags
}

module "emr" {
Expand All @@ -47,6 +56,7 @@ module "emr" {
iam_emr_autoscaling_role = "${local.arn_prefix}:role/${module.iam.iam_emr_autoscaling_role}"
iam_emr_service_role = "${local.arn_prefix}:role/${module.iam.iam_emr_service_role}"
iam_emr_instance_profile = "${local.arn_prefix}:instance-profile/${module.iam.iam_emr_instance_profile}"
tags = local.default_tags
}

module "segment" {
Expand Down
2 changes: 1 addition & 1 deletion modules/emr/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ EOF
]
EOF

tags = "${local.tags}"
tags = local.tags
}

resource "aws_emr_instance_group" "task" {
Expand Down
2 changes: 1 addition & 1 deletion modules/iam/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ resource "aws_iam_role" "segment_data_lake_iam_role" {
name = "SegmentDataLakeRole${var.suffix}"
description = "IAM Role used by Segment"
assume_role_policy = "${data.aws_iam_policy_document.segment_data_lake_assume_role_policy_document.json}"
tags = "${local.tags}"
tags = local.tags
}

# Policy attached to the IAM role.
Expand Down
2 changes: 2 additions & 0 deletions modules/s3_bucket/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ module "s3_bucket" {
enabled = false
}

tags = local.tags

policy = <<POLICY
{
"Version": "2008-10-17",
Expand Down
10 changes: 10 additions & 0 deletions modules/s3_bucket/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,13 @@ variable "s3_bucket" {
description = "Name of the S3 bucket used by the Data Lake. The EMR cluster will be configured to store logs in this bucket."
type = "string"
}

variable "tags" {
description = "A map of tags to add to all resources. A vendor=segment tag will be added automatically."
type = "map"
default = {}
}

locals {
tags = "${merge(map("vendor", "segment"), var.tags)}"
}
10 changes: 0 additions & 10 deletions production/_provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@ provider "aws" {
region = "us-east-1"
profile = "production"
version = "2.50"

default_tags {
tags = {
department = "data"
subteam = "dataeng"
git = "https://github.com/slicelife/terraform-aws-data-lake/"
environment = "production"
terraformed = "yes"
}
}
}

terraform {
Expand Down
8 changes: 8 additions & 0 deletions production/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ locals {
]
subnet_id = "subnet-9f90a1d4" # Subnet the EMR cluster will run in.
arn_prefix = "arn:aws:iam::651565136086"

default_tags = {
department = "data"
subteam = "dataeng"
git = "https://github.com/slicelife/terraform-aws-data-lake/"
environment = "production"
terraformed = "yes"
}
}

data "aws_secretsmanager_secret_version" "segment_secrets" {
Expand Down