mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Updating the docs so the represent the added feature
Adding info about the `managed` option for port forwards…
This commit is contained in:
parent
033cee31f3
commit
426fb2e457
@ -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)
|
managed := d.Get("managed").(bool)
|
||||||
if managed {
|
if managed {
|
||||||
// Get all the rules from the running environment
|
// Get all the forwards from the running environment
|
||||||
p := cs.Firewall.NewListPortForwardingRulesParams()
|
p := cs.Firewall.NewListPortForwardingRulesParams()
|
||||||
p.SetIpaddressid(d.Id())
|
p.SetIpaddressid(d.Id())
|
||||||
p.SetListall(true)
|
p.SetListall(true)
|
||||||
@ -220,7 +220,7 @@ func resourceCloudStackPortForwardRead(d *schema.ResourceData, meta interface{})
|
|||||||
}
|
}
|
||||||
|
|
||||||
for uuid, _ := range uuids {
|
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{}{
|
forward := map[string]interface{}{
|
||||||
"protocol": "N/A",
|
"protocol": "N/A",
|
||||||
"private_port": 0,
|
"private_port": 0,
|
||||||
@ -229,7 +229,7 @@ func resourceCloudStackPortForwardRead(d *schema.ResourceData, meta interface{})
|
|||||||
"uuid": uuid,
|
"uuid": uuid,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the dummy forward to the rules set
|
// Add the dummy forward to the forwards set
|
||||||
forwards.Add(forward)
|
forwards.Add(forward)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,10 @@ The following arguments are supported:
|
|||||||
* `ipaddress` - (Required) The IP address for which to create the port forwards.
|
* `ipaddress` - (Required) The IP address for which to create the port forwards.
|
||||||
Changing this forces a new resource to be created.
|
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
|
* `forward` - (Required) Can be specified multiple times. Each forward block supports
|
||||||
fields documented below.
|
fields documented below.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user