Skip to content

Commit be0ebbc

Browse files
committed
Handle race condition with IAM role permissions
1 parent ca4eed7 commit be0ebbc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

builtin/providers/aws/resource_aws_opsworks_stack.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,8 @@ func resourceAwsOpsworksStackCreate(d *schema.ResourceData, meta interface{}) er
341341
// Service Role Arn: [...] is not yet propagated, please try again in a couple of minutes
342342
propErr := "not yet propagated"
343343
trustErr := "not the necessary trust relationship"
344-
if opserr.Code() == "ValidationException" && (strings.Contains(opserr.Message(), trustErr) || strings.Contains(opserr.Message(), propErr)) {
344+
validateErr := "validate IAM role permission"
345+
if opserr.Code() == "ValidationException" && (strings.Contains(opserr.Message(), trustErr) || strings.Contains(opserr.Message(), propErr) || strings.Contains(opserr.Message(), validateErr)) {
345346
log.Printf("[INFO] Waiting for service IAM role to propagate")
346347
return resource.RetryableError(cerr)
347348
}

0 commit comments

Comments
 (0)