github.com/chalford/terraform@v0.3.7-0.20150113080010-a78c69a8c81f/website/source/docs/providers/cloudstack/r/firewall.html.markdown (about)

     1  ---
     2  layout: "cloudstack"
     3  page_title: "CloudStack: cloudstack_firewall"
     4  sidebar_current: "docs-cloudstack-resource-firewall"
     5  description: |-
     6    Creates firewall rules for a given IP address.
     7  ---
     8  
     9  # cloudstack\_firewall
    10  
    11  Creates firewall rules for a given IP address.
    12  
    13  ## Example Usage
    14  
    15  ```
    16  resource "cloudstack_firewall" "default" {
    17    ipaddress = "192.168.0.1"
    18  
    19    rule {
    20      source_cidr = "10.0.0.0/8"
    21      protocol = "tcp"
    22      ports = ["80", "1000-2000"]
    23    }
    24  }
    25  ```
    26  
    27  ## Argument Reference
    28  
    29  The following arguments are supported:
    30  
    31  * `ipaddress` - (Required) The IP address for which to create the firewall rules.
    32      Changing this forces a new resource to be created.
    33  
    34  * `rule` - (Required) Can be specified multiple times. Each rule block supports
    35      fields documented below.
    36  
    37  The `rule` block supports:
    38  
    39  * `source_cidr` - (Required) The source CIDR to allow access to the given ports.
    40  
    41  * `protocol` - (Required) The name of the protocol to allow. Valid options are:
    42      `tcp`, `udp` and `icmp`.
    43  
    44  * `icmp_type` - (Optional) The ICMP type to allow. This can only be specified if
    45      the protocol is ICMP.
    46  
    47  * `icmp_code` - (Optional) The ICMP code to allow. This can only be specified if
    48      the protocol is ICMP.
    49  
    50  * `ports` - (Optional) List of ports and/or port ranges to allow. This can only
    51      be specified if the protocol is TCP or UDP.
    52  
    53  ## Attributes Reference
    54  
    55  The following attributes are exported:
    56  
    57  * `ipaddress` - The IP address for which the firewall rules are created.