Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nwiizo/tfocus
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.
https://github.com/nwiizo/tfocus
devops rust rust-lang terraform
Last synced: 26 days ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/nwiizo/tfocus
- Owner: nwiizo
- License: mit
- Created: 2024-11-26T11:21:52.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-12-02T10:54:24.000Z (about 1 month ago)
- Last Synced: 2024-12-08T19:57:06.721Z (about 1 month ago)
- Topics: devops, rust, rust-lang, terraform
- Language: Rust
- Homepage: https://crates.io/crates/tfocus
- Size: 586 KB
- Stars: 25
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ฏ 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.![tfocus demo](.github/tfocus_01.gif)
## Features ๐
- ๐ Peco-like fuzzy finder for Terraform resources
- โก Lightning-fast resource selection
- ๐จ Colorful TUI (Terminal User Interface)
- ๐น Vim-like keybindings
- ๐ Recursive file scanning## Installation ๐ ๏ธ
install from crates.io
```bash
cargo install tfocus
```install from github
```bash
cargo install --git https://github.com/nwiizo/tfocus
```## Usage ๐ฎ
```bash
cd your-terraform-project
tfocus
```1. ๐ Launch the fuzzy-search UI
2. โจ๏ธ Select resources using vim-like keybindings
3. ๐ฏ Execute plan/apply on selected resources## Keybindings ๐น
- `โ`/`k`: Move up
- `โ`/`j`: Move down
- `/`: Incremental search
- `Enter`: Select
- `Esc`/`Ctrl+C`: Cancel## โ ๏ธ Important Warning โ ๏ธ
Using terraform resource targeting comes with significant risks:
1. Potential disruption of the Terraform resource graph
2. ๐ฒ Risk of state inconsistencies
3. ๐งฉ Possible oversight of critical dependencies
4. ๐ค 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 changesFor 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 ๐บ
```bash
$ 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