<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>

CC BY-SA 4.0
2022-03-20T21:30:25.417Z
2022-06-16T06:57:19.253Z
2022-06-16T06:57:19.253Z
Evan Carroll
<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>

<terraform><configuration><cloud-init>
Does cloud-init store the copy of the init it ran first?
Evan Carroll
# 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.
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"


---

