Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add bypass_vlan_check to network and private_gateway #166

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions cloudstack/resource_cloudstack_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ func resourceCloudStackNetwork() *schema.Resource {
ForceNew: true,
},

"bypass_vlan_check": {
Type: schema.TypeBool,
Optional: true,
Default: false,
},

"tags": tagsSchema(),
},
}
Expand Down Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions cloudstack/resource_cloudstack_private_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ func resourceCloudStackPrivateGateway() *schema.Resource {
Required: true,
ForceNew: true,
},

"bypass_vlan_check": {
Type: schema.TypeBool,
Optional: true,
Default: false,
},
},
}
}
Expand All @@ -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 != "" {
Expand Down
11 changes: 11 additions & 0 deletions cloudstack/resource_cloudstack_private_gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}`