1. Packages
  2. Civo Provider
  3. API Docs
  4. Database
civo 1.1.5 published on Thursday, Feb 6, 2025 by civo

civo.Database

Explore with Pulumi AI

Example Usage

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,
             engine: Optional[str] = None,
             nodes: Optional[float] = None,
             size: Optional[str] = None,
             version: Optional[str] = None,
             database_id: Optional[str] = None,
             firewall_id: Optional[str] = None,
             name: Optional[str] = None,
             network_id: Optional[str] = None,
             region: Optional[str] = None,
             timeouts: Optional[DatabaseTimeoutsArgs] = 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: civo: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 Civo.Database("databaseResource", new()
{
    Engine = "string",
    Nodes = 0,
    Size = "string",
    Version = "string",
    DatabaseId = "string",
    FirewallId = "string",
    Name = "string",
    NetworkId = "string",
    Region = "string",
    Timeouts = new Civo.Inputs.DatabaseTimeoutsArgs
    {
        Create = "string",
        Delete = "string",
        Update = "string",
    },
});
Copy
example, err := civo.NewDatabase(ctx, "databaseResource", &civo.DatabaseArgs{
	Engine:     pulumi.String("string"),
	Nodes:      pulumi.Float64(0),
	Size:       pulumi.String("string"),
	Version:    pulumi.String("string"),
	DatabaseId: pulumi.String("string"),
	FirewallId: pulumi.String("string"),
	Name:       pulumi.String("string"),
	NetworkId:  pulumi.String("string"),
	Region:     pulumi.String("string"),
	Timeouts: &civo.DatabaseTimeoutsArgs{
		Create: pulumi.String("string"),
		Delete: pulumi.String("string"),
		Update: pulumi.String("string"),
	},
})
Copy
var databaseResource = new Database("databaseResource", DatabaseArgs.builder()
    .engine("string")
    .nodes(0)
    .size("string")
    .version("string")
    .databaseId("string")
    .firewallId("string")
    .name("string")
    .networkId("string")
    .region("string")
    .timeouts(DatabaseTimeoutsArgs.builder()
        .create("string")
        .delete("string")
        .update("string")
        .build())
    .build());
Copy
database_resource = civo.Database("databaseResource",
    engine="string",
    nodes=0,
    size="string",
    version="string",
    database_id="string",
    firewall_id="string",
    name="string",
    network_id="string",
    region="string",
    timeouts={
        "create": "string",
        "delete": "string",
        "update": "string",
    })
Copy
const databaseResource = new civo.Database("databaseResource", {
    engine: "string",
    nodes: 0,
    size: "string",
    version: "string",
    databaseId: "string",
    firewallId: "string",
    name: "string",
    networkId: "string",
    region: "string",
    timeouts: {
        create: "string",
        "delete": "string",
        update: "string",
    },
});
Copy
type: civo:Database
properties:
    databaseId: string
    engine: string
    firewallId: string
    name: string
    networkId: string
    nodes: 0
    region: string
    size: string
    timeouts:
        create: string
        delete: string
        update: string
    version: 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:

