@ahmadnassri/terraform-unidiff

4.0.3 • Public • Published

Terraform Plan Unidiff

Generate a human readable diff of Terraform Plan changes, using Unified format (unidiff)

license release semantic

Usage

CLI

npx @ahmadnassri/terraform-unidiff /path/to/plan.json

Library

Installation

npm install @ahmadnassri/terraform-unidiff

API

const unidiff = require('@ahmadnassri/terraform-unidiff')

const plan = fs.readFileSync('path/to/plan.json')

const { summary, patches } = unidiff(plan)

console.log(patches) // array of changes in unidiff format
console.log(summary) // object with changes counts { create: 1, update: 3, delete: 0 }

Plan JSON

to obtain a Terraform plan in JSON format, run the following command:

terraform plan -out terraform.plan && terraform show -json terraform.plan > terraform.json

Author: Ahmad Nassri • Twitter: @AhmadNassri

Package Sidebar

Install

npm i @ahmadnassri/terraform-unidiff

Weekly Downloads

94

Version

4.0.3

License

ISC

Unpacked Size

6.58 kB

Total Files

6

Last publish

Collaborators

  • ahmadnassri