1. Packages
  2. Upstash
  3. API Docs
  4. KafkaTopic
Upstash v0.2.0 published on Wednesday, May 24, 2023 by Upstash

upstash.KafkaTopic

Explore with Pulumi AI

upstash logo
Upstash v0.2.0 published on Wednesday, May 24, 2023 by Upstash

    Example Usage

    using Pulumi;
    using Upstash = Pulumi.Upstash;
    
    class MyStack : Stack
    {
        public MyStack()
        {
            // Not necessary if the topic belongs to an already created cluster.
            var exampleKafkaCluster = new Upstash.KafkaCluster("exampleKafkaCluster", new Upstash.KafkaClusterArgs
            {
                ClusterName = "Terraform_Upstash_Cluster",
                Region = "eu-west-1",
                Multizone = false,
            });
            var exampleKafkaTopic = new Upstash.KafkaTopic("exampleKafkaTopic", new Upstash.KafkaTopicArgs
            {
                TopicName = "TerraformTopic",
                Partitions = 1,
                RetentionTime = 625135,
                RetentionSize = 725124,
                MaxMessageSize = 829213,
                CleanupPolicy = "delete",
                ClusterId = resource.Upstash_kafka_cluster.ExampleKafkaCluster.Cluster_id,
            });
        }
    
    }
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/upstash/pulumi-upstash/sdk/go/upstash"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := upstash.NewKafkaCluster(ctx, "exampleKafkaCluster", &upstash.KafkaClusterArgs{
    			ClusterName: pulumi.String("Terraform_Upstash_Cluster"),
    			Region:      pulumi.String("eu-west-1"),
    			Multizone:   pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = upstash.NewKafkaTopic(ctx, "exampleKafkaTopic", &upstash.KafkaTopicArgs{
    			TopicName:      pulumi.String("TerraformTopic"),
    			Partitions:     pulumi.Int(1),
    			RetentionTime:  pulumi.Int(625135),
    			RetentionSize:  pulumi.Int(725124),
    			MaxMessageSize: pulumi.Int(829213),
    			CleanupPolicy:  pulumi.String("delete"),
    			ClusterId:      pulumi.Any(resource.Upstash_kafka_cluster.ExampleKafkaCluster.Cluster_id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import java.util.*;
    import java.io.*;
    import java.nio.*;
    import com.pulumi.*;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var exampleKafkaCluster = new KafkaCluster("exampleKafkaCluster", KafkaClusterArgs.builder()        
                .clusterName("Terraform_Upstash_Cluster")
                .region("eu-west-1")
                .multizone(false)
                .build());
    
            var exampleKafkaTopic = new KafkaTopic("exampleKafkaTopic", KafkaTopicArgs.builder()        
                .topicName("TerraformTopic")
                .partitions(1)
                .retentionTime(625135)
                .retentionSize(725124)
                .maxMessageSize(829213)
                .cleanupPolicy("delete")
                .clusterId(resource.upstash_kafka_cluster().exampleKafkaCluster().cluster_id())
                .build());
    
        }
    }
    
    import pulumi
    import upstash_pulumi as upstash
    
    # Not necessary if the topic belongs to an already created cluster.
    example_kafka_cluster = upstash.KafkaCluster("exampleKafkaCluster",
        cluster_name="Terraform_Upstash_Cluster",
        region="eu-west-1",
        multizone=False)
    example_kafka_topic = upstash.KafkaTopic("exampleKafkaTopic",
        topic_name="TerraformTopic",
        partitions=1,
        retention_time=625135,
        retention_size=725124,
        max_message_size=829213,
        cleanup_policy="delete",
        cluster_id=resource["upstash_kafka_cluster"]["exampleKafkaCluster"]["cluster_id"])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as pulumi from "@upstash/pulumi";
    
    // Not necessary if the topic belongs to an already created cluster.
    const exampleKafkaCluster = new upstash.KafkaCluster("exampleKafkaCluster", {
        clusterName: "Terraform_Upstash_Cluster",
        region: "eu-west-1",
        multizone: false,
    });
    const exampleKafkaTopic = new upstash.KafkaTopic("exampleKafkaTopic", {
        topicName: "TerraformTopic",
        partitions: 1,
        retentionTime: 625135,
        retentionSize: 725124,
        maxMessageSize: 829213,
        cleanupPolicy: "delete",
        clusterId: resource.upstash_kafka_cluster.exampleKafkaCluster.cluster_id,
    });
    
    resources:
      exampleKafkaCluster:
        type: upstash:KafkaCluster
        properties:
          clusterName: Terraform_Upstash_Cluster
          region: eu-west-1
          multizone: false
      exampleKafkaTopic:
        type: upstash:KafkaTopic
        properties:
          topicName: TerraformTopic
          partitions: 1
          retentionTime: 625135
          retentionSize: 725124
          maxMessageSize: 829213
          cleanupPolicy: delete
          clusterId: ${resource.upstash_kafka_cluster.exampleKafkaCluster.cluster_id}
    

    Create KafkaTopic Resource

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

    Constructor syntax

    new KafkaTopic(name: string, args: KafkaTopicArgs, opts?: CustomResourceOptions);
    @overload
    def KafkaTopic(resource_name: str,
                   args: KafkaTopicArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def KafkaTopic(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   cleanup_policy: Optional[str] = None,
                   cluster_id: Optional[str] = None,
                   max_message_size: Optional[int] = None,
                   partitions: Optional[int] = None,
                   retention_size: Optional[int] = None,
                   retention_time: Optional[int] = None,
                   topic_name: Optional[str] = None)
    func NewKafkaTopic(ctx *Context, name string, args KafkaTopicArgs, opts ...ResourceOption) (*KafkaTopic, error)
    public KafkaTopic(string name, KafkaTopicArgs args, CustomResourceOptions? opts = null)
    public KafkaTopic(String name, KafkaTopicArgs args)
    public KafkaTopic(String name, KafkaTopicArgs args, CustomResourceOptions options)
    
    type: upstash:KafkaTopic
    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 KafkaTopicArgs
    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 KafkaTopicArgs
    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 KafkaTopicArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args KafkaTopicArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args KafkaTopicArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var kafkaTopicResource = new Upstash.KafkaTopic("kafkaTopicResource", new()
    {
        CleanupPolicy = "string",
        ClusterId = "string",
        MaxMessageSize = 0,
        Partitions = 0,
        RetentionSize = 0,
        RetentionTime = 0,
        TopicName = "string",
    });
    
    example, err := upstash.NewKafkaTopic(ctx, "kafkaTopicResource", &upstash.KafkaTopicArgs{
    	CleanupPolicy:  pulumi.String("string"),
    	ClusterId:      pulumi.String("string"),
    	MaxMessageSize: pulumi.Int(0),
    	Partitions:     pulumi.Int(0),
    	RetentionSize:  pulumi.Int(0),
    	RetentionTime:  pulumi.Int(0),
    	TopicName:      pulumi.String("string"),
    })
    
    var kafkaTopicResource = new KafkaTopic("kafkaTopicResource", KafkaTopicArgs.builder()        
        .cleanupPolicy("string")
        .clusterId("string")
        .maxMessageSize(0)
        .partitions(0)
        .retentionSize(0)
        .retentionTime(0)
        .topicName("string")
        .build());
    
    kafka_topic_resource = upstash.KafkaTopic("kafkaTopicResource",
        cleanup_policy="string",
        cluster_id="string",
        max_message_size=0,
        partitions=0,
        retention_size=0,
        retention_time=0,
        topic_name="string")
    
    const kafkaTopicResource = new upstash.KafkaTopic("kafkaTopicResource", {
        cleanupPolicy: "string",
        clusterId: "string",
        maxMessageSize: 0,
        partitions: 0,
        retentionSize: 0,
        retentionTime: 0,
        topicName: "string",
    });
    
    type: upstash:KafkaTopic
    properties:
        cleanupPolicy: string
        clusterId: string
        maxMessageSize: 0
        partitions: 0
        retentionSize: 0
        retentionTime: 0
        topicName: string
    

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

    CleanupPolicy string
    Cleanup policy will be used in the topic(compact or delete)
    ClusterId string
    ID of the cluster the topic will be deployed in
    MaxMessageSize int
    Max message size in the topic
    Partitions int
    The number of partitions the topic will have
    RetentionSize int
    Retention size of the messages in the topic
    RetentionTime int
    Retention time of messages in the topic
    TopicName string
    Name of the topic
    CleanupPolicy string
    Cleanup policy will be used in the topic(compact or delete)
    ClusterId string
    ID of the cluster the topic will be deployed in
    MaxMessageSize int
    Max message size in the topic
    Partitions int
    The number of partitions the topic will have
    RetentionSize int
    Retention size of the messages in the topic
    RetentionTime int
    Retention time of messages in the topic
    TopicName string
    Name of the topic
    cleanupPolicy String
    Cleanup policy will be used in the topic(compact or delete)
    clusterId String
    ID of the cluster the topic will be deployed in
    maxMessageSize Integer
    Max message size in the topic
    partitions Integer
    The number of partitions the topic will have
    retentionSize Integer
    Retention size of the messages in the topic
    retentionTime Integer
    Retention time of messages in the topic
    topicName String
    Name of the topic
    cleanupPolicy string
    Cleanup policy will be used in the topic(compact or delete)
    clusterId string
    ID of the cluster the topic will be deployed in
    maxMessageSize number
    Max message size in the topic
    partitions number
    The number of partitions the topic will have
    retentionSize number
    Retention size of the messages in the topic
    retentionTime number
    Retention time of messages in the topic
    topicName string
    Name of the topic
    cleanup_policy str
    Cleanup policy will be used in the topic(compact or delete)
    cluster_id str
    ID of the cluster the topic will be deployed in
    max_message_size int
    Max message size in the topic
    partitions int
    The number of partitions the topic will have
    retention_size int
    Retention size of the messages in the topic
    retention_time int
    Retention time of messages in the topic
    topic_name str
    Name of the topic
    cleanupPolicy String
    Cleanup policy will be used in the topic(compact or delete)
    clusterId String
    ID of the cluster the topic will be deployed in
    maxMessageSize Number
    Max message size in the topic
    partitions Number
    The number of partitions the topic will have
    retentionSize Number
    Retention size of the messages in the topic
    retentionTime Number
    Retention time of messages in the topic
    topicName String
    Name of the topic

    Outputs

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

    CreationTime int
    Creation time of the topic
    Id string
    The provider-assigned unique ID for this managed resource.
    Multizone bool
    Whether multizone replication is enabled
    Password string
    Password to be used in authenticating to the cluster
    Region string
    Region of the kafka topic
    RestEndpoint string
    REST Endpoint of the kafka topic
    State string
    State of the kafka topic (active or deleted)
    TcpEndpoint string
    TCP Endpoint of the kafka topic
    TopicId string
    Unique Cluster ID for created topic
    Username string
    Base64 encoded username to be used in authenticating to the cluster
    CreationTime int
    Creation time of the topic
    Id string
    The provider-assigned unique ID for this managed resource.
    Multizone bool
    Whether multizone replication is enabled
    Password string
    Password to be used in authenticating to the cluster
    Region string
    Region of the kafka topic
    RestEndpoint string
    REST Endpoint of the kafka topic
    State string
    State of the kafka topic (active or deleted)
    TcpEndpoint string
    TCP Endpoint of the kafka topic
    TopicId string
    Unique Cluster ID for created topic
    Username string
    Base64 encoded username to be used in authenticating to the cluster
    creationTime Integer
    Creation time of the topic
    id String
    The provider-assigned unique ID for this managed resource.
    multizone Boolean
    Whether multizone replication is enabled
    password String
    Password to be used in authenticating to the cluster
    region String
    Region of the kafka topic
    restEndpoint String
    REST Endpoint of the kafka topic
    state String
    State of the kafka topic (active or deleted)
    tcpEndpoint String
    TCP Endpoint of the kafka topic
    topicId String
    Unique Cluster ID for created topic
    username String
    Base64 encoded username to be used in authenticating to the cluster
    creationTime number
    Creation time of the topic
    id string
    The provider-assigned unique ID for this managed resource.
    multizone boolean
    Whether multizone replication is enabled
    password string
    Password to be used in authenticating to the cluster
    region string
    Region of the kafka topic
    restEndpoint string
    REST Endpoint of the kafka topic
    state string
    State of the kafka topic (active or deleted)
    tcpEndpoint string
    TCP Endpoint of the kafka topic
    topicId string
    Unique Cluster ID for created topic
    username string
    Base64 encoded username to be used in authenticating to the cluster
    creation_time int
    Creation time of the topic
    id str
    The provider-assigned unique ID for this managed resource.
    multizone bool
    Whether multizone replication is enabled
    password str
    Password to be used in authenticating to the cluster
    region str
    Region of the kafka topic
    rest_endpoint str
    REST Endpoint of the kafka topic
    state str
    State of the kafka topic (active or deleted)
    tcp_endpoint str
    TCP Endpoint of the kafka topic
    topic_id str
    Unique Cluster ID for created topic
    username str
    Base64 encoded username to be used in authenticating to the cluster
    creationTime Number
    Creation time of the topic
    id String
    The provider-assigned unique ID for this managed resource.
    multizone Boolean
    Whether multizone replication is enabled
    password String
    Password to be used in authenticating to the cluster
    region String
    Region of the kafka topic
    restEndpoint String
    REST Endpoint of the kafka topic
    state String
    State of the kafka topic (active or deleted)
    tcpEndpoint String
    TCP Endpoint of the kafka topic
    topicId String
    Unique Cluster ID for created topic
    username String
    Base64 encoded username to be used in authenticating to the cluster

    Look up Existing KafkaTopic Resource

    Get an existing KafkaTopic 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?: KafkaTopicState, opts?: CustomResourceOptions): KafkaTopic
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cleanup_policy: Optional[str] = None,
            cluster_id: Optional[str] = None,
            creation_time: Optional[int] = None,
            max_message_size: Optional[int] = None,
            multizone: Optional[bool] = None,
            partitions: Optional[int] = None,
            password: Optional[str] = None,
            region: Optional[str] = None,
            rest_endpoint: Optional[str] = None,
            retention_size: Optional[int] = None,
            retention_time: Optional[int] = None,
            state: Optional[str] = None,
            tcp_endpoint: Optional[str] = None,
            topic_id: Optional[str] = None,
            topic_name: Optional[str] = None,
            username: Optional[str] = None) -> KafkaTopic
    func GetKafkaTopic(ctx *Context, name string, id IDInput, state *KafkaTopicState, opts ...ResourceOption) (*KafkaTopic, error)
    public static KafkaTopic Get(string name, Input<string> id, KafkaTopicState? state, CustomResourceOptions? opts = null)
    public static KafkaTopic get(String name, Output<String> id, KafkaTopicState 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:
    CleanupPolicy string
    Cleanup policy will be used in the topic(compact or delete)
    ClusterId string
    ID of the cluster the topic will be deployed in
    CreationTime int
    Creation time of the topic
    MaxMessageSize int
    Max message size in the topic
    Multizone bool
    Whether multizone replication is enabled
    Partitions int
    The number of partitions the topic will have
    Password string
    Password to be used in authenticating to the cluster
    Region string
    Region of the kafka topic
    RestEndpoint string
    REST Endpoint of the kafka topic
    RetentionSize int
    Retention size of the messages in the topic
    RetentionTime int
    Retention time of messages in the topic
    State string
    State of the kafka topic (active or deleted)
    TcpEndpoint string
    TCP Endpoint of the kafka topic
    TopicId string
    Unique Cluster ID for created topic
    TopicName string
    Name of the topic
    Username string
    Base64 encoded username to be used in authenticating to the cluster
    CleanupPolicy string
    Cleanup policy will be used in the topic(compact or delete)
    ClusterId string
    ID of the cluster the topic will be deployed in
    CreationTime int
    Creation time of the topic
    MaxMessageSize int
    Max message size in the topic
    Multizone bool
    Whether multizone replication is enabled
    Partitions int
    The number of partitions the topic will have
    Password string
    Password to be used in authenticating to the cluster
    Region string
    Region of the kafka topic
    RestEndpoint string
    REST Endpoint of the kafka topic
    RetentionSize int
    Retention size of the messages in the topic
    RetentionTime int
    Retention time of messages in the topic
    State string
    State of the kafka topic (active or deleted)
    TcpEndpoint string
    TCP Endpoint of the kafka topic
    TopicId string
    Unique Cluster ID for created topic
    TopicName string
    Name of the topic
    Username string
    Base64 encoded username to be used in authenticating to the cluster
    cleanupPolicy String
    Cleanup policy will be used in the topic(compact or delete)
    clusterId String
    ID of the cluster the topic will be deployed in
    creationTime Integer
    Creation time of the topic
    maxMessageSize Integer
    Max message size in the topic
    multizone Boolean
    Whether multizone replication is enabled
    partitions Integer
    The number of partitions the topic will have
    password String
    Password to be used in authenticating to the cluster
    region String
    Region of the kafka topic
    restEndpoint String
    REST Endpoint of the kafka topic
    retentionSize Integer
    Retention size of the messages in the topic
    retentionTime Integer
    Retention time of messages in the topic
    state String
    State of the kafka topic (active or deleted)
    tcpEndpoint String
    TCP Endpoint of the kafka topic
    topicId String
    Unique Cluster ID for created topic
    topicName String
    Name of the topic
    username String
    Base64 encoded username to be used in authenticating to the cluster
    cleanupPolicy string
    Cleanup policy will be used in the topic(compact or delete)
    clusterId string
    ID of the cluster the topic will be deployed in
    creationTime number
    Creation time of the topic
    maxMessageSize number
    Max message size in the topic
    multizone boolean
    Whether multizone replication is enabled
    partitions number
    The number of partitions the topic will have
    password string
    Password to be used in authenticating to the cluster
    region string
    Region of the kafka topic
    restEndpoint string
    REST Endpoint of the kafka topic
    retentionSize number
    Retention size of the messages in the topic
    retentionTime number
    Retention time of messages in the topic
    state string
    State of the kafka topic (active or deleted)
    tcpEndpoint string
    TCP Endpoint of the kafka topic
    topicId string
    Unique Cluster ID for created topic
    topicName string
    Name of the topic
    username string
    Base64 encoded username to be used in authenticating to the cluster
    cleanup_policy str
    Cleanup policy will be used in the topic(compact or delete)
    cluster_id str
    ID of the cluster the topic will be deployed in
    creation_time int
    Creation time of the topic
    max_message_size int
    Max message size in the topic
    multizone bool
    Whether multizone replication is enabled
    partitions int
    The number of partitions the topic will have
    password str
    Password to be used in authenticating to the cluster
    region str
    Region of the kafka topic
    rest_endpoint str
    REST Endpoint of the kafka topic
    retention_size int
    Retention size of the messages in the topic
    retention_time int
    Retention time of messages in the topic
    state str
    State of the kafka topic (active or deleted)
    tcp_endpoint str
    TCP Endpoint of the kafka topic
    topic_id str
    Unique Cluster ID for created topic
    topic_name str
    Name of the topic
    username str
    Base64 encoded username to be used in authenticating to the cluster
    cleanupPolicy String
    Cleanup policy will be used in the topic(compact or delete)
    clusterId String
    ID of the cluster the topic will be deployed in
    creationTime Number
    Creation time of the topic
    maxMessageSize Number
    Max message size in the topic
    multizone Boolean
    Whether multizone replication is enabled
    partitions Number
    The number of partitions the topic will have
    password String
    Password to be used in authenticating to the cluster
    region String
    Region of the kafka topic
    restEndpoint String
    REST Endpoint of the kafka topic
    retentionSize Number
    Retention size of the messages in the topic
    retentionTime Number
    Retention time of messages in the topic
    state String
    State of the kafka topic (active or deleted)
    tcpEndpoint String
    TCP Endpoint of the kafka topic
    topicId String
    Unique Cluster ID for created topic
    topicName String
    Name of the topic
    username String
    Base64 encoded username to be used in authenticating to the cluster

    Package Details

    Repository
    upstash upstash/pulumi-upstash
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the upstash Terraform Provider.
    upstash logo
    Upstash v0.2.0 published on Wednesday, May 24, 2023 by Upstash