Skip to content

Commit 0bd12f0

Browse files
Fix network field in google_compute_region_backend_service to force new on change (#15136) (#10738)
[upstream:6158b93d13d6d5a6b4de3118b2f92a17f6118bf5] Signed-off-by: Modular Magician <[email protected]>
1 parent 16afff5 commit 0bd12f0

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

.changelog/15136.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
compute: The network field in 'google_compute_region_backend_service' is now correctly handled, forcing a new resource on change. This resolves the "Network field cannot be modified" error when trying to add, remove, or modify a network on an existing resource
3+
```

google-beta/services/compute/resource_compute_region_backend_service.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,9 +947,12 @@ The default value is 1.0.`,
947947
"network": {
948948
Type: schema.TypeString,
949949
Optional: true,
950+
ForceNew: true,
950951
DiffSuppressFunc: tpgresource.CompareSelfLinkOrResourceName,
951952
Description: `The URL of the network to which this backend service belongs.
952-
This field can only be specified when the load balancing scheme is set to INTERNAL.`,
953+
This field must be set for Internal Passthrough Network Load Balancers when the haPolicy is enabled, and for External Passthrough Network Load Balancers when the haPolicy fastIpMove is enabled.
954+
This field can only be specified when the load balancing scheme is set to INTERNAL, or when the load balancing scheme is set to EXTERNAL and haPolicy fastIpMove is enabled.
955+
Changes to this field force recreation of the resource.`,
953956
},
954957
"outlier_detection": {
955958
Type: schema.TypeList,

website/docs/r/compute_region_backend_service.html.markdown

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,9 @@ The following arguments are supported:
888888
* `network` -
889889
(Optional)
890890
The URL of the network to which this backend service belongs.
891-
This field can only be specified when the load balancing scheme is set to INTERNAL.
891+
This field must be set for Internal Passthrough Network Load Balancers when the haPolicy is enabled, and for External Passthrough Network Load Balancers when the haPolicy fastIpMove is enabled.
892+
This field can only be specified when the load balancing scheme is set to INTERNAL, or when the load balancing scheme is set to EXTERNAL and haPolicy fastIpMove is enabled.
893+
Changes to this field force recreation of the resource.
892894

893895
* `subsetting` -
894896
(Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html))

0 commit comments

Comments
 (0)