From d53876d6ebd4264b8e641a9362f5f38f2e02c585 Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Wed, 6 Apr 2022 01:54:40 +0000 Subject: [PATCH] Switch from an explicit default to O+C for redis readReplicasMode (#5899) Signed-off-by: Modular Magician --- .changelog/5899.txt | 3 +++ google/resource_redis_instance.go | 4 ++-- website/docs/r/redis_instance.html.markdown | 1 - 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 .changelog/5899.txt diff --git a/.changelog/5899.txt b/.changelog/5899.txt new file mode 100644 index 00000000000..2e8e33416f7 --- /dev/null +++ b/.changelog/5899.txt @@ -0,0 +1,3 @@ +```release-note:bug +redis: fixed an issue where older redis instances had a dangerous diff on the field `read_replicas_mode`, adding a default of `READ_REPLICAS_DISABLED`. Now, if the field is not set in config, the value of the field will keep the old value from state. +``` diff --git a/google/resource_redis_instance.go b/google/resource_redis_instance.go index ebbc5b9dd49..aadfff189a1 100644 --- a/google/resource_redis_instance.go +++ b/google/resource_redis_instance.go @@ -285,6 +285,7 @@ resolution and up to nine fractional digits.`, }, "read_replicas_mode": { Type: schema.TypeString, + Computed: true, Optional: true, ForceNew: true, ValidateFunc: validateEnum([]string{"READ_REPLICAS_DISABLED", "READ_REPLICAS_ENABLED", ""}), @@ -293,8 +294,7 @@ If not set, Memorystore Redis backend will default to READ_REPLICAS_DISABLED. - READ_REPLICAS_DISABLED: If disabled, read endpoint will not be provided and the instance cannot scale up or down the number of replicas. - READ_REPLICAS_ENABLED: If enabled, read endpoint will be provided and the instance -can scale up and down the number of replicas. Default value: "READ_REPLICAS_DISABLED" Possible values: ["READ_REPLICAS_DISABLED", "READ_REPLICAS_ENABLED"]`, - Default: "READ_REPLICAS_DISABLED", +can scale up and down the number of replicas. Possible values: ["READ_REPLICAS_DISABLED", "READ_REPLICAS_ENABLED"]`, }, "redis_configs": { Type: schema.TypeMap, diff --git a/website/docs/r/redis_instance.html.markdown b/website/docs/r/redis_instance.html.markdown index cea63f2c73b..33aa6faf119 100644 --- a/website/docs/r/redis_instance.html.markdown +++ b/website/docs/r/redis_instance.html.markdown @@ -313,7 +313,6 @@ The following arguments are supported: instance cannot scale up or down the number of replicas. - READ_REPLICAS_ENABLED: If enabled, read endpoint will be provided and the instance can scale up and down the number of replicas. - Default value is `READ_REPLICAS_DISABLED`. Possible values are `READ_REPLICAS_DISABLED` and `READ_REPLICAS_ENABLED`. * `region` -