1. Packages
  2. UpCloud
  3. API Docs
  4. ManagedDatabaseLogicalDatabase
UpCloud v0.2.0 published on Wednesday, Apr 16, 2025 by UpCloudLtd

upcloud.ManagedDatabaseLogicalDatabase

Explore with Pulumi AI

This resource represents a logical database in managed database

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as upcloud from "@upcloud/pulumi-upcloud";

// PostgreSQL managed database with additional logical database: example_db 
const example = new upcloud.ManagedDatabasePostgresql("example", {
    name: "postgres",
    plan: "1x1xCPU-2GB-25GB",
    title: "postgres",
    zone: "fi-hel1",
});
const exampleDb = new upcloud.ManagedDatabaseLogicalDatabase("example_db", {
    service: example.id,
    name: "example_db",
});
// MySQL managed database with additional logical database: example2_db 
const exampleManagedDatabaseMysql = new upcloud.ManagedDatabaseMysql("example", {
    name: "mysql",
    plan: "1x1xCPU-2GB-25GB",
    title: "mysql",
    zone: "fi-hel1",
});
const example2Db = new upcloud.ManagedDatabaseLogicalDatabase("example2_db", {
    service: exampleManagedDatabaseMysql.id,
    name: "example2_db",
});
Copy
import pulumi
import pulumi_upcloud as upcloud

# PostgreSQL managed database with additional logical database: example_db 
example = upcloud.ManagedDatabasePostgresql("example",
    name="postgres",
    plan="1x1xCPU-2GB-25GB",
    title="postgres",
    zone="fi-hel1")
example_db = upcloud.ManagedDatabaseLogicalDatabase("example_db",
    service=example.id,
    name="example_db")
# MySQL managed database with additional logical database: example2_db 
example_managed_database_mysql = upcloud.ManagedDatabaseMysql("example",
    name="mysql",
    plan="1x1xCPU-2GB-25GB",
    title="mysql",
    zone="fi-hel1")
example2_db = upcloud.ManagedDatabaseLogicalDatabase("example2_db",
    service=example_managed_database_mysql.id,
    name="example2_db")
Copy
package main

