Skip to content

Commit b3d26d7

Browse files
Add update support to reconcile_connections in service attachment (#8831) (#15706)
Signed-off-by: Modular Magician <[email protected]>
1 parent 81162e7 commit b3d26d7

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

.changelog/8831.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
compute: added update support for `reconcile_connections` in `google_compute_service_attachment`
3+
```

google/services/compute/resource_compute_service_attachment.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ supported is 1.`,
139139
"reconcile_connections": {
140140
Type: schema.TypeBool,
141141
Optional: true,
142-
ForceNew: true,
143142
Description: `This flag determines whether a consumer accept/reject list change can reconcile the statuses of existing ACCEPTED or REJECTED PSC endpoints.
144143
145144
If false, connection policy update will only affect existing PENDING PSC endpoints. Existing ACCEPTED/REJECTED endpoints will remain untouched regardless how the connection policy is modified .
@@ -471,6 +470,12 @@ func resourceComputeServiceAttachmentUpdate(d *schema.ResourceData, meta interfa
471470
} else if v, ok := d.GetOkExists("consumer_accept_lists"); ok || !reflect.DeepEqual(v, consumerAcceptListsProp) {
472471
obj["consumerAcceptLists"] = consumerAcceptListsProp
473472
}
473+
reconcileConnectionsProp, err := expandComputeServiceAttachmentReconcileConnections(d.Get("reconcile_connections"), d, config)
474+
if err != nil {
475+
return err
476+
} else if v, ok := d.GetOkExists("reconcile_connections"); ok || !reflect.DeepEqual(v, reconcileConnectionsProp) {
477+
obj["reconcileConnections"] = reconcileConnectionsProp
478+
}
474479

475480
obj, err = resourceComputeServiceAttachmentUpdateEncoder(d, meta, obj)
476481
if err != nil {

google/services/compute/resource_compute_service_attachment_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ resource "google_compute_service_attachment" "psc_ilb_service_attachment" {
144144
connection_limit = 4
145145
}
146146
147+
reconcile_connections = false
147148
}
148149
149150
resource "google_compute_address" "psc_ilb_consumer_address" {

0 commit comments

Comments
 (0)