* feat: support Guest Access settings with `resource_setting_guest_access` * feat: add support for redirect after authentication in guest access settings * feat: add support for Facebook authentication in guest access settings * feat: add support for Google authentication in guest access settings * feat: add support for RADIUS authentication in guest access settings * feat: add support for Wechat authentication in guest access settings * feat: add support for Facebook Wifi authentication in guest access settings * feat: add support for restricted DNS servers * feat: add support for guest portal UI customization * feat: add support for restricted subnet in guest portal * feat: retry client action on HTTP 401, but first attempt relogging in * require controllr version 7.4 for several portal customization attributes * enable acceptance tests workflow concurrency
74 lines
2.5 KiB
Cheetah
74 lines
2.5 KiB
Cheetah
---
|
|
layout: ""
|
|
page_title: "Provider: UniFi"
|
|
description: |-
|
|
The UniFi provider enables management and automation of Ubiquiti UniFi network infrastructure through Terraform.
|
|
---
|
|
|
|
# UniFi Provider
|
|
|
|
The UniFi provider enables infrastructure-as-code management of [Ubiquiti's UniFi](https://www.ui.com/) network controllers and devices. This provider allows you to automate the configuration and management of your UniFi network infrastructure using Terraform.
|
|
|
|
## Supported Features
|
|
|
|
- Manage UniFi network resources using Infrastructure as Code
|
|
- Support for UniFi Controller version 6.x and later
|
|
- Compatible with UDM, UDM-Pro, UCG, and standard controller deployments
|
|
- Comprehensive resource management including:
|
|
- Network/WLAN configuration
|
|
- Firewall rules and groups
|
|
- Port forwarding
|
|
- DNS records
|
|
- User management
|
|
- Device management
|
|
- And more...
|
|
|
|
## Supported Platforms
|
|
|
|
* UniFi Controller version 6.x and later
|
|
* UniFi Dream Machine (UDM)
|
|
* UniFi Dream Machine Pro (UDM-Pro)
|
|
* UniFi Cloud Gateway (UCG)
|
|
* Standard UniFi Controller deployments
|
|
|
|
## Authentication
|
|
|
|
The provider supports two authentication methods:
|
|
|
|
* **Username/Password Authentication** (Traditional method)
|
|
* **API Key Authentication** (Recommended, requires controller version 9.0.108 or later)
|
|
|
|
!> Hard-coding credentials into any Terraform configuration is not recommended, and risks secret leakage should this file ever be committed to a public version control system.
|
|
|
|
### Security Recommendations
|
|
|
|
* Use API Key authentication instead of username/password
|
|
* Create a dedicated service account for Terraform with appropriate permissions
|
|
* Use a **Limited Admin** role with **Local Access Only**
|
|
* Enable HTTPS and valid SSL certificates for your controller
|
|
* Store credentials securely using Terraform variables or environment variables
|
|
* Two-factor authentication (2FA) is not supported
|
|
|
|
### Generating an API Key
|
|
|
|
1. Open your Site in UniFi Site Manager
|
|
2. Click on `Control Plane -> Admins & Users`.
|
|
3. Select your Admin user.
|
|
4. Click `Create API Key`.
|
|
5. Add a name for your API Key.
|
|
6. Copy the key and store it securely, as it will only be displayed once.
|
|
7. Click `Done` to ensure the key is hashed and securely stored.
|
|
8. Use the API Key 🎉
|
|
|
|
## Example Usage
|
|
|
|
Using API Key authentication:
|
|
{{tffile "examples/provider/provider_api_key.tf"}}
|
|
|
|
Using Username/Password authentication:
|
|
{{tffile "examples/provider/provider_user_pass.tf"}}
|
|
|
|
{{ .SchemaMarkdown | trimspace }}
|
|
|
|
## Migrating from paultyng/terraform-provider-unifi
|