UNPKG

@volcengine/pulumi

Version:

A Pulumi package for creating and managing volcengine cloud resources.

213 lines (212 loc) 8.57 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Provides a resource to manage rds mysql account * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as volcengine from "@pulumi/volcengine"; * import * as volcengine from "@volcengine/pulumi"; * * const fooZones = volcengine.ecs.getZones({}); * const fooVpc = new volcengine.vpc.Vpc("fooVpc", { * vpcName: "acc-test-vpc", * cidrBlock: "172.16.0.0/16", * }); * const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", { * subnetName: "acc-test-subnet", * cidrBlock: "172.16.0.0/24", * zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id), * vpcId: fooVpc.id, * }); * const fooInstance = new volcengine.rds_mysql.Instance("fooInstance", { * instanceName: "acc-test-rds-mysql", * dbEngineVersion: "MySQL_5_7", * nodeSpec: "rds.mysql.1c2g", * primaryZoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id), * secondaryZoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id), * storageSpace: 80, * subnetId: fooSubnet.id, * lowerCaseTableNames: "1", * chargeInfo: { * chargeType: "PostPaid", * }, * parameters: [ * { * parameterName: "auto_increment_increment", * parameterValue: "2", * }, * { * parameterName: "auto_increment_offset", * parameterValue: "4", * }, * ], * }); * const foo1 = new volcengine.rds_mysql.Database("foo1", { * dbName: "acc-test-db1", * instanceId: fooInstance.id, * }); * const fooDatabase = new volcengine.rds_mysql.Database("fooDatabase", { * dbName: "acc-test-db", * instanceId: fooInstance.id, * }); * const fooAccount = new volcengine.rds_mysql.Account("fooAccount", { * accountName: "acc-test-account", * accountPassword: "93f0cb0614Aab12", * accountType: "Normal", * instanceId: fooInstance.id, * accountPrivileges: [ * { * dbName: fooDatabase.dbName, * accountPrivilege: "Custom", * accountPrivilegeDetail: "SELECT,INSERT,UPDATE", * }, * { * dbName: foo1.dbName, * accountPrivilege: "DDLOnly", * }, * ], * }); * ``` * * ## Import * * RDS mysql account can be imported using the instance_id:account_name, e.g. * * ```sh * $ pulumi import volcengine:rds_mysql/account:Account default mysql-42b38c769c4b:test * ``` */ export declare class Account extends pulumi.CustomResource { /** * Get an existing Account 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?: AccountState, opts?: pulumi.CustomResourceOptions): Account; /** * Returns true if the given object is an instance of Account. 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 Account; /** * Database account name. The rules are as follows: * Unique name. * Start with a letter and end with a letter or number. * Consists of lowercase letters, numbers, or underscores (_). * The length is 2~32 characters. * The [keyword list](https://www.volcengine.com/docs/6313/66162) is disabled for database accounts, and certain reserved words, including root, admin, etc., cannot be used. */ readonly accountName: pulumi.Output<string>; /** * The password of the database account. * Illustrate: * Cannot start with `!` or `@`. * The length is 8~32 characters. * It consists of any three of uppercase letters, lowercase letters, numbers, and special characters. * The special characters are `!@#$%^*()_+-=`. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignoreChanges ignore changes in fields. */ readonly accountPassword: pulumi.Output<string>; /** * The privilege information of account. */ readonly accountPrivileges: pulumi.Output<outputs.rds_mysql.AccountAccountPrivilege[] | undefined>; /** * Database account type, value: * Super: A high-privilege account. Only one database account can be created for an instance. * Normal: An account with ordinary privileges. */ readonly accountType: pulumi.Output<string>; /** * The ID of the RDS instance. */ readonly instanceId: pulumi.Output<string>; /** * Create a Account 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: AccountArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Account resources. */ export interface AccountState { /** * Database account name. The rules are as follows: * Unique name. * Start with a letter and end with a letter or number. * Consists of lowercase letters, numbers, or underscores (_). * The length is 2~32 characters. * The [keyword list](https://www.volcengine.com/docs/6313/66162) is disabled for database accounts, and certain reserved words, including root, admin, etc., cannot be used. */ accountName?: pulumi.Input<string>; /** * The password of the database account. * Illustrate: * Cannot start with `!` or `@`. * The length is 8~32 characters. * It consists of any three of uppercase letters, lowercase letters, numbers, and special characters. * The special characters are `!@#$%^*()_+-=`. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignoreChanges ignore changes in fields. */ accountPassword?: pulumi.Input<string>; /** * The privilege information of account. */ accountPrivileges?: pulumi.Input<pulumi.Input<inputs.rds_mysql.AccountAccountPrivilege>[]>; /** * Database account type, value: * Super: A high-privilege account. Only one database account can be created for an instance. * Normal: An account with ordinary privileges. */ accountType?: pulumi.Input<string>; /** * The ID of the RDS instance. */ instanceId?: pulumi.Input<string>; } /** * The set of arguments for constructing a Account resource. */ export interface AccountArgs { /** * Database account name. The rules are as follows: * Unique name. * Start with a letter and end with a letter or number. * Consists of lowercase letters, numbers, or underscores (_). * The length is 2~32 characters. * The [keyword list](https://www.volcengine.com/docs/6313/66162) is disabled for database accounts, and certain reserved words, including root, admin, etc., cannot be used. */ accountName: pulumi.Input<string>; /** * The password of the database account. * Illustrate: * Cannot start with `!` or `@`. * The length is 8~32 characters. * It consists of any three of uppercase letters, lowercase letters, numbers, and special characters. * The special characters are `!@#$%^*()_+-=`. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignoreChanges ignore changes in fields. */ accountPassword: pulumi.Input<string>; /** * The privilege information of account. */ accountPrivileges?: pulumi.Input<pulumi.Input<inputs.rds_mysql.AccountAccountPrivilege>[]>; /** * Database account type, value: * Super: A high-privilege account. Only one database account can be created for an instance. * Normal: An account with ordinary privileges. */ accountType: pulumi.Input<string>; /** * The ID of the RDS instance. */ instanceId: pulumi.Input<string>; }