Open Desolar1um opened 3 weeks ago
Hi @Desolar1um!
I'm trying to replicate this issue but I'm not getting any errors. Because I do not have access to the variables you are using, this was the code I used:
data "google_compute_network" "cn_20101" {
name = "cn-20101"
}
data "google_project" "project_20101" {
provider = google-beta
}
resource "google_compute_subnetwork" "subnetwork_20101" {
provider = google-beta
name = "subnetwork-20101"
ip_cidr_range = "10.0.0.248/29"
region = "us-central1"
network = data.google_compute_network.cn_20101.id
}
resource "google_network_connectivity_service_connection_policy" "service_connection_policy_20101" {
provider = google-beta
name = "service-connection-policy-20101"
location = "us-central1"
service_class = "gcp-memorystore"
description = "something"
network = data.google_compute_network.cn_20101.id
psc_config {
subnetworks = [google_compute_subnetwork.subnetwork_20101.id]
}
}
resource "google_memorystore_instance" "memorystore_instance_20101" {
provider = google-beta
instance_id = "memorystore-instance-20101"
shard_count = 3
desired_psc_auto_connections {
network = data.google_compute_network.cn_20101.id
project_id = data.google_project.project_20101.project_id
}
location = "us-central1"
replica_count = 1
node_type = "SHARED_CORE_NANO"
transit_encryption_mode = "TRANSIT_ENCRYPTION_DISABLED"
authorization_mode = "AUTH_DISABLED"
zone_distribution_config {
mode = "MULTI_ZONE"
}
engine_version = "VALKEY_8_0"
deletion_protection_enabled = false
labels = {
"foo" : "bar"
}
}
Please check it and confirm if it works, I added all necessary resources to use a google_memorystore_instance
, like the google_network_connectivity_service_connection_policy
. Because if you don't attach it like in the example I'm sharing it is possible that you could get errors when creating the google_memorystore_instance
.
If after trying again with these configurations you still have issues please share with us your complete code with the values of the variables and locals you are using to make a new try. You don't need to share sensitive information, for this situations you could use examples like:
Hi @ggtisc , thanks for taking the time to look at this!
I don't have problems creating instances, this error occurs when I try to update an instance. Please try decreasing the number of shards/replicas on your instance and let me know if it works.
Confirmed issue!
When trying to update labels it returns the following error:
Error updating Instance "projects/my-project/locations/us-central1/instances/memorystore-instance-20101": googleapi: Error 400: exactly 1 update_mask field must be specified per update request
And when trying to decrease the shard_count from 3 to 2 or 1 it returns the following error:
Error updating Instance "projects/my-project/locations/us-central1/instances/memorystore-instance-20101": googleapi: Error 400: 2 shard cluster is not yet supported: invalid argument
Error updating Instance "projects/my-project/locations/us-central1/instances/memorystore-instance-20101": googleapi: Error 400: exactly 1 update_mask field must be specified per update request
Valkey instance update has a restriction that only one field can be updated at a time. The above error indicates that >1 was changed in one go. Did you try to change any other field along with the labels?
Error updating Instance "projects/my-project/locations/us-central1/instances/memorystore-instance-20101": googleapi: Error 400: 2 shard cluster is not yet supported: invalid argument
Low shard counts have certain limitation today, please follow: https://cloud.google.com/memorystore/docs/valkey/instance-node-specification#selecting_an_instance_shape_of_1_2_or_4_shards
Community Note
Terraform Version & Provider Version(s)
Terraform v1.8.5
Affected Resource(s)
google_memorystore_instance
Terraform Configuration
Debug Output
Expected Behavior
My Valkey cluster should've been decreased from 3 shards 1 replica to 1 shard 0 replicas
Actual Behavior
Steps to reproduce
google_memorystore_instance
google_memorystore_instance
resource withterraform apply
Important Factoids
No response
References
No response
b/378145653