1. Packages
  2. Databricks
  3. API Docs
  4. getSqlWarehouses
Databricks v1.46.1 published on Friday, Jun 28, 2024 by Pulumi

databricks.getSqlWarehouses

Explore with Pulumi AI

databricks logo
Databricks v1.46.1 published on Friday, Jun 28, 2024 by Pulumi

    Example Usage

    Retrieve IDs for all SQL warehouses:

    import * as pulumi from "@pulumi/pulumi";
    import * as databricks from "@pulumi/databricks";
    
    const all = databricks.getSqlWarehouses({});
    
    import pulumi
    import pulumi_databricks as databricks
    
    all = databricks.get_sql_warehouses()
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-databricks/sdk/go/databricks"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := databricks.GetSqlWarehouses(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Databricks = Pulumi.Databricks;
    
    return await Deployment.RunAsync(() => 
    {
        var all = Databricks.GetSqlWarehouses.Invoke();
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.databricks.DatabricksFunctions;
    import com.pulumi.databricks.inputs.GetSqlWarehousesArgs;
    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 all = DatabricksFunctions.getSqlWarehouses();
    
        }
    }
    
    variables:
      all:
        fn::invoke:
          Function: databricks:getSqlWarehouses
          Arguments: {}
    

    Retrieve IDs for all clusters having “Shared” in the warehouse name:

    import * as pulumi from "@pulumi/pulumi";
    import * as databricks from "@pulumi/databricks";
    
    const allShared = databricks.getSqlWarehouses({
        warehouseNameContains: "shared",
    });
    
    import pulumi
    import pulumi_databricks as databricks
    
    all_shared = databricks.get_sql_warehouses(warehouse_name_contains="shared")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-databricks/sdk/go/databricks"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := databricks.GetSqlWarehouses(ctx, &databricks.GetSqlWarehousesArgs{
    			WarehouseNameContains: pulumi.StringRef("shared"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Databricks = Pulumi.Databricks;
    
    return await Deployment.RunAsync(() => 
    {
        var allShared = Databricks.GetSqlWarehouses.Invoke(new()
        {
            WarehouseNameContains = "shared",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.databricks.DatabricksFunctions;
    import com.pulumi.databricks.inputs.GetSqlWarehousesArgs;
    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 allShared = DatabricksFunctions.getSqlWarehouses(GetSqlWarehousesArgs.builder()
                .warehouseNameContains("shared")
                .build());
    
        }
    }
    
    variables:
      allShared:
        fn::invoke:
          Function: databricks:getSqlWarehouses
          Arguments:
            warehouseNameContains: shared
    

    The following resources are often used in the same context:

    • End to end workspace management guide.
    • databricks.InstanceProfile to manage AWS EC2 instance profiles that users can launch databricks.Cluster and access data, like databricks_mount.
    • databricks.SqlDashboard to manage Databricks SQL Dashboards.
    • databricks.SqlGlobalConfig to configure the security policy, databricks_instance_profile, and data access properties for all databricks.SqlEndpoint of workspace.
    • databricks.SqlPermissions to manage data object access control lists in Databricks workspaces for things like tables, views, databases, and more.

    Using getSqlWarehouses

    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 getSqlWarehouses(args: GetSqlWarehousesArgs, opts?: InvokeOptions): Promise<GetSqlWarehousesResult>
    function getSqlWarehousesOutput(args: GetSqlWarehousesOutputArgs, opts?: InvokeOptions): Output<GetSqlWarehousesResult>
    def get_sql_warehouses(ids: Optional[Sequence[str]] = None,
                           warehouse_name_contains: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetSqlWarehousesResult
    def get_sql_warehouses_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                           warehouse_name_contains: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetSqlWarehousesResult]
    func GetSqlWarehouses(ctx *Context, args *GetSqlWarehousesArgs, opts ...InvokeOption) (*GetSqlWarehousesResult, error)
    func GetSqlWarehousesOutput(ctx *Context, args *GetSqlWarehousesOutputArgs, opts ...InvokeOption) GetSqlWarehousesResultOutput

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

    public static class GetSqlWarehouses 
    {
        public static Task<GetSqlWarehousesResult> InvokeAsync(GetSqlWarehousesArgs args, InvokeOptions? opts = null)
        public static Output<GetSqlWarehousesResult> Invoke(GetSqlWarehousesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSqlWarehousesResult> getSqlWarehouses(GetSqlWarehousesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: databricks:index/getSqlWarehouses:getSqlWarehouses
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    list of databricks.SqlEndpoint ids
    WarehouseNameContains string
    Only return databricks.SqlEndpoint ids that match the given name string.
    Ids []string
    list of databricks.SqlEndpoint ids
    WarehouseNameContains string
    Only return databricks.SqlEndpoint ids that match the given name string.
    ids List<String>
    list of databricks.SqlEndpoint ids
    warehouseNameContains String
    Only return databricks.SqlEndpoint ids that match the given name string.
    ids string[]
    list of databricks.SqlEndpoint ids
    warehouseNameContains string
    Only return databricks.SqlEndpoint ids that match the given name string.
    ids Sequence[str]
    list of databricks.SqlEndpoint ids
    warehouse_name_contains str
    Only return databricks.SqlEndpoint ids that match the given name string.
    ids List<String>
    list of databricks.SqlEndpoint ids
    warehouseNameContains String
    Only return databricks.SqlEndpoint ids that match the given name string.

    getSqlWarehouses Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    list of databricks.SqlEndpoint ids
    WarehouseNameContains string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    list of databricks.SqlEndpoint ids
    WarehouseNameContains string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    list of databricks.SqlEndpoint ids
    warehouseNameContains String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    list of databricks.SqlEndpoint ids
    warehouseNameContains string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    list of databricks.SqlEndpoint ids
    warehouse_name_contains str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    list of databricks.SqlEndpoint ids
    warehouseNameContains String

    Package Details

    Repository
    databricks pulumi/pulumi-databricks
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the databricks Terraform Provider.
    databricks logo
    Databricks v1.46.1 published on Friday, Jun 28, 2024 by Pulumi