github.com/atsaki/terraform@v0.4.3-0.20150919165407-25bba5967654/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" "apps" {
    21      ...
    22  }
    23  
    24  resource "azure_security_group_rule" "ssh_access" {
    25      name = "ssh-access-rule"
    26      security_group_names = ["${azure_security_group.web.name}", "${azure_security_group.apps.name}"]
    27      type = "Inbound"
    28      action = "Allow"
    29      priority = 200
    30      source_address_prefix = "100.0.0.0/32"
    31      source_port_range = "*"
    32      destination_address_prefix = "10.0.0.0/32"
    33      destination_port_range = "22"
    34      protocol = "TCP"
    35  }
    36  ```
    37  
    38  ## Argument Reference
    39  
    40  The following arguments are supported:
    41  * `name` - (Required) The name of the security group rule.
    42  
    43  * `security_group_names` - (Required) A list of the names of the security groups
    44      the rule should be applied to.
    45      Changing this list forces the creation of a new resource.
    46  
    47  * `type` - (Required) The type of the security rule. Valid options are:
    48      `Inbound` and `Outbound`.
    49  
    50  * `priority` - (Required) The priority of the network security rule. Rules with
    51      lower priority are evaluated first. This value can be between 100 and 4096.
    52  
    53  * `action` - (Optional) The action that is performed when the security rule is
    54      matched. Valid options are: `Allow` and `Deny`.
    55  
    56  * `source_address_prefix` - (Required) The address prefix of packet sources that
    57      that should be subjected to the rule. An asterisk (\*) can also be used to
    58      match all source IPs.
    59  
    60  * `source_port_range` - (Required) The source port or range. This value can be
    61      between 0 and 65535. An asterisk (\*) can also be used to match all ports.
    62  
    63  * `destination_address_prefix` - (Required) The address prefix of packet
    64      destinations that should be subjected to the rule. An asterisk
    65      (\*) can also be used to match all destination IPs.
    66  
    67  * `destination_port_range` - (Required) The destination port or range. This value
    68      can be between 0 and 65535. An asterisk (\*) can also be used to match all
    69      ports.
    70  
    71  * `protocol` - (Optional) The protocol of the security rule. Valid options are:
    72      `TCP`, `UDP` and `*`.
    73  
    74  The following attributes are exported:
    75  
    76  * `id` - The security group rule ID. Coincides with its given `name`.