1. Packages
  2. Volcengine
  3. API Docs
  4. rds
  5. Database
Volcengine v0.0.28 published on Thursday, Apr 24, 2025 by Volcengine

volcengine.rds.Database

Explore with Pulumi AI

(Deprecated! Recommend use volcengine_rds_mysql_*** replace) Provides a resource to manage rds database

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as volcengine from "@volcengine/pulumi";

const foo = new volcengine.rds.Database("foo", {
    characterSetName: "utf8mb4",
    dbName: "foo",
    instanceId: "mysql-0fdd3bab2e7c",
});
Copy
import pulumi
import pulumi_volcengine as volcengine

foo = volcengine.rds.Database("foo",
    character_set_name="utf8mb4",
    db_name="foo",
    instance_id="mysql-0fdd3bab2e7c")
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/rds"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := rds.NewDatabase(ctx, "foo", &rds.DatabaseArgs{
			CharacterSetName: pulumi.String("utf8mb4"),
			DbName:           pulumi.String("foo"),
			InstanceId:       pulumi.String("mysql-0fdd3bab2e7c"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcengine = Pulumi.Volcengine;

return await Deployment.RunAsync(() => 
{
    var foo = new Volcengine.Rds.Database("foo", new()
    {
        CharacterSetName = "utf8mb4",
        DbName = "foo",
        InstanceId = "mysql-0fdd3bab2e7c",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.rds.Database;
import com.pulumi.volcengine.rds.DatabaseArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var foo = new Database("foo", DatabaseArgs.builder()        
            .characterSetName("utf8mb4")
            .dbName("foo")
            .instanceId("mysql-0fdd3bab2e7c")
            .build());

    }
}
Copy
resources:
  foo:
    type: volcengine:rds:Database
    properties:
      characterSetName: utf8mb4
      dbName: foo
      instanceId: mysql-0fdd3bab2e7c
Copy

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,
             character_set_name: Optional[str] = None,
             db_name: Optional[str] = None,
             instance_id: 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: volcengine:rds:Database
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. DatabaseArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. 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 This property is required. string
The unique name of the resource.
args This property is required. DatabaseArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. DatabaseArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. 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 Volcengine.Rds.Database("databaseResource", new()
{
    CharacterSetName = "string",
    DbName = "string",
    InstanceId = "string",
});
Copy
example, err := rds.NewDatabase(ctx, "databaseResource", &rds.DatabaseArgs{
	CharacterSetName: pulumi.String("string"),
	DbName:           pulumi.String("string"),
	InstanceId:       pulumi.String("string"),
})
Copy
var databaseResource = new com.pulumi.volcengine.rds.Database("databaseResource", com.pulumi.volcengine.rds.DatabaseArgs.builder()
    .characterSetName("string")
    .dbName("string")
    .instanceId("string")
    .build());
Copy
database_resource = volcengine.rds.Database("databaseResource",
    character_set_name="string",
    db_name="string",
    instance_id="string")
Copy
const databaseResource = new volcengine.rds.Database("databaseResource", {
    characterSetName: "string",
    dbName: "string",
    instanceId: "string",
});
Copy
type: volcengine:rds:Database
properties:
    characterSetName: string
    dbName: string
    instanceId: string
Copy

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:

CharacterSetName
This property is required.
Changes to this property will trigger replacement.
string
Database character set. Currently supported character sets include: utf8, utf8mb4, latin1, ascii.
DbName
This property is required.
Changes to this property will trigger replacement.
string
Name database. illustrate: Unique name. The length is 2~64 characters. Start with a letter and end with a letter or number. Consists of lowercase letters, numbers, and underscores (_) or dashes (-). Database names are disabled keywords.
InstanceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the RDS instance.
CharacterSetName
This property is required.
Changes to this property will trigger replacement.
string
Database character set. Currently supported character sets include: utf8, utf8mb4, latin1, ascii.
DbName
This property is required.
Changes to this property will trigger replacement.
string
Name database. illustrate: Unique name. The length is 2~64 characters. Start with a letter and end with a letter or number. Consists of lowercase letters, numbers, and underscores (_) or dashes (-). Database names are disabled keywords.
InstanceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the RDS instance.
characterSetName
This property is required.
Changes to this property will trigger replacement.
String
Database character set. Currently supported character sets include: utf8, utf8mb4, latin1, ascii.
dbName
This property is required.
Changes to this property will trigger replacement.
String
Name database. illustrate: Unique name. The length is 2~64 characters. Start with a letter and end with a letter or number. Consists of lowercase letters, numbers, and underscores (_) or dashes (-). Database names are disabled keywords.
instanceId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the RDS instance.
characterSetName
This property is required.
Changes to this property will trigger replacement.
string
Database character set. Currently supported character sets include: utf8, utf8mb4, latin1, ascii.
dbName
This property is required.
Changes to this property will trigger replacement.
string
Name database. illustrate: Unique name. The length is 2~64 characters. Start with a letter and end with a letter or number. Consists of lowercase letters, numbers, and underscores (_) or dashes (-). Database names are disabled keywords.
instanceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the RDS instance.
character_set_name
This property is required.
Changes to this property will trigger replacement.
str
Database character set. Currently supported character sets include: utf8, utf8mb4, latin1, ascii.
db_name
This property is required.
Changes to this property will trigger replacement.
str
Name database. illustrate: Unique name. The length is 2~64 characters. Start with a letter and end with a letter or number. Consists of lowercase letters, numbers, and underscores (_) or dashes (-). Database names are disabled keywords.
instance_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the RDS instance.
characterSetName
This property is required.
Changes to this property will trigger replacement.
String
Database character set. Currently supported character sets include: utf8, utf8mb4, latin1, ascii.
dbName
This property is required.
Changes to this property will trigger replacement.
String
Name database. illustrate: Unique name. The length is 2~64 characters. Start with a letter and end with a letter or number. Consists of lowercase letters, numbers, and underscores (_) or dashes (-). Database names are disabled keywords.
instanceId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the RDS instance.

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.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

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,
        db_name: Optional[str] = None,
        instance_id: 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: volcengine:rds:Database    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 Changes to this property will trigger replacement. string
Database character set. Currently supported character sets include: utf8, utf8mb4, latin1, ascii.
DbName Changes to this property will trigger replacement. string
Name database. illustrate: Unique name. The length is 2~64 characters. Start with a letter and end with a letter or number. Consists of lowercase letters, numbers, and underscores (_) or dashes (-). Database names are disabled keywords.
InstanceId Changes to this property will trigger replacement. string
The ID of the RDS instance.
CharacterSetName Changes to this property will trigger replacement. string
Database character set. Currently supported character sets include: utf8, utf8mb4, latin1, ascii.
DbName Changes to this property will trigger replacement. string
Name database. illustrate: Unique name. The length is 2~64 characters. Start with a letter and end with a letter or number. Consists of lowercase letters, numbers, and underscores (_) or dashes (-). Database names are disabled keywords.
InstanceId Changes to this property will trigger replacement. string
The ID of the RDS instance.
characterSetName Changes to this property will trigger replacement. String
Database character set. Currently supported character sets include: utf8, utf8mb4, latin1, ascii.
dbName Changes to this property will trigger replacement. String
Name database. illustrate: Unique name. The length is 2~64 characters. Start with a letter and end with a letter or number. Consists of lowercase letters, numbers, and underscores (_) or dashes (-). Database names are disabled keywords.
instanceId Changes to this property will trigger replacement. String
The ID of the RDS instance.
characterSetName Changes to this property will trigger replacement. string
Database character set. Currently supported character sets include: utf8, utf8mb4, latin1, ascii.
dbName Changes to this property will trigger replacement. string
Name database. illustrate: Unique name. The length is 2~64 characters. Start with a letter and end with a letter or number. Consists of lowercase letters, numbers, and underscores (_) or dashes (-). Database names are disabled keywords.
instanceId Changes to this property will trigger replacement. string
The ID of the RDS instance.
character_set_name Changes to this property will trigger replacement. str
Database character set. Currently supported character sets include: utf8, utf8mb4, latin1, ascii.
db_name Changes to this property will trigger replacement. str
Name database. illustrate: Unique name. The length is 2~64 characters. Start with a letter and end with a letter or number. Consists of lowercase letters, numbers, and underscores (_) or dashes (-). Database names are disabled keywords.
instance_id Changes to this property will trigger replacement. str
The ID of the RDS instance.
characterSetName Changes to this property will trigger replacement. String
Database character set. Currently supported character sets include: utf8, utf8mb4, latin1, ascii.
dbName Changes to this property will trigger replacement. String
Name database. illustrate: Unique name. The length is 2~64 characters. Start with a letter and end with a letter or number. Consists of lowercase letters, numbers, and underscores (_) or dashes (-). Database names are disabled keywords.
instanceId Changes to this property will trigger replacement. String
The ID of the RDS instance.

Import

Database can be imported using the id, e.g.

$ pulumi import volcengine:rds/database:Database default mysql-42b38c769c4b:dbname
Copy

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

Package Details

Repository
volcengine volcengine/pulumi-volcengine
License
Apache-2.0
Notes
This Pulumi package is based on the volcengine Terraform Provider.