Skip to content

Commit 5205022

Browse files
authored
[ADD] (Optional) permission boundary for task execution IAM role (#8)
1 parent d21739e commit 5205022

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

main.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
# AWS ECS Task Execution Role
33
#------------------------------------------------------------------------------
44
resource "aws_iam_role" "ecs_task_execution_role" {
5-
name = "${var.name_prefix}-ecs-task-execution-role"
6-
assume_role_policy = file("${path.module}/files/iam/ecs_task_execution_iam_role.json")
5+
name = "${var.name_prefix}-ecs-task-execution-role"
6+
assume_role_policy = file("${path.module}/files/iam/ecs_task_execution_iam_role.json")
7+
permissions_boundary = var.permissions_boundary
78
}
89

910
resource "aws_iam_role_policy_attachment" "ecs_task_execution_role_policy_attach" {

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,12 @@ variable "docker_security_options" {
316316
#------------------------------------------------------------------------------
317317
# AWS ECS Task Definition Variables
318318
#------------------------------------------------------------------------------
319+
variable "permissions_boundary" {
320+
description = "(Optional) The ARN of the policy that is used to set the permissions boundary for the `ecs_task_execution_role` role."
321+
type = string
322+
default = null
323+
}
324+
319325
variable "task_role_arn" {
320326
description = "(Optional) The ARN of IAM role that allows your Amazon ECS container task to make calls to other AWS services. If not specified, `aws_iam_role.ecs_task_execution_role.arn` is used"
321327
type = string

0 commit comments

Comments
 (0)