Skip to content

Commit

Permalink
Merge pull request #3970 from hashicorp/b-aws-iam-policy-attachfix
Browse files Browse the repository at this point in the history
providers/aws: Fix typo in error checking for IAM Policy Attachments
  • Loading branch information
catsby committed Nov 18, 2015
2 parents a211fc3 + 5482e98 commit 5024d66
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion builtin/providers/aws/resource_aws_iam_policy_attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package aws

import (
"fmt"
"log"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 5024d66

Please sign in to comment.