AWS code-library documentation change
Summary
Added PowerShell V5 examples for CreateImage, including note about file system integrity risk when using -NoReboot parameter
Security assessment
The change documents the security implication of using -NoReboot parameter which may compromise file system integrity, but does not address a specific vulnerability
Diff
diff --git a/code-library/latest/ug/ec2_example_ec2_CreateImage_section.md b/code-library/latest/ug/ec2_example_ec2_CreateImage_section.md index 51b090785..6886ec715 100644 --- a//code-library/latest/ug/ec2_example_ec2_CreateImage_section.md +++ b//code-library/latest/ug/ec2_example_ec2_CreateImage_section.md @@ -113,0 +114,29 @@ PowerShell +**Tools for PowerShell V5** + + +**Example 1: This example creates an AMI with the specified name and description, from the specified instance. Amazon EC2 attempts to cleanly shut down the instance before creating the image, and restarts the instance on completion.** + + + New-EC2Image -InstanceId i-12345678 -Name "my-web-server" -Description "My web server AMI" + + +**Example 2: This example creates an AMI with the specified name and description, from the specified instance. Amazon EC2 creates the image without shutting down and restarting the instance; therefore, file system integrity on the created image can't be guaranteed.** + + + New-EC2Image -InstanceId i-12345678 -Name "my-web-server" -Description "My web server AMI" -NoReboot $true + + +**Example 3: This example creates an AMI with three volumes. The first volume is based on an Amazon EBS snapshot. The second volume is an empty 100 GiB Amazon EBS volume. The third volume is an instance store volume. The syntax used by this example requires PowerShell version 3 or higher.** + + + $ebsBlock1 = @{SnapshotId="snap-1a2b3c4d"} + $ebsBlock2 = @{VolumeSize=100} + + New-EC2Image -InstanceId i-12345678 -Name "my-web-server" -Description "My web server AMI" -BlockDeviceMapping @( @{DeviceName="/dev/sdf";Ebs=$ebsBlock1}, @{DeviceName="/dev/sdg";Ebs=$ebsBlock2}, @{DeviceName="/dev/sdc";VirtualName="ephemeral0"}) + + + * For API details, see [CreateImage](https://docs.aws.amazon.com/powershell/v5/reference) in _AWS Tools for PowerShell Cmdlet Reference (V5)_. + + + +