Skip to content

Commit 38fed32

Browse files
Correctly mark config in spanner instance as ForceNew (#4207) (#2699)
Signed-off-by: Modular Magician <[email protected]>
1 parent e2713d5 commit 38fed32

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

.changelog/4207.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
spanner: marked `google_spanner_instance.config` as ForceNew as is not updatable
3+
```

google-beta/resource_spanner_instance.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ func resourceSpannerInstance() *schema.Resource {
4848
"config": {
4949
Type: schema.TypeString,
5050
Required: true,
51+
ForceNew: true,
5152
DiffSuppressFunc: compareSelfLinkOrResourceName,
5253
Description: `The name of the instance's configuration (similar but not
5354
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
303304
billingProject = project
304305

305306
obj := make(map[string]interface{})
306-
configProp, err := expandSpannerInstanceConfig(d.Get("config"), d, config)
307-
if err != nil {
308-
return err
309-
} else if v, ok := d.GetOkExists("config"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, configProp)) {
310-
obj["config"] = configProp
311-
}
312307
displayNameProp, err := expandSpannerInstanceDisplayName(d.Get("display_name"), d, config)
313308
if err != nil {
314309
return err

0 commit comments

Comments
 (0)