Confluent v2.22.0 published on Friday, Mar 28, 2025 by Pulumi
confluentcloud.getClusterLink
Explore with Pulumi AI
confluentcloud.ClusterLink describes a Cluster Link data source.
Example Usage
Option #1: Manage multiple Kafka clusters in the same Pulumi Stack
import * as pulumi from "@pulumi/pulumi";
import * as confluentcloud from "@pulumi/confluentcloud";
const main = confluentcloud.getClusterLink({
    linkName: "main-link",
    restEndpoint: west.restEndpoint,
    kafkaCluster: {
        id: west.id,
    },
    credentials: {
        key: app_manager_west_cluster_api_key.id,
        secret: app_manager_west_cluster_api_key.secret,
    },
});
export const kafkaClusterLinkId = main.then(main => main.clusterLinkId);
import pulumi
import pulumi_confluentcloud as confluentcloud
main = confluentcloud.get_cluster_link(link_name="main-link",
    rest_endpoint=west["restEndpoint"],
    kafka_cluster={
        "id": west["id"],
    },
    credentials={
        "key": app_manager_west_cluster_api_key["id"],
        "secret": app_manager_west_cluster_api_key["secret"],
    })
pulumi.export("kafkaClusterLinkId", main.cluster_link_id)
package main
import (
	"github.com/pulumi/pulumi-confluentcloud/sdk/v2/go/confluentcloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		main, err := confluentcloud.LookupClusterLink(ctx, &confluentcloud.LookupClusterLinkArgs{
			LinkName:     "main-link",
			RestEndpoint: pulumi.StringRef(west.RestEndpoint),
			KafkaCluster: confluentcloud.GetClusterLinkKafkaCluster{
				Id: west.Id,
			},
			Credentials: confluentcloud.GetClusterLinkCredentials{
				Key:    app_manager_west_cluster_api_key.Id,
				Secret: app_manager_west_cluster_api_key.Secret,
			},
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("kafkaClusterLinkId", main.ClusterLinkId)
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using ConfluentCloud = Pulumi.ConfluentCloud;
return await Deployment.RunAsync(() => 
{
    var main = ConfluentCloud.GetClusterLink.Invoke(new()
    {
        LinkName = "main-link",
        RestEndpoint = west.RestEndpoint,
        KafkaCluster = new ConfluentCloud.Inputs.GetClusterLinkKafkaClusterInputArgs
        {
            Id = west.Id,
        },
        Credentials = new ConfluentCloud.Inputs.GetClusterLinkCredentialsInputArgs
        {
            Key = app_manager_west_cluster_api_key.Id,
            Secret = app_manager_west_cluster_api_key.Secret,
        },
    });
    return new Dictionary<string, object?>
    {
        ["kafkaClusterLinkId"] = main.Apply(getClusterLinkResult => getClusterLinkResult.ClusterLinkId),
    };
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.confluentcloud.ConfluentcloudFunctions;
import com.pulumi.confluentcloud.inputs.GetClusterLinkArgs;
import com.pulumi.confluentcloud.inputs.GetClusterLinkKafkaClusterArgs;
import com.pulumi.confluentcloud.inputs.GetClusterLinkCredentialsArgs;
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 main = ConfluentcloudFunctions.getClusterLink(GetClusterLinkArgs.builder()
            .linkName("main-link")
            .restEndpoint(west.restEndpoint())
            .kafkaCluster(GetClusterLinkKafkaClusterArgs.builder()
                .id(west.id())
                .build())
            .credentials(GetClusterLinkCredentialsArgs.builder()
                .key(app_manager_west_cluster_api_key.id())
                .secret(app_manager_west_cluster_api_key.secret())
                .build())
            .build());
        ctx.export("kafkaClusterLinkId", main.applyValue(getClusterLinkResult -> getClusterLinkResult.clusterLinkId()));
    }
}
variables:
  main:
    fn::invoke:
      function: confluentcloud:getClusterLink
      arguments:
        linkName: main-link
        restEndpoint: ${west.restEndpoint}
        kafkaCluster:
          id: ${west.id}
        credentials:
          key: ${["app-manager-west-cluster-api-key"].id}
          secret: ${["app-manager-west-cluster-api-key"].secret}
outputs:
  kafkaClusterLinkId: ${main.clusterLinkId}
Option #2: Manage a single Kafka cluster in the same Pulumi Stack
import * as pulumi from "@pulumi/pulumi";
import * as confluentcloud from "@pulumi/confluentcloud";
const main = confluentcloud.getClusterLink({
    linkName: "main-link",
});
export const kafkaClusterLinkId = main.then(main => main.clusterLinkId);
import pulumi
import pulumi_confluentcloud as confluentcloud
main = confluentcloud.get_cluster_link(link_name="main-link")
pulumi.export("kafkaClusterLinkId", main.cluster_link_id)
package main
import (
	"github.com/pulumi/pulumi-confluentcloud/sdk/v2/go/confluentcloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		main, err := confluentcloud.LookupClusterLink(ctx, &confluentcloud.LookupClusterLinkArgs{
			LinkName: "main-link",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("kafkaClusterLinkId", main.ClusterLinkId)
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using ConfluentCloud = Pulumi.ConfluentCloud;
return await Deployment.RunAsync(() => 
{
    var main = ConfluentCloud.GetClusterLink.Invoke(new()
    {
        LinkName = "main-link",
    });
    return new Dictionary<string, object?>
    {
        ["kafkaClusterLinkId"] = main.Apply(getClusterLinkResult => getClusterLinkResult.ClusterLinkId),
    };
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.confluentcloud.ConfluentcloudFunctions;
import com.pulumi.confluentcloud.inputs.GetClusterLinkArgs;
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 main = ConfluentcloudFunctions.getClusterLink(GetClusterLinkArgs.builder()
            .linkName("main-link")
            .build());
        ctx.export("kafkaClusterLinkId", main.applyValue(getClusterLinkResult -> getClusterLinkResult.clusterLinkId()));
    }
}
variables:
  main:
    fn::invoke:
      function: confluentcloud:getClusterLink
      arguments:
        linkName: main-link
outputs:
  kafkaClusterLinkId: ${main.clusterLinkId}
Using getClusterLink
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 getClusterLink(args: GetClusterLinkArgs, opts?: InvokeOptions): Promise<GetClusterLinkResult>
function getClusterLinkOutput(args: GetClusterLinkOutputArgs, opts?: InvokeOptions): Output<GetClusterLinkResult>def get_cluster_link(credentials: Optional[GetClusterLinkCredentials] = None,
                     kafka_cluster: Optional[GetClusterLinkKafkaCluster] = None,
                     link_name: Optional[str] = None,
                     rest_endpoint: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetClusterLinkResult
def get_cluster_link_output(credentials: Optional[pulumi.Input[GetClusterLinkCredentialsArgs]] = None,
                     kafka_cluster: Optional[pulumi.Input[GetClusterLinkKafkaClusterArgs]] = None,
                     link_name: Optional[pulumi.Input[str]] = None,
                     rest_endpoint: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetClusterLinkResult]func LookupClusterLink(ctx *Context, args *LookupClusterLinkArgs, opts ...InvokeOption) (*LookupClusterLinkResult, error)
func LookupClusterLinkOutput(ctx *Context, args *LookupClusterLinkOutputArgs, opts ...InvokeOption) LookupClusterLinkResultOutput> Note: This function is named LookupClusterLink in the Go SDK.
public static class GetClusterLink 
{
    public static Task<GetClusterLinkResult> InvokeAsync(GetClusterLinkArgs args, InvokeOptions? opts = null)
    public static Output<GetClusterLinkResult> Invoke(GetClusterLinkInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetClusterLinkResult> getClusterLink(GetClusterLinkArgs args, InvokeOptions options)
public static Output<GetClusterLinkResult> getClusterLink(GetClusterLinkArgs args, InvokeOptions options)
fn::invoke:
  function: confluentcloud:index/getClusterLink:getClusterLink
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Link
Name string - The name of the cluster link, for example, 
my-cluster-link. - Credentials
Pulumi.
Confluent Cloud. Inputs. Get Cluster Link Credentials  - Kafka
Cluster Pulumi.Confluent Cloud. Inputs. Get Cluster Link Kafka Cluster  - Rest
Endpoint string - The REST endpoint of the Kafka cluster, for example, 
https://pkc-00000.us-central1.gcp.confluent.cloud:443). 
- Link
Name string - The name of the cluster link, for example, 
my-cluster-link. - Credentials
Get
Cluster Link Credentials  - Kafka
Cluster GetCluster Link Kafka Cluster  - Rest
Endpoint string - The REST endpoint of the Kafka cluster, for example, 
https://pkc-00000.us-central1.gcp.confluent.cloud:443). 
- link
Name String - The name of the cluster link, for example, 
my-cluster-link. - credentials
Get
Cluster Link Credentials  - kafka
Cluster GetCluster Link Kafka Cluster  - rest
Endpoint String - The REST endpoint of the Kafka cluster, for example, 
https://pkc-00000.us-central1.gcp.confluent.cloud:443). 
- link
Name string - The name of the cluster link, for example, 
my-cluster-link. - credentials
Get
Cluster Link Credentials  - kafka
Cluster GetCluster Link Kafka Cluster  - rest
Endpoint string - The REST endpoint of the Kafka cluster, for example, 
https://pkc-00000.us-central1.gcp.confluent.cloud:443). 
- link_
name str - The name of the cluster link, for example, 
my-cluster-link. - credentials
Get
Cluster Link Credentials  - kafka_
cluster GetCluster Link Kafka Cluster  - rest_
endpoint str - The REST endpoint of the Kafka cluster, for example, 
https://pkc-00000.us-central1.gcp.confluent.cloud:443). 
- link
Name String - The name of the cluster link, for example, 
my-cluster-link. - credentials Property Map
 - kafka
Cluster Property Map - rest
Endpoint String - The REST endpoint of the Kafka cluster, for example, 
https://pkc-00000.us-central1.gcp.confluent.cloud:443). 
getClusterLink Result
The following output properties are available:
- Cluster
Link stringId  - (Required String) The actual Cluster Link ID assigned from Confluent Cloud that uniquely represents a link between two Kafka clusters, for example, 
qz0HDEV-Qz2B5aPFpcWQJQ. - Config Dictionary<string, string>
 - (Optional Map) The custom cluster link settings retrieved:
 - Id string
 - (Required String) The composite ID of the Cluster Link data-source, in the format 
<Kafka cluster ID>/<Cluster link name>, for example,lkc-abc123/my-cluster-link. - Link
Name string - Link
State string - (Required String) The current state of the Cluster Link.
 - Credentials
Pulumi.
Confluent Cloud. Outputs. Get Cluster Link Credentials  - Kafka
Cluster Pulumi.Confluent Cloud. Outputs. Get Cluster Link Kafka Cluster  - Rest
Endpoint string 
- Cluster
Link stringId  - (Required String) The actual Cluster Link ID assigned from Confluent Cloud that uniquely represents a link between two Kafka clusters, for example, 
qz0HDEV-Qz2B5aPFpcWQJQ. - Config map[string]string
 - (Optional Map) The custom cluster link settings retrieved:
 - Id string
 - (Required String) The composite ID of the Cluster Link data-source, in the format 
<Kafka cluster ID>/<Cluster link name>, for example,lkc-abc123/my-cluster-link. - Link
Name string - Link
State string - (Required String) The current state of the Cluster Link.
 - Credentials
Get
Cluster Link Credentials  - Kafka
Cluster GetCluster Link Kafka Cluster  - Rest
Endpoint string 
- cluster
Link StringId  - (Required String) The actual Cluster Link ID assigned from Confluent Cloud that uniquely represents a link between two Kafka clusters, for example, 
qz0HDEV-Qz2B5aPFpcWQJQ. - config Map<String,String>
 - (Optional Map) The custom cluster link settings retrieved:
 - id String
 - (Required String) The composite ID of the Cluster Link data-source, in the format 
<Kafka cluster ID>/<Cluster link name>, for example,lkc-abc123/my-cluster-link. - link
Name String - link
State String - (Required String) The current state of the Cluster Link.
 - credentials
Get
Cluster Link Credentials  - kafka
Cluster GetCluster Link Kafka Cluster  - rest
Endpoint String 
- cluster
Link stringId  - (Required String) The actual Cluster Link ID assigned from Confluent Cloud that uniquely represents a link between two Kafka clusters, for example, 
qz0HDEV-Qz2B5aPFpcWQJQ. - config {[key: string]: string}
 - (Optional Map) The custom cluster link settings retrieved:
 - id string
 - (Required String) The composite ID of the Cluster Link data-source, in the format 
<Kafka cluster ID>/<Cluster link name>, for example,lkc-abc123/my-cluster-link. - link
Name string - link
State string - (Required String) The current state of the Cluster Link.
 - credentials
Get
Cluster Link Credentials  - kafka
Cluster GetCluster Link Kafka Cluster  - rest
Endpoint string 
- cluster_
link_ strid  - (Required String) The actual Cluster Link ID assigned from Confluent Cloud that uniquely represents a link between two Kafka clusters, for example, 
qz0HDEV-Qz2B5aPFpcWQJQ. - config Mapping[str, str]
 - (Optional Map) The custom cluster link settings retrieved:
 - id str
 - (Required String) The composite ID of the Cluster Link data-source, in the format 
<Kafka cluster ID>/<Cluster link name>, for example,lkc-abc123/my-cluster-link. - link_
name str - link_
state str - (Required String) The current state of the Cluster Link.
 - credentials
Get
Cluster Link Credentials  - kafka_
cluster GetCluster Link Kafka Cluster  - rest_
endpoint str 
- cluster
Link StringId  - (Required String) The actual Cluster Link ID assigned from Confluent Cloud that uniquely represents a link between two Kafka clusters, for example, 
qz0HDEV-Qz2B5aPFpcWQJQ. - config Map<String>
 - (Optional Map) The custom cluster link settings retrieved:
 - id String
 - (Required String) The composite ID of the Cluster Link data-source, in the format 
<Kafka cluster ID>/<Cluster link name>, for example,lkc-abc123/my-cluster-link. - link
Name String - link
State String - (Required String) The current state of the Cluster Link.
 - credentials Property Map
 - kafka
Cluster Property Map - rest
Endpoint String 
Supporting Types
GetClusterLinkCredentials   
GetClusterLinkKafkaCluster    
- Id string
 - The ID of the Kafka cluster to query for the Cluster Link, for example, 
lkc-abc123. 
- Id string
 - The ID of the Kafka cluster to query for the Cluster Link, for example, 
lkc-abc123. 
- id String
 - The ID of the Kafka cluster to query for the Cluster Link, for example, 
lkc-abc123. 
- id string
 - The ID of the Kafka cluster to query for the Cluster Link, for example, 
lkc-abc123. 
- id str
 - The ID of the Kafka cluster to query for the Cluster Link, for example, 
lkc-abc123. 
- id String
 - The ID of the Kafka cluster to query for the Cluster Link, for example, 
lkc-abc123. 
Package Details
- Repository
 - Confluent Cloud pulumi/pulumi-confluentcloud
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
confluentTerraform Provider.