1. Packages
  2. Scaleway
  3. API Docs
  4. DocumentdbDatabase
Scaleway v1.15.0 published on Tuesday, Jul 30, 2024 by pulumiverse

scaleway.DocumentdbDatabase

Explore with Pulumi AI

scaleway logo
Scaleway v1.15.0 published on Tuesday, Jul 30, 2024 by pulumiverse

    Creates and manages Scaleway DocumentDB database.

    Example Usage

    Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumiverse/scaleway";
    
    const instance = new scaleway.DocumentdbInstance("instance", {
        nodeType: "docdb-play2-pico",
        engine: "FerretDB-1",
        userName: "my_initial_user",
        password: "thiZ_is_v&ry_s3cret",
        volumeSizeInGb: 20,
    });
    const main = new scaleway.DocumentdbDatabase("main", {instanceId: instance.id});
    
    import pulumi
    import pulumiverse_scaleway as scaleway
    
    instance = scaleway.DocumentdbInstance("instance",
        node_type="docdb-play2-pico",
        engine="FerretDB-1",
        user_name="my_initial_user",
        password="thiZ_is_v&ry_s3cret",
        volume_size_in_gb=20)
    main = scaleway.DocumentdbDatabase("main", instance_id=instance.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		instance, err := scaleway.NewDocumentdbInstance(ctx, "instance", &scaleway.DocumentdbInstanceArgs{
    			NodeType:       pulumi.String("docdb-play2-pico"),
    			Engine:         pulumi.String("FerretDB-1"),
    			UserName:       pulumi.String("my_initial_user"),
    			Password:       pulumi.String("thiZ_is_v&ry_s3cret"),
    			VolumeSizeInGb: pulumi.Int(20),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = scaleway.NewDocumentdbDatabase(ctx, "main", &scaleway.DocumentdbDatabaseArgs{
    			InstanceId: instance.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Scaleway = Pulumiverse.Scaleway;
    
    return await Deployment.RunAsync(() => 
    {
        var instance = new Scaleway.DocumentdbInstance("instance", new()
        {
            NodeType = "docdb-play2-pico",
            Engine = "FerretDB-1",
            UserName = "my_initial_user",
            Password = "thiZ_is_v&ry_s3cret",
            VolumeSizeInGb = 20,
        });
    
        var main = new Scaleway.DocumentdbDatabase("main", new()
        {
            InstanceId = instance.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.DocumentdbInstance;
    import com.pulumi.scaleway.DocumentdbInstanceArgs;
    import com.pulumi.scaleway.DocumentdbDatabase;
    import com.pulumi.scaleway.DocumentdbDatabaseArgs;
    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 instance = new DocumentdbInstance("instance", DocumentdbInstanceArgs.builder()
                .nodeType("docdb-play2-pico")
                .engine("FerretDB-1")
                .userName("my_initial_user")
                .password("thiZ_is_v&ry_s3cret")
                .volumeSizeInGb(20)
                .build());
    
            var main = new DocumentdbDatabase("main", DocumentdbDatabaseArgs.builder()
                .instanceId(instance.id())
                .build());
    
        }
    }
    
    resources:
      instance:
        type: scaleway:DocumentdbInstance
        properties:
          nodeType: docdb-play2-pico
          engine: FerretDB-1
          userName: my_initial_user
          password: thiZ_is_v&ry_s3cret
          volumeSizeInGb: 20
      main:
        type: scaleway:DocumentdbDatabase
        properties:
          instanceId: ${instance.id}
    

    Create DocumentdbDatabase Resource

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

    Constructor syntax

    new DocumentdbDatabase(name: string, args: DocumentdbDatabaseArgs, opts?: CustomResourceOptions);
    @overload
    def DocumentdbDatabase(resource_name: str,
                           args: DocumentdbDatabaseArgs,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def DocumentdbDatabase(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           instance_id: Optional[str] = None,
                           name: Optional[str] = None,
                           project_id: Optional[str] = None,
                           region: Optional[str] = None)
    func NewDocumentdbDatabase(ctx *Context, name string, args DocumentdbDatabaseArgs, opts ...ResourceOption) (*DocumentdbDatabase, error)
    public DocumentdbDatabase(string name, DocumentdbDatabaseArgs args, CustomResourceOptions? opts = null)
    public DocumentdbDatabase(String name, DocumentdbDatabaseArgs args)
    public DocumentdbDatabase(String name, DocumentdbDatabaseArgs args, CustomResourceOptions options)
    
    type: scaleway:DocumentdbDatabase
    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 DocumentdbDatabaseArgs
    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 DocumentdbDatabaseArgs
    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 DocumentdbDatabaseArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DocumentdbDatabaseArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DocumentdbDatabaseArgs
    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 documentdbDatabaseResource = new Scaleway.DocumentdbDatabase("documentdbDatabaseResource", new()
    {
        InstanceId = "string",
        Name = "string",
        ProjectId = "string",
        Region = "string",
    });
    
    example, err := scaleway.NewDocumentdbDatabase(ctx, "documentdbDatabaseResource", &scaleway.DocumentdbDatabaseArgs{
    	InstanceId: pulumi.String("string"),
    	Name:       pulumi.String("string"),
    	ProjectId:  pulumi.String("string"),
    	Region:     pulumi.String("string"),
    })
    
    var documentdbDatabaseResource = new DocumentdbDatabase("documentdbDatabaseResource", DocumentdbDatabaseArgs.builder()
        .instanceId("string")
        .name("string")
        .projectId("string")
        .region("string")
        .build());
    
    documentdb_database_resource = scaleway.DocumentdbDatabase("documentdbDatabaseResource",
        instance_id="string",
        name="string",
        project_id="string",
        region="string")
    
    const documentdbDatabaseResource = new scaleway.DocumentdbDatabase("documentdbDatabaseResource", {
        instanceId: "string",
        name: "string",
        projectId: "string",
        region: "string",
    });
    
    type: scaleway:DocumentdbDatabase
    properties:
        instanceId: string
        name: string
        projectId: string
        region: string
    

    DocumentdbDatabase Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The DocumentdbDatabase resource accepts the following input properties:

    InstanceId string

    UUID of the documentdb instance.

    Important: Updates to instance_id will recreate the Database.

    Name string
    Name of the database (e.g. my-new-database).
    ProjectId string
    The project_id you want to attach the resource to
    Region string
    region) The region in which the resource exists.
    InstanceId string

    UUID of the documentdb instance.

    Important: Updates to instance_id will recreate the Database.

    Name string
    Name of the database (e.g. my-new-database).
    ProjectId string
    The project_id you want to attach the resource to
    Region string
    region) The region in which the resource exists.
    instanceId String

    UUID of the documentdb instance.

    Important: Updates to instance_id will recreate the Database.

    name String
    Name of the database (e.g. my-new-database).
    projectId String
    The project_id you want to attach the resource to
    region String
    region) The region in which the resource exists.
    instanceId string

    UUID of the documentdb instance.

    Important: Updates to instance_id will recreate the Database.

    name string
    Name of the database (e.g. my-new-database).
    projectId string
    The project_id you want to attach the resource to
    region string
    region) The region in which the resource exists.
    instance_id str

    UUID of the documentdb instance.

    Important: Updates to instance_id will recreate the Database.

    name str
    Name of the database (e.g. my-new-database).
    project_id str
    The project_id you want to attach the resource to
    region str
    region) The region in which the resource exists.
    instanceId String

    UUID of the documentdb instance.

    Important: Updates to instance_id will recreate the Database.

    name String
    Name of the database (e.g. my-new-database).
    projectId String
    The project_id you want to attach the resource to
    region String
    region) The region in which the resource exists.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Managed bool
    Whether the database is managed or not.
    Owner string
    The name of the owner of the database.
    Size string
    Size in gigabytes of the database.
    Id string
    The provider-assigned unique ID for this managed resource.
    Managed bool
    Whether the database is managed or not.
    Owner string
    The name of the owner of the database.
    Size string
    Size in gigabytes of the database.
    id String
    The provider-assigned unique ID for this managed resource.
    managed Boolean
    Whether the database is managed or not.
    owner String
    The name of the owner of the database.
    size String
    Size in gigabytes of the database.
    id string
    The provider-assigned unique ID for this managed resource.
    managed boolean
    Whether the database is managed or not.
    owner string
    The name of the owner of the database.
    size string
    Size in gigabytes of the database.
    id str
    The provider-assigned unique ID for this managed resource.
    managed bool
    Whether the database is managed or not.
    owner str
    The name of the owner of the database.
    size str
    Size in gigabytes of the database.
    id String
    The provider-assigned unique ID for this managed resource.
    managed Boolean
    Whether the database is managed or not.
    owner String
    The name of the owner of the database.
    size String
    Size in gigabytes of the database.

    Look up Existing DocumentdbDatabase Resource

    Get an existing DocumentdbDatabase 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?: DocumentdbDatabaseState, opts?: CustomResourceOptions): DocumentdbDatabase
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            instance_id: Optional[str] = None,
            managed: Optional[bool] = None,
            name: Optional[str] = None,
            owner: Optional[str] = None,
            project_id: Optional[str] = None,
            region: Optional[str] = None,
            size: Optional[str] = None) -> DocumentdbDatabase
    func GetDocumentdbDatabase(ctx *Context, name string, id IDInput, state *DocumentdbDatabaseState, opts ...ResourceOption) (*DocumentdbDatabase, error)
    public static DocumentdbDatabase Get(string name, Input<string> id, DocumentdbDatabaseState? state, CustomResourceOptions? opts = null)
    public static DocumentdbDatabase get(String name, Output<String> id, DocumentdbDatabaseState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    InstanceId string

    UUID of the documentdb instance.

    Important: Updates to instance_id will recreate the Database.

    Managed bool
    Whether the database is managed or not.
    Name string
    Name of the database (e.g. my-new-database).
    Owner string
    The name of the owner of the database.
    ProjectId string
    The project_id you want to attach the resource to
    Region string
    region) The region in which the resource exists.
    Size string
    Size in gigabytes of the database.
    InstanceId string

    UUID of the documentdb instance.

    Important: Updates to instance_id will recreate the Database.

    Managed bool
    Whether the database is managed or not.
    Name string
    Name of the database (e.g. my-new-database).
    Owner string
    The name of the owner of the database.
    ProjectId string
    The project_id you want to attach the resource to
    Region string
    region) The region in which the resource exists.
    Size string
    Size in gigabytes of the database.
    instanceId String

    UUID of the documentdb instance.

    Important: Updates to instance_id will recreate the Database.

    managed Boolean
    Whether the database is managed or not.
    name String
    Name of the database (e.g. my-new-database).
    owner String
    The name of the owner of the database.
    projectId String
    The project_id you want to attach the resource to
    region String
    region) The region in which the resource exists.
    size String
    Size in gigabytes of the database.
    instanceId string

    UUID of the documentdb instance.

    Important: Updates to instance_id will recreate the Database.

    managed boolean
    Whether the database is managed or not.
    name string
    Name of the database (e.g. my-new-database).
    owner string
    The name of the owner of the database.
    projectId string
    The project_id you want to attach the resource to
    region string
    region) The region in which the resource exists.
    size string
    Size in gigabytes of the database.
    instance_id str

    UUID of the documentdb instance.

    Important: Updates to instance_id will recreate the Database.

    managed bool
    Whether the database is managed or not.
    name str
    Name of the database (e.g. my-new-database).
    owner str
    The name of the owner of the database.
    project_id str
    The project_id you want to attach the resource to
    region str
    region) The region in which the resource exists.
    size str
    Size in gigabytes of the database.
    instanceId String

    UUID of the documentdb instance.

    Important: Updates to instance_id will recreate the Database.

    managed Boolean
    Whether the database is managed or not.
    name String
    Name of the database (e.g. my-new-database).
    owner String
    The name of the owner of the database.
    projectId String
    The project_id you want to attach the resource to
    region String
    region) The region in which the resource exists.
    size String
    Size in gigabytes of the database.

    Import

    DocumentDB Database can be imported using the {region}/{id}/{DBNAME}, e.g.

    bash

    $ pulumi import scaleway:index/documentdbDatabase:DocumentdbDatabase mydb fr-par/11111111-1111-1111-1111-111111111111/mydb
    

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

    Package Details

    Repository
    scaleway pulumiverse/pulumi-scaleway
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the scaleway Terraform Provider.
    scaleway logo
    Scaleway v1.15.0 published on Tuesday, Jul 30, 2024 by pulumiverse