Merge pull request #1107 from svanharmelen/b-cloudstack-diverse

provider/cloudstack: updating the docs so they represent the added `managed` feature
This commit is contained in:
Sander van Harmelen 2015-03-03 14:21:19 +01:00
commit c220e67706
2 changed files with 8 additions and 4 deletions

View File

@ -191,10 +191,10 @@ func resourceCloudStackPortForwardRead(d *schema.ResourceData, meta interface{})
}
}
// If this is a managed firewall, add all unknown rules into a single dummy rule
// If this is a managed resource, add all unknown forwards to dummy forwards
managed := d.Get("managed").(bool)
if managed {
// Get all the rules from the running environment
// Get all the forwards from the running environment
p := cs.Firewall.NewListPortForwardingRulesParams()
p.SetIpaddressid(d.Id())
p.SetListall(true)
@ -220,7 +220,7 @@ func resourceCloudStackPortForwardRead(d *schema.ResourceData, meta interface{})
}
for uuid, _ := range uuids {
// Make a dummy forward to hold all unknown UUIDs
// Make a dummy forward to hold the unknown UUID
forward := map[string]interface{}{
"protocol": "N/A",
"private_port": 0,
@ -229,7 +229,7 @@ func resourceCloudStackPortForwardRead(d *schema.ResourceData, meta interface{})
"uuid": uuid,
}
// Add the dummy forward to the rules set
// Add the dummy forward to the forwards set
forwards.Add(forward)
}
}

View File

@ -32,6 +32,10 @@ The following arguments are supported:
* `ipaddress` - (Required) The IP address for which to create the port forwards.
Changing this forces a new resource to be created.
* `managed` - (Optional) USE WITH CAUTION! If enabled all the port forwards for
this IP address will be managed by this resource. This means it will delete
all port forwards that are not in your config! (defaults false)
* `forward` - (Required) Can be specified multiple times. Each forward block supports
fields documented below.