Skip to content

Commit f1b202e

Browse files
Adding delay after SecuritySettings create to work around API inconsistency (#11165) (#18792)
[upstream:b84aed139eeea71b7919887874e8f1a4a6b263cf] Signed-off-by: Modular Magician <[email protected]>
1 parent 5af6698 commit f1b202e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.changelog/11165.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
dialogflowcx: fixed intermittent issues with retrieving resource state soon after creating `google_dialogflow_cx_security_settings` resources
3+
```

google/services/dialogflowcx/resource_dialogflow_cx_security_settings.go

+5
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,11 @@ func resourceDialogflowCXSecuritySettingsCreate(d *schema.ResourceData, meta int
302302
}
303303
d.SetId(id)
304304

305+
// This is useful if the resource in question doesn't have a perfectly consistent API
306+
// That is, the Operation for Create might return before the Get operation shows the
307+
// completed state of the resource.
308+
time.Sleep(5 * time.Second)
309+
305310
log.Printf("[DEBUG] Finished creating SecuritySettings %q: %#v", d.Id(), res)
306311

307312
return resourceDialogflowCXSecuritySettingsRead(d, meta)

0 commit comments

Comments
 (0)