1. Packages
  2. Azure Classic
  3. API Docs
  4. datashare
  5. getShare

We recommend using Azure Native.

Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi

azure.datashare.getShare

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi

    Use this data source to access information about an existing Data Share.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = azure.datashare.getAccount({
        name: "example-account",
        resourceGroupName: "example-resource-group",
    });
    const exampleGetShare = example.then(example => azure.datashare.getShare({
        name: "existing",
        accountId: example.id,
    }));
    export const id = exampleGetShare.then(exampleGetShare => exampleGetShare.id);
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.datashare.get_account(name="example-account",
        resource_group_name="example-resource-group")
    example_get_share = azure.datashare.get_share(name="existing",
        account_id=example.id)
    pulumi.export("id", example_get_share.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/datashare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := datashare.LookupAccount(ctx, &datashare.LookupAccountArgs{
    			Name:              "example-account",
    			ResourceGroupName: "example-resource-group",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		exampleGetShare, err := datashare.LookupShare(ctx, &datashare.LookupShareArgs{
    			Name:      "existing",
    			AccountId: example.Id,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("id", exampleGetShare.Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Azure.DataShare.GetAccount.Invoke(new()
        {
            Name = "example-account",
            ResourceGroupName = "example-resource-group",
        });
    
        var exampleGetShare = Azure.DataShare.GetShare.Invoke(new()
        {
            Name = "existing",
            AccountId = example.Apply(getAccountResult => getAccountResult.Id),
        });
    
        return new Dictionary<string, object?>
        {
            ["id"] = exampleGetShare.Apply(getShareResult => getShareResult.Id),
        };
    });
    
    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 example = DatashareFunctions.getAccount(GetAccountArgs.builder()
                .name("example-account")
                .resourceGroupName("example-resource-group")
                .build());
    
            final var exampleGetShare = DatashareFunctions.getShare(GetShareArgs.builder()
                .name("existing")
                .accountId(example.applyValue(getAccountResult -> getAccountResult.id()))
                .build());
    
            ctx.export("id", exampleGetShare.applyValue(getShareResult -> getShareResult.id()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: azure:datashare:getAccount
          Arguments:
            name: example-account
            resourceGroupName: example-resource-group
      exampleGetShare:
        fn::invoke:
          Function: azure:datashare:getShare
          Arguments:
            name: existing
            accountId: ${example.id}
    outputs:
      id: ${exampleGetShare.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:

    AccountId string
    The ID of the Data Share account in which the Data Share is created.
    Name string
    The name of this Data Share.
    AccountId string
    The ID of the Data Share account in which the Data Share is created.
    Name string
    The name of this Data Share.
    accountId String
    The ID of the Data Share account in which the Data Share is created.
    name String
    The name of this Data Share.
    accountId string
    The ID of the Data Share account in which the Data Share is created.
    name string
    The name of this Data Share.
    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.
    accountId String
    The ID of the Data Share account in which the Data Share is created.
    name String
    The name of this Data Share.

    getShare Result

    The following output properties are available:

    AccountId 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.
    SnapshotSchedules List<GetShareSnapshotSchedule>
    A snapshot_schedule block as defined below.
    Terms string
    The terms of the Data Share.
    AccountId 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.
    SnapshotSchedules []GetShareSnapshotSchedule
    A snapshot_schedule block as defined below.
    Terms string
    The terms of the Data Share.
    accountId 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.
    snapshotSchedules List<GetShareSnapshotSchedule>
    A snapshot_schedule block as defined below.
    terms String
    The terms of the Data Share.
    accountId 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.
    snapshotSchedules GetShareSnapshotSchedule[]
    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[GetShareSnapshotSchedule]
    A snapshot_schedule block as defined below.
    terms str
    The terms of the Data Share.
    accountId 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.
    snapshotSchedules 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.
    StartTime 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.
    StartTime 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.
    startTime 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.
    startTime 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.
    startTime 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.
    azure logo

    We recommend using Azure Native.

    Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi