Skip to content

Commit f0eaecc

Browse files
authored
fix logging sink crash by adding check (#15795)
1 parent d72cb5c commit f0eaecc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

mmv1/third_party/terraform/services/logging/resource_logging_sink.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,13 @@ func expandResourceLoggingSinkForUpdate(d *schema.ResourceData) (sink *logging.L
159159
Filter: d.Get("filter").(string),
160160
Disabled: d.Get("disabled").(bool),
161161
Description: d.Get("description").(string),
162-
IncludeChildren: d.Get("include_children").(bool),
163162
Exclusions: expandLoggingSinkExclusions(d.Get("exclusions")),
164-
ForceSendFields: []string{"Destination", "Filter", "Disabled", "Exclusions", "IncludeChildren"},
163+
ForceSendFields: []string{"Destination", "Filter", "Disabled", "Exclusions"},
164+
}
165+
166+
if v, ok := d.GetOkExists("include_children"); ok {
167+
sink.IncludeChildren = v.(bool)
168+
sink.ForceSendFields = append(sink.ForceSendFields, "IncludeChildren")
165169
}
166170

167171
updateFields := []string{"exclusions"}

0 commit comments

Comments
 (0)