Table of Contents
Terraform provider plugin for managing Solace appliances using the Solace SEMP v2 API.
Using the Binary Packages
Download the release binary from and copy it to $HOME/terraform.d/plugins/<os>_<arch>/terraform-provider-solace
as explained in the terraform docs.
For example, in a Linux environment you would copy it to /home/youruser/terraform.d/plugins/linux_amd64/terraform-provider-solace
, for a MacOS environment to /Users/youruser/terraform.d/plugins/darwin_amd64/terraform-provider-solace
.
Building The Provider From Source
Clone repository to: $GOPATH/src/github.com/ExalDraen/terraform-provider-solace
mkdir -p $GOPATH/src/github.com/ExalDraen; cd $GOPATH/src/github.com/ExalDraen
git clone git@github.com:ExalDraen/terraform-provider-solace
Enter the provider directory and build the provider
cd $GOPATH/src/github.com/ExalDraen/terraform-provider-solace
make
Developing the Provider
If you wish to work on the provider, you'll first need Go installed on your machine (version 1.8+ is required). You'll also need to correctly setup a GOPATH, as well as adding $GOPATH/bin
to your $PATH
.
To compile the provider, run make
. This will build the provider and put the provider binary in the $GOPATH/bin
directory.
$ make build
...
$ $GOPATH/bin/terraform-provider-solace
...
Testing the Provider
To run acceptance tests you will need to run a local solace instance. Once the instance is running you will need to export the following environment variables.
export SOLACE_USER="admin"
export SOLACE_PASSWORD="alex"
export SOLACE_HOST="localhost:8080"
You can then run the acceptance tests with
TF_ACC=1 make test
Documentation
The provider very closely mirrors the SEMPv2 API, including resource and attribute names. In most cases, the name of attributes and resources is the same as in the SEMP API, with snake_case
instead of CamelCase
. For example max_connection_count
instead of MaxConnectionCount
.
See examples/main.tf for some usage examples.
Configuration
The provider may be configured using terraform as normal, e.g.
provider "solace" {
host = "localhost:8080"
base_path = "/SEMP/v2/config"
user = "admin"
password = "alex"
msg_vpn = "go-tf-1"
}
or using the corresponding SOLACE_*
environment variables. Check provider.go
to see which variables are available.