Skip to content

Update each property of Memorystore instances in a separate request#1297

Merged
modular-magician merged 1 commit intoterraform-google-modules:masterfrom
modular-magician:downstream-pr-8bea1a5ef5441a6eab1f9980483cd8f0172f64fb
Apr 23, 2026
Merged

Update each property of Memorystore instances in a separate request#1297
modular-magician merged 1 commit intoterraform-google-modules:masterfrom
modular-magician:downstream-pr-8bea1a5ef5441a6eab1f9980483cd8f0172f64fb

Conversation

@modular-magician
Copy link
Copy Markdown
Collaborator

Fixes hashicorp/terraform-provider-google#20101

This PR updates the Memorystore Instance definition to submit updates for multiple properties in multiple PATCH requests, one per property.

The Memorystore API allows updating only one instance field per PATCH request, but the provider was sending all changed fields in a single request (e.g., updateMask=replicaCount,engineConfigs), causing updates to multiple fields to fail with:

Error: Error updating Cluster "projects/foobar/locations/us-west2/clusters/primary": googleapi: Error 400: exactly 1 update_mask field must be specified per update request
Details:
[
  {
    "@type": "type.googleapis.com/google.rpc.BadRequest",
    "fieldViolations": [
      {
        "field": "update_mask"
      }
    ]
  }
]

  with module.app.google_redis_cluster.primary,
  on ../../modules/app/redis.tf line 29, in resource "google_redis_cluster" "primary":
  29: resource "google_redis_cluster" "primary" {

Each of the 11 mutable non-label properties now specifies update_id, update_verb, and update_url (with a single-field updateMask query parameter).

I left labels in the main update path because it seems KeyValueLabels is handled specially as part of the provider's built-in handling for merging provider-level default labels with resource-level labels (via effective_labels and terraform_labels). As the sole remaining field in the main update body, I think that should work, but let me know if I misinterpreted the behavior here.

I also added a test to cover a multi-property update and confirmed it now works on a test GCP project.

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

memorystore: fixed an issue preventing updating multiple properties at once for `google_redis_cluster`

Derived from GoogleCloudPlatform/magic-modules#17166

…#17166)

[upstream:8bea1a5ef5441a6eab1f9980483cd8f0172f64fb]

Signed-off-by: Modular Magician <magic-modules@google.com>
@modular-magician modular-magician merged commit 6664ec4 into terraform-google-modules:master Apr 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing update_mask field in google_memorystore_instance resource

1 participant