What is this?
A browser playground for evaluating HCL expressions with
Terraform or OpenTofu — no install, no
project scaffolding, no init/console loop.
Why
You just want to know how setproduct() behaves, or test a gnarly
for expression. Normally that means: install Terraform, make a
project, write HCL, terraform init, terraform console,
fix a typo, Ctrl+C, edit, repeat. This skips all of it — type an
expression, hit Run.
How it works
Your input is split: locals { } blocks become a tiny
main.tf, and the bare expression is piped to
<engine> console in a throwaway directory that's created,
evaluated, and deleted per request. Autocomplete and hover docs come straight
from the selected binary's own metadata functions, so they're exact
for whatever engine + version you've picked.
Engines & versions
Toggle between Terraform and OpenTofu; a range of versions is baked in, and you can install any other version on demand from the version menu — pulled from official, checksum-verified sources and cached.
Security
- No shell. Commands run as argv lists; the version is validated against installed binaries, never interpolated.
- Offline, expression-only. Providers, resources, data sources, modules, and filesystem functions (
file(), …) are rejected;initis-backend=false— no network, no file reads. - Bounded. Per-run timeout + CPU/file/process limits; request size capped; runs non-root with dropped capabilities.
- No reflection. Evaluation is an async JSON API — your code is never echoed into the page (no XSS), and it's CSRF-resistant.
Run it yourself
git clone https://github.com/scottx611x/hcl-playground cd hcl-playground make run # → http://localhost:8080
Built by Scott Ouellette. Source on GitHub.