Coder Social home page Coder Social logo

openvpn's Introduction

OpenVPN on AWS

This repo is setup to provision an EC2 image on AWS for running an OpenVPN instance. Terraform will also deploy a sample EC2 instance behind a private subnet, that you can connect to via the OpenVPN connection

Installation

This tool chain has been developed, to be run with Docker, so you will need Docker and Docker Compose to be installed. Head over to the installation page here, and install the correct client for your OS.

Setup

Bash

The bash scripts used in this repo require the use of the JQ library. On Mac you can install this via brew using:

brew install jq

Packer

Packer requires access to the infrascture that will be hosting all images built, so an assoicated access account is required to be setup prior, with the correct permissions for creating new assets.

There is an example AWS IAM policy in the packer directory, with all the correct resources listed.

Once the account has been created, create a new file the /packer/secrets.tfvars using the contents of /packer/secrets.tfvars.example. Replace the aws_access_key and aws_secret_key with the credentials of the packer aws user you created.

Terraform

Similar to Packer, Terraform will also need to the infrastructure it will be building onto of. Create a new user for the Terraform client to use (again a sample policy doc is provided in the /terraform directory).

Once the account has been created, create a new file the /terraform/secrets.tfvars.example using the contents of /terraform/secrets.tfvars.example. Replace the aws_access_key and aws_secret_key with the credentials of the terraform aws user you created.

Running

First create an SSH key, that will be used to allow SSH access to the images that will be created. Simply run:

make keygen.generate

Generate an AMI for each image:

make packer.build

Deploy the infrastructure and AMI instances:

make terraform.deploy

Cleanup

Packer images (AMI's and snapshots) can not be automatically cleaned up in this current build.

To clean up Terraform generated resources (EC2 instance, Security Group, Key Pair), simply run:

make terraform.destroy

Future changes

Manage terraform state via S3

openvpn's People

Contributors

mjmcconnell-equiis avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.