<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Armory Docs – Terraform Integration Plugin for Spinnaker and Armory CD</title><link>/plugins/terraform/</link><description>Recent content in Terraform Integration Plugin for Spinnaker and Armory CD on Armory Docs</description><generator>Hugo -- gohugo.io</generator><atom:link href="/plugins/terraform/index.xml" rel="self" type="application/rss+xml"/><item><title>Plugins: Get Started with Terraform Integration</title><link>/plugins/terraform/install/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/plugins/terraform/install/</guid><description/></item><item><title>Plugins: Use the Terraform Integration Stage in Spinnaker or Armory Continuous Deployment</title><link>/plugins/terraform/use/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/plugins/terraform/use/</guid><description>
&lt;p>&lt;img src="/images/proprietary.svg" alt="Proprietary">&lt;/p>
&lt;h2 id="overview-of-terraform-integration">Overview of Terraform integration&lt;/h2>
&lt;p>At the core of Terraform Integration is the Terraformer service, which fetches your Terraform projects from source and executes various Terraform commands against them. When a &lt;code>terraform&lt;/code> stage starts, Orca submits the task to Terraformer and monitors it until completion. Once a task is submitted, Terraformer fetches your target project, runs &lt;code>terraform init&lt;/code> to initialize the project, and then runs your desired &lt;code>action&lt;/code> (&lt;code>plan&lt;/code> or &lt;code>apply&lt;/code>). If the task is successful, the stage gets marked successful as well. If the task fails, the stage gets marked as a failure, and the pipeline stops.&lt;/p>
&lt;p>A Terraform Integration stage performs the following actions when it runs:&lt;/p>
&lt;ol>
&lt;li>Authenticates to your repo using basic authentication credentials you provide. This can be a GitHub token or a BitBucket username/password combination.&lt;/li>
&lt;li>Pulls a full directory from your Git repository.&lt;/li>
&lt;li>Optionally uses a Spinnaker artifact provider (Github, BitBucket, or HTTP) to pull in a &lt;code>tfvars&lt;/code>-formatted variable file.&lt;/li>
&lt;li>Runs the Terraform action you select.&lt;/li>
&lt;/ol>
&lt;h2 id="before-you-begin">Before you begin&lt;/h2>
&lt;ul>
&lt;li>You have read the &lt;a href="/plugins/terraform/">Terraform Integration Overview&lt;/a>.&lt;/li>
&lt;li>If you are using Armory CD, you have &lt;a href="/plugins/terraform/install/armory-cd/">enabled Terraform Integration&lt;/a>.&lt;/li>
&lt;li>If you are using Spinnaker, you have installed the Terraform Integration service and plugin (&lt;a href="/plugins/terraform/install/spinnaker-operator/">Spinnaker Operator&lt;/a>, &lt;a href="/plugins/terraform/install/spinnaker-halyard/">Halyard&lt;/a>)&lt;/li>
&lt;/ul>
&lt;h2 id="example-terraform-integration-stage">Example Terraform Integration stage&lt;/h2>
&lt;p>The following example describes a basic pipeline that performs the &lt;code>plan&lt;/code> and &lt;code>apply&lt;/code> Terraform actions.&lt;/p>
&lt;p>The pipeline consists of these stages:&lt;/p>
&lt;ol>
&lt;li>&lt;a href="#plan-stage">Plan stage&lt;/a>&lt;/li>
&lt;li>&lt;a href="#show-stage">Show stage&lt;/a>&lt;/li>
&lt;li>&lt;a href="#manual-judgment-stage">Manual Judgment stage&lt;/a>&lt;/li>
&lt;li>&lt;a href="#apply-stage">Apply stage&lt;/a>&lt;/li>
&lt;/ol>
&lt;h3 id="plan-stage">Plan stage&lt;/h3>
&lt;p>A Plan stage in a pipeline performs the same action as running the &lt;code>terraform plan&lt;/code> command. Although a Plan stage is not strictly required since an Apply stage performs a &lt;code>terraform plan&lt;/code> if no plan file exists, it&amp;rsquo;s a good idea to have one. You&amp;rsquo;ll understand why during the Manual Judgment stage.&lt;/p>
&lt;p>For this stage, configure the following:&lt;/p>
&lt;ul>
&lt;li>For the &lt;strong>Terraform version&lt;/strong>, pick any version, such as &lt;code>0.13.3&lt;/code>.&lt;/li>
&lt;li>For the &lt;strong>Action&lt;/strong>, choose &lt;strong>Plan&lt;/strong>.&lt;/li>
&lt;li>&lt;strong>Main Terraform Artifact&lt;/strong>
&lt;ul>
&lt;li>Select &lt;strong>Expected Artifact &amp;gt; Define a new artifact&lt;/strong>
&lt;ul>
&lt;li>Select &lt;strong>Account &amp;gt; &lt;YourGitRepo>&lt;/strong>. This is the Git repo that was configured when you enabled the Terraform Integration and houses your Terraform code.&lt;/li>
&lt;li>In &lt;strong>URL&lt;/strong>, add the URL to the Git repo that houses your Terraform code.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Under &lt;strong>Produces Artifacts&lt;/strong>
&lt;ol>
&lt;li>Select &lt;strong>Define artifact&lt;/strong>. A window appears.&lt;/li>
&lt;li>Optionally, provide a descriptive display name.&lt;/li>
&lt;li>For &lt;strong>Match Artifact &amp;gt; Account&lt;/strong> , select &lt;strong>embedded-artifact&lt;/strong> .&lt;/li>
&lt;li>Name the artifact &lt;code>planfile&lt;/code>.&lt;/li>
&lt;/ol>
&lt;/li>
&lt;/ul>
&lt;p>The output of this stage, the embedded artifact named &lt;code>planfile&lt;/code>, can be consumed by subsequent stages in this pipeline. In this example, this occurs during the final stage of the pipeline. Additionally, more complex use cases that involve parent-child pipelines can also use plan files.&lt;/p>
&lt;h3 id="show-stage">Show stage&lt;/h3>
&lt;p>The Show stage performs the same action as running the &lt;code>terraform show&lt;/code> command.
You can then use the JSON output from your &lt;code>planfile&lt;/code> in subsequent stages.&lt;/p>
&lt;p>The Show stage depends on the Plan stage. For the Show stage, configure the following:&lt;/p>
&lt;ul>
&lt;li>For the &lt;strong>Terraform version&lt;/strong>, pick the same version as you did you for the Plan stage.&lt;/li>
&lt;li>For the &lt;strong>Action&lt;/strong>, choose &lt;strong>Show&lt;/strong>.&lt;/li>
&lt;li>For &lt;strong>Main Terraform Artifact&lt;/strong>
&lt;ul>
&lt;li>Select &lt;strong>Expected Artifact &amp;gt; Artifact from execution context&lt;/strong>
&lt;ul>
&lt;li>Select &lt;strong>Account &amp;gt; &lt;YourGitRepo>&lt;/strong>. This is the Git repo that was configured when you enabled the Terraform Integration and houses your Terraform code.&lt;/li>
&lt;li>In &lt;strong>URL&lt;/strong>, add the URL to the Git repo that houses your Terraform code.&lt;/li>
&lt;li>In &lt;strong>Branch&lt;/strong>, add the branch your code is in.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>For &lt;strong>Terraform Plan&lt;/strong>, add the &lt;code>planfile&lt;/code> from the dropdown. This is the artifact you created in the Plan stage.&lt;/li>
&lt;li>All other fields can be left blank or with their default values for this example.&lt;/li>
&lt;/ul>
&lt;p>You can add an Evaluate Variables stage to get the output from the &lt;code>planfile&lt;/code> JSON created by the Show stage and use it in subsequent stages.&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Variable Name&lt;/strong>: &lt;code>planfile_json&lt;/code>&lt;/li>
&lt;li>&lt;strong>Variable Value&lt;/strong>: &lt;code>${#stage('Show').outputs.status.outputs.show.planfile_json}&lt;/code>&lt;/li>
&lt;/ul>
&lt;h3 id="manual-judgment-stage">Manual Judgment stage&lt;/h3>
&lt;p>You can use the default values for this stage. Manual judgment stages ask the user to approve or fail a pipeline. Having a Manual Judgment stage between a Plan and Apply stage gives you a chance to confirm that the Terraform code is doing what you expect it to do.&lt;/p>
&lt;h3 id="apply-stage">Apply stage&lt;/h3>
&lt;p>The Apply stage performs the same action as running the &lt;code>terraform apply&lt;/code> command. For this stage, configure the following:&lt;/p>
&lt;ul>
&lt;li>For the &lt;strong>Terraform version&lt;/strong>, pick the same version as you did you for the Plan stage.&lt;/li>
&lt;li>For the &lt;strong>Action&lt;/strong>, choose &lt;strong>Apply&lt;/strong>.&lt;/li>
&lt;li>For &lt;strong>Main Terraform Artifact&lt;/strong>
&lt;ul>
&lt;li>Select &lt;strong>Expected Artifact &amp;gt; Define a new artifact&lt;/strong>
&lt;ul>
&lt;li>Select &lt;strong>Account &amp;gt; &lt;YourGitRepo>&lt;/strong>. This is the Git repo that was configured when you enabled the Terraform Integration and houses your Terraform code.&lt;/li>
&lt;li>In &lt;strong>URL&lt;/strong>, add the URL to the Git repo that houses your Terraform code.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>For &lt;strong>Terraform Artifacts&lt;/strong>, add a new file and select the &lt;code>planfile&lt;/code> from the dropdown. This is the file that you created during the Plan stage and verified during the Manual Judgment stage.&lt;/li>
&lt;li>All other fields can be left blank or with their default values for this example.&lt;/li>
&lt;/ul>
&lt;p>Run the pipeline.&lt;/p>
&lt;h2 id="create-a-terraform-integration-stage">Create a Terraform Integration stage&lt;/h2>
&lt;figure>
&lt;img src="/images/plugins/terraform/terraform_stage_ui.png"/>
&lt;/figure>
&lt;blockquote>
&lt;p>Configure the RDBMS driver exactly as described in &lt;a href="https://spinnaker.io/docs/setup/productionize/persistence/clouddriver-sql/#database-setup">Set up Clouddriver to use SQL - Database Setup&lt;/a>. The MySQL database schema must be configured to with:&lt;/p>
&lt;/blockquote>
&lt;ul>
&lt;li>Default character set &lt;code>utfmb4&lt;/code>&lt;/li>
&lt;li>Default collate &lt;code>utf8mb4_unicode_ci&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>
&lt;div class="alert alert-warning" role="alert">
&lt;h4 class="alert-heading">Warning&lt;/h4>
If the Clouddriver MySQL schema is not configured correctly, the Terraform Integration stage fails.
&lt;/div>
To create a new Terraform stage, perform the following steps:&lt;/p>
&lt;ol>
&lt;li>In Deck, select the Application and pipeline you want to add the Terraform Integration stage to.&lt;/li>
&lt;li>Configure the Pipeline and add a stage.&lt;/li>
&lt;li>For &lt;strong>Type&lt;/strong>, select &lt;strong>Terraform&lt;/strong>.&lt;/li>
&lt;li>Add a &lt;strong>Stage Name&lt;/strong>.&lt;/li>
&lt;li>Configure the Terraform Integration stage.
The available fields may vary slightly depending on what you configure for the stage:
&lt;ul>
&lt;li>
&lt;p>&lt;strong>Basic Settings&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Terraform Version&lt;/strong>: Terraform version to use. All Terraform stages within a pipeline that modify state (apply, output, destroy) must use the same version. If you want to use the remote backend, the minimum supported version is 0.12.0 and you must select the same Terraform version that your Terraform Cloud/Enterprise is configured to use.&lt;/li>
&lt;li>&lt;strong>Action&lt;/strong>: Terraform action to perform. You can select any of the following actions:
&lt;ul>
&lt;li>&lt;strong>Plan&lt;/strong>: The output of the plan command is saved to a base64-encoded Spinnaker artifact and is injected into context. You can use this artifact with a webhook to send the plan data to an external system or to use it in an &lt;code>apply&lt;/code> stage. Optionally, you can select &lt;strong>Plan for Destroy&lt;/strong> to view what Terraform destroys if you run the Destroy action.
&lt;ul>
&lt;li>For remote backends, if you view a &lt;code>plan&lt;/code> action in the Terraform Cloud/Enterprise UI, the type of &lt;code>plan&lt;/code> action that the Terraform Integration performs is a &amp;ldquo;speculative plan.&amp;rdquo; For more information, see &lt;a href="https://www.terraform.io/docs/cloud/run/index.html#speculative-plans">Speculative Plans&lt;/a>.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>&lt;strong>Apply&lt;/strong>: Run &lt;code>terraform apply&lt;/code>. Optionally, you can ignore state locking. Armory recommends you do not ignore state locking because it can lead to state corruption. Only ignore state locking if you understand the consequences.&lt;/li>
&lt;li>&lt;strong>Destroy&lt;/strong>: Run &lt;code>terraform destroy&lt;/code>. Optionally, you can ignore state locking. Armory recommends you do not ignore state locking because it can lead to state corruption. Only ignore state locking if you understand the consequences.&lt;/li>
&lt;li>&lt;strong>Output&lt;/strong>: Run &lt;code>terraform output&lt;/code>.&lt;/li>
&lt;li>&lt;strong>Show&lt;/strong>: Run &lt;code>terraform show&lt;/code>. This creates human-readable JSON output from your &lt;code>planfile&lt;/code>.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>&lt;strong>Targets&lt;/strong>: Scope execution to a certain subset of resources.&lt;/li>
&lt;li>&lt;strong>Workspace&lt;/strong>: &lt;a href="https://www.terraform.io/docs/state/workspaces.html">Terraform workspace&lt;/a> to use. The workspace gets created if it does not already exist. For remote backends, the workspace must be explicit or prefixed. For more information about what that means, see the Terraform documentation about &lt;a href="https://www.terraform.io/docs/backends/types/remote.html">remote backends&lt;/a>&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Main Terraform Artifact&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>
&lt;p>&lt;strong>Expected Artifact&lt;/strong>: Required. Select or define only one &lt;code>git/repo&lt;/code> type artifact.
&lt;figure>
&lt;img src="/images/plugins/terraform/terraform-git-repo.png"/>
&lt;/figure>
&lt;/p>
&lt;ul>
&lt;li>
&lt;p>&lt;strong>Account&lt;/strong>: The account to use for your artifact.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>URL&lt;/strong>: If you use a GitHub artifact, make sure you supply the &lt;em>API&lt;/em> URL of the file, not the URL from the &lt;code>Raw&lt;/code> GitHub page. Use the following examples as a reference for the API URL:&lt;/p>
&lt;p>Regular GitHub:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>https://api.github.com/repos/&lt;span style="color:#ff79c6">{&lt;/span>org&lt;span style="color:#ff79c6">}&lt;/span>/&lt;span style="color:#ff79c6">{&lt;/span>repo&lt;span style="color:#ff79c6">}&lt;/span>/contents/&lt;span style="color:#ff79c6">{&lt;/span>file path&lt;span style="color:#ff79c6">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Github Enterprise:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>https://&lt;span style="color:#ff79c6">{&lt;/span>host&lt;span style="color:#ff79c6">}&lt;/span>/api/v3/repos/&lt;span style="color:#ff79c6">{&lt;/span>org&lt;span style="color:#ff79c6">}&lt;/span>/&lt;span style="color:#ff79c6">{&lt;/span>repo&lt;span style="color:#ff79c6">}&lt;/span>/contents/&lt;span style="color:#ff79c6">{&lt;/span>file path&lt;span style="color:#ff79c6">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/li>
&lt;li>
&lt;p>&lt;strong>Checkout subpath&lt;/strong>: Enable this option to specify a &lt;strong>Subpath&lt;/strong> within a Git repo. Useful if you have a large repo and the Terraform files are located in a specific directory.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Branch&lt;/strong>: The Git branch or commit to use.&lt;/p>
&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Subdirectory&lt;/strong>: Subdirectory within a repo where the &lt;code>terraform&lt;/code> command runs. Use &lt;code>./&lt;/code> if the command should run at the root level.&lt;/p>
&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Variable Files&lt;/strong>: Optional. Variable files that get appended to the Terraform command. Equivalent to running terraform apply with the &lt;code>-var-file&lt;/code> option.&lt;/p>
&lt;ul>
&lt;li>If you want to use the output of a &lt;strong>Plan&lt;/strong> stage for an &lt;strong>Apply&lt;/strong> stage, select the &lt;strong>Plan&lt;/strong> stage output as an &lt;strong>Expected Artifact&lt;/strong>&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Variable Overrides&lt;/strong>: Optional. Key/value pairs used as variables in the Terraform command. Equivalent to running terraform apply with the &lt;code>-var&lt;/code> option. You can use a GitHub or BitBucket&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Backend Artifact&lt;/strong>: Optional. Configuration stored outside of the primary repo that gets used for authenticating to a state backend. For example, if you want to use an S3 artifact for your backend state, specify it in this section.&lt;/p>
&lt;p>For the &lt;code>backendArtifact&lt;/code> and other artifacts, you can replace &lt;code>github/file&lt;/code> with some other artifact type. For example, if you&amp;rsquo;re using the BitBucket artifact provider, specify &lt;code>bitbucket/file&lt;/code> and the corresponding artifact account.&lt;/p>
&lt;p>The Terraform Integration supports remote backends as a feature. Select a Terraform version that is 0.12.0 or higher when configuring the stage. Then, you can use Terraform code that references a remote backend.&lt;/p>
&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ol>
&lt;h2 id="custom-plugins">Custom plugins&lt;/h2>
&lt;p>Terraform Integration supports the use of custom Terraform providers and plugins. Terraform Integration downloads the plugins and injects them into each stage dynamically as needed to ensure the Terraform code can run.&lt;/p>
&lt;p>Any plugin you want to use must meet the following requirements:&lt;/p>
&lt;ul>
&lt;li>Be a zip, tar, gzip, tar-gzip or executable&lt;/li>
&lt;li>If compressed, be at the root of the archive&lt;/li>
&lt;li>Be x86-64 (amd64) Linux binaries&lt;/li>
&lt;li>Have a SHA256 Sum&lt;/li>
&lt;li>Follow the Terraform plugin naming &lt;a href="https://www.terraform.io/docs/extend/how-terraform-works.html#discovery">conventions&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Note&lt;/strong>: If any Terraform Integration stage in a pipeline defines a custom plugin, all Terraform Integration stages must then define that same plugin in the pipeline.&lt;/p>
&lt;p>&lt;strong>Configuring Terraform plugins&lt;/strong>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;action&amp;#34;: &lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;plan&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;artifacts&amp;#34;: &lt;/span>[
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;reference&amp;#34;: &lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;https://github.com/someorg/terraformer&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;type&amp;#34;: &lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;git/repo&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;version&amp;#34;: &lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;refs/heads/branch-testing&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> },
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;metadata&amp;#34;: &lt;/span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;sha256sum&amp;#34;: &lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;fda6273f803c540ba8771534247db54817603b46784628e63eff1ce7890994e4&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> },
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;name&amp;#34;: &lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;terraform-provider-foo&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;reference&amp;#34;: &lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;https://github.com/armory/terraform-provider-foo/releases/download/v0.1.19/terraform-provider-foo_0.1.19_linux_amd64.zip&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;type&amp;#34;: &lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;terraform/custom&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;version&amp;#34;: &lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;v0.1.19&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ],
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ...
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Terraform Integration caches all the defined plugins by default and does not redownload them. To configure the Terraform Integration to redownload a plugin, add the following JSON under the metadata key in the artifact object:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">&amp;#34;metadata&amp;#34;: &lt;/span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;sha256sum&amp;#34;: &lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;longString&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;forceDownload&amp;#34;: &lt;/span>&lt;span style="color:#ff79c6">true&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="view-terraform-log-output">View Terraform log output&lt;/h2>
&lt;figure>
&lt;img src="/images/plugins/terraform/terraformer-ui-logs.png"/>
&lt;/figure>
&lt;p>Terraform provides logs that describe the status of your Terraform action. When you run Terraform actions on your workstation, the log output is streamed to &lt;code>stdout&lt;/code>. For Armory&amp;rsquo;s Terraform Integration, Spinnaker captures the log output and makes it available on the &lt;strong>Pipelines&lt;/strong> page of Deck as part of the &lt;strong>Execution Details&lt;/strong>. Exit codes in the log represent the following states:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-fallback" data-lang="fallback">&lt;span style="display:flex;">&lt;span>0 = Succeeded with empty diff (no changes)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>1 = Error
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>2 = Succeeded with non-empty diff (changes present)
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>For more information about Terraform logs, see the &lt;a href="https://www.terraform.io/docs/commands/plan.html#detailed-exitcode">Terraform documentation&lt;/a>.&lt;/p>
&lt;h2 id="consume-terraform-output-using-spel">Consume Terraform output using SpEL&lt;/h2>
&lt;p>If you have a Terraform template configured with &lt;a href="https://www.terraform.io/docs/configuration/outputs.html">Output Values&lt;/a>, then you can use the &lt;code>Output&lt;/code> stage to parse the output and add it to your pipeline execution context.&lt;/p>
&lt;p>For example, if you have a Terraform template that has this:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-hcl" data-lang="hcl">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">output&lt;/span> &lt;span style="color:#f1fa8c">&amp;#34;bucket_arn&amp;#34;&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> value &lt;span style="color:#ff79c6">=&lt;/span> &lt;span style="color:#f1fa8c">&amp;#34;${aws_s3_bucket.my_bucket.arn}&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Then you can set up an &lt;code>Output&lt;/code> stage that exposes this in the pipeline execution context. If you have an &lt;code>Output&lt;/code> stage with the stage name &lt;code>My Output Stage&lt;/code>, then after running the &lt;code>Output&lt;/code> stage, access the bucket ARN with this:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-hcl" data-lang="hcl">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f1fa8c">${&lt;/span>#stage(&amp;#39;My Output Stage&amp;#39;)[&lt;span style="color:#f1fa8c">&amp;#34;context&amp;#34;][&amp;#34;status&amp;#34;][&amp;#34;outputs&amp;#34;][&amp;#34;bucket_arn&amp;#34;][&amp;#34;value&amp;#34;&lt;/span>]&lt;span style="color:#f1fa8c">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>Plugins: Terraform Integration Plugin Release Notes</title><link>/plugins/terraform/release-notes/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/plugins/terraform/release-notes/</guid><description>
&lt;h2 id="2265">2.26.5&lt;/h2>
&lt;h3 id="show-added-to-terraform-integration-stage">&lt;strong>Show&lt;/strong> Added to Terraform Integration Stage&lt;/h3>
&lt;p>There is a new Terraform action available as part of the Terraform Integration stage. This action is the equivalent of running the Terraform &lt;code>show&lt;/code> command with Terraform. The JSON output from your planfile can be used in subsequent stages.&lt;/p>
&lt;p>To use the stage, select &lt;strong>Terraform&lt;/strong> for the stage type and &lt;strong>Show&lt;/strong> as the action in the Stage Configuration UI. Note that the &lt;strong>Show&lt;/strong> stage depends on your &lt;strong>Plan&lt;/strong> stage. For more information, see &lt;a href="/plugins/terraform/use/#example-terraform-integration-stage">Show Stage section in the Terraform Integration docs&lt;/a>.&lt;/p>
&lt;h3 id="terraform-remote-backends-provided-by-terraform-cloud-and-terraform-enterprise">Terraform remote backends provided by Terraform Cloud and Terraform Enterprise&lt;/h3>
&lt;p>Terraform now supports remote backends provided by Terraform Cloud and Terraform Enterprise - see &lt;a href="/continuous-deployment/armory-admin/terraform-enable-integration/#remote-backends">Remote Backends section in the Terraform Integration docs&lt;/a>.&lt;/p></description></item></channel></rss>