elastic / terraform-provider-ec

https://registry.terraform.io/providers/elastic/ec/latest/docs
Apache License 2.0
176 stars 89 forks source link

How can you set the minimum size for hot nodes with autoscaling enabled? #837

Open nmaves opened 3 months ago

nmaves commented 3 months ago

We have our hot nodes configured to autoscale. Autoscaling is only for disk space and not other resources. We are now in a situation because we want to increase the minimum size of the cluster for CPU reasons but we can't because of the ingone_changes section. How can we increase the minimum size of the cluster's hot nodes?

    hot = {
      size       = var.size
      zone_count = var.zone_count
      autoscaling = {
        max_size          = var.max_size
        max_size_resource = "memory"
      }
    }
  }

  lifecycle {
    ignore_changes = [
      elasticsearch.hot.size
    ]
  }
tobio commented 2 months ago

we want to increase the minimum size of the cluster for CPU reasons but we can't because of the ingone_changes section

Just to clarify a few points here first. Autoscaling will not decrease the size of data tiers. hot.size defines the current size, which may be increased by autoscaling, but not a minimum that the tier will return to automatically.

That said, it sounds like you want to increase the current deployment size? If so you should be able to remove the ignore_changes block, apply the size change and then add the ignore_changes block back to account for any autoscaling size changes.