2026'daki IaC Panorama

2023 yılında HashiCorp, Terraform'un lisansını MPL 2.0'dan (açık kaynak) değiştirdi. Dünyanın en hararetli tartışmalarından birini ateşleyen İş Kaynağı Lisansı (BSL 1.1) DevOps. BSL, OSI tanımına göre açık kaynak değildir: ticari kullanım yasaktır HashiCorp'un doğrudan rakipleri tarafından. Topluluğun tepkisi şöyle oldu anında: açık kaynak çatalı AçıkTofu, daha sonra Linux Vakfı'na bağışlandı.

2026 yılında pazar üç net pozisyona yerleşti: Terraform, %32,8 pazar payı Devasa kurulu tabanı sayesinde IaC araçları arasında ve sağlayıcılar ve modüllerden oluşan ekosistem; OpenTofu fethetti ~%8 esas olarak sertifikalı açık kaynak lisansları gerektiren ortamlarda; Pulumi ve büyüdüm ~%15 geliştirici deneyimine ve yerel testlere odaklanmak. CloudFormation, CDK, Bicep ve Ansible panoramayı tamamlıyor.

Ne Öğreneceksiniz

  • HashiCorp BSL lisans değişikliğinin geçmişi ve sonuçları
  • OpenTofu: Terraform uyumluluğu, mevcut durum ve yol haritası
  • Pulumi: "gerçek kod olarak altyapı" paradigması, artıları ve eksileri
  • Teknik karşılaştırma tablosu: özellikler, lisanslama, ekosistem, testler
  • Karar matrisi: her bir aracın ne zaman seçileceği
  • Terraform'dan OpenTofu'ya geçiş: adım adım prosedür

HashiCorp Lisans Değişikliği: Ne Anlama Geliyor

HashiCorp tarafından 2023'te kabul edilen İş Kaynağı Lisansı'nda (BSL 1.1) bir madde bulunmaktadır anahtar: Yazılımı, rekabet eden ticari bir ürün sunmak için kullanamazsınız. HashiCorp ile. Pratikte bu şu anlama gelir:

# Cosa e CONSENTITO con la BSL HashiCorp:
# - Uso interno in azienda per gestire infrastruttura propria
# - Contribuire al codebase Terraform
# - Creare moduli e provider Terraform
# - Usare Terraform in CI/CD per i tuoi progetti
# - Formazione e certificazioni

# Cosa NON e CONSENTITO senza licenza commerciale:
# - Offrire Terraform as a Service (competitor di Terraform Cloud/Enterprise)
# - Costruire un prodotto SaaS che "wrappa" Terraform come core feature
#   e compete con HCP Terraform
# - Le piattaforme come Spacelift, Env0, Scalr devono gestire questa zona grigia

# Data conversione a Apache 2.0: non annunciata (BSL diventa Apache 2.0 dopo 4 anni
# dalla release di ogni versione, quindi Terraform 1.5 -> Apache 2.0 nel 2027)

# Chi ha BIFORCATO:
# - OpenTofu (Linux Foundation, ex OpenTF) — replica di Terraform pre-BSL
# - OpenTofu segue Terraform con ~2-4 version lag
# - Attuale: OpenTofu 1.8.x vs Terraform 1.9.x

OpenTofu: Açık Kaynak Çatalı

AçıkTofu (eski adıyla OpenTF) ve tutulan Terraform çatalı Gruntwork, Spacelift, Env0, Scalr ve onlarca firmanın katkılarıyla Linux Vakfı'ndan başkalarının. Belirlenen hedef: Terraform eklendikçe uyumlu kalmayı sürdürmek HCP'nin iş modelini korumak için uygulamayabileceği özellikler.

Uyumluluk ve Farklılıklar

# OpenTofu e un drop-in replacement per Terraform
# I file .tf sono identici: nessuna modifica richiesta per la maggior parte dei casi

# Installazione OpenTofu
# Via brew (macOS/Linux):
brew install opentofu

# Via script ufficiale:
curl --proto '=https' --tlsv1.2 -fsSL https://get.opentofu.org/install-opentofu.sh | \
  sh -s -- --install-method standalone

# Verifica versione
tofu version
# OpenTofu v1.8.3
# on linux_amd64

# Comandi identici a Terraform (solo "tofu" invece di "terraform"):
tofu init
tofu plan
tofu apply
tofu destroy

# Stessa sintassi HCL, stessi provider, stesso state file format

OpenTofu'nun Benzersiz Özellikleri (Terraform'da değil)

