Answers: <blockquote>
    <p>Is there any way to tell which AMI my EC2 instance was created from?</p>
  </blockquote>
  
  <h2>Short answer: yes.</h2>
  
  <h2>Longer answer: yes - how would you like to get it?</h2>
  
  <p>The AMI which the EC2 instance was launched with is part of the <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html" rel="nofollow noreferrer">EC2 instance metadata</a></p>
  
  <p>Every instance publishes its metadata, which you can retrieve via the HTTP interface:</p>
  
  <pre><code>curl http://&lt;instance.ip.address&gt;/latest/meta-data/ami-id
  </code></pre>
  
  <p>(lifted directly from the AWS docs)</p>
  
  <p>Many people prefer the Python library for the AWS API (<a href="https://boto3.amazonaws.com/v1/documentation/" rel="nofollow noreferrer">boto3</a>). In this particular case you would need to use the <code>instance.image_id</code> method.</p>
  
Answers: CC BY-SA 4.0
Answers: 2019-08-02T16:40:58.530Z
Answers: If OP updates the question, I could give a more specific answer to the question.
Answers: Bruce Becker
Answers: CC BY-SA 4.0
Answers: 2019-08-02T16:51:33.703Z
Answers: Thanks I also see it in the console (console.aws.amazon.com).  Not sure why I didn't see it before.  Thanks!
Answers: ClintM
Answers: CC BY-SA 4.0
Answers: 2019-08-02T16:39:00.780Z
Answers: 2019-08-02T16:46:24.217Z
Answers: 2019-08-02T16:46:24.217Z
Answers: Bruce Becker
Body: <p>Is there any way to tell which AMI my EC2 instance was created from?</p>
  
Comments: CC BY-SA 4.0
Comments: 2019-08-02T15:31:35.163Z
Comments: I'm voting to close this question as off-topic because it can be simply answered by reading the AWS docs.
Comments: Bruce Becker
Comments: CC BY-SA 4.0
Comments: 2019-08-02T15:42:45.580Z
Comments: Hi @bruce-becker… welcome to StackExchange if you can answer my question by pointing me to the source of the documentation that would be much appreciated and I would surely reward you with reputation points. Thanks!
Comments: ClintM
Comments: CC BY-SA 4.0
Comments: 2019-08-02T16:40:34.450Z
Comments: hi @ClintM - Could you update your question to make it a bit more specific? The reason I voted to close this was because it's almost impossible to answer accurately because there are so many ways to solve the question. Maybe give some more context of what your environment looks like, what language you prefer, whether this is automated, via the console, etc etc.
Comments: Bruce Becker
Tags: <amazon-web-services><amazon-ec2><amazon-ami>
Title: Which AMI was my EC2 instance created from?
UserDisplayName: ClintM
ThreadText: # Which AMI was my EC2 instance created from?
  
  (Asked by: username_0 on 2019-08-02)
  
  Is there any way to tell which AMI my EC2 instance was created from?
  
  **Tags:** amazon-web-services, amazon-ec2, amazon-ami
  
  > **Comments:**
  > **username_1**: I'm voting to close this question as off-topic because it can be simply answered by reading the AWS docs.  
  > **username_0**: Hi @username_1… welcome to StackExchange if you can answer my question by pointing me to the source of the documentation that would be much appreciated and I would surely reward you with reputation points. Thanks!  
  > **username_1**: hi @username_0 - Could you update your question to make it a bit more specific? The reason I voted to close this was because it's almost impossible to answer accurately because there are so many ways to solve the question. Maybe give some more context of what your environment looks like, what language you prefer, whether this is automated, via the console, etc etc.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-08-02. Score: 2 | Accepted answer
  
  > Is there any way to tell which AMI my EC2 instance was created from?
  
  ## Short answer: yes.
  
  ## Longer answer: yes - how would you like to get it?
  
  The AMI which the EC2 instance was launched with is part of the [EC2 instance metadata](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html)
  
  Every instance publishes its metadata, which you can retrieve via the HTTP interface:
  
  ```
  curl http://<instance.ip.address>/latest/meta-data/ami-id
  
  ```
  
  (lifted directly from the AWS docs)
  
  Many people prefer the Python library for the AWS API ([boto3](https://boto3.amazonaws.com/v1/documentation/)). In this particular case you would need to use the `instance.image_id` method.
  
  > **Comments:**
  > **username_1**: If OP updates the question, I could give a more specific answer to the question.  
  > **username_0**: Thanks I also see it in the console (console.aws.amazon.com).  Not sure why I didn't see it before.  Thanks!  
  
  ---
  
  