1. Packages
  2. Ionoscloud Provider
  3. API Docs
  4. getKafkaCluster
ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud

ionoscloud.getKafkaCluster

Explore with Pulumi AI

ionoscloud logo
ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud

    The Kafka Cluster data source can be used to search for and return an existing Kafka Cluster. You can provide a string for the name parameter which will be compared with provisioned Kafka Clusters. If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned. When this happens, please refine your search string so that it is specific enough to return only one result.

    Example Usage

    By ID

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@pulumi/ionoscloud";
    
    const example = ionoscloud.getKafkaCluster({
        id: "your_kafka_cluster_id",
        location: "location_of_kafka_cluster",
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.get_kafka_cluster(id="your_kafka_cluster_id",
        location="location_of_kafka_cluster")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ionoscloud.LookupKafkaCluster(ctx, &ionoscloud.LookupKafkaClusterArgs{
    			Id:       pulumi.StringRef("your_kafka_cluster_id"),
    			Location: "location_of_kafka_cluster",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ionoscloud = Pulumi.Ionoscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Ionoscloud.GetKafkaCluster.Invoke(new()
        {
            Id = "your_kafka_cluster_id",
            Location = "location_of_kafka_cluster",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ionoscloud.IonoscloudFunctions;
    import com.pulumi.ionoscloud.inputs.GetKafkaClusterArgs;
    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) {
            final var example = IonoscloudFunctions.getKafkaCluster(GetKafkaClusterArgs.builder()
                .id("your_kafka_cluster_id")
                .location("location_of_kafka_cluster")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:getKafkaCluster
          arguments:
            id: your_kafka_cluster_id
            location: location_of_kafka_cluster
    

    By Name

    Needs to have the resource be previously created, or a depends_on clause to ensure that the resource is created before this data source is called.

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@pulumi/ionoscloud";
    
    const example = ionoscloud.getKafkaCluster({
        location: "location_of_kafka_cluster",
        name: "kafka-cluster",
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.get_kafka_cluster(location="location_of_kafka_cluster",
        name="kafka-cluster")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ionoscloud.LookupKafkaCluster(ctx, &ionoscloud.LookupKafkaClusterArgs{
    			Location: "location_of_kafka_cluster",
    			Name:     pulumi.StringRef("kafka-cluster"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ionoscloud = Pulumi.Ionoscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Ionoscloud.GetKafkaCluster.Invoke(new()
        {
            Location = "location_of_kafka_cluster",
            Name = "kafka-cluster",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ionoscloud.IonoscloudFunctions;
    import com.pulumi.ionoscloud.inputs.GetKafkaClusterArgs;
    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) {
            final var example = IonoscloudFunctions.getKafkaCluster(GetKafkaClusterArgs.builder()
                .location("location_of_kafka_cluster")
                .name("kafka-cluster")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:getKafkaCluster
          arguments:
            location: location_of_kafka_cluster
            name: kafka-cluster
    

    Using getKafkaCluster

    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 getKafkaCluster(args: GetKafkaClusterArgs, opts?: InvokeOptions): Promise<GetKafkaClusterResult>
    function getKafkaClusterOutput(args: GetKafkaClusterOutputArgs, opts?: InvokeOptions): Output<GetKafkaClusterResult>
    def get_kafka_cluster(id: Optional[str] = None,
                          location: Optional[str] = None,
                          name: Optional[str] = None,
                          partial_match: Optional[bool] = None,
                          opts: Optional[InvokeOptions] = None) -> GetKafkaClusterResult
    def get_kafka_cluster_output(id: Optional[pulumi.Input[str]] = None,
                          location: Optional[pulumi.Input[str]] = None,
                          name: Optional[pulumi.Input[str]] = None,
                          partial_match: Optional[pulumi.Input[bool]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetKafkaClusterResult]
    func LookupKafkaCluster(ctx *Context, args *LookupKafkaClusterArgs, opts ...InvokeOption) (*LookupKafkaClusterResult, error)
    func LookupKafkaClusterOutput(ctx *Context, args *LookupKafkaClusterOutputArgs, opts ...InvokeOption) LookupKafkaClusterResultOutput

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

    public static class GetKafkaCluster 
    {
        public static Task<GetKafkaClusterResult> InvokeAsync(GetKafkaClusterArgs args, InvokeOptions? opts = null)
        public static Output<GetKafkaClusterResult> Invoke(GetKafkaClusterInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetKafkaClusterResult> getKafkaCluster(GetKafkaClusterArgs args, InvokeOptions options)
    public static Output<GetKafkaClusterResult> getKafkaCluster(GetKafkaClusterArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ionoscloud:index/getKafkaCluster:getKafkaCluster
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Location string
    The location of the Kafka Cluster. Possible values: de/fra, de/txl
    Id string
    ID of an existing Kafka Cluster that you want to search for.
    Name string
    Name of an existing Kafka Cluster that you want to search for.
    PartialMatch bool
    Location string
    The location of the Kafka Cluster. Possible values: de/fra, de/txl
    Id string
    ID of an existing Kafka Cluster that you want to search for.
    Name string
    Name of an existing Kafka Cluster that you want to search for.
    PartialMatch bool
    location String
    The location of the Kafka Cluster. Possible values: de/fra, de/txl
    id String
    ID of an existing Kafka Cluster that you want to search for.
    name String
    Name of an existing Kafka Cluster that you want to search for.
    partialMatch Boolean
    location string
    The location of the Kafka Cluster. Possible values: de/fra, de/txl
    id string
    ID of an existing Kafka Cluster that you want to search for.
    name string
    Name of an existing Kafka Cluster that you want to search for.
    partialMatch boolean
    location str
    The location of the Kafka Cluster. Possible values: de/fra, de/txl
    id str
    ID of an existing Kafka Cluster that you want to search for.
    name str
    Name of an existing Kafka Cluster that you want to search for.
    partial_match bool
    location String
    The location of the Kafka Cluster. Possible values: de/fra, de/txl
    id String
    ID of an existing Kafka Cluster that you want to search for.
    name String
    Name of an existing Kafka Cluster that you want to search for.
    partialMatch Boolean

    getKafkaCluster Result

    The following output properties are available:

    BrokerAddresses List<string>
    IP address and port of cluster brokers.
    Connections List<GetKafkaClusterConnection>
    Connection information of the Kafka Cluster. Minimum items: 1, maximum items: 1.
    Id string
    UUID of the Kafka Cluster.
    Location string
    Name string
    The name of the Kafka Cluster.
    Size string
    The size of the Kafka Cluster.
    Version string
    The version of the Kafka Cluster.
    PartialMatch bool
    BrokerAddresses []string
    IP address and port of cluster brokers.
    Connections []GetKafkaClusterConnection
    Connection information of the Kafka Cluster. Minimum items: 1, maximum items: 1.
    Id string
    UUID of the Kafka Cluster.
    Location string
    Name string
    The name of the Kafka Cluster.
    Size string
    The size of the Kafka Cluster.
    Version string
    The version of the Kafka Cluster.
    PartialMatch bool
    brokerAddresses List<String>
    IP address and port of cluster brokers.
    connections List<GetKafkaClusterConnection>
    Connection information of the Kafka Cluster. Minimum items: 1, maximum items: 1.
    id String
    UUID of the Kafka Cluster.
    location String
    name String
    The name of the Kafka Cluster.
    size String
    The size of the Kafka Cluster.
    version String
    The version of the Kafka Cluster.
    partialMatch Boolean
    brokerAddresses string[]
    IP address and port of cluster brokers.
    connections GetKafkaClusterConnection[]
    Connection information of the Kafka Cluster. Minimum items: 1, maximum items: 1.
    id string
    UUID of the Kafka Cluster.
    location string
    name string
    The name of the Kafka Cluster.
    size string
    The size of the Kafka Cluster.
    version string
    The version of the Kafka Cluster.
    partialMatch boolean
    broker_addresses Sequence[str]
    IP address and port of cluster brokers.
    connections Sequence[GetKafkaClusterConnection]
    Connection information of the Kafka Cluster. Minimum items: 1, maximum items: 1.
    id str
    UUID of the Kafka Cluster.
    location str
    name str
    The name of the Kafka Cluster.
    size str
    The size of the Kafka Cluster.
    version str
    The version of the Kafka Cluster.
    partial_match bool
    brokerAddresses List<String>
    IP address and port of cluster brokers.
    connections List<Property Map>
    Connection information of the Kafka Cluster. Minimum items: 1, maximum items: 1.
    id String
    UUID of the Kafka Cluster.
    location String
    name String
    The name of the Kafka Cluster.
    size String
    The size of the Kafka Cluster.
    version String
    The version of the Kafka Cluster.
    partialMatch Boolean

    Supporting Types

    GetKafkaClusterConnection

    BrokerAddresses List<string>
    IP address and port of cluster brokers.
    DatacenterId string
    The datacenter that your instance is connected to.
    LanId string
    The numeric LAN ID your instance is connected to.
    BrokerAddresses []string
    IP address and port of cluster brokers.
    DatacenterId string
    The datacenter that your instance is connected to.
    LanId string
    The numeric LAN ID your instance is connected to.
    brokerAddresses List<String>
    IP address and port of cluster brokers.
    datacenterId String
    The datacenter that your instance is connected to.
    lanId String
    The numeric LAN ID your instance is connected to.
    brokerAddresses string[]
    IP address and port of cluster brokers.
    datacenterId string
    The datacenter that your instance is connected to.
    lanId string
    The numeric LAN ID your instance is connected to.
    broker_addresses Sequence[str]
    IP address and port of cluster brokers.
    datacenter_id str
    The datacenter that your instance is connected to.
    lan_id str
    The numeric LAN ID your instance is connected to.
    brokerAddresses List<String>
    IP address and port of cluster brokers.
    datacenterId String
    The datacenter that your instance is connected to.
    lanId String
    The numeric LAN ID your instance is connected to.

    Package Details

    Repository
    ionoscloud ionos-cloud/terraform-provider-ionoscloud
    License
    Notes
    This Pulumi package is based on the ionoscloud Terraform Provider.
    ionoscloud logo
    ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud