Skip to content

TerraConstructs/TerraTitan

Repository files navigation

TerraTitan

TerraTitan Logo

Convert AWS CDK Constructs to Terraform-CDK using LLM

TerraTitan is an LLM-powered workflow that converts AWS CDK constructs to Terraform CDK (CDKTF). This tool is a major component used to generate and maintain the TerraConstructs library, providing reliable and trustworthy infrastructure components for everyone to use.

Introduction Slides

Goals

  • Automated conversion of AWS CDK constructs to Terraform CDK
  • Generate code for:
    • Source Code (AWSCDK > CDKTF)
    • Unit Tests (Jest)
    • Integration Tests (terratest / golang)
  • CLI to manage LLM Code generation workflow
  • Observability using signoz

Repo Layout

.
├── apps
│  └── core                     # Core TerraTitan app
├── data
│  ├── reference                # Reference Data for LLM Prompting
│  │  ├── declarations          # Typescript declaration files
│  │  │   ├── aws-cdk-lib
│  │  │   ├── provider-aws
│  │  │   └── terraconstructs
│  │  ├── docs                  # Terraform Provider Docs (markdown)
│  │  │   ├── provider-aws
│  │  │   └── typescript
│  │  └── merged                # Typescript declaration merged with Provider Docs
│  │      └── provider-aws
│  ├── samples                  # AWS CDK -> CDKTF Sample conversions ( for few shot prompting + validation Evals)
│  │  ├── aws-events
│  │  ├── aws-iam
│  │  ├── aws-kinesis
│  │  ├── aws-sns
│  │  ├── aws-sqs
│  │  └── README.md
│  └── scripts                  # PoC Scripts to  ...
│     ├── claude-cli            # ... Anthropic prompt benchmarking (using bun.sh)
│     ├── mastra                # ... Mastra PoC workspaces (using NodeJS + pnpm)
│     ├── merge-docs            # ... merge Markdown docs into CDKTF provider declaration files (using bun.sh)
│     ├── openai-cli            # ... OpenAI/Gemini prompt benchmarking (using bun.sh)
│     ├── research-assitant     # ... demo mastra workflow (using bun.sh)
│     ├── tf-doc-scrape.sh      # ... download copy of Terraform Docs (markdown)
│     ├── tfdocs2json           # ... Export terraform-provider-xx schema and combine with Terraform Docs
│     └── validate-file         # ... run tsc syntax check on sourceFile
└── packages
   ├── eslint-config
   ├── typescript-config
   └── vitest-config

Pnpm Worskpaces and Turbo Repo

This repository uses pnpm workspaces and turbo to easily manage multiple apps and libraries (as a monorepo).

Getting Started

  • Install all dependencies using mise (or manually)

    mise install

    see mise for a list of required toolkits.

  • Enable corepack:

    corepack enable
  • Install repo-wide dependencies using pnpm:

    pnpm install
  • Build & Install the tfdocs2json binary (see requirements in mise.toml):

    cd data/scripts/tfdocs2json
    make install

Run tasks

  • pnpm run test: Runs the test in each package using Turborepo.
  • pnpm run view-report: Collects coverage from each package and shows it in a merged report.
  • pnpm run build: Runs build task
  • pnpm run repo-lint: Lints repo-wide dependency versions

Stand up Signoz

To stand up Signoz for observability, you can use the provided Docker Compose file:

cd signoz
./start.sh

📄 License

This project is licensed under the GPL-3.0 License - see the LICENSE file for details.

🙏 Acknowledgments

  • Presented at DevOpsDay Singapore 2025 by Charles Martinot and Vincent De Smet
  • Powered by mastra.ai

About

Your friendly Construct Transformer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages