Databricks v1.56.0 published on Tuesday, Nov 12, 2024 by Pulumi
databricks.getShares
Explore with Pulumi AI
Retrieves a list of databricks.Share name, that were created by Pulumi or manually.
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.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 this = DatabricksFunctions.getShares();
ctx.export("shareName", this_.shares());
}
}
variables:
this:
fn::invoke:
Function: databricks:getShares
Arguments: {}
outputs:
shareName: ${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?: InvokeOptions): Output<GetSharesResult>
def get_shares(shares: Optional[Sequence[str]] = None,
opts: Optional[InvokeOptions] = None) -> GetSharesResult
def get_shares_output(shares: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
opts: Optional[InvokeOptions] = 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 CompletableFuture<GetSharesResult> getShares(GetSharesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: databricks:index/getShares:getShares
arguments:
# arguments dictionary
The following arguments are supported:
- List<string>
- list of databricks.Share names.
- []string
- list of databricks.Share names.
- List<String>
- list of databricks.Share names.
- string[]
- list of databricks.Share names.
- Sequence[str]
- list of databricks.Share names.
- List<String>
- list of databricks.Share names.
getShares Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- List<string>
- list of databricks.Share names.
- Id string
- The provider-assigned unique ID for this managed resource.
- []string
- list of databricks.Share names.
- id String
- The provider-assigned unique ID for this managed resource.
- List<String>
- list of databricks.Share names.
- id string
- The provider-assigned unique ID for this managed resource.
- string[]
- list of databricks.Share names.
- id str
- The provider-assigned unique ID for this managed resource.
- Sequence[str]
- list of databricks.Share names.
- id String
- The provider-assigned unique ID for this managed resource.
- List<String>
- list of databricks.Share names.
Package Details
- Repository
- databricks pulumi/pulumi-databricks
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
databricks
Terraform Provider.