Skip to content

Commit

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

IAM Role Removal Does Not Require Removal of Permission Boundary

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 ansible-collections#959

ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME
iam_role

Reviewed-by: Markus Bergholz <[email protected]>
Reviewed-by: Mark Chappell <None>
  • Loading branch information
phene authored Mar 16, 2022
1 parent 5de9673 commit e670b34
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 e670b34

Please sign in to comment.