Merge pull request #6106 from vmfarms/port-forward-projectid-bug

Add project parameter to cloudstack_port_forward.
This commit is contained in:
Sander van Harmelen 2016-04-11 14:56:05 +02:00
commit ae371b5492
1 changed files with 10 additions and 0 deletions

View File

@ -43,6 +43,12 @@ func resourceCloudStackPortForward() *schema.Resource {
Default: false,
},
"project": &schema.Schema{
Type: schema.TypeString,
Optional: true,
ForceNew: true,
},
"forward": &schema.Schema{
Type: schema.TypeSet,
Required: true,
@ -207,6 +213,10 @@ func resourceCloudStackPortForwardRead(d *schema.ResourceData, meta interface{})
p.SetIpaddressid(d.Id())
p.SetListall(true)
if err := setProjectid(p, cs, d); err != nil {
return err
}
l, err := cs.Firewall.ListPortForwardingRules(p)
if err != nil {
return err