Skip to content

Commit

Permalink
IAM Role Removal Does Not Require Removal of Permission Boundary (#961)…
Browse files Browse the repository at this point in the history
… (#1000)

[PR #961/e670b348 backport][stable-3] IAM Role Removal Does Not Require Removal of Permission Boundary

This is a backport of PR #961 as merged into main (e670b34).
SUMMARY

Removes unnecessary removal of permission boundary from a role when deleting a role. Unlike inline policies, permission boundaries do not need to be removed from an IAM role before deleting the IAM role. This behavior causes issues when a permission boundary is inherited that prevents removal of the permission boundary.
Fixes #959

ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME
iam_role
  • Loading branch information
patchback[bot] authored Mar 16, 2022
1 parent 4d5eead commit c088d93
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- iam_role - Removes unnecessary removal of permission boundary from a role when deleting a role. Unlike inline policies, permission boundaries do not need to be removed from an IAM role before deleting the IAM role. This behavior causes issues when a permission boundary is inherited that prevents removal of the permission boundary. (https://github.com/ansible-collections/community.aws/pull/961)
2 changes: 0 additions & 2 deletions plugins/modules/iam_role.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,10 +571,8 @@ def destroy_role():
# Before we try to delete the role we need to remove any
# - attached instance profiles
# - attached managed policies
# - permissions boundary
remove_instance_profiles(role_params, role)
update_managed_policies(role_params, role, [], True)
update_role_permissions_boundary(boundary_params, role)

try:
if not module.check_mode:
Expand Down

0 comments on commit c088d93

Please sign in to comment.