Skip to content
This repository has been archived by the owner on Jun 27, 2021. It is now read-only.

Commit

Permalink
group creation: sleep 1 second
Browse files Browse the repository at this point in the history
  • Loading branch information
DeviaVir committed Jul 7, 2020
1 parent b14c1af commit 4dfd36b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gsuite/resource_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"log"
"strings"
"time"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
directory "google.golang.org/api/admin/directory/v1"
Expand Down Expand Up @@ -88,6 +89,9 @@ func resourceGroupCreate(d *schema.ResourceData, meta interface{}) error {
return err
}, config.TimeoutMinutes)

// give the eventually consistent G Suite time to settle the group
time.Sleep(time.Second * 1)

if err != nil {
if config.UpdateExisting && strings.Contains(fmt.Sprintf("%s", err), "Entity already exists.") {
log.Printf("[INFO] Group already exists, overwriting existing values")
Expand Down

0 comments on commit 4dfd36b

Please sign in to comment.