Skip to content

rfd59/terraform-provider-rabbitmq

 
 

Repository files navigation

Terraform logo

Terraform Provider for RabbitMQ

GitHub Release GitHub Issues GitHub Pull Requests GitHub License

Go version GitHub Actions Workflow Status GitHub Actions Workflow Status Coverage

RabbitMQ is an AMQP message broker server. The RabbitMQ provider exposes resources used to manage the configuration of resources in a RabbitMQ server.

The provider supports versions 3.13.x, 3.12.x and 3.11.x of RabbitMQ. It may still work with versions 3.10.x, 3.9.x and 3.8.x, however these versions are no longer officialy supported.

For information on RabbitMQ versions, see the RabbitMQ Release Information.

Usage Example

# 1. Specify the version of the RabbitMQ Provider to use
terraform {
  required_providers {
    azurerm = {
      source = "rfd59/rabbitmq"
      version = "2.1.0"
    }
  }
}

# 2. Configure the RabbitMQ Provider
provider "azurerm" {
  # The RabbitMQ management plugin must be enabled on the server, to use this provider.
  # You can enable the plugin by doing something similar to `$ sudo rabbitmq-plugins enable rabbitmq_management`
  # https://www.rabbitmq.com/docs/management

  endpoint = "http://127.0.0.1"
  username = "guest"
  password = "guest"
}

# 3. Create a Virtual Hosts into the RabbitMQ Server
resource "rabbitmq_vhost" "example" {
  name = "vhost_example"
}

Developing & Contributing to the Provider

Requirements

Building the Provider

  1. Fork and Clone this repository localy

  2. To compile the provider, run make build. This will build the provider and put the provider binary in the $GOPATH/bin directory.

    \$ make build
    ...
    \$ $GOPATH/bin/terraform-provider-rabbitmq
    ...

    To find the '${GOPATH}', you can run go env GOPATH.

  3. In order to run the full suite of Acceptance tests, run make testacc.

    \$ make testacc
  4. In order to build the Provider documentation, run make doc.

    \$ make doc

Using this Provider locally

To launch the examples terraform scripts with your local Provider, follow these steps:

  1. Into your home folder, add/update the ~/.terraformrc file with:

    provider_installation {
    
    dev_overrides {
          "rfd59/rabbitmq" = "${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 {}
    }

    To find the '${GOPATH}', you can run go env GOPATH.

  2. Launch a RabbitMQ engine by ./scripts/testacc.sh setup command.

    The RabbitMQ console will be available by http://localhost:15672 (guest/guest)

  3. If it's not already done, build you local Provider by make build command.

  4. Launch terraform -chdir=./examples/... apply to apply the example.