github.com/hobbeswalsh/terraform@v0.3.7-0.20150619183303-ad17cf55a0fa/website/source/docs/providers/azure/r/security_group_rule.html.markdown (about) 1 --- 2 layout: "azure" 3 page_title: "Azure: azure_security_group_rule" 4 sidebar_current: "docs-azure-resource-security-group-rule" 5 description: |- 6 Creates a new network security rule to be associated with a given security group. 7 --- 8 9 # azure\_security\_group\_rule 10 11 Creates a new network security rule to be associated with a given security group. 12 13 ## Example Usage 14 15 ``` 16 resource "azure_security_group" "web" { 17 ... 18 } 19 20 resource "azure_security_group_rule" "ssh_access" { 21 name = "ssh-access-rule" 22 security_group_name = "${azure_security_group.web.name}" 23 type = "Inbound" 24 action = "Allow" 25 priority = 200 26 source_address_prefix = "100.0.0.0/32" 27 source_port_range = "*" 28 destination_address_prefix = "10.0.0.0/32" 29 destination_port_range = "22" 30 protocol = "TCP" 31 } 32 ``` 33 34 ## Argument Reference 35 36 The following arguments are supported: 37 * `name` - (Required) The name of the security group the rule should be 38 applied to. 39 40 * `security_group_name` - (Required) The name of the security group m 41 42 * `type` - (Required) The type of the security rule. Valid options are: 43 `Inbound` and `Outbound`. 44 45 * `priority` - (Required) The priority of the network security rule. Rules with 46 lower priority are evaluated first. This value can be between 100 and 4096. 47 48 * `action` - (Optional) The action that is performed when the security rule is 49 matched. Valid options are: `Allow` and `Deny`. 50 51 * `source_address_prefix` - (Required) The address prefix of packet sources that 52 that should be subjected to the rule. An asterisk (\*) can also be used to 53 match all source IPs. 54 55 * `source_port_range` - (Required) The source port or range. This value can be 56 between 0 and 65535. An asterisk (\*) can also be used to match all ports. 57 58 * `destination_address_prefix` - (Required) The address prefix of packet 59 destinations that should be subjected to the rule. An asterisk 60 (\*) can also be used to match all destination IPs. 61 62 * `destination_port_range` - (Required) The destination port or range. This value 63 can be between 0 and 65535. An asterisk (\*) can also be used to match all 64 ports. 65 66 * `protocol` - (Optional) The protocol of the security rule. Valid options are: 67 `TCP`, `UDP` and `*`. 68 69 The following attributes are exported: 70 71 * `id` - The security group rule ID. Coincides with its given `name`.