Skip to content

Commit fe120f5

Browse files
authored
Release 2.5.0 (#38)
* Merge branch 'feature/update-rabbithole' * Merge branch 'feature/exchange' * Fix go-staticcheck * Refactor queue resource * Fix rabbit-hole for RabbitMQ 3.10 * Update Test action * Fix Update Test action * Update documentation * Update documentation * Update CHANGELOG
1 parent 319d3b7 commit fe120f5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+741
-490
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ name: Tests
33
on:
44
push:
55
branches:
6-
- develop
6+
- '**' # matches every branch
7+
- '!master' # excludes master
78
pull_request:
89

910
jobs:
@@ -14,7 +15,7 @@ jobs:
1415
strategy:
1516
fail-fast: false
1617
matrix:
17-
rmq_version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "4.0"]
18+
rmq_version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "4.0", "4.1"]
1819

1920
env:
2021
RABBITMQ_VERSION: ${{ matrix.rmq_version }}

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,31 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
## 2.5.0 (April 21, 2025)
9+
10+
FEATURE:
11+
12+
* Add `internal` and `alternate_exchange` fields for `rabbitmq_exchange` resource - @rfavreau
13+
14+
* Modify the default value for `durable` field for `rabbitmq_exchange` resource - @rfavreau
15+
16+
* Add an input check to `type` field for `rabbitmq_exchange` resource and set its optional - @rfavreau
17+
18+
* Force the `rabbitmq_exchange` resource to be recreated when a field is updated - @rfavreau
19+
20+
* Add `internal` and `alternate_exchange` fields for `rabbitmq_exchange` datasource - @rfavreau
21+
22+
BUILD / DEV:
23+
24+
* Update _rabbit-hole_ dependency - @rfavreau
25+
26+
* Refactor `rabbitmq_queue` resource - @rfavreau
27+
28+
* Add _RabbitMQ 4.1_ into unit tests - @rfavreau
29+
30+
* Upgrade _resource_exchange_ unit tests - @rfavreau
31+
32+
833
## 2.4.0 (March 16, 2025)
934

1035
FEATURE:

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ build: download
1111
install:
1212
go install
1313

14+
lint:
15+
golangci-lint run
16+
1417
test: build
1518
go test -cover ./rabbitmq
1619

@@ -32,4 +35,4 @@ vet:
3235
exit 1; \
3336
fi
3437

