Skip to content

Commit

Permalink
Handle race condition with IAM role permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjefftang committed Apr 6, 2016
1 parent ca4eed7 commit be0ebbc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion builtin/providers/aws/resource_aws_opsworks_stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,8 @@ func resourceAwsOpsworksStackCreate(d *schema.ResourceData, meta interface{}) er
// Service Role Arn: [...] is not yet propagated, please try again in a couple of minutes
propErr := "not yet propagated"
trustErr := "not the necessary trust relationship"
if opserr.Code() == "ValidationException" && (strings.Contains(opserr.Message(), trustErr) || strings.Contains(opserr.Message(), propErr)) {
validateErr := "validate IAM role permission"
if opserr.Code() == "ValidationException" && (strings.Contains(opserr.Message(), trustErr) || strings.Contains(opserr.Message(), propErr) || strings.Contains(opserr.Message(), validateErr)) {
log.Printf("[INFO] Waiting for service IAM role to propagate")
return resource.RetryableError(cerr)
}
Expand Down

0 comments on commit be0ebbc

Please sign in to comment.