Skip to content

Add AI-powered plain-language to Azure Terraform translator#4

Open
tasa23 wants to merge 8 commits into
mainfrom
claude/ai-terraform-azure-translator-hn1f2z
Open

Add AI-powered plain-language to Azure Terraform translator#4
tasa23 wants to merge 8 commits into
mainfrom
claude/ai-terraform-azure-translator-hn1f2z

Conversation

@tasa23

@tasa23 tasa23 commented Jun 17, 2026

Copy link
Copy Markdown
Owner

A small app that converts plain-English infrastructure descriptions into
Terraform (HCL) for Azure using the azurerm provider, powered by Claude.

  • translator.py: core logic (streaming + adaptive thinking)
  • app.py: Flask web UI with /api/translate endpoint
  • cli.py: command-line interface (args or stdin)
  • templates/index.html: single-page UI with examples and copy-to-clipboard
  • README + requirements

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01BAWVgYJc7xKU8iWuZJgEVk

A small app that converts plain-English infrastructure descriptions into
Terraform (HCL) for Azure using the azurerm provider, powered by Claude.

- translator.py: core logic (streaming + adaptive thinking)
- app.py: Flask web UI with /api/translate endpoint
- cli.py: command-line interface (args or stdin)
- templates/index.html: single-page UI with examples and copy-to-clipboard
- README + requirements

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BAWVgYJc7xKU8iWuZJgEVk
Repository owner locked as off-topic and limited conversation to collaborators Jun 17, 2026
claude added 7 commits June 17, 2026 17:37
- Lazy-import the Anthropic client so logic can be tested without the
  package or an API key installed
- tests/test_translator.py: fake-client tests for fence stripping,
  empty-prompt and refusal handling, and the happy path
- README: Testing section (offline unittest + real end-to-end check)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BAWVgYJc7xKU8iWuZJgEVk
- offline-tests job: runs the unittest suite on every push/PR (no secrets)
- live-check job: gated on an ANTHROPIC_API_KEY secret; generates Terraform
  via the CLI and validates it with terraform fmt/init/validate, skipped
  cleanly when the secret is absent
- ignore tf-check/ and Terraform state artifacts; document CI in the README

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BAWVgYJc7xKU8iWuZJgEVk
Drop-in replacement for the IaC-AIStudio app.py with auth/security hardening,
plus security regression tests, GitLab CI, and a Cloud Shell deploy guide.

Changes in app.py:
- Pin the /api/generate model server-side (ignore client-supplied model)
- OTP: 6-digit crypto codes, HMAC-stored, expiry + attempt lockout, single-use
- Require a verified OTP before password reset and account creation
- Rotate the session on login and OAuth callback (fixation)
- Uniform recovery response (email enumeration); bump SESSION_VERSION 3->4

Internal infra/security docs were intentionally not committed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BAWVgYJc7xKU8iWuZJgEVk
Lets the IaC Build app be managed as a git repo and deployed from the VS Code
terminal (az acr build + containerapp update) instead of Cloud Shell.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BAWVgYJc7xKU8iWuZJgEVk
deploy.ps1 mirrors deploy.sh for Windows + VS Code (az acr build +
containerapp update); .gitattributes forces LF so Windows edits don't
break the Linux container build.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BAWVgYJc7xKU8iWuZJgEVk
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BAWVgYJc7xKU8iWuZJgEVk
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BAWVgYJc7xKU8iWuZJgEVk
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants