@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
100 lines (99 loc) • 3.54 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Provides a resource for adding an IAM User to IAM Groups. This
* resource can be used multiple times with the same user for non-overlapping
* groups.
*
* To exclusively manage the users in a group, see the
* `aws.iam.GroupMembership` resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const user1 = new aws.iam.User("user1", {name: "user1"});
* const group1 = new aws.iam.Group("group1", {name: "group1"});
* const group2 = new aws.iam.Group("group2", {name: "group2"});
* const example1 = new aws.iam.UserGroupMembership("example1", {
* user: user1.name,
* groups: [
* group1.name,
* group2.name,
* ],
* });
* const group3 = new aws.iam.Group("group3", {name: "group3"});
* const example2 = new aws.iam.UserGroupMembership("example2", {
* user: user1.name,
* groups: [group3.name],
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import IAM user group membership using the user name and group names separated by `/`. For example:
*
* ```sh
* $ pulumi import aws:iam/userGroupMembership:UserGroupMembership example1 user1/group1/group2
* ```
*/
export declare class UserGroupMembership extends pulumi.CustomResource {
/**
* Get an existing UserGroupMembership 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?: UserGroupMembershipState, opts?: pulumi.CustomResourceOptions): UserGroupMembership;
/**
* Returns true if the given object is an instance of UserGroupMembership. 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 UserGroupMembership;
/**
* A list of IAM Groups to add the user to
*/
readonly groups: pulumi.Output<string[]>;
/**
* The name of the IAM User to add to groups
*/
readonly user: pulumi.Output<string>;
/**
* Create a UserGroupMembership 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: UserGroupMembershipArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering UserGroupMembership resources.
*/
export interface UserGroupMembershipState {
/**
* A list of IAM Groups to add the user to
*/
groups?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The name of the IAM User to add to groups
*/
user?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a UserGroupMembership resource.
*/
export interface UserGroupMembershipArgs {
/**
* A list of IAM Groups to add the user to
*/
groups: pulumi.Input<pulumi.Input<string>[]>;
/**
* The name of the IAM User to add to groups
*/
user: pulumi.Input<string>;
}