From 0938826e1f34e9bfaabb3e03c9791035ed37529d Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Thu, 29 Mar 2018 14:53:36 -0400 Subject: [PATCH] resource/aws_lambda_function: Add missing IAM retry in update --- aws/resource_aws_lambda_function.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_lambda_function.go b/aws/resource_aws_lambda_function.go index 4a355afb810..e8f316ac628 100644 --- a/aws/resource_aws_lambda_function.go +++ b/aws/resource_aws_lambda_function.go @@ -710,6 +710,10 @@ func resourceAwsLambdaFunctionUpdate(d *schema.ResourceData, meta interface{}) e if err != nil { log.Printf("[DEBUG] Received error modifying Lambda Function Configuration %s: %s", d.Id(), err) + if isAWSErr(err, "InvalidParameterValueException", "The role defined for the function cannot be assumed by Lambda") { + log.Printf("[DEBUG] Received %s, retrying UpdateFunctionConfiguration", err) + return resource.RetryableError(err) + } if isAWSErr(err, "InvalidParameterValueException", "The provided execution role does not have permissions") { log.Printf("[DEBUG] Received %s, retrying UpdateFunctionConfiguration", err) return resource.RetryableError(err)