Open BenRamosG opened 3 months ago
Hi @BenRamosG!
I tried to replicate this issue, but the steps are not clear. I executed a 1st terraform apply
to create the resource and then executed a 2nd terraform apply
without making changes. In both cases I checked the tfstate
file but the data_cache_enabled
value didn't change.
Could you confirm if the steps are correct? because in the steps to reproduce you put just 1 terraform apply
, and with this is the same the data_cache_enabled
value was here.
If you changed any other value please let me know.
I've checked and there is a ticket for my situation: https://github.com/hashicorp/terraform-provider-google/issues/15227
I use Enterprise edition for my cloud sql instance with data_cache_enabled in false. The resource is created correctly, but when I want to modify something later in this resource, this mentioned it:
+ data_cache_config {
+ data_cache_enabled = false
}
When I didn't modify this attribute in the resource.
The issue was replicated with the next configuration since you are not sharing the variable values and the result was successful without errors or differences.
resource "google_sql_database_instance" "sql_db_instance_19144" {
name = "sql-db-instance-19144"
project = "my-project"
region = "us-central1"
database_version = "MYSQL_8_0_31"
settings {
tier = "db-perf-optimized-N-2"
edition = "ENTERPRISE_PLUS"
data_cache_config {
data_cache_enabled = true
}
}
deletion_protection = false
}
If you continue with issues share the complete configuration of your code to make another try, because we don't have access to your variable values. For sensitive data you could use examples like:
Community Note
Terraform Version & Provider Version(s)
Terraform v1.8.3
Affected Resource(s)
google_sql_database_instance
Terraform Configuration
Debug Output
No response
Expected Behavior
State file must contain data_cache_enabled attribute in its document, because once created this resource and exeute an apply command again, it shows data_cache_enabled will be modfied even if you don't modified data_cache_enabled.
Actual Behavior
Don't show cache enable in the state file
Steps to reproduce
terraform apply
Important Factoids
No response
References
No response