Terraform configuration for deploying easy-wg-quick in Google Cloud Platform
These instructions will get you a copy of the project up and running on your Google Cloud Platform account.
Installed and configured gcloud and terraform tools are required to deploy this project in your infrastructure.
Clone repository.
git clone https://github.com/burghardt/tf-gcp-easy-wg-quick.git
Login to your GCP account, when running Terraform on your workstation use command below.
gcloud auth application-default login
Set JSON credentials file name and GCP project name in the terraform.tfvars
file.
project = "gcp-project-name"
credentials_file = "~/.config/gcloud/application_default_credentials.json"
Then follow the typical Terraform command sequence to deploy easy-wg-quick
to the cloud.
terraform init
terraform validate
terraform plan
terraform apply
When the deployment is ready local-exec
of gcloud
will dump the QR code
to the console. Scan it with the mobile Wireguard application. Outputs also
contain examples of gcloud
commands to access the wghub instance.
The region, zone, and boot image are customizable with variables. Keep in mind that instance-startup.bash script assumes recent releases of Debian/Ubuntu with Wireguard available for APT. If switching to another distribution, adjust this script accordingly.
To add more clients or configure easy-wg-quick
parameters modify instance-startup.bash script. Refer to easy-wg-quick documentation for details.
Direct access to port 22 from the Internet is disabled by design. So instead, use IAP tunneling to access wghub securely.
gcloud compute ssh --tunnel-through-iap ...
Script data is available on wghub instance in the /root/easy-wg-quick
directory.
This project is licensed under the MPL-2.0 License - see the LICENSE file for details.