Class AccountNetworkRules
Manages network rules inside of a Azure Storage Account.
NOTE: Network Rules can be defined either directly on the
azure.storage.Accountresource, or using theazure.storage.AccountNetworkRulesresource - but the two cannot be used together. Spurious changes will occur if both are used against the same Storage Account.
NOTE: Only one
azure.storage.AccountNetworkRulescan be tied to anazure.storage.Account. Spurious changes will occur if more thanazure.storage.AccountNetworkRulesis tied to the sameazure.storage.Account.
NOTE: Deleting this resource updates the storage account back to the default values it had when the storage account was created.
Example Usage
using Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
{
Location = "West Europe",
});
var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new Azure.Network.VirtualNetworkArgs
{
AddressSpaces =
{
"10.0.0.0/16",
},
Location = exampleResourceGroup.Location,
ResourceGroupName = exampleResourceGroup.Name,
});
var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new Azure.Network.SubnetArgs
{
ResourceGroupName = exampleResourceGroup.Name,
VirtualNetworkName = exampleVirtualNetwork.Name,
AddressPrefix = "10.0.2.0/24",
ServiceEndpoints =
{
"Microsoft.Storage",
},
});
var exampleAccount = new Azure.Storage.Account("exampleAccount", new Azure.Storage.AccountArgs
{
ResourceGroupName = exampleResourceGroup.Name,
Location = exampleResourceGroup.Location,
AccountTier = "Standard",
AccountReplicationType = "GRS",
Tags =
{
{ "environment", "staging" },
},
});
var test = new Azure.Storage.AccountNetworkRules("test", new Azure.Storage.AccountNetworkRulesArgs
{
ResourceGroupName = azurerm_resource_group.Test.Name,
StorageAccountName = azurerm_storage_account.Test.Name,
DefaultAction = "Allow",
IpRules =
{
"127.0.0.1",
},
VirtualNetworkSubnetIds =
{
azurerm_subnet.Test.Id,
},
Bypasses =
{
"Metrics",
},
});
}
}
Inherited Members
Namespace: Pulumi.Azure.Storage
Assembly: Pulumi.Azure.dll
Syntax
public class AccountNetworkRules : CustomResource
Constructors
View SourceAccountNetworkRules(String, AccountNetworkRulesArgs, CustomResourceOptions)
Create a AccountNetworkRules resource with the given unique name, arguments, and options.
Declaration
public AccountNetworkRules(string name, AccountNetworkRulesArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| AccountNetworkRulesArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceBypasses
Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Valid options are any combination of Logging, Metrics, AzureServices, or None.
Declaration
public Output<ImmutableArray<string>> Bypasses { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
DefaultAction
Specifies the default action of allow or deny when no other rules match. Valid options are Deny or Allow.
Declaration
public Output<string> DefaultAction { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
IpRules
List of public IP or IP ranges in CIDR Format. Only IPV4 addresses are allowed. Private IP address ranges (as defined in RFC 1918) are not allowed.
Declaration
public Output<ImmutableArray<string>> IpRules { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
ResourceGroupName
The name of the resource group in which to create the storage account. Changing this forces a new resource to be created.
Declaration
public Output<string> ResourceGroupName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
StorageAccountName
Specifies the name of the storage account. Changing this forces a new resource to be created. This must be unique across the entire Azure service, not just within the resource group.
Declaration
public Output<string> StorageAccountName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
VirtualNetworkSubnetIds
A list of virtual network subnet ids to to secure the storage account.
Declaration
public Output<ImmutableArray<string>> VirtualNetworkSubnetIds { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Methods
View SourceGet(String, Input<String>, AccountNetworkRulesState, CustomResourceOptions)
Get an existing AccountNetworkRules resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static AccountNetworkRules Get(string name, Input<string> id, AccountNetworkRulesState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| AccountNetworkRulesState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| AccountNetworkRules |