vkcs.DbDatabase
Explore with Pulumi AI
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:
- Dbms
Id 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.
- Db
Database stringId - string → ID of the resource.
- Name string
- required string → The name of the database. Changing this creates a new database.
- Timeouts
Db
Database Timeouts - Vendor
Options DbDatabase Vendor Options - optional → New since v0.5.5.
- Dbms
Id 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.
- Db
Database stringId - string → ID of the resource.
- Name string
- required string → The name of the database. Changing this creates a new database.
- Timeouts
Db
Database Timeouts Args - Vendor
Options DbDatabase Vendor Options Args - optional → New since v0.5.5.
- dbms
Id 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.
- db
Database StringId - string → ID of the resource.
- name String
- required string → The name of the database. Changing this creates a new database.
- timeouts
Db
Database Timeouts - vendor
Options DbDatabase Vendor Options - optional → New since v0.5.5.
- dbms
Id 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.
- db
Database stringId - string → ID of the resource.
- name string
- required string → The name of the database. Changing this creates a new database.
- timeouts
Db
Database Timeouts - vendor
Options DbDatabase Vendor Options - 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_ strid - string → ID of the resource.
- name str
- required string → The name of the database. Changing this creates a new database.
- timeouts
Db
Database Timeouts Args - vendor_
options DbDatabase Vendor Options Args - optional → New since v0.5.5.
- dbms
Id 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.
- db
Database StringId - string → ID of the resource.
- name String
- required string → The name of the database. Changing this creates a new database.
- timeouts Property Map
- vendor
Options 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:
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.
- 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.
- Db
Database stringId - string → ID of the resource.
- Dbms
Id string - required string → ID of the instance or cluster that database is created for.
- Dbms
Type 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
Db
Database Timeouts - Vendor
Options DbDatabase Vendor Options - 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.
- Db
Database stringId - string → ID of the resource.
- Dbms
Id string - required string → ID of the instance or cluster that database is created for.
- Dbms
Type 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
Db
Database Timeouts Args - Vendor
Options DbDatabase Vendor Options Args - 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.
- db
Database StringId - string → ID of the resource.
- dbms
Id String - required string → ID of the instance or cluster that database is created for.
- dbms
Type 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
Db
Database Timeouts - vendor
Options DbDatabase Vendor Options - 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.
- db
Database stringId - string → ID of the resource.
- dbms
Id string - required string → ID of the instance or cluster that database is created for.
- dbms
Type 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
Db
Database Timeouts - vendor
Options DbDatabase Vendor Options - 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_ strid - 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
Db
Database Timeouts Args - vendor_
options DbDatabase Vendor Options Args - 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.
- db
Database StringId - string → ID of the resource.
- dbms
Id String - required string → ID of the instance or cluster that database is created for.
- dbms
Type 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
- vendor
Options Property Map - optional → New since v0.5.5.
Supporting Types
DbDatabaseTimeouts, DbDatabaseTimeoutsArgs
DbDatabaseVendorOptions, DbDatabaseVendorOptionsArgs
- 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.
- 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.
- force
Deletion 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 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.
- force
Deletion 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.