Engine This property is required. string
The engine of the database
Nodes This property is required. double
Count of nodes
Size This property is required. string
Size of the database
Version This property is required. string
The version of the database
DatabaseId string
The ID of this resource.
FirewallId string
The ID of the firewall to use, from the current list. If left blank or not sent, the default firewall will be used (open to all)
Name string
Name of the database
NetworkId string
The id of the associated network
Region string
The region where the database will be created.
Timeouts DatabaseTimeouts
Engine This property is required. string
The engine of the database
Nodes This property is required. float64
Count of nodes
Size This property is required. string
Size of the database
Version This property is required. string
The version of the database
DatabaseId string
The ID of this resource.
FirewallId string
The ID of the firewall to use, from the current list. If left blank or not sent, the default firewall will be used (open to all)
Name string
Name of the database
NetworkId string
The id of the associated network
Region string
The region where the database will be created.
Timeouts DatabaseTimeoutsArgs
engine This property is required. String
The engine of the database
nodes This property is required. Double
Count of nodes
size This property is required. String
Size of the database
version This property is required. String
The version of the database
databaseId String
The ID of this resource.
firewallId String
The ID of the firewall to use, from the current list. If left blank or not sent, the default firewall will be used (open to all)
name String
Name of the database
networkId String
The id of the associated network
region String
The region where the database will be created.
timeouts DatabaseTimeouts
engine This property is required. string
The engine of the database
nodes This property is required. number
Count of nodes
size This property is required. string
Size of the database
version This property is required. string
The version of the database
databaseId string
The ID of this resource.
firewallId string
The ID of the firewall to use, from the current list. If left blank or not sent, the default firewall will be used (open to all)
name string
Name of the database
networkId string
The id of the associated network
region string
The region where the database will be created.
timeouts DatabaseTimeouts
engine This property is required. str
The engine of the database
nodes This property is required. float
Count of nodes
size This property is required. str
Size of the database
version This property is required. str
The version of the database
database_id str
The ID of this resource.
firewall_id str
The ID of the firewall to use, from the current list. If left blank or not sent, the default firewall will be used (open to all)
name str
Name of the database
network_id str
The id of the associated network
region str
The region where the database will be created.
timeouts DatabaseTimeoutsArgs
engine This property is required. String
The engine of the database
nodes This property is required. Number
Count of nodes
size This property is required. String
Size of the database
version This property is required. String
The version of the database
databaseId String
The ID of this resource.
firewallId String
The ID of the firewall to use, from the current list. If left blank or not sent, the default firewall will be used (open to all)
name String
Name of the database
networkId String
The id of the associated network
region String
The region where the database will be created.
timeouts Property Map

Outputs

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

DnsEndpoint string
The DNS endpoint of the database
Endpoint string
The endpoint of the database
Id string
The provider-assigned unique ID for this managed resource.
Password string
The password of the database
Port double
The port of the database
PrivateIpv4 string
The private IP assigned to the database
Status string
The status of the database
Username string
The username of the database
DnsEndpoint string
The DNS endpoint of the database
Endpoint string
The endpoint of the database
Id string
The provider-assigned unique ID for this managed resource.
Password string
The password of the database
Port float64
The port of the database
PrivateIpv4 string
The private IP assigned to the database
Status string
The status of the database
Username string
The username of the database
dnsEndpoint String
The DNS endpoint of the database
endpoint String
The endpoint of the database
id String
The provider-assigned unique ID for this managed resource.
password String
The password of the database
port Double
The port of the database
privateIpv4 String
The private IP assigned to the database
status String
The status of the database
username String
The username of the database
dnsEndpoint string
The DNS endpoint of the database
endpoint string
The endpoint of the database
id string
The provider-assigned unique ID for this managed resource.
password string
The password of the database
port number
The port of the database
privateIpv4 string
The private IP assigned to the database
status string
The status of the database
username string
The username of the database
dns_endpoint str
The DNS endpoint of the database
endpoint str
The endpoint of the database
id str
The provider-assigned unique ID for this managed resource.
password str
The password of the database
port float
The port of the database
private_ipv4 str
The private IP assigned to the database
status str
The status of the database
username str
The username of the database
dnsEndpoint String
The DNS endpoint of the database
endpoint String
The endpoint of the database
id String
The provider-assigned unique ID for this managed resource.
password String
The password of the database
port Number
The port of the database
privateIpv4 String
The private IP assigned to the database
status String
The status of the database
username String
The username of the database

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,
        database_id: Optional[str] = None,
        dns_endpoint: Optional[str] = None,
        endpoint: Optional[str] = None,
        engine: Optional[str] = None,
        firewall_id: Optional[str] = None,
        name: Optional[str] = None,
        network_id: Optional[str] = None,
        nodes: Optional[float] = None,
        password: Optional[str] = None,
        port: Optional[float] = None,
        private_ipv4: Optional[str] = None,
        region: Optional[str] = None,
        size: Optional[str] = None,
        status: Optional[str] = None,
        timeouts: Optional[DatabaseTimeoutsArgs] = None,
        username: Optional[str] = None,
        version: 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: civo: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:
