Skip to content

Commit 275d8b0

Browse files
committed
add bypass_vlan_check to network and private_gateway
1 parent a653531 commit 275d8b0

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

cloudstack/resource_cloudstack_network.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ func resourceCloudStackNetwork() *schema.Resource {
153153
ForceNew: true,
154154
},
155155

156+
"bypass_vlan_check": {
157+
Type: schema.TypeBool,
158+
Optional: true,
159+
Default: false,
160+
},
161+
156162
"tags": tagsSchema(),
157163
},
158164
}
@@ -218,6 +224,9 @@ func resourceCloudStackNetworkCreate(d *schema.ResourceData, meta interface{}) e
218224
p.SetVlan(strconv.Itoa(vlan.(int)))
219225
}
220226

227+
// Bypass VLAN overlap check if necessary
228+
p.SetBypassvlanoverlapcheck(d.Get("bypass_vlan_check").(bool))
229+
221230
// Check is this network needs to be created in a VPC
222231
if vpcid, ok := d.GetOk("vpc_id"); ok {
223232
// Set the vpc id

cloudstack/resource_cloudstack_private_gateway.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ func resourceCloudStackPrivateGateway() *schema.Resource {
8585
Required: true,
8686
ForceNew: true,
8787
},
88+
89+
"bypass_vlan_check": {
90+
Type: schema.TypeBool,
91+
Optional: true,
92+
Default: false,
93+
},
8894
},
8995
}
9096
}
@@ -103,6 +109,7 @@ func resourceCloudStackPrivateGatewayCreate(d *schema.ResourceData, meta interfa
103109
d.Get("vpc_id").(string),
104110
)
105111
p.SetVlan(d.Get("vlan").(string))
112+
p.SetBypassvlanoverlapcheck(d.Get("bypass_vlan_check").(bool))
106113

107114
// Retrieve the network_offering ID
108115
if networkofferingid != "" {

cloudstack/resource_cloudstack_private_gateway_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,15 @@ resource "cloudstack_private_gateway" "foo" {
159159
vpc_id = cloudstack_vpc.foo.id
160160
acl_id = cloudstack_network_acl.foo.id
161161
depends_on = ["cloudstack_vpc.foo","cloudstack_network_acl.foo"]
162+
}
163+
164+
resource "cloudstack_private_gateway" "bar" {
165+
gateway = "10.1.1.253"
166+
ip_address = "192.168.0.2"
167+
netmask = "255.255.255.0"
168+
vlan = "1"
169+
vpc_id = cloudstack_vpc.foo.id
170+
acl_id = cloudstack_network_acl.foo.id
171+
bypass_vlan_check = true
172+
depends_on = ["cloudstack_vpc.foo","cloudstack_network_acl.foo","cloudstack_private_gateway.foo"]
162173
}`

0 commit comments

Comments
 (0)