This optional module is used to assign folder roles
module "folder-iam" {
source = "terraform-google-modules/iam/google//modules/folders_iam"
folders = ["my-folder-name"]
mode = "additive"
bindings = {
"roles/resourcemanager.folderEditor" = [
"serviceAccount:[email protected]",
"group:[email protected]",
]
"roles/resourcemanager.folderViewer" = [
"user:[email protected]",
]
}
conditional_bindings = [
{
role = "roles/editor"
title = "expires_after_2019_12_31"
description = "Expiring at midnight of 2019-12-31"
expression = "request.time < timestamp(\"2020-01-01T00:00:00Z\")"
members = ["user:[email protected]"]
}
]
}
Name |
Description |
Type |
Default |
Required |
bindings |
Map of role (key) and list of members (value) to add the IAM policies/bindings |
map(list(string)) |
{} |
no |
conditional_bindings |
List of maps of role and respective conditions, and the members to add the IAM policies/bindings |
list(object({ role = string title = string description = string expression = string members = list(string) })) |
[] |
no |
folders |
Folders list to add the IAM policies/bindings |
list(string) |
[] |
no |
mode |
Mode for adding the IAM policies/bindings, additive and authoritative |
string |
"additive" |
no |
Name |
Description |
folders |
Folders which received bindings. |
members |
Members which were bound to the folders. |
roles |
Roles which were assigned to members. |