This repo provides an example template that supports a GitHub Actions pipeline building and destroying an OpenVPN EC2 server on demand. This template makes use of the paulmarsicloud/openvpn-ephemeral/aws Terraform Module and the pipeline is created using the paulmarsicloud/terragrunt-awscli Docker container.
In order to utilize this template repo, you will need an AWS Account with an IAM user that has programmatic access, and OpenVPN Connect installed on your local machine.
In order to use this template, simply clone/fork this repo, and update the following:
- The
public_ip: <REPLACE ME>
environment variable in the example<REGION>-create.yml
and<REGION>-destroy.yml
files with your local public IP address (e.g.curl 4.ipaddr.io
) - In the project Settings go to Secrets > Actions > and add environment variables for your
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY_ID
values.
- When ready to use OpenVPN, go to Actions
- Click on the region name listed under Workflow for the region you want to use:
- Click the
Run Workflow
option to start the<REGION> OpenVPN Create
workflow for that region: - Wait for the
<REGION> OpenVPN Create
job to complete - this can take a couple of minutes - When completed, click on the workflow run and you will see the Artifacts at the bottom of your screen. You can download the
openvpn.ovpn
file to your local machine: - Open
openvpn.ovpn
on your local machine with your OpenVPN Connect application - When ready to destroy, simply disconnect from the OpenVPN Connect profile, go back to Actions, select the
<REGION> OpenVPN Destroy
Workflow for your region. Click theRun Workflow
option and ensure that the destroy workflow completes successfully