Download the PHP package skluck/terraform-plan-parser without Composer

On this page you can find all versions of the php package skluck/terraform-plan-parser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package terraform-plan-parser

CircleCI Latest Stable Version GitHub License GitHub Language

Terraform Plan Parser

This is a PHP library for parsing output from terraform plan.

It will attempt to parse out changed attributes of modified resources from terraform plan as well as used modules from terraform init.

It supports both Terraform 0.11 and Terraform 0.12:

Terraform 0.12 supports native JSON output of plan files, however it is not as complete as the stdout and so we must continue to parse it.

Table of Contents

Use Case

This library turns this:

into this:

This library is inspired and based on similar libraries for other languages. Check them out if PHP is not for you:

Installation

This package requires PHP 7.1 or higher. The CI workflow tests against PHP 7.1, 7.2, and 7.3. It has no runtime dependencies.

Download this package with composer:

Usage

The output of this parser also implements jsonSerialize so it can be safely encoded and output with JSON.

Data Structure

The response of parsing terraform plan will always be an array of the following structure:

The parser may successfully parse some resources, but still contain errors for others. So you should check both errors and changedResources to determine your failure states. Generally I would recommend only failing if errors is non-empty, and changedResources is empty, or if errors has some obscene number of messages.

A Special Note about Modules:
This parser will attempt to find the "root" module from Terragrunt output. It can be important information to know if the primary module is from a remote source (such as git or the Terraform Registry) or a local directory.

ResourceChange

This represents individual resources in Terraform and has the following structure:

AttributeChange

This represents individual attributes on resources. The parser will determine the type and if possible the old and new values of this attribute.


All versions of terraform-plan-parser with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package skluck/terraform-plan-parser contains the following files

Loading the files please wait ....