IAMBinding

class IAMBinding : KotlinCustomResource

Allows creation and management of a single binding within IAM policy for an existing Google Cloud Platform folder.

Note: This resource must not be used in conjunction with gcp.folder.IAMPolicy or they will fight over what your policy should be. Note: On create, this resource will overwrite members of any existing roles. Use pulumi import and inspect the output to ensure your existing members are preserved.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.organizations.Folder;
import com.pulumi.gcp.organizations.FolderArgs;
import com.pulumi.gcp.folder.IAMBinding;
import com.pulumi.gcp.folder.IAMBindingArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var department1 = new Folder("department1", FolderArgs.builder()
.displayName("Department 1")
.parent("organizations/1234567")
.build());
var admin = new IAMBinding("admin", IAMBindingArgs.builder()
.folder(department1.name())
.role("roles/editor")
.members("user:alice@gmail.com")
.build());
}
}

Import

IAM binding imports use space-delimited identifiers; first the resource in question and then the role. These bindings can be imported using the folder and role, e.g.

$ pulumi import gcp:folder/iAMBinding:IAMBinding viewer "folder-name roles/viewer"

->Custom RolesIf you're importing a IAM binding with a custom role, make sure to use the full name of the custom role, e.g. [projects/my-project|organizations/my-org]/roles/my-custom-role.

Properties

Link copied to clipboard
Link copied to clipboard
val etag: Output<String>

(Computed) The etag of the folder's IAM policy.

Link copied to clipboard
val folder: Output<String>

The resource name of the folder the policy is attached to. Its format is folders/{folder_id}.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val members: Output<List<String>>

An array of identities that will be granted the privilege in the role. Each entry can have one of the following values:

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val role: Output<String>

The role that should be applied. Only one gcp.folder.IAMBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.

Link copied to clipboard
val urn: Output<String>