github.com/erriapo/terraform@v0.6.12-0.20160203182612-0340ea72354f/website/source/docs/providers/azurerm/r/network_security_group.html.markdown (about)

     1  ---
     2  layout: "azurerm"
     3  page_title: "Azure Resource Manager: azurerm_network_security_group"
     4  sidebar_current: "docs-azurerm-resource-network-security-group"
     5  description: |-
     6    Create a network security group that contains a list of network security rules. Network security groups enable inbound or outbound traffic to be enabled or denied.
     7  ---
     8  
     9  # azurerm\_security\_group
    10  
    11  Create a network security group that contains a list of network security rules.
    12  
    13  ## Example Usage
    14  
    15  ```
    16  resource "azurerm_resource_group" "test" {
    17      name = "acceptanceTestResourceGroup1"
    18      location = "West US"
    19  }
    20  
    21  resource "azurerm_network_security_group" "test" {
    22      name = "acceptanceTestSecurityGroup1"
    23      location = "West US"
    24      resource_group_name = "${azurerm_resource_group.test.name}"
    25  
    26      security_rule {
    27      	name = "test123"
    28      	priority = 100
    29      	direction = "Inbound"
    30      	access = "Allow"
    31      	protocol = "Tcp"
    32      	source_port_range = "*"
    33      	destination_port_range = "*"
    34      	source_address_prefix = "*"
    35      	destination_address_prefix = "*"
    36      }
    37      
    38      tags {
    39          environment = "Production"
    40      }
    41  }
    42  
    43  ```
    44  
    45  ## Argument Reference
    46  
    47  The following arguments are supported:
    48  
    49  * `name` - (Required) Specifies the name of the availability set. Changing this forces a
    50      new resource to be created.
    51  
    52  * `resource_group_name` - (Required) The name of the resource group in which to
    53      create the availability set.
    54  
    55  * `location` - (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
    56  
    57  * `security_rule` - (Optional) Can be specified multiple times to define multiple
    58                                     security rules. Each `security_rule` block supports fields documented below.
    59  
    60  * `tags` - (Optional) A mapping of tags to assign to the resource. 
    61  
    62  
    63  The `security_rule` block supports:
    64  
    65  * `name` - (Required) The name of the security rule. 
    66  
    67  * `description` - (Optional) A description for this rule. Restricted to 140 characters.
    68  
    69  * `protocol` - (Required) Network protocol this rule applies to. Can be Tcp, Udp or * to match both.
    70  
    71  * `source_port_range` - (Required) Source Port or Range. Integer or range between 0 and 65535 or * to match any.
    72  
    73  * `destination_port_range` - (Required) Destination Port or Range. Integer or range between 0 and 65535 or * to match any.
    74  
    75  * `source_address_prefix` - (Required) CIDR or source IP range or * to match any IP. Tags such as ‘VirtualNetwork’, ‘AzureLoadBalancer’ and ‘Internet’ can also be used.
    76  
    77  * `destination_address_prefix` - (Required) CIDR or destination IP range or * to match any IP. Tags such as ‘VirtualNetwork’, ‘AzureLoadBalancer’ and ‘Internet’ can also be used.
    78  
    79  * `access` - (Required) Specifies whether network traffic is allowed or denied. Possible values are “Allow” and “Deny”.
    80  
    81  * `priority` - (Required) Specifies the priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.
    82  
    83  * `direction` - (Required) The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are “Inbound” and “Outbound”.
    84      
    85  
    86  ## Attributes Reference
    87  
    88  The following attributes are exported:
    89  
    90  * `id` - The Network Security Group ID.