terraform-community-modules
tf_aws_openvpn
HCL

Terraform module which creates OpenVPN on AWS

Last updated Sep 20, 2023
33
Stars
19
Forks
5
Issues
0
Stars/day
Attention Score
11
Language breakdown
No language data available.
Files click to expand
README

tfawsopenvpn

Terraform module which creates OpenVPN on AWS

This module is creating the following resources:

  • Two Route53 Records
a. vpn-web.domain.com b. vpn.domain.com
  • One EC2 Load Balancer (ELB) using Amazon Certificate Manager (ACM)
  • One EC2 Security Group
  • One EC2 Instance

Architecture

For Web only:

+-[1/a]-+ +--[2]--+ +--[3]--+ +--[4]--+ | | | | | | | | Internet --> | DNS | --> | ELB | --> | SG | --> | EC2 | | | | | | | | | +-------+ +-------+ +-------+ +-------+ vpn-web.domain.com --> TCP:443 --> TCP:443 --> TCP:443 OK

For VPN connection: (ELB does not support custom port 1194)

+-[1/b]-+ +--[2]--+ +--[3]--+ | | | | | | Internet --> | DNS | --> | SG | --> | EC2 | | | | | | | +-------+ +-------+ +-------+ vpn.domain.com --> TCP:1194 --> TCP:1194 OK

Usage

module "openvpn" {
  source             = "github.com/terraform-community-modules/tfawsopenvpn"
  name               = "openVPN"
  # VPC Inputs
  vpcid             = "${var.vpcid}"
  vpccidr           = "${var.vpccidr}"
  publicsubnetids  = "${var.publicsubnetids}"
  # EC2 Inputs
  keyname           = "${var.keyname}"
  privatekey        = "${var.privatekey}"
  ami                = "${var.ami}"
  instancetype      = "${var.instancetype}"
  # ELB Inputs
  certarn           = "${var.certarn}"
  # DNS Inputs
  domainname        = "${var.publicdomain_name}"
  routezoneid      = "${var.routezoneid}"
  # OpenVPN Inputs
  openvpnuser       = "${var.openvpnuser}"
  openvpnadminuser = "${var.openvpnadminuser}" # Note: Don't choose "admin" username. Looks like it's already reserved.
  openvpnadminpw   = "${var.openvpnadminpw}"
}

Authors

Created and maintained by Quentin Rousseau (contact@quent.in).

License

Apache 2 Licensed. See LICENSE for full details.

🔗 More in this category

© 2026 GitRepoTrend · terraform-community-modules/tf_aws_openvpn · Updated daily from GitHub