Giter Site home page Giter Site logo

chrislewisdev / prettyplan Goto Github PK

View Code? Open in Web Editor NEW
172.0 7.0 10.0 172 KB

A formatting tool to help make large Terraform plans easier to review.

Home Page: https://prettyplan.chrislewisdev.com

License: MIT License

HTML 16.05% JavaScript 2.15% CSS 12.93% TypeScript 68.87%
terraform tools javascript

prettyplan's Introduction

prettyplan Build Status

Prettyplan (available online here) is a small tool to help you view large Terraform plans with ease. By pasting in your plan output, it will be formatted for:

  • Expandable/collapsible sections to help you see your plan at a high level and in detail
  • Tabular layout for easy comparison of old/new values
  • Better display formatting of multi-line strings (such as JSON documents)

Terraform Version Compatibility

Prettyplan was written to work on Terraform plans from 0.11 and earlier. In 0.12, the plan output was significantly changed, addressing many of the pain points that Prettyplan addresses; for this reason, there are no current plans to update Prettyplan to work with 0.12. In my case, Prettyplan was made unnecessary by Terraform's improvements.

Contributions are still welcome if anyone would like to upgrade the code to handle plans from 0.12 onwards.

Contributing

You're welcome to submit ideas/bugs (via the Issues section) or improvements (via Pull Requests)!

The code has all been converted from JavaScript to TypeScript and is built by webpack. To work on the project locally, you should be able to get everything up and running just by having npm, running npm install and then npm run serve which will open up Prettyplan in your default browser, ready for any changes you make to the source files.

You can also run npm run build to build the project without a dev server.

Tests

Tests are being run on every commit and Pull Request via Travis, but if you want to run them locally, you'll need to have npm on your PC, and run npm install followed by npm test in the repository.

Deployment

The project is deployed to Netlify; a slightly older version of the code is also served on GitHub pages which used to be the main way to access Prettyplan.

Will this steal sensitive data from my Terraform plans?

No. All the parsing/formatting is done directly in your browser, no data is sent to or from another service.

prettyplan's People

Contributors

chrislewisdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

prettyplan's Issues

IAM policy document gets parsed as multiple changes

Given the following policy document output from Terraform:

  + aws_iam_role_policy.deploy_role_policy
      id:                                         <computed>
      name:                                       <computed>
      policy:                                     "{\r\n    \"Version\": \"2012-10-17\",\r\n    \"Statement\": [\r\n        {\r\n            \"Action\": [\r\n                \"sqs:*\",\r\n                \"sns:*\"\r\n\r\n            ],\r\n            \"Effect\": \"Allow\",\r\n            \"Resource\": \"*\"\r\n        },\r\n        {\r\n            \"Effect\": \"Allow\",\r\n            \"Resource\": [\r\n                \"*\",\r\n                \"*\"\r\n            ],\r\n            \"Action\": [\r\n                \"logs:CreateLogGroup\",\r\n                \"logs:CreateLogStream\",\r\n                \"logs:PutLogEvents\"\r\n            ]\r\n        },\r\n        {\r\n            \"Effect\": \"Allow\",\r\n            \"Resource\": [\r\n                \"*\"\r\n            ],\r\n            \"Action\": [\r\n
        \"s3:PutObject\",\r\n                \"s3:GetObject\",\r\n                \"s3:GetObjectVersion\"\r\n            ]\r\n        },\r\n        {\r\n            \"Effect\": \"Allow\",\r\n            \"Action\": [\r\n                \"cloudformation:*\"\r\n            ],\r\n            \"Resource\": \"*\"\r\n        },\r\n        {\r\n            \"Effect\": \"Allow\",\r\n"

Prettyplan will actually interpret the policy document as multiple blocks of changes, like so:
image

Note the bottom \"s3 block, which seems to have been parsed as a new change section because it was preceded by a newline character.

Instead, the policy document should appear as just one change block for the policy property on the policy object.

"(forces new resource)" appearing at end of updated values

Rather than showing the "forces new resource" phrase at the end of values that caused the resource to be recreated, since it can mess with our formatting a little, it would be nicer to instead visually highlight the property changes that caused the recreation, e.g. with a kind of red badge or stripe on that row in the property change table.

Highlight differences in changed values

For values which are especially long e.g. json strings, it would be great to see a proper highlighted text diff which shows the changes between the old and new values, since these are not always immediately obvious.

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.