Plumber Terraform Provider
Terraform can be used to manage Plumber when running in server mode. You can manage connections, relays, and tunnels
Usage
You will first need to be running Plumber in server mode. See Plumber Server Mode for more information on getting it set up
First define the provider config. For our example, we're putting plumber's authentication token in the config, but it is recommended that you use the PLUMBER_TOKEN
environment variable to set this value, or pull in via a secrets manager such as Vault.
You will also need to fill in the address
variable so terraform knows where to talk to your plumber server instance
Creating Connections
You can use the plumber_connection
resource to manage connections
See https://registry.terraform.io/providers/batchcorp/plumber/latest/docs/resources/connection for all available connection types and their parameters
Create Relays
Need to ship messages to your Batch.sh collections? Create a relay with the above connection easily:
Create Replay Tunnel
Plumber can act as a replay destination, allowing you to replay messages to your bus without the need to punch holes in firewalls or hand out credentials.
For this functionality, you will need to obtain an API token from https://console.streamdal.com/account/security
As with the plumber token, we don't recommend storing the API token in your terraform files. You can use the environment variable BATCHSH_TOKEN
to provide it to terraform. However for demo purposes, we'll just put it in the terraform config:
After applying, you can go to https://console.streamdal.com/destinations, you will see your newly created "Tunnel to infra kafka" destination. You can replay messages from your collections to this destination, and plumber will write them to the new_orders
topic in your kafka. No fussing with credentials or firewalls!
Last updated