Skip to main content

Introduction

In this tutorial, you will learn how to configure the Terraform Cloud run task integration with Styra DAS to begin enforcing policies on your Terraform resources.

If you are not familiar with Terraform, Terraform Cloud, and the Styra DAS Terraform system type, first review the Styra DAS Terraform System Type Overview.

note

While this tutorial references Terraform Cloud run tasks integrated with Styra DAS, the process is identical for Terraform Enterprise run tasks.

Tutorial Overview

This tutorial will guide you through the following:

  • Create a Terraform Cloud workspace with the Terraform "Fake Web Services" provider for this tutorial.
  • Create a Styra DAS Terraform system.
  • Configure the Terraform Cloud Run Task integration with Styra DAS.
  • Associate the Run Task with your Terraform Cloud Workspace and Styra DAS Terraform system.
  • Define a VPC resource policy.
  • Execute a Terraform change.
  • Review the Terraform Cloud workspace decision.
  • Remove the Terraform Cloud integration from Styra DAS.
  • Remove the Run Task from Terraform Cloud.
important

This tutorial requires:

  • A Styra DAS account
  • A Terraform Cloud organization with a Team & Governance or Business plan
  • A Terraform Cloud user with organization owner permissions
  • Access to a terminal with git and the Terraform CLI installed

Integration Architecture

The following architecture diagram shows the interaction between Terraform Cloud and Styra DAS using the run task integration.

Figure 1 - Architecture of Styra DAS for Terraform CloudFigure 1 - Architecture of Styra DAS for Terraform Cloud

note

While the Styra DAS Free and DAS Enterprise plans both include support for the run task integration with Terraform Cloud, the run tasks feature in Terraform Cloud is available only to Terraform Cloud organizations on a Team & Governance or Business plan.

If your organization is currently using the Terraform Cloud free plan, you can upgrade to the Team & Governance plan trial in your Terraform Cloud organization billing settings to gain access to the run tasks feature in Terraform Cloud for the duration of your Team & Governance plan trial.