.github/skills/terraform-mock-test/SKILL.md
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.
npx skillsauth add aztfmod/terraform-provider-azurecaf terraform-mock-testInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
terraform-provider-azurecaf binary (from provider-build-test skill)resourceDefinition.json with known min_length, max_length, validation_regexGOOS=$(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/"
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.
mkdir -p /tmp/azurecaf-test-<resource_name>/tests
See references/test-templates.md for the main.tf, terraform.rc, and tests/validate_name.tftest.hcl templates.
Key rules:
aztfmod/azurecaf as provider source (not aztfmod.com/arnaudlh/azurecaf)name = azurecaf_name.test.resultcd /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.
The Outputs: section must show non-empty result and result_length. If empty, assertions are not using output.result — fix them.
rm -rf /tmp/azurecaf-test-<resource_name>
development
Analyze test failure output to identify root cause and suggest fixes. Use when build or test failures occur. Triggers on: test failures, build errors, CI failures.
documentation
Analyze changes since the last release tag and determine the appropriate semantic version bump (patch/minor/major) based on CHANGELOG entries and commit types. Triggers on: release preparation, version planning.
testing
Compare two versions of resourceDefinition.json (e.g., branch vs main) and produce a structured change summary. Triggers on: PR review, audit, before/after comparison.
development
Manage resource entries in resourceDefinition.json for the terraform-provider-azurecaf naming provider. Use for lookup, comparison, formatting, and insert/update of resource naming definitions. Triggers on: resourceDefinition.json edits, resource definition lookup, JSON entry formatting, resource comparison.