โ ๏ธ 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