GithubHelp home page GithubHelp logo

onlykumarabhishek / terraform-diff Goto Github PK

View Code? Open in Web Editor NEW

This project forked from contentful-labs/terraform-diff

1.0 0.0 0.0 749 KB

Always know where you need to run Terraform plan & apply!

License: Apache License 2.0

Go 93.24% Makefile 0.89% HCL 1.55% Dockerfile 4.32%

terraform-diff's Introduction

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 module3

The 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

terraform-diff's People

Contributors

yannh avatar elblivion avatar argvk avatar ohookins avatar

Stargazers

Roman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.