1. Packages
  2. Vkcs Provider
  3. API Docs
  4. DbDatabase
vkcs 0.9.3 published on Tuesday, Apr 15, 2025 by vk-cs

vkcs.DbDatabase

Explore with Pulumi AI

vkcs logo
vkcs 0.9.3 published on Tuesday, Apr 15, 2025 by vk-cs

    Provides a db database resource. This can be used to create, modify and delete db databases.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vkcs from "@pulumi/vkcs";
    
    const mysqlDb = new vkcs.DbDatabase("mysqlDb", {
        dbmsId: vkcs_db_instance.mysql.id,
        charset: "utf8",
        collate: "utf8_general_ci",
    });
    
    import pulumi
    import pulumi_vkcs as vkcs
    
    mysql_db = vkcs.DbDatabase("mysqlDb",
        dbms_id=vkcs_db_instance["mysql"]["id"],
        charset="utf8",
        collate="utf8_general_ci")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/vkcs/vkcs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vkcs.NewDbDatabase(ctx, "mysqlDb", &vkcs.DbDatabaseArgs{
    			DbmsId:  pulumi.Any(vkcs_db_instance.Mysql.Id),
    			Charset: pulumi.String("utf8"),
    			Collate: pulumi.String("utf8_general_ci"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vkcs = Pulumi.Vkcs;
    
    return await Deployment.RunAsync(() => 
    {
        var mysqlDb = new Vkcs.DbDatabase("mysqlDb", new()
        {
            DbmsId = vkcs_db_instance.Mysql.Id,
            Charset = "utf8",
            Collate = "utf8_general_ci",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vkcs.DbDatabase;
    import com.pulumi.vkcs.DbDatabaseArgs;
    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 mysqlDb = new DbDatabase("mysqlDb", DbDatabaseArgs.builder()
                .dbmsId(vkcs_db_instance.mysql().id())
                .charset("utf8")
                .collate("utf8_general_ci")
                .build());
    
        }
    }
    
    resources:
      mysqlDb:
        type: vkcs:DbDatabase
        properties:
          dbmsId: ${vkcs_db_instance.mysql.id}
          charset: utf8
          collate: utf8_general_ci
    

    Create DbDatabase Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new DbDatabase(name: string, args: DbDatabaseArgs, opts?: CustomResourceOptions);
    @overload
    def DbDatabase(resource_name: str,
                   args: DbDatabaseArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def DbDatabase(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   dbms_id: Optional[str] = None,
                   charset: Optional[str] = None,
                   collate: Optional[str] = None,
                   db_database_id: Optional[str] = None,
                   name: Optional[str] = None,
                   timeouts: Optional[DbDatabaseTimeoutsArgs] = None,
                   vendor_options: Optional[DbDatabaseVendorOptionsArgs] = None)
    func NewDbDatabase(ctx *Context, name string, args DbDatabaseArgs, opts ...ResourceOption) (*DbDatabase, error)
    public DbDatabase(string name, DbDatabaseArgs args, CustomResourceOptions? opts = null)
    public DbDatabase(String name, DbDatabaseArgs args)
    public DbDatabase(String name, DbDatabaseArgs args, CustomResourceOptions options)
    
    type: vkcs:DbDatabase
    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 DbDatabaseArgs
    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 DbDatabaseArgs
    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 DbDatabaseArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DbDatabaseArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DbDatabaseArgs
    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 dbDatabaseResource = new Vkcs.DbDatabase("dbDatabaseResource", new()
    {
        DbmsId = "string",
        Charset = "string",
        Collate = "string",
        DbDatabaseId = "string",
        Name = "string",
        Timeouts = new Vkcs.Inputs.DbDatabaseTimeoutsArgs
        {
            Create = "string",
            Delete = "string",
        },
        VendorOptions = new Vkcs.Inputs.DbDatabaseVendorOptionsArgs
        {
            ForceDeletion = false,
        },
    });
    
    example, err := vkcs.NewDbDatabase(ctx, "dbDatabaseResource", &vkcs.DbDatabaseArgs{
    	DbmsId:       pulumi.String("string"),
    	Charset:      pulumi.String("string"),
    	Collate:      pulumi.String("string"),
    	DbDatabaseId: pulumi.String("string"),
    	Name:         pulumi.String("string"),
    	Timeouts: &vkcs.DbDatabaseTimeoutsArgs{
    		Create: pulumi.String("string"),
    		Delete: pulumi.String("string"),
    	},
    	VendorOptions: &vkcs.DbDatabaseVendorOptionsArgs{
    		ForceDeletion: pulumi.Bool(false),
    	},
    })
    
    var dbDatabaseResource = new DbDatabase("dbDatabaseResource", DbDatabaseArgs.builder()
        .dbmsId("string")
        .charset("string")
        .collate("string")
        .dbDatabaseId("string")
        .name("string")
        .timeouts(DbDatabaseTimeoutsArgs.builder()
            .create("string")
            .delete("string")
            .build())
        .vendorOptions(DbDatabaseVendorOptionsArgs.builder()
            .forceDeletion(false)
            .build())
        .build());
    
    db_database_resource = vkcs.DbDatabase("dbDatabaseResource",
        dbms_id="string",
        charset="string",
        collate="string",
        db_database_id="string",
        name="string",
        timeouts={
            "create": "string",
            "delete": "string",
        },
        vendor_options={
            "force_deletion": False,
        })
    
    const dbDatabaseResource = new vkcs.DbDatabase("dbDatabaseResource", {
        dbmsId: "string",
        charset: "string",
        collate: "string",
        dbDatabaseId: "string",
        name: "string",
        timeouts: {
            create: "string",
            "delete": "string",
        },
        vendorOptions: {
            forceDeletion: false,
        },
    });
    
    type: vkcs:DbDatabase
    properties:
        charset: string
        collate: string
        dbDatabaseId: string
        dbmsId: string
        name: string
        timeouts:
            create: string
            delete: string
        vendorOptions:
            forceDeletion: false
    

    DbDatabase 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 DbDatabase resource accepts the following input properties:

    DbmsId string
    required string → ID of the instance or cluster that database is created for.
    Charset string
    optional string → Type of charset used for the database. Changing this creates a new database.
    Collate string
    optional string → Collate option of the database. Changing this creates a new database.
    DbDatabaseId string
    string → ID of the resource.
    Name string
    required string → The name of the database. Changing this creates a new database.
    Timeouts DbDatabaseTimeouts
    VendorOptions DbDatabaseVendorOptions
    optional → New since v0.5.5.
    DbmsId string
    required string → ID of the instance or cluster that database is created for.
    Charset string
    optional string → Type of charset used for the database. Changing this creates a new database.
    Collate string
    optional string → Collate option of the database. Changing this creates a new database.
    DbDatabaseId string
    string → ID of the resource.
    Name string
    required string → The name of the database. Changing this creates a new database.
    Timeouts DbDatabaseTimeoutsArgs
    VendorOptions DbDatabaseVendorOptionsArgs
    optional → New since v0.5.5.
    dbmsId String
    required string → ID of the instance or cluster that database is created for.
    charset String
    optional string → Type of charset used for the database. Changing this creates a new database.
    collate String
    optional string → Collate option of the database. Changing this creates a new database.
    dbDatabaseId String
    string → ID of the resource.
    name String
    required string → The name of the database. Changing this creates a new database.
    timeouts DbDatabaseTimeouts
    vendorOptions DbDatabaseVendorOptions
    optional → New since v0.5.5.
    dbmsId string
    required string → ID of the instance or cluster that database is created for.
    charset string
    optional string → Type of charset used for the database. Changing this creates a new database.
    collate string
    optional string → Collate option of the database. Changing this creates a new database.
    dbDatabaseId string
    string → ID of the resource.
    name string
    required string → The name of the database. Changing this creates a new database.
    timeouts DbDatabaseTimeouts
    vendorOptions DbDatabaseVendorOptions
    optional → New since v0.5.5.
    dbms_id str
    required string → ID of the instance or cluster that database is created for.
    charset str
    optional string → Type of charset used for the database. Changing this creates a new database.
    collate str
    optional string → Collate option of the database. Changing this creates a new database.
    db_database_id str
    string → ID of the resource.
    name str
    required string → The name of the database. Changing this creates a new database.
    timeouts DbDatabaseTimeoutsArgs
    vendor_options DbDatabaseVendorOptionsArgs
    optional → New since v0.5.5.
    dbmsId String
    required string → ID of the instance or cluster that database is created for.
    charset String
    optional string → Type of charset used for the database. Changing this creates a new database.
    collate String
    optional string → Collate option of the database. Changing this creates a new database.
    dbDatabaseId String
    string → ID of the resource.
    name String
    required string → The name of the database. Changing this creates a new database.
    timeouts Property Map
    vendorOptions Property Map
    optional → New since v0.5.5.

    Outputs

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

    DbmsType string
    string → Type of dbms for the database, can be "instance" or "cluster".
    Id string
    The provider-assigned unique ID for this managed resource.
    DbmsType string
    string → Type of dbms for the database, can be "instance" or "cluster".
    Id string
    The provider-assigned unique ID for this managed resource.
    dbmsType String
    string → Type of dbms for the database, can be "instance" or "cluster".
    id String
    The provider-assigned unique ID for this managed resource.
    dbmsType string
    string → Type of dbms for the database, can be "instance" or "cluster".
    id string
    The provider-assigned unique ID for this managed resource.
    dbms_type str
    string → Type of dbms for the database, can be "instance" or "cluster".
    id str
    The provider-assigned unique ID for this managed resource.
    dbmsType String
    string → Type of dbms for the database, can be "instance" or "cluster".
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing DbDatabase Resource

    Get an existing DbDatabase 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?: DbDatabaseState, opts?: CustomResourceOptions): DbDatabase
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            charset: Optional[str] = None,
            collate: Optional[str] = None,
            db_database_id: Optional[str] = None,
            dbms_id: Optional[str] = None,
            dbms_type: Optional[str] = None,
            name: Optional[str] = None,
            timeouts: Optional[DbDatabaseTimeoutsArgs] = None,
            vendor_options: Optional[DbDatabaseVendorOptionsArgs] = None) -> DbDatabase
    func GetDbDatabase(ctx *Context, name string, id IDInput, state *DbDatabaseState, opts ...ResourceOption) (*DbDatabase, error)
    public static DbDatabase Get(string name, Input<string> id, DbDatabaseState? state, CustomResourceOptions? opts = null)
    public static DbDatabase get(String name, Output<String> id, DbDatabaseState state, CustomResourceOptions options)
    resources:  _:    type: vkcs:DbDatabase    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:
    Charset string
    optional string → Type of charset used for the database. Changing this creates a new database.
    Collate string
    optional string → Collate option of the database. Changing this creates a new database.
    DbDatabaseId string
    string → ID of the resource.
    DbmsId string
    required string → ID of the instance or cluster that database is created for.
    DbmsType string
    string → Type of dbms for the database, can be "instance" or "cluster".
    Name string
    required string → The name of the database. Changing this creates a new database.
    Timeouts DbDatabaseTimeouts
    VendorOptions DbDatabaseVendorOptions
    optional → New since v0.5.5.
    Charset string
    optional string → Type of charset used for the database. Changing this creates a new database.
    Collate string
    optional string → Collate option of the database. Changing this creates a new database.
    DbDatabaseId string
    string → ID of the resource.
    DbmsId string
    required string → ID of the instance or cluster that database is created for.
    DbmsType string
    string → Type of dbms for the database, can be "instance" or "cluster".
    Name string
    required string → The name of the database. Changing this creates a new database.
    Timeouts DbDatabaseTimeoutsArgs
    VendorOptions DbDatabaseVendorOptionsArgs
    optional → New since v0.5.5.
    charset String
    optional string → Type of charset used for the database. Changing this creates a new database.
    collate String
    optional string → Collate option of the database. Changing this creates a new database.
    dbDatabaseId String
    string → ID of the resource.
    dbmsId String
    required string → ID of the instance or cluster that database is created for.
    dbmsType String
    string → Type of dbms for the database, can be "instance" or "cluster".
    name String
    required string → The name of the database. Changing this creates a new database.
    timeouts DbDatabaseTimeouts
    vendorOptions DbDatabaseVendorOptions
    optional → New since v0.5.5.
    charset string
    optional string → Type of charset used for the database. Changing this creates a new database.
    collate string
    optional string → Collate option of the database. Changing this creates a new database.
    dbDatabaseId string
    string → ID of the resource.
    dbmsId string
    required string → ID of the instance or cluster that database is created for.
    dbmsType string
    string → Type of dbms for the database, can be "instance" or "cluster".
    name string
    required string → The name of the database. Changing this creates a new database.
    timeouts DbDatabaseTimeouts
    vendorOptions DbDatabaseVendorOptions
    optional → New since v0.5.5.
    charset str
    optional string → Type of charset used for the database. Changing this creates a new database.
    collate str
    optional string → Collate option of the database. Changing this creates a new database.
    db_database_id str
    string → ID of the resource.
    dbms_id str
    required string → ID of the instance or cluster that database is created for.
    dbms_type str
    string → Type of dbms for the database, can be "instance" or "cluster".
    name str
    required string → The name of the database. Changing this creates a new database.
    timeouts DbDatabaseTimeoutsArgs
    vendor_options DbDatabaseVendorOptionsArgs
    optional → New since v0.5.5.
    charset String
    optional string → Type of charset used for the database. Changing this creates a new database.
    collate String
    optional string → Collate option of the database. Changing this creates a new database.
    dbDatabaseId String
    string → ID of the resource.
    dbmsId String
    required string → ID of the instance or cluster that database is created for.
    dbmsType String
    string → Type of dbms for the database, can be "instance" or "cluster".
    name String
    required string → The name of the database. Changing this creates a new database.
    timeouts Property Map
    vendorOptions Property Map
    optional → New since v0.5.5.

    Supporting Types

    DbDatabaseTimeouts, DbDatabaseTimeoutsArgs

    Create string
    Delete string
    Create string
    Delete string
    create String
    delete String
    create string
    delete string
    create str
    delete str
    create String
    delete String

    DbDatabaseVendorOptions, DbDatabaseVendorOptionsArgs

    ForceDeletion bool
    optional boolean → Whether to try to force delete the database. Some datastores restricts regular database deletion in some circumstances but provides force deletion for that cases.
    ForceDeletion bool
    optional boolean → Whether to try to force delete the database. Some datastores restricts regular database deletion in some circumstances but provides force deletion for that cases.
    forceDeletion Boolean
    optional boolean → Whether to try to force delete the database. Some datastores restricts regular database deletion in some circumstances but provides force deletion for that cases.
    forceDeletion boolean
    optional boolean → Whether to try to force delete the database. Some datastores restricts regular database deletion in some circumstances but provides force deletion for that cases.
    force_deletion bool
    optional boolean → Whether to try to force delete the database. Some datastores restricts regular database deletion in some circumstances but provides force deletion for that cases.
    forceDeletion Boolean
    optional boolean → Whether to try to force delete the database. Some datastores restricts regular database deletion in some circumstances but provides force deletion for that cases.

    Import

    Databases can be imported using the dbms_id/name

    $ pulumi import vkcs:index/dbDatabase:DbDatabase mydb 67691f3e-a4d1-443e-b1e9-717f505cc458/mydbname
    

    After the import you can use terraform show to view imported fields and write their values to your .tf file.

    You should at least add following fields to your .tf file:

    name, dbms_id

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

    Package Details

    Repository
    vkcs vk-cs/terraform-provider-vkcs
    License
    Notes
    This Pulumi package is based on the vkcs Terraform Provider.
    vkcs logo
    vkcs 0.9.3 published on Tuesday, Apr 15, 2025 by vk-cs