Skip to content

Module to install wireguard remotely and generate clients configurations

License

Notifications You must be signed in to change notification settings

Tchoupinax/terraform-module-wireguard

Repository files navigation

terraform-module-wireguard

Terraform Version

Requirements

Name Version
terraform >= 1.1.9

Providers

Name Version
local n/a
null n/a
template n/a

Modules

No modules.

Resources

Name Type
local_file.client resource
local_file.server resource
null_resource.clean-local resource
null_resource.configure-wireguard-server resource
null_resource.install_wireguard resource
local_file.client_private_key data source
local_file.client_public_key data source
local_file.server_private_key data source
local_file.server_public_key data source
template_file.client_config data source
template_file.server_config data source

Inputs

Name Description Type Default Required
CIDR Provide the network to use for the VPN. string "10.42.42.42/0" no
clients_count Provide the number of client you want. number 1 no
clients_name Provide the name you want for your clients. list(string) null no
depends_on_ Resource dependency of this module. list(string) null no
server_ssh_ip The reachable ip on which wireguard's server will be installed. string n/a yes
server_ssh_private_key The private ssh key to use to access the server via SSH. string n/a yes
server_ssh_user The user to use to access the server via SSH. string "root" no

Outputs

Name Description
clients_configs The list of all generated clients

terraform-docs markdown table --output-file README.md --output-mode inject .

qrencode -t ansiutf8 < modules/wireguard/live/client1.conf

mkdir -p /usr/local/etc/wireguard/ cp ./modules/wireguard/live/client1.conf /usr/local/etc/wireguard/wg0.conf wg-quick up wg0 wg-quick down wg0