:doc:`EC2 <../../ec2>` / Client / get_image_ancestry

******************
get_image_ancestry
******************



.. py:method:: EC2.Client.get_image_ancestry(**kwargs)

  

  Retrieves the ancestry chain of the specified AMI, tracing its lineage back to the root AMI. For more information, see `AMI ancestry <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-ancestry.html>`__ in *Amazon EC2 User Guide*.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetImageAncestry>`_  


  **Request Syntax**
  ::

    response = client.get_image_ancestry(
        ImageId='string',
        DryRun=True|False
    )
    
  :type ImageId: string
  :param ImageId: **[REQUIRED]** 

    The ID of the AMI whose ancestry you want to trace.

    

  
  :type DryRun: boolean
  :param DryRun: 

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is ``DryRunOperation``. Otherwise, it is ``UnauthorizedOperation``.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'ImageAncestryEntries': [
              {
                  'CreationDate': datetime(2015, 1, 1),
                  'ImageId': 'string',
                  'ImageOwnerAlias': 'string',
                  'SourceImageId': 'string',
                  'SourceImageRegion': 'string'
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **ImageAncestryEntries** *(list) --* 

        A list of entries in the AMI ancestry chain, from the specified AMI to the root AMI.

        
        

        - *(dict) --* 

          Information about a single AMI in the ancestry chain and its source (parent) AMI.

          
          

          - **CreationDate** *(datetime) --* 

            The date and time when this AMI was created.

            
          

          - **ImageId** *(string) --* 

            The ID of this AMI.

            
          

          - **ImageOwnerAlias** *(string) --* 

            The owner alias ( ``amazon`` | ``aws-backup-vault`` | ``aws-marketplace`` ) of this AMI, if one is assigned. Otherwise, the value is ``null``.

            
          

          - **SourceImageId** *(string) --* 

            The ID of the parent AMI.

            
          

          - **SourceImageRegion** *(string) --* 

            The Amazon Web Services Region of the parent AMI.

            
      
    
  