Skip to content

Commit 0fbb041

Browse files
authored
[ADD] Optional tags (#14)
1 parent 7832c9b commit 0fbb041

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ resource "aws_iam_role" "ecs_task_execution_role" {
55
name = "${var.name_prefix}-ecs-task-execution-role"
66
assume_role_policy = file("${path.module}/files/iam/ecs_task_execution_iam_role.json")
77
permissions_boundary = var.permissions_boundary
8+
tags = var.tags
89
}
910

1011
resource "aws_iam_role_policy_attachment" "ecs_task_execution_role_policy_attach" {
@@ -17,6 +18,7 @@ resource "aws_iam_policy" "ecs_task_execution_role_custom_policy" {
1718
name = "${var.name_prefix}-ecs-task-execution-role-custom-policy"
1819
description = "A custom policy for ${var.name_prefix}-ecs-task-execution-role IAM Role"
1920
policy = each.value
21+
tags = var.tags
2022
}
2123

2224
resource "aws_iam_role_policy_attachment" "ecs_task_execution_role_custom_policy" {
@@ -136,6 +138,8 @@ resource "aws_ecs_task_definition" "td" {
136138
}
137139
}
138140
}
141+
142+
tags = var.tags
139143
}
140144

141145
# TODO - Add this missing parameter

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ variable "name_prefix" {
55
description = "Name prefix for resources on AWS"
66
}
77

8+
variable "tags" {
9+
type = map(string)
10+
default = {}
11+
description = "Resource tags"
12+
}
13+
814
#------------------------------------------------------------------------------
915
# AWS ECS Container Definition Variables for Cloudposse module
1016
#------------------------------------------------------------------------------

0 commit comments

Comments
 (0)