⚠️ WARNING: Resource targeting should be avoided unless absolutely necessary!
tfocus is a super interactive tool for selecting and executing Terraform plan/apply on specific resources. Think of it as an "emergency tool" - not for everyday use.
- 🔍 Peco-like fuzzy finder for Terraform resources
- ⚡ Lightning-fast resource selection
- 🎨 Colorful TUI (Terminal User Interface)
- 🎹 Vim-like keybindings
- 📁 Recursive file scanning
install from crates.io
cargo install tfocus
install from github
cargo install --git https://github.com/nwiizo/tfocus
cd your-terraform-project
tfocus
- 🔍 Launch the fuzzy-search UI
- ⌨️ Select resources using vim-like keybindings
- 🎯 Execute plan/apply on selected resources
↑
/k
: Move up↓
/j
: Move down/
: Incremental searchEnter
: SelectEsc
/Ctrl+C
: Cancel
Using terraform resource targeting comes with significant risks:
- Potential disruption of the Terraform resource graph
- 🎲 Risk of state inconsistencies
- 🧩 Possible oversight of critical dependencies
- 🤖 Deviation from standard Terraform workflow
Only use this tool in specific circumstances:
- 🚑 Emergency troubleshooting
- 🔧 Development debugging
- 🧪 Testing environment verification
- 📊 Impact assessment of large-scale changes
For regular operations, always use full terraform plan
and apply
!
You might consider using tfocus when:
- 🔥 Working with large Terraform codebases where you need to verify specific changes
- 🐌 Full plan execution takes too long during development
- 🔍 Emergency inspection of specific resource states
- 💣 Staged application of changes in complex infrastructure
Remember! Standard terraform plan
and apply
are the best practices for normal operations.
This is an experimental tool. Use at your own risk!
$ tfocus
QUERY>
▶ 1 [File] main.tf
2 [Module] vpc
3 [Resource] aws_vpc.main
[↑/k]Up [↓/j]Down [Enter]Select [Esc/Ctrl+C]Cancel
Issues and PRs are welcome! Please help make this tool safer and more useful.
MIT
Think of this tool as a "fire exit" - It's there when you need it, but you hope you never have to use it! 😅
made with 🦀 and ❤️ by nwiizo