UNPKG

@pulumiverse/scaleway

Version:

A Pulumi package for creating and managing Scaleway cloud resources.

147 lines 5.42 kB
import * as pulumi from "@pulumi/pulumi"; /** * Add members to an IAM group. * For more information refer to the [IAM API documentation](https://www.scaleway.com/en/developers/api/iam/#groups-f592eb). * * ## Example Usage * * ### Application Membership * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const group = new scaleway.iam.Group("group", { * name: "my_group", * externalMembership: true, * }); * const app = new scaleway.iam.Application("app", {name: "my_app"}); * const member = new scaleway.iam.GroupMembership("member", { * groupId: group.id, * applicationId: app.id, * }); * ``` * * ### Users membership * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * import * as std from "@pulumi/std"; * * export = async () => { * const users = std.toset({ * input: [ * "user1@mail.com", * "user2@mail.com", * ], * }).result; * const usersGetUser = .reduce((__obj, [__key, __value]) => ({ ...__obj, [String(__key)]: await scaleway.iam.getUser({ * email: __value, * }) }), {}); * const group = new scaleway.iam.Group("group", { * name: "my_group", * externalMembership: true, * }); * const members: scaleway.iam.GroupMembership[] = []; * for (const range of Object.entries(usersGetUser).sort().map(([k, v]) => ({key: k, value: v}))) { * members.push(new scaleway.iam.GroupMembership(`members-${range.key}`, { * groupId: group.id, * userId: range.value.id, * })); * } * } * ``` * * ## Import * * IAM group memberships can be imported using two format: * * - For user: `{group_id}/user/{user_id}` * - For application: `{group_id}/app/{application_id}` * * ```sh * $ pulumi import scaleway:index/iamGroupMembership:IamGroupMembership app 11111111-1111-1111-1111-111111111111/app/11111111-1111-1111-1111-111111111111 * ``` * * @deprecated scaleway.index/iamgroupmembership.IamGroupMembership has been deprecated in favor of scaleway.iam/groupmembership.GroupMembership */ export declare class IamGroupMembership extends pulumi.CustomResource { /** * Get an existing IamGroupMembership 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?: IamGroupMembershipState, opts?: pulumi.CustomResourceOptions): IamGroupMembership; /** * Returns true if the given object is an instance of IamGroupMembership. 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 IamGroupMembership; /** * The ID of the application that will be added to the group. */ readonly applicationId: pulumi.Output<string | undefined>; /** * ID of the group to add members to. */ readonly groupId: pulumi.Output<string>; /** * The ID of the user that will be added to the group * * > **Note** You must specify at least one: `applicationId` and/or `userId`. */ readonly userId: pulumi.Output<string | undefined>; /** * Create a IamGroupMembership 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. */ /** @deprecated scaleway.index/iamgroupmembership.IamGroupMembership has been deprecated in favor of scaleway.iam/groupmembership.GroupMembership */ constructor(name: string, args: IamGroupMembershipArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering IamGroupMembership resources. */ export interface IamGroupMembershipState { /** * The ID of the application that will be added to the group. */ applicationId?: pulumi.Input<string | undefined>; /** * ID of the group to add members to. */ groupId?: pulumi.Input<string | undefined>; /** * The ID of the user that will be added to the group * * > **Note** You must specify at least one: `applicationId` and/or `userId`. */ userId?: pulumi.Input<string | undefined>; } /** * The set of arguments for constructing a IamGroupMembership resource. */ export interface IamGroupMembershipArgs { /** * The ID of the application that will be added to the group. */ applicationId?: pulumi.Input<string | undefined>; /** * ID of the group to add members to. */ groupId: pulumi.Input<string>; /** * The ID of the user that will be added to the group * * > **Note** You must specify at least one: `applicationId` and/or `userId`. */ userId?: pulumi.Input<string | undefined>; } //# sourceMappingURL=iamGroupMembership.d.ts.map