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 Go Report Card Build Status Test Status codecov


The RabbitMQ Terraform Provider allows you to declaratively manage RabbitMQ resources such as virtual hosts, users, permissions, and more.

It supports RabbitMQ versions 4.1.x, 4.0.x, 3.13.x, and 3.12.x. Older releases (3.11.x to 3.8.x) may still work but are no longer officially supported.
➡️ See the official RabbitMQ release information for details.


🚀 Quick Start

terraform {
  required_providers {
    rabbitmq = {
      source  = "rfd59/rabbitmq"
      version = "2.6.0"
    }
  }
}

provider "rabbitmq" {
  # The RabbitMQ management plugin must be enabled.
  # Enable with: $ sudo rabbitmq-plugins enable rabbitmq_management
  # Docs: https://www.rabbitmq.com/docs/management

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

resource "rabbitmq_vhost" "example" {
  name = "vhost_example"
}

🛠 Development & Contribution

Requirements

Build the Provider

# Clone your fork
git clone [email protected]:<your-username>/terraform-provider-rabbitmq.git
cd terraform-provider-rabbitmq

# Compile
make build
$GOPATH/bin/terraform-provider-rabbitmq

👉 To check your GOPATH:

go env GOPATH

Run Acceptance Tests

make testacc

Build Documentation

make doc

🧪 Using the Provider Locally

  1. Add or update your ~/.terraformrc:

    provider_installation {
      dev_overrides {
        "rfd59/rabbitmq" = "${GOPATH}/bin"
      }
      direct {}
    }
  2. Start RabbitMQ locally:

    ./scripts/testacc.sh setup

    ➡️ Console available at http://localhost:15672 (user: guest / password: guest)

  3. Build the provider:

    make build
  4. Apply examples:

    terraform -chdir=./examples/... apply

🤝 Contributing

Contributions are welcome!

Please open an issue first to discuss what you would like to change.

Guidelines:

  • Format code with gofmt

    gofmt -w .

  • Lint with golangci-lint

    golangci-lint run

  • Write unit tests for new features
  • Open a Pull Request to develop branch.

📄 License

This project is licensed under the MIT License.

Packages

No packages published

Languages

  • Go 99.0%
  • Other 1.0%