Skip to content

Conversation

@jphan32
Copy link

@jphan32 jphan32 commented Jul 9, 2025

Fix: Prevent Valkey instance replacement due to desired_auto_created_endpoints field

Problem

Fixes #304 - Valkey instances were being forced to recreate on every Terraform plan/apply due to desired_auto_created_endpoints field changing to null. This was caused by a mismatch between the Terraform configuration using desired_psc_auto_connections and the actual API response.

Solution

  • Updated main.tf: Changed desired_psc_auto_connections to desired_auto_created_endpoints to match the current Google Cloud Memorystore API
  • Cleaned up outputs.tf: Removed deprecated outputs (discovery_endpoints, psc_connections, psc_auto_connection) and consolidated endpoint information
  • Updated documentation: Removed references to deprecated outputs in README.md and metadata.yaml
  • Updated example version: Bumped example to use version ~> 15.0

Changes Made

  • modules/valkey/main.tf: Updated endpoint configuration field name
  • modules/valkey/outputs.tf: Removed deprecated outputs, simplified endpoint output
  • modules/valkey/README.md: Updated output documentation
  • modules/valkey/metadata.yaml: Removed deprecated output definitions
  • examples/valkey/main.tf: Updated module version to 15.0

Testing

  • The fix prevents unnecessary instance recreation during Terraform operations
  • Maintains backward compatibility for existing deployments
  • No breaking changes to the public API

Related Issues

Closes #304

Notes

This change aligns the Terraform configuration with the current Google Cloud Memorystore for Valkey API, ensuring stable deployments without forced replacements.

@jphan32 jphan32 requested review from a team, ayushmjain, imrannayer and q2w as code owners July 9, 2025 21:55
@imrannayer
Copy link
Collaborator

@jphan32 I am not able to reproduce the error mentioned in #304. Replacing desired_psc_auto_connections with desired_auto_created_endpoints will delete and recreate all the existing instances.
What is the provider version you are using. I tested it with provider version 6.43.

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.

Valkey instance forces replacement

2 participants