We recommend using Azure Native.
azure.storage.ShareDirectory
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "azuretest",
location: "West Europe",
});
const exampleAccount = new azure.storage.Account("example", {
name: "azureteststorage",
resourceGroupName: example.name,
location: example.location,
accountTier: "Standard",
accountReplicationType: "LRS",
});
const exampleShare = new azure.storage.Share("example", {
name: "sharename",
storageAccountName: exampleAccount.name,
quota: 50,
});
const exampleShareDirectory = new azure.storage.ShareDirectory("example", {
name: "example",
storageShareId: exampleShare.id,
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="azuretest",
location="West Europe")
example_account = azure.storage.Account("example",
name="azureteststorage",
resource_group_name=example.name,
location=example.location,
account_tier="Standard",
account_replication_type="LRS")
example_share = azure.storage.Share("example",
name="sharename",
storage_account_name=example_account.name,
quota=50)
example_share_directory = azure.storage.ShareDirectory("example",
name="example",
storage_share_id=example_share.id)
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"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 := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("azuretest"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleAccount, err := storage.NewAccount(ctx, "example", &storage.AccountArgs{
Name: pulumi.String("azureteststorage"),
ResourceGroupName: example.Name,
Location: example.Location,
AccountTier: pulumi.String("Standard"),
AccountReplicationType: pulumi.String("LRS"),
})
if err != nil {
return err
}
exampleShare, err := storage.NewShare(ctx, "example", &storage.ShareArgs{
Name: pulumi.String("sharename"),
StorageAccountName: exampleAccount.Name,
Quota: pulumi.Int(50),
})
if err != nil {
return err
}
_, err = storage.NewShareDirectory(ctx, "example", &storage.ShareDirectoryArgs{
Name: pulumi.String("example"),
StorageShareId: exampleShare.ID(),
})
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 = "azuretest",
Location = "West Europe",
});
var exampleAccount = new Azure.Storage.Account("example", new()
{
Name = "azureteststorage",
ResourceGroupName = example.Name,
Location = example.Location,
AccountTier = "Standard",
AccountReplicationType = "LRS",
});
var exampleShare = new Azure.Storage.Share("example", new()
{
Name = "sharename",
StorageAccountName = exampleAccount.Name,
Quota = 50,
});
var exampleShareDirectory = new Azure.Storage.ShareDirectory("example", new()
{
Name = "example",
StorageShareId = exampleShare.Id,
});
});
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.storage.Account;
import com.pulumi.azure.storage.AccountArgs;
import com.pulumi.azure.storage.Share;
import com.pulumi.azure.storage.ShareArgs;
import com.pulumi.azure.storage.ShareDirectory;
import com.pulumi.azure.storage.ShareDirectoryArgs;
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("azuretest")
.location("West Europe")
.build());
var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
.name("azureteststorage")
.resourceGroupName(example.name())
.location(example.location())
.accountTier("Standard")
.accountReplicationType("LRS")
.build());
var exampleShare = new Share("exampleShare", ShareArgs.builder()
.name("sharename")
.storageAccountName(exampleAccount.name())
.quota(50)
.build());
var exampleShareDirectory = new ShareDirectory("exampleShareDirectory", ShareDirectoryArgs.builder()
.name("example")
.storageShareId(exampleShare.id())
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: azuretest
location: West Europe
exampleAccount:
type: azure:storage:Account
name: example
properties:
name: azureteststorage
resourceGroupName: ${example.name}
location: ${example.location}
accountTier: Standard
accountReplicationType: LRS
exampleShare:
type: azure:storage:Share
name: example
properties:
name: sharename
storageAccountName: ${exampleAccount.name}
quota: 50
exampleShareDirectory:
type: azure:storage:ShareDirectory
name: example
properties:
name: example
storageShareId: ${exampleShare.id}
Create ShareDirectory Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ShareDirectory(name: string, args: ShareDirectoryArgs, opts?: CustomResourceOptions);
@overload
def ShareDirectory(resource_name: str,
args: ShareDirectoryArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ShareDirectory(resource_name: str,
opts: Optional[ResourceOptions] = None,
storage_share_id: Optional[str] = None,
metadata: Optional[Mapping[str, str]] = None,
name: Optional[str] = None)
func NewShareDirectory(ctx *Context, name string, args ShareDirectoryArgs, opts ...ResourceOption) (*ShareDirectory, error)
public ShareDirectory(string name, ShareDirectoryArgs args, CustomResourceOptions? opts = null)
public ShareDirectory(String name, ShareDirectoryArgs args)
public ShareDirectory(String name, ShareDirectoryArgs args, CustomResourceOptions options)
type: azure:storage:ShareDirectory
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 ShareDirectoryArgs
- 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 ShareDirectoryArgs
- 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 ShareDirectoryArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ShareDirectoryArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ShareDirectoryArgs
- 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 shareDirectoryResource = new Azure.Storage.ShareDirectory("shareDirectoryResource", new()
{
StorageShareId = "string",
Metadata =
{
{ "string", "string" },
},
Name = "string",
});
example, err := storage.NewShareDirectory(ctx, "shareDirectoryResource", &storage.ShareDirectoryArgs{
StorageShareId: pulumi.String("string"),
Metadata: pulumi.StringMap{
"string": pulumi.String("string"),
},
Name: pulumi.String("string"),
})
var shareDirectoryResource = new ShareDirectory("shareDirectoryResource", ShareDirectoryArgs.builder()
.storageShareId("string")
.metadata(Map.of("string", "string"))
.name("string")
.build());
share_directory_resource = azure.storage.ShareDirectory("shareDirectoryResource",
storage_share_id="string",
metadata={
"string": "string",
},
name="string")
const shareDirectoryResource = new azure.storage.ShareDirectory("shareDirectoryResource", {
storageShareId: "string",
metadata: {
string: "string",
},
name: "string",
});
type: azure:storage:ShareDirectory
properties:
metadata:
string: string
name: string
storageShareId: string
ShareDirectory Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ShareDirectory resource accepts the following input properties:
- string
- The Storage Share ID in which this file will be placed into. Changing this forces a new resource to be created.
- Metadata Dictionary<string, string>
- A mapping of metadata to assign to this Directory.
- Name string
- The name (or path) of the Directory that should be created within this File Share. Changing this forces a new resource to be created.
- string
- The Storage Share ID in which this file will be placed into. Changing this forces a new resource to be created.
- Metadata map[string]string
- A mapping of metadata to assign to this Directory.
- Name string
- The name (or path) of the Directory that should be created within this File Share. Changing this forces a new resource to be created.
- String
- The Storage Share ID in which this file will be placed into. Changing this forces a new resource to be created.
- metadata Map<String,String>
- A mapping of metadata to assign to this Directory.
- name String
- The name (or path) of the Directory that should be created within this File Share. Changing this forces a new resource to be created.
- string
- The Storage Share ID in which this file will be placed into. Changing this forces a new resource to be created.
- metadata {[key: string]: string}
- A mapping of metadata to assign to this Directory.
- name string
- The name (or path) of the Directory that should be created within this File Share. Changing this forces a new resource to be created.
- str
- The Storage Share ID in which this file will be placed into. Changing this forces a new resource to be created.
- metadata Mapping[str, str]
- A mapping of metadata to assign to this Directory.
- name str
- The name (or path) of the Directory that should be created within this File Share. Changing this forces a new resource to be created.
- String
- The Storage Share ID in which this file will be placed into. Changing this forces a new resource to be created.
- metadata Map<String>
- A mapping of metadata to assign to this Directory.
- name String
- The name (or path) of the Directory that should be created within this File Share. Changing this forces a new resource to be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the ShareDirectory 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 ShareDirectory Resource
Get an existing ShareDirectory 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?: ShareDirectoryState, opts?: CustomResourceOptions): ShareDirectory
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
metadata: Optional[Mapping[str, str]] = None,
name: Optional[str] = None,
storage_share_id: Optional[str] = None) -> ShareDirectory
func GetShareDirectory(ctx *Context, name string, id IDInput, state *ShareDirectoryState, opts ...ResourceOption) (*ShareDirectory, error)
public static ShareDirectory Get(string name, Input<string> id, ShareDirectoryState? state, CustomResourceOptions? opts = null)
public static ShareDirectory get(String name, Output<String> id, ShareDirectoryState 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.
- Metadata Dictionary<string, string>
- A mapping of metadata to assign to this Directory.
- Name string
- The name (or path) of the Directory that should be created within this File Share. Changing this forces a new resource to be created.
- string
- The Storage Share ID in which this file will be placed into. Changing this forces a new resource to be created.
- Metadata map[string]string
- A mapping of metadata to assign to this Directory.
- Name string
- The name (or path) of the Directory that should be created within this File Share. Changing this forces a new resource to be created.
- string
- The Storage Share ID in which this file will be placed into. Changing this forces a new resource to be created.
- metadata Map<String,String>
- A mapping of metadata to assign to this Directory.
- name String
- The name (or path) of the Directory that should be created within this File Share. Changing this forces a new resource to be created.
- String
- The Storage Share ID in which this file will be placed into. Changing this forces a new resource to be created.
- metadata {[key: string]: string}
- A mapping of metadata to assign to this Directory.
- name string
- The name (or path) of the Directory that should be created within this File Share. Changing this forces a new resource to be created.
- string
- The Storage Share ID in which this file will be placed into. Changing this forces a new resource to be created.
- metadata Mapping[str, str]
- A mapping of metadata to assign to this Directory.
- name str
- The name (or path) of the Directory that should be created within this File Share. Changing this forces a new resource to be created.
- str
- The Storage Share ID in which this file will be placed into. Changing this forces a new resource to be created.
- metadata Map<String>
- A mapping of metadata to assign to this Directory.
- name String
- The name (or path) of the Directory that should be created within this File Share. Changing this forces a new resource to be created.
- String
- The Storage Share ID in which this file will be placed into. Changing this forces a new resource to be created.
Import
Directories within an Azure Storage File Share can be imported using the resource id
, e.g.
$ pulumi import azure:storage/shareDirectory:ShareDirectory example https://tomdevsa20.file.core.windows.net/share1/directory1
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.