AWS Security ChangesHomeSearch

AWS IAM documentation change

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

File: IAM/latest/UserGuide/iam_example_iam_CreatePolicyVersion_section.md

Summary

Added PowerShell V5 example for creating and setting default policy versions

Security assessment

Shows policy version management which is important for access control but doesn't address a specific security flaw

Diff

diff --git a/IAM/latest/UserGuide/iam_example_iam_CreatePolicyVersion_section.md b/IAM/latest/UserGuide/iam_example_iam_CreatePolicyVersion_section.md
index 2815cd087..715c13b36 100644
--- a//IAM/latest/UserGuide/iam_example_iam_CreatePolicyVersion_section.md
+++ b//IAM/latest/UserGuide/iam_example_iam_CreatePolicyVersion_section.md
@@ -74,0 +75,21 @@ PowerShell
+**Tools for PowerShell V5**
+    
+
+**Example 1: This example creates a new "v2" version of the IAM policy whose ARN is`arn:aws:iam::123456789012:policy/MyPolicy` and makes it the default version. The `NewPolicyVersion.json` file provides the policy content. Note that you must use the `-Raw` switch parameter to successfully process the JSON policy file.**
+    
+    
+    New-IAMPolicyVersion -PolicyArn arn:aws:iam::123456789012:policy/MyPolicy -PolicyDocument (Get-content -Raw NewPolicyVersion.json) -SetAsDefault $true
+    
+
+**Output:**
+    
+    
+    CreateDate                           Document                  IsDefaultVersion             VersionId
+    ----------                           --------                  ----------------             ---------
+    4/15/2015 10:54:54 AM                                          True                         v2
+
+  * For API details, see [CreatePolicyVersion](https://docs.aws.amazon.com/powershell/v5/reference) in _AWS Tools for PowerShell Cmdlet Reference (V5)_. 
+
+
+
+