@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
177 lines (176 loc) • 7.87 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Manages the usage permissions of those resources: `huaweicloud.Dli.Queue`, `huaweicloud.Dli.Database`,
* `huaweicloud.Dli.Table`, `huaweicloud.Dli.Package`, `huaweicloud.Dli.FlinksqlJob`, `huaweicloud.Dli.FlinkjarJob`
* within HuaweiCloud DLI.
*
* ## Example Usage
* ### Grant a permission of queue
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const userName = config.requireObject("userName");
* const queueName = config.requireObject("queueName");
* const test = new huaweicloud.dli.Permission("test", {
* userName: userName,
* object: `queues.${queueName}`,
* privileges: [
* "SUBMIT_JOB",
* "DROP_QUEUE",
* ],
* });
* ```
* ### Grant a permission of database
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const userName = config.requireObject("userName");
* const databaseName = config.requireObject("databaseName");
* const test = new huaweicloud.dli.Permission("test", {
* userName: userName,
* object: `databases.${databaseName}`,
* privileges: ["SELECT"],
* });
* ```
*
* ## Import
*
* The permission can be imported by `id`, it is composed of `object` and `user_name`, separated by a slash. e.g.bash
*
* ```sh
* $ pulumi import huaweicloud:Dli/permission:Permission test databases.database_name/user_name
* ```
*/
export declare class Permission extends pulumi.CustomResource {
/**
* Get an existing Permission 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?: PermissionState, opts?: pulumi.CustomResourceOptions): Permission;
/**
* Returns true if the given object is an instance of Permission. 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 Permission;
/**
* Whether this user is an administrator.
*/
readonly isAdmin: pulumi.Output<boolean>;
/**
* Specifies which object's data usage permissions will be shared.
* Its naming format is as follows:
* + **queues.`queuesName`**: the usage permissions of queue.
* + **databases.`databaseName`**: the usage permissions of data in the database.
* + **databases.`databaseName`.tables.`tableName`**: the usage permissions of data in the table.
* + **databases.`databaseName`.tables.`tableName`.columns.`columnName`**: the usage permissions of data in the column.
* + **jobs.flink.`flinkJobId`**: the usage permissions of data in the flink job.
* + **groups.`packageGroupName`**: the usage permissions of data in the package group.
* + **resources.`packageName`**: the usage permissions of data in the package.
*/
readonly object: pulumi.Output<string>;
/**
* Specifies the usage permissions of data.
* + **Permissions on Queue, Database and Table**,
* please see [Permissions Management](https://support.huaweicloud.com/intl/en-us/productdesc-dli/dli_07_0006.html)
*/
readonly privileges: pulumi.Output<string[]>;
/**
* The region in which to create the DLI permission resource. If omitted, the
* provider-level region will be used. Changing this parameter will create a new resource.
*/
readonly region: pulumi.Output<string>;
/**
* Specifies name of the user who is granted with usage permission.
* Changing this parameter will create a new resource.
*/
readonly userName: pulumi.Output<string>;
/**
* Create a Permission 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: PermissionArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Permission resources.
*/
export interface PermissionState {
/**
* Whether this user is an administrator.
*/
isAdmin?: pulumi.Input<boolean>;
/**
* Specifies which object's data usage permissions will be shared.
* Its naming format is as follows:
* + **queues.`queuesName`**: the usage permissions of queue.
* + **databases.`databaseName`**: the usage permissions of data in the database.
* + **databases.`databaseName`.tables.`tableName`**: the usage permissions of data in the table.
* + **databases.`databaseName`.tables.`tableName`.columns.`columnName`**: the usage permissions of data in the column.
* + **jobs.flink.`flinkJobId`**: the usage permissions of data in the flink job.
* + **groups.`packageGroupName`**: the usage permissions of data in the package group.
* + **resources.`packageName`**: the usage permissions of data in the package.
*/
object?: pulumi.Input<string>;
/**
* Specifies the usage permissions of data.
* + **Permissions on Queue, Database and Table**,
* please see [Permissions Management](https://support.huaweicloud.com/intl/en-us/productdesc-dli/dli_07_0006.html)
*/
privileges?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The region in which to create the DLI permission resource. If omitted, the
* provider-level region will be used. Changing this parameter will create a new resource.
*/
region?: pulumi.Input<string>;
/**
* Specifies name of the user who is granted with usage permission.
* Changing this parameter will create a new resource.
*/
userName?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Permission resource.
*/
export interface PermissionArgs {
/**
* Specifies which object's data usage permissions will be shared.
* Its naming format is as follows:
* + **queues.`queuesName`**: the usage permissions of queue.
* + **databases.`databaseName`**: the usage permissions of data in the database.
* + **databases.`databaseName`.tables.`tableName`**: the usage permissions of data in the table.
* + **databases.`databaseName`.tables.`tableName`.columns.`columnName`**: the usage permissions of data in the column.
* + **jobs.flink.`flinkJobId`**: the usage permissions of data in the flink job.
* + **groups.`packageGroupName`**: the usage permissions of data in the package group.
* + **resources.`packageName`**: the usage permissions of data in the package.
*/
object: pulumi.Input<string>;
/**
* Specifies the usage permissions of data.
* + **Permissions on Queue, Database and Table**,
* please see [Permissions Management](https://support.huaweicloud.com/intl/en-us/productdesc-dli/dli_07_0006.html)
*/
privileges: pulumi.Input<pulumi.Input<string>[]>;
/**
* The region in which to create the DLI permission resource. If omitted, the
* provider-level region will be used. Changing this parameter will create a new resource.
*/
region?: pulumi.Input<string>;
/**
* Specifies name of the user who is granted with usage permission.
* Changing this parameter will create a new resource.
*/
userName: pulumi.Input<string>;
}