Skip to content

Commit 34b5d1b

Browse files
committed
Add documenation and deprecation notice
1 parent ad83bde commit 34b5d1b

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

website/docs/r/network_acl_rule.html.markdown

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,30 @@ Creates network ACL rules for a given network ACL.
1313
## Example Usage
1414

1515
```hcl
16-
resource "cloudstack_network_acl_rule" "default" {
16+
rresource "cloudstack_network_acl_rule" "default" {
1717
acl_id = "f3843ce0-334c-4586-bbd3-0c2e2bc946c6"
1818
1919
rule {
2020
action = "allow"
2121
cidr_list = ["10.0.0.0/8"]
2222
protocol = "tcp"
23-
ports = ["80", "1000-2000"]
23+
port = "80-443" # preferred, string, supports single port or range
2424
traffic_type = "ingress"
2525
}
2626
}
2727
```
28+
# Deprecated example (do not use in new configs)
29+
resource "cloudstack_network_acl_rule" "deprecated" {
30+
acl_id = "f3843ce0-334c-4586-bbd3-0c2e2bc946c6"
31+
32+
rule {
33+
action = "allow"
34+
cidr_list = ["10.0.0.0/8"]
35+
protocol = "tcp"
36+
ports = ["80", "1000-2000"] # deprecated, use 'port' instead
37+
traffic_type = "ingress"
38+
}
39+
}
2840

2941
## Argument Reference
3042

@@ -64,8 +76,12 @@ The `rule` block supports:
6476
* `icmp_code` - (Optional) The ICMP code to allow, or `-1` to allow `any`. This
6577
can only be specified if the protocol is ICMP. (defaults 0)
6678

67-
* `ports` - (Optional) List of ports and/or port ranges to allow. This can only
79+
* `port` - (Optional, string) The port or port range to allow. Preferred for new configs.
80+
Use a single port (e.g. "80") or a range (e.g. "1000-2000"). Required for tcp or udp protocols. Cannot be used with ports.
81+
82+
* `ports` - (Optional, Deprecated) List of ports and/or port ranges to allow. This can only
6883
be specified if the protocol is TCP, UDP, ALL or a valid protocol number.
84+
**Deprecated**: Use port (string) instead. ports will be removed in a future version.
6985

7086
* `traffic_type` - (Optional) The traffic type for the rule. Valid options are:
7187
`ingress` or `egress` (defaults ingress).
@@ -91,4 +107,7 @@ When importing into a project you need to prefix the import ID with the project
91107

92108
```shell
93109
terraform import cloudstack_network_acl_rule.default my-project/e8b5982a-1b50-4ea9-9920-6ea2290c7359
94-
```
110+
```
111+
112+
### Deprecation Notice:
113+
The `ports` attribute is deprecated and will be removed in a future version. Use `port` (string) instead for all new configurations.

0 commit comments

Comments
 (0)