AWS Security ChangesHomeSearch

AWS IAM documentation change

Service: IAM · 2025-06-25 · Documentation low

File: IAM/latest/UserGuide/iam_example_iam_DeleteRole_section.md

Summary

Added PowerShell V5 examples for DeleteRole operation including policy detachment steps

Security assessment

The change adds operational examples for role deletion but does not address any specific security vulnerability or weakness. It demonstrates proper cleanup procedure which is general security hygiene.

Diff

diff --git a/IAM/latest/UserGuide/iam_example_iam_DeleteRole_section.md b/IAM/latest/UserGuide/iam_example_iam_DeleteRole_section.md
index cec069112..531a68c91 100644
--- a//IAM/latest/UserGuide/iam_example_iam_DeleteRole_section.md
+++ b//IAM/latest/UserGuide/iam_example_iam_DeleteRole_section.md
@@ -288,0 +289,21 @@ PowerShell
+**Tools for PowerShell V5**
+    
+
+**Example 1: This example deletes the role named`MyNewRole` from the current IAM account. Before you can delete the role you must first use the `Unregister-IAMRolePolicy` command to detach any managed policies. Inline policies are deleted with the role.**
+    
+    
+    Remove-IAMRole -RoleName MyNewRole
+    
+
+**Example 2: This example detaches any managed policies from the role named`MyNewRole` and then deletes the role. The first line retrieves any managed policies attached to the role as a collection and then detaches each policy in the collection from the role. The second line deletes the role itself. Inline policies are deleted along with the role.**
+    
+    
+    Get-IAMAttachedRolePolicyList -RoleName MyNewRole | Unregister-IAMRolePolicy -RoleName MyNewRole
+    Remove-IAMRole -RoleName MyNewRole
+    
+
+  * For API details, see [DeleteRole](https://docs.aws.amazon.com/powershell/v5/reference) in _AWS Tools for PowerShell Cmdlet Reference (V5)_. 
+
+
+
+