1. Packages
  2. Snowflake Provider
  3. API Docs
  4. getDatabase
Snowflake v0.61.1 published on Thursday, Nov 14, 2024 by Pulumi

snowflake.getDatabase

Explore with Pulumi AI

snowflake logo
Snowflake v0.61.1 published on Thursday, Nov 14, 2024 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as snowflake from "@pulumi/snowflake";
    
    const this = snowflake.getDatabase({
        name: "DEMO_DB",
    });
    
    import pulumi
    import pulumi_snowflake as snowflake
    
    this = snowflake.get_database(name="DEMO_DB")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-snowflake/sdk/go/snowflake"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := snowflake.LookupDatabase(ctx, &snowflake.LookupDatabaseArgs{
    			Name: "DEMO_DB",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Snowflake = Pulumi.Snowflake;
    
    return await Deployment.RunAsync(() => 
    {
        var @this = Snowflake.GetDatabase.Invoke(new()
        {
            Name = "DEMO_DB",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.snowflake.SnowflakeFunctions;
    import com.pulumi.snowflake.inputs.GetDatabaseArgs;
    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 this = SnowflakeFunctions.getDatabase(GetDatabaseArgs.builder()
                .name("DEMO_DB")
                .build());
    
        }
    }
    
    variables:
      this:
        fn::invoke:
          Function: snowflake:getDatabase
          Arguments:
            name: DEMO_DB
    

    Using getDatabase

    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 getDatabase(args: GetDatabaseArgs, opts?: InvokeOptions): Promise<GetDatabaseResult>
    function getDatabaseOutput(args: GetDatabaseOutputArgs, opts?: InvokeOptions): Output<GetDatabaseResult>
    def get_database(name: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetDatabaseResult
    def get_database_output(name: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetDatabaseResult]
    func LookupDatabase(ctx *Context, args *LookupDatabaseArgs, opts ...InvokeOption) (*LookupDatabaseResult, error)
    func LookupDatabaseOutput(ctx *Context, args *LookupDatabaseOutputArgs, opts ...InvokeOption) LookupDatabaseResultOutput

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

    public static class GetDatabase 
    {
        public static Task<GetDatabaseResult> InvokeAsync(GetDatabaseArgs args, InvokeOptions? opts = null)
        public static Output<GetDatabaseResult> Invoke(GetDatabaseInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDatabaseResult> getDatabase(GetDatabaseArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: snowflake:index/getDatabase:getDatabase
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The database from which to return its metadata.
    Name string
    The database from which to return its metadata.
    name String
    The database from which to return its metadata.
    name string
    The database from which to return its metadata.
    name str
    The database from which to return its metadata.
    name String
    The database from which to return its metadata.

    getDatabase Result

    The following output properties are available:

    Comment string
    CreatedOn string
    Id string
    The provider-assigned unique ID for this managed resource.
    IsCurrent bool
    IsDefault bool
    Name string
    The database from which to return its metadata.
    Options string
    Origin string
    Owner string
    RetentionTime int
    Comment string
    CreatedOn string
    Id string
    The provider-assigned unique ID for this managed resource.
    IsCurrent bool
    IsDefault bool
    Name string
    The database from which to return its metadata.
    Options string
    Origin string
    Owner string
    RetentionTime int
    comment String
    createdOn String
    id String
    The provider-assigned unique ID for this managed resource.
    isCurrent Boolean
    isDefault Boolean
    name String
    The database from which to return its metadata.
    options String
    origin String
    owner String
    retentionTime Integer
    comment string
    createdOn string
    id string
    The provider-assigned unique ID for this managed resource.
    isCurrent boolean
    isDefault boolean
    name string
    The database from which to return its metadata.
    options string
    origin string
    owner string
    retentionTime number
    comment str
    created_on str
    id str
    The provider-assigned unique ID for this managed resource.
    is_current bool
    is_default bool
    name str
    The database from which to return its metadata.
    options str
    origin str
    owner str
    retention_time int
    comment String
    createdOn String
    id String
    The provider-assigned unique ID for this managed resource.
    isCurrent Boolean
    isDefault Boolean
    name String
    The database from which to return its metadata.
    options String
    origin String
    owner String
    retentionTime Number

    Package Details

    Repository
    Snowflake pulumi/pulumi-snowflake
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the snowflake Terraform Provider.
    snowflake logo
    Snowflake v0.61.1 published on Thursday, Nov 14, 2024 by Pulumi