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",
},
});
}
}
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
new AccountNetworkRules(name: string, args: AccountNetworkRulesArgs, opts?: CustomResourceOptions);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);func NewAccountNetworkRules(ctx *Context, name string, args AccountNetworkRulesArgs, opts ...ResourceOption) (*AccountNetworkRules, error)public AccountNetworkRules(string name, AccountNetworkRulesArgs args, CustomResourceOptions? opts = null)- 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:
- Default
Action string Specifies the default action of allow or deny when no other rules match. Valid options are
DenyorAllow.- Resource
Group stringName The name of the resource group in which to create the storage account. Changing this forces a new resource to be created.
- Storage
Account stringName 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, orNone.- Ip
Rules 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.
- Virtual
Network List<string>Subnet Ids A list of virtual network subnet ids to to secure the storage account.
- Default
Action string Specifies the default action of allow or deny when no other rules match. Valid options are
DenyorAllow.- Resource
Group stringName The name of the resource group in which to create the storage account. Changing this forces a new resource to be created.
- Storage
Account stringName 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, orNone.- Ip
Rules []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.
- Virtual
Network []stringSubnet Ids A list of virtual network subnet ids to to secure the storage account.
- default
Action string Specifies the default action of allow or deny when no other rules match. Valid options are
DenyorAllow.- resource
Group stringName The name of the resource group in which to create the storage account. Changing this forces a new resource to be created.
- storage
Account stringName 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, orNone.- ip
Rules 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.
- virtual
Network string[]Subnet Ids 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
DenyorAllow.- resource_
group_ strname The name of the resource group in which to create the storage account. Changing this forces a new resource to be created.
- storage_
account_ strname 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, orNone.- 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_ List[str]subnet_ ids 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:
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.
public static get(name: string, id: Input<ID>, state?: AccountNetworkRulesState, opts?: CustomResourceOptions): AccountNetworkRulesstatic 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)public static AccountNetworkRules Get(string name, Input<string> id, AccountNetworkRulesState? state, CustomResourceOptions? opts = null)- 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, orNone.- Default
Action string Specifies the default action of allow or deny when no other rules match. Valid options are
DenyorAllow.- Ip
Rules 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.
- Resource
Group stringName The name of the resource group in which to create the storage account. Changing this forces a new resource to be created.
- Storage
Account stringName 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 List<string>Subnet Ids 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, orNone.- Default
Action string Specifies the default action of allow or deny when no other rules match. Valid options are
DenyorAllow.- Ip
Rules []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.
- Resource
Group stringName The name of the resource group in which to create the storage account. Changing this forces a new resource to be created.
- Storage
Account stringName 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 []stringSubnet Ids 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, orNone.- default
Action string Specifies the default action of allow or deny when no other rules match. Valid options are
DenyorAllow.- ip
Rules 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.
- resource
Group stringName The name of the resource group in which to create the storage account. Changing this forces a new resource to be created.
- storage
Account stringName 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 string[]Subnet Ids 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, orNone.- default_
action str Specifies the default action of allow or deny when no other rules match. Valid options are
DenyorAllow.- 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_ strname The name of the resource group in which to create the storage account. Changing this forces a new resource to be created.
- storage_
account_ strname 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_ List[str]subnet_ ids 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
azurermTerraform Provider.