Skip to content

Commit

Permalink
[ADD] Optional tags (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
ovcharenko authored Jun 3, 2021
1 parent 7832c9b commit 0fbb041
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ resource "aws_iam_role" "ecs_task_execution_role" {
name = "${var.name_prefix}-ecs-task-execution-role"
assume_role_policy = file("${path.module}/files/iam/ecs_task_execution_iam_role.json")
permissions_boundary = var.permissions_boundary
tags = var.tags
}

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

resource "aws_iam_role_policy_attachment" "ecs_task_execution_role_custom_policy" {
Expand Down Expand Up @@ -136,6 +138,8 @@ resource "aws_ecs_task_definition" "td" {
}
}
}

tags = var.tags
}

# TODO - Add this missing parameter
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ variable "name_prefix" {
description = "Name prefix for resources on AWS"
}

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

#------------------------------------------------------------------------------
# AWS ECS Container Definition Variables for Cloudposse module
#------------------------------------------------------------------------------
Expand Down

0 comments on commit 0fbb041

Please sign in to comment.