35-
.PHONY: download build install test testacc vet
38+
.PHONY: download build install lint test testacc vet

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
[RabbitMQ](https://rabbitmq.com) is an AMQP message broker server. The **RabbitMQ provider** exposes resources used to manage the configuration of resources in a RabbitMQ server.
1818

19-
The provider supports versions `4.0.x`, `3.13.x` and `3.12.x` of RabbitMQ. It may still work with versions `3.11.x`, `3.10.x`, `3.9.x` and `3.8.x`, however these versions are no longer officialy supported.
19+
The provider supports versions `4.1.x`, `4.0.x`, `3.13.x` and `3.12.x` of RabbitMQ. It may still work with versions `3.11.x`, `3.10.x`, `3.9.x` and `3.8.x`, however these versions are no longer officialy supported.
2020
> For information on RabbitMQ versions, see the RabbitMQ [Release Information](https://www.rabbitmq.com/release-information).
2121
2222
## Usage Example
@@ -27,7 +27,7 @@ terraform {
2727
required_providers {
2828
rabbitmq = {
2929
source = "rfd59/rabbitmq"
30-
version = "2.4.0"
30+
version = "2.5.0"
3131
}
3232
}
3333
}

docs/data-sources/exchange.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ Use this data source to access information about an existing _exchange_.
1515
```terraform
1616
# Read the exchange settings
1717
data "rabbitmq_exchange" "example" {
18-
name = "myexchange"
18+
name = "myexchange"
19+
vhost = "myvhost"
1920
}
2021
```
2122

@@ -33,14 +34,16 @@ data "rabbitmq_exchange" "example" {
3334
### Read-Only
3435

3536
- `id` (String) The ID of this resource.
36-
- `settings` (List of Object) The settings of the exchange. The structure is described below. (see [below for nested schema](#nestedatt--settings))
37+
- `settings` (List of Object) The settings of the exchange. (see [below for nested schema](#nestedatt--settings))
3738

3839
<a id="nestedatt--settings"></a>
3940
### Nested Schema for `settings`
4041

4142
Read-Only:
4243

43-
- `arguments` (Map of String)
44-
- `auto_delete` (Boolean)
45-
- `durable` (Boolean)
46-
- `type` (String)
44+
- `alternate_exchange` (String) If messages to this exchange cannot otherwise be routed, send them to the alternate exchange named here.
45+
- `arguments` (Map of String) Additional key/value settings for the exchange.
46+
- `auto_delete` (Boolean) If `true`, the exchange will delete itself after at least one queue or exchange has been bound to this one, and then all queues or exchanges have been unbound.
47+
- `durable` (Boolean) Whether the exchange survives server restarts.
48+
- `internal` (Boolean) If `true`, clients cannot publish to this exchange directly. It can only be used with exchange to exchange bindings.
49+
- `type` (String) The type of exchange. Possible values are `direct`, `fanout`, `headers` and `topic`.

docs/resources/exchange.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ resource "rabbitmq_exchange" "example" {
3737
### Required
3838

3939
- `name` (String) The name of the exchange.
40-
- `settings` (Block List, Min: 1, Max: 1) The settings of the exchange. The structure is described below. (see [below for nested schema](#nestedblock--settings))
40+
- `settings` (Block List, Min: 1, Max: 1) The settings of the exchange. (see [below for nested schema](#nestedblock--settings))
4141

4242
### Optional
4343

@@ -50,12 +50,23 @@ resource "rabbitmq_exchange" "example" {
5050
<a id="nestedblock--settings"></a>
5151
### Nested Schema for `settings`
5252

53-
Required:
54-
55-
- `type` (String) The type of exchange.
56-
5753
Optional:
5854

55+
- `alternate_exchange` (String) If messages to this exchange cannot otherwise be routed, send them to the alternate exchange named here.
5956
- `arguments` (Map of String) Additional key/value settings for the exchange.
60-
- `auto_delete` (Boolean) Whether the exchange will self-delete when all queues have finished using it. Defaults to `false`.
61-
- `durable` (Boolean) Whether the exchange survives server restarts. Defaults to `false`.
57+
- `auto_delete` (Boolean) If `true`, the exchange will delete itself after at least one queue or exchange has been bound to this one, and then all queues or exchanges have been unbound. Defaults to `false`.
58+
- `durable` (Boolean) Whether the exchange survives server restarts. Defaults to `true`.
59+
60+
~> The default value of `durable` field has been updated since version **2.5.0**. Before it was `false`!
61+
62+
- `internal` (Boolean) If `true`, clients cannot publish to this exchange directly. It can only be used with exchange to exchange bindings. Defaults to `false`.
63+
- `type` (String) The type of exchange. Possible values are `direct`, `fanout`, `headers` and `topic`. Defaults to `direct`.
64+
65+
## Import
66+
67+
Import is supported using the following syntax:
68+
69+
```shell
70+
# Exchange can be imported by specifying its name and its vhost (with a '@' between the both value).
71+
terraform import rabbitmq_exchange.example myexchange@myvhost
72+
```
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Read the exchange settings
22
data "rabbitmq_exchange" "example" {
3-
name = "myexchange"
3+
name = "myexchange"
4+
vhost = "myvhost"
45
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Exchange can be imported by specifying its name and its vhost (with a '@' between the both value).
2+
terraform import rabbitmq_exchange.example myexchange@myvhost

go.mod

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ module github.com/rfd59/terraform-provider-rabbitmq
33
require (
44
github.com/hashicorp/terraform-plugin-docs v0.21.0
55
github.com/hashicorp/terraform-plugin-sdk/v2 v2.36.1
6-
github.com/michaelklishin/rabbit-hole/v2 v2.16.0
6+
github.com/michaelklishin/rabbit-hole/v3 v3.2.0
77
golang.org/x/mod v0.24.0
88
)
99

10-
replace github.com/michaelklishin/rabbit-hole/v2 => github.com/rfavreau/rabbit-hole/v2 v2.16.1
10+
replace github.com/michaelklishin/rabbit-hole/v3 => github.com/rfavreau/rabbit-hole/v3 v3.2.0-2
1111

1212
require (
1313
github.com/BurntSushi/toml v1.2.1 // indirect
@@ -24,7 +24,7 @@ require (
2424
github.com/cloudflare/circl v1.3.8 // indirect
2525
github.com/fatih/color v1.17.0 // indirect
2626
github.com/golang/protobuf v1.5.4 // indirect
27-
github.com/google/go-cmp v0.6.0 // indirect
27+
github.com/google/go-cmp v0.7.0 // indirect
2828
github.com/google/uuid v1.6.0 // indirect
2929
github.com/hashicorp/cli v1.1.7 // indirect
3030
github.com/hashicorp/errwrap v1.1.0 // indirect
@@ -68,13 +68,13 @@ require (
6868
github.com/yuin/goldmark-meta v1.1.0 // indirect
6969
github.com/zclconf/go-cty v1.16.2 // indirect
7070
go.abhg.dev/goldmark/frontmatter v0.2.0 // indirect
71-
golang.org/x/crypto v0.33.0 // indirect
71+
golang.org/x/crypto v0.36.0 // indirect
7272
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect
73-
golang.org/x/net v0.34.0 // indirect
74-
golang.org/x/sync v0.11.0 // indirect
75-
golang.org/x/sys v0.30.0 // indirect
76-
golang.org/x/text v0.22.0 // indirect
77-
golang.org/x/tools v0.22.0 // indirect
73+
golang.org/x/net v0.38.0 // indirect
74+
golang.org/x/sync v0.12.0 // indirect
75+
golang.org/x/sys v0.32.0 // indirect
76+
golang.org/x/text v0.23.0 // indirect
77+
golang.org/x/tools v0.31.0 // indirect
7878
google.golang.org/appengine v1.6.8 // indirect
7979
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect
8080
google.golang.org/grpc v1.69.4 // indirect

0 commit comments

Comments
 (0)