DatabaseId string
The ID of this resource.
DnsEndpoint string
The DNS endpoint of the database
Endpoint string
The endpoint of the database
Engine string
The engine of the database
FirewallId string
The ID of the firewall to use, from the current list. If left blank or not sent, the default firewall will be used (open to all)
Name string
Name of the database
NetworkId string
The id of the associated network
Nodes double
Count of nodes
Password string
The password of the database
Port double
The port of the database
PrivateIpv4 string
The private IP assigned to the database
Region string
The region where the database will be created.
Size string
Size of the database
Status string
The status of the database
Timeouts DatabaseTimeouts
Username string
The username of the database
Version string
The version of the database
DatabaseId string
The ID of this resource.
DnsEndpoint string
The DNS endpoint of the database
Endpoint string
The endpoint of the database
Engine string
The engine of the database
FirewallId string
The ID of the firewall to use, from the current list. If left blank or not sent, the default firewall will be used (open to all)
Name string
Name of the database
NetworkId string
The id of the associated network
Nodes float64
Count of nodes
Password string
The password of the database
Port float64
The port of the database
PrivateIpv4 string
The private IP assigned to the database
Region string
The region where the database will be created.
Size string
Size of the database
Status string
The status of the database
Timeouts DatabaseTimeoutsArgs
Username string
The username of the database
Version string
The version of the database
databaseId String
The ID of this resource.
dnsEndpoint String
The DNS endpoint of the database
endpoint String
The endpoint of the database
engine String
The engine of the database
firewallId String
The ID of the firewall to use, from the current list. If left blank or not sent, the default firewall will be used (open to all)
name String
Name of the database
networkId String
The id of the associated network
nodes Double
Count of nodes
password String
The password of the database
port Double
The port of the database
privateIpv4 String
The private IP assigned to the database
region String
The region where the database will be created.
size String
Size of the database
status String
The status of the database
timeouts DatabaseTimeouts
username String
The username of the database
version String
The version of the database
databaseId string
The ID of this resource.
dnsEndpoint string
The DNS endpoint of the database
endpoint string
The endpoint of the database
engine string
The engine of the database
firewallId string
The ID of the firewall to use, from the current list. If left blank or not sent, the default firewall will be used (open to all)
name string
Name of the database
networkId string
The id of the associated network
nodes number
Count of nodes
password string
The password of the database
port number
The port of the database
privateIpv4 string
The private IP assigned to the database
region string
The region where the database will be created.
size string
Size of the database
status string
The status of the database
timeouts DatabaseTimeouts
username string
The username of the database
version string
The version of the database
database_id str
The ID of this resource.
dns_endpoint str
The DNS endpoint of the database
endpoint str
The endpoint of the database
engine str
The engine of the database
firewall_id str
The ID of the firewall to use, from the current list. If left blank or not sent, the default firewall will be used (open to all)
name str
Name of the database
network_id str
The id of the associated network
nodes float
Count of nodes
password str
The password of the database
port float
The port of the database
private_ipv4 str
The private IP assigned to the database
region str
The region where the database will be created.
size str
Size of the database
status str
The status of the database
timeouts DatabaseTimeoutsArgs
username str
The username of the database
version str
The version of the database
databaseId String
The ID of this resource.
dnsEndpoint String
The DNS endpoint of the database
endpoint String
The endpoint of the database
engine String
The engine of the database
firewallId String
The ID of the firewall to use, from the current list. If left blank or not sent, the default firewall will be used (open to all)
name String
Name of the database
networkId String
The id of the associated network
nodes Number
Count of nodes
password String
The password of the database
port Number
The port of the database
privateIpv4 String
The private IP assigned to the database
region String
The region where the database will be created.
size String
Size of the database
status String
The status of the database
timeouts Property Map
username String
The username of the database
version String
The version of the database

Supporting Types

DatabaseTimeouts
, DatabaseTimeoutsArgs

Create string
Delete string
Update string
Create string
Delete string
Update string
create String
delete String
update String
create string
delete string
update string
create str
delete str
update str
create String
delete String
update String

Import

using ID

$ pulumi import civo:index/database:Database mydb 29fcd1c4-fb61-44c7-b49c-dc7b98e9927e
Copy

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

Package Details

Repository
Civo civo/terraform-provider-civo
License
Notes
This Pulumi package is based on the civo Terraform Provider.