Azure Terraform CLI

SkillFiles & storage

Terraform CLI operations manage Azure infrastructure as code through Terraform formatting, validation, initialization, planning, apply workflows, destroy workflows, state inspection, import workflows, module development, provider lock files, tfvars, and security scanning. Use this skill when working with terraform init, plan, apply, destroy, validate, fmt, state, import, or tfsec workflows.

Use Azure Terraform CLI in Claude, ChatGPT or Ahel Desktop

Free. Sign in, add Azure Terraform CLI and connect your AI. About a minute.

Also: Claude Code · Cursor · Codex

Then ask your AI: use the Azure Terraform CLI skill

Details

Instructions available. Your AI can read the instructions. Execution depends on the setup they require.

Add Ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.

Azure Terraform CLIStart free

What this skill tells your AI

The instructions your AI receives, as published by gbb-acelerators/awesome-harness-primitives in harness/claude-code/skills/azure-terraform-cli/SKILL.md and read by Ahel’s review.

Use this skill to turn Terraform infrastructure requests into ordered CLI workflows, preserve plan and state safety, and return formatting, validation, plan, scan, or read-only state evidence with exit codes and next-step recommendations.

When to invoke

  • "Validate or format Terraform configurations."
  • "Run terraform init or create a Terraform plan."
  • "Summarize resources to add, change, or destroy from a Terraform plan."
  • "Inspect Terraform state without changing resources."
  • "Run tfsec or Checkov against infrastructure code."

Prerequisites and context

  • Terraform >= 1.5.0 installed.
  • Azure CLI authenticated.
  • Backend storage account accessible.
  • Environment variables: ARM_SUBSCRIPTION_ID, ARM_TENANT_ID.

Procedure

  1. Confirm the working directory, backend mode, environment, and tfvars file before running Terraform commands.
  2. Run formatting and validation before planning when configuration changes are in scope.
  3. Initialize with the appropriate backend mode for the requested workflow.
  4. Create and inspect plans with saved plan files when planning changes.
  5. Keep state operations read-only unless a separate approved workflow explicitly requires mutation.
  6. Return the result using the output template.

Format and validate

# Check formatting
terraform fmt -check -recursive -diff

# Apply formatting
terraform fmt -recursive

# Validate configuration
terraform init -backend=false
terraform validate

Planning

# Initialize with backend
terraform init -reconfigure

# Create plan
terraform plan   -var-file=environments/${ENVIRONMENT}.tfvars   -out=tfplan   -detailed-exitcode

# Show plan in JSON
terraform show -json tfplan | jq '.resource_changes'

Security scanning

# TFSec scan
tfsec . --format=json --out=tfsec-results.json

# Checkov scan
checkov -d . --output-file=checkov-results.json --output=json

State operations (read-only)

# List resources
terraform state list

# Show resource details
terraform state show 'azurerm_kubernetes_cluster.main'

Best practices

  1. ALWAYS run terraform fmt before committing.
  2. ALWAYS run terraform validate before planning.
  3. NEVER commit .tfstate files.
  4. ALWAYS use -out flag for plans to review.
  5. Use workspaces for environment separation.
  6. Enable state locking with Azure blob lease.

Output template

Return exactly this structure:

**Status:** PASS | FAIL | BLOCKED
**Summary:** One sentence describing the formatting, validation, plan, scan, state, or infrastructure outcome.

### Details
1. Command executed: `<terraform, tfsec, or checkov command with full parameters>`
2. Exit code: `<0 success, 1 error, 2 changes pending, or tool-specific code>`
3. Workspace or environment: `<workspace, ENVIRONMENT, or tfvars file>`
4. Plan summary: `<resources to add/change/destroy or not applicable>`
5. Warnings or errors: `<line references, scan findings, backend issues, or none>`
6. Recommendations: `<next Terraform action or none>`

### Validation
- Formatting and validation: `<terraform fmt or validate evidence or reason not checked>`
- Plan or state evidence: `<terraform plan, show, state list, state show, scan output, or reason not checked>`

Limits

  • Do not use this skill for Azure CLI day-2 commands.
  • Use azure-cli (skill) instead when the task is direct Azure resource queries, AKS credentials, ACR, Key Vault, account context, RBAC checks, or managed identity operations.
  • Do not use this skill for Azure architecture design.
  • Use azure-infrastructure (skill) instead when the task is architecture patterns, hub-spoke networking, private endpoints, naming, tagging, or Workload Identity design.
  • Do not use this skill for Kubernetes operations.
  • Use azure-kubectl-cli (skill) instead when the task is Kubernetes resource inspection, logs, events, manifests, rollout, or troubleshooting.
  • Do not use this skill for Helm charts.
  • Use azure-helm-cli (skill) instead when the task is chart values, repositories, templates, releases, upgrades, or rollbacks.
  • Do not use this skill for full deployment orchestration.
  • Use open-horizons-deploy-orchestration (skill) instead when the task spans prerequisites, Terraform apply sequencing, Kubernetes verification, and platform validation.

Related primitives

NameTypeUse it when
open-horizons-terraformagentDesigning or implementing Terraform modules and infrastructure changes.
open-horizons-security-revieweragentReviewing Terraform security, compliance, or policy findings.
open-horizons-deployment-operatoragentCoordinating approved Terraform execution as part of platform deployment.
azure-cliskillVerifying Azure account, resource, AKS, ACR, or Key Vault state outside Terraform.
azure-infrastructureskillChoosing Azure architecture patterns before encoding infrastructure.
open-horizons-terraform-changeskillRepository-specific validation is required after Terraform changes.

Quality gate

  • name is azure-terraform-cli and matches the parent directory.
  • terraform fmt and terraform validate are run or explicitly marked not applicable before planning.
  • Plans use -out=tfplan and report exit code semantics when a plan is created.
  • State operations are read-only unless a separately approved mutating workflow is in scope.
  • Security scan outputs preserve tfsec-results.json or checkov-results.json paths when scans run.
  • .tfstate files are not committed or exposed in the response.

Signals

GitHub stars
20
Last commit
Sep 2026

Ahel review

  • S4info
    community integration, published by gbb-acelerators, not azure

Automated review, not a security audit. Ruleset v1+k2.

Advanced
Item type
skill
Key
azure-terraform-cli
Source
github.com/gbb-acelerators/awesome-harness-primitives