Merge pull request #5668 from Originate/mb-correctly-handle-missing-lambda

provider/aws: Correctly handle missing lambda function
This commit is contained in:
James Nugent 2016-03-16 19:45:36 +00:00
commit 69c65109cd
1 changed files with 4 additions and 0 deletions

View File

@ -226,6 +226,10 @@ func resourceAwsLambdaFunctionRead(d *schema.ResourceData, meta interface{}) err
getFunctionOutput, err := conn.GetFunction(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "ResourceNotFoundException" {
d.SetId("")
return nil
}
return err
}