From be0ebbc22e82932f1b7f697e9580779edd8db2ab Mon Sep 17 00:00:00 2001 From: Jeff Tang Date: Wed, 6 Apr 2016 15:57:14 -0400 Subject: [PATCH] Handle race condition with IAM role permissions --- builtin/providers/aws/resource_aws_opsworks_stack.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builtin/providers/aws/resource_aws_opsworks_stack.go b/builtin/providers/aws/resource_aws_opsworks_stack.go index c021f16a9..61ceb7a1a 100644 --- a/builtin/providers/aws/resource_aws_opsworks_stack.go +++ b/builtin/providers/aws/resource_aws_opsworks_stack.go @@ -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) }