Infra Lang is an Infrastructure-as-Code DSL for DevOps engineers, SREs, and
platform teams. Describe your application — services, databases, queues,
secrets, and pipelines — in one declarative .infra file, and compile it to the
target you need.
Infrastructure is maintained in many formats at once: raw Kubernetes YAML, a
local docker-compose.yml, a GitHub Actions workflow, maybe Terraform. Each is
written and maintained by hand, so they drift apart — and mistakes in the
Kubernetes manifests only surface at kubectl apply time, not when you write
them.
Infra Lang replaces the fragmentation with a single, validated source of truth.
Write the service once:
# app.infra
service api {
image: "myapp/api:v1.0.0"
replicas: 3
port 8080
health http("/health")
resources {
requests { cpu: 200m, memory: 256Mi }
limits { cpu: 1000m, memory: 512Mi }
}
}
Compile it to Kubernetes:
infra compile app.infra --target kubernetes
Which produces a Deployment and a Service:
apiVersion: apps/v1
kind: Deployment
metadata:
name: api
spec:
replicas: 3
selector:
matchLabels:
app.kubernetes.io/name: api
template:
spec:
containers:
- name: api
image: myapp/api:v1.0.0
ports:
- containerPort: 8080
name: port-0
resources:
requests: { cpu: 200m, memory: 256Mi }
limits: { cpu: 1000m, memory: 512Mi }
readinessProbe:
httpGet: { path: /health, port: 8080 }
---
apiVersion: v1
kind: Service
metadata:
name: api
spec:
selector:
app.kubernetes.io/name: api
ports:
- port: 8080
targetPort: 8080
The same file compiles to Docker Compose and (via a pipeline block) to a
GitHub Actions workflow.
Install
pip install 'git+https://github.com/TuviDev/infra-lang.git'
Write a .infra file (see the demo above).
Compile to your target
infra validate app.infra
infra compile app.infra --target kubernetes
| Example | What it shows |
|---|---|
| 01_hello_world | The simplest single service |
| 02_web_app | API + database + cache + secrets |
| 03_microservices | Three services sharing a DB and a queue |
| 04_cicd_pipeline | A full CI/CD pipeline (GitHub Actions) |
Infra Lang is inspired by the ideas behind Terraform, Score, and Pulumi.