1 unstable release
new 0.1.0 | Dec 2, 2024 |
---|
#5 in #terraform
235KB
928 lines
๐ฏ tfocus
โ ๏ธ WARNING: Resource targeting should be avoided unless absolutely necessary!
What's this? ๐ค
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.
Features ๐
- ๐ Peco-like fuzzy finder for Terraform resources
- โก Lightning-fast resource selection
- ๐จ Colorful TUI (Terminal User Interface)
- ๐น Vim-like keybindings
- ๐ Recursive file scanning
Installation ๐ ๏ธ
cargo install --git https://github.com/nwiizo/tfocus
Usage ๐ฎ
cd your-terraform-project
tfocus
- ๐ Launch the fuzzy-search UI
- โจ๏ธ Select resources using vim-like keybindings
- ๐ฏ Execute plan/apply on selected resources
Keybindings ๐น
โ
/k
: Move upโ
/j
: Move down/
: Incremental searchEnter
: SelectEsc
/Ctrl+C
: Cancel
โ ๏ธ Important Warning โ ๏ธ
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
When to Use ๐ฏ
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
!
Appropriate Use Cases ๐ญ
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.
Development Status ๐ง
This is an experimental tool. Use at your own risk!
Example ๐บ
$ tfocus
QUERY>
โถ 1 [File] main.tf
2 [Module] vpc
3 [Resource] aws_vpc.main
[โ/k]Up [โ/j]Down [Enter]Select [Esc/Ctrl+C]Cancel
Contributing ๐ค
Issues and PRs are welcome! Please help make this tool safer and more useful.
License ๐
MIT
Final Note ๐ฌ
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
Dependencies
~7โ46MB
~714K SLoC