AWS Security ChangesHomeSearch

AWS code-library documentation change

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

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

Summary

Added PowerShell V5 example for embedding inline user policies

Security assessment

Demonstrates policy management which relates to security controls, but no indication of addressing a specific security flaw.

Diff

diff --git a/code-library/latest/ug/iam_example_iam_PutUserPolicy_section.md b/code-library/latest/ug/iam_example_iam_PutUserPolicy_section.md
index c2b21f1eb..72341b626 100644
--- a//code-library/latest/ug/iam_example_iam_PutUserPolicy_section.md
+++ b//code-library/latest/ug/iam_example_iam_PutUserPolicy_section.md
@@ -131,0 +132,14 @@ PowerShell
+**Tools for PowerShell V5**
+    
+
+**Example 1: This example creates an inline policy named`EC2AccessPolicy` and embeds it in the IAM user `Bob`. If an inline policy with the same name already exists, then it is overwritten. The JSON policy content comes from the file `EC2AccessPolicy.json`. Note that you must use the `-Raw` parameter to successfully process the content of the JSON file.**
+    
+    
+    Write-IAMUserPolicy -UserName Bob -PolicyName EC2AccessPolicy -PolicyDocument (Get-Content -Raw EC2AccessPolicy.json)
+    
+
+  * For API details, see [PutUserPolicy](https://docs.aws.amazon.com/powershell/v5/reference) in _AWS Tools for PowerShell Cmdlet Reference (V5)_. 
+
+
+
+