We recommend using Azure Native.
azure.storage.getShare
Explore with Pulumi AI
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<Get
Share Acl> - One or more acl blocks as defined below.
- Metadata Dictionary<string, string>
- A map of custom file share metadata.
- Storage
Account stringId The ID of the storage account in which the share exists.
NOTE: One of
storage_account_name
orstorage_account_id
must be specified. When specifyingstorage_account_id
the resource will use the Resource Manager API, rather than the Data Plane API.- Storage
Account stringName - 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
[]Get
Share Acl - One or more acl blocks as defined below.
- Metadata map[string]string
- A map of custom file share metadata.
- Storage
Account stringId The ID of the storage account in which the share exists.
NOTE: One of
storage_account_name
orstorage_account_id
must be specified. When specifyingstorage_account_id
the resource will use the Resource Manager API, rather than the Data Plane API.- Storage
Account stringName - 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<Get
Share Acl> - One or more acl blocks as defined below.
- metadata Map<String,String>
- A map of custom file share metadata.
- storage
Account StringId The ID of the storage account in which the share exists.
NOTE: One of
storage_account_name
orstorage_account_id
must be specified. When specifyingstorage_account_id
the resource will use the Resource Manager API, rather than the Data Plane API.- storage
Account StringName - 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
Get
Share Acl[] - One or more acl blocks as defined below.
- metadata {[key: string]: string}
- A map of custom file share metadata.
- storage
Account stringId The ID of the storage account in which the share exists.
NOTE: One of
storage_account_name
orstorage_account_id
must be specified. When specifyingstorage_account_id
the resource will use the Resource Manager API, rather than the Data Plane API.- storage
Account stringName - 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[Get
Share Acl] - One or more acl blocks as defined below.
- metadata Mapping[str, str]
- A map of custom file share metadata.
- storage_
account_ strid The ID of the storage account in which the share exists.
NOTE: One of
storage_account_name
orstorage_account_id
must be specified. When specifyingstorage_account_id
the resource will use the Resource Manager API, rather than the Data Plane API.- storage_
account_ strname - 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.
- storage
Account StringId The ID of the storage account in which the share exists.
NOTE: One of
storage_account_name
orstorage_account_id
must be specified. When specifyingstorage_account_id
the resource will use the Resource Manager API, rather than the Data Plane API.- storage
Account StringName - 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.
- Resource
Manager stringId - Acls
List<Get
Share Acl> - One or more acl blocks as defined below.
- Storage
Account stringId - Storage
Account stringName
- 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.
- Resource
Manager stringId - Acls
[]Get
Share Acl - One or more acl blocks as defined below.
- Storage
Account stringId - Storage
Account stringName
- 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.
- resource
Manager StringId - acls
List<Get
Share Acl> - One or more acl blocks as defined below.
- storage
Account StringId - storage
Account StringName
- 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.
- resource
Manager stringId - acls
Get
Share Acl[] - One or more acl blocks as defined below.
- storage
Account stringId - storage
Account stringName
- 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_ strid - acls
Sequence[Get
Share Acl] - One or more acl blocks as defined below.
- storage_
account_ strid - storage_
account_ strname
- 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.
- resource
Manager StringId - acls List<Property Map>
- One or more acl blocks as defined below.
- storage
Account StringId - storage
Account StringName
Supporting Types
GetShareAcl
- Access
Policies List<GetShare Acl Access Policy> - An
access_policy
block as defined below. - Id string
- The ID which should be used for this Shared Identifier.
- Access
Policies []GetShare Acl Access Policy - An
access_policy
block as defined below. - Id string
- The ID which should be used for this Shared Identifier.
- access
Policies List<GetShare Acl Access Policy> - An
access_policy
block as defined below. - id String
- The ID which should be used for this Shared Identifier.
- access
Policies GetShare Acl Access Policy[] - An
access_policy
block as defined below. - id string
- The ID which should be used for this Shared Identifier.
- access_
policies Sequence[GetShare Acl Access Policy] - An
access_policy
block as defined below. - id str
- The ID which should be used for this Shared Identifier.
- access
Policies 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), andl
(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), andl
(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), andl
(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), andl
(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), andl
(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), andl
(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.