Account

class Account : KotlinCustomResource

Manages an Azure Storage Account.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "example-resources",
location: "West Europe",
});
const exampleAccount = new azure.storage.Account("example", {
name: "storageaccountname",
resourceGroupName: example.name,
location: example.location,
accountTier: "Standard",
accountReplicationType: "GRS",
tags: {
environment: "staging",
},
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
example_account = azure.storage.Account("example",
name="storageaccountname",
resource_group_name=example.name,
location=example.location,
account_tier="Standard",
account_replication_type="GRS",
tags={
"environment": "staging",
})
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 = "example-resources",
Location = "West Europe",
});
var exampleAccount = new Azure.Storage.Account("example", new()
{
Name = "storageaccountname",
ResourceGroupName = example.Name,
Location = example.Location,
AccountTier = "Standard",
AccountReplicationType = "GRS",
Tags =
{
{ "environment", "staging" },
},
});
});
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("example-resources"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
_, err = storage.NewAccount(ctx, "example", &storage.AccountArgs{
Name: pulumi.String("storageaccountname"),
ResourceGroupName: example.Name,
Location: example.Location,
AccountTier: pulumi.String("Standard"),
AccountReplicationType: pulumi.String("GRS"),
Tags: pulumi.StringMap{
"environment": pulumi.String("staging"),
},
})
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 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("example-resources")
.location("West Europe")
.build());
var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
.name("storageaccountname")
.resourceGroupName(example.name())
.location(example.location())
.accountTier("Standard")
.accountReplicationType("GRS")
.tags(Map.of("environment", "staging"))
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
exampleAccount:
type: azure:storage:Account
name: example
properties:
name: storageaccountname
resourceGroupName: ${example.name}
location: ${example.location}
accountTier: Standard
accountReplicationType: GRS
tags:
environment: staging

