Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

getKafkaTopic

# Kafka Topic Data Source

The Kafka Topic data source provides information about the existing Aiven Kafka Topic.

Example Usage

using Pulumi;
using Aiven = Pulumi.Aiven;

class MyStack : Stack
{
    public MyStack()
    {
        var mytesttopic = Output.Create(Aiven.GetKafkaTopic.InvokeAsync(new Aiven.GetKafkaTopicArgs
        {
            Config = new Aiven.Inputs.GetKafkaTopicConfigArgs
            {
                CleanupPolicy = "compact",
                FlushMs = "10",
                UncleanLeaderElectionEnable = "true",
            },
            Partitions = 3,
            Project = aiven_project.Myproject.Project,
            Replication = 1,
            ServiceName = aiven_service.Myservice.Service_name,
            TopicName = "<TOPIC_NAME>",
        }));
    }

}
package main

import (
    "github.com/pulumi/pulumi-aiven/sdk/v3/go/aiven"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        opt0 := 3
        opt1 := 1
        _, err := aiven.LookupKafkaTopic(ctx, &aiven.LookupKafkaTopicArgs{
            Config: aiven.GetKafkaTopicConfig{
                CleanupPolicy:               "compact",
                FlushMs:                     "10",
                UncleanLeaderElectionEnable: "true",
            },
            Partitions:  &opt0,
            Project:     aiven_project.Myproject.Project,
            Replication: &opt1,
            ServiceName: aiven_service.Myservice.Service_name,
            TopicName:   "<TOPIC_NAME>",
        }, nil)
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aiven as aiven

mytesttopic = aiven.get_kafka_topic(config=aiven.GetKafkaTopicConfigArgs(
        cleanup_policy="compact",
        flush_ms="10",
        unclean_leader_election_enable="true",
    ),
    partitions=3,
    project=aiven_project["myproject"]["project"],
    replication=1,
    service_name=aiven_service["myservice"]["service_name"],
    topic_name="<TOPIC_NAME>")
import * as pulumi from "@pulumi/pulumi";
import * as aiven from "@pulumi/aiven";

const mytesttopic = pulumi.all([aiven_project_myproject.project, aiven_service_myservice.serviceName]).apply(([project, serviceName]) => aiven.getKafkaTopic({
    config: {
        cleanupPolicy: "compact",
        flushMs: "10",
        uncleanLeaderElectionEnable: "true",
    },
    partitions: 3,
    project: project,
    replication: 1,
    serviceName: serviceName,
    topicName: "<TOPIC_NAME>",
}, { async: true }));

Using getKafkaTopic

function getKafkaTopic(args: GetKafkaTopicArgs, opts?: InvokeOptions): Promise<GetKafkaTopicResult>
def get_kafka_topic(cleanup_policy: Optional[str] = None, config: Optional[GetKafkaTopicConfigArgs] = None, minimum_in_sync_replicas: Optional[int] = None, partitions: Optional[int] = None, project: Optional[str] = None, replication: Optional[int] = None, retention_bytes: Optional[int] = None, retention_hours: Optional[int] = None, service_name: Optional[str] = None, termination_protection: Optional[bool] = None, topic_name: Optional[str] = None, opts: Optional[InvokeOptions] = None) -> GetKafkaTopicResult
func LookupKafkaTopic(ctx *Context, args *LookupKafkaTopicArgs, opts ...InvokeOption) (*LookupKafkaTopicResult, error)

Note: This function is named LookupKafkaTopic in the Go SDK.

public static class GetKafkaTopic {
    public static Task<GetKafkaTopicResult> InvokeAsync(GetKafkaTopicArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Project string

and service_name - (Required) define the project and service the topic belongs to. They should be defined using reference as shown above to set up dependencies correctly. These properties cannot be changed once the service is created. Doing so will result in the topic being deleted and new one created instead.

ServiceName string
TopicName string

is the actual name of the topic account. This propery cannot be changed once the service is created. Doing so will result in the topic being deleted and new one created instead.

CleanupPolicy string

cleanup.policy value, can be create, delete or compact,delete

Config GetKafkaTopicConfigArgs

Kafka topic configuration

MinimumInSyncReplicas int

Minimum required nodes in-sync replicas (ISR) to produce to a partition.

Partitions int

Number of partitions to create in the topic.

Replication int

Replication factor for the topic.

RetentionBytes int

retention.bytes value

RetentionHours int

Retention period in hours, if -1 it is infinite.

TerminationProtection bool
Project string

and service_name - (Required) define the project and service the topic belongs to. They should be defined using reference as shown above to set up dependencies correctly. These properties cannot be changed once the service is created. Doing so will result in the topic being deleted and new one created instead.

ServiceName string
TopicName string

is the actual name of the topic account. This propery cannot be changed once the service is created. Doing so will result in the topic being deleted and new one created instead.

CleanupPolicy string

cleanup.policy value, can be create, delete or compact,delete

Config GetKafkaTopicConfig

Kafka topic configuration

MinimumInSyncReplicas int

Minimum required nodes in-sync replicas (ISR) to produce to a partition.

Partitions int

Number of partitions to create in the topic.

Replication int

Replication factor for the topic.

RetentionBytes int

retention.bytes value

RetentionHours int

Retention period in hours, if -1 it is infinite.

TerminationProtection bool
project string

and service_name - (Required) define the project and service the topic belongs to. They should be defined using reference as shown above to set up dependencies correctly. These properties cannot be changed once the service is created. Doing so will result in the topic being deleted and new one created instead.

serviceName string
topicName string

is the actual name of the topic account. This propery cannot be changed once the service is created. Doing so will result in the topic being deleted and new one created instead.

cleanupPolicy string

cleanup.policy value, can be create, delete or compact,delete

config GetKafkaTopicConfig

Kafka topic configuration

minimumInSyncReplicas number

Minimum required nodes in-sync replicas (ISR) to produce to a partition.

partitions number

Number of partitions to create in the topic.

replication number

Replication factor for the topic.

retentionBytes number

retention.bytes value

retentionHours number

Retention period in hours, if -1 it is infinite.

terminationProtection boolean
project str

and service_name - (Required) define the project and service the topic belongs to. They should be defined using reference as shown above to set up dependencies correctly. These properties cannot be changed once the service is created. Doing so will result in the topic being deleted and new one created instead.

service_name str
topic_name str

is the actual name of the topic account. This propery cannot be changed once the service is created. Doing so will result in the topic being deleted and new one created instead.

cleanup_policy str

cleanup.policy value, can be create, delete or compact,delete

config GetKafkaTopicConfigArgs

Kafka topic configuration

minimum_in_sync_replicas int

Minimum required nodes in-sync replicas (ISR) to produce to a partition.

partitions int

Number of partitions to create in the topic.

replication int

Replication factor for the topic.

retention_bytes int

retention.bytes value

retention_hours int

Retention period in hours, if -1 it is infinite.

termination_protection bool

getKafkaTopic Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Project string
ServiceName string
TopicName string
CleanupPolicy string

cleanup.policy value, can be create, delete or compact,delete

Config GetKafkaTopicConfig

Kafka topic configuration

MinimumInSyncReplicas int

Minimum required nodes in-sync replicas (ISR) to produce to a partition.

Partitions int

Number of partitions to create in the topic.

Replication int

Replication factor for the topic.

RetentionBytes int

retention.bytes value

RetentionHours int

Retention period in hours, if -1 it is infinite.

TerminationProtection bool
Id string

The provider-assigned unique ID for this managed resource.

Project string
ServiceName string
TopicName string
CleanupPolicy string

cleanup.policy value, can be create, delete or compact,delete

Config GetKafkaTopicConfig

Kafka topic configuration

MinimumInSyncReplicas int

Minimum required nodes in-sync replicas (ISR) to produce to a partition.

Partitions int

Number of partitions to create in the topic.

Replication int

Replication factor for the topic.

RetentionBytes int

retention.bytes value

RetentionHours int

Retention period in hours, if -1 it is infinite.

TerminationProtection bool
id string

The provider-assigned unique ID for this managed resource.

project string
serviceName string
topicName string
cleanupPolicy string

cleanup.policy value, can be create, delete or compact,delete

config GetKafkaTopicConfig

Kafka topic configuration

minimumInSyncReplicas number

Minimum required nodes in-sync replicas (ISR) to produce to a partition.

partitions number

Number of partitions to create in the topic.

replication number

Replication factor for the topic.

retentionBytes number

retention.bytes value

retentionHours number

Retention period in hours, if -1 it is infinite.

terminationProtection boolean
id str

The provider-assigned unique ID for this managed resource.

project str
service_name str
topic_name str
cleanup_policy str

cleanup.policy value, can be create, delete or compact,delete

config GetKafkaTopicConfig

Kafka topic configuration

minimum_in_sync_replicas int

Minimum required nodes in-sync replicas (ISR) to produce to a partition.

partitions int

Number of partitions to create in the topic.

replication int

Replication factor for the topic.

retention_bytes int

retention.bytes value

retention_hours int

Retention period in hours, if -1 it is infinite.

termination_protection bool

Supporting Types

GetKafkaTopicConfig

CleanupPolicy string

cleanup.policy value, can be create, delete or compact,delete

CompressionType string

compression.type value

DeleteRetentionMs string

delete.retention.ms value

FileDeleteDelayMs string

file.delete.delay.ms value

FlushMessages string

flush.messages value

FlushMs string

flush.ms value

IndexIntervalBytes string

index.interval.bytes value

MaxCompactionLagMs string

max.compaction.lag.ms value

MaxMessageBytes string

max.message.bytes value

MessageDownconversionEnable string

message.downconversion.enable value

MessageFormatVersion string

message.format.version value

MessageTimestampDifferenceMaxMs string

message.timestamp.difference.max.ms value

MessageTimestampType string

message.timestamp.type value

MinCleanableDirtyRatio string

min.cleanable.dirty.ratio value

MinCompactionLagMs string

min.compaction.lag.ms value

MinInsyncReplicas string

min.insync.replicas value

Preallocate string

preallocate value

RetentionBytes string

retention.bytes value

RetentionMs string

retention.ms value

SegmentBytes string

segment.bytes value

SegmentIndexBytes string

segment.index.bytes value

SegmentJitterMs string

segment.jitter.ms value

SegmentMs string

segment.ms value

UncleanLeaderElectionEnable string

unclean.leader.election.enable value

CleanupPolicy string

cleanup.policy value, can be create, delete or compact,delete

CompressionType string

compression.type value

DeleteRetentionMs string

delete.retention.ms value

FileDeleteDelayMs string

file.delete.delay.ms value

FlushMessages string

flush.messages value

FlushMs string

flush.ms value

IndexIntervalBytes string

index.interval.bytes value

MaxCompactionLagMs string

max.compaction.lag.ms value

MaxMessageBytes string

max.message.bytes value

MessageDownconversionEnable string

message.downconversion.enable value

MessageFormatVersion string

message.format.version value

MessageTimestampDifferenceMaxMs string

message.timestamp.difference.max.ms value

MessageTimestampType string

message.timestamp.type value

MinCleanableDirtyRatio string

min.cleanable.dirty.ratio value

MinCompactionLagMs string

min.compaction.lag.ms value

MinInsyncReplicas string

min.insync.replicas value

Preallocate string

preallocate value

RetentionBytes string

retention.bytes value

RetentionMs string

retention.ms value

SegmentBytes string

segment.bytes value

SegmentIndexBytes string

segment.index.bytes value

SegmentJitterMs string

segment.jitter.ms value

SegmentMs string

segment.ms value

UncleanLeaderElectionEnable string

unclean.leader.election.enable value

cleanupPolicy string

cleanup.policy value, can be create, delete or compact,delete

compressionType string

compression.type value

deleteRetentionMs string

delete.retention.ms value

fileDeleteDelayMs string

file.delete.delay.ms value

flushMessages string

flush.messages value

flushMs string

flush.ms value

indexIntervalBytes string

index.interval.bytes value

maxCompactionLagMs string

max.compaction.lag.ms value

maxMessageBytes string

max.message.bytes value

messageDownconversionEnable string

message.downconversion.enable value

messageFormatVersion string

message.format.version value

messageTimestampDifferenceMaxMs string

message.timestamp.difference.max.ms value

messageTimestampType string

message.timestamp.type value

minCleanableDirtyRatio string

min.cleanable.dirty.ratio value

minCompactionLagMs string

min.compaction.lag.ms value

minInsyncReplicas string

min.insync.replicas value

preallocate string

preallocate value

retentionBytes string

retention.bytes value

retentionMs string

retention.ms value

segmentBytes string

segment.bytes value

segmentIndexBytes string

segment.index.bytes value

segmentJitterMs string

segment.jitter.ms value

segmentMs string

segment.ms value

uncleanLeaderElectionEnable string

unclean.leader.election.enable value

cleanup_policy str

cleanup.policy value, can be create, delete or compact,delete

compression_type str

compression.type value

delete_retention_ms str

delete.retention.ms value

file_delete_delay_ms str

file.delete.delay.ms value

flush_messages str

flush.messages value

flush_ms str

flush.ms value

index_interval_bytes str

index.interval.bytes value

max_compaction_lag_ms str

max.compaction.lag.ms value

max_message_bytes str

max.message.bytes value

message_downconversion_enable str

message.downconversion.enable value

message_format_version str

message.format.version value

message_timestamp_difference_max_ms str

message.timestamp.difference.max.ms value

message_timestamp_type str

message.timestamp.type value

min_cleanable_dirty_ratio str

min.cleanable.dirty.ratio value

min_compaction_lag_ms str

min.compaction.lag.ms value

min_insync_replicas str

min.insync.replicas value

preallocate str

preallocate value

retention_bytes str

retention.bytes value

retention_ms str

retention.ms value

segment_bytes str

segment.bytes value

segment_index_bytes str

segment.index.bytes value

segment_jitter_ms str

segment.jitter.ms value

segment_ms str

segment.ms value

unclean_leader_election_enable str

unclean.leader.election.enable value

Package Details

Repository
https://github.com/pulumi/pulumi-aiven
License
Apache-2.0
Notes
This Pulumi package is based on the aiven Terraform Provider.