published on Tuesday, Sep 8, 2026 by Pulumi
published on Tuesday, Sep 8, 2026 by Pulumi
Retrieves a list of databricks.Share name, that were created by Pulumi or manually.
This data source can only be used with a workspace-level provider!
Plugin Framework Migration
The shares data source has been migrated from sdkv2 to plugin framework. If you encounter any problem with this data source and suspect it is due to the migration, you can fallback to sdkv2 by setting the environment variable in the following way export USE_SDK_V2_DATA_SOURCES="databricks.getShares".
Deprecation: The SDKv2 fallback implementation, selectable via
USE_SDK_V2_DATA_SOURCES="databricks.getShares", is deprecated and will be removed in the next major release of the provider. Setting the environment variable now emits a runtime warning; remove the override to use the default Plugin Framework implementation.
Example Usage
Getting all existing shares in the metastore
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
const _this = databricks.getShares({});
export const shareName = _this.then(_this => _this.shares);
import pulumi
import pulumi_databricks as databricks
this = databricks.get_shares()
pulumi.export("shareName", this.shares)
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 {
this, err := databricks.GetShares(ctx, &databricks.GetSharesArgs{}, nil)
if err != nil {
return err
}
ctx.Export("shareName", this.Shares)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Databricks = Pulumi.Databricks;
return await Deployment.RunAsync(() =>
{
var @this = Databricks.GetShares.Invoke();
return new Dictionary<string, object?>
{
["shareName"] = @this.Apply(@this => @this.Apply(getSharesResult => getSharesResult.Shares)),
};
});
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.GetSharesArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 = DatabricksFunctions.getShares(GetSharesArgs.builder()
.build());
ctx.export("shareName", this_.shares());
}
}
variables:
this:
fn::invoke:
function: databricks:getShares
arguments: {}
outputs:
shareName: ${this.shares}
pulumi {
required_providers {
databricks = {
source = "pulumi/databricks"
}
}
}
data "databricks_getshares" "this" {
}
output "shareName" {
value = data.databricks_getshares.this.shares
}
Related Resources
The following resources are used in the same context:
- databricks.Share to create Delta Sharing shares.
- databricks.Recipient to create Delta Sharing recipients.
- databricks.Grants to manage Delta Sharing permissions.
Using getShares
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 getShares(args: GetSharesArgs, opts?: InvokeOptions): Promise<GetSharesResult>
function getSharesOutput(args: GetSharesOutputArgs, opts?: InvokeOutputOptions): Output<GetSharesResult>def get_shares(provider_config: Optional[GetSharesProviderConfig] = None,
shares: Optional[Sequence[str]] = None,
opts: Optional[InvokeOptions] = None) -> GetSharesResult
def get_shares_output(provider_config: pulumi.Input[Optional[GetSharesProviderConfigArgs]] = None,
shares: pulumi.Input[Optional[Sequence[pulumi.Input[str]]]] = None,
opts: Optional[InvokeOutputOptions] = None) -> Output[GetSharesResult]func GetShares(ctx *Context, args *GetSharesArgs, opts ...InvokeOption) (*GetSharesResult, error)
func GetSharesOutput(ctx *Context, args *GetSharesOutputArgs, opts ...InvokeOption) GetSharesResultOutput> Note: This function is named GetShares in the Go SDK.
public static class GetShares
{
public static Task<GetSharesResult> InvokeAsync(GetSharesArgs args, InvokeOptions? opts = null)
public static Output<GetSharesResult> Invoke(GetSharesInvokeArgs args, InvokeOptions? opts = null)
public static Output<GetSharesResult> Invoke(GetSharesInvokeArgs args, InvokeOutputOptions opts)
}public static CompletableFuture<GetSharesResult> getShares(GetSharesArgs args, InvokeOptions options)
public static Output<GetSharesResult> getShares(GetSharesArgs args, InvokeOptions options)
public static Output<GetSharesResult> getShares(GetSharesArgs args, InvokeOutputOptions options)
fn::invoke:
function: databricks:index/getShares:getShares
arguments:
# arguments dictionarydata "databricks_get_shares" "name" {
# arguments
}The following arguments are supported:
- Provider
Config GetShares Provider Config - Configure the provider for management through account provider. This block consists of the following fields:
- List<string>
- list of databricks.Share names.
- Provider
Config GetShares Provider Config - Configure the provider for management through account provider. This block consists of the following fields:
- []string
- list of databricks.Share names.
- provider_
config object - Configure the provider for management through account provider. This block consists of the following fields:
- list(string)
- list of databricks.Share names.
- provider
Config GetShares Provider Config - Configure the provider for management through account provider. This block consists of the following fields:
- List<String>
- list of databricks.Share names.
- provider
Config GetShares Provider Config - Configure the provider for management through account provider. This block consists of the following fields:
- string[]
- list of databricks.Share names.
- provider_
config GetShares Provider Config - Configure the provider for management through account provider. This block consists of the following fields:
- Sequence[str]
- list of databricks.Share names.
- provider
Config Property Map - Configure the provider for management through account provider. This block consists of the following fields:
- List<String>
- list of databricks.Share names.
getShares Result
The following output properties are available:
- List<string>
- list of databricks.Share names.
- Provider
Config GetShares Provider Config
- []string
- list of databricks.Share names.
- Provider
Config GetShares Provider Config
- list(string)
- list of databricks.Share names.
- provider_
config object
- List<String>
- list of databricks.Share names.
- provider
Config GetShares Provider Config
- string[]
- list of databricks.Share names.
- provider
Config GetShares Provider Config
- Sequence[str]
- list of databricks.Share names.
- provider_
config GetShares Provider Config
- List<String>
- list of databricks.Share names.
- provider
Config Property Map
Supporting Types
GetSharesProviderConfig
- Workspace
Id string - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
- Workspace
Id string - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
- workspace_
id string - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
- workspace
Id String - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
- workspace
Id string - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
- workspace_
id str - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
- workspace
Id String - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
Package Details
- Repository
- databricks pulumi/pulumi-databricks
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
databricksTerraform Provider.
published on Tuesday, Sep 8, 2026 by Pulumi