1. Packages
  2. Packages
  3. Ionoscloud
  4. API Docs
  5. getKafkaUserCredentials
Viewing docs for IonosCloud v0.3.0
published on Wednesday, Apr 15, 2026 by ionos-cloud
ionoscloud logo
Viewing docs for IonosCloud v0.3.0
published on Wednesday, Apr 15, 2026 by ionos-cloud

    The Kafka user credentials data source can be used to retrieve access credentials for a specific user.

    ⚠️ In order to avoid storing sensitive data in the state, the user credentials ephemeral resource can be used.

    Example Usage

    By ID

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@ionos-cloud/sdk-pulumi";
    
    const kafkaUserCredentialsDs = ionoscloud.getKafkaUserCredentials({
        clusterId: "kafka_cluster_id",
        id: "kafka_user_id",
        location: "kafka_cluster_location",
        timeouts: {
            read: "1m",
        },
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    kafka_user_credentials_ds = ionoscloud.get_kafka_user_credentials(cluster_id="kafka_cluster_id",
        id="kafka_user_id",
        location="kafka_cluster_location",
        timeouts={
            "read": "1m",
        })
    
    package main
    
    import (
    	"github.com/ionos-cloud/pulumi-ionoscloud/sdk/go/ionoscloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ionoscloud.GetKafkaUserCredentials(ctx, &ionoscloud.GetKafkaUserCredentialsArgs{
    			ClusterId: "kafka_cluster_id",
    			Id:        pulumi.StringRef("kafka_user_id"),
    			Location:  pulumi.StringRef("kafka_cluster_location"),
    			Timeouts: ionoscloud.GetKafkaUserCredentialsTimeouts{
    				Read: pulumi.StringRef("1m"),
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ionoscloud = Ionoscloud.Pulumi.Ionoscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var kafkaUserCredentialsDs = Ionoscloud.Index.GetKafkaUserCredentials.Invoke(new()
        {
            ClusterId = "kafka_cluster_id",
            Id = "kafka_user_id",
            Location = "kafka_cluster_location",
            Timeouts = new Ionoscloud.Inputs.GetKafkaUserCredentialsTimeoutsInputArgs
            {
                Read = "1m",
            },
        });
    
    });
    
    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.GetKafkaUserCredentialsArgs;
    import com.pulumi.ionoscloud.inputs.GetKafkaUserCredentialsTimeoutsArgs;
    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 kafkaUserCredentialsDs = IonoscloudFunctions.getKafkaUserCredentials(GetKafkaUserCredentialsArgs.builder()
                .clusterId("kafka_cluster_id")
                .id("kafka_user_id")
                .location("kafka_cluster_location")
                .timeouts(GetKafkaUserCredentialsTimeoutsArgs.builder()
                    .read("1m")
                    .build())
                .build());
    
        }
    }
    
    variables:
      kafkaUserCredentialsDs:
        fn::invoke:
          function: ionoscloud:getKafkaUserCredentials
          arguments:
            clusterId: kafka_cluster_id
            id: kafka_user_id
            location: kafka_cluster_location
            timeouts:
              read: 1m
    
    Example coming soon!
    

    By name

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@ionos-cloud/sdk-pulumi";
    
    const kafkaUserCredentialsDs = ionoscloud.getKafkaUserCredentials({
        clusterId: "kafka_cluster_id",
        username: "kafka_username",
        location: "kafka_cluster_location",
        timeouts: {
            read: "1m",
        },
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    kafka_user_credentials_ds = ionoscloud.get_kafka_user_credentials(cluster_id="kafka_cluster_id",
        username="kafka_username",
        location="kafka_cluster_location",
        timeouts={
            "read": "1m",
        })
    
    package main
    
    import (
    	"github.com/ionos-cloud/pulumi-ionoscloud/sdk/go/ionoscloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ionoscloud.GetKafkaUserCredentials(ctx, &ionoscloud.GetKafkaUserCredentialsArgs{
    			ClusterId: "kafka_cluster_id",
    			Username:  pulumi.StringRef("kafka_username"),
    			Location:  pulumi.StringRef("kafka_cluster_location"),
    			Timeouts: ionoscloud.GetKafkaUserCredentialsTimeouts{
    				Read: pulumi.StringRef("1m"),
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ionoscloud = Ionoscloud.Pulumi.Ionoscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var kafkaUserCredentialsDs = Ionoscloud.Index.GetKafkaUserCredentials.Invoke(new()
        {
            ClusterId = "kafka_cluster_id",
            Username = "kafka_username",
            Location = "kafka_cluster_location",
            Timeouts = new Ionoscloud.Inputs.GetKafkaUserCredentialsTimeoutsInputArgs
            {
                Read = "1m",
            },
        });
    
    });
    
    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.GetKafkaUserCredentialsArgs;
    import com.pulumi.ionoscloud.inputs.GetKafkaUserCredentialsTimeoutsArgs;
    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 kafkaUserCredentialsDs = IonoscloudFunctions.getKafkaUserCredentials(GetKafkaUserCredentialsArgs.builder()
                .clusterId("kafka_cluster_id")
                .username("kafka_username")
                .location("kafka_cluster_location")
                .timeouts(GetKafkaUserCredentialsTimeoutsArgs.builder()
                    .read("1m")
                    .build())
                .build());
    
        }
    }
    
    variables:
      kafkaUserCredentialsDs:
        fn::invoke:
          function: ionoscloud:getKafkaUserCredentials
          arguments:
            clusterId: kafka_cluster_id
            username: kafka_username
            location: kafka_cluster_location
            timeouts:
              read: 1m
    
    Example coming soon!
    

    Attributes reference

    The following attributes are returned by the data source:

    • id - the ID of the user;
    • username - the name of the user;
    • certificateAuthority - PEM for the certificate authority;
    • privateKey - PEM for the private key;
    • certificate - PEM for the certificate;

    Using getKafkaUserCredentials

    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 getKafkaUserCredentials(args: GetKafkaUserCredentialsArgs, opts?: InvokeOptions): Promise<GetKafkaUserCredentialsResult>
    function getKafkaUserCredentialsOutput(args: GetKafkaUserCredentialsOutputArgs, opts?: InvokeOptions): Output<GetKafkaUserCredentialsResult>
    def get_kafka_user_credentials(cluster_id: Optional[str] = None,
                                   id: Optional[str] = None,
                                   location: Optional[str] = None,
                                   timeouts: Optional[GetKafkaUserCredentialsTimeouts] = None,
                                   username: Optional[str] = None,
                                   opts: Optional[InvokeOptions] = None) -> GetKafkaUserCredentialsResult
    def get_kafka_user_credentials_output(cluster_id: pulumi.Input[Optional[str]] = None,
                                   id: pulumi.Input[Optional[str]] = None,
                                   location: pulumi.Input[Optional[str]] = None,
                                   timeouts: pulumi.Input[Optional[GetKafkaUserCredentialsTimeoutsArgs]] = None,
                                   username: pulumi.Input[Optional[str]] = None,
                                   opts: Optional[InvokeOptions] = None) -> Output[GetKafkaUserCredentialsResult]
    func GetKafkaUserCredentials(ctx *Context, args *GetKafkaUserCredentialsArgs, opts ...InvokeOption) (*GetKafkaUserCredentialsResult, error)
    func GetKafkaUserCredentialsOutput(ctx *Context, args *GetKafkaUserCredentialsOutputArgs, opts ...InvokeOption) GetKafkaUserCredentialsResultOutput

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

    public static class GetKafkaUserCredentials 
    {
        public static Task<GetKafkaUserCredentialsResult> InvokeAsync(GetKafkaUserCredentialsArgs args, InvokeOptions? opts = null)
        public static Output<GetKafkaUserCredentialsResult> Invoke(GetKafkaUserCredentialsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetKafkaUserCredentialsResult> getKafkaUserCredentials(GetKafkaUserCredentialsArgs args, InvokeOptions options)
    public static Output<GetKafkaUserCredentialsResult> getKafkaUserCredentials(GetKafkaUserCredentialsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ionoscloud:index/getKafkaUserCredentials:getKafkaUserCredentials
      arguments:
        # arguments dictionary
    data "ionoscloud_getkafkausercredentials" "name" {
        # arguments
    }

    The following arguments are supported:

    ClusterId string
    [string] the ID of the Kafka cluster;
    Id string
    [string] the ID of the Kafka user, can be retrieved using ionoscloud.getKafkaUsers data source;
    Location string
    [string] the location of the Kafka cluster, can be one of: de/fra, de/fra/2, de/txl, fr/par, es/vit, gb/lhr, gb/bhx, us/las, us/mci, us/ewr. If omitted, the default location will be used: de/fra;
    Timeouts Ionoscloud.GetKafkaUserCredentialsTimeouts
    Username string
    [string] the name of the Kafka user, can be retrieved using ionoscloud.getKafkaUsers data source;
    ClusterId string
    [string] the ID of the Kafka cluster;
    Id string
    [string] the ID of the Kafka user, can be retrieved using ionoscloud.getKafkaUsers data source;
    Location string
    [string] the location of the Kafka cluster, can be one of: de/fra, de/fra/2, de/txl, fr/par, es/vit, gb/lhr, gb/bhx, us/las, us/mci, us/ewr. If omitted, the default location will be used: de/fra;
    Timeouts GetKafkaUserCredentialsTimeouts
    Username string
    [string] the name of the Kafka user, can be retrieved using ionoscloud.getKafkaUsers data source;
    cluster_id string
    [string] the ID of the Kafka cluster;
    id string
    [string] the ID of the Kafka user, can be retrieved using ionoscloud.getKafkaUsers data source;
    location string
    [string] the location of the Kafka cluster, can be one of: de/fra, de/fra/2, de/txl, fr/par, es/vit, gb/lhr, gb/bhx, us/las, us/mci, us/ewr. If omitted, the default location will be used: de/fra;
    timeouts object
    username string
    [string] the name of the Kafka user, can be retrieved using ionoscloud.getKafkaUsers data source;
    clusterId String
    [string] the ID of the Kafka cluster;
    id String
    [string] the ID of the Kafka user, can be retrieved using ionoscloud.getKafkaUsers data source;
    location String
    [string] the location of the Kafka cluster, can be one of: de/fra, de/fra/2, de/txl, fr/par, es/vit, gb/lhr, gb/bhx, us/las, us/mci, us/ewr. If omitted, the default location will be used: de/fra;
    timeouts GetKafkaUserCredentialsTimeouts
    username String
    [string] the name of the Kafka user, can be retrieved using ionoscloud.getKafkaUsers data source;
    clusterId string
    [string] the ID of the Kafka cluster;
    id string
    [string] the ID of the Kafka user, can be retrieved using ionoscloud.getKafkaUsers data source;
    location string
    [string] the location of the Kafka cluster, can be one of: de/fra, de/fra/2, de/txl, fr/par, es/vit, gb/lhr, gb/bhx, us/las, us/mci, us/ewr. If omitted, the default location will be used: de/fra;
    timeouts GetKafkaUserCredentialsTimeouts
    username string
    [string] the name of the Kafka user, can be retrieved using ionoscloud.getKafkaUsers data source;
    cluster_id str
    [string] the ID of the Kafka cluster;
    id str
    [string] the ID of the Kafka user, can be retrieved using ionoscloud.getKafkaUsers data source;
    location str
    [string] the location of the Kafka cluster, can be one of: de/fra, de/fra/2, de/txl, fr/par, es/vit, gb/lhr, gb/bhx, us/las, us/mci, us/ewr. If omitted, the default location will be used: de/fra;
    timeouts GetKafkaUserCredentialsTimeouts
    username str
    [string] the name of the Kafka user, can be retrieved using ionoscloud.getKafkaUsers data source;
    clusterId String
    [string] the ID of the Kafka cluster;
    id String
    [string] the ID of the Kafka user, can be retrieved using ionoscloud.getKafkaUsers data source;
    location String
    [string] the location of the Kafka cluster, can be one of: de/fra, de/fra/2, de/txl, fr/par, es/vit, gb/lhr, gb/bhx, us/las, us/mci, us/ewr. If omitted, the default location will be used: de/fra;
    timeouts Property Map
    username String
    [string] the name of the Kafka user, can be retrieved using ionoscloud.getKafkaUsers data source;

    getKafkaUserCredentials Result

    The following output properties are available:

    Supporting Types

    GetKafkaUserCredentialsTimeouts

    Read string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    Read string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    read string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    read String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    read string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    read str
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    read String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

    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
    Viewing docs for IonosCloud v0.3.0
    published on Wednesday, Apr 15, 2026 by ionos-cloud
      Try Pulumi Cloud free. Your team will thank you.