From bed71c0fcbf7360085f6d77107fd91e088f632c9 Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Mon, 9 Nov 2020 21:12:16 +0000 Subject: [PATCH] Correctly mark config in spanner instance as ForceNew (#4207) Signed-off-by: Modular Magician --- .changelog/4207.txt | 3 +++ google-beta/resource_spanner_instance.go | 7 +------ 2 files changed, 4 insertions(+), 6 deletions(-) create mode 100644 .changelog/4207.txt diff --git a/.changelog/4207.txt b/.changelog/4207.txt new file mode 100644 index 0000000000..0e6c2d2423 --- /dev/null +++ b/.changelog/4207.txt @@ -0,0 +1,3 @@ +```release-note:bug +spanner: marked `google_spanner_instance.config` as ForceNew as is not updatable +``` diff --git a/google-beta/resource_spanner_instance.go b/google-beta/resource_spanner_instance.go index 5bcaf1b9b9..729c02d423 100644 --- a/google-beta/resource_spanner_instance.go +++ b/google-beta/resource_spanner_instance.go @@ -48,6 +48,7 @@ func resourceSpannerInstance() *schema.Resource { "config": { Type: schema.TypeString, Required: true, + ForceNew: true, DiffSuppressFunc: compareSelfLinkOrResourceName, Description: `The name of the instance's configuration (similar but not quite the same as a region) which defines defines the geographic placement and @@ -303,12 +304,6 @@ func resourceSpannerInstanceUpdate(d *schema.ResourceData, meta interface{}) err billingProject = project obj := make(map[string]interface{}) - configProp, err := expandSpannerInstanceConfig(d.Get("config"), d, config) - if err != nil { - return err - } else if v, ok := d.GetOkExists("config"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, configProp)) { - obj["config"] = configProp - } displayNameProp, err := expandSpannerInstanceDisplayName(d.Get("display_name"), d, config) if err != nil { return err