Skip to content

matthisholleville/terraform-provider-haproxy

Repository files navigation

Pritunl logo Terraform logo

Terraform Provider to configure HAProxy

Requirements

  • Terraform >=1.1.x
  • Go 1.17.x (to build the provider plugin)

Building The Provider

$ git clone [email protected]:matthisholleville/terraform-provider-haproxy.git
$ go build -o terraform-provider-haproxy

Testing The Provider

$ make test

Example usage

# Set the required provider and versions
terraform {
  required_providers {
    haproxy = {
      version = "~> 1.0.0"
      source  = "matthisholleville/haproxy"
    }
  }
}

# Configure the haproxy provider
provider "haproxy" {
  server_addr = "10.100.0.130:5555"
  username    = "CHANGE_ME"
  password    = "CHANGE_ME"
  insecure    = true
}

# Create a new entrie in the ratelimit HAProxy Maps file
resource "haproxy_maps" "test" {
  map   = "ratelimit"
  key   = "/metrics"
  value = "50"
}

Ressources implemented

  • maps
  • frontend

Ressources in the roadmap

  • backend
  • server
  • acl
  • httpRequestRule
  • httpResponseRule

License

The Terraform HAProxy Provider is available to everyone under the terms of the Mozilla Public License Version 2.0. Take a look the LICENSE file.