This module is used to create a VPN Gateway
data "ibm_resource_group" "resource_group" {
name = (var.resource_group != null ? var.resource_group : "default")
}
locals {
rules = [
for r in var.connections : {
name = r.name
peer_address = r.peer_address
preshared_key = r.preshared_key
local_cidrs = r.local_cidrs
peer_cidrs = r.peer_cidrs
admin_state_up = lookup(r, "admin_state_up", null)
action = lookup(r, "action", null)
interval = lookup(r, "interval", null)
timeout = lookup(r, "timeout", null)
ike_policy = lookup(r, "ike_policy", null)
ipsec_policy = lookup(r, "ipsec_policy", null)
}
]
}
module "vpn_gateway" {
source = "terraform-ibm-modules/vpc/ibm//modules/vpn-gateway"
create_vpn_gateway = var.create_vpn_gateway
name = var.name
resource_group_id = data.ibm_resource_group.resource_group.id
subnet = var.subnet
tags = var.tags
vpn_gateway = var.vpn_gateway
connections = var.connections
}
Name | Version |
---|---|
terraform | >= 1.3.0 |
ibm | >= 1.64.0, <2.0.0 |
No modules.
Name | Type |
---|---|
ibm_is_vpn_gateway.vpngw | resource |
ibm_is_vpn_gateway_connection.vpngw_connections | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
connections | List of connections for the VPN Gateway | list(object({ |
[] |
no |
create_vpn_gateway | True to create new VPN Gateway. False if VPN Gateway is already existing and VPN Gateway connections are to be added | bool |
n/a | yes |
name | Name of the VPN Gateway | string |
null |
no |
resource_group_id | ID of resource group. | string |
null |
no |
subnet | Subnet id for the Gateway | string |
null |
no |
tags | List of Tags for the VPN Gateway | list(string) |
[] |
no |
vpn_gateway | Existing Gateway ID to which connections are to be attached | string |
null |
no |
Name | Description |
---|---|
vpn_gateway_connections | The VPN Gateway Connections |
vpn_gateway_id | The ID of the VPN Gateway |
vpn_gateway_public_ip | The public IP address assigned to the VPN gateway |