Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: cloudamqp/terraform-provider-cloudamqp
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.27.0
Choose a base ref
...
head repository: cloudamqp/terraform-provider-cloudamqp
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.27.1
Choose a head ref
  • 20 commits
  • 25 files changed
  • 6 contributors

Commits on Jul 8, 2023

  1. Fix typo (#213)

    walro authored Jul 8, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e58440b View commit details

Commits on Jul 17, 2023

  1. Copy the full SHA
    1b513eb View commit details
  2. Bump google.golang.org/grpc from 1.50.1 to 1.53.0 (#212)

    Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.50.1 to 1.53.0.
    - [Release notes](https://github.com/grpc/grpc-go/releases)
    - [Commits](grpc/grpc-go@v1.50.1...v1.53.0)
    
    ---
    updated-dependencies:
    - dependency-name: google.golang.org/grpc
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Jul 17, 2023
    Copy the full SHA
    4346829 View commit details
  3. Copy the full SHA
    5edfdff View commit details
  4. Bump GitHub Actions

    Make workflow more similar to what is used by
    https://github.com/CloudKarafka/terraform-provider-cloudkarafka
    
    - use .go-version in actions
    - actions/setup-go@v4 caches by default
    
    Close #179
    dentarg committed Jul 17, 2023
    Copy the full SHA
    00f4368 View commit details

Commits on Aug 2, 2023

  1. Copy the full SHA
    b9f5d64 View commit details
  2. Update CHANGELOG.md

    tbroden84 authored Aug 2, 2023
    Copy the full SHA
    d85d9c6 View commit details

Commits on Aug 10, 2023

  1. Bump goreleaser/goreleaser-action from 4.3.0 to 4.4.0 (#217)

    Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 4.3.0 to 4.4.0.
    - [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
    - [Commits](goreleaser/goreleaser-action@336e299...3fa32b8)
    
    ---
    updated-dependencies:
    - dependency-name: goreleaser/goreleaser-action
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Aug 10, 2023
    Copy the full SHA
    acbe149 View commit details

Commits on Aug 24, 2023

  1. Update docs

    Instance: Upgrade/downgrade subscription plan
    RabbitMQ config: Known issue with null vs. default values
    Alarm: Mandatory notice alarm
    tbroden84 committed Aug 24, 2023
    Copy the full SHA
    ff971bb View commit details

Commits on Aug 31, 2023

  1. Update documentation with info about rolling upgrades (#221)

    Co-authored-by: Patrik Ragnarsson <[email protected]>
    annieblomgren and dentarg authored Aug 31, 2023
    Copy the full SHA
    1a56f2d View commit details

Commits on Sep 4, 2023

  1. Bump crazy-max/ghaction-import-gpg from 5.3.0 to 5.4.0 (#224)

    Bumps [crazy-max/ghaction-import-gpg](https://github.com/crazy-max/ghaction-import-gpg) from 5.3.0 to 5.4.0.
    - [Release notes](https://github.com/crazy-max/ghaction-import-gpg/releases)
    - [Commits](crazy-max/ghaction-import-gpg@72b6676...d6f3f49)
    
    ---
    updated-dependencies:
    - dependency-name: crazy-max/ghaction-import-gpg
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Sep 4, 2023
    Copy the full SHA
    6ed0262 View commit details
  2. Bump actions/checkout from 3 to 4 (#223)

    Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
    - [Release notes](https://github.com/actions/checkout/releases)
    - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
    - [Commits](actions/checkout@v3...v4)
    
    ---
    updated-dependencies:
    - dependency-name: actions/checkout
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Sep 4, 2023
    Copy the full SHA
    ea2538c View commit details

Commits on Sep 5, 2023

  1. Bump goreleaser/goreleaser-action from 4.4.0 to 4.6.0 (#225)

    Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 4.4.0 to 4.6.0.
    - [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
    - [Commits](goreleaser/goreleaser-action@3fa32b8...5fdedb9)
    
    ---
    updated-dependencies:
    - dependency-name: goreleaser/goreleaser-action
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Sep 5, 2023
    Copy the full SHA
    fa38319 View commit details

Commits on Sep 7, 2023

  1. Add ForceNew to resources with cloudamqp_instance dependency (#222)

    For a resource with dependency to another resource. The dependant resource requires to have ForceNew behaviour added. Otherwise when replacing the top resource, the other will just update the resource with the new dependency attribute and not replace it.
    tbroden84 authored Sep 7, 2023
    Copy the full SHA
    f9d4701 View commit details
  2. Update CHANGELOG.md

    tbroden84 authored Sep 7, 2023
    Copy the full SHA
    632aa72 View commit details

Commits on Sep 8, 2023

  1. Bump go-api to v1.12.3

    tbroden84 committed Sep 8, 2023
    Copy the full SHA
    0d64041 View commit details
  2. Update docs

    tbroden84 committed Sep 8, 2023
    Copy the full SHA
    18c9831 View commit details
  3. Copy the full SHA
    cd65134 View commit details
  4. Bump go version to v1.21

    tbroden84 committed Sep 8, 2023
    Copy the full SHA
    85372e9 View commit details
  5. Update release.yml

    Set go-version from file
    tbroden84 authored Sep 8, 2023
    Copy the full SHA
    f8d4c9c View commit details
14 changes: 9 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
version: 2
updates:
- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: daily
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: CI

on:
push:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Allow goreleaser to access older tag information.
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version-file: .go-version
- name: Build for single target with GoReleaser
uses: goreleaser/goreleaser-action@5fdedb94abba051217030cc86d4523cf3f02243d # v4.6.0
with:
args: build --clean --snapshot --single-target
34 changes: 10 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -18,35 +18,21 @@ jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Unshallow
run: git fetch --prune --unshallow
-
name: Read go version
id: go-version
run: |
content=`cat ./.go-version`
echo "::set-output name=content::$content"
-
name: Set up Go
uses: actions/setup-go@v2
- uses: actions/checkout@v4
with:
# TODO: Replace with go-version-from-file when it is supported
# https://github.com/actions/setup-go/pull/62
go-version: ${{ steps.go-version.outputs.content }}
-
name: Import GPG key
# Allow goreleaser to access older tag information.
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version-file: .go-version
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5.0.0
uses: crazy-max/ghaction-import-gpg@d6f3f49f3345e29369fe57596a3ca8f94c4d2ca7 # v5.4.0
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@5fdedb94abba051217030cc86d4523cf3f02243d # v4.6.0
with:
version: latest
args: release --rm-dist
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.20
1.21
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
## 1.27.1 (Sep 08, 2023)

NOTES:

* Updated the API wrapper (go-api) dependecy with newer version (1.12.3)

IMPROVEMENTS:

* Cleanup RabbitMQ configuration resource ([#215](https://github.com/cloudamqp/terraform-provider-cloudamqp/pull/215))
* Add ForceNew to resources with cloudamqp_instance dependency ([#222](https://github.com/cloudamqp/terraform-provider-cloudamqp/pull/222))

BUG FIXES:

* Indirect handle managed required plugins failing to be destroyed.

## 1.27.0 (Jun 12, 2023)

NOTES:
2 changes: 1 addition & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
TEST?=$$(go list ./... |grep -v 'vendor')
GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)
PKG_NAME=cloudamqp
PROVIDER_VERSION = 1.27.0
PROVIDER_VERSION = 1.27.1

default: build

1 change: 1 addition & 0 deletions cloudamqp/resource_cloudamqp_alarm.go
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@ func resourceAlarm() *schema.Resource {
"instance_id": {
Type: schema.TypeInt,
Required: true,
ForceNew: true,
Description: "Instance identifier",
},
"type": {
1 change: 1 addition & 0 deletions cloudamqp/resource_cloudamqp_custom_domain.go
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@ func resourceCustomDomain() *schema.Resource {
"instance_id": {
Type: schema.TypeInt,
Required: true,
ForceNew: true,
Description: "Instance identifier",
},
"hostname": {
1 change: 1 addition & 0 deletions cloudamqp/resource_cloudamqp_integration_log.go
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@ func resourceIntegrationLog() *schema.Resource {
"instance_id": {
Type: schema.TypeInt,
Required: true,
ForceNew: true,
Description: "Instance identifier used to make proxy calls",
},
"name": {
1 change: 1 addition & 0 deletions cloudamqp/resource_cloudamqp_integration_metric.go
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@ func resourceIntegrationMetric() *schema.Resource {
"instance_id": {
Type: schema.TypeInt,
Required: true,
ForceNew: true,
Description: "Instance identifier",
},
"name": {
1 change: 1 addition & 0 deletions cloudamqp/resource_cloudamqp_notification.go
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ func resourceNotification() *schema.Resource {
"instance_id": {
Type: schema.TypeInt,
Required: true,
ForceNew: true,
Description: "Instance identifier",
},
"type": {
1 change: 1 addition & 0 deletions cloudamqp/resource_cloudamqp_plugin.go
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ func resourcePlugin() *schema.Resource {
"instance_id": {
Type: schema.TypeInt,
Required: true,
ForceNew: true,
Description: "Instance identifier",
},
"name": {
1 change: 1 addition & 0 deletions cloudamqp/resource_cloudamqp_plugin_community.go
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ func resourcePluginCommunity() *schema.Resource {
"instance_id": {
Type: schema.TypeInt,
Required: true,
ForceNew: true,
Description: "Instance identifier",
},
"name": {
1 change: 1 addition & 0 deletions cloudamqp/resource_cloudamqp_privatelink_aws.go
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@ func resourcePrivateLinkAws() *schema.Resource {
"instance_id": {
Type: schema.TypeInt,
Required: true,
ForceNew: true,
Description: "The CloudAMQP instance identifier",
},
"status": {
1 change: 1 addition & 0 deletions cloudamqp/resource_cloudamqp_privatelink_azure.go
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@ func resourcePrivateLinkAzure() *schema.Resource {
"instance_id": {
Type: schema.TypeInt,
Required: true,
ForceNew: true,
Description: "The CloudAMQP instance identifier",
},
"status": {
87 changes: 37 additions & 50 deletions cloudamqp/resource_cloudamqp_rabbitmq_configuration.go
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ import (

func resourceRabbitMqConfiguration() *schema.Resource {
return &schema.Resource{
Create: resourceRabbitMqConfigurationCreate,
Create: resourceRabbitMqConfigurationUpdate,
Read: resourceRabbitMqConfigurationRead,
Update: resourceRabbitMqConfigurationUpdate,
Delete: resourceRabbitMqConfigurationDelete,
@@ -24,6 +24,7 @@ func resourceRabbitMqConfiguration() *schema.Resource {
"instance_id": {
Type: schema.TypeInt,
Required: true,
ForceNew: true,
Description: "Instance identifier",
},
"heartbeat": {
@@ -154,40 +155,15 @@ func resourceRabbitMqConfiguration() *schema.Resource {
}
}

func resourceRabbitMqConfigurationCreate(d *schema.ResourceData, meta interface{}) error {
api := meta.(*api.API)
keys := rabbitMqConfigurationWriteAttributeKeys()
params := make(map[string]interface{})
for _, k := range keys {
v := d.Get(k)
if v == nil || v == 0 || v == 0.0 || v == "" {
continue
} else if k == "connection_max" {
if v == -1 {
v = "infinity"
}
} else if k == "consumer_timeout" {
if v == -1 {
v = "false"
}
} else if k == "log_exchange_level" {
k = "log.exchange.level"
}
params["rabbit."+k] = v
}
err := api.UpdateRabbitMqConfiguration(d.Get("instance_id").(int), params, d.Get("sleep").(int), d.Get("timeout").(int))
if err != nil {
return err
}
id := strconv.Itoa(d.Get("instance_id").(int))
d.SetId(id)
return resourceRabbitMqConfigurationRead(d, meta)
}

func resourceRabbitMqConfigurationRead(d *schema.ResourceData, meta interface{}) error {
api := meta.(*api.API)
instanceID, _ := strconv.Atoi(d.Id())
data, err := api.ReadRabbitMqConfiguration(instanceID, d.Get("sleep").(int), d.Get("timeout").(int))
var (
api = meta.(*api.API)
instanceID, _ = strconv.Atoi(d.Id())
sleep = d.Get("sleep").(int)
timeout = d.Get("timeout").(int)
)

data, err := api.ReadRabbitMqConfiguration(instanceID, sleep, timeout)
log.Printf("[DEBUG] cloudamqp::resource::rabbitmq_configuration::read data: %v", data)
if err != nil {
return err
@@ -196,23 +172,18 @@ func resourceRabbitMqConfigurationRead(d *schema.ResourceData, meta interface{})
d.Set("instance_id", instanceID)
for k, v := range data {
if validateRabbitMqConfigurationJSONField(k) {
if v == nil || v == "" {
continue
}
key := strings.ReplaceAll(k, "rabbit.", "")
if key == "connection_max" {
if v == "infinity" || v == nil {
if v == "infinity" {
v = -1
}
} else if key == "consumer_timeout" {
if v == "false" {
v = -1
}
} else if key == "queue_index_embed_msgs_below" {
if v == nil {
v = 4096
}
} else if key == "max_message_size" {
if v == nil {
v = 134217728
}
} else if key == "log.exchange.level" {
key = "log_exchange_level"
}
@@ -223,12 +194,22 @@ func resourceRabbitMqConfigurationRead(d *schema.ResourceData, meta interface{})
}

func resourceRabbitMqConfigurationUpdate(d *schema.ResourceData, meta interface{}) error {
api := meta.(*api.API)
keys := rabbitMqConfigurationWriteAttributeKeys()
params := make(map[string]interface{})
var (
api = meta.(*api.API)
instanceID = d.Get("instance_id").(int)
keys = rabbitMqConfigurationWriteAttributeKeys()
params = make(map[string]interface{})
sleep = d.Get("sleep").(int)
timeout = d.Get("timeout").(int)
)

for _, k := range keys {
if !d.HasChange(k) {
continue
}

v := d.Get(k)
if v == nil {
if v == nil || v == "" {
continue
} else if k == "connection_max" {
if v == -1 {
@@ -243,10 +224,16 @@ func resourceRabbitMqConfigurationUpdate(d *schema.ResourceData, meta interface{
}
params["rabbit."+k] = v
}
err := api.UpdateRabbitMqConfiguration(d.Get("instance_id").(int), params, d.Get("sleep").(int), d.Get("timeout").(int))
if err != nil {
return err

log.Printf("[DEBUG] RabbitMQ configuration params: %v", params)
if len(params) > 0 {
err := api.UpdateRabbitMqConfiguration(instanceID, params, sleep, timeout)
if err != nil {
return err
}
}

d.SetId(strconv.Itoa(instanceID))
return resourceRabbitMqConfigurationRead(d, meta)
}

1 change: 1 addition & 0 deletions cloudamqp/resource_cloudamqp_security_firewall.go
Original file line number Diff line number Diff line change
@@ -29,6 +29,7 @@ func resourceSecurityFirewall() *schema.Resource {
"instance_id": {
Type: schema.TypeInt,
Required: true,
ForceNew: true,
Description: "Instance identifier",
},
"rules": {
2 changes: 1 addition & 1 deletion docs/data-sources/nodes.md
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ The `nodes` block consist of
* `name` - Name of the node.
* `running` - Is the node running?
* `rabbitmq_version` - Currently configured Rabbit MQ version on the node.
* `erlang_version` - Currently used Erlanbg version on the node.
* `erlang_version` - Currently used Erlang version on the node.
* `hipe` - Enable or disable High-performance Erlang.
* `configured` - Is the node configured?
* `disk_size` - Subscription plan disk size
2 changes: 2 additions & 0 deletions docs/resources/alarm.md
Original file line number Diff line number Diff line change
@@ -94,6 +94,8 @@ Optional argument for all alarms: `tags, queue_regex, vhost_regex`
| Server unreachable | server_unreachable | - | &#10004; | time_threshold |
| Notice | notice | &#10004; | &#10004; | |

~> Notice alarm is manadatory! Only one can exists and cannot be deleted. Setting `no_default_alarm` to true, will still create this alarm.

## Dependency

This resource depends on CloudAMQP instance identifier, `cloudamqp_instance.instance.id`.
Loading