Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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 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 ๐Ÿ“บ

```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