Terraform plugin

The Deploy Terraform plugin supports:

  • Applying Terraform resources
  • Destroying Terraform resources

For more information about the Deploy Terraform plugin requirements and the configuration items (CIs) that the plugin supports, see the Terraform Plugin Reference.

Using the Deploy Terraform plugin

The Deploy Terraform plugin can create and destroy Terraform resources using the Terraform client. To use the plugin:

  1. Download the Deploy Terraform plugin ZIP from the distribution site.
  2. Unpack the plugin inside the XL_DEPLOY_SERVER_HOME/plugins/ directory.
  3. Restart Deploy.

Create the Terraform client

To create a Terraform client in Deploy:

  1. Under Infrastructure create an overthere.SshHost or overthere.LocalHost CI, depending on the location of the Terraform client.

    • For the overthere.SshHost CI. Specify the following properties:

      • os : Operating system the host runs.
      • connectionType : Select SFTP as the type of SSH connection to create.
      • address : Address of the host.
      • port : Port on which the SSH server runs.
    • For the overthere.LocalHost CI. Specify the following properties:

      • os : Operating system the host runs.
  2. Under the host, create a terraform.TerraformClient CI. Specify the following properties:

    • path: The path where the Terraform client executable is available.
    • pluginDirectory: The path where Terraform’s pre-installed plugins are available. This is an optional property. If not provided, the required plugins will be downloaded by terraform init.
    • workingDirectory: The path where Terraform maintains its state for incremental deployments. This is an optional property.

Configure Terraform resources using artifact-based deployables

To configure Terraform resources:

  1. Under Applications, create an application (udm.Application) and a deployment package (udm.DeploymentPackage).
  2. Under the deployment package, create a terraform.Module CI. Specify the following properties:

    • file: The ZIP file that contains the Terraform template files. Terraform does not support a nested directory structure for these files, so all files must be placed at the root of the ZIP file.
    • targets: The list of resource names that you want to create or modify. It will skip other resources defined in Terraform template files.
    • inputVariables: The map of the name and value of the input variables whose values will be resolved in Terraform template files.
    • outputVariables: The map of the name and value of the output variables. This will be populated with the outputs defined in Terraform template files after the deployment.