AWS Security ChangesHomeSearch

AWS code-library documentation change

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

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

Summary

Added PowerShell V5 example for removing roles from instance profiles

Security assessment

Documents role management for EC2 instances, relevant to security hardening, but not tied to a specific security issue.

Diff

diff --git a/code-library/latest/ug/iam_example_iam_RemoveRoleFromInstanceProfile_section.md b/code-library/latest/ug/iam_example_iam_RemoveRoleFromInstanceProfile_section.md
index faa355298..d46303fca 100644
--- a//code-library/latest/ug/iam_example_iam_RemoveRoleFromInstanceProfile_section.md
+++ b//code-library/latest/ug/iam_example_iam_RemoveRoleFromInstanceProfile_section.md
@@ -50,0 +51,14 @@ PowerShell
+**Tools for PowerShell V5**
+    
+
+**Example 1: This example deletes the role named`MyNewRole` from the EC2 instance profile named `MyNewRole`. An instance profile that is created in the IAM console always has the same name as the role, as in this example. If you create them in the API or CLI, then they can have different names.**
+    
+    
+    Remove-IAMRoleFromInstanceProfile -InstanceProfileName MyNewRole -RoleName MyNewRole -Force
+    
+
+  * For API details, see [RemoveRoleFromInstanceProfile](https://docs.aws.amazon.com/powershell/v5/reference) in _AWS Tools for PowerShell Cmdlet Reference (V5)_. 
+
+
+
+