r/opentofu

▲ 1 r/opentofu+1 crossposts

I've created tfimport, a tool to make importing infrastructure into tf managed state a bearable task!

Hello fellow Cloud / Platform / SRE / DevOps / (whatever we are called these days) engineers!

You remember that time when you had to import a ton of resources into Terraform-managed state? I bet you do!

The hunt for those "ClickOpsed" resources, searching for the specific info needed to generate the import ID, jumping into the cloud dashboard to find a single value, or writing clever (but fragile) bash one-liners to sort it all out...

Well, I have good news for you: I've solved that problem!

Oh, Well... not the ClickOps part. That is probably never going away. But as I usually like to do... I built a tool to make the process easier, quicker, and more reliable!

tfimport figures out import IDs by looking directly at your OpenTofu/Terraform plan. When the plan doesn't provide all the right info, it is smart enough to look it up using the cloud provider SDKs!

✅ Supports OpenTofu, Terraform, and Terragrunt.
✅ Supports a large pool of resources across most major cloud providers.
✅ Free and Open Source.
✅ Available as builds/packages for your favorite OS (or just grab the binary!).

Check it out here: https://tfimport.coolapso.sh

tfimport.coolapso.sh
u/4s3ti — 12 hours ago
▲ 1 r/opentofu+1 crossposts

Built a native GNOME desktop GUI for Terraform / OpenTofu, inspired by TFE and OTF

Sharing a side project for linux desktop users: Terrain, an open-source desktop app for managing Terraform / OpenTofu workflows locally, with a UI shaped like Terraform Enterprise / HCP Terraform / OTF. Remote backends (HCP, self-hosted TFE, OTF) work too, via go-tfe, in the same sidebar.

The motivation was selfish: I wanted TFE-style ergonomics (workspaces, run history, structured plan diffs, variable management) for projects on my laptop, using a desktop native tool that isn't a browser tab. What works today:

  • Local projects added by Git URL. Terrain clones into its own data dir; multiple subpaths share one clone.
  • Tofu workspaces are first-class, runs pinned via TF_WORKSPACE, parsed from -json output.
  • Plan diff: TFE-style action badges with per-attribute before/after.
  • State viewer with version history and side-by-side diff between snapshots.
  • Variables and variable sets, sensitive values stored in libsecret only.
  • Managed binary mode: SHA256-verified upstream OpenTofu / Terraform releases per workspace, no host install needed.

Disclosure: most of the Go was written with help from Claude, all reviewed by me. Terrain does not generate or modify your Terraform; runs go through the upstream tofu / terraform binary unchanged.

Source: https://github.com/raspbeguy/terrain

Honest feedback welcome, especially from folks running serious state.

u/ThisIsACoolNick — 4 days ago
▲ 5 r/opentofu+1 crossposts

I am just getting started with OpenTofu and on a recent post, someone highly recommended I do NOT use local states for my homelab. It took a bit, but I do have my main OpenTofu project/configuration using Cloudflare's R2 object storage using the S3 backend type.

What I am stuck on now is trying to continue to use OpenTofu to build the inventory using the ansible/ansible provider. In my state object in my bucket, I can see the inventory resource just like when it was local, but I cannot seem to figure out how to call it from Ansible. When I do, I get an alert saying that Terraform (instead of OpenTofu) needs to do an init. Any suggestions?

In the meantime, I added a data source for this and am using a local_file resource to write out the inventory. That will work for my needs, but I'm still curious what I'm doing wrong.

Also, overall this has been going much slower than I anticipated. For a newbie to the tool, it is a bit overwhelming even though I've done infrastructure engineering for a long time. If someone has a pointer on a good primer to read, I'd appreciate the pointer. My Google-Fu has given me lots of info, but I've also had to re-interpret it because functionality has changed or bits of a walk-through are missed out.

reddit.com
u/Mountain-Cat30 — 14 days ago