1. Packages
  2. Snowflake Provider
  3. API Docs
  4. getCurrentAccount
Snowflake v1.2.0 published on Monday, Apr 14, 2025 by Pulumi

snowflake.getCurrentAccount

Explore with Pulumi AI

Snowflake v1.2.0 published on Monday, Apr 14, 2025 by Pulumi

!> Caution: Preview Feature This feature is considered a preview feature in the provider, regardless of the state of the resource in Snowflake. We do not guarantee its stability. It will be reworked and marked as a stable feature in future releases. Breaking changes are expected, even without bumping the major version. To use this feature, add the relevant feature name to preview_features_enabled field in the provider configuration. Please always refer to the Getting Help section in our Github repo to best determine how to get help for your questions.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as snowflake from "@pulumi/snowflake";

const _this = snowflake.getCurrentAccount({});
const snowflakeAccountUrl = new aws.index.SsmParameter("snowflake_account_url", {
    name: "/snowflake/account_url",
    type: "String",
    value: _this.url,
});
Copy
import pulumi
import pulumi_aws as aws
import pulumi_snowflake as snowflake

this = snowflake.get_current_account()
snowflake_account_url = aws.index.SsmParameter("snowflake_account_url",
    name=/snowflake/account_url,
    type=String,
    value=this.url)
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws"
	"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 {
		this, err := snowflake.GetCurrentAccount(ctx, map[string]interface{}{}, nil)
		if err != nil {
			return err
		}
		_, err = aws.NewSsmParameter(ctx, "snowflake_account_url", &aws.SsmParameterArgs{
			Name:  "/snowflake/account_url",
			Type:  "String",
			Value: this.Url,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
using Snowflake = Pulumi.Snowflake;

return await Deployment.RunAsync(() => 
{
    var @this = Snowflake.GetCurrentAccount.Invoke();

    var snowflakeAccountUrl = new Aws.Index.SsmParameter("snowflake_account_url", new()
    {
        Name = "/snowflake/account_url",
        Type = "String",
        Value = @this.Apply(getCurrentAccountResult => getCurrentAccountResult.Url),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.snowflake.SnowflakeFunctions;
import com.pulumi.aws.ssmParameter;
import com.pulumi.aws.ssmParameterArgs;
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.getCurrentAccount(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference);

        var snowflakeAccountUrl = new SsmParameter("snowflakeAccountUrl", SsmParameterArgs.builder()
            .name("/snowflake/account_url")
            .type("String")
            .value(this_.url())
            .build());

    }
}
Copy
resources:
  snowflakeAccountUrl:
    type: aws:ssmParameter
    name: snowflake_account_url
    properties:
      name: /snowflake/account_url
      type: String
      value: ${this.url}
variables:
  this:
    fn::invoke:
      function: snowflake:getCurrentAccount
      arguments: {}
Copy

Note If a field has a default value, it is shown next to the type in the schema.

Using getCurrentAccount

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 getCurrentAccount(opts?: InvokeOptions): Promise<GetCurrentAccountResult>
function getCurrentAccountOutput(opts?: InvokeOptions): Output<GetCurrentAccountResult>
Copy
def get_current_account(opts: Optional[InvokeOptions] = None) -> GetCurrentAccountResult
def get_current_account_output(opts: Optional[InvokeOptions] = None) -> Output[GetCurrentAccountResult]
Copy
func GetCurrentAccount(ctx *Context, opts ...InvokeOption) (*GetCurrentAccountResult, error)
func GetCurrentAccountOutput(ctx *Context, opts ...InvokeOption) GetCurrentAccountResultOutput
Copy

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

public static class GetCurrentAccount 
{
    public static Task<GetCurrentAccountResult> InvokeAsync(InvokeOptions? opts = null)
    public static Output<GetCurrentAccountResult> Invoke(InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetCurrentAccountResult> getCurrentAccount(InvokeOptions options)
public static Output<GetCurrentAccountResult> getCurrentAccount(InvokeOptions options)
Copy
fn::invoke:
  function: snowflake:index/getCurrentAccount:getCurrentAccount
  arguments:
    # arguments dictionary
Copy

getCurrentAccount Result

The following output properties are available:

Account string
The Snowflake Account ID; as returned by CURRENT_ACCOUNT().
Id string
The provider-assigned unique ID for this managed resource.
Region string
The Snowflake Region; as returned by CURRENT_REGION()
Url string
The Snowflake URL.
Account string
The Snowflake Account ID; as returned by CURRENT_ACCOUNT().
Id string
The provider-assigned unique ID for this managed resource.
Region string
The Snowflake Region; as returned by CURRENT_REGION()
Url string
The Snowflake URL.
account String
The Snowflake Account ID; as returned by CURRENT_ACCOUNT().
id String
The provider-assigned unique ID for this managed resource.
region String
The Snowflake Region; as returned by CURRENT_REGION()
url String
The Snowflake URL.
account string
The Snowflake Account ID; as returned by CURRENT_ACCOUNT().
id string
The provider-assigned unique ID for this managed resource.
region string
The Snowflake Region; as returned by CURRENT_REGION()
url string
The Snowflake URL.
account str
The Snowflake Account ID; as returned by CURRENT_ACCOUNT().
id str
The provider-assigned unique ID for this managed resource.
region str
The Snowflake Region; as returned by CURRENT_REGION()
url str
The Snowflake URL.
account String
The Snowflake Account ID; as returned by CURRENT_ACCOUNT().
id String
The provider-assigned unique ID for this managed resource.
region String
The Snowflake Region; as returned by CURRENT_REGION()
url String
The Snowflake URL.

Package Details

Repository
Snowflake pulumi/pulumi-snowflake
License
Apache-2.0
Notes
This Pulumi package is based on the snowflake Terraform Provider.
Snowflake v1.2.0 published on Monday, Apr 14, 2025 by Pulumi