AccountNetworkRules

Manages network rules inside of a Azure Storage Account.

NOTE: Network Rules can be defined either directly on the azure.storage.Account resource, or using the azure.storage.AccountNetworkRules resource - 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.AccountNetworkRules can be tied to an azure.storage.Account. Spurious changes will occur if more than azure.storage.AccountNetworkRules is tied to the same azure.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",
            },
        });
    }

}

Coming soon!

import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork",
    address_spaces=["10.0.0.0/16"],
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name)
example_subnet = azure.network.Subnet("exampleSubnet",
    resource_group_name=example_resource_group.name,
    virtual_network_name=example_virtual_network.name,
    address_prefix="10.0.2.0/24",
    service_endpoints=["Microsoft.Storage"])
example_account = azure.storage.Account("exampleAccount",
    resource_group_name=example_resource_group.name,
    location=example_resource_group.location,
    account_tier="Standard",
    account_replication_type="GRS",
    tags={
        "environment": "staging",
    })
test = azure.storage.AccountNetworkRules("test",
    resource_group_name=azurerm_resource_group["test"]["name"],
    storage_account_name=azurerm_storage_account["test"]["name"],
    default_action="Allow",
    ip_rules=["127.0.0.1"],
    virtual_network_subnet_ids=[azurerm_subnet["test"]["id"]],
    bypasses=["Metrics"])
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", {
    addressSpaces: ["10.0.0.0/16"],
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
});
const exampleSubnet = new azure.network.Subnet("exampleSubnet", {
    resourceGroupName: exampleResourceGroup.name,
    virtualNetworkName: exampleVirtualNetwork.name,
    addressPrefix: "10.0.2.0/24",
    serviceEndpoints: ["Microsoft.Storage"],
});
const exampleAccount = new azure.storage.Account("exampleAccount", {
    resourceGroupName: exampleResourceGroup.name,
    location: exampleResourceGroup.location,
    accountTier: "Standard",
    accountReplicationType: "GRS",
    tags: {
        environment: "staging",
    },
});
const test = new azure.storage.AccountNetworkRules("test", {
    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"],
});

Create a AccountNetworkRules Resource

def AccountNetworkRules(resource_name, opts=None, bypasses=None, default_action=None, ip_rules=None, resource_group_name=None, storage_account_name=None, virtual_network_subnet_ids=None, __props__=None);
name string
The unique name of the resource.
args AccountNetworkRulesArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args AccountNetworkRulesArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args AccountNetworkRulesArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

AccountNetworkRules Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The AccountNetworkRules resource accepts the following input properties:

DefaultAction string

Specifies the default action of allow or deny when no other rules match. Valid options are Deny or Allow.

ResourceGroupName string

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

StorageAccountName string

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.

Bypasses List<string>

Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Valid options are any combination of Logging, Metrics, AzureServices, or None.

IpRules List<string>

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.

VirtualNetworkSubnetIds List<string>

A list of virtual network subnet ids to to secure the storage account.

DefaultAction string

Specifies the default action of allow or deny when no other rules match. Valid options are Deny or Allow.

ResourceGroupName string

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

StorageAccountName string

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.

Bypasses []string

Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Valid options are any combination of Logging, Metrics, AzureServices, or None.

IpRules []string

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.

VirtualNetworkSubnetIds []string

A list of virtual network subnet ids to to secure the storage account.

defaultAction string

Specifies the default action of allow or deny when no other rules match. Valid options are Deny or Allow.

resourceGroupName string

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

storageAccountName string

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.

bypasses string[]

Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Valid options are any combination of Logging, Metrics, AzureServices, or None.

ipRules string[]

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.

virtualNetworkSubnetIds string[]

A list of virtual network subnet ids to to secure the storage account.

default_action str

Specifies the default action of allow or deny when no other rules match. Valid options are Deny or Allow.

resource_group_name str

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

storage_account_name str

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.

bypasses List[str]

Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Valid options are any combination of Logging, Metrics, AzureServices, or None.

ip_rules List[str]

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.

virtual_network_subnet_ids List[str]

A list of virtual network subnet ids to to secure the storage account.

Outputs

All input properties are implicitly available as output properties. Additionally, the AccountNetworkRules resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing AccountNetworkRules Resource

Get an existing AccountNetworkRules resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

static get(resource_name, id, opts=None, bypasses=None, default_action=None, ip_rules=None, resource_group_name=None, storage_account_name=None, virtual_network_subnet_ids=None, __props__=None);
func GetAccountNetworkRules(ctx *Context, name string, id IDInput, state *AccountNetworkRulesState, opts ...ResourceOption) (*AccountNetworkRules, error)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Bypasses List<string>

Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Valid options are any combination of Logging, Metrics, AzureServices, or None.

DefaultAction string

Specifies the default action of allow or deny when no other rules match. Valid options are Deny or Allow.

IpRules List<string>

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.

ResourceGroupName string

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

StorageAccountName string

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.

VirtualNetworkSubnetIds List<string>

A list of virtual network subnet ids to to secure the storage account.

Bypasses []string

Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Valid options are any combination of Logging, Metrics, AzureServices, or None.

DefaultAction string

Specifies the default action of allow or deny when no other rules match. Valid options are Deny or Allow.

IpRules []string

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.

ResourceGroupName string

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

StorageAccountName string

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.

VirtualNetworkSubnetIds []string

A list of virtual network subnet ids to to secure the storage account.

bypasses string[]

Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Valid options are any combination of Logging, Metrics, AzureServices, or None.

defaultAction string

Specifies the default action of allow or deny when no other rules match. Valid options are Deny or Allow.

ipRules string[]

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.

resourceGroupName string

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

storageAccountName string

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.

virtualNetworkSubnetIds string[]

A list of virtual network subnet ids to to secure the storage account.

bypasses List[str]

Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Valid options are any combination of Logging, Metrics, AzureServices, or None.

default_action str

Specifies the default action of allow or deny when no other rules match. Valid options are Deny or Allow.

ip_rules List[str]

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.

resource_group_name str

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

storage_account_name str

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.

virtual_network_subnet_ids List[str]

A list of virtual network subnet ids to to secure the storage account.

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.