1. Packages
  2. Astra DB
  3. API Docs
  4. getKeyspace
Astra DB v1.0.42 published on Tuesday, Jun 6, 2023 by pulumiverse

astra.getKeyspace

Explore with Pulumi AI

astra logo
Astra DB v1.0.42 published on Tuesday, Jun 6, 2023 by pulumiverse

    astra.Keyspace provides a datasource for a particular keyspace. See astra.getKeyspaces if you’re looking to fetch all the keyspaces for a particular database.

    Example Usage

    using System.Collections.Generic;
    using Pulumi;
    using Astra = Pulumi.Astra;
    
    return await Deployment.RunAsync(() => 
    {
        var dev = Astra.GetKeyspace.Invoke(new()
        {
            DatabaseId = "f9f4b1e0-4c05-451e-9bba-d631295a7f73",
            Name = "puppies",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-astra/sdk/go/astra"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-astra/sdk/go/astra"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := astra.LookupKeyspace(ctx, &GetKeyspaceArgs{
    			DatabaseId: "f9f4b1e0-4c05-451e-9bba-d631295a7f73",
    			Name:       "puppies",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.astra.AstraFunctions;
    import com.pulumi.astra.inputs.GetKeyspaceArgs;
    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 dev = AstraFunctions.getKeyspace(GetKeyspaceArgs.builder()
                .databaseId("f9f4b1e0-4c05-451e-9bba-d631295a7f73")
                .name("puppies")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_astra as astra
    
    dev = astra.get_keyspace(database_id="f9f4b1e0-4c05-451e-9bba-d631295a7f73",
        name="puppies")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as astra from "@pulumi/astra";
    
    const dev = pulumi.output(astra.getKeyspace({
        databaseId: "f9f4b1e0-4c05-451e-9bba-d631295a7f73",
        name: "puppies",
    }));
    
    variables:
      dev:
        Fn::Invoke:
          Function: astra:getKeyspace
          Arguments:
            databaseId: f9f4b1e0-4c05-451e-9bba-d631295a7f73
            name: puppies
    

    Using getKeyspace

    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 getKeyspace(args: GetKeyspaceArgs, opts?: InvokeOptions): Promise<GetKeyspaceResult>
    function getKeyspaceOutput(args: GetKeyspaceOutputArgs, opts?: InvokeOptions): Output<GetKeyspaceResult>
    def get_keyspace(database_id: Optional[str] = None,
                     name: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetKeyspaceResult
    def get_keyspace_output(database_id: Optional[pulumi.Input[str]] = None,
                     name: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetKeyspaceResult]
    func LookupKeyspace(ctx *Context, args *LookupKeyspaceArgs, opts ...InvokeOption) (*LookupKeyspaceResult, error)
    func LookupKeyspaceOutput(ctx *Context, args *LookupKeyspaceOutputArgs, opts ...InvokeOption) LookupKeyspaceResultOutput

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

    public static class GetKeyspace 
    {
        public static Task<GetKeyspaceResult> InvokeAsync(GetKeyspaceArgs args, InvokeOptions? opts = null)
        public static Output<GetKeyspaceResult> Invoke(GetKeyspaceInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetKeyspaceResult> getKeyspace(GetKeyspaceArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: astra:index/getKeyspace:getKeyspace
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DatabaseId string
    The ID of the Astra database.
    Name string
    The keyspace name.
    DatabaseId string
    The ID of the Astra database.
    Name string
    The keyspace name.
    databaseId String
    The ID of the Astra database.
    name String
    The keyspace name.
    databaseId string
    The ID of the Astra database.
    name string
    The keyspace name.
    database_id str
    The ID of the Astra database.
    name str
    The keyspace name.
    databaseId String
    The ID of the Astra database.
    name String
    The keyspace name.

    getKeyspace Result

    The following output properties are available:

    DatabaseId string
    The ID of the Astra database.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The keyspace name.
    DatabaseId string
    The ID of the Astra database.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The keyspace name.
    databaseId String
    The ID of the Astra database.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The keyspace name.
    databaseId string
    The ID of the Astra database.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The keyspace name.
    database_id str
    The ID of the Astra database.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The keyspace name.
    databaseId String
    The ID of the Astra database.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The keyspace name.

    Package Details

    Repository
    astra pulumiverse/pulumi-astra
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the astra Terraform Provider.
    astra logo
    Astra DB v1.0.42 published on Tuesday, Jun 6, 2023 by pulumiverse