Giter VIP home page Giter VIP logo

terraform-aws-pritunl-vpn-server's Introduction

Overview

This module setups a VPN server for a VPC to connect to instances.

Before you start to use the module you have to make sure you've created resources below

  • healthchecks.io account and cron entry for monitoring the backup script

After provisioning, don't forget to run commands below:

  • Pritunl setup
    • sudo pritunl setup-key

Input variables

  • aws_key_name: SSH Key pair for VPN instance
  • vpc_id: The VPC id
  • public_subnet_id: One of the public subnets to create the instance
  • ami_id: Amazon Linux AMI ID
  • instance_type: Instance type of the VPN box (t2.small is mostly enough)
  • ebs_optimized: Create EBS optimized EC2 instance. Default: false
  • whitelist: List of office IP addresses that you can SSH and non-VPN connected users can reach temporary profile download pages
  • whitelist_http: List of IP addresses that you can allow HTTP connections.
  • internal_cidrs: List of CIDRs that will be whitelisted to access the VPN server internally.
  • tags: Map of AWS Tag key and values
  • resource_name_prefix: All the resources will be prefixed with the value of this variable
  • healthchecks_io_key: Health check key for healthchecks.io
  • s3_bucket_name: Optional bucket name for Pritunl backups

Outputs

  • vpn_instance_private_ip_address: Private IP address of the instance
  • vpn_public_ip_address: EIP of the VPN box
  • vpn_management_ui: URL for the management UI

Usage

provider "aws" {
  region  = "eu-west-2"
}

module "app_pritunl" {
  source = "github.com/opsgang/terraform_pritunl?ref=2.0.0"

  aws_key_name         = "org-eu-west-2"
  vpc_id               = "${module.vpc.vpc_id}"
  public_subnet_id     = "${module.vpc.public_subnets[1]}"
  ami_id               = "ami-403e2524"
  instance_type        = "t2.nano"
  resource_name_prefix = "opsgang-pritunl"
  healthchecks_io_key  = "NNNNNNNN-NNNN-NNNN-NNNN-NNNNNNNNNNN"
  s3_bucket_name       = "i-want-to-override-generated-bucket-name"

  whitelist = [
    "8.8.8.8/32",
  ]

  tags {
    "role" = "vpn"
    "env"  = "prod"
  }
}

P.S. : Yes, AMI id is hardcoded! This module meant to be used in your VPC template. Presumably, no one wants to destroy the VPN instance and restore the configuration after terraform apply against to VPC. There is no harm to manage that manually and keep people working during the day.

There will be wiki link about initial setup of Pritunl

terraform-aws-pritunl-vpn-server's People

Contributors

j-russell avatar jinal--shah avatar leventyalcin avatar mclueppers avatar omrisiri avatar tomcohen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

terraform-aws-pritunl-vpn-server's Issues

Build custom AMI

hi! could you share packer(anything else?) file to build the AMI?

Backup restore

There is a backup script already but there is no restore script.

The main advantage of the restore script is we can even gather ami-id from the data source. If the user passes the AMI ID we can use that, if not we can use the data source.

If terraform apply deletes the instance fresh one will restore the data and keep working as it was before

Remove credstash

We now have Parameter Store with KMS encryption or AWS Secret Store. I'll change that with one of these.

Change cron with SSM

Cron is not as reliable as what AWS offers. Also, it's not accountable.

So, I will change the kicking backup script from cron to SSM or Lambda+CloudWatch schedules.

Generated S3 Bucket name should be optional

Well, bucket names are unique across all the regions and customers in AWS.

I wouldn't want to force someone to change resource_name_prefix it's because they can't create a bucket.

I want to set a var that people can customize the bucket name. If the variable is empty, the fallback could be generated.

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.