1. Packages
  2. Redpanda Provider
  3. API Docs
  4. getServerlessCluster
redpanda 0.13.0 published on Monday, Mar 17, 2025 by redpanda-data

redpanda.getServerlessCluster

Explore with Pulumi AI

redpanda logo
redpanda 0.13.0 published on Monday, Mar 17, 2025 by redpanda-data

    Data source for a Redpanda Cloud serverless cluster

    Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as redpanda from "@pulumi/redpanda";
    
    const example = redpanda.getServerlessCluster({
        id: "serverless_cluster_id",
    });
    
    import pulumi
    import pulumi_redpanda as redpanda
    
    example = redpanda.get_serverless_cluster(id="serverless_cluster_id")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/redpanda/redpanda"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := redpanda.LookupServerlessCluster(ctx, &redpanda.LookupServerlessClusterArgs{
    			Id: "serverless_cluster_id",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Redpanda = Pulumi.Redpanda;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Redpanda.GetServerlessCluster.Invoke(new()
        {
            Id = "serverless_cluster_id",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.redpanda.RedpandaFunctions;
    import com.pulumi.redpanda.inputs.GetServerlessClusterArgs;
    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 = RedpandaFunctions.getServerlessCluster(GetServerlessClusterArgs.builder()
                .id("serverless_cluster_id")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: redpanda:getServerlessCluster
          arguments:
            id: serverless_cluster_id
    

    Example Usage to create a serverless cluster

    import * as pulumi from "@pulumi/pulumi";
    import * as redpanda from "@pulumi/redpanda";
    
    const testResourceGroup = new redpanda.ResourceGroup("testResourceGroup", {});
    const config = new pulumi.Config();
    const region = config.get("region") || "pro-us-east-1";
    const testServerlessCluster = new redpanda.ServerlessCluster("testServerlessCluster", {
        resourceGroupId: testResourceGroup.id,
        serverlessRegion: region,
    });
    const resourceGroupName = config.get("resourceGroupName") || "testgroup";
    const clusterName = config.get("clusterName") || "testname";
    
    import pulumi
    import pulumi_redpanda as redpanda
    
    test_resource_group = redpanda.ResourceGroup("testResourceGroup")
    config = pulumi.Config()
    region = config.get("region")
    if region is None:
        region = "pro-us-east-1"
    test_serverless_cluster = redpanda.ServerlessCluster("testServerlessCluster",
        resource_group_id=test_resource_group.id,
        serverless_region=region)
    resource_group_name = config.get("resourceGroupName")
    if resource_group_name is None:
        resource_group_name = "testgroup"
    cluster_name = config.get("clusterName")
    if cluster_name is None:
        cluster_name = "testname"
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/redpanda/redpanda"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		testResourceGroup, err := redpanda.NewResourceGroup(ctx, "testResourceGroup", nil)
    		if err != nil {
    			return err
    		}
    		cfg := config.New(ctx, "")
    		region := "pro-us-east-1"
    		if param := cfg.Get("region"); param != "" {
    			region = param
    		}
    		_, err = redpanda.NewServerlessCluster(ctx, "testServerlessCluster", &redpanda.ServerlessClusterArgs{
    			ResourceGroupId:  testResourceGroup.ID(),
    			ServerlessRegion: pulumi.String(region),
    		})
    		if err != nil {
    			return err
    		}
    		resourceGroupName := "testgroup"
    		if param := cfg.Get("resourceGroupName"); param != "" {
    			resourceGroupName = param
    		}
    		clusterName := "testname"
    		if param := cfg.Get("clusterName"); param != "" {
    			clusterName = param
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Redpanda = Pulumi.Redpanda;
    
    return await Deployment.RunAsync(() => 
    {
        var testResourceGroup = new Redpanda.ResourceGroup("testResourceGroup");
    
        var config = new Config();
        var region = config.Get("region") ?? "pro-us-east-1";
        var testServerlessCluster = new Redpanda.ServerlessCluster("testServerlessCluster", new()
        {
            ResourceGroupId = testResourceGroup.Id,
            ServerlessRegion = region,
        });
    
        var resourceGroupName = config.Get("resourceGroupName") ?? "testgroup";
        var clusterName = config.Get("clusterName") ?? "testname";
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.redpanda.ResourceGroup;
    import com.pulumi.redpanda.ServerlessCluster;
    import com.pulumi.redpanda.ServerlessClusterArgs;
    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 config = ctx.config();
            var testResourceGroup = new ResourceGroup("testResourceGroup");
    
            final var region = config.get("region").orElse("pro-us-east-1");
            var testServerlessCluster = new ServerlessCluster("testServerlessCluster", ServerlessClusterArgs.builder()
                .resourceGroupId(testResourceGroup.id())
                .serverlessRegion(region)
                .build());
    
            final var resourceGroupName = config.get("resourceGroupName").orElse("testgroup");
            final var clusterName = config.get("clusterName").orElse("testname");
        }
    }
    
    configuration:
      resourceGroupName:
        type: string
        default: testgroup
      clusterName:
        type: string
        default: testname
      region:
        type: string
        default: pro-us-east-1
    resources:
      testResourceGroup:
        type: redpanda:ResourceGroup
      testServerlessCluster:
        type: redpanda:ServerlessCluster
        properties:
          resourceGroupId: ${testResourceGroup.id}
          serverlessRegion: ${region}
    

    Limitations

    Can only be used with Redpanda Cloud serverless clusters.

    Using getServerlessCluster

    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 getServerlessCluster(args: GetServerlessClusterArgs, opts?: InvokeOptions): Promise<GetServerlessClusterResult>
    function getServerlessClusterOutput(args: GetServerlessClusterOutputArgs, opts?: InvokeOptions): Output<GetServerlessClusterResult>
    def get_serverless_cluster(id: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetServerlessClusterResult
    def get_serverless_cluster_output(id: Optional[pulumi.Input[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetServerlessClusterResult]
    func LookupServerlessCluster(ctx *Context, args *LookupServerlessClusterArgs, opts ...InvokeOption) (*LookupServerlessClusterResult, error)
    func LookupServerlessClusterOutput(ctx *Context, args *LookupServerlessClusterOutputArgs, opts ...InvokeOption) LookupServerlessClusterResultOutput

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

    public static class GetServerlessCluster 
    {
        public static Task<GetServerlessClusterResult> InvokeAsync(GetServerlessClusterArgs args, InvokeOptions? opts = null)
        public static Output<GetServerlessClusterResult> Invoke(GetServerlessClusterInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetServerlessClusterResult> getServerlessCluster(GetServerlessClusterArgs args, InvokeOptions options)
    public static Output<GetServerlessClusterResult> getServerlessCluster(GetServerlessClusterArgs args, InvokeOptions options)
    
    fn::invoke:
      function: redpanda:index/getServerlessCluster:getServerlessCluster
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    The ID of the serverless cluster
    Id string
    The ID of the serverless cluster
    id String
    The ID of the serverless cluster
    id string
    The ID of the serverless cluster
    id str
    The ID of the serverless cluster
    id String
    The ID of the serverless cluster

    getServerlessCluster Result

    The following output properties are available:

    ClusterApiUrl string
    The URL of the cluster API
    Id string
    The ID of the serverless cluster
    Name string
    Name of the serverless cluster
    ResourceGroupId string
    The ID of the resource group in which to create the serverless cluster
    ServerlessRegion string
    Redpanda specific region for the serverless cluster
    ClusterApiUrl string
    The URL of the cluster API
    Id string
    The ID of the serverless cluster
    Name string
    Name of the serverless cluster
    ResourceGroupId string
    The ID of the resource group in which to create the serverless cluster
    ServerlessRegion string
    Redpanda specific region for the serverless cluster
    clusterApiUrl String
    The URL of the cluster API
    id String
    The ID of the serverless cluster
    name String
    Name of the serverless cluster
    resourceGroupId String
    The ID of the resource group in which to create the serverless cluster
    serverlessRegion String
    Redpanda specific region for the serverless cluster
    clusterApiUrl string
    The URL of the cluster API
    id string
    The ID of the serverless cluster
    name string
    Name of the serverless cluster
    resourceGroupId string
    The ID of the resource group in which to create the serverless cluster
    serverlessRegion string
    Redpanda specific region for the serverless cluster
    cluster_api_url str
    The URL of the cluster API
    id str
    The ID of the serverless cluster
    name str
    Name of the serverless cluster
    resource_group_id str
    The ID of the resource group in which to create the serverless cluster
    serverless_region str
    Redpanda specific region for the serverless cluster
    clusterApiUrl String
    The URL of the cluster API
    id String
    The ID of the serverless cluster
    name String
    Name of the serverless cluster
    resourceGroupId String
    The ID of the resource group in which to create the serverless cluster
    serverlessRegion String
    Redpanda specific region for the serverless cluster

    Package Details

    Repository
    redpanda redpanda-data/terraform-provider-redpanda
    License
    Notes
    This Pulumi package is based on the redpanda Terraform Provider.
    redpanda logo
    redpanda 0.13.0 published on Monday, Mar 17, 2025 by redpanda-data