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

azurerm_virtual_network_gateway_connection - add "connection_protocol" property #5145

Merged
merged 5 commits into from
Dec 18, 2019
Merged
Show file tree
Hide file tree
Changes from 2 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
19 changes: 19 additions & 0 deletions azurerm/resource_arm_virtual_network_gateway_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,16 @@ func resourceArmVirtualNetworkGatewayConnection() *schema.Resource {
Computed: true,
},

"connection_protocol": {
phires marked this conversation as resolved.
Show resolved Hide resolved
Type: schema.TypeString,
Optional: true,
ForceNew: true,
ValidateFunc: validation.StringInSlice([]string{
string(network.IKEv1),
string(network.IKEv2),
}, true),
phires marked this conversation as resolved.
Show resolved Hide resolved
},

"ipsec_policy": {
Type: schema.TypeList,
Optional: true,
Expand Down Expand Up @@ -369,6 +379,10 @@ func resourceArmVirtualNetworkGatewayConnectionRead(d *schema.ResourceData, meta
d.Set("shared_key", conn.SharedKey)
}

if string(conn.ConnectionProtocol) != "" {
d.Set("connection_protocol", string(conn.ConnectionProtocol))
}
phires marked this conversation as resolved.
Show resolved Hide resolved

if conn.ExpressRouteGatewayBypass != nil {
d.Set("express_route_gateway_bypass", conn.ExpressRouteGatewayBypass)
}
Expand Down Expand Up @@ -486,6 +500,11 @@ func getArmVirtualNetworkGatewayConnectionProperties(d *schema.ResourceData) (*n
props.SharedKey = utils.String(v.(string))
}

if v, ok := d.GetOk("connection_protocol"); ok {
connectionProtocol := v.(string)
props.ConnectionProtocol = network.VirtualNetworkGatewayConnectionProtocol(connectionProtocol)
}

if v, ok := d.GetOk("ipsec_policy"); ok {
props.IpsecPolicies = expandArmVirtualNetworkGatewayConnectionIpsecPolicies(v.([]interface{}))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,12 @@ The following arguments are supported:
Site-to-Site or VNet-to-VNet connection is created whereas ExpressRoute
connections do not need a shared key.

* `connection_protocol` - (Optional) The IKE protocol version to use. Possible
values are `IKEv1` and `IKEv2`. Only valid for IPSec connections on virtual
network gateways with SKU `VpnGw1`, `VpnGw2`, `VpnGw3`, `VpnGw1AZ`, `VpnGw2AZ`
or `VpnGw3AZ`. Changing the protocol will force a new connection to be created.
phires marked this conversation as resolved.
Show resolved Hide resolved
Defaults to `IKEv2`.
phires marked this conversation as resolved.
Show resolved Hide resolved

* `enable_bgp` - (Optional) If `true`, BGP (Border Gateway Protocol) is enabled
for this connection. Defaults to `false`.

Expand Down