Real-World Code Search Recipes/Find Terraform resource blocks

Search infrastructure code for a resource type.

Section: Logs, docs, and ops recipes

Find Terraform resource blocks

bash
bash
rg -t tf '^resource\s+"aws_' infra/
Explanation

Great for impact analysis before cloud changes.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Logs, docs, and ops recipes
Search for 5xx errors in logs
Find common server-side error lines.
OpenIn sheetbashsame section
Find Markdown links
Extract or inspect inline links in docs.
OpenIn sheetbashsame section
Find container image references
Search YAML and Helm files for image tags.
OpenIn sheetbashsame section
Find OpenAPI operation IDs
Search specs for operation identifiers.
OpenIn sheetbashsame section
Find debug logging in source code
Locate `console.log` usage across a codebase.
OpenIn sheetbash1 tag match
Search for AWS access key patterns
Look for common credential shapes.
OpenIn sheetbash1 tag match