Skip to content

Commit 1712cbf

Browse files
Change bypassvlanoverlapcheck to bypass_vlan_overlap_check for naming consistency
The parameter name has been changed from camelCase (bypassvlanoverlapcheck) to snake_case (bypass_vlan_overlap_check) to maintain consistency with other resource arguments like ip_address, physical_network_id, and acl_id. This change affects: - Resource schema definition - Resource creation logic - Test cases and assertions - Documentation examples The parameter is now also marked as ForceNew since it can only be set during gateway creation and cannot be modified afterwards.
1 parent e2e1c9f commit 1712cbf

3 files changed

Lines changed: 18 additions & 17 deletions

File tree

cloudstack/resource_cloudstack_private_gateway.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,11 @@ func resourceCloudStackPrivateGateway() *schema.Resource {
8686
ForceNew: true,
8787
},
8888

89-
"bypassvlanoverlapcheck": {
89+
"bypass_vlan_overlap_check": {
9090
Type: schema.TypeBool,
9191
Optional: true,
9292
Default: false,
93+
ForceNew: true,
9394
},
9495
},
9596
}
@@ -125,9 +126,9 @@ func resourceCloudStackPrivateGatewayCreate(d *schema.ResourceData, meta interfa
125126
p.SetAclid(aclid.(string))
126127
}
127128

128-
// Set bypassvlanoverlapcheck if specified
129-
if bypassvlanoverlapcheck, ok := d.GetOk("bypassvlanoverlapcheck"); ok {
130-
p.SetBypassvlanoverlapcheck(bypassvlanoverlapcheck.(bool))
129+
// Set bypass_vlan_overlap_check if specified
130+
if bypassVlanOverlapCheck, ok := d.GetOk("bypass_vlan_overlap_check"); ok {
131+
p.SetBypassvlanoverlapcheck(bypassVlanOverlapCheck.(bool))
131132
}
132133

133134
// Create the new private gateway

cloudstack/resource_cloudstack_private_gateway_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func TestAccCloudStackPrivateGateway_import(t *testing.T) {
6262
ResourceName: "cloudstack_private_gateway.foo",
6363
ImportState: true,
6464
ImportStateVerify: true,
65-
ImportStateVerifyIgnore: []string{"bypassvlanoverlapcheck"},
65+
ImportStateVerifyIgnore: []string{"bypass_vlan_overlap_check"},
6666
},
6767
},
6868
})
@@ -82,7 +82,7 @@ func TestAccCloudStackPrivateGateway_bypassVlanOverlapCheck(t *testing.T) {
8282
testAccCheckCloudStackPrivateGatewayExists(
8383
"cloudstack_private_gateway.bar", &gateway),
8484
resource.TestCheckResourceAttr(
85-
"cloudstack_private_gateway.bar", "bypassvlanoverlapcheck", "true"),
85+
"cloudstack_private_gateway.bar", "bypass_vlan_overlap_check", "true"),
8686
),
8787
},
8888
},
@@ -103,7 +103,7 @@ func TestAccCloudStackPrivateGateway_bypassVlanOverlapCheckDefault(t *testing.T)
103103
testAccCheckCloudStackPrivateGatewayExists(
104104
"cloudstack_private_gateway.foo", &gateway),
105105
resource.TestCheckResourceAttr(
106-
"cloudstack_private_gateway.foo", "bypassvlanoverlapcheck", "false"),
106+
"cloudstack_private_gateway.foo", "bypass_vlan_overlap_check", "false"),
107107
),
108108
},
109109
},
@@ -225,6 +225,6 @@ resource "cloudstack_private_gateway" "bar" {
225225
vlan = "2"
226226
vpc_id = cloudstack_vpc.bar.id
227227
acl_id = cloudstack_network_acl.bar.id
228-
bypassvlanoverlapcheck = true
228+
bypass_vlan_overlap_check = true
229229
depends_on = ["cloudstack_vpc.bar","cloudstack_network_acl.bar"]
230230
}`

website/docs/r/private_gateway.html.markdown

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ Example with VLAN overlap check bypass:
2929

3030
```hcl
3131
resource "cloudstack_private_gateway" "with_bypass" {
32-
gateway = "10.0.0.1"
33-
ip_address = "10.0.0.2"
34-
netmask = "255.255.255.252"
35-
vlan = "200"
36-
vpc_id = "76f6e8dc-07e3-4971-b2a2-8831b0cc4cb4"
37-
acl_id = "cf4f1dad-aade-4ccd-866c-0a2166e5be3d"
38-
bypassvlanoverlapcheck = true
32+
gateway = "10.0.0.1"
33+
ip_address = "10.0.0.2"
34+
netmask = "255.255.255.252"
35+
vlan = "200"
36+
vpc_id = "76f6e8dc-07e3-4971-b2a2-8831b0cc4cb4"
37+
acl_id = "cf4f1dad-aade-4ccd-866c-0a2166e5be3d"
38+
bypass_vlan_overlap_check = true
3939
}
4040
```
4141

@@ -65,10 +65,10 @@ The following arguments are supported:
6565
* `vpc_id` - (Required) The VPC ID in which to create this Private gateway. Changing
6666
this forces a new resource to be created.
6767

68-
* `bypassvlanoverlapcheck` - (Optional) When set to true, bypasses the VLAN overlap
68+
* `bypass_vlan_overlap_check` - (Optional) When set to true, bypasses the VLAN overlap
6969
check during private gateway creation. This allows creating private gateways with
7070
VLANs that may overlap with existing VLANs in the physical network. Defaults to
71-
false.
71+
false. Changing this forces a new resource to be created.
7272

7373
## Attributes Reference
7474

0 commit comments

Comments
 (0)