Skip to content

I just want an OpenVPN 🔐 Get private openvpn access with a single command :)

Notifications You must be signed in to change notification settings

VardyNg/OpenVPN-on-EC2

Repository files navigation

I just want a quick OpenVPN

Deploy VPN servers on any AWS region, get openvpn access using a single command, auto config ec2 instance and download the config file.

Terraform

DEMO

TL;DR

# put your ec2 key pair (.pem) in the project root
terraform init && terraform apply --auto-approve

Wait for the execution to finish, the client.ovpn will be downloaded to the project root soon.

Prerequisites

  • Terraform
  • AWS account
  • AWS EC2 key pair

How to use

  1. Configure variables for custom use

    Variable Description Default Required
    app_name application name openvpn-on-ec2 no
    region AWS region to deploy the resources us-west-1 no
    instance_type EC2 instance type t4g.small no
    ec2_key_name EC2 key pair name - yes
    ec2_ami_id Map of AMI IDs for each region see variable.tf no

    The variable can be configured in the tfvars files

  2. Initialise terraform

    terraform init
  3. Put your ec2 key pair (.pem) in the project root, otherwise the vpn config can't be downloaded

  4. Deploy resources

    terraform plan -o plan.out

    and

    terraform apply plan.out

What resources are provisioned

  • VPC
  • Public Subnet
  • Security Group
  • EC2

Clean up

terraform destroy

About

I just want an OpenVPN 🔐 Get private openvpn access with a single command :)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages