@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
149 lines (148 loc) • 4.83 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Manages a **Custom Policy** resource within HuaweiCloud IAM service.
*
* ->**Note** You *must* have admin privileges to use this resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as huaweicloud from "@pulumi/huaweicloud";
*
* const role1 = new huaweicloud.Iam.Role("role1", {
* description: "created by terraform",
* policy: `{
* "Version": "1.1",
* "Statement": [
* {
* "Action": [
* "obs:bucket:GetBucketAcl"
* ],
* "Effect": "Allow",
* "Resource": [
* "obs:*:*:bucket:*"
* ],
* "Condition": {
* "StringStartWith": {
* "g:ProjectName": [
* "cn-north-4"
* ]
* }
* }
* }
* ]
* }
* `,
* type: "AX",
* });
* ```
*
* ## Import
*
* IAM custom policies can be imported using the `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Iam/role:Role role1 89c60255-9bd6-460c-822a-e2b959ede9d2
* ```
*/
export declare class Role extends pulumi.CustomResource {
/**
* Get an existing Role 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?: RoleState, opts?: pulumi.CustomResourceOptions): Role;
/**
* Returns true if the given object is an instance of Role. 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 Role;
/**
* Specifies the description of the custom policy.
*/
readonly description: pulumi.Output<string>;
/**
* Specifies the name of the custom policy.
*/
readonly name: pulumi.Output<string>;
/**
* Specifies the content of the custom policy in JSON format. For more details,
* please refer to the [official document](https://support.huaweicloud.com/intl/en-us/usermanual-iam/iam_01_0017.html).
*/
readonly policy: pulumi.Output<string>;
/**
* The number of references.
*/
readonly references: pulumi.Output<number>;
/**
* Specifies the display mode of the custom policy. Valid options are as follows:
* + **AX**: the global service project.
* + **XA**: region-specific projects.
*/
readonly type: pulumi.Output<string>;
/**
* Create a Role 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: RoleArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Role resources.
*/
export interface RoleState {
/**
* Specifies the description of the custom policy.
*/
description?: pulumi.Input<string>;
/**
* Specifies the name of the custom policy.
*/
name?: pulumi.Input<string>;
/**
* Specifies the content of the custom policy in JSON format. For more details,
* please refer to the [official document](https://support.huaweicloud.com/intl/en-us/usermanual-iam/iam_01_0017.html).
*/
policy?: pulumi.Input<string>;
/**
* The number of references.
*/
references?: pulumi.Input<number>;
/**
* Specifies the display mode of the custom policy. Valid options are as follows:
* + **AX**: the global service project.
* + **XA**: region-specific projects.
*/
type?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Role resource.
*/
export interface RoleArgs {
/**
* Specifies the description of the custom policy.
*/
description: pulumi.Input<string>;
/**
* Specifies the name of the custom policy.
*/
name?: pulumi.Input<string>;
/**
* Specifies the content of the custom policy in JSON format. For more details,
* please refer to the [official document](https://support.huaweicloud.com/intl/en-us/usermanual-iam/iam_01_0017.html).
*/
policy: pulumi.Input<string>;
/**
* Specifies the display mode of the custom policy. Valid options are as follows:
* + **AX**: the global service project.
* + **XA**: region-specific projects.
*/
type: pulumi.Input<string>;
}