Skip to content

Commit e5566db

Browse files
Removed monitoring notificationchannel set_computed_name post_create (#13637) (#22317)
[upstream:d1b891ad0338f5030fbacc6b90aa6e9c5bfa3ff9] Signed-off-by: Modular Magician <[email protected]>
1 parent 13d0c06 commit e5566db

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

google/services/monitoring/resource_monitoring_notification_channel.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -291,24 +291,6 @@ func resourceMonitoringNotificationChannelCreate(d *schema.ResourceData, meta in
291291
}
292292
d.SetId(id)
293293

294-
// `name` is autogenerated from the api so needs to be set post-create
295-
name, ok := res["name"]
296-
if !ok {
297-
respBody, ok := res["response"]
298-
if !ok {
299-
return fmt.Errorf("Create response didn't contain critical fields. Create may not have succeeded.")
300-
}
301-
302-
name, ok = respBody.(map[string]interface{})["name"]
303-
if !ok {
304-
return fmt.Errorf("Create response didn't contain critical fields. Create may not have succeeded.")
305-
}
306-
}
307-
if err := d.Set("name", name.(string)); err != nil {
308-
return fmt.Errorf("Error setting name: %s", err)
309-
}
310-
d.SetId(name.(string))
311-
312294
log.Printf("[DEBUG] Finished creating NotificationChannel %q: %#v", d.Id(), res)
313295

314296
return resourceMonitoringNotificationChannelRead(d, meta)

0 commit comments

Comments
 (0)