snowflake.getSecrets
Explore with Pulumi AI
!> V1 release candidate This data source is a release candidate for the V1. We do not expect significant changes in it before the V1. We will welcome any feedback and adjust the data source if needed. Any errors reported will be resolved with a higher priority. We encourage checking this data source out before the V1 release. Please follow the migration guide to use it.
Datasource used to get details of filtered secrets. Filtering is aligned with the current possibilities for SHOW SECRETS query. The results of SHOW and DESCRIBE are encapsulated in one output collection secrets
.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as snowflake from "@pulumi/snowflake";
// Simple usage
const simple = snowflake.getSecrets({});
export const simpleOutput = simple.then(simple => simple.secrets);
// Filtering (like)
const like = snowflake.getSecrets({
like: "secret-name",
});
export const likeOutput = like.then(like => like.secrets);
// Filtering by prefix (like)
const likePrefix = snowflake.getSecrets({
like: "prefix%",
});
export const likePrefixOutput = likePrefix.then(likePrefix => likePrefix.secrets);
// Filtering (in)
const in = snowflake.getSecrets({
"in": {
schema: test.fullyQualifiedName,
},
});
export const inOutput = _in.then(_in => _in.secrets);
// Without additional data (to limit the number of calls make for every found secret)
const onlyShow = snowflake.getSecrets({
withDescribe: false,
});
export const onlyShowOutput = onlyShow.then(onlyShow => onlyShow.secrets);
import pulumi
import pulumi_snowflake as snowflake
# Simple usage
simple = snowflake.get_secrets()
pulumi.export("simpleOutput", simple.secrets)
# Filtering (like)
like = snowflake.get_secrets(like="secret-name")
pulumi.export("likeOutput", like.secrets)
# Filtering by prefix (like)
like_prefix = snowflake.get_secrets(like="prefix%")
pulumi.export("likePrefixOutput", like_prefix.secrets)
# Filtering (in)
in_ = snowflake.get_secrets(in_={
"schema": test["fullyQualifiedName"],
})
pulumi.export("inOutput", in_.secrets)
# Without additional data (to limit the number of calls make for every found secret)
only_show = snowflake.get_secrets(with_describe=False)
pulumi.export("onlyShowOutput", only_show.secrets)
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 {
// Simple usage
simple, err := snowflake.GetSecrets(ctx, &snowflake.GetSecretsArgs{}, nil)
if err != nil {
return err
}
ctx.Export("simpleOutput", simple.Secrets)
// Filtering (like)
like, err := snowflake.GetSecrets(ctx, &snowflake.GetSecretsArgs{
Like: pulumi.StringRef("secret-name"),
}, nil)
if err != nil {
return err
}
ctx.Export("likeOutput", like.Secrets)
// Filtering by prefix (like)
likePrefix, err := snowflake.GetSecrets(ctx, &snowflake.GetSecretsArgs{
Like: pulumi.StringRef("prefix%"),
}, nil)
if err != nil {
return err
}
ctx.Export("likePrefixOutput", likePrefix.Secrets)
// Filtering (in)
in, err := snowflake.GetSecrets(ctx, &snowflake.GetSecretsArgs{
In: snowflake.GetSecretsIn{
Schema: pulumi.StringRef(test.FullyQualifiedName),
},
}, nil)
if err != nil {
return err
}
ctx.Export("inOutput", in.Secrets)
// Without additional data (to limit the number of calls make for every found secret)
onlyShow, err := snowflake.GetSecrets(ctx, &snowflake.GetSecretsArgs{
WithDescribe: pulumi.BoolRef(false),
}, nil)
if err != nil {
return err
}
ctx.Export("onlyShowOutput", onlyShow.Secrets)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Snowflake = Pulumi.Snowflake;
return await Deployment.RunAsync(() =>
{
// Simple usage
var simple = Snowflake.GetSecrets.Invoke();
// Filtering (like)
var like = Snowflake.GetSecrets.Invoke(new()
{
Like = "secret-name",
});
// Filtering by prefix (like)
var likePrefix = Snowflake.GetSecrets.Invoke(new()
{
Like = "prefix%",
});
// Filtering (in)
var @in = Snowflake.GetSecrets.Invoke(new()
{
In = new Snowflake.Inputs.GetSecretsInInputArgs
{
Schema = test.FullyQualifiedName,
},
});
// Without additional data (to limit the number of calls make for every found secret)
var onlyShow = Snowflake.GetSecrets.Invoke(new()
{
WithDescribe = false,
});
return new Dictionary<string, object?>
{
["simpleOutput"] = simple.Apply(getSecretsResult => getSecretsResult.Secrets),
["likeOutput"] = like.Apply(getSecretsResult => getSecretsResult.Secrets),
["likePrefixOutput"] = likePrefix.Apply(getSecretsResult => getSecretsResult.Secrets),
["inOutput"] = @in.Apply(@in => @in.Apply(getSecretsResult => getSecretsResult.Secrets)),
["onlyShowOutput"] = onlyShow.Apply(getSecretsResult => getSecretsResult.Secrets),
};
});
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.GetSecretsArgs;
import com.pulumi.snowflake.inputs.GetSecretsInArgs;
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) {
// Simple usage
final var simple = SnowflakeFunctions.getSecrets();
ctx.export("simpleOutput", simple.applyValue(getSecretsResult -> getSecretsResult.secrets()));
// Filtering (like)
final var like = SnowflakeFunctions.getSecrets(GetSecretsArgs.builder()
.like("secret-name")
.build());
ctx.export("likeOutput", like.applyValue(getSecretsResult -> getSecretsResult.secrets()));
// Filtering by prefix (like)
final var likePrefix = SnowflakeFunctions.getSecrets(GetSecretsArgs.builder()
.like("prefix%")
.build());
ctx.export("likePrefixOutput", likePrefix.applyValue(getSecretsResult -> getSecretsResult.secrets()));
// Filtering (in)
final var in = SnowflakeFunctions.getSecrets(GetSecretsArgs.builder()
.in(GetSecretsInArgs.builder()
.schema(test.fullyQualifiedName())
.build())
.build());
ctx.export("inOutput", in.applyValue(getSecretsResult -> getSecretsResult.secrets()));
// Without additional data (to limit the number of calls make for every found secret)
final var onlyShow = SnowflakeFunctions.getSecrets(GetSecretsArgs.builder()
.withDescribe(false)
.build());
ctx.export("onlyShowOutput", onlyShow.applyValue(getSecretsResult -> getSecretsResult.secrets()));
}
}
variables:
# Simple usage
simple:
fn::invoke:
Function: snowflake:getSecrets
Arguments: {}
# Filtering (like)
like:
fn::invoke:
Function: snowflake:getSecrets
Arguments:
like: secret-name
# Filtering by prefix (like)
likePrefix:
fn::invoke:
Function: snowflake:getSecrets
Arguments:
like: prefix%
# Filtering (in)
in:
fn::invoke:
Function: snowflake:getSecrets
Arguments:
in:
schema: ${test.fullyQualifiedName}
# Without additional data (to limit the number of calls make for every found secret)
onlyShow:
fn::invoke:
Function: snowflake:getSecrets
Arguments:
withDescribe: false
outputs:
simpleOutput: ${simple.secrets}
likeOutput: ${like.secrets}
likePrefixOutput: ${likePrefix.secrets}
inOutput: ${in.secrets}
onlyShowOutput: ${onlyShow.secrets}
Using getSecrets
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 getSecrets(args: GetSecretsArgs, opts?: InvokeOptions): Promise<GetSecretsResult>
function getSecretsOutput(args: GetSecretsOutputArgs, opts?: InvokeOptions): Output<GetSecretsResult>
def get_secrets(in_: Optional[GetSecretsIn] = None,
like: Optional[str] = None,
with_describe: Optional[bool] = None,
opts: Optional[InvokeOptions] = None) -> GetSecretsResult
def get_secrets_output(in_: Optional[pulumi.Input[GetSecretsInArgs]] = None,
like: Optional[pulumi.Input[str]] = None,
with_describe: Optional[pulumi.Input[bool]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetSecretsResult]
func GetSecrets(ctx *Context, args *GetSecretsArgs, opts ...InvokeOption) (*GetSecretsResult, error)
func GetSecretsOutput(ctx *Context, args *GetSecretsOutputArgs, opts ...InvokeOption) GetSecretsResultOutput
> Note: This function is named GetSecrets
in the Go SDK.
public static class GetSecrets
{
public static Task<GetSecretsResult> InvokeAsync(GetSecretsArgs args, InvokeOptions? opts = null)
public static Output<GetSecretsResult> Invoke(GetSecretsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetSecretsResult> getSecrets(GetSecretsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: snowflake:index/getSecrets:getSecrets
arguments:
# arguments dictionary
The following arguments are supported:
- In
Get
Secrets In - IN clause to filter the list of secrets
- Like string
- Filters the output with case-insensitive pattern, with support for SQL wildcard characters (
%
and_
). - With
Describe bool - Runs DESC SECRET for each secret returned by SHOW SECRETS. The output of describe is saved to the description field. By default this value is set to true.
- In
Get
Secrets In - IN clause to filter the list of secrets
- Like string
- Filters the output with case-insensitive pattern, with support for SQL wildcard characters (
%
and_
). - With
Describe bool - Runs DESC SECRET for each secret returned by SHOW SECRETS. The output of describe is saved to the description field. By default this value is set to true.
- in
Get
Secrets In - IN clause to filter the list of secrets
- like String
- Filters the output with case-insensitive pattern, with support for SQL wildcard characters (
%
and_
). - with
Describe Boolean - Runs DESC SECRET for each secret returned by SHOW SECRETS. The output of describe is saved to the description field. By default this value is set to true.
- in
Get
Secrets In - IN clause to filter the list of secrets
- like string
- Filters the output with case-insensitive pattern, with support for SQL wildcard characters (
%
and_
). - with
Describe boolean - Runs DESC SECRET for each secret returned by SHOW SECRETS. The output of describe is saved to the description field. By default this value is set to true.
- in_
Get
Secrets In - IN clause to filter the list of secrets
- like str
- Filters the output with case-insensitive pattern, with support for SQL wildcard characters (
%
and_
). - with_
describe bool - Runs DESC SECRET for each secret returned by SHOW SECRETS. The output of describe is saved to the description field. By default this value is set to true.
- in Property Map
- IN clause to filter the list of secrets
- like String
- Filters the output with case-insensitive pattern, with support for SQL wildcard characters (
%
and_
). - with
Describe Boolean - Runs DESC SECRET for each secret returned by SHOW SECRETS. The output of describe is saved to the description field. By default this value is set to true.
getSecrets Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Secrets
List<Get
Secrets Secret> - Holds the aggregated output of all secrets details queries.
- In
Get
Secrets In - IN clause to filter the list of secrets
- Like string
- Filters the output with case-insensitive pattern, with support for SQL wildcard characters (
%
and_
). - With
Describe bool - Runs DESC SECRET for each secret returned by SHOW SECRETS. The output of describe is saved to the description field. By default this value is set to true.
- Id string
- The provider-assigned unique ID for this managed resource.
- Secrets
[]Get
Secrets Secret - Holds the aggregated output of all secrets details queries.
- In
Get
Secrets In - IN clause to filter the list of secrets
- Like string
- Filters the output with case-insensitive pattern, with support for SQL wildcard characters (
%
and_
). - With
Describe bool - Runs DESC SECRET for each secret returned by SHOW SECRETS. The output of describe is saved to the description field. By default this value is set to true.
- id String
- The provider-assigned unique ID for this managed resource.
- secrets
List<Get
Secrets Secret> - Holds the aggregated output of all secrets details queries.
- in
Get
Secrets In - IN clause to filter the list of secrets
- like String
- Filters the output with case-insensitive pattern, with support for SQL wildcard characters (
%
and_
). - with
Describe Boolean - Runs DESC SECRET for each secret returned by SHOW SECRETS. The output of describe is saved to the description field. By default this value is set to true.
- id string
- The provider-assigned unique ID for this managed resource.
- secrets
Get
Secrets Secret[] - Holds the aggregated output of all secrets details queries.
- in
Get
Secrets In - IN clause to filter the list of secrets
- like string
- Filters the output with case-insensitive pattern, with support for SQL wildcard characters (
%
and_
). - with
Describe boolean - Runs DESC SECRET for each secret returned by SHOW SECRETS. The output of describe is saved to the description field. By default this value is set to true.
- id str
- The provider-assigned unique ID for this managed resource.
- secrets
Sequence[Get
Secrets Secret] - Holds the aggregated output of all secrets details queries.
- in_
Get
Secrets In - IN clause to filter the list of secrets
- like str
- Filters the output with case-insensitive pattern, with support for SQL wildcard characters (
%
and_
). - with_
describe bool - Runs DESC SECRET for each secret returned by SHOW SECRETS. The output of describe is saved to the description field. By default this value is set to true.
- id String
- The provider-assigned unique ID for this managed resource.
- secrets List<Property Map>
- Holds the aggregated output of all secrets details queries.
- in Property Map
- IN clause to filter the list of secrets
- like String
- Filters the output with case-insensitive pattern, with support for SQL wildcard characters (
%
and_
). - with
Describe Boolean - Runs DESC SECRET for each secret returned by SHOW SECRETS. The output of describe is saved to the description field. By default this value is set to true.
Supporting Types
GetSecretsIn
- Account bool
- Returns records for the entire account.
- Application string
- Returns records for the specified application.
- Application
Package string - Returns records for the specified application package.
- Database string
- Returns records for the current database in use or for a specified database.
- Schema string
- Returns records for the current schema in use or a specified schema. Use fully qualified name.
- Account bool
- Returns records for the entire account.
- Application string
- Returns records for the specified application.
- Application
Package string - Returns records for the specified application package.
- Database string
- Returns records for the current database in use or for a specified database.
- Schema string
- Returns records for the current schema in use or a specified schema. Use fully qualified name.
- account Boolean
- Returns records for the entire account.
- application String
- Returns records for the specified application.
- application
Package String - Returns records for the specified application package.
- database String
- Returns records for the current database in use or for a specified database.
- schema String
- Returns records for the current schema in use or a specified schema. Use fully qualified name.
- account boolean
- Returns records for the entire account.
- application string
- Returns records for the specified application.
- application
Package string - Returns records for the specified application package.
- database string
- Returns records for the current database in use or for a specified database.
- schema string
- Returns records for the current schema in use or a specified schema. Use fully qualified name.
- account bool
- Returns records for the entire account.
- application str
- Returns records for the specified application.
- application_
package str - Returns records for the specified application package.
- database str
- Returns records for the current database in use or for a specified database.
- schema str
- Returns records for the current schema in use or a specified schema. Use fully qualified name.
- account Boolean
- Returns records for the entire account.
- application String
- Returns records for the specified application.
- application
Package String - Returns records for the specified application package.
- database String
- Returns records for the current database in use or for a specified database.
- schema String
- Returns records for the current schema in use or a specified schema. Use fully qualified name.
GetSecretsSecret
- Describe
Outputs List<GetSecrets Secret Describe Output> - Holds the output of DESCRIBE SECRET.
- Show
Outputs List<GetSecrets Secret Show Output> - Holds the output of SHOW SECRETS.
- Describe
Outputs []GetSecrets Secret Describe Output - Holds the output of DESCRIBE SECRET.
- Show
Outputs []GetSecrets Secret Show Output - Holds the output of SHOW SECRETS.
- describe
Outputs List<GetSecrets Secret Describe Output> - Holds the output of DESCRIBE SECRET.
- show
Outputs List<GetSecrets Secret Show Output> - Holds the output of SHOW SECRETS.
- describe
Outputs GetSecrets Secret Describe Output[] - Holds the output of DESCRIBE SECRET.
- show
Outputs GetSecrets Secret Show Output[] - Holds the output of SHOW SECRETS.
- describe_
outputs Sequence[GetSecrets Secret Describe Output] - Holds the output of DESCRIBE SECRET.
- show_
outputs Sequence[GetSecrets Secret Show Output] - Holds the output of SHOW SECRETS.
- describe
Outputs List<Property Map> - Holds the output of DESCRIBE SECRET.
- show
Outputs List<Property Map> - Holds the output of SHOW SECRETS.
GetSecretsSecretDescribeOutput
- Comment string
- Created
On string - Database
Name string - Integration
Name string - Name string
- Oauth
Access stringToken Expiry Time - Oauth
Refresh stringToken Expiry Time - Oauth
Scopes List<string> - Owner string
- Schema
Name string - Secret
Type string - Username string
- Comment string
- Created
On string - Database
Name string - Integration
Name string - Name string
- Oauth
Access stringToken Expiry Time - Oauth
Refresh stringToken Expiry Time - Oauth
Scopes []string - Owner string
- Schema
Name string - Secret
Type string - Username string
- comment String
- created
On String - database
Name String - integration
Name String - name String
- oauth
Access StringToken Expiry Time - oauth
Refresh StringToken Expiry Time - oauth
Scopes List<String> - owner String
- schema
Name String - secret
Type String - username String
- comment string
- created
On string - database
Name string - integration
Name string - name string
- oauth
Access stringToken Expiry Time - oauth
Refresh stringToken Expiry Time - oauth
Scopes string[] - owner string
- schema
Name string - secret
Type string - username string
- comment str
- created_
on str - database_
name str - integration_
name str - name str
- oauth_
access_ strtoken_ expiry_ time - oauth_
refresh_ strtoken_ expiry_ time - oauth_
scopes Sequence[str] - owner str
- schema_
name str - secret_
type str - username str
- comment String
- created
On String - database
Name String - integration
Name String - name String
- oauth
Access StringToken Expiry Time - oauth
Refresh StringToken Expiry Time - oauth
Scopes List<String> - owner String
- schema
Name String - secret
Type String - username String
GetSecretsSecretShowOutput
- Comment string
- Created
On string - Database
Name string - Name string
- Oauth
Scopes List<string> - Owner string
- Owner
Role stringType - Schema
Name string - Secret
Type string
- Comment string
- Created
On string - Database
Name string - Name string
- Oauth
Scopes []string - Owner string
- Owner
Role stringType - Schema
Name string - Secret
Type string
- comment String
- created
On String - database
Name String - name String
- oauth
Scopes List<String> - owner String
- owner
Role StringType - schema
Name String - secret
Type String
- comment string
- created
On string - database
Name string - name string
- oauth
Scopes string[] - owner string
- owner
Role stringType - schema
Name string - secret
Type string
- comment str
- created_
on str - database_
name str - name str
- oauth_
scopes Sequence[str] - owner str
- owner_
role_ strtype - schema_
name str - secret_
type str
- comment String
- created
On String - database
Name String - name String
- oauth
Scopes List<String> - owner String
- owner
Role StringType - schema
Name String - secret
Type String
Package Details
- Repository
- Snowflake pulumi/pulumi-snowflake
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
snowflake
Terraform Provider.