* docs: improve provider documentation * fix accidentally changed type of stormctrl_ucast_rate * docs: add badges and plans to readme
73 lines
2.3 KiB
Cheetah
73 lines
2.3 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
|
|
|
|
The provider supports management of:
|
|
|
|
* Networks and VLANs
|
|
* Wireless Networks (WLANs)
|
|
* Firewall Rules and Groups
|
|
* Port Forwarding
|
|
* DNS Records
|
|
* User Management
|
|
* Device Configuration
|
|
* 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
|