Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/aws: retry through a different flavor of opsworks IAM error #4844

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions builtin/providers/aws/resource_aws_opsworks_stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,18 @@ func resourceAwsOpsworksStackCreate(d *schema.ResourceData, meta interface{}) er
// The full error we're looking for looks something like
// the following:
// 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)) {
log.Printf("[INFO] Waiting for service IAM role to propagate")
return cerr
retryableErrs := []string{
"not yet propagated",
"not the necessary trust relationship",
"Failed to check with EC2",
}
if opserr.Code() == "ValidationException" {
for _, retryableErr := range retryableErrs {
if strings.Contains(opserr.Message(), retryableErr) {
log.Printf("[INFO] Got retryable error: %s; Waiting for service IAM role to propagate", cerr)
return cerr
}
}
}
}
return resource.RetryError{Err: cerr}
Expand Down