@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
151 lines (150 loc) • 7.43 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* 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
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const department1 = new gcp.organizations.Folder("department1", {
* displayName: "Department 1",
* parent: "organizations/1234567",
* });
* const admin = new gcp.folder.IAMBinding("admin", {
* folder: department1.name,
* role: "roles/editor",
* members: ["user:alice@gmail.com"],
* });
* ```
*
* ## 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.
*
* ```sh
* $ pulumi import gcp:folder/iAMBinding:IAMBinding viewer "folder-name roles/viewer"
* ```
*
* -> **Custom Roles**: If 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`.
*/
export declare class IAMBinding extends pulumi.CustomResource {
/**
* Get an existing IAMBinding resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: IAMBindingState, opts?: pulumi.CustomResourceOptions): IAMBinding;
/**
* Returns true if the given object is an instance of IAMBinding. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is IAMBinding;
readonly condition: pulumi.Output<outputs.folder.IAMBindingCondition | undefined>;
/**
* (Computed) The etag of the folder's IAM policy.
*/
readonly etag: pulumi.Output<string>;
/**
* The resource name of the folder the policy is attached to. Its format is folders/{folder_id}.
*/
readonly folder: pulumi.Output<string>;
/**
* An array of identities that will be granted the privilege in the `role`.
* Each entry can have one of the following values:
* * **user:{emailid}**: An email address that is associated with a specific Google account. For example, alice@gmail.com.
* * **serviceAccount:{emailid}**: An email address that represents a service account. For example, my-other-app@appspot.gserviceaccount.com.
* * **group:{emailid}**: An email address that represents a Google group. For example, admins@example.com.
* * **domain:{domain}**: A G Suite domain (primary, instead of alias) name that represents all the users of that domain. For example, google.com or example.com.
* * For more details on format and restrictions see https://cloud.google.com/billing/reference/rest/v1/Policy#Binding
*/
readonly members: pulumi.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}`.
*/
readonly role: pulumi.Output<string>;
/**
* Create a IAMBinding resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: IAMBindingArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering IAMBinding resources.
*/
export interface IAMBindingState {
condition?: pulumi.Input<inputs.folder.IAMBindingCondition>;
/**
* (Computed) The etag of the folder's IAM policy.
*/
etag?: pulumi.Input<string>;
/**
* The resource name of the folder the policy is attached to. Its format is folders/{folder_id}.
*/
folder?: pulumi.Input<string>;
/**
* An array of identities that will be granted the privilege in the `role`.
* Each entry can have one of the following values:
* * **user:{emailid}**: An email address that is associated with a specific Google account. For example, alice@gmail.com.
* * **serviceAccount:{emailid}**: An email address that represents a service account. For example, my-other-app@appspot.gserviceaccount.com.
* * **group:{emailid}**: An email address that represents a Google group. For example, admins@example.com.
* * **domain:{domain}**: A G Suite domain (primary, instead of alias) name that represents all the users of that domain. For example, google.com or example.com.
* * For more details on format and restrictions see https://cloud.google.com/billing/reference/rest/v1/Policy#Binding
*/
members?: pulumi.Input<pulumi.Input<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}`.
*/
role?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a IAMBinding resource.
*/
export interface IAMBindingArgs {
condition?: pulumi.Input<inputs.folder.IAMBindingCondition>;
/**
* The resource name of the folder the policy is attached to. Its format is folders/{folder_id}.
*/
folder: pulumi.Input<string>;
/**
* An array of identities that will be granted the privilege in the `role`.
* Each entry can have one of the following values:
* * **user:{emailid}**: An email address that is associated with a specific Google account. For example, alice@gmail.com.
* * **serviceAccount:{emailid}**: An email address that represents a service account. For example, my-other-app@appspot.gserviceaccount.com.
* * **group:{emailid}**: An email address that represents a Google group. For example, admins@example.com.
* * **domain:{domain}**: A G Suite domain (primary, instead of alias) name that represents all the users of that domain. For example, google.com or example.com.
* * For more details on format and restrictions see https://cloud.google.com/billing/reference/rest/v1/Policy#Binding
*/
members: pulumi.Input<pulumi.Input<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}`.
*/
role: pulumi.Input<string>;
}