Merge pull request #3970 from hashicorp/b-aws-iam-policy-attachfix

providers/aws: Fix typo in error checking for IAM Policy Attachments
This commit is contained in:
Clint 2015-11-18 13:57:03 -06:00
commit 5024d66f3c
1 changed files with 3 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package aws
import (
"fmt"
"log"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
@ -90,7 +91,8 @@ func resourceAwsIamPolicyAttachmentRead(d *schema.ResourceData, meta interface{}
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
if awsErr.Code() == "NoSuchIdentity" {
if awsErr.Code() == "NoSuchEntity" {
log.Printf("[WARN] No such entity found for Policy Attachment (%s)", d.Id())
d.SetId("")
return nil
}