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

fix: Correctly filter policy attachments in aws-us-gov #821

Merged
merged 4 commits into from
Jul 4, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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