import (
	"github.com/UpCloudLtd/pulumi-upcloud/sdk/go/upcloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// PostgreSQL managed database with additional logical database: example_db
		example, err := upcloud.NewManagedDatabasePostgresql(ctx, "example", &upcloud.ManagedDatabasePostgresqlArgs{
			Name:  pulumi.String("postgres"),
			Plan:  pulumi.String("1x1xCPU-2GB-25GB"),
			Title: pulumi.String("postgres"),
			Zone:  pulumi.String("fi-hel1"),
		})
		if err != nil {
			return err
		}
		_, err = upcloud.NewManagedDatabaseLogicalDatabase(ctx, "example_db", &upcloud.ManagedDatabaseLogicalDatabaseArgs{
			Service: example.ID(),
			Name:    pulumi.String("example_db"),
		})
		if err != nil {
			return err
		}
		// MySQL managed database with additional logical database: example2_db
		exampleManagedDatabaseMysql, err := upcloud.NewManagedDatabaseMysql(ctx, "example", &upcloud.ManagedDatabaseMysqlArgs{
			Name:  pulumi.String("mysql"),
			Plan:  pulumi.String("1x1xCPU-2GB-25GB"),
			Title: pulumi.String("mysql"),
			Zone:  pulumi.String("fi-hel1"),
		})
		if err != nil {
			return err
		}
		_, err = upcloud.NewManagedDatabaseLogicalDatabase(ctx, "example2_db", &upcloud.ManagedDatabaseLogicalDatabaseArgs{
			Service: exampleManagedDatabaseMysql.ID(),
			Name:    pulumi.String("example2_db"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using UpCloud = UpCloud.Pulumi.UpCloud;

return await Deployment.RunAsync(() => 
{
    // PostgreSQL managed database with additional logical database: example_db 
    var example = new UpCloud.ManagedDatabasePostgresql("example", new()
    {
        Name = "postgres",
        Plan = "1x1xCPU-2GB-25GB",
        Title = "postgres",
        Zone = "fi-hel1",
    });

    var exampleDb = new UpCloud.ManagedDatabaseLogicalDatabase("example_db", new()
    {
        Service = example.Id,
        Name = "example_db",
    });

    // MySQL managed database with additional logical database: example2_db 
    var exampleManagedDatabaseMysql = new UpCloud.ManagedDatabaseMysql("example", new()
    {
        Name = "mysql",
        Plan = "1x1xCPU-2GB-25GB",
        Title = "mysql",
        Zone = "fi-hel1",
    });

    var example2Db = new UpCloud.ManagedDatabaseLogicalDatabase("example2_db", new()
    {
        Service = exampleManagedDatabaseMysql.Id,
        Name = "example2_db",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.upcloud.ManagedDatabasePostgresql;
import com.pulumi.upcloud.ManagedDatabasePostgresqlArgs;
import com.pulumi.upcloud.ManagedDatabaseLogicalDatabase;
import com.pulumi.upcloud.ManagedDatabaseLogicalDatabaseArgs;
import com.pulumi.upcloud.ManagedDatabaseMysql;
import com.pulumi.upcloud.ManagedDatabaseMysqlArgs;
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) {
        // PostgreSQL managed database with additional logical database: example_db 
        var example = new ManagedDatabasePostgresql("example", ManagedDatabasePostgresqlArgs.builder()
            .name("postgres")
            .plan("1x1xCPU-2GB-25GB")
            .title("postgres")
            .zone("fi-hel1")
            .build());

        var exampleDb = new ManagedDatabaseLogicalDatabase("exampleDb", ManagedDatabaseLogicalDatabaseArgs.builder()
            .service(example.id())
            .name("example_db")
            .build());

        // MySQL managed database with additional logical database: example2_db 
        var exampleManagedDatabaseMysql = new ManagedDatabaseMysql("exampleManagedDatabaseMysql", ManagedDatabaseMysqlArgs.builder()
            .name("mysql")
            .plan("1x1xCPU-2GB-25GB")
            .title("mysql")
            .zone("fi-hel1")
            .build());

        var example2Db = new ManagedDatabaseLogicalDatabase("example2Db", ManagedDatabaseLogicalDatabaseArgs.builder()
            .service(exampleManagedDatabaseMysql.id())
            .name("example2_db")
            .build());

    }
}
Copy
resources:
  # PostgreSQL managed database with additional logical database: example_db
  example:
    type: upcloud:ManagedDatabasePostgresql
    properties:
      name: postgres
      plan: 1x1xCPU-2GB-25GB
      title: postgres
      zone: fi-hel1
  exampleDb:
    type: upcloud:ManagedDatabaseLogicalDatabase
    name: example_db
    properties:
      service: ${example.id}
      name: example_db
  # MySQL managed database with additional logical database: example2_db
  exampleManagedDatabaseMysql:
    type: upcloud:ManagedDatabaseMysql
    name: example
    properties:
      name: mysql
      plan: 1x1xCPU-2GB-25GB
      title: mysql
      zone: fi-hel1
  example2Db:
    type: upcloud:ManagedDatabaseLogicalDatabase
    name: example2_db
    properties:
      service: ${exampleManagedDatabaseMysql.id}
      name: example2_db
Copy

Create ManagedDatabaseLogicalDatabase Resource

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

Constructor syntax

new ManagedDatabaseLogicalDatabase(name: string, args: ManagedDatabaseLogicalDatabaseArgs, opts?: CustomResourceOptions);
@overload
def ManagedDatabaseLogicalDatabase(resource_name: str,
                                   args: ManagedDatabaseLogicalDatabaseArgs,
                                   opts: Optional[ResourceOptions] = None)

@overload
def ManagedDatabaseLogicalDatabase(resource_name: str,
                                   opts: Optional[ResourceOptions] = None,
                                   service: Optional[str] = None,
                                   character_set: Optional[str] = None,
                                   collation: Optional[str] = None,
                                   name: Optional[str] = None)
func NewManagedDatabaseLogicalDatabase(ctx *Context, name string, args ManagedDatabaseLogicalDatabaseArgs, opts ...ResourceOption) (*ManagedDatabaseLogicalDatabase, error)
public ManagedDatabaseLogicalDatabase(string name, ManagedDatabaseLogicalDatabaseArgs args, CustomResourceOptions? opts = null)
public ManagedDatabaseLogicalDatabase(String name, ManagedDatabaseLogicalDatabaseArgs args)
public ManagedDatabaseLogicalDatabase(String name, ManagedDatabaseLogicalDatabaseArgs args, CustomResourceOptions options)
type: upcloud:ManagedDatabaseLogicalDatabase
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. ManagedDatabaseLogicalDatabaseArgs
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. ManagedDatabaseLogicalDatabaseArgs
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. ManagedDatabaseLogicalDatabaseArgs
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. ManagedDatabaseLogicalDatabaseArgs
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. ManagedDatabaseLogicalDatabaseArgs
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 managedDatabaseLogicalDatabaseResource = new UpCloud.ManagedDatabaseLogicalDatabase("managedDatabaseLogicalDatabaseResource", new()
{
    Service = "string",
    CharacterSet = "string",
    Collation = "string",
    Name = "string",
});
Copy
example, err := upcloud.NewManagedDatabaseLogicalDatabase(ctx, "managedDatabaseLogicalDatabaseResource", &upcloud.ManagedDatabaseLogicalDatabaseArgs{
	Service:      pulumi.String("string"),
	CharacterSet: pulumi.String("string"),
	Collation:    pulumi.String("string"),
	Name:         pulumi.String("string"),
})
Copy
var managedDatabaseLogicalDatabaseResource = new ManagedDatabaseLogicalDatabase("managedDatabaseLogicalDatabaseResource", ManagedDatabaseLogicalDatabaseArgs.builder()
    .service("string")
    .characterSet("string")
    .collation("string")
    .name("string")
    .build());
Copy
managed_database_logical_database_resource = upcloud.ManagedDatabaseLogicalDatabase("managedDatabaseLogicalDatabaseResource",
    service="string",
    character_set="string",
    collation="string",
    name="string")
Copy
const managedDatabaseLogicalDatabaseResource = new upcloud.ManagedDatabaseLogicalDatabase("managedDatabaseLogicalDatabaseResource", {
    service: "string",
    characterSet: "string",
    collation: "string",
    name: "string",
});
Copy
type: upcloud:ManagedDatabaseLogicalDatabase
properties:
    characterSet: string
    collation: string
    name: string
    service: string
Copy

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

Service
This property is required.
Changes to this property will trigger replacement.
string
Service's UUID for which this user belongs to
CharacterSet Changes to this property will trigger replacement. string
Default character set for the database (LC_CTYPE)
Collation Changes to this property will trigger replacement. string
Default collation for the database (LC_COLLATE)
Name Changes to this property will trigger replacement. string
Name of the logical database
Service
This property is required.
Changes to this property will trigger replacement.
string
Service's UUID for which this user belongs to
CharacterSet Changes to this property will trigger replacement. string
Default character set for the database (LC_CTYPE)
Collation Changes to this property will trigger replacement. string
Default collation for the database (LC_COLLATE)
Name Changes to this property will trigger replacement. string
Name of the logical database
service
This property is required.
Changes to this property will trigger replacement.
String
Service's UUID for which this user belongs to
characterSet Changes to this property will trigger replacement. String
Default character set for the database (LC_CTYPE)
collation Changes to this property will trigger replacement. String
Default collation for the database (LC_COLLATE)
name Changes to this property will trigger replacement. String
Name of the logical database
service
This property is required.
Changes to this property will trigger replacement.
string
Service's UUID for which this user belongs to
characterSet Changes to this property will trigger replacement. string
Default character set for the database (LC_CTYPE)
collation Changes to this property will trigger replacement. string
Default collation for the database (LC_COLLATE)
name Changes to this property will trigger replacement. string
Name of the logical database
service
This property is required.
Changes to this property will trigger replacement.
str
Service's UUID for which this user belongs to
character_set Changes to this property will trigger replacement. str
Default character set for the database (LC_CTYPE)
collation Changes to this property will trigger replacement. str
Default collation for the database (LC_COLLATE)
name Changes to this property will trigger replacement. str
Name of the logical database
service
This property is required.
Changes to this property will trigger replacement.
String
Service's UUID for which this user belongs to
characterSet Changes to this property will trigger replacement. String
Default character set for the database (LC_CTYPE)
collation Changes to this property will trigger replacement. String
Default collation for the database (LC_COLLATE)
name Changes to this property will trigger replacement. String
Name of the logical database

Outputs

All input properties are implicitly available as output properties. Additionally, the ManagedDatabaseLogicalDatabase 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 ManagedDatabaseLogicalDatabase Resource

Get an existing ManagedDatabaseLogicalDatabase 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?: ManagedDatabaseLogicalDatabaseState, opts?: CustomResourceOptions): ManagedDatabaseLogicalDatabase
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        character_set: Optional[str] = None,
        collation: Optional[str] = None,
        name: Optional[str] = None,
        service: Optional[str] = None) -> ManagedDatabaseLogicalDatabase
func GetManagedDatabaseLogicalDatabase(ctx *Context, name string, id IDInput, state *ManagedDatabaseLogicalDatabaseState, opts ...ResourceOption) (*ManagedDatabaseLogicalDatabase, error)
public static ManagedDatabaseLogicalDatabase Get(string name, Input<string> id, ManagedDatabaseLogicalDatabaseState? state, CustomResourceOptions? opts = null)
public static ManagedDatabaseLogicalDatabase get(String name, Output<String> id, ManagedDatabaseLogicalDatabaseState state, CustomResourceOptions options)
resources:  _:    type: upcloud:ManagedDatabaseLogicalDatabase    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:
CharacterSet Changes to this property will trigger replacement. string
Default character set for the database (LC_CTYPE)
Collation Changes to this property will trigger replacement. string
Default collation for the database (LC_COLLATE)
Name Changes to this property will trigger replacement. string
Name of the logical database
Service Changes to this property will trigger replacement. string
Service's UUID for which this user belongs to
CharacterSet Changes to this property will trigger replacement. string
Default character set for the database (LC_CTYPE)
Collation Changes to this property will trigger replacement. string
Default collation for the database (LC_COLLATE)
Name Changes to this property will trigger replacement. string
Name of the logical database
Service Changes to this property will trigger replacement. string
Service's UUID for which this user belongs to
characterSet Changes to this property will trigger replacement. String
Default character set for the database (LC_CTYPE)
collation Changes to this property will trigger replacement. String
Default collation for the database (LC_COLLATE)
name Changes to this property will trigger replacement. String
Name of the logical database
service Changes to this property will trigger replacement. String
Service's UUID for which this user belongs to
characterSet Changes to this property will trigger replacement. string
Default character set for the database (LC_CTYPE)
collation Changes to this property will trigger replacement. string
Default collation for the database (LC_COLLATE)
name Changes to this property will trigger replacement. string
Name of the logical database
service Changes to this property will trigger replacement. string
Service's UUID for which this user belongs to
character_set Changes to this property will trigger replacement. str
Default character set for the database (LC_CTYPE)
collation Changes to this property will trigger replacement. str
Default collation for the database (LC_COLLATE)
name Changes to this property will trigger replacement. str
Name of the logical database
service Changes to this property will trigger replacement. str
Service's UUID for which this user belongs to
characterSet Changes to this property will trigger replacement. String
Default character set for the database (LC_CTYPE)
collation Changes to this property will trigger replacement. String
Default collation for the database (LC_COLLATE)
name Changes to this property will trigger replacement. String
Name of the logical database
service Changes to this property will trigger replacement. String
Service's UUID for which this user belongs to

Package Details

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