1. Packages
  2. Ionoscloud
  3. API Docs
  4. kafka
  5. getCluster
IonosCloud v0.2.3 published on Tuesday, May 13, 2025 by ionos-cloud

ionoscloud.kafka.getCluster

Explore with Pulumi AI

ionoscloud logo
IonosCloud v0.2.3 published on Tuesday, May 13, 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.kafka.getCluster({
        id: "your_kafka_cluster_id",
        location: "location_of_kafka_cluster",
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.kafka.get_cluster(id="your_kafka_cluster_id",
        location="location_of_kafka_cluster")
    
    package main
    
    import (
    	"github.com/ionos-cloud/pulumi-ionoscloud/sdk/go/ionoscloud/kafka"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := kafka.LookupCluster(ctx, &kafka.LookupClusterArgs{
    			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.Kafka.GetCluster.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.kafka.KafkaFunctions;
    import com.pulumi.ionoscloud.kafka.inputs.GetClusterArgs;
    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 = KafkaFunctions.getCluster(GetClusterArgs.builder()
                .id("your_kafka_cluster_id")
                .location("location_of_kafka_cluster")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:kafka:getCluster
          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.kafka.getCluster({
        name: "kafka-cluster",
        location: "location_of_kafka_cluster",
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.kafka.get_cluster(name="kafka-cluster",
        location="location_of_kafka_cluster")
    
    package main
    
    import (
    	"github.com/ionos-cloud/pulumi-ionoscloud/sdk/go/ionoscloud/kafka"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := kafka.LookupCluster(ctx, &kafka.LookupClusterArgs{
    			Name:     pulumi.StringRef("kafka-cluster"),
    			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.Kafka.GetCluster.Invoke(new()
        {
            Name = "kafka-cluster",
            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.kafka.KafkaFunctions;
    import com.pulumi.ionoscloud.kafka.inputs.GetClusterArgs;
    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 = KafkaFunctions.getCluster(GetClusterArgs.builder()
                .name("kafka-cluster")
                .location("location_of_kafka_cluster")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:kafka:getCluster
          arguments:
            name: kafka-cluster
            location: location_of_kafka_cluster
    

    Using getCluster

    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 getCluster(args: GetClusterArgs, opts?: InvokeOptions): Promise<GetClusterResult>
    function getClusterOutput(args: GetClusterOutputArgs, opts?: InvokeOptions): Output<GetClusterResult>
    def get_cluster(id: Optional[str] = None,
                    location: Optional[str] = None,
                    name: Optional[str] = None,
                    partial_match: Optional[bool] = None,
                    opts: Optional[InvokeOptions] = None) -> GetClusterResult
    def get_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[GetClusterResult]
    func LookupCluster(ctx *Context, args *LookupClusterArgs, opts ...InvokeOption) (*LookupClusterResult, error)
    func LookupClusterOutput(ctx *Context, args *LookupClusterOutputArgs, opts ...InvokeOption) LookupClusterResultOutput

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

    public static class GetCluster 
    {
        public static Task<GetClusterResult> InvokeAsync(GetClusterArgs args, InvokeOptions? opts = null)
        public static Output<GetClusterResult> Invoke(GetClusterInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetClusterResult> getCluster(GetClusterArgs args, InvokeOptions options)
    public static Output<GetClusterResult> getCluster(GetClusterArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ionoscloud:kafka/getCluster:getCluster
      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

    getCluster Result

    The following output properties are available:

    BrokerAddresses List<string>
    IP address and port of cluster brokers.
    Connections List<Ionoscloud.GetClusterConnection>
    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 []GetClusterConnection
    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<GetClusterConnection>
    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 GetClusterConnection[]
    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[GetClusterConnection]
    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

    GetClusterConnection

    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/pulumi-ionoscloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ionoscloud Terraform Provider.
    ionoscloud logo
    IonosCloud v0.2.3 published on Tuesday, May 13, 2025 by ionos-cloud