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

We recommend using Azure Native.

Azure Classic v6.4.0 published on Tuesday, Oct 8, 2024 by Pulumi

azure.datashare.Share

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v6.4.0 published on Tuesday, Oct 8, 2024 by Pulumi

    Manages a Data Share.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = new azure.core.ResourceGroup("example", {
        name: "example-resources",
        location: "West Europe",
    });
    const exampleAccount = new azure.datashare.Account("example", {
        name: "example-dsa",
        location: example.location,
        resourceGroupName: example.name,
        identity: {
            type: "SystemAssigned",
        },
        tags: {
            foo: "bar",
        },
    });
    const exampleShare = new azure.datashare.Share("example", {
        name: "example_dss",
        accountId: exampleAccount.id,
        kind: "CopyBased",
        description: "example desc",
        terms: "example terms",
        snapshotSchedule: {
            name: "example-ss",
            recurrence: "Day",
            startTime: "2020-04-17T04:47:52.9614956Z",
        },
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.core.ResourceGroup("example",
        name="example-resources",
        location="West Europe")
    example_account = azure.datashare.Account("example",
        name="example-dsa",
        location=example.location,
        resource_group_name=example.name,
        identity={
            "type": "SystemAssigned",
        },
        tags={
            "foo": "bar",
        })
    example_share = azure.datashare.Share("example",
        name="example_dss",
        account_id=example_account.id,
        kind="CopyBased",
        description="example desc",
        terms="example terms",
        snapshot_schedule={
            "name": "example-ss",
            "recurrence": "Day",
            "start_time": "2020-04-17T04:47:52.9614956Z",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
    	"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 := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
    			Name:     pulumi.String("example-resources"),
    			Location: pulumi.String("West Europe"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleAccount, err := datashare.NewAccount(ctx, "example", &datashare.AccountArgs{
    			Name:              pulumi.String("example-dsa"),
    			Location:          example.Location,
    			ResourceGroupName: example.Name,
    			Identity: &datashare.AccountIdentityArgs{
    				Type: pulumi.String("SystemAssigned"),
    			},
    			Tags: pulumi.StringMap{
    				"foo": pulumi.String("bar"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = datashare.NewShare(ctx, "example", &datashare.ShareArgs{
    			Name:        pulumi.String("example_dss"),
    			AccountId:   exampleAccount.ID(),
    			Kind:        pulumi.String("CopyBased"),
    			Description: pulumi.String("example desc"),
    			Terms:       pulumi.String("example terms"),
    			SnapshotSchedule: &datashare.ShareSnapshotScheduleArgs{
    				Name:       pulumi.String("example-ss"),
    				Recurrence: pulumi.String("Day"),
    				StartTime:  pulumi.String("2020-04-17T04:47:52.9614956Z"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Azure.Core.ResourceGroup("example", new()
        {
            Name = "example-resources",
            Location = "West Europe",
        });
    
        var exampleAccount = new Azure.DataShare.Account("example", new()
        {
            Name = "example-dsa",
            Location = example.Location,
            ResourceGroupName = example.Name,
            Identity = new Azure.DataShare.Inputs.AccountIdentityArgs
            {
                Type = "SystemAssigned",
            },
            Tags = 
            {
                { "foo", "bar" },
            },
        });
    
        var exampleShare = new Azure.DataShare.Share("example", new()
        {
            Name = "example_dss",
            AccountId = exampleAccount.Id,
            Kind = "CopyBased",
            Description = "example desc",
            Terms = "example terms",
            SnapshotSchedule = new Azure.DataShare.Inputs.ShareSnapshotScheduleArgs
            {
                Name = "example-ss",
                Recurrence = "Day",
                StartTime = "2020-04-17T04:47:52.9614956Z",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.core.ResourceGroup;
    import com.pulumi.azure.core.ResourceGroupArgs;
    import com.pulumi.azure.datashare.Account;
    import com.pulumi.azure.datashare.AccountArgs;
    import com.pulumi.azure.datashare.inputs.AccountIdentityArgs;
    import com.pulumi.azure.datashare.Share;
    import com.pulumi.azure.datashare.ShareArgs;
    import com.pulumi.azure.datashare.inputs.ShareSnapshotScheduleArgs;
    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) {
            var example = new ResourceGroup("example", ResourceGroupArgs.builder()
                .name("example-resources")
                .location("West Europe")
                .build());
    
            var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
                .name("example-dsa")
                .location(example.location())
                .resourceGroupName(example.name())
                .identity(AccountIdentityArgs.builder()
                    .type("SystemAssigned")
                    .build())
                .tags(Map.of("foo", "bar"))
                .build());
    
            var exampleShare = new Share("exampleShare", ShareArgs.builder()
                .name("example_dss")
                .accountId(exampleAccount.id())
                .kind("CopyBased")
                .description("example desc")
                .terms("example terms")
                .snapshotSchedule(ShareSnapshotScheduleArgs.builder()
                    .name("example-ss")
                    .recurrence("Day")
                    .startTime("2020-04-17T04:47:52.9614956Z")
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: azure:core:ResourceGroup
        properties:
          name: example-resources
          location: West Europe
      exampleAccount:
        type: azure:datashare:Account
        name: example
        properties:
          name: example-dsa
          location: ${example.location}
          resourceGroupName: ${example.name}
          identity:
            type: SystemAssigned
          tags:
            foo: bar
      exampleShare:
        type: azure:datashare:Share
        name: example
        properties:
          name: example_dss
          accountId: ${exampleAccount.id}
          kind: CopyBased
          description: example desc
          terms: example terms
          snapshotSchedule:
            name: example-ss
            recurrence: Day
            startTime: 2020-04-17T04:47:52.9614956Z
    

    Create Share Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Share(name: string, args: ShareArgs, opts?: CustomResourceOptions);
    @overload
    def Share(resource_name: str,
              args: ShareArgs,
              opts: Optional[ResourceOptions] = None)
    
    @overload
    def Share(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              account_id: Optional[str] = None,
              kind: Optional[str] = None,
              description: Optional[str] = None,
              name: Optional[str] = None,
              snapshot_schedule: Optional[ShareSnapshotScheduleArgs] = None,
              terms: Optional[str] = None)
    func NewShare(ctx *Context, name string, args ShareArgs, opts ...ResourceOption) (*Share, error)
    public Share(string name, ShareArgs args, CustomResourceOptions? opts = null)
    public Share(String name, ShareArgs args)
    public Share(String name, ShareArgs args, CustomResourceOptions options)
    
    type: azure:datashare:Share
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ShareArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ShareArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ShareArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ShareArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ShareArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var shareResource = new Azure.DataShare.Share("shareResource", new()
    {
        AccountId = "string",
        Kind = "string",
        Description = "string",
        Name = "string",
        SnapshotSchedule = new Azure.DataShare.Inputs.ShareSnapshotScheduleArgs
        {
            Name = "string",
            Recurrence = "string",
            StartTime = "string",
        },
        Terms = "string",
    });
    
    example, err := datashare.NewShare(ctx, "shareResource", &datashare.ShareArgs{
    	AccountId:   pulumi.String("string"),
    	Kind:        pulumi.String("string"),
    	Description: pulumi.String("string"),
    	Name:        pulumi.String("string"),
    	SnapshotSchedule: &datashare.ShareSnapshotScheduleArgs{
    		Name:       pulumi.String("string"),
    		Recurrence: pulumi.String("string"),
    		StartTime:  pulumi.String("string"),
    	},
    	Terms: pulumi.String("string"),
    })
    
    var shareResource = new Share("shareResource", ShareArgs.builder()
        .accountId("string")
        .kind("string")
        .description("string")
        .name("string")
        .snapshotSchedule(ShareSnapshotScheduleArgs.builder()
            .name("string")
            .recurrence("string")
            .startTime("string")
            .build())
        .terms("string")
        .build());
    
    share_resource = azure.datashare.Share("shareResource",
        account_id="string",
        kind="string",
        description="string",
        name="string",
        snapshot_schedule={
            "name": "string",
            "recurrence": "string",
            "startTime": "string",
        },
        terms="string")
    
    const shareResource = new azure.datashare.Share("shareResource", {
        accountId: "string",
        kind: "string",
        description: "string",
        name: "string",
        snapshotSchedule: {
            name: "string",
            recurrence: "string",
            startTime: "string",
        },
        terms: "string",
    });
    
    type: azure:datashare:Share
    properties:
        accountId: string
        description: string
        kind: string
        name: string
        snapshotSchedule:
            name: string
            recurrence: string
            startTime: string
        terms: string
    

    Share Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The Share resource accepts the following input properties:

    AccountId string
    The ID of the Data Share account in which the Data Share is created. Changing this forces a new Data Share to be created.
    Kind string
    The kind of the Data Share. Possible values are CopyBased and InPlace. Changing this forces a new Data Share to be created.
    Description string
    The Data Share's description.
    Name string
    The name which should be used for this Data Share. Changing this forces a new Data Share to be created.
    SnapshotSchedule ShareSnapshotSchedule
    A snapshot_schedule block as defined below.
    Terms string
    The terms of the Data Share.
    AccountId string
    The ID of the Data Share account in which the Data Share is created. Changing this forces a new Data Share to be created.
    Kind string
    The kind of the Data Share. Possible values are CopyBased and InPlace. Changing this forces a new Data Share to be created.
    Description string
    The Data Share's description.
    Name string
    The name which should be used for this Data Share. Changing this forces a new Data Share to be created.
    SnapshotSchedule ShareSnapshotScheduleArgs
    A snapshot_schedule block as defined below.
    Terms string
    The terms of the Data Share.
    accountId String
    The ID of the Data Share account in which the Data Share is created. Changing this forces a new Data Share to be created.
    kind String
    The kind of the Data Share. Possible values are CopyBased and InPlace. Changing this forces a new Data Share to be created.
    description String
    The Data Share's description.
    name String
    The name which should be used for this Data Share. Changing this forces a new Data Share to be created.
    snapshotSchedule ShareSnapshotSchedule
    A snapshot_schedule block as defined below.
    terms String
    The terms of the Data Share.
    accountId string
    The ID of the Data Share account in which the Data Share is created. Changing this forces a new Data Share to be created.
    kind string
    The kind of the Data Share. Possible values are CopyBased and InPlace. Changing this forces a new Data Share to be created.
    description string
    The Data Share's description.
    name string
    The name which should be used for this Data Share. Changing this forces a new Data Share to be created.
    snapshotSchedule ShareSnapshotSchedule
    A snapshot_schedule block as defined below.
    terms string
    The terms of the Data Share.
    account_id str
    The ID of the Data Share account in which the Data Share is created. Changing this forces a new Data Share to be created.
    kind str
    The kind of the Data Share. Possible values are CopyBased and InPlace. Changing this forces a new Data Share to be created.
    description str
    The Data Share's description.
    name str
    The name which should be used for this Data Share. Changing this forces a new Data Share to be created.
    snapshot_schedule ShareSnapshotScheduleArgs
    A snapshot_schedule block as defined below.
    terms str
    The terms of the Data Share.
    accountId String
    The ID of the Data Share account in which the Data Share is created. Changing this forces a new Data Share to be created.
    kind String
    The kind of the Data Share. Possible values are CopyBased and InPlace. Changing this forces a new Data Share to be created.
    description String
    The Data Share's description.
    name String
    The name which should be used for this Data Share. Changing this forces a new Data Share to be created.
    snapshotSchedule Property Map
    A snapshot_schedule block as defined below.
    terms String
    The terms of the Data Share.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Share resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing Share Resource

    Get an existing Share resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ShareState, opts?: CustomResourceOptions): Share
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_id: Optional[str] = None,
            description: Optional[str] = None,
            kind: Optional[str] = None,
            name: Optional[str] = None,
            snapshot_schedule: Optional[ShareSnapshotScheduleArgs] = None,
            terms: Optional[str] = None) -> Share
    func GetShare(ctx *Context, name string, id IDInput, state *ShareState, opts ...ResourceOption) (*Share, error)
    public static Share Get(string name, Input<string> id, ShareState? state, CustomResourceOptions? opts = null)
    public static Share get(String name, Output<String> id, ShareState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AccountId string
    The ID of the Data Share account in which the Data Share is created. Changing this forces a new Data Share to be created.
    Description string
    The Data Share's description.
    Kind string
    The kind of the Data Share. Possible values are CopyBased and InPlace. Changing this forces a new Data Share to be created.
    Name string
    The name which should be used for this Data Share. Changing this forces a new Data Share to be created.
    SnapshotSchedule ShareSnapshotSchedule
    A snapshot_schedule block as defined below.
    Terms string
    The terms of the Data Share.
    AccountId string
    The ID of the Data Share account in which the Data Share is created. Changing this forces a new Data Share to be created.
    Description string
    The Data Share's description.
    Kind string
    The kind of the Data Share. Possible values are CopyBased and InPlace. Changing this forces a new Data Share to be created.
    Name string
    The name which should be used for this Data Share. Changing this forces a new Data Share to be created.
    SnapshotSchedule ShareSnapshotScheduleArgs
    A snapshot_schedule block as defined below.
    Terms string
    The terms of the Data Share.
    accountId String
    The ID of the Data Share account in which the Data Share is created. Changing this forces a new Data Share to be created.
    description String
    The Data Share's description.
    kind String
    The kind of the Data Share. Possible values are CopyBased and InPlace. Changing this forces a new Data Share to be created.
    name String
    The name which should be used for this Data Share. Changing this forces a new Data Share to be created.
    snapshotSchedule ShareSnapshotSchedule
    A snapshot_schedule block as defined below.
    terms String
    The terms of the Data Share.
    accountId string
    The ID of the Data Share account in which the Data Share is created. Changing this forces a new Data Share to be created.
    description string
    The Data Share's description.
    kind string
    The kind of the Data Share. Possible values are CopyBased and InPlace. Changing this forces a new Data Share to be created.
    name string
    The name which should be used for this Data Share. Changing this forces a new Data Share to be created.
    snapshotSchedule ShareSnapshotSchedule
    A snapshot_schedule block as defined below.
    terms string
    The terms of the Data Share.
    account_id str
    The ID of the Data Share account in which the Data Share is created. Changing this forces a new Data Share to be created.
    description str
    The Data Share's description.
    kind str
    The kind of the Data Share. Possible values are CopyBased and InPlace. Changing this forces a new Data Share to be created.
    name str
    The name which should be used for this Data Share. Changing this forces a new Data Share to be created.
    snapshot_schedule ShareSnapshotScheduleArgs
    A snapshot_schedule block as defined below.
    terms str
    The terms of the Data Share.
    accountId String
    The ID of the Data Share account in which the Data Share is created. Changing this forces a new Data Share to be created.
    description String
    The Data Share's description.
    kind String
    The kind of the Data Share. Possible values are CopyBased and InPlace. Changing this forces a new Data Share to be created.
    name String
    The name which should be used for this Data Share. Changing this forces a new Data Share to be created.
    snapshotSchedule Property Map
    A snapshot_schedule block as defined below.
    terms String
    The terms of the Data Share.

    Supporting Types

    ShareSnapshotSchedule, ShareSnapshotScheduleArgs

    Name string
    The name of the snapshot schedule.
    Recurrence string
    The interval of the synchronization with the source data. Possible values are Hour and Day.
    StartTime string
    The synchronization with the source data's start time.
    Name string
    The name of the snapshot schedule.
    Recurrence string
    The interval of the synchronization with the source data. Possible values are Hour and Day.
    StartTime string
    The synchronization with the source data's start time.
    name String
    The name of the snapshot schedule.
    recurrence String
    The interval of the synchronization with the source data. Possible values are Hour and Day.
    startTime String
    The synchronization with the source data's start time.
    name string
    The name of the snapshot schedule.
    recurrence string
    The interval of the synchronization with the source data. Possible values are Hour and Day.
    startTime string
    The synchronization with the source data's start time.
    name str
    The name of the snapshot schedule.
    recurrence str
    The interval of the synchronization with the source data. Possible values are Hour and Day.
    start_time str
    The synchronization with the source data's start time.
    name String
    The name of the snapshot schedule.
    recurrence String
    The interval of the synchronization with the source data. Possible values are Hour and Day.
    startTime String
    The synchronization with the source data's start time.

    Import

    Data Shares can be imported using the resource id, e.g.

    $ pulumi import azure:datashare/share:Share example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DataShare/accounts/account1/shares/share1
    

    To learn more about importing existing cloud resources, see Importing resources.

    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 Classic v6.4.0 published on Tuesday, Oct 8, 2024 by Pulumi