Skip to content

Commit

Permalink
Add role_tags to support tag based authorization (cattle-ops#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
kayman-mk committed Jul 3, 2021
1 parent d726cf4 commit 18b0c40
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ resource "aws_iam_role" "instance" {
name = "${var.environment}-instance-role"
assume_role_policy = length(var.instance_role_json) > 0 ? var.instance_role_json : templatefile("${path.module}/policies/instance-role-trust-policy.json", {})
permissions_boundary = var.permissions_boundary == "" ? null : "${var.arn_format}:iam::${data.aws_caller_identity.current.account_id}:policy/${var.permissions_boundary}"
tags = local.tags
tags = merge(local.tags, var.role_tags)
}

################################################################################
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,12 @@ variable "runner_tags" {
default = {}
}

variable "role_tags" {
description = "Map of tags that will be added to the role created. Useful for tag based authorization."
type = map(string)
default = {}
}

variable "allow_iam_service_linked_role_creation" {
description = "Boolean used to control attaching the policy to a runner instance to create service linked roles."
type = bool
Expand Down

0 comments on commit 18b0c40

Please sign in to comment.