With Network Rules

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "example-resources",
location: "West Europe",
});
const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
name: "virtnetname",
addressSpaces: ["10.0.0.0/16"],
location: example.location,
resourceGroupName: example.name,
});
const exampleSubnet = new azure.network.Subnet("example", {
name: "subnetname",
resourceGroupName: example.name,
virtualNetworkName: exampleVirtualNetwork.name,
addressPrefixes: ["10.0.2.0/24"],
serviceEndpoints: [
"Microsoft.Sql",
"Microsoft.Storage",
],
});
const exampleAccount = new azure.storage.Account("example", {
name: "storageaccountname",
resourceGroupName: example.name,
location: example.location,
accountTier: "Standard",
accountReplicationType: "LRS",
networkRules: {
defaultAction: "Deny",
ipRules: ["100.0.0.1"],
virtualNetworkSubnetIds: [exampleSubnet.id],
},
tags: {
environment: "staging",
},
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
example_virtual_network = azure.network.VirtualNetwork("example",
name="virtnetname",
address_spaces=["10.0.0.0/16"],
location=example.location,
resource_group_name=example.name)
example_subnet = azure.network.Subnet("example",
name="subnetname",
resource_group_name=example.name,
virtual_network_name=example_virtual_network.name,
address_prefixes=["10.0.2.0/24"],
service_endpoints=[
"Microsoft.Sql",
"Microsoft.Storage",
])
example_account = azure.storage.Account("example",
name="storageaccountname",
resource_group_name=example.name,
location=example.location,
account_tier="Standard",
account_replication_type="LRS",
network_rules={
"default_action": "Deny",
"ip_rules": ["100.0.0.1"],
"virtual_network_subnet_ids": [example_subnet.id],
},
tags={
"environment": "staging",
})
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 = "example-resources",
Location = "West Europe",
});
var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("example", new()
{
Name = "virtnetname",
AddressSpaces = new[]
{
"10.0.0.0/16",
},
Location = example.Location,
ResourceGroupName = example.Name,
});
var exampleSubnet = new Azure.Network.Subnet("example", new()
{
Name = "subnetname",
ResourceGroupName = example.Name,
VirtualNetworkName = exampleVirtualNetwork.Name,
AddressPrefixes = new[]
{
"10.0.2.0/24",
},
ServiceEndpoints = new[]
{
"Microsoft.Sql",
"Microsoft.Storage",
},
});
var exampleAccount = new Azure.Storage.Account("example", new()
{
Name = "storageaccountname",
ResourceGroupName = example.Name,
Location = example.Location,
AccountTier = "Standard",
AccountReplicationType = "LRS",
NetworkRules = new Azure.Storage.Inputs.AccountNetworkRulesArgs
{
DefaultAction = "Deny",
IpRules = new[]
{
"100.0.0.1",
},
VirtualNetworkSubnetIds = new[]
{
exampleSubnet.Id,
},
},
Tags =
{
{ "environment", "staging" },
},
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/network"
"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("example-resources"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "example", &network.VirtualNetworkArgs{
Name: pulumi.String("virtnetname"),
AddressSpaces: pulumi.StringArray{
pulumi.String("10.0.0.0/16"),
},
Location: example.Location,
ResourceGroupName: example.Name,
})
if err != nil {
return err
}
exampleSubnet, err := network.NewSubnet(ctx, "example", &network.SubnetArgs{
Name: pulumi.String("subnetname"),
ResourceGroupName: example.Name,
VirtualNetworkName: exampleVirtualNetwork.Name,
AddressPrefixes: pulumi.StringArray{
pulumi.String("10.0.2.0/24"),
},
ServiceEndpoints: pulumi.StringArray{
pulumi.String("Microsoft.Sql"),
pulumi.String("Microsoft.Storage"),
},
})
if err != nil {
return err
}
_, err = storage.NewAccount(ctx, "example", &storage.AccountArgs{
Name: pulumi.String("storageaccountname"),
ResourceGroupName: example.Name,
Location: example.Location,
AccountTier: pulumi.String("Standard"),
AccountReplicationType: pulumi.String("LRS"),
NetworkRules: &storage.AccountNetworkRulesTypeArgs{
DefaultAction: pulumi.String("Deny"),
IpRules: pulumi.StringArray{
pulumi.String("100.0.0.1"),
},
VirtualNetworkSubnetIds: pulumi.StringArray{
exampleSubnet.ID(),
},
},
Tags: pulumi.StringMap{
"environment": pulumi.String("staging"),
},
})
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.network.VirtualNetwork;
import com.pulumi.azure.network.VirtualNetworkArgs;
import com.pulumi.azure.network.Subnet;
import com.pulumi.azure.network.SubnetArgs;
import com.pulumi.azure.storage.Account;
import com.pulumi.azure.storage.AccountArgs;
import com.pulumi.azure.storage.inputs.AccountNetworkRulesArgs;
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("example-resources")
.location("West Europe")
.build());
var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()
.name("virtnetname")
.addressSpaces("10.0.0.0/16")
.location(example.location())
.resourceGroupName(example.name())
.build());
var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()
.name("subnetname")
.resourceGroupName(example.name())
.virtualNetworkName(exampleVirtualNetwork.name())
.addressPrefixes("10.0.2.0/24")
.serviceEndpoints(
"Microsoft.Sql",
"Microsoft.Storage")
.build());
var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
.name("storageaccountname")
.resourceGroupName(example.name())
.location(example.location())
.accountTier("Standard")
.accountReplicationType("LRS")
.networkRules(AccountNetworkRulesArgs.builder()
.defaultAction("Deny")
.ipRules("100.0.0.1")
.virtualNetworkSubnetIds(exampleSubnet.id())
.build())
.tags(Map.of("environment", "staging"))
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
exampleVirtualNetwork:
type: azure:network:VirtualNetwork
name: example
properties:
name: virtnetname
addressSpaces:
- 10.0.0.0/16
location: ${example.location}
resourceGroupName: ${example.name}
exampleSubnet:
type: azure:network:Subnet
name: example
properties:
name: subnetname
resourceGroupName: ${example.name}
virtualNetworkName: ${exampleVirtualNetwork.name}
addressPrefixes:
- 10.0.2.0/24
serviceEndpoints:
- Microsoft.Sql
- Microsoft.Storage
exampleAccount:
type: azure:storage:Account
name: example
properties:
name: storageaccountname
resourceGroupName: ${example.name}
location: ${example.location}
accountTier: Standard
accountReplicationType: LRS
networkRules:
defaultAction: Deny
ipRules:
- 100.0.0.1
virtualNetworkSubnetIds:
- ${exampleSubnet.id}
tags:
environment: staging

Import

Storage Accounts can be imported using the resource id, e.g.

$ pulumi import azure:storage/account:Account storageAcc1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Storage/storageAccounts/myaccount

Properties

Link copied to clipboard
val accessTier: Output<String>

Defines the access tier for BlobStorage, FileStorage and StorageV2 accounts. Valid options are Hot, Cool, Cold and Premium. Defaults to Hot.

Link copied to clipboard
val accountKind: Output<String>?

Defines the Kind of account. Valid options are BlobStorage, BlockBlobStorage, FileStorage, Storage and StorageV2. Defaults to StorageV2.

Link copied to clipboard

Defines the type of replication to use for this storage account. Valid options are LRS, GRS, RAGRS, ZRS, GZRS and RAGZRS. Changing this forces a new resource to be created when types LRS, GRS and RAGRS are changed to ZRS, GZRS or RAGZRS and vice versa.

Link copied to clipboard
val accountTier: Output<String>

Defines the Tier to use for this storage account. Valid options are Standard and Premium. For BlockBlobStorage and FileStorage accounts only Premium is valid. Changing this forces a new resource to be created.

Link copied to clipboard
val allowedCopyScope: Output<String>?

Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. Possible values are AAD and PrivateLink.

Link copied to clipboard

Allow or disallow nested items within this Account to opt into being public. Defaults to true.

Link copied to clipboard

A azure_files_authentication block as defined below.

Link copied to clipboard

A blob_properties block as defined below.

Link copied to clipboard

Should cross Tenant replication be enabled? Defaults to false.

Link copied to clipboard

A custom_domain block as documented below.

Link copied to clipboard

A customer_managed_key block as documented below.

Link copied to clipboard

Default to Azure Active Directory authorization in the Azure portal when accessing the Storage Account. The default value is false

Link copied to clipboard
val dnsEndpointType: Output<String>?

Specifies which DNS endpoint type to use. Possible values are Standard and AzureDnsZone. Defaults to Standard. Changing this forces a new resource to be created.

Link copied to clipboard
val edgeZone: Output<String>?

Specifies the Edge Zone within the Azure Region where this Storage Account should exist. Changing this forces a new Storage Account to be created.

Link copied to clipboard

Boolean flag which forces HTTPS if enabled, see here for more information. Defaults to true.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

An identity block as defined below.

Link copied to clipboard

An immutability_policy block as defined below. Changing this forces a new resource to be created.

Link copied to clipboard

Is infrastructure encryption enabled? Changing this forces a new resource to be created. Defaults to false.

Link copied to clipboard
val isHnsEnabled: Output<Boolean>?

Is Hierarchical Namespace enabled? This can be used with Azure Data Lake Storage Gen 2 (see here for more information). Changing this forces a new resource to be created.

Link copied to clipboard

Are Large File Shares Enabled? Defaults to false.

Link copied to clipboard

Is Local User Enabled? Defaults to true.

Link copied to clipboard
val location: Output<String>

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

Link copied to clipboard
val minTlsVersion: Output<String>?

The minimum supported TLS version for the storage account. Possible values are TLS1_0, TLS1_1, and TLS1_2. Defaults to TLS1_2 for new storage accounts.

Link copied to clipboard
val name: Output<String>

Specifies the name of the storage account. Only lowercase Alphanumeric characters allowed. Changing this forces a new resource to be created. This must be unique across the entire Azure service, not just within the resource group.

Link copied to clipboard

A network_rules block as documented below.

Link copied to clipboard
val nfsv3Enabled: Output<Boolean>?

Is NFSv3 protocol enabled? Changing this forces a new resource to be created. Defaults to false.

Link copied to clipboard

The primary access key for the storage account.

Link copied to clipboard

The connection string associated with the primary blob location.

Link copied to clipboard

The endpoint URL for blob storage in the primary location.

Link copied to clipboard
val primaryBlobHost: Output<String>

The hostname with port if applicable for blob storage in the primary location.

Link copied to clipboard

The internet routing endpoint URL for blob storage in the primary location.

Link copied to clipboard

The internet routing hostname with port if applicable for blob storage in the primary location.

Link copied to clipboard

The microsoft routing endpoint URL for blob storage in the primary location.

Link copied to clipboard

The microsoft routing hostname with port if applicable for blob storage in the primary location.

Link copied to clipboard

The connection string associated with the primary location.

Link copied to clipboard

The endpoint URL for DFS storage in the primary location.

Link copied to clipboard
val primaryDfsHost: Output<String>

The hostname with port if applicable for DFS storage in the primary location.

Link copied to clipboard

The internet routing endpoint URL for DFS storage in the primary location.

Link copied to clipboard

The internet routing hostname with port if applicable for DFS storage in the primary location.

Link copied to clipboard

The microsoft routing endpoint URL for DFS storage in the primary location.

Link copied to clipboard

The microsoft routing hostname with port if applicable for DFS storage in the primary location.

Link copied to clipboard

The endpoint URL for file storage in the primary location.

Link copied to clipboard
val primaryFileHost: Output<String>

The hostname with port if applicable for file storage in the primary location.

Link copied to clipboard

The internet routing endpoint URL for file storage in the primary location.

Link copied to clipboard

The internet routing hostname with port if applicable for file storage in the primary location.

Link copied to clipboard

The microsoft routing endpoint URL for file storage in the primary location.

Link copied to clipboard

The microsoft routing hostname with port if applicable for file storage in the primary location.

Link copied to clipboard
val primaryLocation: Output<String>

The primary location of the storage account.

Link copied to clipboard

The endpoint URL for queue storage in the primary location.

Link copied to clipboard

The hostname with port if applicable for queue storage in the primary location.

Link copied to clipboard

The microsoft routing endpoint URL for queue storage in the primary location.

Link copied to clipboard

The microsoft routing hostname with port if applicable for queue storage in the primary location.

Link copied to clipboard

The endpoint URL for table storage in the primary location.

Link copied to clipboard

The hostname with port if applicable for table storage in the primary location.

Link copied to clipboard

The microsoft routing endpoint URL for table storage in the primary location.

Link copied to clipboard

The microsoft routing hostname with port if applicable for table storage in the primary location.

Link copied to clipboard

The endpoint URL for web storage in the primary location.

Link copied to clipboard
val primaryWebHost: Output<String>

The hostname with port if applicable for web storage in the primary location.

Link copied to clipboard

The internet routing endpoint URL for web storage in the primary location.

Link copied to clipboard

The internet routing hostname with port if applicable for web storage in the primary location.

Link copied to clipboard

The microsoft routing endpoint URL for web storage in the primary location.

Link copied to clipboard

The microsoft routing hostname with port if applicable for web storage in the primary location.

Link copied to clipboard

Whether the public network access is enabled? Defaults to true.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The encryption type of the queue service. Possible values are Service and Account. Changing this forces a new resource to be created. Default value is Service.

Link copied to clipboard

A queue_properties block as defined below.

Link copied to clipboard

The name of the resource group in which to create the storage account. Changing this forces a new resource to be created.

Link copied to clipboard
val routing: Output<AccountRouting>

A routing block as defined below.

Link copied to clipboard

A sas_policy block as defined below.

Link copied to clipboard

The secondary access key for the storage account.

Link copied to clipboard

The connection string associated with the secondary blob location.

Link copied to clipboard

The endpoint URL for blob storage in the secondary location.

Link copied to clipboard

The hostname with port if applicable for blob storage in the secondary location.

Link copied to clipboard

The internet routing endpoint URL for blob storage in the secondary location.

Link copied to clipboard

The internet routing hostname with port if applicable for blob storage in the secondary location.

Link copied to clipboard

The microsoft routing endpoint URL for blob storage in the secondary location.

Link copied to clipboard

The microsoft routing hostname with port if applicable for blob storage in the secondary location.

Link copied to clipboard

The connection string associated with the secondary location.

Link copied to clipboard

The endpoint URL for DFS storage in the secondary location.

Link copied to clipboard

The hostname with port if applicable for DFS storage in the secondary location.

Link copied to clipboard

The internet routing endpoint URL for DFS storage in the secondary location.

Link copied to clipboard

The internet routing hostname with port if applicable for DFS storage in the secondary location.

Link copied to clipboard

The microsoft routing endpoint URL for DFS storage in the secondary location.

Link copied to clipboard

The microsoft routing hostname with port if applicable for DFS storage in the secondary location.

Link copied to clipboard

The endpoint URL for file storage in the secondary location.

Link copied to clipboard

The hostname with port if applicable for file storage in the secondary location.

Link copied to clipboard

The internet routing endpoint URL for file storage in the secondary location.

Link copied to clipboard

The internet routing hostname with port if applicable for file storage in the secondary location.

Link copied to clipboard

The microsoft routing endpoint URL for file storage in the secondary location.

Link copied to clipboard

The microsoft routing hostname with port if applicable for file storage in the secondary location.

Link copied to clipboard

The secondary location of the storage account.

Link copied to clipboard

The endpoint URL for queue storage in the secondary location.

Link copied to clipboard

The hostname with port if applicable for queue storage in the secondary location.

Link copied to clipboard

The microsoft routing endpoint URL for queue storage in the secondary location.

Link copied to clipboard

The microsoft routing hostname with port if applicable for queue storage in the secondary location.

Link copied to clipboard

The endpoint URL for table storage in the secondary location.

Link copied to clipboard

The hostname with port if applicable for table storage in the secondary location.

Link copied to clipboard

The microsoft routing endpoint URL for table storage in the secondary location.

Link copied to clipboard

The microsoft routing hostname with port if applicable for table storage in the secondary location.

Link copied to clipboard

The endpoint URL for web storage in the secondary location.

Link copied to clipboard

The hostname with port if applicable for web storage in the secondary location.

Link copied to clipboard

The internet routing endpoint URL for web storage in the secondary location.

Link copied to clipboard

The internet routing hostname with port if applicable for web storage in the secondary location.

Link copied to clipboard

The microsoft routing endpoint URL for web storage in the secondary location.

Link copied to clipboard

The microsoft routing hostname with port if applicable for web storage in the secondary location.

Link copied to clipboard
val sftpEnabled: Output<Boolean>?

Boolean, enable SFTP for the storage account

Link copied to clipboard
Link copied to clipboard

A share_properties block as defined below.

Link copied to clipboard

A static_website block as defined below.

Link copied to clipboard

The encryption type of the table service. Possible values are Service and Account. Changing this forces a new resource to be created. Default value is Service.

Link copied to clipboard
val tags: Output<Map<String, String>>?

A mapping of tags to assign to the resource.

Link copied to clipboard
val urn: Output<String>