azure.datashare.getShare
Use this data source to access information about an existing Data Share.
Example Usage
using System.Collections.Generic;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var exampleAccount = Azure.DataShare.GetAccount.Invoke(new()
{
Name = "example-account",
ResourceGroupName = "example-resource-group",
});
var exampleShare = Azure.DataShare.GetShare.Invoke(new()
{
Name = "existing",
AccountId = exampleAccount.Apply(getAccountResult => getAccountResult.Id),
});
return new Dictionary<string, object?>
{
["id"] = exampleShare.Apply(getShareResult => getShareResult.Id),
};
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datashare"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleAccount, err := datashare.LookupAccount(ctx, &datashare.LookupAccountArgs{
Name: "example-account",
ResourceGroupName: "example-resource-group",
}, nil)
if err != nil {
return err
}
exampleShare, err := datashare.LookupShare(ctx, &datashare.LookupShareArgs{
Name: "existing",
AccountId: exampleAccount.Id,
}, nil)
if err != nil {
return err
}
ctx.Export("id", exampleShare.Id)
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.datashare.DatashareFunctions;
import com.pulumi.azure.datashare.inputs.GetAccountArgs;
import com.pulumi.azure.datashare.inputs.GetShareArgs;
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 exampleAccount = DatashareFunctions.getAccount(GetAccountArgs.builder()
.name("example-account")
.resourceGroupName("example-resource-group")
.build());
final var exampleShare = DatashareFunctions.getShare(GetShareArgs.builder()
.name("existing")
.accountId(exampleAccount.applyValue(getAccountResult -> getAccountResult.id()))
.build());
ctx.export("id", exampleShare.applyValue(getShareResult -> getShareResult.id()));
}
}
import pulumi
import pulumi_azure as azure
example_account = azure.datashare.get_account(name="example-account",
resource_group_name="example-resource-group")
example_share = azure.datashare.get_share(name="existing",
account_id=example_account.id)
pulumi.export("id", example_share.id)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const exampleAccount = azure.datashare.getAccount({
name: "example-account",
resourceGroupName: "example-resource-group",
});
const exampleShare = exampleAccount.then(exampleAccount => azure.datashare.getShare({
name: "existing",
accountId: exampleAccount.id,
}));
export const id = exampleShare.then(exampleShare => exampleShare.id);
variables:
exampleAccount:
fn::invoke:
Function: azure:datashare:getAccount
Arguments:
name: example-account
resourceGroupName: example-resource-group
exampleShare:
fn::invoke:
Function: azure:datashare:getShare
Arguments:
name: existing
accountId: ${exampleAccount.id}
outputs:
id: ${exampleShare.id}
Using getShare
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 getShare(args: GetShareArgs, opts?: InvokeOptions): Promise<GetShareResult>
function getShareOutput(args: GetShareOutputArgs, opts?: InvokeOptions): Output<GetShareResult>
def get_share(account_id: Optional[str] = None,
name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetShareResult
def get_share_output(account_id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetShareResult]
func LookupShare(ctx *Context, args *LookupShareArgs, opts ...InvokeOption) (*LookupShareResult, error)
func LookupShareOutput(ctx *Context, args *LookupShareOutputArgs, opts ...InvokeOption) LookupShareResultOutput
> Note: This function is named LookupShare
in the Go SDK.
public static class GetShare
{
public static Task<GetShareResult> InvokeAsync(GetShareArgs args, InvokeOptions? opts = null)
public static Output<GetShareResult> Invoke(GetShareInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetShareResult> getShare(GetShareArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: azure:datashare/getShare:getShare
arguments:
# arguments dictionary
The following arguments are supported:
- account_
id str The ID of the Data Share account in which the Data Share is created.
- name str
The name of this Data Share.
getShare Result
The following output properties are available:
- Account
Id string - Description string
The description of the Data Share.
- Id string
The provider-assigned unique ID for this managed resource.
- Kind string
The kind of the Data Share.
- Name string
The name of the snapshot schedule.
- Snapshot
Schedules List<GetShare Snapshot Schedule> A
snapshot_schedule
block as defined below.- Terms string
The terms of the Data Share.
- Account
Id string - Description string
The description of the Data Share.
- Id string
The provider-assigned unique ID for this managed resource.
- Kind string
The kind of the Data Share.
- Name string
The name of the snapshot schedule.
- Snapshot
Schedules []GetShare Snapshot Schedule A
snapshot_schedule
block as defined below.- Terms string
The terms of the Data Share.
- account
Id String - description String
The description of the Data Share.
- id String
The provider-assigned unique ID for this managed resource.
- kind String
The kind of the Data Share.
- name String
The name of the snapshot schedule.
- snapshot
Schedules List<GetShare Snapshot Schedule> A
snapshot_schedule
block as defined below.- terms String
The terms of the Data Share.
- account
Id string - description string
The description of the Data Share.
- id string
The provider-assigned unique ID for this managed resource.
- kind string
The kind of the Data Share.
- name string
The name of the snapshot schedule.
- snapshot
Schedules GetShare Snapshot Schedule[] A
snapshot_schedule
block as defined below.- terms string
The terms of the Data Share.
- account_
id str - description str
The description of the Data Share.
- id str
The provider-assigned unique ID for this managed resource.
- kind str
The kind of the Data Share.
- name str
The name of the snapshot schedule.
- snapshot_
schedules Sequence[GetShare Snapshot Schedule] A
snapshot_schedule
block as defined below.- terms str
The terms of the Data Share.
- account
Id String - description String
The description of the Data Share.
- id String
The provider-assigned unique ID for this managed resource.
- kind String
The kind of the Data Share.
- name String
The name of the snapshot schedule.
- snapshot
Schedules List<Property Map> A
snapshot_schedule
block as defined below.- terms String
The terms of the Data Share.
Supporting Types
GetShareSnapshotSchedule
- Name string
The name of this Data Share.
- Recurrence string
The interval of the synchronization with the source data.
- Start
Time string The synchronization with the source data's start time.
- Name string
The name of this Data Share.
- Recurrence string
The interval of the synchronization with the source data.
- Start
Time string The synchronization with the source data's start time.
- name String
The name of this Data Share.
- recurrence String
The interval of the synchronization with the source data.
- start
Time String The synchronization with the source data's start time.
- name string
The name of this Data Share.
- recurrence string
The interval of the synchronization with the source data.
- start
Time string The synchronization with the source data's start time.
- name str
The name of this Data Share.
- recurrence str
The interval of the synchronization with the source data.
- start_
time str The synchronization with the source data's start time.
- name String
The name of this Data Share.
- recurrence String
The interval of the synchronization with the source data.
- start
Time String The synchronization with the source data's start time.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
azurerm
Terraform Provider.