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

We recommend using Azure Native.

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

azure.storage.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 File Share.

    Note on Authentication Shared Key authentication will always be used for this data source, as AzureAD authentication is not supported by the Storage API for files.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = azure.storage.getAccount({
        name: "exampleaccount",
        resourceGroupName: "examples",
    });
    const exampleGetShare = example.then(example => azure.storage.getShare({
        name: "existing",
        storageAccountId: example.id,
    }));
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.storage.get_account(name="exampleaccount",
        resource_group_name="examples")
    example_get_share = azure.storage.get_share(name="existing",
        storage_account_id=example.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/storage"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := storage.LookupAccount(ctx, &storage.LookupAccountArgs{
    			Name:              "exampleaccount",
    			ResourceGroupName: pulumi.StringRef("examples"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = storage.LookupShare(ctx, &storage.LookupShareArgs{
    			Name:             "existing",
    			StorageAccountId: pulumi.StringRef(example.Id),
    		}, nil)
    		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 = Azure.Storage.GetAccount.Invoke(new()
        {
            Name = "exampleaccount",
            ResourceGroupName = "examples",
        });
    
        var exampleGetShare = Azure.Storage.GetShare.Invoke(new()
        {
            Name = "existing",
            StorageAccountId = example.Apply(getAccountResult => getAccountResult.Id),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.storage.StorageFunctions;
    import com.pulumi.azure.storage.inputs.GetAccountArgs;
    import com.pulumi.azure.storage.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 = StorageFunctions.getAccount(GetAccountArgs.builder()
                .name("exampleaccount")
                .resourceGroupName("examples")
                .build());
    
            final var exampleGetShare = StorageFunctions.getShare(GetShareArgs.builder()
                .name("existing")
                .storageAccountId(example.applyValue(getAccountResult -> getAccountResult.id()))
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: azure:storage:getAccount
          Arguments:
            name: exampleaccount
            resourceGroupName: examples
      exampleGetShare:
        fn::invoke:
          Function: azure:storage:getShare
          Arguments:
            name: existing
            storageAccountId: ${example.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(acls: Optional[Sequence[GetShareAcl]] = None,
                  metadata: Optional[Mapping[str, str]] = None,
                  name: Optional[str] = None,
                  storage_account_id: Optional[str] = None,
                  storage_account_name: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetShareResult
    def get_share_output(acls: Optional[pulumi.Input[Sequence[pulumi.Input[GetShareAclArgs]]]] = None,
                  metadata: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                  name: Optional[pulumi.Input[str]] = None,
                  storage_account_id: Optional[pulumi.Input[str]] = None,
                  storage_account_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:storage/getShare:getShare
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the share.
    Acls List<GetShareAcl>
    One or more acl blocks as defined below.
    Metadata Dictionary<string, string>
    A map of custom file share metadata.
    StorageAccountId string

    The ID of the storage account in which the share exists.

    NOTE: One of storage_account_name or storage_account_id must be specified. When specifying storage_account_id the resource will use the Resource Manager API, rather than the Data Plane API.

    StorageAccountName string
    The name of the storage account in which the share exists. This property is deprecated in favour of storage_account_id.
    Name string
    The name of the share.
    Acls []GetShareAcl
    One or more acl blocks as defined below.
    Metadata map[string]string
    A map of custom file share metadata.
    StorageAccountId string

    The ID of the storage account in which the share exists.

    NOTE: One of storage_account_name or storage_account_id must be specified. When specifying storage_account_id the resource will use the Resource Manager API, rather than the Data Plane API.

    StorageAccountName string
    The name of the storage account in which the share exists. This property is deprecated in favour of storage_account_id.
    name String
    The name of the share.
    acls List<GetShareAcl>
    One or more acl blocks as defined below.
    metadata Map<String,String>
    A map of custom file share metadata.
    storageAccountId String

    The ID of the storage account in which the share exists.

    NOTE: One of storage_account_name or storage_account_id must be specified. When specifying storage_account_id the resource will use the Resource Manager API, rather than the Data Plane API.

    storageAccountName String
    The name of the storage account in which the share exists. This property is deprecated in favour of storage_account_id.
    name string
    The name of the share.
    acls GetShareAcl[]
    One or more acl blocks as defined below.
    metadata {[key: string]: string}
    A map of custom file share metadata.
    storageAccountId string

    The ID of the storage account in which the share exists.

    NOTE: One of storage_account_name or storage_account_id must be specified. When specifying storage_account_id the resource will use the Resource Manager API, rather than the Data Plane API.

    storageAccountName string
    The name of the storage account in which the share exists. This property is deprecated in favour of storage_account_id.
    name str
    The name of the share.
    acls Sequence[GetShareAcl]
    One or more acl blocks as defined below.
    metadata Mapping[str, str]
    A map of custom file share metadata.
    storage_account_id str

    The ID of the storage account in which the share exists.

    NOTE: One of storage_account_name or storage_account_id must be specified. When specifying storage_account_id the resource will use the Resource Manager API, rather than the Data Plane API.

    storage_account_name str
    The name of the storage account in which the share exists. This property is deprecated in favour of storage_account_id.
    name String
    The name of the share.
    acls List<Property Map>
    One or more acl blocks as defined below.
    metadata Map<String>
    A map of custom file share metadata.
    storageAccountId String

    The ID of the storage account in which the share exists.

    NOTE: One of storage_account_name or storage_account_id must be specified. When specifying storage_account_id the resource will use the Resource Manager API, rather than the Data Plane API.

    storageAccountName String
    The name of the storage account in which the share exists. This property is deprecated in favour of storage_account_id.

    getShare Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Metadata Dictionary<string, string>
    A map of custom file share metadata.
    Name string
    Quota int
    The quota of the File Share in GB.
    ResourceManagerId string

    Deprecated: this property has been deprecated in favour of id and will be removed in version 5.0 of the Provider.

    Acls List<GetShareAcl>
    One or more acl blocks as defined below.
    StorageAccountId string
    StorageAccountName string
    Id string
    The provider-assigned unique ID for this managed resource.
    Metadata map[string]string
    A map of custom file share metadata.
    Name string
    Quota int
    The quota of the File Share in GB.
    ResourceManagerId string

    Deprecated: this property has been deprecated in favour of id and will be removed in version 5.0 of the Provider.

    Acls []GetShareAcl
    One or more acl blocks as defined below.
    StorageAccountId string
    StorageAccountName string
    id String
    The provider-assigned unique ID for this managed resource.
    metadata Map<String,String>
    A map of custom file share metadata.
    name String
    quota Integer
    The quota of the File Share in GB.
    resourceManagerId String

    Deprecated: this property has been deprecated in favour of id and will be removed in version 5.0 of the Provider.

    acls List<GetShareAcl>
    One or more acl blocks as defined below.
    storageAccountId String
    storageAccountName String
    id string
    The provider-assigned unique ID for this managed resource.
    metadata {[key: string]: string}
    A map of custom file share metadata.
    name string
    quota number
    The quota of the File Share in GB.
    resourceManagerId string

    Deprecated: this property has been deprecated in favour of id and will be removed in version 5.0 of the Provider.

    acls GetShareAcl[]
    One or more acl blocks as defined below.
    storageAccountId string
    storageAccountName string
    id str
    The provider-assigned unique ID for this managed resource.
    metadata Mapping[str, str]
    A map of custom file share metadata.
    name str
    quota int
    The quota of the File Share in GB.
    resource_manager_id str

    Deprecated: this property has been deprecated in favour of id and will be removed in version 5.0 of the Provider.

    acls Sequence[GetShareAcl]
    One or more acl blocks as defined below.
    storage_account_id str
    storage_account_name str
    id String
    The provider-assigned unique ID for this managed resource.
    metadata Map<String>
    A map of custom file share metadata.
    name String
    quota Number
    The quota of the File Share in GB.
    resourceManagerId String

    Deprecated: this property has been deprecated in favour of id and will be removed in version 5.0 of the Provider.

    acls List<Property Map>
    One or more acl blocks as defined below.
    storageAccountId String
    storageAccountName String

    Supporting Types

    GetShareAcl

    AccessPolicies List<GetShareAclAccessPolicy>
    An access_policy block as defined below.
    Id string
    The ID which should be used for this Shared Identifier.
    AccessPolicies []GetShareAclAccessPolicy
    An access_policy block as defined below.
    Id string
    The ID which should be used for this Shared Identifier.
    accessPolicies List<GetShareAclAccessPolicy>
    An access_policy block as defined below.
    id String
    The ID which should be used for this Shared Identifier.
    accessPolicies GetShareAclAccessPolicy[]
    An access_policy block as defined below.
    id string
    The ID which should be used for this Shared Identifier.
    access_policies Sequence[GetShareAclAccessPolicy]
    An access_policy block as defined below.
    id str
    The ID which should be used for this Shared Identifier.
    accessPolicies List<Property Map>
    An access_policy block as defined below.
    id String
    The ID which should be used for this Shared Identifier.

    GetShareAclAccessPolicy

    Expiry string
    The time at which this Access Policy is valid until.
    Permissions string
    The permissions which should be associated with this Shared Identifier. Possible value is combination of r (read), w (write), d (delete), and l (list).
    Start string
    The time at which this Access Policy is valid from.
    Expiry string
    The time at which this Access Policy is valid until.
    Permissions string
    The permissions which should be associated with this Shared Identifier. Possible value is combination of r (read), w (write), d (delete), and l (list).
    Start string
    The time at which this Access Policy is valid from.
    expiry String
    The time at which this Access Policy is valid until.
    permissions String
    The permissions which should be associated with this Shared Identifier. Possible value is combination of r (read), w (write), d (delete), and l (list).
    start String
    The time at which this Access Policy is valid from.
    expiry string
    The time at which this Access Policy is valid until.
    permissions string
    The permissions which should be associated with this Shared Identifier. Possible value is combination of r (read), w (write), d (delete), and l (list).
    start string
    The time at which this Access Policy is valid from.
    expiry str
    The time at which this Access Policy is valid until.
    permissions str
    The permissions which should be associated with this Shared Identifier. Possible value is combination of r (read), w (write), d (delete), and l (list).
    start str
    The time at which this Access Policy is valid from.
    expiry String
    The time at which this Access Policy is valid until.
    permissions String
    The permissions which should be associated with this Shared Identifier. Possible value is combination of r (read), w (write), d (delete), and l (list).
    start String
    The time at which this Access Policy is valid from.

    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