# OpenTofu + Atlantis

Infrastructure as code you run. OpenTofu is MPL-2.0; Atlantis is Apache-2.0 PR automation. Terraform is BSL — not the OSS path.

**Replaces:** Terraform Cloud

**Tier:** Medium

## Problem

HCP Terraform (Terraform Cloud) meters resources (Essentials from $0.10/resource/month). Terraform itself is BSL 1.1 since 2023 — OSI does not list that as open source. OpenTofu is the MPL-2.0 fork. Atlantis runs plan/apply from pull requests on a box you host. This is not feature parity with every Terraform Cloud run-task and policy-as-code add-on.

## Stack

- [OpenTofu](https://opentofu.org) — MPL-2.0 Terraform fork
- [Atlantis](https://www.runatlantis.io) — Apache-2.0 Terraform/OpenTofu pull-request automation

## Estimated SaaS cost saved

| You stop paying | Typical / year | Self-host instead |
|---|---:|---|
| HCP Terraform Essentials / Standard (small estate) | $2,400 | OpenTofu + Atlantis |

**About $2,400 / year** on a small team, before you count lock-in.

## Deploy on Railway

Placeholder: Atlantis + a volume for its data, talking to OpenTofu. Runners that need cloud credentials are often a VPS. No one-click template in this repo yet — Start on Railway. Git hosting can sit on /stacks/forgejo-git.

[Start on Railway](https://c17.io/go/railway/opentofu-atlantis?from=%2Fstacks%2Fopentofu-atlantis.md)

[Forgejo if you also want to leave Bitbucket Cloud](https://c17.io/stacks/forgejo-git)

## AGENT_PROMPT

```
Replace Terraform Cloud with OpenTofu plus Atlantis.

Do not install current Terraform and call it open source — it is BSL.
- OpenTofu for the CLI. Atlantis for plan/apply comments on PRs. Persist Atlantis data. Lock down the webhook secret.
- Run one existing root module with tofu plan. Do not claim Sentinel / run-task parity.
- Write AGENT_PROMPT.md.
```

## FAQ

### Will my .tf files work?

Most will. OpenTofu tracks Terraform language compatibility; test the providers you actually use. Atlantis is the PR workflow, not a full Terraform Cloud clone (no private-module marketplace, no Sentinel).

### Why Atlantis?

So apply still happens from a pull request. You can also run tofu locally or in Woodpecker/Forgejo Actions — /stacks/woodpecker-ci.

Source: https://c17.io/stacks/opentofu-atlantis
