Skip to content

Commit 1b1a9b8

Browse files
committed
change rule_id -> rule_number and add doc
1 parent fed2259 commit 1b1a9b8

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

cloudstack/resource_cloudstack_network_acl_rule.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func resourceCloudStackNetworkACLRule() *schema.Resource {
5757
Optional: true,
5858
Elem: &schema.Resource{
5959
Schema: map[string]*schema.Schema{
60-
"rule_id": {
60+
"rule_number": {
6161
Type: schema.TypeInt,
6262
Optional: true,
6363
Computed: true,
@@ -210,7 +210,7 @@ func createNetworkACLRule(d *schema.ResourceData, meta interface{}, rule map[str
210210
p := cs.NetworkACL.NewCreateNetworkACLParams(rule["protocol"].(string))
211211

212212
// If a rule ID is specified, set it
213-
if ruleId, ok := rule["rule_id"].(int); ok && ruleId > 0 {
213+
if ruleId, ok := rule["rule_number"].(int); ok && ruleId > 0 {
214214
p.SetNumber(ruleId)
215215
}
216216

@@ -644,12 +644,12 @@ func verifyNetworkACLParams(d *schema.ResourceData) error {
644644
}
645645

646646
func verifyNetworkACLRuleParams(d *schema.ResourceData, rule map[string]interface{}) error {
647-
if ruleId, ok := rule["rule_id"]; ok && ruleId != nil {
648-
if rId, ok := ruleId.(int); ok && rId != 0 {
649-
// Validate only if rule_id is explicitly set (non-zero)
647+
if ruleNum, ok := rule["rule_number"]; ok && ruleNum != nil {
648+
if rId, ok := ruleNum.(int); ok && rId != 0 {
649+
// Validate only if rule_number is explicitly set (non-zero)
650650
if rId < 1 || rId > 65535 {
651651
return fmt.Errorf(
652-
"%q must be between %d and %d inclusive, got: %d", "rule_id", 1, 65535, rId)
652+
"%q must be between %d and %d inclusive, got: %d", "rule_number", 1, 65535, rId)
653653
}
654654
}
655655
}

website/docs/r/network_acl_rule.html.markdown

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ The following arguments are supported:
4848

4949
The `rule` block supports:
5050

51+
* `rule_number` - (Optional) The number of the ACL item, its ordering.
52+
5153
* `action` - (Optional) The action for the rule. Valid options are: `allow` and
5254
`deny` (defaults allow).
5355

@@ -68,6 +70,8 @@ The `rule` block supports:
6870
* `traffic_type` - (Optional) The traffic type for the rule. Valid options are:
6971
`ingress` or `egress` (defaults ingress).
7072

73+
* `description` - (Optional) A description indicating why the ACL rule is required.
74+
7175
## Attributes Reference
7276

7377
The following attributes are exported:

0 commit comments

Comments
 (0)