You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bigtable: fixed `node_scaling_factor` forcing new instance on `google_bigtable_instance` when adding new cluster
3
+
```
4
+
5
+
### Context:
6
+
7
+
Related Github Issue: https://github.com/hashicorp/terraform-provider-google/issues/23564
8
+
9
+
TLDR; When adding a new cluster to an existing bigtable instance a forced recreate is required due to the `forceNew` attribute on `node_scaling_factor`. This doesn't match the API / Console functionality where adding a new cluster requires no recreate.
10
+
11
+
This PR removes the unconditional `forceNew` attribute on `node_scaling_factor` and instead adds to the CustomizeDiff to check if an existing cluster's `node_scaling_factor` has changed or not. If yes; require recreate. If no; don't require recreate.
12
+
13
+
### Testing:
14
+
15
+
I've added two new test cases.
16
+
1. Test modifying existing cluster's `node_scaling_factor` and fails when `deletion_protection` is `true`
17
+
2. Test adding a new cluster to an existing instance AND does not require deletion/recreate.
18
+
19
+
I've run these test in local env, sample logs below
20
+
21
+
```
22
+
brandon.cate@DD944JY0FF terraform-provider-google-beta % make testacc TEST=./google-beta/services/bigtable TESTARGS='-run=TestAccBigtableInstance_addNewClusterWithoutDeletionProtection$$'
23
+
==> Checking that code complies with gofmt requirements...
24
+
go vet
25
+
TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test ./google-beta/services/bigtable -v -run=TestAccBigtableInstance_addNewClusterWithoutDeletionProtection$ -timeout 240m -ldflags="-X=github.com/hashicorp/terraform-provider-google-beta/version.ProviderVersion=acc"
26
+
=== RUN TestAccBigtableInstance_addNewClusterWithoutDeletionProtection
ok github.com/hashicorp/terraform-provider-google-beta/google-beta/services/bigtable 46.799s
32
+
33
+
34
+
brandon.cate@DD944JY0FF terraform-provider-google-beta % make testacc TEST=./google-beta/services/bigtable TESTARGS='-run=TestAccBigtableInstance_createWithNodeScalingFactorThenFailFromDeletionProtection$$'
35
+
==> Checking that code complies with gofmt requirements...
36
+
go vet
37
+
TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test ./google-beta/services/bigtable -v -run=TestAccBigtableInstance_createWithNodeScalingFactorThenFailFromDeletionProtection$ -timeout 240m -ldflags="-X=github.com/hashicorp/terraform-provider-google-beta/version.ProviderVersion=acc"
38
+
=== RUN TestAccBigtableInstance_createWithNodeScalingFactorThenFailFromDeletionProtection
0 commit comments