Storage Account Args
The storage account. Azure REST API version: 2022-09-01. Prior API version in Azure Native 1.x: 2021-02-01. Other available API versions: 2015-05-01-preview, 2015-06-15, 2018-11-01, 2023-01-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 (
"github.com/pulumi/pulumi-azure-native-sdk/storage/v2"
"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,
DefaultToOAuthAuthentication = false,
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,
IsSftpEnabled = 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 main
import (
"github.com/pulumi/pulumi-azure-native-sdk/storage/v2"
"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"),
AllowBlobPublicAccess: pulumi.Bool(false),
AllowSharedKeyAccess: pulumi.Bool(true),
DefaultToOAuthAuthentication: pulumi.Bool(false),
Encryption: storage.EncryptionResponse{
KeySource: pulumi.String("Microsoft.Storage"),
RequireInfrastructureEncryption: pulumi.Bool(false),
Services: interface{}{
Blob: &storage.EncryptionServiceArgs{
Enabled: pulumi.Bool(true),
KeyType: pulumi.String("Account"),
},
File: &storage.EncryptionServiceArgs{
Enabled: pulumi.Bool(true),
KeyType: pulumi.String("Account"),
},
},
},
ExtendedLocation: &storage.ExtendedLocationArgs{
Name: pulumi.String("losangeles001"),
Type: pulumi.String("EdgeZone"),
},
IsHnsEnabled: pulumi.Bool(true),
IsSftpEnabled: pulumi.Bool(true),
KeyPolicy: &storage.KeyPolicyArgs{
KeyExpirationPeriodInDays: pulumi.Int(20),
},
Kind: pulumi.String("Storage"),
Location: pulumi.String("eastus"),
MinimumTlsVersion: pulumi.String("TLS1_2"),
ResourceGroupName: pulumi.String("res9101"),
RoutingPreference: &storage.RoutingPreferenceArgs{
PublishInternetEndpoints: pulumi.Bool(true),
PublishMicrosoftEndpoints: pulumi.Bool(true),
RoutingChoice: pulumi.String("MicrosoftRouting"),
},
SasPolicy: &storage.SasPolicyArgs{
ExpirationAction: pulumi.String("Log"),
SasExpirationPeriod: pulumi.String("1.15:59:59"),
},
Sku: &storage.SkuArgs{
Name: pulumi.String("Standard_GRS"),
},
Tags: pulumi.StringMap{
"key1": pulumi.String("value1"),
"key2": pulumi.String("value2"),
},
})
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")
.allowBlobPublicAccess(false)
.allowSharedKeyAccess(true)
.defaultToOAuthAuthentication(false)
.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)
.isSftpEnabled(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());
}
}
StorageAccountCreateAllowedCopyScopeToAAD
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,
AllowedCopyScope = "AAD",
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",
},
},
},
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 main
import (
"github.com/pulumi/pulumi-azure-native-sdk/storage/v2"
"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"),
AllowBlobPublicAccess: pulumi.Bool(false),
AllowSharedKeyAccess: pulumi.Bool(true),
AllowedCopyScope: pulumi.String("AAD"),
Encryption: storage.EncryptionResponse{
KeySource: pulumi.String("Microsoft.Storage"),
RequireInfrastructureEncryption: pulumi.Bool(false),
Services: interface{}{
Blob: &storage.EncryptionServiceArgs{
Enabled: pulumi.Bool(true),
KeyType: pulumi.String("Account"),
},
File: &storage.EncryptionServiceArgs{
Enabled: pulumi.Bool(true),
KeyType: pulumi.String("Account"),
},
},
},
IsHnsEnabled: pulumi.Bool(true),
KeyPolicy: &storage.KeyPolicyArgs{
KeyExpirationPeriodInDays: pulumi.Int(20),
},
Kind: pulumi.String("Storage"),
Location: pulumi.String("eastus"),
MinimumTlsVersion: pulumi.String("TLS1_2"),
ResourceGroupName: pulumi.String("res9101"),
RoutingPreference: &storage.RoutingPreferenceArgs{
PublishInternetEndpoints: pulumi.Bool(true),
PublishMicrosoftEndpoints: pulumi.Bool(true),
RoutingChoice: pulumi.String("MicrosoftRouting"),
},
SasPolicy: &storage.SasPolicyArgs{
ExpirationAction: pulumi.String("Log"),
SasExpirationPeriod: pulumi.String("1.15:59:59"),
},
Sku: &storage.SkuArgs{
Name: pulumi.String("Standard_GRS"),
},
Tags: pulumi.StringMap{
"key1": pulumi.String("value1"),
"key2": pulumi.String("value2"),
},
})
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")
.allowBlobPublicAccess(false)
.allowSharedKeyAccess(true)
.allowedCopyScope("AAD")
.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")
))
))
))
.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());
}
}
StorageAccountCreateAllowedCopyScopeToPrivateLink
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,
AllowedCopyScope = "PrivateLink",
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",
},
},
},
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 main
import (
"github.com/pulumi/pulumi-azure-native-sdk/storage/v2"
"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"),
AllowBlobPublicAccess: pulumi.Bool(false),
AllowSharedKeyAccess: pulumi.Bool(true),
AllowedCopyScope: pulumi.String("PrivateLink"),
Encryption: storage.EncryptionResponse{
KeySource: pulumi.String("Microsoft.Storage"),
RequireInfrastructureEncryption: pulumi.Bool(false),
Services: interface{}{
Blob: &storage.EncryptionServiceArgs{
Enabled: pulumi.Bool(true),
KeyType: pulumi.String("Account"),
},
File: &storage.EncryptionServiceArgs{
Enabled: pulumi.Bool(true),
KeyType: pulumi.String("Account"),
},
},
},
IsHnsEnabled: pulumi.Bool(true),
KeyPolicy: &storage.KeyPolicyArgs{
KeyExpirationPeriodInDays: pulumi.Int(20),
},
Kind: pulumi.String("Storage"),
Location: pulumi.String("eastus"),
MinimumTlsVersion: pulumi.String("TLS1_2"),
ResourceGroupName: pulumi.String("res9101"),
RoutingPreference: &storage.RoutingPreferenceArgs{
PublishInternetEndpoints: pulumi.Bool(true),
PublishMicrosoftEndpoints: pulumi.Bool(true),
RoutingChoice: pulumi.String("MicrosoftRouting"),
},
SasPolicy: &storage.SasPolicyArgs{
ExpirationAction: pulumi.String("Log"),
SasExpirationPeriod: pulumi.String("1.15:59:59"),
},
Sku: &storage.SkuArgs{
Name: pulumi.String("Standard_GRS"),
},
Tags: pulumi.StringMap{
"key1": pulumi.String("value1"),
"key2": pulumi.String("value2"),
},
})
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")
.allowBlobPublicAccess(false)
.allowSharedKeyAccess(true)
.allowedCopyScope("PrivateLink")
.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")
))
))
))
.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());
}
}
StorageAccountCreateDisallowPublicNetworkAccess
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",
PublicNetworkAccess = "Disabled",
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 main
import (
"github.com/pulumi/pulumi-azure-native-sdk/storage/v2"
"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"),
AllowBlobPublicAccess: pulumi.Bool(false),
AllowSharedKeyAccess: pulumi.Bool(true),
Encryption: storage.EncryptionResponse{
KeySource: pulumi.String("Microsoft.Storage"),
RequireInfrastructureEncryption: pulumi.Bool(false),
Services: interface{}{
Blob: &storage.EncryptionServiceArgs{
Enabled: pulumi.Bool(true),
KeyType: pulumi.String("Account"),
},
File: &storage.EncryptionServiceArgs{
Enabled: pulumi.Bool(true),
KeyType: pulumi.String("Account"),
},
},
},
ExtendedLocation: &storage.ExtendedLocationArgs{
Name: pulumi.String("losangeles001"),
Type: pulumi.String("EdgeZone"),
},
IsHnsEnabled: pulumi.Bool(true),
KeyPolicy: &storage.KeyPolicyArgs{
KeyExpirationPeriodInDays: pulumi.Int(20),
},
Kind: pulumi.String("Storage"),
Location: pulumi.String("eastus"),
MinimumTlsVersion: pulumi.String("TLS1_2"),
PublicNetworkAccess: pulumi.String("Disabled"),
ResourceGroupName: pulumi.String("res9101"),
RoutingPreference: &storage.RoutingPreferenceArgs{
PublishInternetEndpoints: pulumi.Bool(true),
PublishMicrosoftEndpoints: pulumi.Bool(true),
RoutingChoice: pulumi.String("MicrosoftRouting"),
},
SasPolicy: &storage.SasPolicyArgs{
ExpirationAction: pulumi.String("Log"),
SasExpirationPeriod: pulumi.String("1.15:59:59"),
},
Sku: &storage.SkuArgs{
Name: pulumi.String("Standard_GRS"),
},
Tags: pulumi.StringMap{
"key1": pulumi.String("value1"),
"key2": pulumi.String("value2"),
},
})
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")
.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")
.publicNetworkAccess("Disabled")
.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());
}
}
StorageAccountCreateDnsEndpointTypeToAzureDnsZone
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,
DefaultToOAuthAuthentication = false,
DnsEndpointType = "AzureDnsZone",
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,
IsSftpEnabled = 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 main
import (
"github.com/pulumi/pulumi-azure-native-sdk/storage/v2"
"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"),
AllowBlobPublicAccess: pulumi.Bool(false),
AllowSharedKeyAccess: pulumi.Bool(true),
DefaultToOAuthAuthentication: pulumi.Bool(false),
DnsEndpointType: pulumi.String("AzureDnsZone"),
Encryption: storage.EncryptionResponse{
KeySource: pulumi.String("Microsoft.Storage"),
RequireInfrastructureEncryption: pulumi.Bool(false),
Services: interface{}{
Blob: &storage.EncryptionServiceArgs{
Enabled: pulumi.Bool(true),
KeyType: pulumi.String("Account"),
},
File: &storage.EncryptionServiceArgs{
Enabled: pulumi.Bool(true),
KeyType: pulumi.String("Account"),
},
},
},
ExtendedLocation: &storage.ExtendedLocationArgs{
Name: pulumi.String("losangeles001"),
Type: pulumi.String("EdgeZone"),
},
IsHnsEnabled: pulumi.Bool(true),
IsSftpEnabled: pulumi.Bool(true),
KeyPolicy: &storage.KeyPolicyArgs{
KeyExpirationPeriodInDays: pulumi.Int(20),
},
Kind: pulumi.String("Storage"),
Location: pulumi.String("eastus"),
MinimumTlsVersion: pulumi.String("TLS1_2"),
ResourceGroupName: pulumi.String("res9101"),
RoutingPreference: &storage.RoutingPreferenceArgs{
PublishInternetEndpoints: pulumi.Bool(true),
PublishMicrosoftEndpoints: pulumi.Bool(true),
RoutingChoice: pulumi.String("MicrosoftRouting"),
},
SasPolicy: &storage.SasPolicyArgs{
ExpirationAction: pulumi.String("Log"),
SasExpirationPeriod: pulumi.String("1.15:59:59"),
},
Sku: &storage.SkuArgs{
Name: pulumi.String("Standard_GRS"),
},
Tags: pulumi.StringMap{
"key1": pulumi.String("value1"),
"key2": pulumi.String("value2"),
},
})
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")
.allowBlobPublicAccess(false)
.allowSharedKeyAccess(true)
.defaultToOAuthAuthentication(false)
.dnsEndpointType("AzureDnsZone")
.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)
.isSftpEnabled(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());
}
}
StorageAccountCreateDnsEndpointTypeToStandard
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,
DefaultToOAuthAuthentication = false,
DnsEndpointType = "Standard",
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,
IsSftpEnabled = 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 main
import (
"github.com/pulumi/pulumi-azure-native-sdk/storage/v2"
"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"),
AllowBlobPublicAccess: pulumi.Bool(false),
AllowSharedKeyAccess: pulumi.Bool(true),
DefaultToOAuthAuthentication: pulumi.Bool(false),
DnsEndpointType: pulumi.String("Standard"),
Encryption: storage.EncryptionResponse{
KeySource: pulumi.String("Microsoft.Storage"),
RequireInfrastructureEncryption: pulumi.Bool(false),
Services: interface{}{
Blob: &storage.EncryptionServiceArgs{
Enabled: pulumi.Bool(true),
KeyType: pulumi.String("Account"),
},
File: &storage.EncryptionServiceArgs{
Enabled: pulumi.Bool(true),
KeyType: pulumi.String("Account"),
},
},
},
ExtendedLocation: &storage.ExtendedLocationArgs{
Name: pulumi.String("losangeles001"),
Type: pulumi.String("EdgeZone"),
},
IsHnsEnabled: pulumi.Bool(true),
IsSftpEnabled: pulumi.Bool(true),
KeyPolicy: &storage.KeyPolicyArgs{
KeyExpirationPeriodInDays: pulumi.Int(20),
},
Kind: pulumi.String("Storage"),
Location: pulumi.String("eastus"),
MinimumTlsVersion: pulumi.String("TLS1_2"),
ResourceGroupName: pulumi.String("res9101"),
RoutingPreference: &storage.RoutingPreferenceArgs{
PublishInternetEndpoints: pulumi.Bool(true),
PublishMicrosoftEndpoints: pulumi.Bool(true),
RoutingChoice: pulumi.String("MicrosoftRouting"),
},
SasPolicy: &storage.SasPolicyArgs{
ExpirationAction: pulumi.String("Log"),
SasExpirationPeriod: pulumi.String("1.15:59:59"),
},
Sku: &storage.SkuArgs{
Name: pulumi.String("Standard_GRS"),
},
Tags: pulumi.StringMap{
"key1": pulumi.String("value1"),
"key2": pulumi.String("value2"),
},
})
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")
.allowBlobPublicAccess(false)
.allowSharedKeyAccess(true)
.defaultToOAuthAuthentication(false)
.dnsEndpointType("Standard")
.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)
.isSftpEnabled(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());
}
}
StorageAccountCreateEnablePublicNetworkAccess
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",
PublicNetworkAccess = "Enabled",
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 main
import (
"github.com/pulumi/pulumi-azure-native-sdk/storage/v2"
"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"),
AllowBlobPublicAccess: pulumi.Bool(false),
AllowSharedKeyAccess: pulumi.Bool(true),
Encryption: storage.EncryptionResponse{
KeySource: pulumi.String("Microsoft.Storage"),
RequireInfrastructureEncryption: pulumi.Bool(false),
Services: interface{}{
Blob: &storage.EncryptionServiceArgs{
Enabled: pulumi.Bool(true),
KeyType: pulumi.String("Account"),
},
File: &storage.EncryptionServiceArgs{
Enabled: pulumi.Bool(true),
KeyType: pulumi.String("Account"),
},
},
},
ExtendedLocation: &storage.ExtendedLocationArgs{
Name: pulumi.String("losangeles001"),
Type: pulumi.String("EdgeZone"),
},
IsHnsEnabled: pulumi.Bool(true),
KeyPolicy: &storage.KeyPolicyArgs{
KeyExpirationPeriodInDays: pulumi.Int(20),
},
Kind: pulumi.String("Storage"),
Location: pulumi.String("eastus"),
MinimumTlsVersion: pulumi.String("TLS1_2"),
PublicNetworkAccess: pulumi.String("Enabled"),
ResourceGroupName: pulumi.String("res9101"),
RoutingPreference: &storage.RoutingPreferenceArgs{
PublishInternetEndpoints: pulumi.Bool(true),
PublishMicrosoftEndpoints: pulumi.Bool(true),
RoutingChoice: pulumi.String("MicrosoftRouting"),
},
SasPolicy: &storage.SasPolicyArgs{
ExpirationAction: pulumi.String("Log"),
SasExpirationPeriod: pulumi.String("1.15:59:59"),
},
Sku: &storage.SkuArgs{
Name: pulumi.String("Standard_GRS"),
},
Tags: pulumi.StringMap{
"key1": pulumi.String("value1"),
"key2": pulumi.String("value2"),
},
})
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")
.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")
.publicNetworkAccess("Enabled")
.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());
}
}
StorageAccountCreatePremiumBlockBlobStorage
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",
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",
},
},
},
Kind = "BlockBlobStorage",
Location = "eastus",
MinimumTlsVersion = "TLS1_2",
ResourceGroupName = "res9101",
Sku = new AzureNative.Storage.Inputs.SkuArgs
{
Name = "Premium_LRS",
},
Tags =
{
{ "key1", "value1" },
{ "key2", "value2" },
},
});
});
package main
import (
"github.com/pulumi/pulumi-azure-native-sdk/storage/v2"
"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"),
AllowSharedKeyAccess: pulumi.Bool(true),
Encryption: storage.EncryptionResponse{
KeySource: pulumi.String("Microsoft.Storage"),
RequireInfrastructureEncryption: pulumi.Bool(false),
Services: interface{}{
Blob: &storage.EncryptionServiceArgs{
Enabled: pulumi.Bool(true),
KeyType: pulumi.String("Account"),
},
File: &storage.EncryptionServiceArgs{
Enabled: pulumi.Bool(true),
KeyType: pulumi.String("Account"),
},
},
},
Kind: pulumi.String("BlockBlobStorage"),
Location: pulumi.String("eastus"),
MinimumTlsVersion: pulumi.String("TLS1_2"),
ResourceGroupName: pulumi.String("res9101"),
Sku: &storage.SkuArgs{
Name: pulumi.String("Premium_LRS"),
},
Tags: pulumi.StringMap{
"key1": pulumi.String("value1"),
"key2": pulumi.String("value2"),
},
})
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")
.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")
))
))
))
.kind("BlockBlobStorage")
.location("eastus")
.minimumTlsVersion("TLS1_2")
.resourceGroupName("res9101")
.sku(Map.of("name", "Premium_LRS"))
.tags(Map.ofEntries(
Map.entry("key1", "value1"),
Map.entry("key2", "value2")
))
.build());
}
}
StorageAccountCreateWithImmutabilityPolicy
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",
ExtendedLocation = new AzureNative.Storage.Inputs.ExtendedLocationArgs
{
Name = "losangeles001",
Type = "EdgeZone",
},
ImmutableStorageWithVersioning = new AzureNative.Storage.Inputs.ImmutableStorageAccountArgs
{
Enabled = true,
ImmutabilityPolicy = new AzureNative.Storage.Inputs.AccountImmutabilityPolicyPropertiesArgs
{
AllowProtectedAppendWrites = true,
ImmutabilityPeriodSinceCreationInDays = 15,
State = "Unlocked",
},
},
Kind = "Storage",
Location = "eastus",
ResourceGroupName = "res9101",
Sku = new AzureNative.Storage.Inputs.SkuArgs
{
Name = "Standard_GRS",
},
});
});
package main
import (
"github.com/pulumi/pulumi-azure-native-sdk/storage/v2"
"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"),
ExtendedLocation: &storage.ExtendedLocationArgs{
Name: pulumi.String("losangeles001"),
Type: pulumi.String("EdgeZone"),
},
ImmutableStorageWithVersioning: storage.ImmutableStorageAccountResponse{
Enabled: pulumi.Bool(true),
ImmutabilityPolicy: &storage.AccountImmutabilityPolicyPropertiesArgs{
AllowProtectedAppendWrites: pulumi.Bool(true),
ImmutabilityPeriodSinceCreationInDays: pulumi.Int(15),
State: pulumi.String("Unlocked"),
},
},
Kind: pulumi.String("Storage"),
Location: pulumi.String("eastus"),
ResourceGroupName: pulumi.String("res9101"),
Sku: &storage.SkuArgs{
Name: pulumi.String("Standard_GRS"),
},
})
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")
.extendedLocation(Map.ofEntries(
Map.entry("name", "losangeles001"),
Map.entry("type", "EdgeZone")
))
.immutableStorageWithVersioning(Map.ofEntries(
Map.entry("enabled", true),
Map.entry("immutabilityPolicy", Map.ofEntries(
Map.entry("allowProtectedAppendWrites", true),
Map.entry("immutabilityPeriodSinceCreationInDays", 15),
Map.entry("state", "Unlocked")
))
))
.kind("Storage")
.location("eastus")
.resourceGroupName("res9101")
.sku(Map.of("name", "Standard_GRS"))
.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/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}
Constructors
Functions
Properties
Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed.
Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters.