Skip to content

bbbates/pulumi-unifi-native

Repository files navigation

Unifi Pulumi Provider

A native Pulumi provider for managing Unifi resources.

Goals

To:

  • Provide a native Pulumi provider for Unifi resources, and
  • Support all Unifi resources that can be managed via the Unifi API, and
  • Be a good platform for which to build upon for more complex and common Unifi use cases

Currently, to manage Unifi resources via Pulumi, you need to make use of one of the Terraform providers, which are not complete.

Status

  • This provider is in very very early stages of development. I have the provider working with my reasonably simple Unifi ecosystem (a Dream Machine, a few APs, a couple of switches, some basic firewall rules, and a few VLANs).

  • Currently, I have only included the Python SDK, as that is what I am using. If you would like to help out with the other SDKs, please let me know!

  • You will need to clone and build the provider to use locally.

  • Documentation is non-existent - this is a task for the future. Will be best to peruse the python SDK packages to get an understanding of what can be done with this provider.

This issue tracks progress.

Examples

Examples can be found here:

Build the provider

$ make gen generate_schema provider install

This will:

  1. Create the SDK codegen binary and place it in a ./bin folder (gitignored)
  2. Create the provider binary and place it in the ./bin folder (gitignored)
  3. Install the provider on your machine.

Configuration

The following configuration options are available for the provider:

Name Description Required Default Value
unifi-native:apiKey The API key to use for authentication with the Unifi controller. Yes
unifi-native:apiHost The hostname or IP address of the Unifi controller. Yes
unifi-native:allowInsecure If you are using a self-signed cert on the controller, set this to true No false
unifi-native:siteId The site name that the stack will be applied against No default

Importing Existing Resources

The type slugs generally follow the `unifi-native:lowercaseresourcename:CamelCaseResourceName. For example:

$ pulumi import 'unifi-native:firewallrule:FirewallRule' NameOfFirewallRule 'LONGID'

Testing the provider

UnifiOS is loaded in a vagrant box as the test fixture. To run the tests, you will need to have vagrant installed (and libvirt, so only linux hosts for now).

cd examples && go test

# This will create the test fixture and run the tests against it.

Thanks to

About

Pulumi unifi resource provider generated from unifi-api openapi spec

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •