Share Args
Manages a File Share within Azure Storage.
Note The storage share supports two storage tiers: premium and standard. Standard file shares are created in general purpose (GPv1 or GPv2) storage accounts and premium file shares are created in FileStorage storage accounts. For further information, refer to the section "What storage tiers are supported in Azure Files?" of documentation. Note on Authentication Shared Key authentication will always be used for this resource, 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 = 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",
storageAccountId: exampleAccount.id,
quota: 50,
acls: [{
id: "MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI",
accessPolicies: [{
permissions: "rwdl",
start: "2019-07-02T09:38:21Z",
expiry: "2019-07-02T10:38:21Z",
}],
}],
});
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_id=example_account.id,
quota=50,
acls=[{
"id": "MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI",
"access_policies": [{
"permissions": "rwdl",
"start": "2019-07-02T09:38:21Z",
"expiry": "2019-07-02T10:38:21Z",
}],
}])
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",
StorageAccountId = exampleAccount.Id,
Quota = 50,
Acls = new[]
{
new Azure.Storage.Inputs.ShareAclArgs
{
Id = "MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI",
AccessPolicies = new[]
{
new Azure.Storage.Inputs.ShareAclAccessPolicyArgs
{
Permissions = "rwdl",
Start = "2019-07-02T09:38:21Z",
Expiry = "2019-07-02T10:38:21Z",
},
},
},
},
});
});
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
}
_, err = storage.NewShare(ctx, "example", &storage.ShareArgs{
Name: pulumi.String("sharename"),
StorageAccountId: exampleAccount.ID(),
Quota: pulumi.Int(50),
Acls: storage.ShareAclArray{
&storage.ShareAclArgs{
Id: pulumi.String("MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI"),
AccessPolicies: storage.ShareAclAccessPolicyArray{
&storage.ShareAclAccessPolicyArgs{
Permissions: pulumi.String("rwdl"),
Start: pulumi.String("2019-07-02T09:38:21Z"),
Expiry: pulumi.String("2019-07-02T10:38:21Z"),
},
},
},
},
})
if err != nil {
return err
}
return nil
})
}
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.inputs.ShareAclArgs;
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")
.storageAccountId(exampleAccount.id())
.quota(50)
.acls(ShareAclArgs.builder()
.id("MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI")
.accessPolicies(ShareAclAccessPolicyArgs.builder()
.permissions("rwdl")
.start("2019-07-02T09:38:21Z")
.expiry("2019-07-02T10:38:21Z")
.build())
.build())
.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
storageAccountId: ${exampleAccount.id}
quota: 50
acls:
- id: MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI
accessPolicies:
- permissions: rwdl
start: 2019-07-02T09:38:21Z
expiry: 2019-07-02T10:38:21Z
Import
Storage Shares can be imported using the id
, e.g.
$ pulumi import azure:storage/share:Share exampleShare /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Storage/storageAccounts/myAccount/fileServices/default/shares/exampleShare
Constructors
Properties
The access tier of the File Share. Possible values are Hot
, Cool
and TransactionOptimized
, Premium
. ~>NOTE: The FileStorage
account_kind
of the azure.storage.Account
requires Premium
access_tier
.
One or more acl
blocks as defined below.
The protocol used for the share. Possible values are SMB
and NFS
. The SMB
indicates the share can be accessed by SMBv3.0, SMBv2.1 and REST. The NFS
indicates the share can be accessed by NFSv4.1. Defaults to SMB
. Changing this forces a new resource to be created. ~>NOTE: The FileStorage
account_kind
of the azure.storage.Account
is required for the NFS
protocol.
The maximum size of the share, in gigabytes. ~>NOTE: For Standard storage accounts, by default this must be 1
GB (or higher) and at most 5120
GB (5
TB). This can be set to a value larger than 5120
GB if large_file_share_enabled
is set to true
in the parent azure.storage.Account
. ~>NOTE: For Premium FileStorage storage accounts, this must be greater than 100
GB and at most 102400
GB (100
TB).
Specifies the storage account in which to create the share. Changing this forces a new resource to be created.
Specifies the storage account in which to create the share. Changing this forces a new resource to be created. This property is deprecated in favour of storage_account_id
.