1. Packages
  2. Vultr
  3. API Docs
  4. DatabaseTopic
Vultr v2.23.1 published on Tuesday, Dec 10, 2024 by dirien

vultr.DatabaseTopic

Explore with Pulumi AI

vultr logo
Vultr v2.23.1 published on Tuesday, Dec 10, 2024 by dirien

    Provides a Vultr database topic resource. This can be used to create, read, modify, and delete topics for a managed database on your Vultr account.

    Example Usage

    Create a new database topic:

    import * as pulumi from "@pulumi/pulumi";
    import * as vultr from "@ediri/vultr";
    
    const myDatabaseTopic = new vultr.DatabaseTopic("myDatabaseTopic", {
        databaseId: vultr_database.my_database.id,
        name: "my_database_topic",
        partitions: 3,
        replication: 2,
        retentionHours: 120,
        retentionBytes: -1,
    });
    
    import pulumi
    import ediri_vultr as vultr
    
    my_database_topic = vultr.DatabaseTopic("myDatabaseTopic",
        database_id=vultr_database["my_database"]["id"],
        name="my_database_topic",
        partitions=3,
        replication=2,
        retention_hours=120,
        retention_bytes=-1)
    
    package main
    
    import (
    	"github.com/dirien/pulumi-vultr/sdk/v2/go/vultr"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vultr.NewDatabaseTopic(ctx, "myDatabaseTopic", &vultr.DatabaseTopicArgs{
    			DatabaseId:     pulumi.Any(vultr_database.My_database.Id),
    			Name:           pulumi.String("my_database_topic"),
    			Partitions:     pulumi.Int(3),
    			Replication:    pulumi.Int(2),
    			RetentionHours: pulumi.Int(120),
    			RetentionBytes: pulumi.Int(-1),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vultr = ediri.Vultr;
    
    return await Deployment.RunAsync(() => 
    {
        var myDatabaseTopic = new Vultr.DatabaseTopic("myDatabaseTopic", new()
        {
            DatabaseId = vultr_database.My_database.Id,
            Name = "my_database_topic",
            Partitions = 3,
            Replication = 2,
            RetentionHours = 120,
            RetentionBytes = -1,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vultr.DatabaseTopic;
    import com.pulumi.vultr.DatabaseTopicArgs;
    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 myDatabaseTopic = new DatabaseTopic("myDatabaseTopic", DatabaseTopicArgs.builder()
                .databaseId(vultr_database.my_database().id())
                .name("my_database_topic")
                .partitions("3")
                .replication("2")
                .retentionHours("120")
                .retentionBytes("-1")
                .build());
    
        }
    }
    
    resources:
      myDatabaseTopic:
        type: vultr:DatabaseTopic
        properties:
          databaseId: ${vultr_database.my_database.id}
          name: my_database_topic
          partitions: '3'
          replication: '2'
          retentionHours: '120'
          retentionBytes: '-1'
    

    Create DatabaseTopic Resource

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

    Constructor syntax

    new DatabaseTopic(name: string, args: DatabaseTopicArgs, opts?: CustomResourceOptions);
    @overload
    def DatabaseTopic(resource_name: str,
                      args: DatabaseTopicArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def DatabaseTopic(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      database_id: Optional[str] = None,
                      name: Optional[str] = None,
                      partitions: Optional[int] = None,
                      replication: Optional[int] = None,
                      retention_bytes: Optional[int] = None,
                      retention_hours: Optional[int] = None)
    func NewDatabaseTopic(ctx *Context, name string, args DatabaseTopicArgs, opts ...ResourceOption) (*DatabaseTopic, error)
    public DatabaseTopic(string name, DatabaseTopicArgs args, CustomResourceOptions? opts = null)
    public DatabaseTopic(String name, DatabaseTopicArgs args)
    public DatabaseTopic(String name, DatabaseTopicArgs args, CustomResourceOptions options)
    
    type: vultr:DatabaseTopic
    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 DatabaseTopicArgs
    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 DatabaseTopicArgs
    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 DatabaseTopicArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DatabaseTopicArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DatabaseTopicArgs
    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 databaseTopicResource = new Vultr.DatabaseTopic("databaseTopicResource", new()
    {
        DatabaseId = "string",
        Name = "string",
        Partitions = 0,
        Replication = 0,
        RetentionBytes = 0,
        RetentionHours = 0,
    });
    
    example, err := vultr.NewDatabaseTopic(ctx, "databaseTopicResource", &vultr.DatabaseTopicArgs{
    	DatabaseId:     pulumi.String("string"),
    	Name:           pulumi.String("string"),
    	Partitions:     pulumi.Int(0),
    	Replication:    pulumi.Int(0),
    	RetentionBytes: pulumi.Int(0),
    	RetentionHours: pulumi.Int(0),
    })
    
    var databaseTopicResource = new DatabaseTopic("databaseTopicResource", DatabaseTopicArgs.builder()
        .databaseId("string")
        .name("string")
        .partitions(0)
        .replication(0)
        .retentionBytes(0)
        .retentionHours(0)
        .build());
    
    database_topic_resource = vultr.DatabaseTopic("databaseTopicResource",
        database_id="string",
        name="string",
        partitions=0,
        replication=0,
        retention_bytes=0,
        retention_hours=0)
    
    const databaseTopicResource = new vultr.DatabaseTopic("databaseTopicResource", {
        databaseId: "string",
        name: "string",
        partitions: 0,
        replication: 0,
        retentionBytes: 0,
        retentionHours: 0,
    });
    
    type: vultr:DatabaseTopic
    properties:
        databaseId: string
        name: string
        partitions: 0
        replication: 0
        retentionBytes: 0
        retentionHours: 0
    

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

    DatabaseId string
    The managed database ID you want to attach this topic to.
    Name string
    The name for the new managed database topic.
    Partitions int
    The number of partitions for the new managed database topic.
    Replication int
    The replication factor for the new managed database topic.
    RetentionBytes int
    The retention bytes for the new managed database topic.
    RetentionHours int
    The retention hours for the new managed database topic.
    DatabaseId string
    The managed database ID you want to attach this topic to.
    Name string
    The name for the new managed database topic.
    Partitions int
    The number of partitions for the new managed database topic.
    Replication int
    The replication factor for the new managed database topic.
    RetentionBytes int
    The retention bytes for the new managed database topic.
    RetentionHours int
    The retention hours for the new managed database topic.
    databaseId String
    The managed database ID you want to attach this topic to.
    name String
    The name for the new managed database topic.
    partitions Integer
    The number of partitions for the new managed database topic.
    replication Integer
    The replication factor for the new managed database topic.
    retentionBytes Integer
    The retention bytes for the new managed database topic.
    retentionHours Integer
    The retention hours for the new managed database topic.
    databaseId string
    The managed database ID you want to attach this topic to.
    name string
    The name for the new managed database topic.
    partitions number
    The number of partitions for the new managed database topic.
    replication number
    The replication factor for the new managed database topic.
    retentionBytes number
    The retention bytes for the new managed database topic.
    retentionHours number
    The retention hours for the new managed database topic.
    database_id str
    The managed database ID you want to attach this topic to.
    name str
    The name for the new managed database topic.
    partitions int
    The number of partitions for the new managed database topic.
    replication int
    The replication factor for the new managed database topic.
    retention_bytes int
    The retention bytes for the new managed database topic.
    retention_hours int
    The retention hours for the new managed database topic.
    databaseId String
    The managed database ID you want to attach this topic to.
    name String
    The name for the new managed database topic.
    partitions Number
    The number of partitions for the new managed database topic.
    replication Number
    The replication factor for the new managed database topic.
    retentionBytes Number
    The retention bytes for the new managed database topic.
    retentionHours Number
    The retention hours for the new managed database topic.

    Outputs

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

    Get an existing DatabaseTopic 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?: DatabaseTopicState, opts?: CustomResourceOptions): DatabaseTopic
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            database_id: Optional[str] = None,
            name: Optional[str] = None,
            partitions: Optional[int] = None,
            replication: Optional[int] = None,
            retention_bytes: Optional[int] = None,
            retention_hours: Optional[int] = None) -> DatabaseTopic
    func GetDatabaseTopic(ctx *Context, name string, id IDInput, state *DatabaseTopicState, opts ...ResourceOption) (*DatabaseTopic, error)
    public static DatabaseTopic Get(string name, Input<string> id, DatabaseTopicState? state, CustomResourceOptions? opts = null)
    public static DatabaseTopic get(String name, Output<String> id, DatabaseTopicState 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:
    DatabaseId string
    The managed database ID you want to attach this topic to.
    Name string
    The name for the new managed database topic.
    Partitions int
    The number of partitions for the new managed database topic.
    Replication int
    The replication factor for the new managed database topic.
    RetentionBytes int
    The retention bytes for the new managed database topic.
    RetentionHours int
    The retention hours for the new managed database topic.
    DatabaseId string
    The managed database ID you want to attach this topic to.
    Name string
    The name for the new managed database topic.
    Partitions int
    The number of partitions for the new managed database topic.
    Replication int
    The replication factor for the new managed database topic.
    RetentionBytes int
    The retention bytes for the new managed database topic.
    RetentionHours int
    The retention hours for the new managed database topic.
    databaseId String
    The managed database ID you want to attach this topic to.
    name String
    The name for the new managed database topic.
    partitions Integer
    The number of partitions for the new managed database topic.
    replication Integer
    The replication factor for the new managed database topic.
    retentionBytes Integer
    The retention bytes for the new managed database topic.
    retentionHours Integer
    The retention hours for the new managed database topic.
    databaseId string
    The managed database ID you want to attach this topic to.
    name string
    The name for the new managed database topic.
    partitions number
    The number of partitions for the new managed database topic.
    replication number
    The replication factor for the new managed database topic.
    retentionBytes number
    The retention bytes for the new managed database topic.
    retentionHours number
    The retention hours for the new managed database topic.
    database_id str
    The managed database ID you want to attach this topic to.
    name str
    The name for the new managed database topic.
    partitions int
    The number of partitions for the new managed database topic.
    replication int
    The replication factor for the new managed database topic.
    retention_bytes int
    The retention bytes for the new managed database topic.
    retention_hours int
    The retention hours for the new managed database topic.
    databaseId String
    The managed database ID you want to attach this topic to.
    name String
    The name for the new managed database topic.
    partitions Number
    The number of partitions for the new managed database topic.
    replication Number
    The replication factor for the new managed database topic.
    retentionBytes Number
    The retention bytes for the new managed database topic.
    retentionHours Number
    The retention hours for the new managed database topic.

    Package Details

    Repository
    vultr dirien/pulumi-vultr
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the vultr Terraform Provider.
    vultr logo
    Vultr v2.23.1 published on Tuesday, Dec 10, 2024 by dirien