RetentaRetenta

Evidence record · captured 2026-10-11

Terraform Test

Guides writing and running Terraform's native tests (.tftest.hcl): run blocks, assertions, plan vs apply tests, mock providers and data sources (Terraform 1.7+), testing module outputs, and troubleshooting test syntax. References cover mocks, CI/CD pipelines (GitHub Actions and GitLab CI) and a full example suite for a VPC module.

Official publisherUnverifiedSource reviewedBehavior not tested
Source review

Editorial assessment

This is a source-only assessment. It does not claim runtime or security testing.

What it does

A syntax-dense reference for Terraform's native test framework that steers the agent toward plan-mode unit tests and mocks, with a file-naming convention that lets CI run unit and apply-mode integration tests separately.

Best for

  • Adding .tftest.hcl coverage to a reusable module
  • Testing variable validation rules with expect_failures
  • Setting up mock providers so unit tests run without cloud credentials (Terraform 1.7+)

Strengths in the source

  • Defaults to command = plan and reserves apply mode for tests that need real resource behavior.
  • Names files *_unit_test.tftest.hcl and *_integration_test.tftest.hcl so the two can be filtered in CI.
  • Documents run-block features with version notes, including parallel and state_key from 1.9 and mocks from 1.7.
  • Explains reverse run-order cleanup and the -no-cleanup flag for debugging.

Limitations

  • Apply-mode tests create and destroy real cloud resources, which needs credentials and can incur cost.
  • Some plan-mode examples assert on provider-computed values such as output.vpc_id, which are usually unknown until apply.
  • References cover CI and mocks, but examples are AWS-only.

When not to use it

  • Projects on Terraform before 1.6, which lack the test command.
  • Policy-as-code or compliance checks better handled by dedicated scanners.

Reviewed by Retenta editorial on 2026-10-11; scope: source only.

Files included in this review
  • plugins/terraform/skills/terraform-test/SKILL.md

Evidence and boundaries

Execution · not tested

Retenta has not executed this skill.

Security · not tested

The skill folder bundles no executable scripts. Retenta has not run a security scan.

Revision
f706481af9b8fedb66de909f6243ad29601afa0c
License evidence
MPL-2.0Retenta preserves the license text captured with this immutable upstream snapshot; no independent legal or security review is claimed.
Last source change
2026-08-10
Independent verification
Published by HashiCorp, but not independently verified by a third-party reviewer.
Upstream repository
Open publisher repository

Compatibility

Claude Code

documented

Named in the upstream skill or repository documentation; not tested by Retenta.

OpenAI Codex

documented

Named in the upstream skill or repository documentation; not tested by Retenta.

Cursor

documented

Named in the upstream skill or repository documentation; not tested by Retenta.

GitHub Copilot

documented

Named in the upstream skill or repository documentation; not tested by Retenta.

OpenCode

documented

Named in the upstream skill or repository documentation; not tested by Retenta.

any Agent Skills client via npx skills

documented

Named in the upstream skill or repository documentation; not tested by Retenta.

Requirements and access

  • Terraform CLI 1.6+ (1.7+ for mocks)
  • Cloud credentials for apply-mode tests

Referenced tools

No named tool is required by the reviewed SKILL.md.

Install from the source

Clones the current default branch, which may be newer than the reviewed revision f706481. The destination shown is Claude Code's personal skills folder; other agents read the same folder from their own skills directory.

View the SKILL.md at its source Verify the publisher's install documentation

More DevOps skills →

Install the full skill folder

git clone --depth 1 https://github.com/hashicorp/agent-skills.git
cp -R agent-skills/plugins/terraform/skills/terraform-test ~/.claude/skills/terraform-test

Thyme RAG Capsules

Make this skill’s state durable, governed, and portable.

A Retenta capsule lets agents recall prior work, append provenance-stamped progress, and carry the memory to the next run.