cloudamqp / terraform-provider-cloudamqp

Terraform Provider for CloudAMQP
https://registry.terraform.io/providers/cloudamqp/cloudamqp
Mozilla Public License 2.0
35 stars 39 forks source link

`cloudamqp_instance`: remove the `api.DefaultRmqVersion()` call #236

Closed dentarg closed 10 months ago

dentarg commented 1 year ago

In which situations are we fetching the default RabbitMQ version?

Do we need to do it? / What happens if we don't?

https://github.com/cloudamqp/terraform-provider-cloudamqp/blob/18de509d78e24b1c6b1f486a1f32168e1f99edb4/cloudamqp/resource_cloudamqp_instance.go#L181-L183

tbroden84 commented 1 year ago

We are fetching the default version if you leave the version out in the configuration.

resource "cloudamqp_instance" "instance" {
  name    = "instance"
  plan    = "bunny-1"
  region  = "amazon-web-services::eu-north-1"
}

It was introduced in https://github.com/cloudamqp/terraform-provider-cloudamqp/commit/d3f6c1b850e20df7813cdad557540a504d42f43d when we added the version to be manageable.

Looks like we don't really need to make this call at all (behaviour changed from before?). Either use the configured version or leave it out from the create request. Since our required params in the API backend are only name, plan and region. Leaving it out makes our backend pick the default version.

dentarg commented 1 year ago

Thanks for checking, what I suspected. We should remove it then :)

tbroden84 commented 1 year ago

Nice catch!

tbroden84 commented 10 months ago

Available in v1.29.0