provider/gce: Add description in firewall resource

This commit is contained in:
Julien Vey 2015-02-05 11:37:52 +01:00
parent 26156981d7
commit 33eebbed51
3 changed files with 10 additions and 0 deletions

View File

@ -26,6 +26,11 @@ func resourceComputeFirewall() *schema.Resource {
ForceNew: true,
},
"description": &schema.Schema{
Type: schema.TypeString,
Optional: true,
},
"network": &schema.Schema{
Type: schema.TypeString,
Required: true,
@ -306,6 +311,7 @@ func resourceFirewall(
// Build the firewall parameter
return &compute.Firewall{
Name: d.Get("name").(string),
Description: d.Get("description").(string),
Network: network.SelfLink,
Allowed: allowed,
SourceRanges: sourceRanges,

View File

@ -126,6 +126,7 @@ resource "google_compute_network" "foobar" {
resource "google_compute_firewall" "foobar" {
name = "terraform-test"
description = "Resource created for Terraform acceptance testing"
network = "${google_compute_network.foobar.name}"
source_tags = ["foo"]
@ -142,6 +143,7 @@ resource "google_compute_network" "foobar" {
resource "google_compute_firewall" "foobar" {
name = "terraform-test"
description = "Resource created for Terraform acceptance testing"
network = "${google_compute_network.foobar.name}"
source_tags = ["foo"]

View File

@ -37,6 +37,8 @@ The following arguments are supported:
* `name` - (Required) A unique name for the resource, required by GCE.
Changing this forces a new resource to be created.
* `description` - (Optional) Textual description field.
* `network` - (Required) The name of the network to attach this firewall to.
* `allow` - (Required) Can be specified multiple times for each allow