databricks logo
Databricks v1.14.0, May 23 23

databricks.getMwsWorkspaces

Explore with Pulumi AI

Note If you have a fully automated setup with workspaces created by databricks_mws_workspaces, please make sure to add depends_on attribute in order to prevent default auth: cannot configure default credentials errors.

Lists all databricks.MwsWorkspaces in Databricks Account.

Note account_id provider configuration property is required for this resource to work.

The following resources are used in the same context:

  • databricks.MwsWorkspaces to manage Databricks E2 Workspaces.
  • databricks.MetastoreAssignment

Example Usage

Listing all workspaces in

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Databricks = Pulumi.Databricks;

return await Deployment.RunAsync(() => 
{
    var all = Databricks.GetMwsWorkspaces.Invoke();

    return new Dictionary<string, object?>
    {
        ["allMwsWorkspaces"] = all.Apply(getMwsWorkspacesResult => getMwsWorkspacesResult.Ids),
    };
});
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 {
		all, err := databricks.LookupMwsWorkspaces(ctx, nil, nil)
		if err != nil {
			return err
		}
		ctx.Export("allMwsWorkspaces", all.Ids)
		return nil
	})
}
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.GetMwsWorkspacesArgs;
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.getMwsWorkspaces();

        ctx.export("allMwsWorkspaces", all.applyValue(getMwsWorkspacesResult -> getMwsWorkspacesResult.ids()));
    }
}
import pulumi
import pulumi_databricks as databricks

all = databricks.get_mws_workspaces()
pulumi.export("allMwsWorkspaces", all.ids)
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";

const all = databricks.getMwsWorkspaces({});
export const allMwsWorkspaces = all.then(all => all.ids);
variables:
  all:
    fn::invoke:
      Function: databricks:getMwsWorkspaces
      Arguments: {}
outputs:
  allMwsWorkspaces: ${all.ids}

Using getMwsWorkspaces

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 getMwsWorkspaces(args: GetMwsWorkspacesArgs, opts?: InvokeOptions): Promise<GetMwsWorkspacesResult>
function getMwsWorkspacesOutput(args: GetMwsWorkspacesOutputArgs, opts?: InvokeOptions): Output<GetMwsWorkspacesResult>
def get_mws_workspaces(ids: Optional[Mapping[str, Any]] = None,
                       opts: Optional[InvokeOptions] = None) -> GetMwsWorkspacesResult
def get_mws_workspaces_output(ids: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetMwsWorkspacesResult]
func LookupMwsWorkspaces(ctx *Context, args *LookupMwsWorkspacesArgs, opts ...InvokeOption) (*LookupMwsWorkspacesResult, error)
func LookupMwsWorkspacesOutput(ctx *Context, args *LookupMwsWorkspacesOutputArgs, opts ...InvokeOption) LookupMwsWorkspacesResultOutput

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

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

The following arguments are supported:

Ids Dictionary<string, object>

name-to-id map for all of the workspaces in the account

Ids map[string]interface{}

name-to-id map for all of the workspaces in the account

ids Map<String,Object>

name-to-id map for all of the workspaces in the account

ids {[key: string]: any}

name-to-id map for all of the workspaces in the account

ids Mapping[str, Any]

name-to-id map for all of the workspaces in the account

ids Map<Any>

name-to-id map for all of the workspaces in the account

getMwsWorkspaces Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Ids Dictionary<string, object>

name-to-id map for all of the workspaces in the account

Id string

The provider-assigned unique ID for this managed resource.

Ids map[string]interface{}

name-to-id map for all of the workspaces in the account

id String

The provider-assigned unique ID for this managed resource.

ids Map<String,Object>

name-to-id map for all of the workspaces in the account

id string

The provider-assigned unique ID for this managed resource.

ids {[key: string]: any}

name-to-id map for all of the workspaces in the account

id str

The provider-assigned unique ID for this managed resource.

ids Mapping[str, Any]

name-to-id map for all of the workspaces in the account

id String

The provider-assigned unique ID for this managed resource.

ids Map<Any>

name-to-id map for all of the workspaces in the account

Package Details

Repository
databricks pulumi/pulumi-databricks
License
Apache-2.0
Notes

This Pulumi package is based on the databricks Terraform Provider.