Skip to content

Commit 4a9bca8

Browse files
sbocinecBBBmau
authored andcommitted
Fix Service Account creation by ignoring 403 errors on read polling (GoogleCloudPlatform#11811)
1 parent 8135212 commit 4a9bca8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mmv1/third_party/terraform/services/resourcemanager/resource_google_service_account.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ func resourceGoogleServiceAccountCreate(d *schema.ResourceData, meta interface{}
152152

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

157158
if err != nil {
158159
return err

0 commit comments

Comments
 (0)