Snowflake

v0.14.0 published on Thursday, Sep 29, 2022 by Pulumi

getDatabase

Example Usage

using System.Collections.Generic;
using Pulumi;
using Snowflake = Pulumi.Snowflake;

return await Deployment.RunAsync(() => 
{
    var @this = Snowflake.GetDatabase.Invoke(new()
    {
        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, &GetDatabaseArgs{
			Name: "DEMO_DB",
		}, 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.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());

    }
}
import pulumi
import pulumi_snowflake as snowflake

this = snowflake.get_database(name="DEMO_DB")
import * as pulumi from "@pulumi/pulumi";
import * as snowflake from "@pulumi/snowflake";

const thisDatabase = pulumi.output(snowflake.getDatabase({
    name: "DEMO_DB",
}));
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
https://github.com/pulumi/pulumi-snowflake
License
Apache-2.0
Notes

This Pulumi package is based on the snowflake Terraform Provider.