# 1. Encrypted State (OpenTofu 1.7+)
# Terraform richiede un backend esterno per la cifratura dello state
# OpenTofu supporta encryption nativa nel backend

terraform {
  encryption {
    key_provider "pbkdf2" "my_key" {
      passphrase = var.state_encryption_key
    }

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

    state {
      method = method.aes_gcm.my_method
    }

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

# 2. Provider Functions (OpenTofu 1.7+, porting in Terraform 1.8)
# Funzioni custom definite nei provider (entrambi supportano ora)

# 3. Variable validation con references ad altre variabili
variable "max_instances" {
  type = number
}

variable "min_instances" {
  type = number
  validation {
    # OpenTofu: puoi referenziare altre variabili nella validation
    condition     = var.min_instances <= var.max_instances
    error_message = "min_instances deve essere <= max_instances."
  }
}

Terraform'dan OpenTofu'ya Geçiş

# Migrazione in 5 passi (praticamente indolore)

# 1. Backup dello state attuale
terraform state pull > backup_$(date +%Y%m%d).tfstate

# 2. Installa OpenTofu
brew install opentofu

# 3. Testa in un ambiente non-prod
cd environments/dev
tofu init   # Legge lo stesso .terraform.lock.hcl (OpenTofu e compatibile)
tofu plan   # Verifica che il plan sia identico a terraform plan

# 4. Se tutto ok, migra il .terraform.lock.hcl
# OpenTofu usa un formato leggermente diverso per il lock file
tofu providers lock \
  -platform=linux_amd64 \
  -platform=darwin_amd64 \
  -platform=darwin_arm64

# 5. Aggiorna le pipeline CI/CD
# Sostituisci "terraform" con "tofu" negli script
# Aggiorna le action GitHub se usi hashicorp/setup-terraform:
# usa opentofu/setup-opentofu invece

# Nel CI/CD (GitHub Actions):
# - name: Setup OpenTofu
#   uses: opentofu/setup-opentofu@v1
#   with:
#     tofu_version: "1.8.x"

Pulumi: Gerçek Kod Olarak Altyapı

Pulumi tamamen farklı bir yaklaşım benimsiyor: Bildirime dayalı DSL (HCL) yerine, kullanmak gerçek programlama dilleri — TypeScript, Python, Go, C#, Java. Bunun derin etkileri vardır: döngülere, koşullara, işlevlere, npm/pip modüllerine erişiminiz vardır, Jest/pytest ve tüm dil araç zinciri ile yerel test.

TypeScript'te Pulumi

// Pulumi - infrastruttura come TypeScript
import * as aws from "@pulumi/aws";
import * as pulumi from "@pulumi/pulumi";

const config = new pulumi.Config();
const environment = config.require("environment");
const instanceCount = config.requireNumber("instanceCount");

// VPC con subnet - stessa logica di Terraform ma con TypeScript
const vpc = new aws.ec2.Vpc("main", {
  cidrBlock: "10.0.0.0/16",
  enableDnsHostnames: true,
  enableDnsSupport: true,
  tags: {
    Name: `${environment}-vpc`,
    Environment: environment,
    ManagedBy: "Pulumi",
  },
});

// Crea subnet dinamicamente con un loop TypeScript nativo
// In Terraform useresti count o for_each
const publicSubnets = Array.from({ length: instanceCount }, (_, i) =>
  new aws.ec2.Subnet(`public-${i}`, {
    vpcId: vpc.id,
    cidrBlock: `10.0.${i}.0/24`,
    mapPublicIpOnLaunch: true,
    tags: { Name: `${environment}-public-${i + 1}` },
  })
);

// Output esportati
export const vpcId = vpc.id;
export const subnetIds = publicSubnets.map(s => s.id);

Pulumi ile Yerel Test

Pulumi'nin Terraform'a göre en somut avantajı test etmektir: yazabilirsiniz Terratest veya harici çerçeveler olmadan standart Jest/pytest/Go testiyle test etme.

// test/infra.test.ts — Unit test Pulumi con Jest
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

// Mock del provider AWS per i test (non fa chiamate reali)
pulumi.runtime.setMocks({
  newResource: (args) => {
    return {
      id: `${args.name}-id`,
      state: { ...args.inputs, id: `${args.name}-id` },
    };
  },
  call: (args) => ({ outputs: {} }),
});

describe("VPC Infrastructure", () => {
  let infra: typeof import("../index");

  beforeAll(async () => {
    infra = await import("../index");
  });

  test("VPC deve avere DNS abilitato", async () => {
    const vpc = await infra.vpc;
    const props = await vpc.enableDnsHostnames.apply(v => v);
    expect(props).toBe(true);
  });

  test("Numero subnet deve corrispondere alla configurazione", async () => {
    const subnets = await pulumi.all(infra.subnetIds).apply(ids => ids.length);
    const expectedCount = Number(process.env.INSTANCE_COUNT || 2);
    expect(subnets).toBe(expectedCount);
  });

  test("Subnet devono appartenere alla VPC", async () => {
    const vpcId = await infra.vpcId;
    // Verifica che ogni subnet abbia il VPC ID corretto
    expect(vpcId).toBeDefined();
    expect(vpcId).toMatch(/^vpc-/);
  });
});

Karşılaştırma Tablosu: Terraform vs OpenTofu vs Pulumi

Özellik Özellik Karşılaştırması (2026)

Özellikler Terraform AçıkTofu Pulumi
Lisans BSL1.1 MPL2.0 Apaçi 2.0
Dil HCL HCL TS/Python/Go/C#
AWS Sağlayıcıları 1200'den fazla kaynak TF'nin aynısı ~900 kaynak
Yerel test dünya testi (1.6+) tofu testi Jest/pytest/Go
Durum şifrelemesi Yalnızca arka uç Yerli (1.7+) Pulumi Bulutu
Öğrenme eğrisi Düşük Düşük Ortalama
Topluluk ve Dokümanlar Harika İyi İyi

Karar Matrisi: Hangisini Ne Zaman Seçmeli

# Scegli TERRAFORM se:
# - Hai gia un team con esperienza HCL e non vuoi riformare
# - Lavori in un contesto enterprise con vendor support HashiCorp
# - Hai bisogno del massimo ecosistema di provider e moduli
# - Non hai requisiti di licenza open-source certificata
# - Usi Terraform Cloud o HCP per il backend di stato

# Scegli OPENTOFU se:
# - La licenza BSL e un problema (healthcare, govtech, open-source aziende)
# - Vuoi drop-in replacement con garanzia open-source a lungo termine
# - Usi gia Terraform e vuoi minimizzare il costo di migrazione
# - Hai bisogno di state encryption nativa (feature non in Terraform)
# - Il tuo company legal ha approvato MPL 2.0 ma non BSL

# Scegli PULUMI se:
# - Il tuo team e composto da developer (non solo DevOps) abituati a TypeScript/Python
# - Hai logica di configurazione complessa: loop, condizionali, validazioni rich
# - Vuoi testing nativo con framework di test standard senza Terratest
# - Stai costruendo un Internal Developer Platform e vuoi API programmatiche
# - Hai bisogno di astrazioni di alto livello (Pulumi Component Resources)

Birlikte Çalışabilirlik: Pulumi'de Terraform Sağlayıcıyı Kullanmak

// Pulumi supporta tutti i provider Terraform via bridge
// Utile per provider non ancora disponibili nativamente in Pulumi

import * as pulumitf from "@pulumi/terraform";

// Usa qualsiasi provider Terraform (anche non ufficiale)
const provider = new pulumitf.Provider("custom-provider", {
  version: "1.2.3",
  // Equivalente di required_providers in Terraform
});

// Questa interoperabilita permette una migrazione graduale
// da Terraform a Pulumi senza dover aspettare che tutti i provider
// siano portati nativamente

Sonuçlar

Bu yarışmanın mutlak bir kazananı yok: her araç bağlam açısından öne çıkıyor farklı. Terraform, en zengin ekosistemle pazar lideri olmaya devam ediyor. OpenTofu e Açık kaynak lisansıyla Terraform uyumluluğu isteyenler için akılcı seçim. Pulumi ve altyapıyı birleştirmek isteyen geliştirici merkezli ekipler için gelecek ve tek bir kod paradigmasında uygulama.

Komple Seri: Terraform ve IaC

  • Madde 01 — Sıfırdan Terraform
  • Madde 02 — Yeniden Kullanılabilir Terraform Modülleri
  • Madde 03 — Terraform Durumu ve Uzak Arka Uç
  • Madde 04 — CI/CD'de Terraform
  • Madde 05 — IaC Testi
  • Madde 06 — IaC güvenliği
  • Madde 07 — Terraform Çoklu Bulut
  • Madde 08 — Terraform için GitOps
  • Madde 09 (bu) — Terraform, Pulumi ve OpenTofu: Karşılaştırma 2026
  • Madde 10 — Terraform Kurumsal Kalıpları