diff --git a/aws/resource_aws_iam_user_policy.go b/aws/resource_aws_iam_user_policy.go index 23234000e02..5bcccc25937 100644 --- a/aws/resource_aws_iam_user_policy.go +++ b/aws/resource_aws_iam_user_policy.go @@ -2,6 +2,7 @@ package aws import ( "fmt" + "log" "net/url" "strings" @@ -101,6 +102,7 @@ func resourceAwsIamUserPolicyRead(d *schema.ResourceData, meta interface{}) erro getResp, err := iamconn.GetUserPolicy(request) if err != nil { if isAWSErr(err, iam.ErrCodeNoSuchEntityException, "") { + log.Printf("[WARN] IAM User Policy (%s) for %s not found, removing from state", name, user) d.SetId("") return nil }