github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/website/source/docs/providers/vcd/r/firewall_rules.html.markdown (about) 1 --- 2 layout: "vcd" 3 page_title: "vCloudDirector: vcd_firewall_rules" 4 sidebar_current: "docs-vcd-resource-firewall-rules" 5 description: |- 6 Provides a vCloud Director Firewall resource. This can be used to create, modify, and delete firewall settings and rules. 7 --- 8 9 # vcd\_firewall\_rules 10 11 Provides a vCloud Director Firewall resource. This can be used to create, 12 modify, and delete firewall settings and rules. 13 14 ## Example Usage 15 16 ``` 17 resource "vcd_firewall_rules" "fw" { 18 edge_gateway = "Edge Gateway Name" 19 default_action = "drop" 20 21 rule { 22 description = "deny-ftp-out" 23 policy = "deny" 24 protocol = "tcp" 25 destination_port = "21" 26 destination_ip = "any" 27 source_port = "any" 28 source_ip = "10.10.0.0/24" 29 } 30 31 rule { 32 description = "allow-outbound" 33 policy = "allow" 34 protocol = "any" 35 destination_port = "any" 36 destination_ip = "any" 37 source_port = "any" 38 source_ip = "10.10.0.0/24" 39 } 40 } 41 42 resource "vcd_vapp" "web" { 43 # ... 44 } 45 46 resource "vcd_firewall_rules" "fw-web" { 47 edge_gateway = "Edge Gateway Name" 48 default_action = "drop" 49 50 rule { 51 description = "allow-web" 52 policy = "allow" 53 protocol = "tcp" 54 destination_port = "80" 55 destination_ip = "${vcd_vapp.web.ip}" 56 source_port = "any" 57 source_ip = "any" 58 } 59 } 60 ``` 61 62 ## Argument Reference 63 64 The following arguments are supported: 65 66 * `edge_gateway` - (Required) The name of the edge gateway on which to apply the Firewall Rules 67 * `default_action` - (Required) Either "allow" or "deny". Specifies what to do should none of the rules match 68 * `rule` - (Optional) Configures a firewall rule; see [Rules](#rules) below for details. 69 70 <a id="rules"></a> 71 ## Rules 72 73 Each firewall rule supports the following attributes: 74 75 * `description` - (Required) Description of the fireall rule 76 * `policy` - (Required) Specifies what to do when this rule is matched. Either "allow" or "deny" 77 * `protocol` - (Required) The protocol to match. One of "tcp", "udp", "icmp" or "any" 78 * `destination_port` - (Required) The destination port to match. Either a port number or "any" 79 * `destination_ip` - (Required) The destination IP to match. Either an IP address, IP range or "any" 80 * `source_port` - (Required) The source port to match. Either a port number or "any" 81 * `source_ip` - (Required) The source IP to match. Either an IP address, IP range or "any"