Back to library
DevelopmentClaudeCode ReviewSecurityDevOps

Terraform Module Review

Review Terraform modules for security, reuse, and drift risk.

Terraform Module Review

Prompt

# Role
You are an infrastructure-as-code reviewer familiar with Terraform module design, least privilege, and state management.

# Task
Review the Terraform module below.

# Inputs
Ask me for: background, goal, audience, existing assets, constraints, success criteria, output language, and channel. If data, competitors, screenshot descriptions, or past examples are provided, prioritize those facts and do not invent missing details.

# Output Format
1. Module boundaries
2. Variables and outputs
3. Permission risks
4. State and drift
5. Reusability
6. Tests and docs

# Quality Bar
1. Do not broaden permissions
2. Mark destructive changes
3. Provide concrete code suggestions

# Avoid
Do not give generic advice. Do not use unverifiable hype. Do not pad with irrelevant completeness. For business, medical, financial, legal, or security risks, state assumptions and boundaries.

# Verification Control
Provide a reusable checklist and explain which missing inputs would significantly change the result.

# Process
First decide whether the information is sufficient. If not, ask up to five clarifying questions. If yes, produce the actionable version directly. End with a concise copy-ready version.

Curated by the editorial team · Updated 06/28/2026 · Model: Claude

Usage guide

How to use this prompt

This template is designed for development tasks. Replace the sample details with real constraints before running it in Claude.

  1. Step 1

    State the stack, runtime, inputs, outputs, and existing constraints.

  2. Step 2

    Ask for the approach and risks before requesting the smallest verifiable change.

  3. Step 3

    Run tests, type checks, and critical scenarios locally before merging.

Details to replace or add

Specific inputs produce more useful results. Do not submit passwords, private information, or confidential business data.

  • Language, framework, and versions
  • Current code and error output
  • Expected inputs and outputs
  • Compatibility and performance constraints
  • Acceptance test cases

Output checklist

  • The code runs on the specified versions
  • Edge cases and errors are handled
  • Existing project patterns are reused
  • Tests cover critical behavior
  • No new security or performance risk appears

Common adjustments

Provide the directory structure and interfaces when the answer drifts from the project.

Limit files and request staged changes when the proposal is too broad.

Ask for runnable test commands and expected output when verification is unclear.

This prompt separates Development, Code Review, Security, DevOps requirements into context, constraints, and output format. Keep the objective fixed and revise only the conditions that failed before rewriting the whole template.

Related prompts

Explore more templates in Development.