UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

182 lines (181 loc) 8.22 kB
import * as pulumi from "@pulumi/pulumi"; /** * Manages RDS Mysql 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.MysqlAccount("test", { * instanceId: instanceId, * password: accountPassword, * }); * ``` * * ## Import * * RDS account can be imported using the `instance_id` and `name` separated by a slash, e.g.bash * * ```sh * $ pulumi import huaweicloud:Rds/mysqlAccount:MysqlAccount account_1 <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 Mysql account. You can then decide if changes should be applied to the RDS Mysql account, or the resource definition should be updated to align with the RDS Mysql account. Also you can ignore changes as below. hcl resource "huaweicloud_rds_mysql_account" "account_1" { * * ... * * lifecycle { * * ignore_changes = [ * * password * * ] * * } } */ export declare class MysqlAccount extends pulumi.CustomResource { /** * Get an existing MysqlAccount 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?: MysqlAccountState, opts?: pulumi.CustomResourceOptions): MysqlAccount; /** * Returns true if the given object is an instance of MysqlAccount. 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 MysqlAccount; /** * Specifies remarks of the database account. The parameter must be 1 to 512 * characters long and is supported only for MySQL 8.0.25 and later versions. */ readonly description: pulumi.Output<string | undefined>; /** * Specifies the IP addresses that are allowed to access your DB instance. * + If the IP address is set to %, all IP addresses are allowed to access your instance. * + If the IP address is set to 10.10.10.%, all IP addresses in the subnet 10.10.10.X are allowed to access * your instance. * + Multiple IP addresses can be added. */ readonly hosts: pulumi.Output<string[]>; /** * Specifies the rds instance id. Changing this will create a new resource. */ readonly instanceId: pulumi.Output<string>; /** * Specifies the username of the db account. Only lowercase letters, digits, * hyphens (-), and underscores (_) are allowed. Changing this will create a new resource. * + If the database version is MySQL 5.6, the username consists of 1 to 16 characters. * + If the database version is MySQL 5.7 or 8.0, the username consists of 1 to 32 characters. */ readonly name: pulumi.Output<string>; /** * Specifies the password of the db account. The parameter must be 8 to 32 characters * long and contain only letters(case-sensitive), digits, and special characters(~!@#$%^*-_=+?,()&). The value must be * different from `name` or `name` spelled backwards. */ readonly password: pulumi.Output<string>; /** * The region in which to create the rds account resource. If omitted, the * provider-level region will be used. Changing this creates a new resource. */ readonly region: pulumi.Output<string>; /** * Create a MysqlAccount 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: MysqlAccountArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering MysqlAccount resources. */ export interface MysqlAccountState { /** * Specifies remarks of the database account. The parameter must be 1 to 512 * characters long and is supported only for MySQL 8.0.25 and later versions. */ description?: pulumi.Input<string>; /** * Specifies the IP addresses that are allowed to access your DB instance. * + If the IP address is set to %, all IP addresses are allowed to access your instance. * + If the IP address is set to 10.10.10.%, all IP addresses in the subnet 10.10.10.X are allowed to access * your instance. * + Multiple IP addresses can be added. */ hosts?: pulumi.Input<pulumi.Input<string>[]>; /** * Specifies the rds instance id. Changing this will create a new resource. */ instanceId?: pulumi.Input<string>; /** * Specifies the username of the db account. Only lowercase letters, digits, * hyphens (-), and underscores (_) are allowed. Changing this will create a new resource. * + If the database version is MySQL 5.6, the username consists of 1 to 16 characters. * + If the database version is MySQL 5.7 or 8.0, the username consists of 1 to 32 characters. */ name?: pulumi.Input<string>; /** * Specifies the password of the db account. The parameter must be 8 to 32 characters * long and contain only letters(case-sensitive), digits, and special characters(~!@#$%^*-_=+?,()&). The value must be * different from `name` or `name` spelled backwards. */ password?: pulumi.Input<string>; /** * The region in which to create the rds account resource. If omitted, the * provider-level region will be used. Changing this creates a new resource. */ region?: pulumi.Input<string>; } /** * The set of arguments for constructing a MysqlAccount resource. */ export interface MysqlAccountArgs { /** * Specifies remarks of the database account. The parameter must be 1 to 512 * characters long and is supported only for MySQL 8.0.25 and later versions. */ description?: pulumi.Input<string>; /** * Specifies the IP addresses that are allowed to access your DB instance. * + If the IP address is set to %, all IP addresses are allowed to access your instance. * + If the IP address is set to 10.10.10.%, all IP addresses in the subnet 10.10.10.X are allowed to access * your instance. * + Multiple IP addresses can be added. */ hosts?: pulumi.Input<pulumi.Input<string>[]>; /** * Specifies the rds instance id. Changing this will create a new resource. */ instanceId: pulumi.Input<string>; /** * Specifies the username of the db account. Only lowercase letters, digits, * hyphens (-), and underscores (_) are allowed. Changing this will create a new resource. * + If the database version is MySQL 5.6, the username consists of 1 to 16 characters. * + If the database version is MySQL 5.7 or 8.0, the username consists of 1 to 32 characters. */ name?: pulumi.Input<string>; /** * Specifies the password of the db account. The parameter must be 8 to 32 characters * long and contain only letters(case-sensitive), digits, and special characters(~!@#$%^*-_=+?,()&). The value must be * different from `name` or `name` spelled backwards. */ password: pulumi.Input<string>; /** * The region in which to create the rds account resource. If omitted, the * provider-level region will be used. Changing this creates a new resource. */ region?: pulumi.Input<string>; }