github.com/bengesoff/terraform@v0.3.1-0.20141018223233-b25a53629922/website/source/docs/providers/google/r/compute_firewall.html.markdown (about) 1 --- 2 layout: "google" 3 page_title: "Google: google_compute_firewall" 4 sidebar_current: "docs-google-resource-firewall" 5 --- 6 7 # google\_compute\_firewall 8 9 Manages a firewall resource within GCE. 10 11 ## Example Usage 12 13 ``` 14 resource "google_compute_firewall" "default" { 15 name = "test" 16 network = "${google_compute_network.other.name}" 17 18 allow { 19 protocol = "icmp" 20 } 21 22 allow { 23 protocol = "tcp" 24 ports = ["80", "8080", "1000-2000"] 25 } 26 27 source_tags = ["web"] 28 } 29 ``` 30 31 ## Argument Reference 32 33 The following arguments are supported: 34 35 * `name` - (Required) A unique name for the resource, required by GCE. 36 Changing this forces a new resource to be created. 37 38 * `network` - (Required) The name of the network to attach this firewall to. 39 40 * `allow` - (Required) Can be specified multiple times for each allow 41 rule. Each allow block supports fields documented below. 42 43 * `source_ranges` - (Optional) A list of source CIDR ranges that this 44 firewall applies to. 45 46 * `source_tags` - (Optional) A list of source tags that this firewall applies to. 47 48 * `target_tags` - (Optional) A list of target tags that this firewall applies to. 49 50 The `allow` block supports: 51 52 * `protocol` - (Required) The name of the protocol to allow. 53 54 * `ports` - (Optional) List of ports and/or port ranges to allow. This can 55 only be specified if the protocol is TCP or UDP. 56 57 ## Attributes Reference 58 59 The following attributes are exported: 60 61 * `name` - The name of the resource. 62 * `network` - The network that this resource is attached to. 63 * `source_ranges` - The CIDR block ranges this firewall applies to. 64 * `source_tags` - The tags that this firewall applies to.