Unable to fetch list of snapshots associated with a single AMI using Boto3 SDK EC2.Client.describe_images

0

AWS Boto3 SDK EC2.Client.describe_images returns 'BlockDeviceMappings' as a key of the list of dictionaries 'Images'. 'BlockDeviceMappings' is a list of dictionaries whose one of the keys is 'SnapshotId'. The issue is 'SnapshotId' returns a single string, instead of a list of strings, which should ideally be the case, since one AMI may have multiple snapshots associated with it. Any idea, how to get the list of all the snapshots associated with a single AMI?

asked a year ago328 views
1 Answer
0

The snapshot ID displayed in "BlockDeviceMappings" is the snapshot ID used to create the AMI.
In other words, a single AMI cannot have multiple snapshot IDs associated with it.

profile picture
EXPERT
answered a year ago
  • Each AMI has a block device mapping that specifies the block devices to attach to an instance when it is launched from the AMI. For an EBS-backed AMI, we can add EBS volumes and instance store volumes using a block device mapping. I am looking to fetch the list of EBS volumes based on snapshots that can be added to an AMI. Is there a way to fetch the same.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions