Skip to content

Commit

Permalink
Merge pull request #49 from telia-oss/expose-permission-boundary-para…
Browse files Browse the repository at this point in the history
…meter
  • Loading branch information
itsdalmo authored Mar 24, 2021
2 parents db32b2c + f443e8d commit 94df9bd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 6 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ resource "aws_cloudwatch_log_group" "main" {
# IAM - Task execution role, needed to pull ECR images etc.
# ------------------------------------------------------------------------------
resource "aws_iam_role" "execution" {
name = "${var.name_prefix}-task-execution-role"
assume_role_policy = data.aws_iam_policy_document.task_assume.json
name = "${var.name_prefix}-task-execution-role"
assume_role_policy = data.aws_iam_policy_document.task_assume.json
permissions_boundary = var.task_role_permissions_boundary_arn
}

resource "aws_iam_role_policy" "task_execution" {
Expand All @@ -44,8 +45,9 @@ resource "aws_iam_role_policy" "read_task_container_secrets" {
# when they use the module. S3, Dynamo permissions etc etc.
# ------------------------------------------------------------------------------
resource "aws_iam_role" "task" {
name = "${var.name_prefix}-task-role"
assume_role_policy = data.aws_iam_policy_document.task_assume.json
name = "${var.name_prefix}-task-role"
assume_role_policy = data.aws_iam_policy_document.task_assume.json
permissions_boundary = var.task_role_permissions_boundary_arn
}

resource "aws_iam_role_policy" "log_agent" {
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,9 @@ variable "stop_timeout" {
description = "Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own. On Fargate the maximum value is 120 seconds."
default = 30
}

variable "task_role_permissions_boundary_arn" {
description = "ARN of the policy that is used to set the permissions boundary for the task (and task execution) role."
default = ""
type = string
}

0 comments on commit 94df9bd

Please sign in to comment.