Description
When I change the parameters of a stackit_redis_instance, the redis instance is force-replaced, because its region changed. However, the region is actually the same value (provider default).
Steps to reproduce
Apply the following configuration:
terraform {
required_version = ">= 1.11.1"
required_providers {
stackit = {
source = "stackitcloud/stackit"
version = "0.108.0"
}
}
}
provider "stackit" {
default_region = "eu01"
}
resource "stackit_redis_instance" "test" {
project_id = "<some-id>"
name = "repro-test"
plan_name = "stackit-redis-1.4.10-single"
version = "7"
#parameters = {
# maxmemory_policy = "noeviction"
#}
}
- Run
terraform init
- Run
terraform apply
- Uncomment the
parameters section (or change the maxmemory_policy to volatile-lru or something else)
- Run
terraform apply again (or terraform plan)
Actual behavior
The first apply creates the redis instance. The second apply reports the following change (shortened for readability):
# stackit_redis_instance.test must be replaced
-/+ resource "stackit_redis_instance" "test" {
...
name = "repro-test"
~ parameters = {
~ max_disk_threshold = 80 -> (known after apply)
+ maxmemory_policy = "noeviction"
...
}
~ plan_id = "3849f72f-99cc-4e2c-afda-700d66ef08f2" -> (known after apply)
~ region = "eu01" # forces replacement -> (known after apply) # forces replacement
# (3 unchanged attributes hidden)
}
Expected behavior
I would expect this change to work without replacing the redis instance.
Known Workaround
Setting the region attribute of the redis instance to region = "eu01" solves the problem. The redis instance is updated in-place. The error seems to only occur when using the provider-default region.
The workaround only works during plan time. On apply I still get an error (see comment below).
Environment
- OS: macOS 26.5.2
- Terraform version (see
terraform --version): OpenTofu v1.12.5 (also tested with Terraform v1.15.8)
- Version of the STACKIT Terraform provider:
v0.110.0
Additional information
This feels like the kind of problem that might affect other resources as well. I haven't explicitly checked any other resources.
Description
When I change the
parametersof astackit_redis_instance, the redis instance is force-replaced, because itsregionchanged. However, the region is actually the same value (provider default).Steps to reproduce
Apply the following configuration:
terraform initterraform applyparameterssection (or change themaxmemory_policytovolatile-lruor something else)terraform applyagain (orterraform plan)Actual behavior
The first apply creates the redis instance. The second
applyreports the following change (shortened for readability):Expected behavior
I would expect this change to work without replacing the redis instance.
Known Workaround
Setting theregionattribute of the redis instance toregion = "eu01"solves the problem. The redis instance is updated in-place. The error seems to only occur when using the provider-default region.The workaround only works during plan time. On
applyI still get an error (see comment below).Environment
terraform --version):OpenTofu v1.12.5(also tested with Terraformv1.15.8)v0.110.0Additional information
This feels like the kind of problem that might affect other resources as well. I haven't explicitly checked any other resources.