@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
263 lines (262 loc) • 13.2 kB
TypeScript
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,
* });
* //instance_id = "mysql-b51d37110dd1"
* 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",
* },
* ],
* host: "192.10.10.%",
* });
* // table_column_privileges {
* // db_name = volcengine_rds_mysql_database.foo.db_name
* // table_privileges {
* // table_name = "test"
* // account_privilege_detail = "SELECT,INSERT,UPDATE"
* // }
* // column_privileges {
* // table_name = "test"
* // column_name = "test"
* // account_privilege_detail = "SELECT,INSERT,UPDATE"
* // }
* // }
* ```
*
* ## 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;
/**
* Account information description. The length should not exceed 256 characters.
*/
readonly accountDesc: pulumi.Output<string | undefined>;
/**
* 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. Due to differences in the return structure of the query interface, it is necessary to use lifecycleIgnore to suppress changes when creating Global permissions.
*/
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>;
/**
* Specify the IP address for the account to access the database. The default value is %. If the Host is specified as %, the account is allowed to access the database from any IP address. Wildcards are supported for setting the IP address range that can access the database. For example, if the Host is specified as 192.10.10.%, it means the account can access the database from IP addresses between 192.10.10.0 and 192.10.10.255. The specified Host needs to be added to the whitelist bound to the instance, otherwise the instance cannot be accessed normally. The ModifyAllowList interface can be called to add the Host to the whitelist. Note: If the created account type is a high-privilege account, the host IP can only be specified as %. That is, when the value of AccountType is Super, the value of Host can only be %.
*/
readonly host: pulumi.Output<string>;
/**
* The ID of the RDS instance.
*/
readonly instanceId: pulumi.Output<string>;
/**
* Settings for table column permissions of the account.
*/
readonly tableColumnPrivileges: pulumi.Output<outputs.rds_mysql.AccountTableColumnPrivilege[] | undefined>;
/**
* 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 {
/**
* Account information description. The length should not exceed 256 characters.
*/
accountDesc?: pulumi.Input<string>;
/**
* 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. Due to differences in the return structure of the query interface, it is necessary to use lifecycleIgnore to suppress changes when creating Global permissions.
*/
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>;
/**
* Specify the IP address for the account to access the database. The default value is %. If the Host is specified as %, the account is allowed to access the database from any IP address. Wildcards are supported for setting the IP address range that can access the database. For example, if the Host is specified as 192.10.10.%, it means the account can access the database from IP addresses between 192.10.10.0 and 192.10.10.255. The specified Host needs to be added to the whitelist bound to the instance, otherwise the instance cannot be accessed normally. The ModifyAllowList interface can be called to add the Host to the whitelist. Note: If the created account type is a high-privilege account, the host IP can only be specified as %. That is, when the value of AccountType is Super, the value of Host can only be %.
*/
host?: pulumi.Input<string>;
/**
* The ID of the RDS instance.
*/
instanceId?: pulumi.Input<string>;
/**
* Settings for table column permissions of the account.
*/
tableColumnPrivileges?: pulumi.Input<pulumi.Input<inputs.rds_mysql.AccountTableColumnPrivilege>[]>;
}
/**
* The set of arguments for constructing a Account resource.
*/
export interface AccountArgs {
/**
* Account information description. The length should not exceed 256 characters.
*/
accountDesc?: pulumi.Input<string>;
/**
* 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. Due to differences in the return structure of the query interface, it is necessary to use lifecycleIgnore to suppress changes when creating Global permissions.
*/
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>;
/**
* Specify the IP address for the account to access the database. The default value is %. If the Host is specified as %, the account is allowed to access the database from any IP address. Wildcards are supported for setting the IP address range that can access the database. For example, if the Host is specified as 192.10.10.%, it means the account can access the database from IP addresses between 192.10.10.0 and 192.10.10.255. The specified Host needs to be added to the whitelist bound to the instance, otherwise the instance cannot be accessed normally. The ModifyAllowList interface can be called to add the Host to the whitelist. Note: If the created account type is a high-privilege account, the host IP can only be specified as %. That is, when the value of AccountType is Super, the value of Host can only be %.
*/
host?: pulumi.Input<string>;
/**
* The ID of the RDS instance.
*/
instanceId: pulumi.Input<string>;
/**
* Settings for table column permissions of the account.
*/
tableColumnPrivileges?: pulumi.Input<pulumi.Input<inputs.rds_mysql.AccountTableColumnPrivilege>[]>;
}