Identify the source AMI used to create a new Amazon EC2 AMI - Amazon Elastic Compute Cloud

Identify the source AMI used to create a new Amazon EC2 AMI

You can identify the source AMI used to create a new AMI by checking the Source AMI ID (console) or sourceImageId (AWS CLI) field on the new AMI. This field contains the ID of the original AMI that was copied to create the new AMI.

You can also find the Region where the source AMI was located by checking the Source AMI Region (console) or sourceImageRegion (AWS CLI) field.

Considerations
  • The ID and Region of the source AMI only appear if the AMI was created by using the following API commands:

    If the AMI was created with any other API command, the ID and Region of the source AMI don't appear.

  • For some older AMIs, the ID and Region of the source AMI might not be available.

  • If the source AMI has been deleted, the ID and Region fields of the source AMI still appear on the new AMI.

  • For AMIs created by using CreateImage (creates an AMI from an instance), the source AMI ID is the ID of the AMI used to launch the instance.

Console
To identify the source AMI used to create an AMI
  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. In the navigation pane, choose AMIs.

  3. Select the AMI to view its details.

    The source AMI information appears in the following fields: Source AMI ID and Source AMI Region

AWS CLI
To identify the source AMI used to create an AMI

Use the describe-images command and specify the ID and Region of the AMI.

aws ec2 describe-images \ --region us-east-1 \ --image-ids ami-1234567890EXAMPLE

Example output – The source AMI information appears in the following fields: SourceImageId and SourceImageRegion

{ "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" } ], "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" } ] }