Skip to content

Commit

Permalink
Fix Service Account creation by ignoring 403 errors on read polling (G…
Browse files Browse the repository at this point in the history
  • Loading branch information
sbocinec authored Oct 2, 2024
1 parent ef10b71 commit e6af55b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ func resourceGoogleServiceAccountCreate(d *schema.ResourceData, meta interface{}

// We poll until the resource is found due to eventual consistency issue
// on part of the api https://cloud.google.com/iam/docs/overview#consistency
err = transport_tpg.PollingWaitTime(resourceServiceAccountPollRead(d, meta), transport_tpg.PollCheckForExistence, "Creating Service Account", d.Timeout(schema.TimeoutCreate), 1)
// IAM API returns 403 when the queried SA is not found, so we must ignore both 404 & 403 errors
err = transport_tpg.PollingWaitTime(resourceServiceAccountPollRead(d, meta), transport_tpg.PollCheckForExistenceWith403, "Creating Service Account", d.Timeout(schema.TimeoutCreate), 1)

if err != nil {
return err
Expand Down

0 comments on commit e6af55b

Please sign in to comment.