AWS AWSEC2 documentation change
Summary
Restructured documentation to separate store/restore tasks, added PowerShell examples, updated CLI command outputs, and improved task description clarity
Security assessment
Changes focus on improving command syntax examples (CLI/PowerShell) and task separation. No security vulnerabilities, encryption changes, or access control modifications are mentioned. The existing security context about encrypted snapshots remains unchanged.
Diff
diff --git a/AWSEC2/latest/UserGuide/work-with-ami-store-restore.md b/AWSEC2/latest/UserGuide/work-with-ami-store-restore.md index efa70ed57..02114b4ef 100644 --- a//AWSEC2/latest/UserGuide/work-with-ami-store-restore.md +++ b//AWSEC2/latest/UserGuide/work-with-ami-store-restore.md @@ -5 +5 @@ -Securing your AMIsPermissions for storing and restoring AMIs using S3Create store and restore image tasks +Securing your AMIsPermissions for storing and restoring AMIs using S3Create a store image taskCreate a restore image task @@ -17 +17,3 @@ When you store an AMI in an S3 bucket, a store image task is created. You can us - * Create store and restore image tasks + * Create a store image task + + * Create a restore image task @@ -84 +86 @@ If the snapshots that make up the AMI are encrypted, or if your account is enabl -## Create store and restore image tasks +## Create a store image task @@ -87,0 +90,3 @@ To store an AMI in an S3 bucket, start by creating a store image task. The time +AWS CLI + + @@ -90 +95 @@ To store an AMI in an S3 bucket, start by creating a store image task. The time -Use the [create-store-image-task](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/create-store-image-task.html) command. Specify the ID of the AMI and the name of the S3 bucket in which to store the AMI. +Use the [create-store-image-task](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/create-store-image-task.html) command. @@ -109 +114,4 @@ Use the [describe-store-image-tasks](https://awscli.amazonaws.com/v2/documentati - aws ec2 describe-store-image-tasks + aws ec2 describe-store-image-tasks \ + --image-ids ami-0abcdef1234567890 \ + --query StoreImageTaskResults[].StoreTaskState \ + --output text @@ -114,13 +122 @@ The following is example output. - { - "StoreImageTaskResults": [ - { - "AmiId": "ami-0abcdef1234567890", - "Bucket": "amzn-s3-demo-bucket", - "ProgressPercentage": 17, - "S3objectKey": "ami-0abcdef1234567890.bin", - "StoreTaskState": "InProgress", - "StoreTaskFailureReason": null, - "TaskStartTime": "2022-01-01T01:01:01.001Z" - } - ] - } + InProgress @@ -128 +124 @@ The following is example output. -###### To create a restore image task +PowerShell @@ -130 +125,0 @@ The following is example output. -Use the [create-restore-image-task](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/create-restore-image-task.html) command. Using the values for `S3ObjectKey` and `Bucket` from the `describe-store-image-tasks` output, specify the object key of the AMI and the name of the S3 bucket to which the AMI was copied. Also specify a name for the restored AMI. The name must be unique for AMIs in the Region for this account. @@ -132 +127,18 @@ Use the [create-restore-image-task](https://awscli.amazonaws.com/v2/documentatio -###### Note +###### To create the store image task + +Use the [New-EC2StoreImageTask](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2StoreImageTask.html) cmdlet. + + + New-EC2StoreImageTask ` + -ImageId ami-0abcdef1234567890 ` + -Bucket amzn-s3-demo-bucket + +The following is example output. + + + ObjectKey : ami-0abcdef1234567890.bin + +###### To describe the progress of the store image task + +Use the [Get-EC2StoreImageTask](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2StoreImageTask.html) cmdlet. + @@ -134 +146,17 @@ Use the [create-restore-image-task](https://awscli.amazonaws.com/v2/documentatio -The restored AMI gets a new AMI ID. + (Get-EC2StoreImageTask -ImageId ami-0abcdef1234567890).StoreTaskState + +The following is example output. + + + InProgress + +## Create a restore image task + +You must specify a name for the restored AMI. The name must be unique for AMIs in the Region for this account. The restored AMI gets a new AMI ID. + +AWS CLI + + +###### To create a restore image task + +Use the [create-restore-image-task](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/create-restore-image-task.html) command. @@ -140 +168 @@ The restored AMI gets a new AMI ID. - --name "New AMI Name" + --name "my-restored-ami" @@ -146 +174 @@ The following is example output. - "ImageId": "ami-0eab20fe36f83e1a8" + "ImageId": "ami-1234567890abcdef0" @@ -148,0 +177,18 @@ The following is example output. +PowerShell + + +###### To create a restore image task + +Use the [New-EC2RestoreImageTask](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2RestoreImageTask.html) cmdlet. + + + New-EC2RestoreImageTask ` + -ObjectKey ami-0abcdef1234567890.bin ` + -Bucket amzn-s3-demo-bucket ` + -Name "my-restored-ami" + +The following is example output. + + + ImageId : ami-1234567890abcdef0 +