Horkos
Cloud infrastructure code that won't let you deploy insecure configurations
A type-safe language for cloud infrastructure that compiles to Terraform. Security is enforced at compile time.
The Idea
// One line of Horkos:
val bucket = S3.createBucket("my-data")
// Generates Terraform with secure defaults:
// ✓ AES256 encryption
// ✓ Versioning enabled
// ✓ Public access blocked
Weakening security requires explicit justification:
// Won't compile:
val bad = S3.createBucket("data", publicAccess: true) // ❌
// Must be explicit:
val public = unsafe("APPROVED: Static website - ticket #402") {
S3.createBucket("website", publicAccess: true) // ✅
}
Quick Start
# Install
# Create a new project
# Compile to Terraform (finds src/main.hk automatically)
# Apply with Terraform
&&
Project Structure
my-infra/
├── src/
│ ├── main.hk # Entry point (convention)
│ └── network/
│ └── vpc.hk # Importable module
└── terraform/ # Generated output
├── main.tf # Provider config
├── resources.tf # From src/main.hk
└── network/
└── vpc.tf # From src/network/vpc.hk
Multi-File Example
// src/network/vpc.hk
val logBucket = S3.createBucket("vpc-logs")
val mainVpc = Network.createVpc("main", cidr: "10.0.0.0/16", flowLogs: logBucket)
// src/main.hk
import "./network/vpc.hk" as network
val sg = Network.createSecurityGroup(vpc: network.mainVpc, name: "web")
val bucket = S3.createBucket("app-data")
)
)
Why Horkos?
| Problem | Other Tools | Horkos |
|---|---|---|
| Security | Opt-in (easy to forget) | Enforced (can't forget) |
| When errors caught | CI/runtime (too late) | Compile time (before commit) |
| Type safety | None or unsound | Full type checking |
| Legacy code | Trust it blindly | Marked as Unverified<T> |
| Cross-file types | N/A | Shared across imports |
Current Status
v0.1.2 - Alpha
✅ S3, VPC, Subnets, Security Groups
✅ Taint tracking with Unverified<T>
✅ unsafe blocks with mandatory justifications
✅ Multi-file projects with cross-file type sharing
✅ Per-file Terraform output
✅ Rich error messages with error codes
See ROADMAP for planned features.
Documentation
- User Guide - Full documentation
- Architecture - Compiler internals
- Roadmap - What's coming next
- Grammar - Language specification
License
MIT OR Apache-2.0
Origin
In Greek mythology, Horkos punished oath-breakers swiftly. Here, your infrastructure declarations are oaths—break them and the compiler stops you.