Control-M for Terraform


Terraform is an open-source Infrastructure as Code (IaC) tool that enables you to create, configure, test, and manage your infrastructure on multiple platforms in a declarative way, using configuration files that describe the desired state of your infrastructure.

Control-M for Terraform enables you to do the following:

  • Connect to the Terraform Cloud with OAuth 2.0 authentication
  • Trigger a Terraform workspace and pass variables
  • Create a Terraform workspace and create a variable on a workspace
  • Integrate Terraform jobs with other Control-M jobs into a single orchestrated flow.
  • Monitor the Terraform workspace run status.
  • Attach an SLA job to your entire Terraform service.

Setting Up Control-M for Terraform

This procedure describes how to install the Terraform plug-in, create a connection profile, and define a Terraform job in Helix Control-M and Automation API.

Before You Begin

  • Verify that Automation API is installed, as described in Setting up the API.
  • Verify that Agent version 9.0.21.080 or later is installed.
  • Ensure that the Apply Method in the general settings in Terraform is set to Auto apply.

Begin

  1. On the Agent host, set the Java environment variable by running one of the following commands through a command line:
    • Linux:
      • Bourne Shell/Bash: export BMC_INST_JAVA_HOME=<java_11_directory>
      • csh/tcsh: setenv BMC_INST_JAVA_HOME <java_11_directory>
    • Windows: set BMC_INST_JAVA_HOME="<java_11_directory>"
  2. Run one of the following API commands:
    • For a fresh installation, use the provision image command:
      • Linux: ctm provision image Terraform_plugin.Linux
      • Windows: ctm provision image Terraform_plugin.Windows
    • To upgrade, use the following command:
      ctm provision agent::update
  3. Create a Terraform connection profile in Helix Control-M or Automation API, as follows:
  4. Define a Terraform job in Helix Control-M or Automation API, as follows:
Warning

Note

To remove this plug-in from an Agent, see Removing a Plug-in. The plug-in ID is TER102023.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

Control-M