published on Thursday, May 7, 2026 by Volcengine
published on Thursday, May 7, 2026 by Volcengine
Database
Example Usage
Example coming soon!
Example coming soon!
Example coming soon!
Example coming soon!
Example coming soon!
resources:
databaseDemo:
type: volcenginecc:rdsmysql:Database
name: DatabaseDemo
properties:
characterSetName: utf8
databasePrivileges:
- account_name: a***
account_privilege: ReadOnly
host: '%'
description: Demo Example
instanceId: mysql-779***
name: rdstest
Create Database Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Database(name: string, args: DatabaseArgs, opts?: CustomResourceOptions);@overload
def Database(resource_name: str,
args: DatabaseArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Database(resource_name: str,
opts: Optional[ResourceOptions] = None,
instance_id: Optional[str] = None,
name: Optional[str] = None,
character_set_name: Optional[str] = None,
database_privileges: Optional[Sequence[DatabaseDatabasePrivilegeArgs]] = None,
description: Optional[str] = None)func NewDatabase(ctx *Context, name string, args DatabaseArgs, opts ...ResourceOption) (*Database, error)public Database(string name, DatabaseArgs args, CustomResourceOptions? opts = null)
public Database(String name, DatabaseArgs args)
public Database(String name, DatabaseArgs args, CustomResourceOptions options)
type: volcenginecc:rdsmysql:Database
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args DatabaseArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args DatabaseArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args DatabaseArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DatabaseArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DatabaseArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var databaseResource = new Volcenginecc.Rdsmysql.Database("databaseResource", new()
{
InstanceId = "string",
Name = "string",
CharacterSetName = "string",
DatabasePrivileges = new[]
{
new Volcenginecc.Rdsmysql.Inputs.DatabaseDatabasePrivilegeArgs
{
AccountName = "string",
AccountPrivilege = "string",
Host = "string",
},
},
Description = "string",
});
example, err := rdsmysql.NewDatabase(ctx, "databaseResource", &rdsmysql.DatabaseArgs{
InstanceId: pulumi.String("string"),
Name: pulumi.String("string"),
CharacterSetName: pulumi.String("string"),
DatabasePrivileges: rdsmysql.DatabaseDatabasePrivilegeArray{
&rdsmysql.DatabaseDatabasePrivilegeArgs{
AccountName: pulumi.String("string"),
AccountPrivilege: pulumi.String("string"),
Host: pulumi.String("string"),
},
},
Description: pulumi.String("string"),
})
var databaseResource = new com.volcengine.volcenginecc.rdsmysql.Database("databaseResource", com.volcengine.volcenginecc.rdsmysql.DatabaseArgs.builder()
.instanceId("string")
.name("string")
.characterSetName("string")
.databasePrivileges(DatabaseDatabasePrivilegeArgs.builder()
.accountName("string")
.accountPrivilege("string")
.host("string")
.build())
.description("string")
.build());
database_resource = volcenginecc.rdsmysql.Database("databaseResource",
instance_id="string",
name="string",
character_set_name="string",
database_privileges=[{
"account_name": "string",
"account_privilege": "string",
"host": "string",
}],
description="string")
const databaseResource = new volcenginecc.rdsmysql.Database("databaseResource", {
instanceId: "string",
name: "string",
characterSetName: "string",
databasePrivileges: [{
accountName: "string",
accountPrivilege: "string",
host: "string",
}],
description: "string",
});
type: volcenginecc:rdsmysql:Database
properties:
characterSetName: string
databasePrivileges:
- accountName: string
accountPrivilege: string
host: string
description: string
instanceId: string
name: string
Database Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Database resource accepts the following input properties:
- Instance
Id string - Database instance ID.
- Name string
- Database name. Naming rules: must be unique; length must be 2–64 characters; must start with a letter and end with a letter or number; can contain letters, numbers, underscores (_), or hyphens (-); certain reserved words, such as root and admin, cannot be used.
- Character
Set stringName - Database character set. Supported character sets: utf8, utf8mb4 (default), latin1, ascii.
- Database
Privileges List<Volcengine.Database Database Privilege> - Description string
- Database description, up to 256 characters. This field is optional. If not set, or if set with a description length of 0, the description will be empty.
- Instance
Id string - Database instance ID.
- Name string
- Database name. Naming rules: must be unique; length must be 2–64 characters; must start with a letter and end with a letter or number; can contain letters, numbers, underscores (_), or hyphens (-); certain reserved words, such as root and admin, cannot be used.
- Character
Set stringName - Database character set. Supported character sets: utf8, utf8mb4 (default), latin1, ascii.
- Database
Privileges []DatabaseDatabase Privilege Args - Description string
- Database description, up to 256 characters. This field is optional. If not set, or if set with a description length of 0, the description will be empty.
- instance
Id String - Database instance ID.
- name String
- Database name. Naming rules: must be unique; length must be 2–64 characters; must start with a letter and end with a letter or number; can contain letters, numbers, underscores (_), or hyphens (-); certain reserved words, such as root and admin, cannot be used.
- character
Set StringName - Database character set. Supported character sets: utf8, utf8mb4 (default), latin1, ascii.
- database
Privileges List<DatabaseDatabase Privilege> - description String
- Database description, up to 256 characters. This field is optional. If not set, or if set with a description length of 0, the description will be empty.
- instance
Id string - Database instance ID.
- name string
- Database name. Naming rules: must be unique; length must be 2–64 characters; must start with a letter and end with a letter or number; can contain letters, numbers, underscores (_), or hyphens (-); certain reserved words, such as root and admin, cannot be used.
- character
Set stringName - Database character set. Supported character sets: utf8, utf8mb4 (default), latin1, ascii.
- database
Privileges DatabaseDatabase Privilege[] - description string
- Database description, up to 256 characters. This field is optional. If not set, or if set with a description length of 0, the description will be empty.
- instance_
id str - Database instance ID.
- name str
- Database name. Naming rules: must be unique; length must be 2–64 characters; must start with a letter and end with a letter or number; can contain letters, numbers, underscores (_), or hyphens (-); certain reserved words, such as root and admin, cannot be used.
- character_
set_ strname - Database character set. Supported character sets: utf8, utf8mb4 (default), latin1, ascii.
- database_
privileges Sequence[DatabaseDatabase Privilege Args] - description str
- Database description, up to 256 characters. This field is optional. If not set, or if set with a description length of 0, the description will be empty.
- instance
Id String - Database instance ID.
- name String
- Database name. Naming rules: must be unique; length must be 2–64 characters; must start with a letter and end with a letter or number; can contain letters, numbers, underscores (_), or hyphens (-); certain reserved words, such as root and admin, cannot be used.
- character
Set StringName - Database character set. Supported character sets: utf8, utf8mb4 (default), latin1, ascii.
- database
Privileges List<Property Map> - description String
- Database description, up to 256 characters. This field is optional. If not set, or if set with a description length of 0, the description will be empty.
Outputs
All input properties are implicitly available as output properties. Additionally, the Database resource produces the following output properties:
Look up Existing Database Resource
Get an existing Database resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: DatabaseState, opts?: CustomResourceOptions): Database@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
character_set_name: Optional[str] = None,
database_privileges: Optional[Sequence[DatabaseDatabasePrivilegeArgs]] = None,
description: Optional[str] = None,
instance_id: Optional[str] = None,
name: Optional[str] = None,
status: Optional[str] = None) -> Databasefunc GetDatabase(ctx *Context, name string, id IDInput, state *DatabaseState, opts ...ResourceOption) (*Database, error)public static Database Get(string name, Input<string> id, DatabaseState? state, CustomResourceOptions? opts = null)public static Database get(String name, Output<String> id, DatabaseState state, CustomResourceOptions options)resources: _: type: volcenginecc:rdsmysql:Database get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Character
Set stringName - Database character set. Supported character sets: utf8, utf8mb4 (default), latin1, ascii.
- Database
Privileges List<Volcengine.Database Database Privilege> - Description string
- Database description, up to 256 characters. This field is optional. If not set, or if set with a description length of 0, the description will be empty.
- Instance
Id string - Database instance ID.
- Name string
- Database name. Naming rules: must be unique; length must be 2–64 characters; must start with a letter and end with a letter or number; can contain letters, numbers, underscores (_), or hyphens (-); certain reserved words, such as root and admin, cannot be used.
- Status string
- Database status. Values: Unavailable (not available), Available (available).
- Character
Set stringName - Database character set. Supported character sets: utf8, utf8mb4 (default), latin1, ascii.
- Database
Privileges []DatabaseDatabase Privilege Args - Description string
- Database description, up to 256 characters. This field is optional. If not set, or if set with a description length of 0, the description will be empty.
- Instance
Id string - Database instance ID.
- Name string
- Database name. Naming rules: must be unique; length must be 2–64 characters; must start with a letter and end with a letter or number; can contain letters, numbers, underscores (_), or hyphens (-); certain reserved words, such as root and admin, cannot be used.
- Status string
- Database status. Values: Unavailable (not available), Available (available).
- character
Set StringName - Database character set. Supported character sets: utf8, utf8mb4 (default), latin1, ascii.
- database
Privileges List<DatabaseDatabase Privilege> - description String
- Database description, up to 256 characters. This field is optional. If not set, or if set with a description length of 0, the description will be empty.
- instance
Id String - Database instance ID.
- name String
- Database name. Naming rules: must be unique; length must be 2–64 characters; must start with a letter and end with a letter or number; can contain letters, numbers, underscores (_), or hyphens (-); certain reserved words, such as root and admin, cannot be used.
- status String
- Database status. Values: Unavailable (not available), Available (available).
- character
Set stringName - Database character set. Supported character sets: utf8, utf8mb4 (default), latin1, ascii.
- database
Privileges DatabaseDatabase Privilege[] - description string
- Database description, up to 256 characters. This field is optional. If not set, or if set with a description length of 0, the description will be empty.
- instance
Id string - Database instance ID.
- name string
- Database name. Naming rules: must be unique; length must be 2–64 characters; must start with a letter and end with a letter or number; can contain letters, numbers, underscores (_), or hyphens (-); certain reserved words, such as root and admin, cannot be used.
- status string
- Database status. Values: Unavailable (not available), Available (available).
- character_
set_ strname - Database character set. Supported character sets: utf8, utf8mb4 (default), latin1, ascii.
- database_
privileges Sequence[DatabaseDatabase Privilege Args] - description str
- Database description, up to 256 characters. This field is optional. If not set, or if set with a description length of 0, the description will be empty.
- instance_
id str - Database instance ID.
- name str
- Database name. Naming rules: must be unique; length must be 2–64 characters; must start with a letter and end with a letter or number; can contain letters, numbers, underscores (_), or hyphens (-); certain reserved words, such as root and admin, cannot be used.
- status str
- Database status. Values: Unavailable (not available), Available (available).
- character
Set StringName - Database character set. Supported character sets: utf8, utf8mb4 (default), latin1, ascii.
- database
Privileges List<Property Map> - description String
- Database description, up to 256 characters. This field is optional. If not set, or if set with a description length of 0, the description will be empty.
- instance
Id String - Database instance ID.
- name String
- Database name. Naming rules: must be unique; length must be 2–64 characters; must start with a letter and end with a letter or number; can contain letters, numbers, underscores (_), or hyphens (-); certain reserved words, such as root and admin, cannot be used.
- status String
- Database status. Values: Unavailable (not available), Available (available).
Supporting Types
DatabaseDatabasePrivilege, DatabaseDatabasePrivilegeArgs
- Account
Name string - Database account name.
- Account
Privilege string - Granted account privilege type. Values: ReadWrite (read and write privileges), ReadOnly (read-only privileges), DDLOnly (DDL privileges only), DMLOnly (DML privileges only), Custom (custom privileges).
- Host string
- The specified database account can access the database from the IP address. Default value: %. If Host is set to %, the account can access the database from any IP address. If Host is set to 192.10.10.%, the account can access the database from IP addresses between 192.10.10.0 and 192.10.10.255. The specified Host must be added to the instance's allowlist.
- Account
Name string - Database account name.
- Account
Privilege string - Granted account privilege type. Values: ReadWrite (read and write privileges), ReadOnly (read-only privileges), DDLOnly (DDL privileges only), DMLOnly (DML privileges only), Custom (custom privileges).
- Host string
- The specified database account can access the database from the IP address. Default value: %. If Host is set to %, the account can access the database from any IP address. If Host is set to 192.10.10.%, the account can access the database from IP addresses between 192.10.10.0 and 192.10.10.255. The specified Host must be added to the instance's allowlist.
- account
Name String - Database account name.
- account
Privilege String - Granted account privilege type. Values: ReadWrite (read and write privileges), ReadOnly (read-only privileges), DDLOnly (DDL privileges only), DMLOnly (DML privileges only), Custom (custom privileges).
- host String
- The specified database account can access the database from the IP address. Default value: %. If Host is set to %, the account can access the database from any IP address. If Host is set to 192.10.10.%, the account can access the database from IP addresses between 192.10.10.0 and 192.10.10.255. The specified Host must be added to the instance's allowlist.
- account
Name string - Database account name.
- account
Privilege string - Granted account privilege type. Values: ReadWrite (read and write privileges), ReadOnly (read-only privileges), DDLOnly (DDL privileges only), DMLOnly (DML privileges only), Custom (custom privileges).
- host string
- The specified database account can access the database from the IP address. Default value: %. If Host is set to %, the account can access the database from any IP address. If Host is set to 192.10.10.%, the account can access the database from IP addresses between 192.10.10.0 and 192.10.10.255. The specified Host must be added to the instance's allowlist.
- account_
name str - Database account name.
- account_
privilege str - Granted account privilege type. Values: ReadWrite (read and write privileges), ReadOnly (read-only privileges), DDLOnly (DDL privileges only), DMLOnly (DML privileges only), Custom (custom privileges).
- host str
- The specified database account can access the database from the IP address. Default value: %. If Host is set to %, the account can access the database from any IP address. If Host is set to 192.10.10.%, the account can access the database from IP addresses between 192.10.10.0 and 192.10.10.255. The specified Host must be added to the instance's allowlist.
- account
Name String - Database account name.
- account
Privilege String - Granted account privilege type. Values: ReadWrite (read and write privileges), ReadOnly (read-only privileges), DDLOnly (DDL privileges only), DMLOnly (DML privileges only), Custom (custom privileges).
- host String
- The specified database account can access the database from the IP address. Default value: %. If Host is set to %, the account can access the database from any IP address. If Host is set to 192.10.10.%, the account can access the database from IP addresses between 192.10.10.0 and 192.10.10.255. The specified Host must be added to the instance's allowlist.
Import
$ pulumi import volcenginecc:rdsmysql/database:Database example "instance_id|name"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- volcenginecc volcengine/pulumi-volcenginecc
- License
- MPL-2.0
- Notes
- This Pulumi package is based on the
volcengineccTerraform Provider.
published on Thursday, May 7, 2026 by Volcengine
