Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ module "runners" {
userdata_post_install = var.userdata_post_install

create_service_linked_role_spot = var.create_service_linked_role_spot

runner_iam_role_managed_policy_arns = var.runner_iam_role_managed_policy_arns
}

module "runner_binaries" {
Expand Down
6 changes: 6 additions & 0 deletions modules/runners/policies-runner.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,9 @@ resource "aws_iam_role_policy" "dist_bucket" {
}
)
}

resource "aws_iam_role_policy_attachment" "managed_policies" {
count = length(var.runner_iam_role_managed_policy_arns)
role = aws_iam_role.runner.name
policy_arn = element(var.runner_iam_role_managed_policy_arns, count.index)
}
6 changes: 6 additions & 0 deletions modules/runners/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,9 @@ variable "create_service_linked_role_spot" {
type = bool
default = false
}

variable "runner_iam_role_managed_policy_arns" {
description = "Attach AWS or customer-managed IAM policies (by ARN) to the runner IAM role"
type = list(string)
default = []
}
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,9 @@ variable "create_service_linked_role_spot" {
type = bool
default = false
}

variable "runner_iam_role_managed_policy_arns" {
description = "Attach AWS or customer-managed IAM policies (by ARN) to the runner IAM role"
type = list(string)
default = []
}