upstash.KafkaTopic
Explore with Pulumi AI
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.
Constructor 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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The KafkaTopic resource accepts the following input properties:
- Cleanup
Policy string - Cleanup policy will be used in the topic(compact or delete)
- Cluster
Id string - ID of the cluster the topic will be deployed in
- Max
Message intSize - 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 string - Name of the topic
- Cleanup
Policy string - Cleanup policy will be used in the topic(compact or delete)
- Cluster
Id string - ID of the cluster the topic will be deployed in
- Max
Message intSize - 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 string - Name of the topic
- cleanup
Policy String - Cleanup policy will be used in the topic(compact or delete)
- cluster
Id String - ID of the cluster the topic will be deployed in
- max
Message IntegerSize - Max message size in the topic
- partitions Integer
- The number of partitions the topic will have
- retention
Size Integer - Retention size of the messages in the topic
- retention
Time Integer - Retention time of messages in the topic
- topic
Name String - Name of the topic
- cleanup
Policy string - Cleanup policy will be used in the topic(compact or delete)
- cluster
Id string - ID of the cluster the topic will be deployed in
- max
Message numberSize - Max message size in the topic
- partitions number
- The number of partitions the topic will have
- retention
Size number - Retention size of the messages in the topic
- retention
Time number - Retention time of messages in the topic
- topic
Name 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_ intsize - 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
- cleanup
Policy String - Cleanup policy will be used in the topic(compact or delete)
- cluster
Id String - ID of the cluster the topic will be deployed in
- max
Message NumberSize - Max message size in the topic
- partitions Number
- The number of partitions the topic will have
- retention
Size Number - Retention size of the messages in the topic
- retention
Time Number - Retention time of messages in the topic
- topic
Name String - Name of the topic
Outputs
All input properties are implicitly available as output properties. Additionally, the KafkaTopic resource produces the following output properties:
- Creation
Time 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
- Rest
Endpoint string - REST Endpoint of the kafka topic
- State string
- State of the kafka topic (active or deleted)
- Tcp
Endpoint string - TCP Endpoint of the kafka topic
- Topic
Id 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 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
- Rest
Endpoint string - REST Endpoint of the kafka topic
- State string
- State of the kafka topic (active or deleted)
- Tcp
Endpoint string - TCP Endpoint of the kafka topic
- Topic
Id string - Unique Cluster ID for created topic
- Username string
- Base64 encoded username to be used in authenticating to the cluster
- creation
Time 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
- rest
Endpoint String - REST Endpoint of the kafka topic
- state String
- State of the kafka topic (active or deleted)
- tcp
Endpoint String - TCP Endpoint of the kafka topic
- topic
Id String - Unique Cluster ID for created topic
- username String
- Base64 encoded username to be used in authenticating to the cluster
- creation
Time 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
- rest
Endpoint string - REST Endpoint of the kafka topic
- state string
- State of the kafka topic (active or deleted)
- tcp
Endpoint string - TCP Endpoint of the kafka topic
- topic
Id 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
- creation
Time 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
- rest
Endpoint String - REST Endpoint of the kafka topic
- state String
- State of the kafka topic (active or deleted)
- tcp
Endpoint String - TCP Endpoint of the kafka topic
- topic
Id 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.
- Cleanup
Policy string - Cleanup policy will be used in the topic(compact or delete)
- Cluster
Id string - ID of the cluster the topic will be deployed in
- Creation
Time int - Creation time of the topic
- Max
Message intSize - 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
- Rest
Endpoint string - 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 string
- State of the kafka topic (active or deleted)
- Tcp
Endpoint string - TCP Endpoint of the kafka topic
- Topic
Id string - Unique Cluster ID for created topic
- Topic
Name string - Name of the topic
- Username string
- Base64 encoded username to be used in authenticating to the cluster
- Cleanup
Policy string - Cleanup policy will be used in the topic(compact or delete)
- Cluster
Id string - ID of the cluster the topic will be deployed in
- Creation
Time int - Creation time of the topic
- Max
Message intSize - 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
- Rest
Endpoint string - 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 string
- State of the kafka topic (active or deleted)
- Tcp
Endpoint string - TCP Endpoint of the kafka topic
- Topic
Id string - Unique Cluster ID for created topic
- Topic
Name string - Name of the topic
- Username string
- Base64 encoded username to be used in authenticating to the cluster
- cleanup
Policy String - Cleanup policy will be used in the topic(compact or delete)
- cluster
Id String - ID of the cluster the topic will be deployed in
- creation
Time Integer - Creation time of the topic
- max
Message IntegerSize - 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
- rest
Endpoint String - REST Endpoint of the kafka topic
- retention
Size Integer - Retention size of the messages in the topic
- retention
Time Integer - Retention time of messages in the topic
- state String
- State of the kafka topic (active or deleted)
- tcp
Endpoint String - TCP Endpoint of the kafka topic
- topic
Id String - Unique Cluster ID for created topic
- topic
Name String - Name of the topic
- username String
- Base64 encoded username to be used in authenticating to the cluster
- cleanup
Policy string - Cleanup policy will be used in the topic(compact or delete)
- cluster
Id string - ID of the cluster the topic will be deployed in
- creation
Time number - Creation time of the topic
- max
Message numberSize - 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
- rest
Endpoint string - REST Endpoint of the kafka topic
- retention
Size number - Retention size of the messages in the topic
- retention
Time number - Retention time of messages in the topic
- state string
- State of the kafka topic (active or deleted)
- tcp
Endpoint string - TCP Endpoint of the kafka topic
- topic
Id string - Unique Cluster ID for created topic
- topic
Name 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_ intsize - 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
- cleanup
Policy String - Cleanup policy will be used in the topic(compact or delete)
- cluster
Id String - ID of the cluster the topic will be deployed in
- creation
Time Number - Creation time of the topic
- max
Message NumberSize - 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
- rest
Endpoint String - REST Endpoint of the kafka topic
- retention
Size Number - Retention size of the messages in the topic
- retention
Time Number - Retention time of messages in the topic
- state String
- State of the kafka topic (active or deleted)
- tcp
Endpoint String - TCP Endpoint of the kafka topic
- topic
Id String - Unique Cluster ID for created topic
- topic
Name 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.