UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

178 lines (177 loc) 7.56 kB
import * as pulumi from "@pulumi/pulumi"; import { input as inputs, output as outputs } from "../types"; /** * Manages RDS PostgreSQL account 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 accountPassword = config.requireObject("accountPassword"); * const test = new huaweicloud.rds.PgAccount("test", { * instanceId: instanceId, * password: accountPassword, * }); * ``` * * ## Import * * The RDS PostgreSQL account can be imported using the `instance_id` and `name` separated by a slash, e.g. bash * * ```sh * $ pulumi import huaweicloud:Rds/pgAccount:PgAccount test <instance_id>/<name> * ``` * * Note that the imported state may not be identical to your resource definition, due to some attributes missing from the API response, security or some other reason. The missing attributes include`password`. It is generally recommended running `terraform plan` after importing the RDS PostgreSQL account. You can then decide if changes should be applied to the RDS PostgreSQL account, or the resource definition should be updated to align with the RDS PostgreSQL account. Also you can ignore changes as below. hcl resource "huaweicloud_rds_pg_account" "account_1" { * * ... * * lifecycle { * * ignore_changes = [ * * password * * ] * * } } */ export declare class PgAccount extends pulumi.CustomResource { /** * Get an existing PgAccount 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?: PgAccountState, opts?: pulumi.CustomResourceOptions): PgAccount; /** * Returns true if the given object is an instance of PgAccount. 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 PgAccount; /** * Indicates the permission attributes of a user. * The attributes structure is documented below. */ readonly attributes: pulumi.Output<outputs.Rds.PgAccountAttribute[]>; /** * Specifies the remarks of the DB account. The parameter must be 1 to 512 characters. */ readonly description: pulumi.Output<string | undefined>; /** * Specifies the ID of the RDS PostgreSQL instance. */ readonly instanceId: pulumi.Output<string>; /** * schema: Deprecated */ readonly memberofs: pulumi.Output<string[] | undefined>; /** * Specifies the username of the DB account. The username contains 1 to 63 * characters, including letters, digits, and underscores (_). It cannot start with pg or a digit and must be different * from system usernames. System users include **rdsAdmin**, **rdsMetric**, **rdsBackup**, **rdsRepl**, **rdsProxy**, * and **rdsDdm**. */ readonly name: pulumi.Output<string>; /** * Specifies the password of the DB account. The value must be 8 to 32 characters long * and contain at least three types of the following characters: uppercase letters, lowercase letters, digits, and special * characters (~!@#%^*-_=+?,). The value cannot contain the username or the username spelled backwards. */ readonly password: pulumi.Output<string>; /** * Specifies the region in which to create the resource. * If omitted, the provider-level region will be used. Changing this parameter will create a new resource. */ readonly region: pulumi.Output<string>; /** * Create a PgAccount 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: PgAccountArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering PgAccount resources. */ export interface PgAccountState { /** * Indicates the permission attributes of a user. * The attributes structure is documented below. */ attributes?: pulumi.Input<pulumi.Input<inputs.Rds.PgAccountAttribute>[]>; /** * Specifies the remarks of the DB account. The parameter must be 1 to 512 characters. */ description?: pulumi.Input<string>; /** * Specifies the ID of the RDS PostgreSQL instance. */ instanceId?: pulumi.Input<string>; /** * schema: Deprecated */ memberofs?: pulumi.Input<pulumi.Input<string>[]>; /** * Specifies the username of the DB account. The username contains 1 to 63 * characters, including letters, digits, and underscores (_). It cannot start with pg or a digit and must be different * from system usernames. System users include **rdsAdmin**, **rdsMetric**, **rdsBackup**, **rdsRepl**, **rdsProxy**, * and **rdsDdm**. */ name?: pulumi.Input<string>; /** * Specifies the password of the DB account. The value must be 8 to 32 characters long * and contain at least three types of the following characters: uppercase letters, lowercase letters, digits, and special * characters (~!@#%^*-_=+?,). The value cannot contain the username or the username spelled backwards. */ password?: pulumi.Input<string>; /** * Specifies the region in which to create the resource. * If omitted, the provider-level region will be used. Changing this parameter will create a new resource. */ region?: pulumi.Input<string>; } /** * The set of arguments for constructing a PgAccount resource. */ export interface PgAccountArgs { /** * Specifies the remarks of the DB account. The parameter must be 1 to 512 characters. */ description?: pulumi.Input<string>; /** * Specifies the ID of the RDS PostgreSQL instance. */ instanceId: pulumi.Input<string>; /** * schema: Deprecated */ memberofs?: pulumi.Input<pulumi.Input<string>[]>; /** * Specifies the username of the DB account. The username contains 1 to 63 * characters, including letters, digits, and underscores (_). It cannot start with pg or a digit and must be different * from system usernames. System users include **rdsAdmin**, **rdsMetric**, **rdsBackup**, **rdsRepl**, **rdsProxy**, * and **rdsDdm**. */ name?: pulumi.Input<string>; /** * Specifies the password of the DB account. The value must be 8 to 32 characters long * and contain at least three types of the following characters: uppercase letters, lowercase letters, digits, and special * characters (~!@#%^*-_=+?,). The value cannot contain the username or the username spelled backwards. */ password: pulumi.Input<string>; /** * Specifies the region in which to create the resource. * If omitted, the provider-level region will be used. Changing this parameter will create a new resource. */ region?: pulumi.Input<string>; }