Create a Terraform Open Source config provider in Cloud Provisioning and Governance. The Terraform Open Source config provider enables Cloud Provisioning and Governance to discover the Terraform Open Source config installables (Terraform templates) and detect changes in them.

Before you begin

  • Ensure that Terraform server is running on Windows or Linux operating system.
  • Ensure that a supported Terraform Open Source version is installed in the server. Cloud Provisioning and Governance: Terraform Connector supports Terraform Open Source versions 1.1.0 through 1.1.9 and 1.2.0.
  • If you want to use a minor or patch version of the Terraform Open Source CLI, ensure that the minor or patch version is added to the workload config provider. For more information, see Add support for minor or patch versions of the Terraform.
  • Ensure that the MID Server can access the Terraform server.
  • Ensure that the MID Server has Terraform capability. For more information, see Configure MID Server capabilities.
  • Ensure that all the templates are stored in separate directories and all the template directories are in the same base directory.
  • Ensure that Terraform Connector has access to the Terraform registry (registry.hashicorp.com).

Role required: cloud_admin

About this task

Procedure

  1. (Optional) If you have deployed the Terraform Open Source on a Linux server, create SSH Private Key Credentials for the server in the ServiceNow AI Platform.
    1. Navigate to All > Cloud Provisioning and Governance > Cloud Admin Portal.
      The Cloud Admin Portal opens in a new browser tab.
    2. On the Cloud Admin Portal, navigate to Manage > Credentials.
    3. Select New.
    4. Select SSH Private Key Credentials.
    5. On the form, fill in the fields.
    6. Select the Test Credentials related link.
    7. On the form, fill in the fields.
      Table 1. Test Credentials form
      Field Description
      Target IP address of the Terraform server for which you are creating the credential.
      MID Server MID Server that can be used to connect with the Terraform server.
    8. Select OK.
    9. Select Submit.
  2. (Optional) If you have deployed the Terraform Open Source on a Windows server, create Windows Credentials for the server in the ServiceNow AI Platform.
    1. Navigate to All > Cloud Provisioning and Governance > Cloud Admin Portal.
      The Cloud Admin Portal opens in a new browser tab.
    2. On the Cloud Admin Portal, navigate to Manage > Credentials.
    3. Select New.
    4. Select Windows Credentials.
    5. On the form, fill in the fields.
    6. Select the Test Credentials related link.
    7. On the form, fill in the fields.
      Table 2. Test Credentials form
      Field Description
      Target IP address of the Terraform server for which you are creating the credential.
      MID Server MID Server that can be used to connect with the Terraform server.
    8. Select OK.
    9. Select Submit.
  3. Create a config provider for Terraform Open Source.
    1. On the Cloud Admin Portal, navigate to Manage > Config Management.
    2. Select New.
    3. On the form, fill in the fields.
    4. Select Submit.

What to do next

Discover the Terraform templates from the Terraform Open Source server. For more information, see Run the IaC Discovery.