AWS AWSEC2 documentation change
Summary
Updated CLI example with query filtering and added PowerShell equivalent for retrieving source AMI information
Security assessment
Change focuses on improving command examples and output formatting for source AMI identification. No security-specific content added or modified beyond general documentation improvements.
Diff
diff --git a/AWSEC2/latest/UserGuide/identify-source-ami-used-to-create-new-ami.md b/AWSEC2/latest/UserGuide/identify-source-ami-used-to-create-new-ami.md index 787f3077f..c2156998b 100644 --- a//AWSEC2/latest/UserGuide/identify-source-ami-used-to-create-new-ami.md +++ b//AWSEC2/latest/UserGuide/identify-source-ami-used-to-create-new-ami.md @@ -58 +58,2 @@ Use the [describe-images](https://awscli.amazonaws.com/v2/documentation/api/late - --image-ids ami-1234567890EXAMPLE + --image-ids ami-1234567890EXAMPLE \ + --query "Images[].{ID:SourceImageId,Region:SourceImageRegion}" @@ -60 +61 @@ Use the [describe-images](https://awscli.amazonaws.com/v2/documentation/api/late -Example output – The source AMI information appears in the following fields: `SourceImageId` and `SourceImageRegion` +The following is example output. @@ -62,0 +64 @@ Example output – The source AMI information appears in the following fields: ` + [ @@ -64,16 +66,2 @@ Example output – The source AMI information appears in the following fields: ` - "Images": [ - { - "PlatformDetails": "Linux/UNIX", - "UsageOperation": "RunInstances", - "BlockDeviceMappings": [ - { - "Ebs": { - "DeleteOnTermination": true, - "Iops": 3000, - "SnapshotId": "snap-1112223334example", - "VolumeSize": 8, - "VolumeType": "gp3", - "Throughput": 125, - "Encrypted": false - }, - "DeviceName": "/dev/xvda" + "ID": "ami-0a70b9d193ae8a799", + "Region": "us-west-2" @@ -81,23 +68,0 @@ Example output – The source AMI information appears in the following fields: ` - ], - "Description": "My test AMI", - "EnaSupport": true, - "Hypervisor": "xen", - "Name": "my-test-ami", - "RootDeviceName": "/dev/xvda", - "RootDeviceType": "ebs", - "SriovNetSupport": "simple", - "VirtualizationType": "hvm", - "BootMode": "uefi-preferred", - "ImdsSupport": "v2.0", - **"SourceImageId": "ami-example9876543210",** - **"SourceImageRegion": "us-east-1",** - "ImageId": "ami-1234567890EXAMPLE", - "ImageLocation": "123456789012/my-test-ami", - "State": "available", - "OwnerId": "123456789012", - "CreationDate": "2024-08-16T17:43:15.000Z", - "Public": false, - "Architecture": "x86_64", - "ImageType": "machine" - } - ] @@ -105,0 +71,17 @@ Example output – The source AMI information appears in the following fields: ` +PowerShell + + +###### To identify the source AMI used to create an AMI + +Use the following [Get-EC2Image](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Image.html) cmdlet. + + + Get-EC2Image -ImageId ami-0b1a928a144a74ec9 | Select SourceImageId, SourceImageRegion + +The following is example output. + + + SourceImageId SourceImageRegion + ------------- ----------------- + ami-0a70b9d193ae8a799 us-west-2 +