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

snowflake.getConnections

Explore with Pulumi AI

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

    !> 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 connections. Filtering is aligned with the current possibilities for SHOW CONNECTIONS query. The results of SHOW is encapsulated in one output collection connections.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as snowflake from "@pulumi/snowflake";
    
    // Simple usage
    const simple = snowflake.getConnections({});
    export const simpleOutput = simple.then(simple => simple.connections);
    // Filtering (like)
    const like = snowflake.getConnections({
        like: "connection-name",
    });
    export const likeOutput = like.then(like => like.connections);
    // Filtering by prefix (like)
    const likePrefix = snowflake.getConnections({
        like: "prefix%",
    });
    export const likePrefixOutput = likePrefix.then(likePrefix => likePrefix.connections);
    
    import pulumi
    import pulumi_snowflake as snowflake
    
    # Simple usage
    simple = snowflake.get_connections()
    pulumi.export("simpleOutput", simple.connections)
    # Filtering (like)
    like = snowflake.get_connections(like="connection-name")
    pulumi.export("likeOutput", like.connections)
    # Filtering by prefix (like)
    like_prefix = snowflake.get_connections(like="prefix%")
    pulumi.export("likePrefixOutput", like_prefix.connections)
    
    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.GetConnections(ctx, &snowflake.GetConnectionsArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("simpleOutput", simple.Connections)
    		// Filtering (like)
    		like, err := snowflake.GetConnections(ctx, &snowflake.GetConnectionsArgs{
    			Like: pulumi.StringRef("connection-name"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("likeOutput", like.Connections)
    		// Filtering by prefix (like)
    		likePrefix, err := snowflake.GetConnections(ctx, &snowflake.GetConnectionsArgs{
    			Like: pulumi.StringRef("prefix%"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("likePrefixOutput", likePrefix.Connections)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Snowflake = Pulumi.Snowflake;
    
    return await Deployment.RunAsync(() => 
    {
        // Simple usage
        var simple = Snowflake.GetConnections.Invoke();
    
        // Filtering (like)
        var like = Snowflake.GetConnections.Invoke(new()
        {
            Like = "connection-name",
        });
    
        // Filtering by prefix (like)
        var likePrefix = Snowflake.GetConnections.Invoke(new()
        {
            Like = "prefix%",
        });
    
        return new Dictionary<string, object?>
        {
            ["simpleOutput"] = simple.Apply(getConnectionsResult => getConnectionsResult.Connections),
            ["likeOutput"] = like.Apply(getConnectionsResult => getConnectionsResult.Connections),
            ["likePrefixOutput"] = likePrefix.Apply(getConnectionsResult => getConnectionsResult.Connections),
        };
    });
    
    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.GetConnectionsArgs;
    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.getConnections();
    
            ctx.export("simpleOutput", simple.applyValue(getConnectionsResult -> getConnectionsResult.connections()));
            // Filtering (like)
            final var like = SnowflakeFunctions.getConnections(GetConnectionsArgs.builder()
                .like("connection-name")
                .build());
    
            ctx.export("likeOutput", like.applyValue(getConnectionsResult -> getConnectionsResult.connections()));
            // Filtering by prefix (like)
            final var likePrefix = SnowflakeFunctions.getConnections(GetConnectionsArgs.builder()
                .like("prefix%")
                .build());
    
            ctx.export("likePrefixOutput", likePrefix.applyValue(getConnectionsResult -> getConnectionsResult.connections()));
        }
    }
    
    variables:
      # Simple usage
      simple:
        fn::invoke:
          Function: snowflake:getConnections
          Arguments: {}
      # Filtering (like)
      like:
        fn::invoke:
          Function: snowflake:getConnections
          Arguments:
            like: connection-name
      # Filtering by prefix (like)
      likePrefix:
        fn::invoke:
          Function: snowflake:getConnections
          Arguments:
            like: prefix%
    outputs:
      simpleOutput: ${simple.connections}
      likeOutput: ${like.connections}
      likePrefixOutput: ${likePrefix.connections}
    

    Using getConnections

    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 getConnections(args: GetConnectionsArgs, opts?: InvokeOptions): Promise<GetConnectionsResult>
    function getConnectionsOutput(args: GetConnectionsOutputArgs, opts?: InvokeOptions): Output<GetConnectionsResult>
    def get_connections(like: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetConnectionsResult
    def get_connections_output(like: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetConnectionsResult]
    func GetConnections(ctx *Context, args *GetConnectionsArgs, opts ...InvokeOption) (*GetConnectionsResult, error)
    func GetConnectionsOutput(ctx *Context, args *GetConnectionsOutputArgs, opts ...InvokeOption) GetConnectionsResultOutput

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

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

    The following arguments are supported:

    Like string
    Filters the output with case-insensitive pattern, with support for SQL wildcard characters (% and _).
    Like string
    Filters the output with case-insensitive pattern, with support for SQL wildcard characters (% and _).
    like String
    Filters the output with case-insensitive pattern, with support for SQL wildcard characters (% and _).
    like string
    Filters the output with case-insensitive pattern, with support for SQL wildcard characters (% and _).
    like str
    Filters the output with case-insensitive pattern, with support for SQL wildcard characters (% and _).
    like String
    Filters the output with case-insensitive pattern, with support for SQL wildcard characters (% and _).

    getConnections Result

    The following output properties are available:

    Connections List<GetConnectionsConnection>
    Holds the aggregated output of all connections details queries.
    Id string
    The provider-assigned unique ID for this managed resource.
    Like string
    Filters the output with case-insensitive pattern, with support for SQL wildcard characters (% and _).
    Connections []GetConnectionsConnection
    Holds the aggregated output of all connections details queries.
    Id string
    The provider-assigned unique ID for this managed resource.
    Like string
    Filters the output with case-insensitive pattern, with support for SQL wildcard characters (% and _).
    connections List<GetConnectionsConnection>
    Holds the aggregated output of all connections details queries.
    id String
    The provider-assigned unique ID for this managed resource.
    like String
    Filters the output with case-insensitive pattern, with support for SQL wildcard characters (% and _).
    connections GetConnectionsConnection[]
    Holds the aggregated output of all connections details queries.
    id string
    The provider-assigned unique ID for this managed resource.
    like string
    Filters the output with case-insensitive pattern, with support for SQL wildcard characters (% and _).
    connections Sequence[GetConnectionsConnection]
    Holds the aggregated output of all connections details queries.
    id str
    The provider-assigned unique ID for this managed resource.
    like str
    Filters the output with case-insensitive pattern, with support for SQL wildcard characters (% and _).
    connections List<Property Map>
    Holds the aggregated output of all connections details queries.
    id String
    The provider-assigned unique ID for this managed resource.
    like String
    Filters the output with case-insensitive pattern, with support for SQL wildcard characters (% and _).

    Supporting Types

    GetConnectionsConnection

    ShowOutputs List<GetConnectionsConnectionShowOutput>
    Holds the output of SHOW CONNECTIONS.
    ShowOutputs []GetConnectionsConnectionShowOutput
    Holds the output of SHOW CONNECTIONS.
    showOutputs List<GetConnectionsConnectionShowOutput>
    Holds the output of SHOW CONNECTIONS.
    showOutputs GetConnectionsConnectionShowOutput[]
    Holds the output of SHOW CONNECTIONS.
    show_outputs Sequence[GetConnectionsConnectionShowOutput]
    Holds the output of SHOW CONNECTIONS.
    showOutputs List<Property Map>
    Holds the output of SHOW CONNECTIONS.

    GetConnectionsConnectionShowOutput

    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