smithery.ai

debug-resource

Debug and troubleshoot Terraform resource issues

First seen Mar 29, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,580 B
  • docs SUMMARY.md 70 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

Debug Terraform Resource

This skill helps debug issues with Terraform resources in the DataRobot provider.

Common Issues

1. Resource Not Found After Create

  • Check if the API returns the correct ID
  • Verify the ID is stored in state: data.ID = types.StringValue(response.ID)
  • Look for client.NotFoundError handling in Read

2. State Drift

  • Ensure Read populates all computed fields
  • Check for fields that should use UseStateForUnknown() plan modifier
  • Verify Optional fields handle empty vs null correctly

3. Update Not Working

  • Check if field has RequiresReplace() modifier (forces new resource)
  • Verify Update sends only changed fields to API
  • Look for proper error handling in Update

4. Import Fails

  • Ensure ImportState uses resource.ImportStatePassthroughID
  • Verify Read can reconstruct full state from just the ID

Debug Commands

# Enable Terraform debug logging
export TF_LOG=DEBUG
export TF_LOG_PATH=./terraform.log

# Run with trace API calls
export TF_LOG_PROVIDER=TRACE

# Test specific resource
go test -v ./pkg/provider -run TestAcc{ResourceName} -timeout 30m

Useful Patterns

// Add debug tracing
traceAPICall("CreateResourceName")

// Check for not found errors
if _, ok := err.(*client.NotFoundError); ok {
    resp.State.RemoveResource(ctx)
    return
}

// Add diagnostic details
resp.Diagnostics.AddError(
    "Error creating resource",
    fmt.Sprintf("Could not create: %s", err.Error()),
)