@pulumi/azuread
Version:
A Pulumi package for creating and managing Azure Active Directory (Azure AD) cloud resources.
105 lines (104 loc) • 4.77 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Manages a single group membership within Azure Active Directory.
*
* > **Warning** Do not use this resource at the same time as the `members` property of the `azuread.Group` resource for the same group. Doing so will cause a conflict and group members will be removed.
*
* ## API Permissions
*
* The following API permissions are required in order to use this resource.
*
* When authenticated with a service principal, this resource requires one of the following application roles: `Group.ReadWrite.All` or `Directory.ReadWrite.All`.
*
* However, if the authenticated service principal is an owner of the group being managed, an application role is not required.
*
* When authenticated with a user principal, this resource requires one of the following directory roles: `Groups Administrator`, `User Administrator` or `Global Administrator`
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azuread from "@pulumi/azuread";
*
* const example = azuread.getUser({
* userPrincipalName: "jdoe@example.com",
* });
* const exampleGroup = new azuread.Group("example", {
* displayName: "my_group",
* securityEnabled: true,
* });
* const exampleGroupMember = new azuread.GroupMember("example", {
* groupObjectId: exampleGroup.objectId,
* memberObjectId: example.then(example => example.objectId),
* });
* ```
*
* ## Import
*
* Group members can be imported using the object ID of the group and the object ID of the member, e.g.
*
* ```sh
* $ pulumi import azuread:index/groupMember:GroupMember example 00000000-0000-0000-0000-000000000000/member/11111111-1111-1111-1111-111111111111
* ```
*
* -> This ID format is unique to Terraform and is composed of the Azure AD Group Object ID and the target Member Object ID in the format `{GroupObjectID}/member/{MemberObjectID}`.
*/
export declare class GroupMember extends pulumi.CustomResource {
/**
* Get an existing GroupMember 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?: GroupMemberState, opts?: pulumi.CustomResourceOptions): GroupMember;
/**
* Returns true if the given object is an instance of GroupMember. 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 GroupMember;
/**
* The object ID of the group you want to add the member to. Changing this forces a new resource to be created.
*/
readonly groupObjectId: pulumi.Output<string>;
/**
* The object ID of the principal you want to add as a member to the group. Supported object types are Users, Groups or Service Principals. Changing this forces a new resource to be created.
*/
readonly memberObjectId: pulumi.Output<string>;
/**
* Create a GroupMember 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: GroupMemberArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering GroupMember resources.
*/
export interface GroupMemberState {
/**
* The object ID of the group you want to add the member to. Changing this forces a new resource to be created.
*/
groupObjectId?: pulumi.Input<string>;
/**
* The object ID of the principal you want to add as a member to the group. Supported object types are Users, Groups or Service Principals. Changing this forces a new resource to be created.
*/
memberObjectId?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a GroupMember resource.
*/
export interface GroupMemberArgs {
/**
* The object ID of the group you want to add the member to. Changing this forces a new resource to be created.
*/
groupObjectId: pulumi.Input<string>;
/**
* The object ID of the principal you want to add as a member to the group. Supported object types are Users, Groups or Service Principals. Changing this forces a new resource to be created.
*/
memberObjectId: pulumi.Input<string>;
}