Browse the Repo

file-type-icon.circleci
file-type-iconexamples
file-type-iconopenvpn-host-duo
file-type-iconopenvpn-host
file-type-iconpacker-duo
file-type-iconpacker
file-type-iconREADME.md
file-type-iconbuild.json
file-type-iconmodules
file-type-icontest
file-type-icon.gitignore
file-type-icon.pre-commit-config.yaml
file-type-iconCODEOWNERS
file-type-iconLICENSE.txt
file-type-iconREADME.md
file-type-iconterraform-cloud-enterprise-private-module-...

Browse the Repo

file-type-icon.circleci
file-type-iconexamples
file-type-iconopenvpn-host-duo
file-type-iconopenvpn-host
file-type-iconpacker-duo
file-type-iconpacker
file-type-iconREADME.md
file-type-iconbuild.json
file-type-iconmodules
file-type-icontest
file-type-icon.gitignore
file-type-icon.pre-commit-config.yaml
file-type-iconCODEOWNERS
file-type-iconLICENSE.txt
file-type-iconREADME.md
file-type-iconterraform-cloud-enterprise-private-module-...
OpenVPN

OpenVPN

Deploy an OpenVPN server. Supports auto healing, public key infrastructure (PKI), cert backup, and managing user accounts using IAM groups.

Code Preview

Preview the Code

mobile file icon

README.md

down

Open VPN example AMI

This folder contains an example Packer template for building an AMI (Amazon Machine Image) containing the OpenVPN server.

Pre-requisites:

In order to build this AMI you will need to provide some input variables. There are several variables but the most important ones are:

  • In which AWS region should Packer build your AMI
  • Where should Packer look for a copy of the openvpn-admin binary that you will use to manage your VPN certificates. If you haven't built this before, take a look at it's documentation for steps on how to build it. Remember: When building openvpn-admin for use in this packer template, keep in mind the OS and architecture where this will be deployed and not the OS/architecture of the machine that's building openvpn-admin. E.g., if you're firing up an EC2 Instance that runs Linux, you'll need to build the binary for Linux, even if you happen to be running the build on a Mac.

All variables below:

Variable name Description Default Value
active_git_branch The git branch to use for gruntwork-install. null
aws_region Tells Packer in which AWS region to build your AMI us-east-1
github_oauth_token Your github OAuth token. env.GITHUB_OAUTH_TOKEN
openvpn_admin_binary Where should Packer look for a copy of the openvpn-admin binary that you will use to manage the VPN certificates on your VPN server. See: openvpn-admin for more info. /examples/bin/openvpn-admin
gruntwork_installer_version What version of Gruntwork Installer to use v0.0.20
bash_commons_version What version of bash-commons to use v0.0.6

Building the packer template

Below is an example of the command you could run to build this packer template.

packer build \
	-var aws_region=us-east-1 \
	-var openvpn_admin_binary=../examples/bin/openvpn-admin \
	-only=ubuntu-16-build \
	../examples/packer/build.json

Notes

  • -only flag allows you to execute one specific builder with the given name. This parameter can be ommitted if the packer template has only one builder defined in it. This example has just one builder, but we're including the parameter for reference.
  • openvpn_admin_binary in the example above is pointing to a sample location. Unless you execute the automated test, which will actually build the artifact for you and place it into that folder, you will have to provide your own path where that binary is located.

Questions? Ask away.

We're here to talk about our services, answer any questions, give advice, or just to chat.

Ready to hand off the Gruntwork?