1. Packages
  2. Azure Classic
  3. API Docs
  4. storage
  5. AccountNetworkRules

We recommend using Azure Native.

Azure Classic v5.72.0 published on Monday, Apr 15, 2024 by Pulumi

azure.storage.AccountNetworkRules

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.72.0 published on Monday, Apr 15, 2024 by Pulumi

    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

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = new azure.core.ResourceGroup("example", {
        name: "example-resources",
        location: "West Europe",
    });
    const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
        name: "example-vnet",
        addressSpaces: ["10.0.0.0/16"],
        location: example.location,
        resourceGroupName: example.name,
    });
    const exampleSubnet = new azure.network.Subnet("example", {
        name: "example-subnet",
        resourceGroupName: example.name,
        virtualNetworkName: exampleVirtualNetwork.name,
        addressPrefixes: ["10.0.2.0/24"],
        serviceEndpoints: ["Microsoft.Storage"],
    });
    const exampleAccount = new azure.storage.Account("example", {
        name: "storageaccountname",
        resourceGroupName: example.name,
        location: example.location,
        accountTier: "Standard",
        accountReplicationType: "GRS",
        tags: {
            environment: "staging",
        },
    });
    const exampleAccountNetworkRules = new azure.storage.AccountNetworkRules("example", {
        storageAccountId: exampleAccount.id,
        defaultAction: "Allow",
        ipRules: ["127.0.0.1"],
        virtualNetworkSubnetIds: [exampleSubnet.id],
        bypasses: ["Metrics"],
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.core.ResourceGroup("example",
        name="example-resources",
        location="West Europe")
    example_virtual_network = azure.network.VirtualNetwork("example",
        name="example-vnet",
        address_spaces=["10.0.0.0/16"],
        location=example.location,
        resource_group_name=example.name)
    example_subnet = azure.network.Subnet("example",
        name="example-subnet",
        resource_group_name=example.name,
        virtual_network_name=example_virtual_network.name,
        address_prefixes=["10.0.2.0/24"],
        service_endpoints=["Microsoft.Storage"])
    example_account = azure.storage.Account("example",
        name="storageaccountname",
        resource_group_name=example.name,
        location=example.location,
        account_tier="Standard",
        account_replication_type="GRS",
        tags={
            "environment": "staging",
        })
    example_account_network_rules = azure.storage.AccountNetworkRules("example",
        storage_account_id=example_account.id,
        default_action="Allow",
        ip_rules=["127.0.0.1"],
        virtual_network_subnet_ids=[example_subnet.id],
        bypasses=["Metrics"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
    			Name:     pulumi.String("example-resources"),
    			Location: pulumi.String("West Europe"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "example", &network.VirtualNetworkArgs{
    			Name: pulumi.String("example-vnet"),
    			AddressSpaces: pulumi.StringArray{
    				pulumi.String("10.0.0.0/16"),
    			},
    			Location:          example.Location,
    			ResourceGroupName: example.Name,
    		})
    		if err != nil {
    			return err
    		}
    		exampleSubnet, err := network.NewSubnet(ctx, "example", &network.SubnetArgs{
    			Name:               pulumi.String("example-subnet"),
    			ResourceGroupName:  example.Name,
    			VirtualNetworkName: exampleVirtualNetwork.Name,
    			AddressPrefixes: pulumi.StringArray{
    				pulumi.String("10.0.2.0/24"),
    			},
    			ServiceEndpoints: pulumi.StringArray{
    				pulumi.String("Microsoft.Storage"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		exampleAccount, err := storage.NewAccount(ctx, "example", &storage.AccountArgs{
    			Name:                   pulumi.String("storageaccountname"),
    			ResourceGroupName:      example.Name,
    			Location:               example.Location,
    			AccountTier:            pulumi.String("Standard"),
    			AccountReplicationType: pulumi.String("GRS"),
    			Tags: pulumi.StringMap{
    				"environment": pulumi.String("staging"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = storage.NewAccountNetworkRules(ctx, "example", &storage.AccountNetworkRulesArgs{
    			StorageAccountId: exampleAccount.ID(),
    			DefaultAction:    pulumi.String("Allow"),
    			IpRules: pulumi.StringArray{
    				pulumi.String("127.0.0.1"),
    			},
    			VirtualNetworkSubnetIds: pulumi.StringArray{
    				exampleSubnet.ID(),
    			},
    			Bypasses: pulumi.StringArray{
    				pulumi.String("Metrics"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Azure.Core.ResourceGroup("example", new()
        {
            Name = "example-resources",
            Location = "West Europe",
        });
    
        var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("example", new()
        {
            Name = "example-vnet",
            AddressSpaces = new[]
            {
                "10.0.0.0/16",
            },
            Location = example.Location,
            ResourceGroupName = example.Name,
        });
    
        var exampleSubnet = new Azure.Network.Subnet("example", new()
        {
            Name = "example-subnet",
            ResourceGroupName = example.Name,
            VirtualNetworkName = exampleVirtualNetwork.Name,
            AddressPrefixes = new[]
            {
                "10.0.2.0/24",
            },
            ServiceEndpoints = new[]
            {
                "Microsoft.Storage",
            },
        });
    
        var exampleAccount = new Azure.Storage.Account("example", new()
        {
            Name = "storageaccountname",
            ResourceGroupName = example.Name,
            Location = example.Location,
            AccountTier = "Standard",
            AccountReplicationType = "GRS",
            Tags = 
            {
                { "environment", "staging" },
            },
        });
    
        var exampleAccountNetworkRules = new Azure.Storage.AccountNetworkRules("example", new()
        {
            StorageAccountId = exampleAccount.Id,
            DefaultAction = "Allow",
            IpRules = new[]
            {
                "127.0.0.1",
            },
            VirtualNetworkSubnetIds = new[]
            {
                exampleSubnet.Id,
            },
            Bypasses = new[]
            {
                "Metrics",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.core.ResourceGroup;
    import com.pulumi.azure.core.ResourceGroupArgs;
    import com.pulumi.azure.network.VirtualNetwork;
    import com.pulumi.azure.network.VirtualNetworkArgs;
    import com.pulumi.azure.network.Subnet;
    import com.pulumi.azure.network.SubnetArgs;
    import com.pulumi.azure.storage.Account;
    import com.pulumi.azure.storage.AccountArgs;
    import com.pulumi.azure.storage.AccountNetworkRules;
    import com.pulumi.azure.storage.AccountNetworkRulesArgs;
    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 example = new ResourceGroup("example", ResourceGroupArgs.builder()        
                .name("example-resources")
                .location("West Europe")
                .build());
    
            var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()        
                .name("example-vnet")
                .addressSpaces("10.0.0.0/16")
                .location(example.location())
                .resourceGroupName(example.name())
                .build());
    
            var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()        
                .name("example-subnet")
                .resourceGroupName(example.name())
                .virtualNetworkName(exampleVirtualNetwork.name())
                .addressPrefixes("10.0.2.0/24")
                .serviceEndpoints("Microsoft.Storage")
                .build());
    
            var exampleAccount = new Account("exampleAccount", AccountArgs.builder()        
                .name("storageaccountname")
                .resourceGroupName(example.name())
                .location(example.location())
                .accountTier("Standard")
                .accountReplicationType("GRS")
                .tags(Map.of("environment", "staging"))
                .build());
    
            var exampleAccountNetworkRules = new AccountNetworkRules("exampleAccountNetworkRules", AccountNetworkRulesArgs.builder()        
                .storageAccountId(exampleAccount.id())
                .defaultAction("Allow")
                .ipRules("127.0.0.1")
                .virtualNetworkSubnetIds(exampleSubnet.id())
                .bypasses("Metrics")
                .build());
    
        }
    }
    
    resources:
      example:
        type: azure:core:ResourceGroup
        properties:
          name: example-resources
          location: West Europe
      exampleVirtualNetwork:
        type: azure:network:VirtualNetwork
        name: example
        properties:
          name: example-vnet
          addressSpaces:
            - 10.0.0.0/16
          location: ${example.location}
          resourceGroupName: ${example.name}
      exampleSubnet:
        type: azure:network:Subnet
        name: example
        properties:
          name: example-subnet
          resourceGroupName: ${example.name}
          virtualNetworkName: ${exampleVirtualNetwork.name}
          addressPrefixes:
            - 10.0.2.0/24
          serviceEndpoints:
            - Microsoft.Storage
      exampleAccount:
        type: azure:storage:Account
        name: example
        properties:
          name: storageaccountname
          resourceGroupName: ${example.name}
          location: ${example.location}
          accountTier: Standard
          accountReplicationType: GRS
          tags:
            environment: staging
      exampleAccountNetworkRules:
        type: azure:storage:AccountNetworkRules
        name: example
        properties:
          storageAccountId: ${exampleAccount.id}
          defaultAction: Allow
          ipRules:
            - 127.0.0.1
          virtualNetworkSubnetIds:
            - ${exampleSubnet.id}
          bypasses:
            - Metrics
    

    Create AccountNetworkRules Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new AccountNetworkRules(name: string, args: AccountNetworkRulesArgs, opts?: CustomResourceOptions);
    @overload
    def AccountNetworkRules(resource_name: str,
                            args: AccountNetworkRulesInitArgs,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def AccountNetworkRules(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            default_action: Optional[str] = None,
                            storage_account_id: Optional[str] = None,
                            bypasses: Optional[Sequence[str]] = None,
                            ip_rules: Optional[Sequence[str]] = None,
                            private_link_access_rules: Optional[Sequence[AccountNetworkRulesPrivateLinkAccessRuleArgs]] = None,
                            virtual_network_subnet_ids: Optional[Sequence[str]] = None)
    func NewAccountNetworkRules(ctx *Context, name string, args AccountNetworkRulesArgs, opts ...ResourceOption) (*AccountNetworkRules, error)
    public AccountNetworkRules(string name, AccountNetworkRulesArgs args, CustomResourceOptions? opts = null)
    public AccountNetworkRules(String name, AccountNetworkRulesArgs args)
    public AccountNetworkRules(String name, AccountNetworkRulesArgs args, CustomResourceOptions options)
    
    type: azure:storage:AccountNetworkRules
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    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.
    args AccountNetworkRulesInitArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control 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.
    name String
    The unique name of the resource.
    args AccountNetworkRulesArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var accountNetworkRulesResource = new Azure.Storage.AccountNetworkRules("accountNetworkRulesResource", new()
    {
        DefaultAction = "string",
        StorageAccountId = "string",
        Bypasses = new[]
        {
            "string",
        },
        IpRules = new[]
        {
            "string",
        },
        PrivateLinkAccessRules = new[]
        {
            new Azure.Storage.Inputs.AccountNetworkRulesPrivateLinkAccessRuleArgs
            {
                EndpointResourceId = "string",
                EndpointTenantId = "string",
            },
        },
        VirtualNetworkSubnetIds = new[]
        {
            "string",
        },
    });
    
    example, err := storage.NewAccountNetworkRules(ctx, "accountNetworkRulesResource", &storage.AccountNetworkRulesArgs{
    	DefaultAction:    pulumi.String("string"),
    	StorageAccountId: pulumi.String("string"),
    	Bypasses: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	IpRules: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	PrivateLinkAccessRules: storage.AccountNetworkRulesPrivateLinkAccessRuleArray{
    		&storage.AccountNetworkRulesPrivateLinkAccessRuleArgs{
    			EndpointResourceId: pulumi.String("string"),
    			EndpointTenantId:   pulumi.String("string"),
    		},
    	},
    	VirtualNetworkSubnetIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var accountNetworkRulesResource = new AccountNetworkRules("accountNetworkRulesResource", AccountNetworkRulesArgs.builder()        
        .defaultAction("string")
        .storageAccountId("string")
        .bypasses("string")
        .ipRules("string")
        .privateLinkAccessRules(AccountNetworkRulesPrivateLinkAccessRuleArgs.builder()
            .endpointResourceId("string")
            .endpointTenantId("string")
            .build())
        .virtualNetworkSubnetIds("string")
        .build());
    
    account_network_rules_resource = azure.storage.AccountNetworkRules("accountNetworkRulesResource",
        default_action="string",
        storage_account_id="string",
        bypasses=["string"],
        ip_rules=["string"],
        private_link_access_rules=[azure.storage.AccountNetworkRulesPrivateLinkAccessRuleArgs(
            endpoint_resource_id="string",
            endpoint_tenant_id="string",
        )],
        virtual_network_subnet_ids=["string"])
    
    const accountNetworkRulesResource = new azure.storage.AccountNetworkRules("accountNetworkRulesResource", {
        defaultAction: "string",
        storageAccountId: "string",
        bypasses: ["string"],
        ipRules: ["string"],
        privateLinkAccessRules: [{
            endpointResourceId: "string",
            endpointTenantId: "string",
        }],
        virtualNetworkSubnetIds: ["string"],
    });
    
    type: azure:storage:AccountNetworkRules
    properties:
        bypasses:
            - string
        defaultAction: string
        ipRules:
            - string
        privateLinkAccessRules:
            - endpointResourceId: string
              endpointTenantId: string
        storageAccountId: string
        virtualNetworkSubnetIds:
            - string
    

    AccountNetworkRules Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts 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.
    StorageAccountId string
    Specifies the ID of the storage account. Changing this forces a new resource to be created.
    Bypasses List<string>

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

    NOTE User has to explicitly set bypass to empty slice ([]) to remove it.

    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.

    NOTE Small address ranges using "/31" or "/32" prefix sizes are not supported. These ranges should be configured using individual IP address rules without prefix specified.

    NOTE IP network rules have no effect on requests originating from the same Azure region as the storage account. Use Virtual network rules to allow same-region requests. Services deployed in the same region as the storage account use private Azure IP addresses for communication. Thus, you cannot restrict access to specific Azure services based on their public outbound IP address range.

    NOTE User has to explicitly set ip_rules to empty slice ([]) to remove it.

    PrivateLinkAccessRules List<AccountNetworkRulesPrivateLinkAccessRule>
    One or more private_link_access block as defined below.
    VirtualNetworkSubnetIds List<string>

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

    NOTE User has to explicitly set virtual_network_subnet_ids to empty slice ([]) to remove it.

    DefaultAction string
    Specifies the default action of allow or deny when no other rules match. Valid options are Deny or Allow.
    StorageAccountId string
    Specifies the ID of the storage account. Changing this forces a new resource to be created.
    Bypasses []string

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

    NOTE User has to explicitly set bypass to empty slice ([]) to remove it.

    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.

    NOTE Small address ranges using "/31" or "/32" prefix sizes are not supported. These ranges should be configured using individual IP address rules without prefix specified.

    NOTE IP network rules have no effect on requests originating from the same Azure region as the storage account. Use Virtual network rules to allow same-region requests. Services deployed in the same region as the storage account use private Azure IP addresses for communication. Thus, you cannot restrict access to specific Azure services based on their public outbound IP address range.

    NOTE User has to explicitly set ip_rules to empty slice ([]) to remove it.

    PrivateLinkAccessRules []AccountNetworkRulesPrivateLinkAccessRuleArgs
    One or more private_link_access block as defined below.
    VirtualNetworkSubnetIds []string

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

    NOTE User has to explicitly set virtual_network_subnet_ids to empty slice ([]) to remove it.

    defaultAction String
    Specifies the default action of allow or deny when no other rules match. Valid options are Deny or Allow.
    storageAccountId String
    Specifies the ID of the storage account. Changing this forces a new resource to be created.
    bypasses List<String>

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

    NOTE User has to explicitly set bypass to empty slice ([]) to remove it.

    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.

    NOTE Small address ranges using "/31" or "/32" prefix sizes are not supported. These ranges should be configured using individual IP address rules without prefix specified.

    NOTE IP network rules have no effect on requests originating from the same Azure region as the storage account. Use Virtual network rules to allow same-region requests. Services deployed in the same region as the storage account use private Azure IP addresses for communication. Thus, you cannot restrict access to specific Azure services based on their public outbound IP address range.

    NOTE User has to explicitly set ip_rules to empty slice ([]) to remove it.

    privateLinkAccessRules List<AccountNetworkRulesPrivateLinkAccessRule>
    One or more private_link_access block as defined below.
    virtualNetworkSubnetIds List<String>

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

    NOTE User has to explicitly set virtual_network_subnet_ids to empty slice ([]) to remove it.

    defaultAction string
    Specifies the default action of allow or deny when no other rules match. Valid options are Deny or Allow.
    storageAccountId string
    Specifies the ID of the storage account. Changing this forces a new resource to be created.
    bypasses string[]

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

    NOTE User has to explicitly set bypass to empty slice ([]) to remove it.

    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.

    NOTE Small address ranges using "/31" or "/32" prefix sizes are not supported. These ranges should be configured using individual IP address rules without prefix specified.

    NOTE IP network rules have no effect on requests originating from the same Azure region as the storage account. Use Virtual network rules to allow same-region requests. Services deployed in the same region as the storage account use private Azure IP addresses for communication. Thus, you cannot restrict access to specific Azure services based on their public outbound IP address range.

    NOTE User has to explicitly set ip_rules to empty slice ([]) to remove it.

    privateLinkAccessRules AccountNetworkRulesPrivateLinkAccessRule[]
    One or more private_link_access block as defined below.
    virtualNetworkSubnetIds string[]

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

    NOTE User has to explicitly set virtual_network_subnet_ids to empty slice ([]) to remove it.

    default_action str
    Specifies the default action of allow or deny when no other rules match. Valid options are Deny or Allow.
    storage_account_id str
    Specifies the ID of the storage account. Changing this forces a new resource to be created.
    bypasses Sequence[str]

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

    NOTE User has to explicitly set bypass to empty slice ([]) to remove it.

    ip_rules Sequence[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.

    NOTE Small address ranges using "/31" or "/32" prefix sizes are not supported. These ranges should be configured using individual IP address rules without prefix specified.

    NOTE IP network rules have no effect on requests originating from the same Azure region as the storage account. Use Virtual network rules to allow same-region requests. Services deployed in the same region as the storage account use private Azure IP addresses for communication. Thus, you cannot restrict access to specific Azure services based on their public outbound IP address range.

    NOTE User has to explicitly set ip_rules to empty slice ([]) to remove it.

    private_link_access_rules Sequence[AccountNetworkRulesPrivateLinkAccessRuleArgs]
    One or more private_link_access block as defined below.
    virtual_network_subnet_ids Sequence[str]

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

    NOTE User has to explicitly set virtual_network_subnet_ids to empty slice ([]) to remove it.

    defaultAction String
    Specifies the default action of allow or deny when no other rules match. Valid options are Deny or Allow.
    storageAccountId String
    Specifies the ID of the storage account. Changing this forces a new resource to be created.
    bypasses List<String>

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

    NOTE User has to explicitly set bypass to empty slice ([]) to remove it.

    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.

    NOTE Small address ranges using "/31" or "/32" prefix sizes are not supported. These ranges should be configured using individual IP address rules without prefix specified.

    NOTE IP network rules have no effect on requests originating from the same Azure region as the storage account. Use Virtual network rules to allow same-region requests. Services deployed in the same region as the storage account use private Azure IP addresses for communication. Thus, you cannot restrict access to specific Azure services based on their public outbound IP address range.

    NOTE User has to explicitly set ip_rules to empty slice ([]) to remove it.

    privateLinkAccessRules List<Property Map>
    One or more private_link_access block as defined below.
    virtualNetworkSubnetIds List<String>

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

    NOTE User has to explicitly set virtual_network_subnet_ids to empty slice ([]) to remove it.

    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 string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up 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): AccountNetworkRules
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            bypasses: Optional[Sequence[str]] = None,
            default_action: Optional[str] = None,
            ip_rules: Optional[Sequence[str]] = None,
            private_link_access_rules: Optional[Sequence[AccountNetworkRulesPrivateLinkAccessRuleArgs]] = None,
            storage_account_id: Optional[str] = None,
            virtual_network_subnet_ids: Optional[Sequence[str]] = None) -> AccountNetworkRules
    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)
    public static AccountNetworkRules get(String name, Output<String> id, AccountNetworkRulesState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    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.

    NOTE User has to explicitly set bypass to empty slice ([]) to remove it.

    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.

    NOTE Small address ranges using "/31" or "/32" prefix sizes are not supported. These ranges should be configured using individual IP address rules without prefix specified.

    NOTE IP network rules have no effect on requests originating from the same Azure region as the storage account. Use Virtual network rules to allow same-region requests. Services deployed in the same region as the storage account use private Azure IP addresses for communication. Thus, you cannot restrict access to specific Azure services based on their public outbound IP address range.

    NOTE User has to explicitly set ip_rules to empty slice ([]) to remove it.

    PrivateLinkAccessRules List<AccountNetworkRulesPrivateLinkAccessRule>
    One or more private_link_access block as defined below.
    StorageAccountId string
    Specifies the ID of the storage account. Changing this forces a new resource to be created.
    VirtualNetworkSubnetIds List<string>

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

    NOTE User has to explicitly set virtual_network_subnet_ids to empty slice ([]) to remove it.

    Bypasses []string

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

    NOTE User has to explicitly set bypass to empty slice ([]) to remove it.

    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.

    NOTE Small address ranges using "/31" or "/32" prefix sizes are not supported. These ranges should be configured using individual IP address rules without prefix specified.

    NOTE IP network rules have no effect on requests originating from the same Azure region as the storage account. Use Virtual network rules to allow same-region requests. Services deployed in the same region as the storage account use private Azure IP addresses for communication. Thus, you cannot restrict access to specific Azure services based on their public outbound IP address range.

    NOTE User has to explicitly set ip_rules to empty slice ([]) to remove it.

    PrivateLinkAccessRules []AccountNetworkRulesPrivateLinkAccessRuleArgs
    One or more private_link_access block as defined below.
    StorageAccountId string
    Specifies the ID of the storage account. Changing this forces a new resource to be created.
    VirtualNetworkSubnetIds []string

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

    NOTE User has to explicitly set virtual_network_subnet_ids to empty slice ([]) to remove it.

    bypasses List<String>

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

    NOTE User has to explicitly set bypass to empty slice ([]) to remove it.

    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.

    NOTE Small address ranges using "/31" or "/32" prefix sizes are not supported. These ranges should be configured using individual IP address rules without prefix specified.

    NOTE IP network rules have no effect on requests originating from the same Azure region as the storage account. Use Virtual network rules to allow same-region requests. Services deployed in the same region as the storage account use private Azure IP addresses for communication. Thus, you cannot restrict access to specific Azure services based on their public outbound IP address range.

    NOTE User has to explicitly set ip_rules to empty slice ([]) to remove it.

    privateLinkAccessRules List<AccountNetworkRulesPrivateLinkAccessRule>
    One or more private_link_access block as defined below.
    storageAccountId String
    Specifies the ID of the storage account. Changing this forces a new resource to be created.
    virtualNetworkSubnetIds List<String>

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

    NOTE User has to explicitly set virtual_network_subnet_ids to empty slice ([]) to remove it.

    bypasses string[]

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

    NOTE User has to explicitly set bypass to empty slice ([]) to remove it.

    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.

    NOTE Small address ranges using "/31" or "/32" prefix sizes are not supported. These ranges should be configured using individual IP address rules without prefix specified.

    NOTE IP network rules have no effect on requests originating from the same Azure region as the storage account. Use Virtual network rules to allow same-region requests. Services deployed in the same region as the storage account use private Azure IP addresses for communication. Thus, you cannot restrict access to specific Azure services based on their public outbound IP address range.

    NOTE User has to explicitly set ip_rules to empty slice ([]) to remove it.

    privateLinkAccessRules AccountNetworkRulesPrivateLinkAccessRule[]
    One or more private_link_access block as defined below.
    storageAccountId string
    Specifies the ID of the storage account. Changing this forces a new resource to be created.
    virtualNetworkSubnetIds string[]

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

    NOTE User has to explicitly set virtual_network_subnet_ids to empty slice ([]) to remove it.

    bypasses Sequence[str]

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

    NOTE User has to explicitly set bypass to empty slice ([]) to remove it.

    default_action str
    Specifies the default action of allow or deny when no other rules match. Valid options are Deny or Allow.
    ip_rules Sequence[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.

    NOTE Small address ranges using "/31" or "/32" prefix sizes are not supported. These ranges should be configured using individual IP address rules without prefix specified.

    NOTE IP network rules have no effect on requests originating from the same Azure region as the storage account. Use Virtual network rules to allow same-region requests. Services deployed in the same region as the storage account use private Azure IP addresses for communication. Thus, you cannot restrict access to specific Azure services based on their public outbound IP address range.

    NOTE User has to explicitly set ip_rules to empty slice ([]) to remove it.

    private_link_access_rules Sequence[AccountNetworkRulesPrivateLinkAccessRuleArgs]
    One or more private_link_access block as defined below.
    storage_account_id str
    Specifies the ID of the storage account. Changing this forces a new resource to be created.
    virtual_network_subnet_ids Sequence[str]

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

    NOTE User has to explicitly set virtual_network_subnet_ids to empty slice ([]) to remove it.

    bypasses List<String>

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

    NOTE User has to explicitly set bypass to empty slice ([]) to remove it.

    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.

    NOTE Small address ranges using "/31" or "/32" prefix sizes are not supported. These ranges should be configured using individual IP address rules without prefix specified.

    NOTE IP network rules have no effect on requests originating from the same Azure region as the storage account. Use Virtual network rules to allow same-region requests. Services deployed in the same region as the storage account use private Azure IP addresses for communication. Thus, you cannot restrict access to specific Azure services based on their public outbound IP address range.

    NOTE User has to explicitly set ip_rules to empty slice ([]) to remove it.

    privateLinkAccessRules List<Property Map>
    One or more private_link_access block as defined below.
    storageAccountId String
    Specifies the ID of the storage account. Changing this forces a new resource to be created.
    virtualNetworkSubnetIds List<String>

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

    NOTE User has to explicitly set virtual_network_subnet_ids to empty slice ([]) to remove it.

    Supporting Types

    AccountNetworkRulesPrivateLinkAccessRule, AccountNetworkRulesPrivateLinkAccessRuleArgs

    EndpointResourceId string
    The resource id of the resource access rule to be granted access.
    EndpointTenantId string
    The tenant id of the resource of the resource access rule to be granted access. Defaults to the current tenant id.
    EndpointResourceId string
    The resource id of the resource access rule to be granted access.
    EndpointTenantId string
    The tenant id of the resource of the resource access rule to be granted access. Defaults to the current tenant id.
    endpointResourceId String
    The resource id of the resource access rule to be granted access.
    endpointTenantId String
    The tenant id of the resource of the resource access rule to be granted access. Defaults to the current tenant id.
    endpointResourceId string
    The resource id of the resource access rule to be granted access.
    endpointTenantId string
    The tenant id of the resource of the resource access rule to be granted access. Defaults to the current tenant id.
    endpoint_resource_id str
    The resource id of the resource access rule to be granted access.
    endpoint_tenant_id str
    The tenant id of the resource of the resource access rule to be granted access. Defaults to the current tenant id.
    endpointResourceId String
    The resource id of the resource access rule to be granted access.
    endpointTenantId String
    The tenant id of the resource of the resource access rule to be granted access. Defaults to the current tenant id.

    Import

    Storage Account Network Rules can be imported using the resource id, e.g.

    $ pulumi import azure:storage/accountNetworkRules:AccountNetworkRules storageAcc1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Storage/storageAccounts/myaccount
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure Classic v5.72.0 published on Monday, Apr 15, 2024 by Pulumi