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