Skip to main content
Version: Release 24.3

Terraform Container Plugin

The Terraform container plugin allows you to set up infrastructure from Release. It can create new resources, update existing ones, or delete resources defined in your configuration. It clones the Git repository for Terraform files and executes the apply and delete commands. It does not maintain the state files terraform.tfstate. Also, provide the backend configuration for the state in your Terraform configuration file.

note

In the release flow editor, Container tasks have a blue border.

Terraform provides the following features:

  • Apply (Container)
  • Destroy (Container)

Prerequisites

For Terraform integration, you need the Digital.ai Release Runner setup to run the container tasks.

Apply (Container)

The Apply (Container) task is used to execute terraform module for the apply command.

  1. In the release flow tab of a Release template, add a task of type Terraform > Apply (Container).
  2. Click the added task to open it.
  3. In the Capabilities field, enter a value that matches the capability set for your Runner. This will help you to route jobs to that particular Runner.
  4. In the Terraform Client Version field, the version of the installed Terraform client is displayed.
  5. In the Git URL field, enter the URL of the GIT repository with Terraform files.
  6. In the Branch field, enter the branch of the GIT repository.
  7. In the Git directory path field, enter the directory path of the GIT repository where Terraform files are stored.
  8. In the Git Token field, enter the PAT to connect to the GIT repository.
  9. In the Environment Variables field, enter the Terraform environment variables the following format: {'VAR1': 'value1', 'VAR2': 'value2'}
  10. Example for AWS Environment Variables : {'AWS_ACCESS_KEY_ID': 'Your value', 'AWS_SECRET_ACCESS_KEY': 'Your value', 'AWS_SESSION_TOKEN': 'Your value'}

Apply (Container)

Destroy (Container)

The Destroy (Container) task is used to execute terraform module for the destroy command.

  1. In the release flow tab of a Release template, add a task of type Terraform > Delete (Container).
  2. Click the added task to open it.
  3. In the Capabilities field, enter a value that matches the capability set for your Runner. This will help you to route jobs to that particular Runner.
  4. In the Terraform Client Version field, the version of the installed Terraform client is displayed.
  5. In the Git URL field, enter the URL of the GIT repository with Terraform files.
  6. In the Branch field, enter the branch of the GIT repository.
  7. In the Git directory path field, enter the directory path of the GIT repository where Terraform files are stored.
  8. In the Git Token field, enter the PAT to connect to the GIT repository.
  9. In the Environment Variables field, enter the Terraform environment variables the following format: {'VAR1': 'value1', 'VAR2': 'value2'}
  10. Example for AWS Environment Variables : {'AWS_ACCESS_KEY_ID': 'Your value', 'AWS_SECRET_ACCESS_KEY': 'Your value', 'AWS_SESSION_TOKEN': 'Your value'}

Destroy (Container)