provider/aws: handle aws_lambda_function missing s3 key error (#10960)
* ensure NoSuchKey is not a retryable error * Simplify err handling + lower log msg severity
This commit is contained in:
parent
6667a85cd9
commit
b8f6e2a70a
|
@ -297,14 +297,13 @@ func resourceAwsLambdaFunctionCreate(d *schema.ResourceData, meta interface{}) e
|
|||
err := resource.Retry(10*time.Minute, func() *resource.RetryError {
|
||||
_, err := conn.CreateFunction(params)
|
||||
if err != nil {
|
||||
log.Printf("[ERROR] Received %q, retrying CreateFunction", err)
|
||||
if awserr, ok := err.(awserr.Error); ok {
|
||||
if awserr.Code() == "InvalidParameterValueException" {
|
||||
log.Printf("[DEBUG] InvalidParameterValueException creating Lambda Function: %s", awserr)
|
||||
return resource.RetryableError(awserr)
|
||||
}
|
||||
}
|
||||
log.Printf("[DEBUG] Error creating Lambda Function: %s", err)
|
||||
|
||||
if isAWSErr(err, "InvalidParameterValueException", "The role defined for the function cannot be assumed by Lambda") {
|
||||
log.Printf("[DEBUG] Received %s, retrying CreateFunction", err)
|
||||
return resource.RetryableError(err)
|
||||
}
|
||||
|
||||
return resource.NonRetryableError(err)
|
||||
}
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue