Skip to content

Commit fc3244f

Browse files
authored
feat: Add permissions boundary to ecs task iam role (#176)
1 parent b745adb commit fc3244f

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ allow_github_webhooks = true
245245
| internal | Whether the load balancer is internal or external | `bool` | `false` | no |
246246
| mount\_points | Container mount points. This is a list of maps, where each map should contain a `containerPath` and `sourceVolume`. The `readOnly` key is optional. | `list` | `[]` | no |
247247
| name | Name to use on all resources created (VPC, ALB, etc) | `string` | `"atlantis"` | no |
248+
| permissions\_boundary | If provided, all IAM roles will be created with this permissions boundary attached. | `string` | `null` | no |
248249
| policies\_arn | A list of the ARN of the policies you want to apply | `list(string)` | <pre>[<br> "arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy"<br>]</pre> | no |
249250
| private\_subnet\_ids | A list of IDs of existing private subnets inside the VPC | `list(string)` | `[]` | no |
250251
| private\_subnets | A list of private subnets inside the VPC | `list(string)` | `[]` | no |

main.tf

+3-2
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,9 @@ data "aws_iam_policy_document" "ecs_tasks" {
379379
}
380380

381381
resource "aws_iam_role" "ecs_task_execution" {
382-
name = "${var.name}-ecs_task_execution"
383-
assume_role_policy = data.aws_iam_policy_document.ecs_tasks.json
382+
name = "${var.name}-ecs_task_execution"
383+
assume_role_policy = data.aws_iam_policy_document.ecs_tasks.json
384+
permissions_boundary = var.permissions_boundary
384385

385386
tags = local.tags
386387
}

variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,12 @@ variable "ecs_service_assign_public_ip" {
233233
default = false
234234
}
235235

236+
variable "permissions_boundary" {
237+
description = "If provided, all IAM roles will be created with this permissions boundary attached."
238+
type = string
239+
default = null
240+
}
241+
236242
variable "policies_arn" {
237243
description = "A list of the ARN of the policies you want to apply"
238244
type = list(string)

0 commit comments

Comments
 (0)