AWS Security ChangesHomeSearch

AWS code-library documentation change

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

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

Summary

Added PowerShell V5 examples for AMI permission management

Security assessment

Documents access control for AMI sharing which is security-critical functionality, but does not address a specific vulnerability. Shows how to properly manage launch permissions.

Diff

diff --git a/code-library/latest/ug/ec2_example_ec2_ModifyImageAttribute_section.md b/code-library/latest/ug/ec2_example_ec2_ModifyImageAttribute_section.md
index c94ae3bde..c194f2668 100644
--- a//code-library/latest/ug/ec2_example_ec2_ModifyImageAttribute_section.md
+++ b//code-library/latest/ug/ec2_example_ec2_ModifyImageAttribute_section.md
@@ -108,0 +109,38 @@ PowerShell
+**Tools for PowerShell V5**
+    
+
+**Example 1: This example updates the description for the specified AMI.**
+    
+    
+    Edit-EC2ImageAttribute -ImageId ami-12345678 -Description "New description"
+    
+
+**Example 2: This example makes the AMI public (for example, so any AWS account can use it).**
+    
+    
+    Edit-EC2ImageAttribute -ImageId ami-12345678 -Attribute launchPermission -OperationType add -UserGroup all
+    
+
+**Example 3: This example makes the AMI private (for example, so that only you as the owner can use it).**
+    
+    
+    Edit-EC2ImageAttribute -ImageId ami-12345678 -Attribute launchPermission -OperationType remove -UserGroup all
+    
+
+**Example 4: This example grants launch permission to the specified AWS account.**
+    
+    
+    Edit-EC2ImageAttribute -ImageId ami-12345678 -Attribute launchPermission -OperationType add -UserId 111122223333
+    
+
+**Example 5: This example removes launch permission from the specified AWS account.**
+    
+    
+    Edit-EC2ImageAttribute -ImageId ami-12345678 -Attribute launchPermission -OperationType remove -UserId 111122223333
+    
+
+  * For API details, see [ModifyImageAttribute](https://docs.aws.amazon.com/powershell/v5/reference) in _AWS Tools for PowerShell Cmdlet Reference (V5)_. 
+
+
+
+