We recommend using Azure Native.
Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi
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.getShare({
name: "existing",
storageAccountName: "existing",
});
export const id = example.then(example => example.id);
import pulumi
import pulumi_azure as azure
example = azure.storage.get_share(name="existing",
storage_account_name="existing")
pulumi.export("id", example.id)
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := storage.LookupShare(ctx, &storage.LookupShareArgs{
Name: "existing",
StorageAccountName: "existing",
}, nil)
if err != nil {
return err
}
ctx.Export("id", example.Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.Storage.GetShare.Invoke(new()
{
Name = "existing",
StorageAccountName = "existing",
});
return new Dictionary<string, object?>
{
["id"] = example.Apply(getShareResult => getShareResult.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.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.getShare(GetShareArgs.builder()
.name("existing")
.storageAccountName("existing")
.build());
ctx.export("id", example.applyValue(getShareResult -> getShareResult.id()));
}
}
variables:
example:
fn::invoke:
Function: azure:storage:getShare
Arguments:
name: existing
storageAccountName: existing
outputs:
id: ${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_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_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.
- Storage
Account stringName - The name of the storage account.
- Acls
List<Get
Share Acl> - One or more acl blocks as defined below.
- Metadata Dictionary<string, string>
- A map of custom file share metadata.
- Name string
- The name of the share.
- Storage
Account stringName - The name of the storage account.
- Acls
[]Get
Share Acl - One or more acl blocks as defined below.
- Metadata map[string]string
- A map of custom file share metadata.
- name String
- The name of the share.
- storage
Account StringName - The name of the storage account.
- acls
List<Get
Share Acl> - One or more acl blocks as defined below.
- metadata Map<String,String>
- A map of custom file share metadata.
- name string
- The name of the share.
- storage
Account stringName - The name of the storage account.
- acls
Get
Share Acl[] - One or more acl blocks as defined below.
- metadata {[key: string]: string}
- A map of custom file share metadata.
- name str
- The name of the share.
- storage_
account_ strname - The name of the storage account.
- acls
Sequence[Get
Share Acl] - One or more acl blocks as defined below.
- metadata Mapping[str, str]
- A map of custom file share metadata.
- name String
- The name of the share.
- storage
Account StringName - The name of the storage account.
- acls List<Property Map>
- One or more acl blocks as defined below.
- metadata Map<String>
- A map of custom file share metadata.
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 - Storage
Account stringName - Acls
List<Get
Share Acl> - One or more acl blocks as defined below.
- 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 - Storage
Account stringName - Acls
[]Get
Share Acl - One or more acl blocks as defined below.
- 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 - storage
Account StringName - acls
List<Get
Share Acl> - One or more acl blocks as defined below.
- 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 - storage
Account stringName - acls
Get
Share Acl[] - One or more acl blocks as defined below.
- 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 - storage_
account_ strname - acls
Sequence[Get
Share Acl] - One or more acl blocks as defined below.
- 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 - storage
Account StringName - acls List<Property Map>
- One or more acl blocks as defined below.
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 should be valid until, in ISO8601 format.
- 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 should be valid from, in ISO8601 format.
- Expiry string
- The time at which this Access Policy should be valid until, in ISO8601 format.
- 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 should be valid from, in ISO8601 format.
- expiry String
- The time at which this Access Policy should be valid until, in ISO8601 format.
- 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 should be valid from, in ISO8601 format.
- expiry string
- The time at which this Access Policy should be valid until, in ISO8601 format.
- 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 should be valid from, in ISO8601 format.
- expiry str
- The time at which this Access Policy should be valid until, in ISO8601 format.
- 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 should be valid from, in ISO8601 format.
- expiry String
- The time at which this Access Policy should be valid until, in ISO8601 format.
- 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 should be valid from, in ISO8601 format.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.