aiven / terraform-provider-aiven

Aiven Terraform Provider
https://registry.terraform.io/providers/aiven/aiven/latest/docs
MIT License
129 stars 70 forks source link

How to handle `disk_space` attribute deprecation #1593

Closed eversC closed 8 months ago

eversC commented 8 months ago

What can we help you with?

disk_space attribute on the aiven_kafka resource is deprecated, I see this warning in terraform plan/apply:

│ Warning: Argument is deprecated
│ 
│   with module.aiven.aiven_kafka.this["kafka-test"],
│   on ../../modules/infrastructure/kafka.tf line 11, in resource "aiven_kafka" "this":
│   11:   disk_space              = lookup(each.value, "disk_space", null)
│ 
│ This will be removed in v5.0.0. Please use `additional_disk_space` to specify the space to be added to the default `disk_space` defined by the plan.
│ 
│ (and 3 more similar warnings elsewhere)

please advise on how I can safely stop using the disk_space attribute

if I remove the attribute, terraform suggests it's going to update the cluster in place (even if I specify an accompanying additional_disk_space attribute), and it's not clear how safe that'll be to apply.

Terraform will perform the following actions:

  # module.aiven.aiven_kafka.this["kafka-prod"] will be updated in-place
  ~ resource "aiven_kafka" "this" {
      - disk_space              = "6750GiB" -> null
        id                      = "kafka-prod/kafka-prod"
        # (23 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

Where would you expect to find this information?

I'd expect to find this information in the provider docs for the aiven_kafka resource.

Serpentiel commented 8 months ago

Hey, @eversC! 👋

I will check this out and will let you know shortly what would be the ideal migration scenario.

Serpentiel commented 8 months ago

Hey, @eversC! 👋

Yes, it should be good to change it in one run. Here's how it works:

  1. Determine the disk space that's bundled with your current plan, e.g. for the Business-4 GCP plan the amount of disk space that's included in it is 600 GiB.
  2. If your current disk_space is set to, for example, 630GiB, set the additional_disk_space to 30GiB (because 600 GiB is already included in the plan itself, and therefore the additional disk space you request is only 30 GiB).

I hope this answers your question!

Please let me know if you have anything else to add here. I will close this issue for now.

eversC commented 8 months ago

that's great thanks for getting back to me @Serpentiel! 🙏