{"id":19696538,"url":"https://github.com/romankurnovskii/openvpn_ec2_cf_template","last_synced_at":"2025-04-29T11:32:08.360Z","repository":{"id":155099993,"uuid":"632459212","full_name":"romankurnovskii/openvpn_ec2_cf_template","owner":"romankurnovskii","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-08T21:22:42.000Z","size":11,"stargazers_count":3,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-05T15:11:22.785Z","etag":null,"topics":["aws","cloudformation","ec2","openvpn-server"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/romankurnovskii.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-25T13:00:04.000Z","updated_at":"2024-01-12T14:57:12.000Z","dependencies_parsed_at":"2024-01-07T21:28:29.071Z","dependency_job_id":"dd45d6ad-f758-426d-92b5-05ea6103b07d","html_url":"https://github.com/romankurnovskii/openvpn_ec2_cf_template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romankurnovskii%2Fopenvpn_ec2_cf_template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romankurnovskii%2Fopenvpn_ec2_cf_template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romankurnovskii%2Fopenvpn_ec2_cf_template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romankurnovskii%2Fopenvpn_ec2_cf_template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/romankurnovskii","download_url":"https://codeload.github.com/romankurnovskii/openvpn_ec2_cf_template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251494020,"owners_count":21598218,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","cloudformation","ec2","openvpn-server"],"created_at":"2024-11-11T19:35:29.650Z","updated_at":"2025-04-29T11:32:08.014Z","avatar_url":"https://github.com/romankurnovskii.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenVPN on AWS EC2 with CloudFormation\n\nA quick and easy way to set up and maintain your own VPN using the open-source version of OpenVPN on an Amazon Web Services (AWS) EC2 instance.\n\n## Features\n\n- Simple setup using AWS CloudFormation\n- OpenVPN server on an AWS EC2 instance\n- Configurable instance type and region\n- Automatic client configuration generation\n- Secure key storage in an S3 bucket\n- Automated server updates and maintenance\n\n## Quick Start\n\n- Sign in to your [AWS Management Console](https://console.aws.amazon.com/)\n- Click on the \"Create Stack\" button in the [CloudFormation Console](https://console.aws.amazon.com/cloudformation/home)\n- Upload the provided CloudFormation template and follow the prompts\n- Once the stack creation is complete, go to the **Outputs** tab in CloudFormation to find the S3 URL for your client configuration\n- Download the client configuration file (`client.ovpn`) and use it with your OpenVPN client software\n\n### From CLI\n\n```\n\nstack_name=MyStack\n\naws cloudformation create-stack --stack-name \"$stack_name\"  --capabilities CAPABILITY_NAMED_IAM --template-body file:///Users/r/Desktop/github/openvpn_ec2_cf_template/cf_template.yml\n\naws cloudformation describe-stacks --stack-name \"$stack_name\" \n# aws cloudformation describe-stacks --stack-name \"$stack_name\"  --query \"Stacks[0].Outputs\"\n# aws cloudformation describe-stack-events --stack-name \"$stack_name\" \n\noutput_json=$(aws cloudformation describe-stacks --stack-name \"$stack_name\" --query \"Stacks[0].Outputs\")\necho $output_json\n\ns3_url=$(echo $output_json | jq -r '.[] | select(.OutputKey==\"ClientConfigurationUrl\").OutputValue' | sed 's|https://s3.console.aws.amazon.com/s3/object/||')\n\nbucket_name=$(echo $s3_url | cut -d '/' -f 1)\necho \"bucket_name: $bucket_name\"\n\ns3_file=\"s3://${s3_url}\"\necho \"s3_file: $s3_file\"\n\naws s3 cp \"$s3_file\" .\n\n# ==== remove\naws s3 rm \"s3://${bucket_name}/\" --recursive\naws s3 ls \"s3://${bucket_name}/\"\n\n# aws s3api delete-bucket --bucket your-bucket-name\n\naws cloudformation delete-stack --stack-name \"$stack_name\" \n```\n\n## Details\n\n### Cost\n\nThe cost of running this VPN solution mainly depends on the selected EC2 instance type and the data transfer. The default instance type is **t3a.nano**, which should be sufficient for most personal VPN use cases. \n\nThe cost for this instance type is approximately **$3-4/month**, depending on the region for instance **ondemand**. Current setup is for spot, so it can be **~$1-2/month**.\n\n\n### Technical Details\n\nThis project uses AWS CloudFormation to create and manage the following resources:\n\n- EC2 instance (Ubuntu) with OpenVPN server \n- EC2 security group for allowing VPN and SSH access\n- Elastic IP address associated with the EC2 instance\n- S3 bucket for securely storing client configurations\n- IAM role and policies for granting necessary permissions\n- The provided Bash scripts automate the installation and configuration of OpenVPN, as well as generating client configuration files.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromankurnovskii%2Fopenvpn_ec2_cf_template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fromankurnovskii%2Fopenvpn_ec2_cf_template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromankurnovskii%2Fopenvpn_ec2_cf_template/lists"}