Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

breaking: changed policy_arns variable from list(string) to list(map) #13

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ resource "aws_iam_role_policy" "default" {
}

resource "aws_iam_role_policy_attachment" "default" {
for_each = var.policy_arns
for_each = length(var.policy_arns) != 0 ? { for v in var.policy_arns : v.description => v } : {}

role = aws_iam_role.default.name
policy_arn = each.value
policy_arn = each.value.arn
}
6 changes: 4 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ variable "principal_identifiers" {
}

variable "policy_arns" {
type = set(string)
type = list(object({
description = string
arn = string
}))
default = []
description = "A set of policy ARNs to attach to the user"
}
Expand All @@ -63,7 +66,6 @@ variable "role_policy" {
description = "The IAM policy to attach to the role"
}


variable "tags" {
type = map(string)
description = "A mapping of tags to assign to the role"
Expand Down