UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

142 lines (141 loc) 5.33 kB
import * as pulumi from "@pulumi/pulumi"; /** * Manages a Role assignment within group on HuaweiCloud IAM Service. * * > **NOTE:** 1. You *must* have admin privileges to use this resource. * <br/>2. When the resource is created, the permissions will take effect after 15 to 30 minutes. * * ## Example Usage * ### Assign Role On Project Level * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as huaweicloud from "@pulumi/huaweicloud"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const role1 = huaweicloud.Iam.getRole({ * name: "rds_adm", * }); * const group1 = new huaweicloud.iam.Group("group1", {}); * const roleAssignment1 = new huaweicloud.iam.RoleAssignment("roleAssignment1", { * roleId: role1.then(role1 => role1.id), * groupId: group1.id, * projectId: _var.project_id, * }); * ``` * ### Assign Role On Domain Level * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as huaweicloud from "@pulumi/huaweicloud"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const role1 = huaweicloud.Iam.getRole({ * name: "secu_admin", * }); * const group1 = new huaweicloud.iam.Group("group1", {}); * const roleAssignment1 = new huaweicloud.iam.RoleAssignment("roleAssignment1", { * roleId: role1.then(role1 => role1.id), * groupId: group1.id, * domainId: _var.domain_id, * }); * ``` */ export declare class RoleAssignment extends pulumi.CustomResource { /** * Get an existing RoleAssignment 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?: RoleAssignmentState, opts?: pulumi.CustomResourceOptions): RoleAssignment; /** * Returns true if the given object is an instance of RoleAssignment. 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 RoleAssignment; /** * Specifies the domain to assign the role in. * Required if `projectId` is empty. Changing this parameter will create a new resource. */ readonly domainId: pulumi.Output<string | undefined>; readonly enterpriseProjectId: pulumi.Output<string | undefined>; /** * Specifies the group to assign the role to. * Changing this parameter will create a new resource. */ readonly groupId: pulumi.Output<string>; /** * Specifies the project to assign the role in. * Required if `domainId` is empty. Changing this parameter will create a new resource. */ readonly projectId: pulumi.Output<string | undefined>; /** * Specifies the role to assign. * Changing this parameter will create a new resource. */ readonly roleId: pulumi.Output<string>; /** * Create a RoleAssignment 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: RoleAssignmentArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering RoleAssignment resources. */ export interface RoleAssignmentState { /** * Specifies the domain to assign the role in. * Required if `projectId` is empty. Changing this parameter will create a new resource. */ domainId?: pulumi.Input<string>; enterpriseProjectId?: pulumi.Input<string>; /** * Specifies the group to assign the role to. * Changing this parameter will create a new resource. */ groupId?: pulumi.Input<string>; /** * Specifies the project to assign the role in. * Required if `domainId` is empty. Changing this parameter will create a new resource. */ projectId?: pulumi.Input<string>; /** * Specifies the role to assign. * Changing this parameter will create a new resource. */ roleId?: pulumi.Input<string>; } /** * The set of arguments for constructing a RoleAssignment resource. */ export interface RoleAssignmentArgs { /** * Specifies the domain to assign the role in. * Required if `projectId` is empty. Changing this parameter will create a new resource. */ domainId?: pulumi.Input<string>; enterpriseProjectId?: pulumi.Input<string>; /** * Specifies the group to assign the role to. * Changing this parameter will create a new resource. */ groupId: pulumi.Input<string>; /** * Specifies the project to assign the role in. * Required if `domainId` is empty. Changing this parameter will create a new resource. */ projectId?: pulumi.Input<string>; /** * Specifies the role to assign. * Changing this parameter will create a new resource. */ roleId: pulumi.Input<string>; }