diff --git a/cloudstack/resource_cloudstack_network.go b/cloudstack/resource_cloudstack_network.go index e7329f82..da5c928d 100644 --- a/cloudstack/resource_cloudstack_network.go +++ b/cloudstack/resource_cloudstack_network.go @@ -153,6 +153,12 @@ func resourceCloudStackNetwork() *schema.Resource { ForceNew: true, }, + "bypass_vlan_check": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + "tags": tagsSchema(), }, } @@ -218,6 +224,9 @@ func resourceCloudStackNetworkCreate(d *schema.ResourceData, meta interface{}) e p.SetVlan(strconv.Itoa(vlan.(int))) } + // Bypass VLAN overlap check if necessary + p.SetBypassvlanoverlapcheck(d.Get("bypass_vlan_check").(bool)) + // Check is this network needs to be created in a VPC if vpcid, ok := d.GetOk("vpc_id"); ok { // Set the vpc id diff --git a/cloudstack/resource_cloudstack_private_gateway.go b/cloudstack/resource_cloudstack_private_gateway.go index 6d4e0078..e923093b 100644 --- a/cloudstack/resource_cloudstack_private_gateway.go +++ b/cloudstack/resource_cloudstack_private_gateway.go @@ -85,6 +85,12 @@ func resourceCloudStackPrivateGateway() *schema.Resource { Required: true, ForceNew: true, }, + + "bypass_vlan_check": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, }, } } @@ -103,6 +109,7 @@ func resourceCloudStackPrivateGatewayCreate(d *schema.ResourceData, meta interfa d.Get("vpc_id").(string), ) p.SetVlan(d.Get("vlan").(string)) + p.SetBypassvlanoverlapcheck(d.Get("bypass_vlan_check").(bool)) // Retrieve the network_offering ID if networkofferingid != "" { diff --git a/cloudstack/resource_cloudstack_private_gateway_test.go b/cloudstack/resource_cloudstack_private_gateway_test.go index a20a8141..96c3da3c 100644 --- a/cloudstack/resource_cloudstack_private_gateway_test.go +++ b/cloudstack/resource_cloudstack_private_gateway_test.go @@ -159,4 +159,15 @@ resource "cloudstack_private_gateway" "foo" { vpc_id = cloudstack_vpc.foo.id acl_id = cloudstack_network_acl.foo.id depends_on = ["cloudstack_vpc.foo","cloudstack_network_acl.foo"] +} + +resource "cloudstack_private_gateway" "bar" { + gateway = "10.1.1.253" + ip_address = "192.168.0.2" + netmask = "255.255.255.0" + vlan = "1" + vpc_id = cloudstack_vpc.foo.id + acl_id = cloudstack_network_acl.foo.id + bypass_vlan_check = true + depends_on = ["cloudstack_vpc.foo","cloudstack_network_acl.foo","cloudstack_private_gateway.foo"] }`