UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

199 lines (198 loc) 8.03 kB
import * as pulumi from "@pulumi/pulumi"; import { input as inputs, output as outputs } from "../types"; /** * Manages a DDS database user resource within HuaweiCloud. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const instanceId = config.requireObject("instanceId"); * const userName = config.requireObject("userName"); * const userPassword = config.requireObject("userPassword"); * const ownedRoleName = config.requireObject("ownedRoleName"); * const ownedRoleDbName = config.requireObject("ownedRoleDbName"); * const test = new huaweicloud.dds.DatabaseUser("test", { * instanceId: instanceId, * password: userPassword, * dbName: _var.db_name, * roles: [{ * name: ownedRoleName, * dbName: ownedRoleDbName, * }], * }); * ``` * * ## Import * * DDS database user can be imported using the `instance_id`, `db_name` and `name` separated by slashes (/), e.g. bash * * ```sh * $ pulumi import huaweicloud:Dds/databaseUser:DatabaseUser test <instance_id>/<db_name>/<name> * ``` * * Note that the imported state may not be identical to your resource definition, due to some attributes missing from the API response. The missing attributes include`password`. It is generally recommended running `terraform plan` after importing a DDS database user. You can then decide if changes should be applied to the DDS database user, or the resource definition should be updated to align with the DDS database user. Also you can ignore changes as below. hcl resource "huaweicloud_dds_database_user" "test" { * * ... * * lifecycle { * * ignore_changes = [ * * password, * * ] * * } } */ export declare class DatabaseUser extends pulumi.CustomResource { /** * Get an existing DatabaseUser 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?: DatabaseUserState, opts?: pulumi.CustomResourceOptions): DatabaseUser; /** * Returns true if the given object is an instance of DatabaseUser. 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 DatabaseUser; /** * Specifies the database name to which this owned role belongs. * Changing this parameter will create a new user. */ readonly dbName: pulumi.Output<string>; /** * The list of database privileges owned by the current user, includes all privileges * inherited by owned roles. The inheritedPrivileges structure is documented below. */ readonly inheritedPrivileges: pulumi.Output<outputs.Dds.DatabaseUserInheritedPrivilege[]>; /** * Specifies the DDS instance ID to which the user belongs. * Changing this parameter will create a new user. */ readonly instanceId: pulumi.Output<string>; /** * Specifies the name of role owned by the current user. * The name can contain `1` to `64` characters, only letters, digits, underscores (_), hyphens (-) and dots (.) are * allowed. Changing this parameter will create a new user. */ readonly name: pulumi.Output<string>; /** * Specifies the user password. * The password content must meet the following conditions: */ readonly password: pulumi.Output<string>; /** * The list of database privileges owned by the current user. * The privileges structure is documented below. */ readonly privileges: pulumi.Output<outputs.Dds.DatabaseUserPrivilege[]>; /** * Specifies the region where the DDS instance is located. * Changing this parameter will create a new user. */ readonly region: pulumi.Output<string>; /** * Specifies the list of roles owned by the current user. * The roles structure is documented below. Changing this parameter will create a new user. */ readonly roles: pulumi.Output<outputs.Dds.DatabaseUserRole[]>; /** * Create a DatabaseUser 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: DatabaseUserArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering DatabaseUser resources. */ export interface DatabaseUserState { /** * Specifies the database name to which this owned role belongs. * Changing this parameter will create a new user. */ dbName?: pulumi.Input<string>; /** * The list of database privileges owned by the current user, includes all privileges * inherited by owned roles. The inheritedPrivileges structure is documented below. */ inheritedPrivileges?: pulumi.Input<pulumi.Input<inputs.Dds.DatabaseUserInheritedPrivilege>[]>; /** * Specifies the DDS instance ID to which the user belongs. * Changing this parameter will create a new user. */ instanceId?: pulumi.Input<string>; /** * Specifies the name of role owned by the current user. * The name can contain `1` to `64` characters, only letters, digits, underscores (_), hyphens (-) and dots (.) are * allowed. Changing this parameter will create a new user. */ name?: pulumi.Input<string>; /** * Specifies the user password. * The password content must meet the following conditions: */ password?: pulumi.Input<string>; /** * The list of database privileges owned by the current user. * The privileges structure is documented below. */ privileges?: pulumi.Input<pulumi.Input<inputs.Dds.DatabaseUserPrivilege>[]>; /** * Specifies the region where the DDS instance is located. * Changing this parameter will create a new user. */ region?: pulumi.Input<string>; /** * Specifies the list of roles owned by the current user. * The roles structure is documented below. Changing this parameter will create a new user. */ roles?: pulumi.Input<pulumi.Input<inputs.Dds.DatabaseUserRole>[]>; } /** * The set of arguments for constructing a DatabaseUser resource. */ export interface DatabaseUserArgs { /** * Specifies the database name to which this owned role belongs. * Changing this parameter will create a new user. */ dbName: pulumi.Input<string>; /** * Specifies the DDS instance ID to which the user belongs. * Changing this parameter will create a new user. */ instanceId: pulumi.Input<string>; /** * Specifies the name of role owned by the current user. * The name can contain `1` to `64` characters, only letters, digits, underscores (_), hyphens (-) and dots (.) are * allowed. Changing this parameter will create a new user. */ name?: pulumi.Input<string>; /** * Specifies the user password. * The password content must meet the following conditions: */ password: pulumi.Input<string>; /** * Specifies the region where the DDS instance is located. * Changing this parameter will create a new user. */ region?: pulumi.Input<string>; /** * Specifies the list of roles owned by the current user. * The roles structure is documented below. Changing this parameter will create a new user. */ roles: pulumi.Input<pulumi.Input<inputs.Dds.DatabaseUserRole>[]>; }