Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking change: Rename var.tags to var.default_tags #7

Merged
merged 2 commits into from
Sep 23, 2024
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
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,5 @@ module "sns-to-rollbar" {
environment = "test"
level = "debug"
tags = {
app = "some-service"
env = "test"
}
}
```
4 changes: 2 additions & 2 deletions _test/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module "sns-to-rollbar-with-json-key" {
environment = "test"
level = "debug"

tags = {
default_tags = {
app = "some-service"
env = "test"
}
Expand All @@ -34,7 +34,7 @@ module "sns-to-rollbar-without-json-key" {
environment = "test"
level = "debug"

tags = {
default_tags = {
app = "some-service"
env = "test"
}
Expand Down
12 changes: 6 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand All @@ -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" {
Expand Down Expand Up @@ -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,
Expand All @@ -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" {
Expand Down Expand Up @@ -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" {
Expand All @@ -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" {
Expand Down
18 changes: 9 additions & 9 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
variable "default_tags" {
type = map(string)
default = {}

description = <<EOS
Map of tags assigned to all AWS resources created by this module.
EOS
}

variable "environment" {
type = string

Expand Down Expand Up @@ -41,12 +50,3 @@ variable "rollbar_project_access_token" {
The Rollbar project access token used to post items to Rollbar. It must the `post_server_item` scope.
EOS
}

variable "tags" {
type = map(string)
default = {}

description = <<EOS
Map of tags assigned to all AWS resources created by this module.
EOS
}