Why TOSCA before Terraform
Terraform is an execution engine. It knows how to provision resources on a given provider — it does not know what the system is supposed to do, what constraints it must satisfy, or what the relationships between components mean at a semantic level.
TOSCA separates intent from execution. A TOSCA model describes the topology, capabilities, and requirements of a system independently of any provider. When the model is complete and valid, Terraform HCL is derived from it — not authored.
This matters when you need to retarget a deployment from AWS to GCP, or run the same workload across two providers simultaneously. The topology stays constant. Only the compilation target changes.
# TOSCA (source of truth)
node_templates:
api_server:
type: tosca.nodes.Compute
capabilities:
host:
properties:
num_cpus: 8
mem_size: 32 GB
# ↓ Compiled to provider-specific HCL
# aws → aws_instance.api_server
# gcp → google_compute_instance.api_server
# azure → azurerm_linux_virtual_machine.api_server