Skip to content

Commit

Permalink
resource/codebuild: Increase timeout for creation retry (IAM) (#904)
Browse files Browse the repository at this point in the history
  • Loading branch information
radeksimko authored Jun 19, 2017
1 parent 4f524d3 commit 289be94
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions aws/resource_aws_codebuild_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,16 +212,21 @@ func resourceAwsCodeBuildProjectCreate(d *schema.ResourceData, meta interface{})
}

var resp *codebuild.CreateProjectOutput
err := resource.Retry(2*time.Minute, func() *resource.RetryError {
err := resource.Retry(5*time.Minute, func() *resource.RetryError {
var err error

resp, err = conn.CreateProject(params)

if err != nil {
return resource.RetryableError(err)
// Work around eventual consistency of IAM
if isAWSErr(err, "InvalidInputException", "CodeBuild is not authorized to perform") {
return resource.RetryableError(err)
}

return resource.NonRetryableError(err)
}

return resource.NonRetryableError(err)
return nil

})

if err != nil {
Expand Down

0 comments on commit 289be94

Please sign in to comment.