Skip to content

An example of how you can use Terraform to set up your home network running on UDM.

License

Notifications You must be signed in to change notification settings

rafalkrol-xyz/ubiquity-unifi-dream-machine-setup-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ubiquiti Unifi Dream Machine Setup

Description

This repository is an example of how you can set up your home network running on Ubiquiti's Unifi Dream Machine (UDM) (probably on other Ubiquiti's products as well, but, I only have the UDM and thus cannot vouch for the others) using Terraform and its community provider for Unifi.

Acknowledgements

Kudos to Paul Tyng for the creation of the Unifi provider for Terraform!

Caveats

  • this example uses Terraform v0.13
  • I use the terraform.tfvars file for passing the secrets in. If you plan on doing the same, you ought to git ignore it
  • the credentials I use for running Terraform on my UDM come from a super admin user who had been created outside of Terraform (manually, through the UDM's GUI)
  • the default LAN network, the one that's created automatically upon the first boot of the UDM, is excluded on purpose from this setup
  • if, as myself, you're too lazy to plug your machine to the UDM with an ethernet cable, expect errors (e.g. Error: unable to determine API URL style: ...) caused by the intermittent disruptions of the WiFi connection that occur when UDM applies your changes
  • there are two important aspects of Terraform that you should consider before adopting this example:

Running

Use the Core Terraform Workflow:

a) git clone this repo

git clone git@github.com:rafalkrol-xyz/ubiquity-unifi-dream-machine-setup-example.git

b) make the necessary changes to Terraform variables (e.g. set the proper password and username)

c) initialize Terraform

terraform init

d) review plan

terraform plan

e) if happy with everything, apply the changes

terraform apply

Pieces of the networking puzzle

If you started with the default UDM settings, this is what you should end up with:

  • networks

The view of your networks as seen in the UDM GUI

  • Wi-Fi networks

The view of your Wi-Fi networks as seen in the UDM GUI

  • firewall groups

The view of your firewall groups as seen in the UDM GUI

  • firewall rules

The view of your networks as seen in the UDM GUI

About

An example of how you can use Terraform to set up your home network running on UDM.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages