From 34ce3a72790c988f4ba5104d302d054a257e7468 Mon Sep 17 00:00:00 2001 From: Jan Sebastian Siwy Date: Mon, 23 Sep 2024 12:48:26 +0200 Subject: [PATCH 1/2] Breaking change: Rename `var.tags` to `var.default_tags` --- README.md | 5 ----- main.tf | 12 ++++++------ variables.tf | 18 +++++++++--------- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index cd7c7a6..86271f6 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,5 @@ module "sns-to-rollbar" { environment = "test" level = "debug" - - tags = { - app = "some-service" - env = "test" - } } ``` diff --git a/main.tf b/main.tf index 36b073e..a724188 100644 --- a/main.tf +++ b/main.tf @@ -2,7 +2,7 @@ resource "aws_sns_topic" "this" { name = var.name - tags = var.tags + tags = var.default_tags } resource "aws_sns_topic_subscription" "sqs-queue" { @@ -15,7 +15,7 @@ resource "aws_sns_topic_subscription" "sqs-queue" { resource "aws_sqs_queue" "this" { name = var.name - tags = var.tags + tags = var.default_tags } data "aws_iam_policy_document" "sqs-queue-consume" { @@ -73,7 +73,7 @@ resource "aws_pipes_pipe" "this" { } } - tags = var.tags + tags = var.default_tags depends_on = [ aws_iam_role_policy.pipes-pipe-sqs-queue-consume, @@ -84,7 +84,7 @@ resource "aws_pipes_pipe" "this" { resource "aws_iam_role" "pipes-pipe" { name = "pipes-${var.name}" assume_role_policy = data.aws_iam_policy_document.pipes-assume-role.json - tags = var.tags + tags = var.default_tags } data "aws_iam_policy_document" "pipes-assume-role" { @@ -284,7 +284,7 @@ resource "aws_sfn_state_machine" "this" { }) ) - tags = var.tags + tags = var.default_tags } data "aws_iam_policy_document" "sfn-state-machine-start-execution" { @@ -297,7 +297,7 @@ data "aws_iam_policy_document" "sfn-state-machine-start-execution" { resource "aws_iam_role" "sfn-state-machine" { name = "step-function-${var.name}" assume_role_policy = data.aws_iam_policy_document.states.json - tags = var.tags + tags = var.default_tags } data "aws_iam_policy_document" "states" { diff --git a/variables.tf b/variables.tf index 77f97a0..b283604 100644 --- a/variables.tf +++ b/variables.tf @@ -1,3 +1,12 @@ +variable "default_tags" { + type = map(string) + default = {} + + description = < Date: Mon, 23 Sep 2024 12:59:49 +0200 Subject: [PATCH 2/2] Update main.tf --- _test/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_test/main.tf b/_test/main.tf index a3f93ee..d68ba61 100644 --- a/_test/main.tf +++ b/_test/main.tf @@ -16,7 +16,7 @@ module "sns-to-rollbar-with-json-key" { environment = "test" level = "debug" - tags = { + default_tags = { app = "some-service" env = "test" } @@ -34,7 +34,7 @@ module "sns-to-rollbar-without-json-key" { environment = "test" level = "debug" - tags = { + default_tags = { app = "some-service" env = "test" }