Przejdź do treści
Biblioteka skilli
DevOps i chmura · Nauka i wyjaśnianie

opentofu

/opentofu

Obejmuje OpenTofu, otwartoźródłowy fork Terraform: HCL, providery, zarządzanie stanem, moduły oraz migrację z Terraform i różnice między oboma narzędziami.

Repozytorium
domain-expert ↗
Licencja
MIT
Ostatnia zmiana repozytorium
23.09.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
4
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
1
Przestarzałość

Brak sygnałów. Repozytorium zmienione 23.09.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Obejmuje OpenTofu, otwartoźródłowy fork Terraform: HCL, providery, zarządzanie stanem, moduły oraz migrację z Terraform i różnice między oboma narzędziami.

Wyzwalacze z opisu

OpenTofu\tofu plan\tofu apply\Terraform fork\OpenTofu migration\tofu state\MPL license Terraform\
Oryginalny opis (EN)

Covers OpenTofu, the open-source Terraform fork: HCL, providers, state management, modules, migration from Terraform, feature parity, divergences, and community ecosystem. WHEN: \"OpenTofu\", \"tofu plan\", \"tofu apply\", \"Terraform fork\", \"OpenTofu migration\", \"tofu state\", \"MPL license Terraform\". Do NOT use for Terraform-proper questions with no OpenTofu angle — use the `terraform` skill.

Jak działa

  1. How to Approach Tasks
  2. Core Architecture
  3. Migration from Terraform
  4. CLI Reference
  5. Reference Files
Sekcje z nagłówków SKILL.md, w oryginale · 169 linii, 789 słów
Podgląd SKILL.md
---
name: opentofu
description: "Covers OpenTofu, the open-source Terraform fork: HCL, providers, state management, modules, migration from Terraform, feature parity, divergences, and community ecosystem. WHEN: \"OpenTofu\", \"tofu plan\", \"tofu apply\", \"Terraform fork\", \"OpenTofu migration\", \"tofu state\", \"MPL license Terraform\". Do NOT use for Terraform-proper questions with no OpenTofu angle — use the `terraform` skill."
license: MIT
---

# OpenTofu Technology Expert

This skill covers OpenTofu, the open-source fork of Terraform maintained by the Linux Foundation. OpenTofu was created in response to HashiCorp's license change from MPL 2.0 to BSL 1.1 in August 2023. Current version is 1.x.

OpenTofu maintains broad compatibility with Terraform but diverges on newer features. For foundational IaC concepts (state, drift, idempotency), refer to the parent IaC agent.

## How to Approach Tasks

1. **Classify** the request:
   - **Troubleshooting** -- Load `references/diagnostics.md`
   - **Architecture / internals** -- Load `references/architecture.md`
   - **Best practices** -- Load `references/best-practices.md`
   - **Migration from Terraform** -- Cover compatibility, state migration, provider reuse

2. **Identify context** -- Is the user migrating from Terraform, starting fresh, or maintaining an existing OpenTofu setup?

3. **Note divergences** -- OpenTofu and Terraform share a common heritage but diverge on features after the fork point. Always clarify which features are OpenTofu-specific vs shared.

## Core Architecture

OpenTofu shares the same fundamental architecture as Terraform:

- **HCL configuration** -- Same HCL syntax, same `.tf` file format
- **Provider plugin protocol** -- Uses the same gRPC provider protocol (versions 5 and 6). Most Terraform providers work with OpenTofu.
- **State file** -- Same format (version 4). State files are interchangeable between Terraform and OpenTofu.
- **Module system** -- Same module structure, same registry protocol
- **CLI workflow** -- `tofu init`, `tofu plan`, `tofu apply` (drop-in replacement for `terraform` commands)

### Key Differences from Terraform

| Feature | OpenTofu | Terraform |
|---|---|---|
| **License** | MPL 2.0 (open source) | BSL 1.1 (source-available) |
| **Governance** | Linux Foundation, community-driven | HashiCorp (Broadcom) |
| **Registry** | OpenTofu Registry (mirrors + community) | Terraform Registry |
| **State encryption** | Native state encryption (client-side) | No native encryption (rely on backend) |
| **Early variable/locals evaluation** | Supported | Not supported |
| **Provider-defined functions** | Supported (own implementation) | Supported (different implementation) |
| **Removed blocks** | `removed` block for safe resource removal | `removed` block (different syntax) |
| **Stacks** | Not supported | Terraform Cloud/Enterprise only |
| **Cloud integration** | No proprietary cloud service | Terraform Cloud/Enterprise |

### State Encryption

OpenTofu's standout feature — client-side state encryption:

