1. Packages
  2. Packages
  3. Aiven Provider
  4. API Docs
  5. getKafkaTopic
Viewing docs for Aiven v4.5.2 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
aiven logo
Viewing docs for Aiven v4.5.2 (Older version)
published on Monday, Mar 9, 2026 by Pulumi

    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
            {
                Project = aiven_project.Myproject.Project,
                ServiceName = aiven_service.Myservice.Service_name,
                TopicName = "<TOPIC_NAME>",
            }));
        }
    
    }
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aiven/sdk/v4/go/aiven"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := aiven.LookupKafkaTopic(ctx, &GetKafkaTopicArgs{
    			Project:     aiven_project.Myproject.Project,
    			ServiceName: aiven_service.Myservice.Service_name,
    			TopicName:   "<TOPIC_NAME>",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Example coming soon!

    import * as pulumi from "@pulumi/pulumi";
    import * as aiven from "@pulumi/aiven";
    
    const mytesttopic = aiven.getKafkaTopic({
        project: aiven_project.myproject.project,
        serviceName: aiven_service.myservice.service_name,
        topicName: "<TOPIC_NAME>",
    });
    
    import pulumi
    import pulumi_aiven as aiven
    
    mytesttopic = aiven.get_kafka_topic(project=aiven_project["myproject"]["project"],
        service_name=aiven_service["myservice"]["service_name"],
        topic_name="<TOPIC_NAME>")
    

    Example coming soon!

    Using getKafkaTopic

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getKafkaTopic(args: GetKafkaTopicArgs, opts?: InvokeOptions): Promise<GetKafkaTopicResult>
    function getKafkaTopicOutput(args: GetKafkaTopicOutputArgs, opts?: InvokeOptions): Output<GetKafkaTopicResult>
    def get_kafka_topic(project: Optional[str] = None,
                        service_name: Optional[str] = None,
                        topic_name: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetKafkaTopicResult
    def get_kafka_topic_output(project: Optional[pulumi.Input[str]] = None,
                        service_name: Optional[pulumi.Input[str]] = None,
                        topic_name: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetKafkaTopicResult]
    func LookupKafkaTopic(ctx *Context, args *LookupKafkaTopicArgs, opts ...InvokeOption) (*LookupKafkaTopicResult, error)
    func LookupKafkaTopicOutput(ctx *Context, args *LookupKafkaTopicOutputArgs, opts ...InvokeOption) LookupKafkaTopicResultOutput

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

    public static class GetKafkaTopic 
    {
        public static Task<GetKafkaTopicResult> InvokeAsync(GetKafkaTopicArgs args, InvokeOptions? opts = null)
        public static Output<GetKafkaTopicResult> Invoke(GetKafkaTopicInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetKafkaTopicResult> getKafkaTopic(GetKafkaTopicArgs args, InvokeOptions options)
    public static Output<GetKafkaTopicResult> getKafkaTopic(GetKafkaTopicArgs args, InvokeOptions options)
    
    fn::invoke:
      function: aiven:index/getKafkaTopic:getKafkaTopic
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Project string
    Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
    ServiceName string
    Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
    TopicName string
    The name of the topic. This property cannot be changed, doing so forces recreation of the resource.
    Project string
    Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
    ServiceName string
    Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
    TopicName string
    The name of the topic. This property cannot be changed, doing so forces recreation of the resource.
    project String
    Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
    serviceName String
    Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
    topicName String
    The name of the topic. This property cannot be changed, doing so forces recreation of the resource.
    project string
    Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
    serviceName string
    Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
    topicName string
    The name of the topic. This property cannot be changed, doing so forces recreation of the resource.
    project str
    Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
    service_name str
    Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
    topic_name str
    The name of the topic. This property cannot be changed, doing so forces recreation of the resource.
    project String
    Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
    serviceName String
    Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
    topicName String
    The name of the topic. This property cannot be changed, doing so forces recreation of the resource.

    getKafkaTopic Result

    The following output properties are available:

    CleanupPolicy string
    DEPRECATED use config.cleanup_policy instead Topic cleanup policy. The possible values are delete and compact.
    Configs List<GetKafkaTopicConfig>
    Kafka topic configuration
    Id string
    The provider-assigned unique ID for this managed resource.
    MinimumInSyncReplicas int
    DEPRECATED use config.mininsyncreplicas instead Minimum required nodes in-sync replicas (ISR) to produce to a partition.
    Partitions int
    The number of partitions to create in the topic.
    Project string
    Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
    Replication int
    The replication factor for the topic.
    RetentionBytes int
    DEPRECATED use config.retention_bytes instead Retention bytes.
    RetentionHours int
    DEPRECATED use config.retention_ms instead Retention period (hours).
    ServiceName string
    Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
    Tags List<GetKafkaTopicTag>
    Kafka Topic tag.
    TerminationProtection bool
    TopicName string
    The name of the topic. This property cannot be changed, doing so forces recreation of the resource.
    CleanupPolicy string
    DEPRECATED use config.cleanup_policy instead Topic cleanup policy. The possible values are delete and compact.
    Configs []GetKafkaTopicConfig
    Kafka topic configuration
    Id string
    The provider-assigned unique ID for this managed resource.
    MinimumInSyncReplicas int
    DEPRECATED use config.mininsyncreplicas instead Minimum required nodes in-sync replicas (ISR) to produce to a partition.
    Partitions int
    The number of partitions to create in the topic.
    Project string
    Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
    Replication int
    The replication factor for the topic.
    RetentionBytes int
    DEPRECATED use config.retention_bytes instead Retention bytes.
    RetentionHours int
    DEPRECATED use config.retention_ms instead Retention period (hours).
    ServiceName string
    Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
    Tags []GetKafkaTopicTag
    Kafka Topic tag.
    TerminationProtection bool
    TopicName string
    The name of the topic. This property cannot be changed, doing so forces recreation of the resource.
    cleanupPolicy String
    DEPRECATED use config.cleanup_policy instead Topic cleanup policy. The possible values are delete and compact.
    configs List<GetKafkaTopicConfig>
    Kafka topic configuration
    id String
    The provider-assigned unique ID for this managed resource.
    minimumInSyncReplicas Integer
    DEPRECATED use config.mininsyncreplicas instead Minimum required nodes in-sync replicas (ISR) to produce to a partition.
    partitions Integer
    The number of partitions to create in the topic.
    project String
    Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
    replication Integer
    The replication factor for the topic.
    retentionBytes Integer
    DEPRECATED use config.retention_bytes instead Retention bytes.
    retentionHours Integer
    DEPRECATED use config.retention_ms instead Retention period (hours).
    serviceName String
    Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
    tags List<GetKafkaTopicTag>
    Kafka Topic tag.
    terminationProtection Boolean
    topicName String
    The name of the topic. This property cannot be changed, doing so forces recreation of the resource.
    cleanupPolicy string
    DEPRECATED use config.cleanup_policy instead Topic cleanup policy. The possible values are delete and compact.
    configs GetKafkaTopicConfig[]
    Kafka topic configuration
    id string
    The provider-assigned unique ID for this managed resource.
    minimumInSyncReplicas number
    DEPRECATED use config.mininsyncreplicas instead Minimum required nodes in-sync replicas (ISR) to produce to a partition.
    partitions number
    The number of partitions to create in the topic.
    project string
    Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
    replication number
    The replication factor for the topic.
    retentionBytes number
    DEPRECATED use config.retention_bytes instead Retention bytes.
    retentionHours number
    DEPRECATED use config.retention_ms instead Retention period (hours).
    serviceName string
    Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
    tags GetKafkaTopicTag[]
    Kafka Topic tag.
    terminationProtection boolean
    topicName string
    The name of the topic. This property cannot be changed, doing so forces recreation of the resource.
    cleanup_policy str
    DEPRECATED use config.cleanup_policy instead Topic cleanup policy. The possible values are delete and compact.
    configs Sequence[GetKafkaTopicConfig]
    Kafka topic configuration
    id str
    The provider-assigned unique ID for this managed resource.
    minimum_in_sync_replicas int
    DEPRECATED use config.mininsyncreplicas instead Minimum required nodes in-sync replicas (ISR) to produce to a partition.
    partitions int
    The number of partitions to create in the topic.
    project str
    Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
    replication int
    The replication factor for the topic.
    retention_bytes int
    DEPRECATED use config.retention_bytes instead Retention bytes.
    retention_hours int
    DEPRECATED use config.retention_ms instead Retention period (hours).
    service_name str
    Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
    tags Sequence[GetKafkaTopicTag]
    Kafka Topic tag.
    termination_protection bool
    topic_name str
    The name of the topic. This property cannot be changed, doing so forces recreation of the resource.
    cleanupPolicy String
    DEPRECATED use config.cleanup_policy instead Topic cleanup policy. The possible values are delete and compact.
    configs List<Property Map>
    Kafka topic configuration
    id String
    The provider-assigned unique ID for this managed resource.
    minimumInSyncReplicas Number
    DEPRECATED use config.mininsyncreplicas instead Minimum required nodes in-sync replicas (ISR) to produce to a partition.
    partitions Number
    The number of partitions to create in the topic.
    project String
    Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
    replication Number
    The replication factor for the topic.
    retentionBytes Number
    DEPRECATED use config.retention_bytes instead Retention bytes.
    retentionHours Number
    DEPRECATED use config.retention_ms instead Retention period (hours).
    serviceName String
    Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
    tags List<Property Map>
    Kafka Topic tag.
    terminationProtection Boolean
    topicName String
    The name of the topic. This property cannot be changed, doing so forces recreation of the resource.

    Supporting Types

    GetKafkaTopicConfig

    CleanupPolicy string
    DEPRECATED use config.cleanup_policy instead Topic cleanup policy. The possible values are delete and compact.
    CompressionType string
    DeleteRetentionMs string
    FileDeleteDelayMs string
    FlushMessages string
    FlushMs string
    IndexIntervalBytes string
    MaxCompactionLagMs string
    MaxMessageBytes string
    MessageDownconversionEnable string
    MessageFormatVersion string
    MessageTimestampDifferenceMaxMs string
    MessageTimestampType string
    MinCleanableDirtyRatio string
    MinCompactionLagMs string
    MinInsyncReplicas string
    Preallocate string
    RetentionBytes string
    DEPRECATED use config.retention_bytes instead Retention bytes.
    RetentionMs string
    SegmentBytes string
    SegmentIndexBytes string
    SegmentJitterMs string
    SegmentMs string
    UncleanLeaderElectionEnable string
    CleanupPolicy string
    DEPRECATED use config.cleanup_policy instead Topic cleanup policy. The possible values are delete and compact.
    CompressionType string
    DeleteRetentionMs string
    FileDeleteDelayMs string
    FlushMessages string
    FlushMs string
    IndexIntervalBytes string
    MaxCompactionLagMs string
    MaxMessageBytes string
    MessageDownconversionEnable string
    MessageFormatVersion string
    MessageTimestampDifferenceMaxMs string
    MessageTimestampType string
    MinCleanableDirtyRatio string
    MinCompactionLagMs string
    MinInsyncReplicas string
    Preallocate string
    RetentionBytes string
    DEPRECATED use config.retention_bytes instead Retention bytes.
    RetentionMs string
    SegmentBytes string
    SegmentIndexBytes string
    SegmentJitterMs string
    SegmentMs string
    UncleanLeaderElectionEnable string
    cleanupPolicy String
    DEPRECATED use config.cleanup_policy instead Topic cleanup policy. The possible values are delete and compact.
    compressionType String
    deleteRetentionMs String
    fileDeleteDelayMs String
    flushMessages String
    flushMs String
    indexIntervalBytes String
    maxCompactionLagMs String
    maxMessageBytes String
    messageDownconversionEnable String
    messageFormatVersion String
    messageTimestampDifferenceMaxMs String
    messageTimestampType String
    minCleanableDirtyRatio String
    minCompactionLagMs String
    minInsyncReplicas String
    preallocate String
    retentionBytes String
    DEPRECATED use config.retention_bytes instead Retention bytes.
    retentionMs String
    segmentBytes String
    segmentIndexBytes String
    segmentJitterMs String
    segmentMs String
    uncleanLeaderElectionEnable String
    cleanupPolicy string
    DEPRECATED use config.cleanup_policy instead Topic cleanup policy. The possible values are delete and compact.
    compressionType string
    deleteRetentionMs string
    fileDeleteDelayMs string
    flushMessages string
    flushMs string
    indexIntervalBytes string
    maxCompactionLagMs string
    maxMessageBytes string
    messageDownconversionEnable string
    messageFormatVersion string
    messageTimestampDifferenceMaxMs string
    messageTimestampType string
    minCleanableDirtyRatio string
    minCompactionLagMs string
    minInsyncReplicas string
    preallocate string
    retentionBytes string
    DEPRECATED use config.retention_bytes instead Retention bytes.
    retentionMs string
    segmentBytes string
    segmentIndexBytes string
    segmentJitterMs string
    segmentMs string
    uncleanLeaderElectionEnable string
    cleanupPolicy String
    DEPRECATED use config.cleanup_policy instead Topic cleanup policy. The possible values are delete and compact.
    compressionType String
    deleteRetentionMs String
    fileDeleteDelayMs String
    flushMessages String
    flushMs String
    indexIntervalBytes String
    maxCompactionLagMs String
    maxMessageBytes String
    messageDownconversionEnable String
    messageFormatVersion String
    messageTimestampDifferenceMaxMs String
    messageTimestampType String
    minCleanableDirtyRatio String
    minCompactionLagMs String
    minInsyncReplicas String
    preallocate String
    retentionBytes String
    DEPRECATED use config.retention_bytes instead Retention bytes.
    retentionMs String
    segmentBytes String
    segmentIndexBytes String
    segmentJitterMs String
    segmentMs String
    uncleanLeaderElectionEnable String

    GetKafkaTopicTag

    Key string
    Value string
    Key string
    Value string
    key String
    value String
    key string
    value string
    key str
    value str
    key String
    value String

    Package Details

    Repository
    Aiven pulumi/pulumi-aiven
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aiven Terraform Provider.
    aiven logo
    Viewing docs for Aiven v4.5.2 (Older version)
    published on Monday, Mar 9, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial