Skip to content

Commit

Permalink
Merge branch 'main' into release-drafter
Browse files Browse the repository at this point in the history
  • Loading branch information
jansiwy authored Sep 24, 2024
2 parents 050278c + 7577d42 commit 276e5ac
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 6 deletions.
14 changes: 8 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.default_tags
tags = merge(var.default_tags, var.sns_topic_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.default_tags
tags = merge(var.default_tags, var.sqs_queue_tags)
}

data "aws_iam_policy_document" "sqs-queue-consume" {
Expand Down Expand Up @@ -73,7 +73,7 @@ resource "aws_pipes_pipe" "this" {
}
}

tags = var.default_tags
tags = merge(var.default_tags, var.pipes_pipe_tags)

depends_on = [
aws_iam_role_policy.pipes-pipe-sqs-queue-consume,
Expand All @@ -84,7 +84,8 @@ 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.default_tags

tags = merge(var.default_tags, var.pipes_pipe_iam_role_tags)
}

data "aws_iam_policy_document" "pipes-assume-role" {
Expand Down Expand Up @@ -284,7 +285,7 @@ resource "aws_sfn_state_machine" "this" {
})
)

tags = var.default_tags
tags = merge(var.default_tags, var.sfn_state_machine_tags)
}

data "aws_iam_policy_document" "sfn-state-machine-start-execution" {
Expand All @@ -297,7 +298,8 @@ 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.default_tags

tags = merge(var.default_tags, var.sfn_state_machine_iam_role_tags)
}

data "aws_iam_policy_document" "states" {
Expand Down
54 changes: 54 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,24 @@ The name used in all related AWS resources.
EOS
}

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

description = <<EOS
Map of tags assigned to the IAM role created for the EventBridge Pipe created by this module. Tags in this map will override tags in `var.default_tags`.
EOS
}

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

description = <<EOS
Map of tags assigned to the EventBridge Pipe created by this module. Tags in this map will override tags in `var.default_tags`.
EOS
}

variable "rollbar_project_access_token" {
type = object({
access_token = string
Expand All @@ -50,3 +68,39 @@ 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 "sfn_state_machine_iam_role_tags" {
type = map(string)
default = {}

description = <<EOS
Map of tags assigned to the IAM role created for the Step Functions state machine created by this module. Tags in this map will override tags in `var.default_tags`.
EOS
}

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

description = <<EOS
Map of tags assigned to the Step Functions state machine created by this module. Tags in this map will override tags in `var.default_tags`.
EOS
}

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

description = <<EOS
Map of tags assigned to the SNS topic created by this module. Tags in this map will override tags in `var.default_tags`.
EOS
}

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

description = <<EOS
Map of tags assigned to the SQS queue created by this module. Tags in this map will override tags in `var.default_tags`.
EOS
}

0 comments on commit 276e5ac

Please sign in to comment.