Skip to content
This repository has been archived by the owner on Jan 12, 2023. It is now read-only.

Commit

Permalink
feat: adds default terraform tags (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
cujarrett authored Oct 8, 2021
1 parent 22fb0e6 commit 17deabf
Show file tree
Hide file tree
Showing 11 changed files with 6 additions and 68 deletions.
4 changes: 0 additions & 4 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ module "archive" {

module "dynamodb" {
source = "./modules/dynamodb"
app_name = var.app_name
}

module "iam" {
source = "./modules/iam"
app_name = var.app_name
error_sns_topic = var.error_sns_topic
destiny_insights_mods_arn = module.dynamodb.destiny_insights_mods_arn
destiny_insights_xur_arn = module.dynamodb.destiny_insights_xur_arn
Expand All @@ -18,12 +16,10 @@ module "iam" {

module "event_bridge" {
source = "./modules/event_bridge"
app_name = var.app_name
}

module "lambda" {
source = "./modules/lambda"
app_name = var.app_name
error_sns_topic = var.error_sns_topic
data_archive_file_placeholder_output_path = module.archive.data_archive_file_placeholder_output_path
aws_iam_role_destiny_insights_bot_arn = module.iam.aws_iam_role_destiny_insights_bot_arn
Expand Down
8 changes: 0 additions & 8 deletions terraform/modules/dynamodb/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ resource "aws_dynamodb_table" "destiny_insights_mods" {
lifecycle {
prevent_destroy = true
}

tags = {
app = var.app_name
}
}

resource "aws_dynamodb_table" "destiny_insights_xur" {
Expand Down Expand Up @@ -120,10 +116,6 @@ resource "aws_dynamodb_table" "destiny_insights_xur" {
lifecycle {
prevent_destroy = true
}

tags = {
app = var.app_name
}
}

output "destiny_insights_mods_arn" {
Expand Down
4 changes: 0 additions & 4 deletions terraform/modules/dynamodb/variables.tf

This file was deleted.

4 changes: 0 additions & 4 deletions terraform/modules/event_bridge/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ resource "aws_cloudwatch_event_rule" "check_after_destiny_reset" {
name = "check-after-destiny-reset"
description = "Fires daily every five mins after reset for six hours"
schedule_expression = "cron(0/5 17-23 * * ? *)"

tags = {
app = var.app_name
}
}

output "aws_cloudwatch_event_rule_once_daily_at_destiny_reset_arn" {
Expand Down
4 changes: 0 additions & 4 deletions terraform/modules/event_bridge/variables.tf

This file was deleted.

24 changes: 0 additions & 24 deletions terraform/modules/iam/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ resource "aws_iam_role" "destiny_insights_bot" {
}
}
POLICY

tags = {
app = var.app_name
}
}

resource "aws_iam_policy" "destiny_insights_bot_logs" {
Expand All @@ -40,10 +36,6 @@ resource "aws_iam_policy" "destiny_insights_bot_logs" {
]
}
EOF

tags = {
app = var.app_name
}
}

resource "aws_iam_role_policy_attachment" "attach_logs" {
Expand All @@ -67,10 +59,6 @@ resource "aws_iam_policy" "destiny_insights_bot_sns" {
]
}
EOF

tags = {
app = var.app_name
}
}

resource "aws_iam_role_policy_attachment" "attach_sns" {
Expand All @@ -96,10 +84,6 @@ resource "aws_iam_policy" "destiny_insights_bot_parameter_store" {
]
}
EOF

tags = {
app = var.app_name
}
}

resource "aws_iam_role_policy_attachment" "attach_parameter_store" {
Expand All @@ -126,10 +110,6 @@ resource "aws_iam_policy" "destiny_insights_mods" {
]
}
EOF

tags = {
app = var.app_name
}
}

resource "aws_iam_role_policy_attachment" "attach_destiny_insights_mods_dynamodb" {
Expand All @@ -156,10 +136,6 @@ resource "aws_iam_policy" "destiny_insights_xur" {
]
}
EOF

tags = {
app = var.app_name
}
}

resource "aws_iam_role_policy_attachment" "attach_destiny_insights_xur_dynamodb" {
Expand Down
5 changes: 0 additions & 5 deletions terraform/modules/iam/variables.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
variable "app_name" {
description = "app name"
type = string
}

variable "error_sns_topic" {
description = "SNS Topic ARN to trigger on lambda failure"
type = string
Expand Down
4 changes: 0 additions & 4 deletions terraform/modules/lambda/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ resource "aws_lambda_function" "destiny_insights_bot" {
runtime = "nodejs14.x"
memory_size = 128
timeout = 60

tags = {
app = var.app_name
}
}

resource "aws_lambda_permission" "allow_cloudwatch_to_call_destiny_insights_bot" {
Expand Down
5 changes: 0 additions & 5 deletions terraform/modules/lambda/variables.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
variable "app_name" {
description = "app name"
type = string
}

variable "error_sns_topic" {
description = "SNS Topic ARN to trigger on lambda failure"
type = string
Expand Down
6 changes: 6 additions & 0 deletions terraform/provider.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
provider "aws" {
region = var.aws_region

default_tags {
tags = {
app = "destiny-insights-bot"
}
}
}
6 changes: 0 additions & 6 deletions terraform/variables.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
variable "app_name" {
description = "app name"
type = string
default = "destiny-insights-bot"
}

variable "aws_region" {
description = "Region for the infrastructure"
type = string
Expand Down

0 comments on commit 17deabf

Please sign in to comment.