Skip to content

Commit b9c28b7

Browse files
Make network ForceNew in google_compute_packet_mirroring (#4216) (#2704)
Signed-off-by: Modular Magician <[email protected]>
1 parent 1430952 commit b9c28b7

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

.changelog/4216.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: fixed an issue in `google_compute_packet_mirroring` where updates would fail due to `network` not being updatable
3+
```

google-beta/resource_compute_packet_mirroring.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ set to true.`,
122122
"network": {
123123
Type: schema.TypeList,
124124
Required: true,
125+
ForceNew: true,
125126
Description: `Specifies the mirrored VPC network. Only packets in this network
126127
will be mirrored. All mirrored VMs should have a NIC in the given
127128
network. All mirrored subnetworks should belong to the given network.`,
@@ -131,6 +132,7 @@ network. All mirrored subnetworks should belong to the given network.`,
131132
"url": {
132133
Type: schema.TypeString,
133134
Required: true,
135+
ForceNew: true,
134136
DiffSuppressFunc: compareSelfLinkOrResourceName,
135137
Description: `The full self_link URL of the network where this rule is active.`,
136138
},
@@ -389,12 +391,6 @@ func resourceComputePacketMirroringUpdate(d *schema.ResourceData, meta interface
389391
} else if v, ok := d.GetOkExists("region"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, regionProp)) {
390392
obj["region"] = regionProp
391393
}
392-
networkProp, err := expandComputePacketMirroringNetwork(d.Get("network"), d, config)
393-
if err != nil {
394-
return err
395-
} else if v, ok := d.GetOkExists("network"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, networkProp)) {
396-
obj["network"] = networkProp
397-
}
398394
priorityProp, err := expandComputePacketMirroringPriority(d.Get("priority"), d, config)
399395
if err != nil {
400396
return err

0 commit comments

Comments
 (0)