Skip to content

marcomezzaro/terraform-provider-haproxy-pf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform Provider Haproxy

This provider uses Haproxy Dataplane api in order to manage Terraform objects.

Built with Terraform plugin framework.

Checklist:

  • Backend
  • Frontend
  • Bind
  • Server
  • Server Template

TODO:

  • ACL
  • More resource options

Dev Build provider

set terraformrc file with dev_overrides

# ~/.terraformrc 
provider_installation {

  dev_overrides {
      "registry.terraform.io/marcomezzaro/haproxy-pf" = "<GOPATH>/bin/"
  }

  # For all other providers, install them directly from their origin provider
  # registries as normal. If you omit this, Terraform will _only_ use
  # the dev_overrides block, and so no other providers will be available.
  direct {}
}

Run the following command to build the provider

$ make install

build and run haproxy for testing

podman build -t haproxy-dp -f docker/Dockerfile docker/
podman run -it --rm -p 5555:5555 --name haproxy localhost/haproxy-dp:latest

Run ACC Test

TF_ACC=1 HAPROXY_SERVER="localhost:5555" HAPROXY_USERNAME="admin" HAPROXY_PASSWORD="adminpwd" HAPROXY_INSECURE="true" go test -v -cover -count 1 ./haproxy/

Generate doc

go generate ./...

Test sample configuration

First, build and install the provider.

$ make install

Then, navigate to the examples directory. and use the example to create terraform manifests

$ cd examples

Run the following command to initialize the workspace and apply the sample configuration.

$ terraform init && terraform apply

Special Thanks

https://github.com/matthisholleville

About

A Terraform provider for HAproxy

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages