1. Packages
  2. Volcengine
  3. API Docs
  4. rds_postgresql
  5. Database
Volcengine v0.0.24 published on Tuesday, Jun 25, 2024 by Volcengine

volcengine.rds_postgresql.Database

Explore with Pulumi AI

volcengine logo
Volcengine v0.0.24 published on Tuesday, Jun 25, 2024 by Volcengine

    Provides a resource to manage rds postgresql database

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Volcengine = Pulumi.Volcengine;
    
    return await Deployment.RunAsync(() => 
    {
        var foo = new Volcengine.Rds_postgresql.Database("foo", new()
        {
            CType = "C",
            Collate = "zh_CN.utf8",
            DbName = "acc-test",
            InstanceId = "postgres-95*******233",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/rds_postgresql"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := rds_postgresql.NewDatabase(ctx, "foo", &rds_postgresql.DatabaseArgs{
    			CType:      pulumi.String("C"),
    			Collate:    pulumi.String("zh_CN.utf8"),
    			DbName:     pulumi.String("acc-test"),
    			InstanceId: pulumi.String("postgres-95*******233"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.volcengine.rds_postgresql.Database;
    import com.pulumi.volcengine.rds_postgresql.DatabaseArgs;
    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 foo = new Database("foo", DatabaseArgs.builder()        
                .cType("C")
                .collate("zh_CN.utf8")
                .dbName("acc-test")
                .instanceId("postgres-95*******233")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_volcengine as volcengine
    
    foo = volcengine.rds_postgresql.Database("foo",
        c_type="C",
        collate="zh_CN.utf8",
        db_name="acc-test",
        instance_id="postgres-95*******233")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as volcengine from "@volcengine/pulumi";
    
    const foo = new volcengine.rds_postgresql.Database("foo", {
        cType: "C",
        collate: "zh_CN.utf8",
        dbName: "acc-test",
        instanceId: "postgres-95*******233",
    });
    
    resources:
      foo:
        type: volcengine:rds_postgresql:Database
        properties:
          cType: C
          collate: zh_CN.utf8
          dbName: acc-test
          instanceId: postgres-95*******233
    

    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,
                 db_name: Optional[str] = None,
                 instance_id: Optional[str] = None,
                 c_type: Optional[str] = None,
                 character_set_name: Optional[str] = None,
                 collate: Optional[str] = None,
                 owner: Optional[str] = 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: volcengine:rds_postgresql:Database
    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 DatabaseArgs
    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 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 string
    The unique name of the resource.
    args DatabaseArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DatabaseArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args 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 exampledatabaseResourceResourceFromRds_postgresqldatabase = new Volcengine.Rds_postgresql.Database("exampledatabaseResourceResourceFromRds_postgresqldatabase", new()
    {
        DbName = "string",
        InstanceId = "string",
        CType = "string",
        CharacterSetName = "string",
        Collate = "string",
        Owner = "string",
    });
    
    example, err := rds_postgresql.NewDatabase(ctx, "exampledatabaseResourceResourceFromRds_postgresqldatabase", &rds_postgresql.DatabaseArgs{
    	DbName:           pulumi.String("string"),
    	InstanceId:       pulumi.String("string"),
    	CType:            pulumi.String("string"),
    	CharacterSetName: pulumi.String("string"),
    	Collate:          pulumi.String("string"),
    	Owner:            pulumi.String("string"),
    })
    
    var exampledatabaseResourceResourceFromRds_postgresqldatabase = new Database("exampledatabaseResourceResourceFromRds_postgresqldatabase", DatabaseArgs.builder()
        .dbName("string")
        .instanceId("string")
        .cType("string")
        .characterSetName("string")
        .collate("string")
        .owner("string")
        .build());
    
    exampledatabase_resource_resource_from_rds_postgresqldatabase = volcengine.rds_postgresql.Database("exampledatabaseResourceResourceFromRds_postgresqldatabase",
        db_name="string",
        instance_id="string",
        c_type="string",
        character_set_name="string",
        collate="string",
        owner="string")
    
    const exampledatabaseResourceResourceFromRds_postgresqldatabase = new volcengine.rds_postgresql.Database("exampledatabaseResourceResourceFromRds_postgresqldatabase", {
        dbName: "string",
        instanceId: "string",
        cType: "string",
        characterSetName: "string",
        collate: "string",
        owner: "string",
    });
    
    type: volcengine:rds_postgresql:Database
    properties:
        cType: string
        characterSetName: string
        collate: string
        dbName: string
        instanceId: string
        owner: string
    

    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

    The Database resource accepts the following input properties:

    DbName string
    The name of database.
    InstanceId string
    The ID of the RDS instance.
    CType string
    Character classification. Value range: C (default), C.UTF-8, en_US.utf8, zh_CN.utf8, and POSIX.
    CharacterSetName string
    Database character set. Currently supported character sets include: utf8, latin1, ascii. Default is utf8.
    Collate string
    The collate of database. Sorting rules. Value range: C (default), C.UTF-8, en_US.utf8, zh_CN.utf8 and POSIX.
    Owner string
    The owner of database.
    DbName string
    The name of database.
    InstanceId string
    The ID of the RDS instance.
    CType string
    Character classification. Value range: C (default), C.UTF-8, en_US.utf8, zh_CN.utf8, and POSIX.
    CharacterSetName string
    Database character set. Currently supported character sets include: utf8, latin1, ascii. Default is utf8.
    Collate string
    The collate of database. Sorting rules. Value range: C (default), C.UTF-8, en_US.utf8, zh_CN.utf8 and POSIX.
    Owner string
    The owner of database.
    dbName String
    The name of database.
    instanceId String
    The ID of the RDS instance.
    cType String
    Character classification. Value range: C (default), C.UTF-8, en_US.utf8, zh_CN.utf8, and POSIX.
    characterSetName String
    Database character set. Currently supported character sets include: utf8, latin1, ascii. Default is utf8.
    collate String
    The collate of database. Sorting rules. Value range: C (default), C.UTF-8, en_US.utf8, zh_CN.utf8 and POSIX.
    owner String
    The owner of database.
    dbName string
    The name of database.
    instanceId string
    The ID of the RDS instance.
    cType string
    Character classification. Value range: C (default), C.UTF-8, en_US.utf8, zh_CN.utf8, and POSIX.
    characterSetName string
    Database character set. Currently supported character sets include: utf8, latin1, ascii. Default is utf8.
    collate string
    The collate of database. Sorting rules. Value range: C (default), C.UTF-8, en_US.utf8, zh_CN.utf8 and POSIX.
    owner string
    The owner of database.
    db_name str
    The name of database.
    instance_id str
    The ID of the RDS instance.
    c_type str
    Character classification. Value range: C (default), C.UTF-8, en_US.utf8, zh_CN.utf8, and POSIX.
    character_set_name str
    Database character set. Currently supported character sets include: utf8, latin1, ascii. Default is utf8.
    collate str
    The collate of database. Sorting rules. Value range: C (default), C.UTF-8, en_US.utf8, zh_CN.utf8 and POSIX.
    owner str
    The owner of database.
    dbName String
    The name of database.
    instanceId String
    The ID of the RDS instance.
    cType String
    Character classification. Value range: C (default), C.UTF-8, en_US.utf8, zh_CN.utf8, and POSIX.
    characterSetName String
    Database character set. Currently supported character sets include: utf8, latin1, ascii. Default is utf8.
    collate String
    The collate of database. Sorting rules. Value range: C (default), C.UTF-8, en_US.utf8, zh_CN.utf8 and POSIX.
    owner String
    The owner of database.

    Outputs

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

    DbStatus string
    The status of the RDS database.
    Id string
    The provider-assigned unique ID for this managed resource.
    DbStatus string
    The status of the RDS database.
    Id string
    The provider-assigned unique ID for this managed resource.
    dbStatus String
    The status of the RDS database.
    id String
    The provider-assigned unique ID for this managed resource.
    dbStatus string
    The status of the RDS database.
    id string
    The provider-assigned unique ID for this managed resource.
    db_status str
    The status of the RDS database.
    id str
    The provider-assigned unique ID for this managed resource.
    dbStatus String
    The status of the RDS database.
    id String
    The provider-assigned unique ID for this managed resource.

    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,
            c_type: Optional[str] = None,
            character_set_name: Optional[str] = None,
            collate: Optional[str] = None,
            db_name: Optional[str] = None,
            db_status: Optional[str] = None,
            instance_id: Optional[str] = None,
            owner: 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)
    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:
    CType string
    Character classification. Value range: C (default), C.UTF-8, en_US.utf8, zh_CN.utf8, and POSIX.
    CharacterSetName string
    Database character set. Currently supported character sets include: utf8, latin1, ascii. Default is utf8.
    Collate string
    The collate of database. Sorting rules. Value range: C (default), C.UTF-8, en_US.utf8, zh_CN.utf8 and POSIX.
    DbName string
    The name of database.
    DbStatus string
    The status of the RDS database.
    InstanceId string
    The ID of the RDS instance.
    Owner string
    The owner of database.
    CType string
    Character classification. Value range: C (default), C.UTF-8, en_US.utf8, zh_CN.utf8, and POSIX.
    CharacterSetName string
    Database character set. Currently supported character sets include: utf8, latin1, ascii. Default is utf8.
    Collate string
    The collate of database. Sorting rules. Value range: C (default), C.UTF-8, en_US.utf8, zh_CN.utf8 and POSIX.
    DbName string
    The name of database.
    DbStatus string
    The status of the RDS database.
    InstanceId string
    The ID of the RDS instance.
    Owner string
    The owner of database.
    cType String
    Character classification. Value range: C (default), C.UTF-8, en_US.utf8, zh_CN.utf8, and POSIX.
    characterSetName String
    Database character set. Currently supported character sets include: utf8, latin1, ascii. Default is utf8.
    collate String
    The collate of database. Sorting rules. Value range: C (default), C.UTF-8, en_US.utf8, zh_CN.utf8 and POSIX.
    dbName String
    The name of database.
    dbStatus String
    The status of the RDS database.
    instanceId String
    The ID of the RDS instance.
    owner String
    The owner of database.
    cType string
    Character classification. Value range: C (default), C.UTF-8, en_US.utf8, zh_CN.utf8, and POSIX.
    characterSetName string
    Database character set. Currently supported character sets include: utf8, latin1, ascii. Default is utf8.
    collate string
    The collate of database. Sorting rules. Value range: C (default), C.UTF-8, en_US.utf8, zh_CN.utf8 and POSIX.
    dbName string
    The name of database.
    dbStatus string
    The status of the RDS database.
    instanceId string
    The ID of the RDS instance.
    owner string
    The owner of database.
    c_type str
    Character classification. Value range: C (default), C.UTF-8, en_US.utf8, zh_CN.utf8, and POSIX.
    character_set_name str
    Database character set. Currently supported character sets include: utf8, latin1, ascii. Default is utf8.
    collate str
    The collate of database. Sorting rules. Value range: C (default), C.UTF-8, en_US.utf8, zh_CN.utf8 and POSIX.
    db_name str
    The name of database.
    db_status str
    The status of the RDS database.
    instance_id str
    The ID of the RDS instance.
    owner str
    The owner of database.
    cType String
    Character classification. Value range: C (default), C.UTF-8, en_US.utf8, zh_CN.utf8, and POSIX.
    characterSetName String
    Database character set. Currently supported character sets include: utf8, latin1, ascii. Default is utf8.
    collate String
    The collate of database. Sorting rules. Value range: C (default), C.UTF-8, en_US.utf8, zh_CN.utf8 and POSIX.
    dbName String
    The name of database.
    dbStatus String
    The status of the RDS database.
    instanceId String
    The ID of the RDS instance.
    owner String
    The owner of database.

    Import

    Database can be imported using the instanceId:dbName, e.g.

     $ pulumi import volcengine:rds_postgresql/database:Database default postgres-ca7b7019****:dbname
    

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

    Package Details

    Repository
    volcengine volcengine/pulumi-volcengine
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the volcengine Terraform Provider.
    volcengine logo
    Volcengine v0.0.24 published on Tuesday, Jun 25, 2024 by Volcengine