Table of Contents

The Error

No instance found for the given address / No matching resource found

What Causes This

The resource address doesn’t exist in state. Wrong format, resource is in a module, or was removed/renamed.

How to Fix It

Solution 1: List All Resources

terraform state list | grep web

Solution 2: Correct Address Format

terraform state show 'aws_instance.web[0]'           # count
terraform state show 'aws_instance.web["primary"]'    # for_each
terraform state show 'module.vpc.aws_vpc.main'        # module

Solution 3: Check Workspace

terraform workspace show
terraform workspace select production
terraform state list

Prevention Tips

  1. Pin provider versions — avoid surprise breaking changes
  2. Use CI/CD — catch errors before they hit production
  3. Test with terraform plan — always review before applying
  4. Keep Terraform updated — newer versions have better error messages
  5. Use terraform validate — catches syntax errors early

Hands-On Courses

Conclusion

This error is common and fixable. Follow the solutions above, and check our Terraform course for hands-on training that covers real-world troubleshooting scenarios.