@pulumiverse/scaleway
Version:
A Pulumi package for creating and managing Scaleway cloud resources.
144 lines • 5.07 kB
TypeScript
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:iam/groupMembership:GroupMembership app 11111111-1111-1111-1111-111111111111/app/11111111-1111-1111-1111-111111111111
* ```
*/
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<pulumi.ID>, 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;
/**
* 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 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 {
/**
* 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 GroupMembership resource.
*/
export interface GroupMembershipArgs {
/**
* 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=groupMembership.d.ts.map