```hcl
terraform {
  encryption {
    key_provider "pbkdf2" "my_passphrase" {
      passphrase = var.state_passphrase
    }

    method "aes_gcm" "my_method" {
      keys = key_provider.pbkdf2.my_passphrase
    }

    state {
      method = method.aes_gcm.my_method
    }

    plan {
      method = method.aes_gcm.my_method
    }
  }
}
```

Key providers: `pbkdf2`, `aws_kms`, `gcp_kms`, `openbao` (Vault fork).

### Early Variable/Locals Evaluation

OpenTofu allows variables and locals in `backend` and `module.source` blocks:

```hcl
# OpenTofu only — not valid in Terraform
variable "environment" {
  type = string
}

terraform {
  backend "s3" {
    bucket = "mycompany-${var.environment}-state"
    key    = "terraform.tfstate"
    region = "us-east-1"
  }
}
```

## Migration from Terraform

### Compatibility Assessment

1. **CLI**: Replace `terraform` with `tofu` — most commands are identical
2. **State**: State files are compatible. No conversion needed.
3. **Providers**: Most providers work. Check the OpenTofu Registry for availability.
4. **Modules**: Terraform Registry modules work if they don't use BSL-only features.
5. **Backend**: Same backend types supported (S3, GCS, Azure Blob, Consul, pg).

### Migration Steps

```bash
# 1. Install OpenTofu
brew install opentofu    # macOS
# or download from https://opentofu.org/docs/intro/install/

# 2. Verify version
tofu version

# 3. Initialize (downloads providers from OpenTofu Registry)
tofu init

# 4. Validate
tofu validate

# 5. Plan (compare against existing state)
tofu plan

# 6. If plan matches expectations, you're migrated
# State file remains in the same backend — no migration needed
```

### Breaking Points

- **Terraform Cloud/Enterprise features**: Remote execution, Sentinel policies, private registry — no OpenTofu equivalent
- **BSL-only features**: Features added to Terraform after 1.5.x may not be in OpenTofu (or may be implemented differently)
- **Provider mirroring**: Some providers may lag in the OpenTofu Registry. Use `provider_installation` block to configure mirrors.

```hcl
# Use Terraform Registry as fallback
provider_installation {
  direct {
    exclude = []
  }
}
```

## CLI Reference

```bash
# Core workflow (identical to Terraform)
tofu init              # Initialize, download providers
tofu plan              # Preview changes
tofu apply             # Apply changes
tofu destroy           # Destroy all resources

# State management
tofu state list
tofu state show <resource>
tofu state mv <source> <dest>
tofu state rm <resource>
tofu import <resource> <id>

# Validation and formatting
tofu validate
tofu fmt -check -recursive
tofu test              # Run tests

# State encryption
tofu init -migrate-state    # Enable encryption on existing state
```

## Reference Files

- `references/architecture.md` — OpenTofu internals, registry architecture, provider compatibility layer, state encryption deep dive, fork divergence tracking
- `references/best-practices.md` — Migration strategies, provider pinning, state encryption configuration, CI/CD integration, community module usage
- `references/diagnostics.md` — Provider compatibility issues, state migration errors, encryption key management, registry resolution failures
Pliki w paczce (4)
  • SKILL.md 6 KB
  • references/architecture.md 6 KB
  • references/best-practices.md 3 KB
  • references/diagnostics.md 3 KB

Wersje

RepozytoriumWynikLicencja
Ta strona · chrishuffman5/domain-expert100MIT
TerminalSkills/skills100Apache-2.0

Migawka bazy z 13.11.2026 · wersja paczki 976398b90e9c (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100terraform-helper
    Pomaga w pracy z plikami .tf w Terraform i OpenTofu: HCL, providery, moduły, zarządzanie stanem i polecenia CLI.
  • 100terraform
    Pomaga w konfiguracji Terraform i OpenTofu: moduły, testy, zarządzanie stanem, migracja stanu i przegląd HCL oraz wzorce IaC.
  • 100terraform
    Konfiguruje moduły Terraform i OpenTofu, testy, zarządzanie stanem i przegląd HCL dla wielu środowisk infrastruktury jako kodu.
  • 100opentofu-migration
    Migruje z Terraform do OpenTofu z zachowaniem zgodności stanu, konfiguracją rejestru dostawców i aktualizacją potoków CI/CD, przy przejściu na otwartoźródłowy fork bez licencyjnych ograniczeń.
  • 100opentofu-migration
    Przenosi infrastrukturę z Terraform na OpenTofu, dbając o zgodność stanu, konfigurację rejestru dostawców i aktualizację potoków CI/CD.
  • 90terraform
    Pomaga zmieniać repozytorium Terraform lub OpenTofu: providery, moduły, zasoby, stan, zmienne i plany infrastruktury.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.