Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/contentful-labs/terraform-diff
Always know where you need to run Terraform plan & apply!
https://github.com/contentful-labs/terraform-diff
autoplan autoplanning diff terraform
Last synced: 16 days ago
JSON representation
Always know where you need to run Terraform plan & apply!
- Host: GitHub
- URL: https://github.com/contentful-labs/terraform-diff
- Owner: contentful-labs
- License: apache-2.0
- Created: 2020-01-28T16:17:58.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-06-16T08:40:58.000Z (over 1 year ago)
- Last Synced: 2024-11-01T03:32:59.305Z (about 1 month ago)
- Topics: autoplan, autoplanning, diff, terraform
- Language: Go
- Homepage:
- Size: 1.11 MB
- Stars: 66
- Watchers: 21
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-repositories - contentful-labs/terraform-diff - Always know where you need to run Terraform plan & apply! (Go)
- awesome-tf - terraform-diff - Always know where you need to run Terraform plan & apply! (Tools / Community providers)
README
# Terraform-diff
Terraform-diff helps you detect what Terraform projects have changed when changes are made to Terraform modules.
## Example
Given the following Terraform setup:
```
.
├── modules
│ └── module1
│ │ └── main.tf
│ └── module2
│ │ └── main.tf
│ └── module3
│ └── main.tf
└── project1
│ └─── main.tf
└── project2
└─── main.tf
```And the following dependencies:
* project1 depends on module1
* module1 depends on module2
* project2 depends on module3The logic would be:
* if there is a change in modules/module1/, modules/module2/, or project1/, you would want to run `make plan` in project1/.
* if there is a change in modules/module3/, or project2/, you would want to run `make plan` in project2/This is where Terraform-diff is useful:
```
$ terraform-diff -h
Usage of terraform-diff:
-output string
output format (text or json) (default "text")
-range string
git commit range
$ terraform-diff project1 project2
project1
$ terraform-diff --range fbf666c786...ca37f7145f -o json project1 project2
{
"project1",
"project2"
}
```## Trade-offs
``terraform-diff`` relies on git & static analysis of the Terraform files. It will **not** detect, among others:
* changes in external datasources
* remote states updates