1. Packages
  2. Bytepluscc Provider
  3. API Docs
  4. rdsmysql
  5. Database
bytepluscc v0.0.11 published on Wednesday, Jan 21, 2026 by Byteplus
bytepluscc logo
bytepluscc v0.0.11 published on Wednesday, Jan 21, 2026 by Byteplus

    数据库

    Example Usage

    Example coming soon!
    
    Example coming soon!
    
    Example coming soon!
    
    Example coming soon!
    
    Example coming soon!
    
    resources:
      databaseDemo:
        type: bytepluscc: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: bytepluscc: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 Bytepluscc.Rdsmysql.Database("databaseResource", new()
    {
        InstanceId = "string",
        Name = "string",
        CharacterSetName = "string",
        DatabasePrivileges = new[]
        {
            new Bytepluscc.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 Database("databaseResource", DatabaseArgs.builder()
        .instanceId("string")
        .name("string")
        .characterSetName("string")
        .databasePrivileges(DatabaseDatabasePrivilegeArgs.builder()
            .accountName("string")
            .accountPrivilege("string")
            .host("string")
            .build())
        .description("string")
        .build());
    
    database_resource = bytepluscc.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 bytepluscc.rdsmysql.Database("databaseResource", {
        instanceId: "string",
        name: "string",
        characterSetName: "string",
        databasePrivileges: [{
            accountName: "string",
            accountPrivilege: "string",
            host: "string",
        }],
        description: "string",
    });
    
    type: bytepluscc: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:

    InstanceId string
    数据库实例 ID。
    Name string
    数据库名称。命名规则如下:名称唯一。长度为 2~64 个字符。以字母开头,以字母或数字结尾。由字母、数字、下划线(_)或中划线(-)组成。不能使用某些预留字,包括 root、admin 等。
    CharacterSetName string
    数据库字符集。目前支持的字符集包含:utf8、utf8mb4(默认)、latin1、ascii。
    DatabasePrivileges List<Byteplus.DatabaseDatabasePrivilege>
    Description string
    数据库的描述信息,长度不超过 256 个字符。该字段可选,若不设置该字段,或设置了该字段但描述信息长度为 0 ,则描述信息为空。
    InstanceId string
    数据库实例 ID。
    Name string
    数据库名称。命名规则如下:名称唯一。长度为 2~64 个字符。以字母开头,以字母或数字结尾。由字母、数字、下划线(_)或中划线(-)组成。不能使用某些预留字,包括 root、admin 等。
    CharacterSetName string
    数据库字符集。目前支持的字符集包含:utf8、utf8mb4(默认)、latin1、ascii。
    DatabasePrivileges []DatabaseDatabasePrivilegeArgs
    Description string
    数据库的描述信息,长度不超过 256 个字符。该字段可选,若不设置该字段,或设置了该字段但描述信息长度为 0 ,则描述信息为空。
    instanceId String
    数据库实例 ID。
    name String
    数据库名称。命名规则如下:名称唯一。长度为 2~64 个字符。以字母开头,以字母或数字结尾。由字母、数字、下划线(_)或中划线(-)组成。不能使用某些预留字,包括 root、admin 等。
    characterSetName String
    数据库字符集。目前支持的字符集包含:utf8、utf8mb4(默认)、latin1、ascii。
    databasePrivileges List<DatabaseDatabasePrivilege>
    description String
    数据库的描述信息,长度不超过 256 个字符。该字段可选,若不设置该字段,或设置了该字段但描述信息长度为 0 ,则描述信息为空。
    instanceId string
    数据库实例 ID。
    name string
    数据库名称。命名规则如下:名称唯一。长度为 2~64 个字符。以字母开头,以字母或数字结尾。由字母、数字、下划线(_)或中划线(-)组成。不能使用某些预留字,包括 root、admin 等。
    characterSetName string
    数据库字符集。目前支持的字符集包含:utf8、utf8mb4(默认)、latin1、ascii。
    databasePrivileges DatabaseDatabasePrivilege[]
    description string
    数据库的描述信息,长度不超过 256 个字符。该字段可选,若不设置该字段,或设置了该字段但描述信息长度为 0 ,则描述信息为空。
    instance_id str
    数据库实例 ID。
    name str
    数据库名称。命名规则如下:名称唯一。长度为 2~64 个字符。以字母开头,以字母或数字结尾。由字母、数字、下划线(_)或中划线(-)组成。不能使用某些预留字,包括 root、admin 等。
    character_set_name str
    数据库字符集。目前支持的字符集包含:utf8、utf8mb4(默认)、latin1、ascii。
    database_privileges Sequence[DatabaseDatabasePrivilegeArgs]
    description str
    数据库的描述信息,长度不超过 256 个字符。该字段可选,若不设置该字段,或设置了该字段但描述信息长度为 0 ,则描述信息为空。
    instanceId String
    数据库实例 ID。
    name String
    数据库名称。命名规则如下:名称唯一。长度为 2~64 个字符。以字母开头,以字母或数字结尾。由字母、数字、下划线(_)或中划线(-)组成。不能使用某些预留字,包括 root、admin 等。
    characterSetName String
    数据库字符集。目前支持的字符集包含:utf8、utf8mb4(默认)、latin1、ascii。
    databasePrivileges List<Property Map>
    description String
    数据库的描述信息,长度不超过 256 个字符。该字段可选,若不设置该字段,或设置了该字段但描述信息长度为 0 ,则描述信息为空。

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Database resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    数据库状态。取值为:Unavailable:不可用。Available:可用。
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    数据库状态。取值为:Unavailable:不可用。Available:可用。
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    数据库状态。取值为:Unavailable:不可用。Available:可用。
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    数据库状态。取值为:Unavailable:不可用。Available:可用。
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    数据库状态。取值为:Unavailable:不可用。Available:可用。
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    数据库状态。取值为:Unavailable:不可用。Available:可用。

    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) -> Database
    func 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: bytepluscc: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.
    The following state arguments are supported:
    CharacterSetName string
    数据库字符集。目前支持的字符集包含:utf8、utf8mb4(默认)、latin1、ascii。
    DatabasePrivileges List<Byteplus.DatabaseDatabasePrivilege>
    Description string
    数据库的描述信息,长度不超过 256 个字符。该字段可选,若不设置该字段,或设置了该字段但描述信息长度为 0 ,则描述信息为空。
    InstanceId string
    数据库实例 ID。
    Name string
    数据库名称。命名规则如下:名称唯一。长度为 2~64 个字符。以字母开头,以字母或数字结尾。由字母、数字、下划线(_)或中划线(-)组成。不能使用某些预留字,包括 root、admin 等。
    Status string
    数据库状态。取值为:Unavailable:不可用。Available:可用。
    CharacterSetName string
    数据库字符集。目前支持的字符集包含:utf8、utf8mb4(默认)、latin1、ascii。
    DatabasePrivileges []DatabaseDatabasePrivilegeArgs
    Description string
    数据库的描述信息,长度不超过 256 个字符。该字段可选,若不设置该字段,或设置了该字段但描述信息长度为 0 ,则描述信息为空。
    InstanceId string
    数据库实例 ID。
    Name string
    数据库名称。命名规则如下:名称唯一。长度为 2~64 个字符。以字母开头,以字母或数字结尾。由字母、数字、下划线(_)或中划线(-)组成。不能使用某些预留字,包括 root、admin 等。
    Status string
    数据库状态。取值为:Unavailable:不可用。Available:可用。
    characterSetName String
    数据库字符集。目前支持的字符集包含:utf8、utf8mb4(默认)、latin1、ascii。
    databasePrivileges List<DatabaseDatabasePrivilege>
    description String
    数据库的描述信息,长度不超过 256 个字符。该字段可选,若不设置该字段,或设置了该字段但描述信息长度为 0 ,则描述信息为空。
    instanceId String
    数据库实例 ID。
    name String
    数据库名称。命名规则如下:名称唯一。长度为 2~64 个字符。以字母开头,以字母或数字结尾。由字母、数字、下划线(_)或中划线(-)组成。不能使用某些预留字,包括 root、admin 等。
    status String
    数据库状态。取值为:Unavailable:不可用。Available:可用。
    characterSetName string
    数据库字符集。目前支持的字符集包含:utf8、utf8mb4(默认)、latin1、ascii。
    databasePrivileges DatabaseDatabasePrivilege[]
    description string
    数据库的描述信息,长度不超过 256 个字符。该字段可选,若不设置该字段,或设置了该字段但描述信息长度为 0 ,则描述信息为空。
    instanceId string
    数据库实例 ID。
    name string
    数据库名称。命名规则如下:名称唯一。长度为 2~64 个字符。以字母开头,以字母或数字结尾。由字母、数字、下划线(_)或中划线(-)组成。不能使用某些预留字,包括 root、admin 等。
    status string
    数据库状态。取值为:Unavailable:不可用。Available:可用。
    character_set_name str
    数据库字符集。目前支持的字符集包含:utf8、utf8mb4(默认)、latin1、ascii。
    database_privileges Sequence[DatabaseDatabasePrivilegeArgs]
    description str
    数据库的描述信息,长度不超过 256 个字符。该字段可选,若不设置该字段,或设置了该字段但描述信息长度为 0 ,则描述信息为空。
    instance_id str
    数据库实例 ID。
    name str
    数据库名称。命名规则如下:名称唯一。长度为 2~64 个字符。以字母开头,以字母或数字结尾。由字母、数字、下划线(_)或中划线(-)组成。不能使用某些预留字,包括 root、admin 等。
    status str
    数据库状态。取值为:Unavailable:不可用。Available:可用。
    characterSetName String
    数据库字符集。目前支持的字符集包含:utf8、utf8mb4(默认)、latin1、ascii。
    databasePrivileges List<Property Map>
    description String
    数据库的描述信息,长度不超过 256 个字符。该字段可选,若不设置该字段,或设置了该字段但描述信息长度为 0 ,则描述信息为空。
    instanceId String
    数据库实例 ID。
    name String
    数据库名称。命名规则如下:名称唯一。长度为 2~64 个字符。以字母开头,以字母或数字结尾。由字母、数字、下划线(_)或中划线(-)组成。不能使用某些预留字,包括 root、admin 等。
    status String
    数据库状态。取值为:Unavailable:不可用。Available:可用。

    Supporting Types

    DatabaseDatabasePrivilege, DatabaseDatabasePrivilegeArgs

    AccountName string
    数据库账号名称。
    AccountPrivilege string
    授予的账号权限类型,取值:ReadWrite:读写权限。ReadOnly:只读权限。DDLOnly:仅 DDL 权限。DMLOnly:仅 DML 权限。Custom:自定义权限。
    Host string
    指定的数据库账号可以访问数据库的 IP 地址。默认值为 %。若指定 Host 为 %,允许该账号从任意 IP 地址访问数据库。若指定 Host 为 192.10.10.%,则表示该账号可从 192.10.10.0~192.10.10.255 之间的 IP 地址访问数据库。指定的 Host 需要添加在实例所绑定的白名单中,
    AccountName string
    数据库账号名称。
    AccountPrivilege string
    授予的账号权限类型,取值:ReadWrite:读写权限。ReadOnly:只读权限。DDLOnly:仅 DDL 权限。DMLOnly:仅 DML 权限。Custom:自定义权限。
    Host string
    指定的数据库账号可以访问数据库的 IP 地址。默认值为 %。若指定 Host 为 %,允许该账号从任意 IP 地址访问数据库。若指定 Host 为 192.10.10.%,则表示该账号可从 192.10.10.0~192.10.10.255 之间的 IP 地址访问数据库。指定的 Host 需要添加在实例所绑定的白名单中,
    accountName String
    数据库账号名称。
    accountPrivilege String
    授予的账号权限类型,取值:ReadWrite:读写权限。ReadOnly:只读权限。DDLOnly:仅 DDL 权限。DMLOnly:仅 DML 权限。Custom:自定义权限。
    host String
    指定的数据库账号可以访问数据库的 IP 地址。默认值为 %。若指定 Host 为 %,允许该账号从任意 IP 地址访问数据库。若指定 Host 为 192.10.10.%,则表示该账号可从 192.10.10.0~192.10.10.255 之间的 IP 地址访问数据库。指定的 Host 需要添加在实例所绑定的白名单中,
    accountName string
    数据库账号名称。
    accountPrivilege string
    授予的账号权限类型,取值:ReadWrite:读写权限。ReadOnly:只读权限。DDLOnly:仅 DDL 权限。DMLOnly:仅 DML 权限。Custom:自定义权限。
    host string
    指定的数据库账号可以访问数据库的 IP 地址。默认值为 %。若指定 Host 为 %,允许该账号从任意 IP 地址访问数据库。若指定 Host 为 192.10.10.%,则表示该账号可从 192.10.10.0~192.10.10.255 之间的 IP 地址访问数据库。指定的 Host 需要添加在实例所绑定的白名单中,
    account_name str
    数据库账号名称。
    account_privilege str
    授予的账号权限类型,取值:ReadWrite:读写权限。ReadOnly:只读权限。DDLOnly:仅 DDL 权限。DMLOnly:仅 DML 权限。Custom:自定义权限。
    host str
    指定的数据库账号可以访问数据库的 IP 地址。默认值为 %。若指定 Host 为 %,允许该账号从任意 IP 地址访问数据库。若指定 Host 为 192.10.10.%,则表示该账号可从 192.10.10.0~192.10.10.255 之间的 IP 地址访问数据库。指定的 Host 需要添加在实例所绑定的白名单中,
    accountName String
    数据库账号名称。
    accountPrivilege String
    授予的账号权限类型,取值:ReadWrite:读写权限。ReadOnly:只读权限。DDLOnly:仅 DDL 权限。DMLOnly:仅 DML 权限。Custom:自定义权限。
    host String
    指定的数据库账号可以访问数据库的 IP 地址。默认值为 %。若指定 Host 为 %,允许该账号从任意 IP 地址访问数据库。若指定 Host 为 192.10.10.%,则表示该账号可从 192.10.10.0~192.10.10.255 之间的 IP 地址访问数据库。指定的 Host 需要添加在实例所绑定的白名单中,

    Import

    $ pulumi import bytepluscc:rdsmysql/database:Database example "instance_id|name"
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    bytepluscc byteplus-sdk/pulumi-bytepluscc
    License
    MPL-2.0
    Notes
    This Pulumi package is based on the bytepluscc Terraform Provider.
    bytepluscc logo
    bytepluscc v0.0.11 published on Wednesday, Jan 21, 2026 by Byteplus
      Meet Neo: Your AI Platform Teammate