AWS Security ChangesHomeSearch

AWS code-library documentation change

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

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

Summary

Added PowerShell V5 example for snapshot import with security role requirements

Security assessment

References required IAM permissions for secure snapshot imports, but no specific vulnerability addressed. Reinforces security best practices for data imports.

Diff

diff --git a/code-library/latest/ug/ec2_example_ec2_ImportSnapshot_section.md b/code-library/latest/ug/ec2_example_ec2_ImportSnapshot_section.md
index 360d0a9e7..8c8527e1b 100644
--- a//code-library/latest/ug/ec2_example_ec2_ImportSnapshot_section.md
+++ b//code-library/latest/ug/ec2_example_ec2_ImportSnapshot_section.md
@@ -84,0 +85,30 @@ PowerShell
+**Tools for PowerShell V5**
+    
+
+**Example 1: This example imports a VM disk image of format 'VMDK' to an Amazon EBS snapshot. The example requires a VM Import Service Role with the default name 'vmimport', with a policy allowing Amazon EC2 access to the specified bucket, as explained in the`VM Import Prequisites` topic in http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/VMImportPrerequisites.html. To use a custom role, specify the role name using the `-RoleName` parameter.**
+    
+    
+    $parms = @{
+        "ClientToken"="idempotencyToken"
+        "Description"="Disk Image Import"
+        "DiskContainer_Description" = "Data disk"
+        "DiskContainer_Format" = "VMDK"
+        "DiskContainer_S3Bucket" = "amzn-s3-demo-bucket"
+        "DiskContainer_S3Key" = "datadiskimage.vmdk"
+    }
+    
+    Import-EC2Snapshot @parms
+    
+
+**Output:**
+    
+    
+    Description            ImportTaskId               SnapshotTaskDetail                                                          
+    -----------------      --------------------       ------------------                                                          
+    Disk Image Import      import-snap-abcdefgh       Amazon.EC2.Model.SnapshotTaskDetail
+
+  * For API details, see [ImportSnapshot](https://docs.aws.amazon.com/powershell/v5/reference) in _AWS Tools for PowerShell Cmdlet Reference (V5)_. 
+
+
+
+