aztfmod/terraform-provider-azurecaf/terraform-mock-test-2

Claude Code and agent skill by aztfmod/terraform-provider-azurecaf

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Validate a resource definition end-to-end using terraform test with mock_provider azurerm. Proves the CAF-generated name is accepted by the azurerm provider schema without Azure credentials. Use after provider-build-test succeeds to run the mocked azurerm integration test.

Install

npx vskill@latest install aztfmod/terraform-provider-azurecaf/terraform-mock-test-2

SKILL.md

Terraform Mock Test

Prerequisites

  • Successfully built terraform-provider-azurecaf binary (from provider-build-test skill)
  • Resource entry in resourceDefinition.json with known min_length, max_length, validation_regex

Procedure

1. Install provider locally
bash
GOOS=$(go env GOOS) GOARCH=$(go env GOARCH)
LOCAL_PLUGIN_DIR=~/.terraform.d/plugins/aztfmod.com/arnaudlh/azurecaf/1.0.0/${GOOS}_${GOARCH}
mkdir -p "$LOCAL_PLUGIN_DIR"
cp ./terraform-provider-azurecaf "$LOCAL_PLUGIN_DIR/"
2. Look up azurerm resource attributes

Use Terraform MCP get_provider_details (provider_name: azurerm, provider_namespace: hashicorp, provider_document_type: resources, resource_name: <resource_name>).

Extract only Required arguments and Required nested blocks. Do NOT use Context7.

3. Create test directory
bash
mkdir -p /tmp/azurecaf-test-<resource_name>/tests
4. Create test files

See references/test-templates.md for the main.tf, terraform.rc, and tests/validate_name.tftest.hcl templates.

Key rules:

  • Use aztfmod/azurecaf as provider source (not aztfmod.com/arnaudlh/azurecaf)
  • Use hardcoded fake Azure resource IDs for parent references — do NOT chain azurerm resources
  • The azurerm resource MUST set name = azurecaf_name.test.result
5. Run test
bash
cd /tmp/azurecaf-test-<resource_name>
terraform init # downloads azurerm provider schema
TF_CLI_CONFIG_FILE=/tmp/azurecaf-test-<resource_name>/terraform.rc terraform test -verbose

Always use -verbose to show generated name, resource state, and output values.

6. Validate results

The Outputs: section must show non-empty result and result_length. If empty, assertions are not using output.result — fix them.

7. Lifecycle consistency check

After terraform test passes, verify plan→apply→plan consistency using a separate lifecycle test:

bash
cd /tmp/azurecaf-test-<resource_name>
TF_CLI_CONFIG_FILE=/tmp/azurecaf-test-<resource_name>/terraform.rc terraform plan -out=tfplan
TF_CLI_CONFIG_FILE=/tmp/azurecaf-test-<resource_name>/terraform.rc terraform apply tfplan
TF_CLI_CONFIG_FILE=/tmp/azurecaf-test-<resource_name>/terraform.rc terraform plan

The final terraform plan must report "No changes". If it shows changes, there is a plan-apply inconsistency that must be fixed before proceeding.

Also verify that result is visible during the first plan (not showing (known after apply)) when random_seed is set.

8. Clean up
bash
rm -rf /tmp/azurecaf-test-<resource_name>

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
184
Repository forks
100
7-day trend score
26

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 2 May 2026, 6 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/aztfmod/terraform-provider-azurecaf/terraform-mock-test-2/badge)](https://verified-skill.com/skills/aztfmod/terraform-provider-azurecaf/terraform-mock-test-2)

Something wrong with this skill or its page? Tell us.