AWS Security ChangesHomeSearch

AWS code-library documentation change

Service: code-library · 2025-06-28 · Documentation low

File: code-library/latest/ug/iam_example_iam_DetachRolePolicy_section.md

Summary

Added PowerShell V5 examples for detaching role policies

Security assessment

Standard documentation update for role policy management. No evidence of addressing specific security vulnerabilities.

Diff

diff --git a/code-library/latest/ug/iam_example_iam_DetachRolePolicy_section.md b/code-library/latest/ug/iam_example_iam_DetachRolePolicy_section.md
index 8482ce70a..393b5effa 100644
--- a//code-library/latest/ug/iam_example_iam_DetachRolePolicy_section.md
+++ b//code-library/latest/ug/iam_example_iam_DetachRolePolicy_section.md
@@ -494,0 +495,20 @@ PowerShell
+**Tools for PowerShell V5**
+    
+
+**Example 1: This example detaches the managed group policy whose ARN is`arn:aws:iam::123456789012:policy/FederatedTesterAccessPolicy` from the role named `FedTesterRole`.**
+    
+    
+    Unregister-IAMRolePolicy -RoleName FedTesterRole -PolicyArn arn:aws:iam::123456789012:policy/FederatedTesterAccessPolicy
+    
+
+**Example 2: This example finds all of the managed policies that are attached to the role named`FedTesterRole` and detaches them from the role.**
+    
+    
+    Get-IAMAttachedRolePolicyList -RoleName FedTesterRole | Unregister-IAMRolePolicy -Rolename FedTesterRole
+    
+
+  * For API details, see [DetachRolePolicy](https://docs.aws.amazon.com/powershell/v5/reference) in _AWS Tools for PowerShell Cmdlet Reference (V5)_. 
+
+
+
+