Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oirad/terraform-hetzner-wireguard
Creates a wireguard server and configuration on Hetzner cloud
https://github.com/oirad/terraform-hetzner-wireguard
hetzner-cloud terraform wireguard-vpn-setup
Last synced: 3 months ago
JSON representation
Creates a wireguard server and configuration on Hetzner cloud
- Host: GitHub
- URL: https://github.com/oirad/terraform-hetzner-wireguard
- Owner: oirad
- Created: 2020-03-28T08:34:06.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-03-28T12:13:02.000Z (over 4 years ago)
- Last Synced: 2024-05-17T23:34:16.428Z (6 months ago)
- Topics: hetzner-cloud, terraform, wireguard-vpn-setup
- Language: Shell
- Homepage:
- Size: 2.93 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-starred - oirad/terraform-hetzner-wireguard - Creates a wireguard server and configuration on Hetzner cloud (terraform)
README
# Terraform to create wireguard server on hetzner cloud
## WARNING
The script exposes the client configuration on port 80 on the IP, this is only intended to be used as a temporary solution to spin up a new server when needed.
If you do not want this behaviour and want to keep the server running, modify [user_data.sh](user_data.sh#L59) removing the line.
## Basic Set-up
1. Go to https://console.hetzner.cloud/projects
2. Create a new project
3. Within the project navigate to Access > API Tokens
4. Create a new token
5. Copy the token in a file named `secrets.tfvars` which will look like
```
hcloud_token = "MY_TOKEN_CONTENT_FROM_HETZNER"
```
6. `terraform init`
7. `terraform apply -var-file secrets.tfvars`
8. Confirm by typing `yes` when prompted
9. Wait for the process to finish, you should see an output that looks like:
```
Apply complete! Resources: 1 added, 0 changed, 1 destroyed.Outputs:
server_ip = 116.203.147.163
```
10. Open the IP (might take a little to start) and download the hetzner.conf file
11. Import this in your Wireguard client## Advanced Set-up
### SSH Key
In case you want to access the created server copy the contents of your public ssh key (Usually stored at `~/.ssh/id_rsa.pub`) in `secrets.tfvars` adding a line that looks like:
```
ssh_key = "MY_PUBLIC_SSH_KEY_CONTENT"
```### Server location
The default server location used is `nbg1`, you can change this by modifying `variables.tf` or add a line in `secrets.tfvars` with:
```
location = "fsn1"
```