Skip to content

brennoo/terraform-provider-hrui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform Provider for HRUI Switches

This is a hobby project to create a Terraform provider for HRUI switches (www.hruitech.com) that are web-managed. It relies on goquery for interfacing with the web UI.

HRUI ODM/OEM

This provider is developed using a Horaco (ZX-SWTG124AS) switch. Other brands that are likely to work with this provider, as they seem to be the same hardware, include:

  • HRUI
  • Horaco
  • Sodola
  • XikeStor
  • AmpCom

Note: Using firmware v1.9.

Getting Started

Requirements

  • Go 1.23 or later
  • Terraform 1.9 or later

Building the provider

  1. Clone the repository:

    git clone github.com/brennoo/terraform-provider-hrui.git
  2. Navigate to the provider directory:

    cd terraform-provider-hrui
  3. Build the provider:

    make build

    This will create an executable file named terraform-provider-hrui in the project directory.

Using the provider

  1. Configure the provider in your Terraform configuration:

    terraform {
      required_providers {
        hrui = {
          source  = "brennoo/hrui"
          version = "~> 0.0.1"      // not released yet
        }
      }
    }
    
    provider "hrui" {
      url      = "http://192.168.2.1"
      username = "admin"
      # The password can be set in HRUI_PASSWORD environment variable
    }
  2. Refer to the examples folder for usage of available resources and data sources.

Developing the provider

  1. Set up a development override in your ~/.terraformrc file:

    provider_installation {
      dev_overrides {
        "brennoo/hrui" = "/path/to/your/project"
      }
      direct {}
    }
    

    Replace /path/to/your/project with the actual path to your provider directory.

  2. Run terraform init in your Terraform project directory.

Contributing

Contributions are welcome! Please see the CONTRIBUTING.md file for guidelines.

License

This provider is licensed under the MPL-2.0 License. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published