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>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@e670b34
  • Loading branch information
phene authored and alinabuzachis committed Oct 6, 2023
1 parent cf0ae3f commit 6c33cad
Showing 1 changed file with 0 additions and 2 deletions.
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 6c33cad

Please sign in to comment.