Created
April 15, 2018 07:37
-
-
Save premist/83e5a28747cb02eeda37d378d532e212 to your computer and use it in GitHub Desktop.
$0.01/hour self-destructing VPN server on Google Cloud Platform
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
GCP_PROJECT=my-gce-project | |
GCP_ZONE=asia-northeast1-b # Tokyo | |
GCP_MACHINE_TYPE=g1-small # f1-micro is also fine | |
VPN_NAME=my-vpn | |
VPN_PSK=somesufficientlylongpsk | |
VPN_USERS=myself:mysomesortofsecurepassword | |
set -ex | |
gcloud components install beta --quiet | |
gcloud beta compute instances create-with-container $VPN_NAME \ | |
--project $GCP_PROJECT \ | |
--zone $GCP_ZONE \ | |
--machine-type=$GCP_MACHINE_TYPE \ | |
--preemptible \ | |
--container-privileged \ | |
--container-image=premist/softethervpn:v0.0.1 \ | |
--container-env=PSK=$VPN_PSK,USERS=$VPN_USERS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$0.01/hour doesn't include bandwidth cost.