> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/continuous-delivery/troubleshooting-and-resources/armory/how-tos/how-to-parse-terraform-plan-status-code-for-your-spinnaker-pipeline-logic.md).

# How to parse Terraform Plan Status Code for your Spinnaker Pipeline Logic

### Introduction <a href="#introduction" id="introduction"></a>

When using Armory's Terraform Plan stage - you can use SpEL (Pipeline Expression) to retrieve the exitcode.

* 0 = Succeeded with empty diff (no changes)\* 1 = Error\* 2 = Succeeded with non-empty diff (changes present) `${#stage("Terraform Plan").outputs.status.code}` The pipeline expression can be used in a "Check Preconditions" stage in order to assert a particular value for the status code before proceeding or terminating the pipeline. Alternatively, the expression can be used in the "Execution Options" under a "Manual Judgment" stage so you can bypass the Manual Judgement stage when you want to automatically apply a change.

### Prerequisites <a href="#prerequisites" id="prerequisites"></a>

Armory Terraformer enabled

### Instructions <a href="#instructions" id="instructions"></a>

Check out this video for a demonstration:
