StorageAccount

class StorageAccount : KotlinCustomResource

The storage account. API Version: 2021-02-01.

Example Usage

NfsV3AccountCreate

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var storageAccount = new AzureNative.Storage.StorageAccount("storageAccount", new()
{
AccountName = "sto4445",
EnableHttpsTrafficOnly = false,
EnableNfsV3 = true,
IsHnsEnabled = true,
Kind = "BlockBlobStorage",
Location = "eastus",
NetworkRuleSet = new AzureNative.Storage.Inputs.NetworkRuleSetArgs
{
Bypass = "AzureServices",
DefaultAction = AzureNative.Storage.DefaultAction.Allow,
IpRules = new[] {},
VirtualNetworkRules = new[]
{
new AzureNative.Storage.Inputs.VirtualNetworkRuleArgs
{
VirtualNetworkResourceId = "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.Network/virtualNetworks/net123/subnets/subnet12",
},
},
},
ResourceGroupName = "res9101",
Sku = new AzureNative.Storage.Inputs.SkuArgs
{
Name = "Premium_LRS",
},
});
});
package main
import (
storage "github.com/pulumi/pulumi-azure-native-sdk/storage"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := storage.NewStorageAccount(ctx, "storageAccount", &storage.StorageAccountArgs{
AccountName: pulumi.String("sto4445"),
EnableHttpsTrafficOnly: pulumi.Bool(false),
EnableNfsV3: pulumi.Bool(true),
IsHnsEnabled: pulumi.Bool(true),
Kind: pulumi.String("BlockBlobStorage"),
Location: pulumi.String("eastus"),
NetworkRuleSet: storage.NetworkRuleSetResponse{
Bypass: pulumi.String("AzureServices"),
DefaultAction: storage.DefaultActionAllow,
IpRules: storage.IPRuleArray{},
VirtualNetworkRules: storage.VirtualNetworkRuleArray{
&storage.VirtualNetworkRuleArgs{
VirtualNetworkResourceId: pulumi.String("/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.Network/virtualNetworks/net123/subnets/subnet12"),
},
},
},
ResourceGroupName: pulumi.String("res9101"),
Sku: &storage.SkuArgs{
Name: pulumi.String("Premium_LRS"),
},
})
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.azurenative.storage.StorageAccount;
import com.pulumi.azurenative.storage.StorageAccountArgs;
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 storageAccount = new StorageAccount("storageAccount", StorageAccountArgs.builder()
.accountName("sto4445")
.enableHttpsTrafficOnly(false)
.enableNfsV3(true)
.isHnsEnabled(true)
.kind("BlockBlobStorage")
.location("eastus")
.networkRuleSet(Map.ofEntries(
Map.entry("bypass", "AzureServices"),
Map.entry("defaultAction", "Allow"),
Map.entry("ipRules", ),
Map.entry("virtualNetworkRules", Map.of("virtualNetworkResourceId", "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.Network/virtualNetworks/net123/subnets/subnet12"))
))
.resourceGroupName("res9101")
.sku(Map.of("name", "Premium_LRS"))
.build());
}
}

StorageAccountCreate

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var storageAccount = new AzureNative.Storage.StorageAccount("storageAccount", new()
{
AccountName = "sto4445",
AllowBlobPublicAccess = false,
AllowSharedKeyAccess = true,
Encryption = new AzureNative.Storage.Inputs.EncryptionArgs
{
KeySource = "Microsoft.Storage",
RequireInfrastructureEncryption = false,
Services = new AzureNative.Storage.Inputs.EncryptionServicesArgs
{
Blob = new AzureNative.Storage.Inputs.EncryptionServiceArgs
{
Enabled = true,
KeyType = "Account",
},
File = new AzureNative.Storage.Inputs.EncryptionServiceArgs
{
Enabled = true,
KeyType = "Account",
},
},
},
ExtendedLocation = new AzureNative.Storage.Inputs.ExtendedLocationArgs
{
Name = "losangeles001",
Type = "EdgeZone",
},
IsHnsEnabled = true,
KeyPolicy = new AzureNative.Storage.Inputs.KeyPolicyArgs
{
KeyExpirationPeriodInDays = 20,
},
Kind = "Storage",
Location = "eastus",
MinimumTlsVersion = "TLS1_2",
ResourceGroupName = "res9101",
RoutingPreference = new AzureNative.Storage.Inputs.RoutingPreferenceArgs
{
PublishInternetEndpoints = true,
PublishMicrosoftEndpoints = true,
RoutingChoice = "MicrosoftRouting",
},
SasPolicy = new AzureNative.Storage.Inputs.SasPolicyArgs
{
ExpirationAction = "Log",
SasExpirationPeriod = "1.15:59:59",
},
Sku = new AzureNative.Storage.Inputs.SkuArgs
{
Name = "Standard_GRS",
},
Tags =
{
{ "key1", "value1" },
{ "key2", "value2" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.storage.StorageAccount;
import com.pulumi.azurenative.storage.StorageAccountArgs;
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 storageAccount = new StorageAccount("storageAccount", StorageAccountArgs.builder()
.accountName("sto4445")
.allowBlobPublicAccess(false)
.allowSharedKeyAccess(true)
.encryption(Map.ofEntries(
Map.entry("keySource", "Microsoft.Storage"),
Map.entry("requireInfrastructureEncryption", false),
Map.entry("services", Map.ofEntries(
Map.entry("blob", Map.ofEntries(
Map.entry("enabled", true),
Map.entry("keyType", "Account")
)),
Map.entry("file", Map.ofEntries(
Map.entry("enabled", true),
Map.entry("keyType", "Account")
))
))
))
.extendedLocation(Map.ofEntries(
Map.entry("name", "losangeles001"),
Map.entry("type", "EdgeZone")
))
.isHnsEnabled(true)
.keyPolicy(Map.of("keyExpirationPeriodInDays", 20))
.kind("Storage")
.location("eastus")
.minimumTlsVersion("TLS1_2")
.resourceGroupName("res9101")
.routingPreference(Map.ofEntries(
Map.entry("publishInternetEndpoints", true),
Map.entry("publishMicrosoftEndpoints", true),
Map.entry("routingChoice", "MicrosoftRouting")
))
.sasPolicy(Map.ofEntries(
Map.entry("expirationAction", "Log"),
Map.entry("sasExpirationPeriod", "1.15:59:59")
))
.sku(Map.of("name", "Standard_GRS"))
.tags(Map.ofEntries(
Map.entry("key1", "value1"),
Map.entry("key2", "value2")
))
.build());
}
}

StorageAccountCreateUserAssignedEncryptionIdentityWithCMK

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var storageAccount = new AzureNative.Storage.StorageAccount("storageAccount", new()
{
AccountName = "sto4445",
Encryption = new AzureNative.Storage.Inputs.EncryptionArgs
{
EncryptionIdentity = new AzureNative.Storage.Inputs.EncryptionIdentityArgs
{
EncryptionUserAssignedIdentity = "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}",
},
KeySource = "Microsoft.Keyvault",
KeyVaultProperties = new AzureNative.Storage.Inputs.KeyVaultPropertiesArgs
{
KeyName = "wrappingKey",
KeyVaultUri = "https://myvault8569.vault.azure.net",
KeyVersion = "",
},
Services = new AzureNative.Storage.Inputs.EncryptionServicesArgs
{
Blob = new AzureNative.Storage.Inputs.EncryptionServiceArgs
{
Enabled = true,
KeyType = "Account",
},
File = new AzureNative.Storage.Inputs.EncryptionServiceArgs
{
Enabled = true,
KeyType = "Account",
},
},
},
Identity = new AzureNative.Storage.Inputs.IdentityArgs
{
Type = "UserAssigned",
UserAssignedIdentities =
{
{ "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}", null },
},
},
Kind = "Storage",
Location = "eastus",
ResourceGroupName = "res9101",
Sku = new AzureNative.Storage.Inputs.SkuArgs
{
Name = "Standard_LRS",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.storage.StorageAccount;
import com.pulumi.azurenative.storage.StorageAccountArgs;
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 storageAccount = new StorageAccount("storageAccount", StorageAccountArgs.builder()
.accountName("sto4445")
.encryption(Map.ofEntries(
Map.entry("encryptionIdentity", Map.of("encryptionUserAssignedIdentity", "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}")),
Map.entry("keySource", "Microsoft.Keyvault"),
Map.entry("keyVaultProperties", Map.ofEntries(
Map.entry("keyName", "wrappingKey"),
Map.entry("keyVaultUri", "https://myvault8569.vault.azure.net"),
Map.entry("keyVersion", "")
)),
Map.entry("services", Map.ofEntries(
Map.entry("blob", Map.ofEntries(
Map.entry("enabled", true),
Map.entry("keyType", "Account")
)),
Map.entry("file", Map.ofEntries(
Map.entry("enabled", true),
Map.entry("keyType", "Account")
))
))
))
.identity(Map.ofEntries(
Map.entry("type", "UserAssigned"),
Map.entry("userAssignedIdentities", Map.of("/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}", ))
))
.kind("Storage")
.location("eastus")
.resourceGroupName("res9101")
.sku(Map.of("name", "Standard_LRS"))
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:storage:StorageAccount sto4445 /subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.Storage/storageAccounts/sto4445

Properties

Link copied to clipboard
val accessTier: Output<String>

Required for storage accounts where kind = BlobStorage. The access tier used for billing.

Link copied to clipboard

Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property.

Link copied to clipboard

Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true.

Link copied to clipboard

Provides the identity based authentication settings for Azure Files.

Link copied to clipboard

Blob restore status

Link copied to clipboard
val creationTime: Output<String>

Gets the creation date and time of the storage account in UTC.

Link copied to clipboard

Gets the custom domain the user assigned to this storage account.

Link copied to clipboard

Allows https traffic only to storage service if sets to true.

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

NFS 3.0 protocol support enabled if set to true.

Link copied to clipboard

Gets the encryption settings on the account. If unspecified, the account is unencrypted.

Link copied to clipboard

The extendedLocation of the resource.

Link copied to clipboard

If the failover is in progress, the value will be true, otherwise, it will be null.

Link copied to clipboard

Geo Replication Stats

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

The identity of the resource.

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

Account HierarchicalNamespace enabled if sets to true.

Link copied to clipboard

Storage account keys creation time.

Link copied to clipboard

KeyPolicy assigned to the storage account.

Link copied to clipboard
val kind: Output<String>

Gets the Kind.

Link copied to clipboard

Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled.

Link copied to clipboard

Gets the timestamp of the most recent instance of a failover to the secondary location. Only the most recent timestamp is retained. This element is not returned if there has never been a failover instance. Only available if the accountType is Standard_GRS or Standard_RAGRS.

Link copied to clipboard
val location: Output<String>

The geo-location where the resource lives

Link copied to clipboard

Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property.

Link copied to clipboard
val name: Output<String>

The name of the resource

Link copied to clipboard

Network rule set

Link copied to clipboard

Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object. Note that Standard_ZRS and Premium_LRS accounts only return the blob endpoint.

Link copied to clipboard
val primaryLocation: Output<String>

Gets the location of the primary data center for the storage account.

Link copied to clipboard

List of private endpoint connection associated with the specified storage account

Link copied to clipboard

Gets the status of the storage account at the time the operation was called.

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

Maintains information about the network routing choice opted by the user for data transfer

Link copied to clipboard

SasPolicy assigned to the storage account.

Link copied to clipboard

Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object from the secondary location of the storage account. Only available if the SKU name is Standard_RAGRS.

Link copied to clipboard

Gets the location of the geo-replicated secondary for the storage account. Only available if the accountType is Standard_GRS or Standard_RAGRS.

Link copied to clipboard
val sku: Output<SkuResponse>

Gets the SKU.

Link copied to clipboard
val statusOfPrimary: Output<String>

Gets the status indicating whether the primary location of the storage account is available or unavailable.

Link copied to clipboard

Gets the status indicating whether the secondary location of the storage account is available or unavailable. Only available if the SKU name is Standard_GRS or Standard_RAGRS.

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

Resource tags.

Link copied to clipboard
val type: Output<String>

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

Link copied to clipboard
val urn: Output<String>