Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
fix: Correctly filter policy attachments in aws-us-gov (#821)
Browse files Browse the repository at this point in the history
* fix: Correctly filter policy attachments in aws-us-gov

* fmt
  • Loading branch information
kazimierzbudzyk authored Jul 4, 2022
1 parent c0ad99d commit d61ee97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion resources/iam-role-policy-attachments.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func ListIAMRolePolicyAttachments(sess *session.Session) ([]Resource, error) {
}

func (e *IAMRolePolicyAttachment) Filter() error {
if strings.HasPrefix(e.policyArn, "arn:aws:iam::aws:policy/aws-service-role/") {
if strings.Contains(e.policyArn, ":iam::aws:policy/aws-service-role/") {
return fmt.Errorf("cannot detach from service roles")
}
return nil
Expand Down

0 comments on commit d61ee97

Please sign in to comment.