Skip to content

Commit ad83bde

Browse files
committed
do not enforce passing port when proto is 'all'
1 parent e68cbdc commit ad83bde

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cloudstack/resource_cloudstack_network_acl_rule.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,9 @@ func createNetworkACLRule(d *schema.ResourceData, meta interface{}, rule map[str
294294
}
295295
log.Printf("[WARN] 'ports' is deprecated. Use 'port' instead.")
296296
} else {
297-
return fmt.Errorf("Parameter port is required for protocol 'tcp' or 'udp'. Use 'port' (string) for new configs.")
297+
if rule["protocol"].(string) == "tcp" || rule["protocol"].(string) == "udp" {
298+
return fmt.Errorf("Parameter port is required for protocol 'tcp' or 'udp'. Use 'port' (string) for new configs.")
299+
}
298300
}
299301
if portStr != "" {
300302
m := splitPorts.FindStringSubmatch(portStr)

0 commit comments

Comments
 (0)