FEATURES PRICING ABOUT DOCS LOGIN

azurerm_network_security_rule

Create a Network Security Rule.

Example Usage

resource "azurerm_resource_group" "test" {
    name = "acceptanceTestResourceGroup1"
    location = "West US"
}

resource "azurerm_network_security_group" "test" {
    name = "acceptanceTestSecurityGroup1"
    location = "West US"
    resource_group_name = "${azurerm_resource_group.test.name}"
}

resource "azurerm_network_security_rule" "test" {
	name = "test123"
    priority = 100
    direction = "Outbound"
    access = "Allow"
    protocol = "Tcp"
    source_port_range = "*"
    destination_port_range = "*"
    source_address_prefix = "*"
    destination_address_prefix = "*"
    resource_group_name = "${azurerm_resource_group.test.name}"
    network_security_group_name = "${azurerm_network_security_group.test.name}"
}

Argument Reference

The following arguments are supported:

Attributes Reference

The following attributes are exported:

Import

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

terraform import azurerm_network_security_rule.rule1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/networkSecurityGroups/mySecurityGroup/securityRules/rule1

See the source of this document at Terraform.io

REQUEST A DEMO