Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jeff-knurek/tfarbe
add color to Terraform 12/13 plan output, also format it for markdown diff
https://github.com/jeff-knurek/tfarbe
color go hacktoberfest terraform
Last synced: about 2 months ago
JSON representation
add color to Terraform 12/13 plan output, also format it for markdown diff
- Host: GitHub
- URL: https://github.com/jeff-knurek/tfarbe
- Owner: jeff-knurek
- License: mit
- Created: 2020-09-21T09:10:51.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-08-08T13:04:06.000Z (over 2 years ago)
- Last Synced: 2024-08-05T08:08:23.954Z (5 months ago)
- Topics: color, go, hacktoberfest, terraform
- Language: Go
- Homepage:
- Size: 371 KB
- Stars: 22
- Watchers: 3
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tfarbe
Add color to Terraform 12 plan output.Inspired from: https://github.com/coinbase/terraform-landscape
**NOTE**: if you're using terraform v11, tfarbe will not help and you should use `terraform-landscape`.
### Example of output
Also formats the ouput for markdown diff.
For example, this:
```
# module.apps.kubernetes_deployment.deployment is tainted, so must be replaced
-/+ resource "kubernetes_deployment" "deployment" {
~ id = "some-app" -> (known after apply)
wait_for_rollout = true~ spec {
- active_deadline_seconds = 0 -> null
- automount_service_account_token = false -> null
dns_policy = "ClusterFirst"
host_ipc = false
host_network = false
host_pid = false
+ hostname = (known after apply)
+ node_name = (known after apply)
restart_policy = "Always"
+ service_account_name = (known after apply)
```becomes:
```diff
# module.apps.kubernetes_deployment.deployment is tainted, so must be replaced
-/+ resource "kubernetes_deployment" "deployment" {
~ id = "some-app" -> (known after apply)
wait_for_rollout = true~ spec {
- active_deadline_seconds = 0 -> null
- automount_service_account_token = false -> null
dns_policy = "ClusterFirst"
host_ipc = false
host_network = false
host_pid = false
+ hostname = (known after apply)
+ node_name = (known after apply)
restart_policy = "Always"
+ service_account_name = (known after apply)
```## Install
Binaries (should) be available on the [Release page](https://github.com/jeff-knurek/tfarbe/releases/) for both Linux and Mac. You can simple copy one of these binaries to your PATH.
## Usage
```
terraform plan ... | tfarbe
```### with Docker
```
git clone https://github.com/jeff-knurek/tfarbe.git
cd tfarbe
docker build . -t tfarbe
....
terraform plan ... | docker run -i --rm tfarbe
```### Helpful bash addition
Add this to your `.bash_profile`/`.bashrc`/`...` accordingly
```
terraform() {
if [[ $1 == "plan" ]]; then
command terraform "$@" | docker run --rm -i tfarbe
else
command terraform "$@"
fi
}
```## License
This project is released under the [MIT license](LICENSE).