Answers: <p>It seems to be stored under</p>
  <pre><code>/var/lib/cloud/instances
  </code></pre>
  <p>Under your <a href="https://devops.stackexchange.com/q/15483/18965">instance id</a>.</p>
  <pre><code>cd /var/lib/cloud/instances/$(cloud-init query instance_id)
  </code></pre>
  <p>For me I found the information I wanted in <code>user-data.txt</code>.</p>
  <pre><code>sudo cat &quot;/var/lib/cloud/instances/$(cloud-init query instance_id)/user-data.txt&quot;
  </code></pre>
  
Answers: CC BY-SA 4.0
Answers: 2022-03-20T21:30:25.417Z
Answers: 2022-06-16T06:57:19.253Z
Answers: 2022-06-16T06:57:19.253Z
Answers: Evan Carroll
Body: <p>I'm sending my cloud-init file to Terraform via <code>user_data</code>. Is this stored anywhere on the machine that runs it? I know it may get merged with other stuff before it's run.</p>
  
Tags: <terraform><configuration><cloud-init>
Title: Does cloud-init store the copy of the init it ran first?
UserDisplayName: Evan Carroll
ThreadText: # Does cloud-init store the copy of the init it ran first?
  
  (Asked by: username_0 on 2022-03-20)
  
  I'm sending my cloud-init file to Terraform via `user_data`. Is this stored anywhere on the machine that runs it? I know it may get merged with other stuff before it's run.
  
  **Tags:** terraform, configuration, cloud-init
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2022-03-20. Score: 1 | Accepted answer
  
  It seems to be stored under
  
  ```
  /var/lib/cloud/instances
  
  ```
  
  Under your [instance id](https://devops.stackexchange.com/q/15483/18965).
  
  ```
  cd /var/lib/cloud/instances/$(cloud-init query instance_id)
  
  ```
  
  For me I found the information I wanted in `user-data.txt`.
  
  ```
  sudo cat "/var/lib/cloud/instances/$(cloud-init query instance_id)/user-data.txt"
  
  ```
  
  
  ---
  
  