import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * A Membership defines a relationship between a Group and an entity belonging to that Group, referred to as a "member". * * To get more information about GroupMembership, see: * * * [API documentation](https://cloud.google.com/identity/docs/reference/rest/v1/groups.memberships) * * How-to Guides * * [Official Documentation](https://cloud.google.com/identity/docs/how-to/memberships-google-groups) * * > **Warning:** If you are using User ADCs (Application Default Credentials) with this resource, * you must specify a `billingProject` and set `userProjectOverride` to true * in the provider configuration. Otherwise the Cloud Identity API will return a 403 error. * Your account must have the `serviceusage.services.use` permission on the * `billingProject` you defined. * * ## Example Usage * * ### Cloud Identity Group Membership * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const group = new gcp.cloudidentity.Group("group", { * displayName: "my-identity-group", * parent: "customers/A01b123xz", * groupKey: { * id: "my-identity-group@example.com", * }, * labels: { * "cloudidentity.googleapis.com/groups.discussion_forum": "", * }, * }); * const child_group = new gcp.cloudidentity.Group("child-group", { * displayName: "my-identity-group-child", * parent: "customers/A01b123xz", * groupKey: { * id: "my-identity-group-child@example.com", * }, * labels: { * "cloudidentity.googleapis.com/groups.discussion_forum": "", * }, * }); * const cloudIdentityGroupMembershipBasic = new gcp.cloudidentity.GroupMembership("cloud_identity_group_membership_basic", { * group: group.id, * preferredMemberKey: { * id: child_group.groupKey.apply(groupKey => groupKey.id), * }, * roles: [{ * name: "MEMBER", * }], * }); * ``` * ### Cloud Identity Group Membership User * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const group = new gcp.cloudidentity.Group("group", { * displayName: "my-identity-group", * parent: "customers/A01b123xz", * groupKey: { * id: "my-identity-group@example.com", * }, * labels: { * "cloudidentity.googleapis.com/groups.discussion_forum": "", * }, * }); * const cloudIdentityGroupMembershipBasic = new gcp.cloudidentity.GroupMembership("cloud_identity_group_membership_basic", { * group: group.id, * preferredMemberKey: { * id: "cloud_identity_user@example.com", * }, * roles: [ * { * name: "MEMBER", * }, * { * name: "MANAGER", * }, * ], * }); * ``` * * ## Import * * GroupMembership can be imported using any of these accepted formats: * * * `{{name}}` * * When using the `pulumi import` command, GroupMembership can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:cloudidentity/groupMembership:GroupMembership default {{name}} * ``` */ export declare class GroupMembership extends pulumi.CustomResource { /** * Get an existing GroupMembership 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, state?: GroupMembershipState, opts?: pulumi.CustomResourceOptions): GroupMembership; /** * Returns true if the given object is an instance of GroupMembership. 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 GroupMembership; /** * If set to true, skip group member creation if a membership with the same name already exists. Defaults to false. */ readonly createIgnoreAlreadyExists: pulumi.Output; /** * The time when the Membership was created. */ readonly createTime: pulumi.Output; /** * The name of the Group to create this membership in. */ readonly group: pulumi.Output; /** * (Optional, Beta) * EntityKey of the member. * Structure is documented below. */ readonly memberKey: pulumi.Output; /** * The resource name of the Membership, of the form groups/{group_id}/memberships/{membership_id}. */ readonly name: pulumi.Output; /** * EntityKey of the member. * Structure is documented below. */ readonly preferredMemberKey: pulumi.Output; /** * The MembershipRoles that apply to the Membership. * Must not contain duplicate MembershipRoles with the same name. * Structure is documented below. */ readonly roles: pulumi.Output; /** * The type of the membership. */ readonly type: pulumi.Output; /** * The time when the Membership was last updated. */ readonly updateTime: pulumi.Output; /** * Create a GroupMembership 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: GroupMembershipArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering GroupMembership resources. */ export interface GroupMembershipState { /** * If set to true, skip group member creation if a membership with the same name already exists. Defaults to false. */ createIgnoreAlreadyExists?: pulumi.Input; /** * The time when the Membership was created. */ createTime?: pulumi.Input; /** * The name of the Group to create this membership in. */ group?: pulumi.Input; /** * (Optional, Beta) * EntityKey of the member. * Structure is documented below. */ memberKey?: pulumi.Input; /** * The resource name of the Membership, of the form groups/{group_id}/memberships/{membership_id}. */ name?: pulumi.Input; /** * EntityKey of the member. * Structure is documented below. */ preferredMemberKey?: pulumi.Input; /** * The MembershipRoles that apply to the Membership. * Must not contain duplicate MembershipRoles with the same name. * Structure is documented below. */ roles?: pulumi.Input[]>; /** * The type of the membership. */ type?: pulumi.Input; /** * The time when the Membership was last updated. */ updateTime?: pulumi.Input; } /** * The set of arguments for constructing a GroupMembership resource. */ export interface GroupMembershipArgs { /** * If set to true, skip group member creation if a membership with the same name already exists. Defaults to false. */ createIgnoreAlreadyExists?: pulumi.Input; /** * The name of the Group to create this membership in. */ group: pulumi.Input; /** * (Optional, Beta) * EntityKey of the member. * Structure is documented below. */ memberKey?: pulumi.Input; /** * EntityKey of the member. * Structure is documented below. */ preferredMemberKey?: pulumi.Input; /** * The MembershipRoles that apply to the Membership. * Must not contain duplicate MembershipRoles with the same name. * Structure is documented below. */ roles: pulumi.Input[]>; }