1. Home
  2. Insights
  3. Onboard a cloud provider in ServiceNow with Terraform in six steps
Blog · Cloud

Onboard a cloud provider in ServiceNow with Terraform in six steps

A walkthrough of connecting ServiceNow Cloud Management to Terraform Enterprise: VCS provider, connector plugin, credentials, config provider, catalogue item and a first VM order.

Intelibliss4 min readFrom our archive
The ServiceNow Cloud User Portal showing a completed Terraform provisioning request and its stack status

Update, October 2026: IMGO was built on ServiceNow Cloud Provisioning and Governance, which ServiceNow has since marked for deprecation. Its successor is OneCloud, a new application with no dependency on CPG or Cloud Services Catalog. The approach to moving is in our CPG deprecation article.

The Terraform connector for ServiceNow Cloud Management lets end users provision infrastructure from the ServiceNow catalogue. ServiceNow creates a workspace in Terraform Enterprise, Terraform runs the configuration held in your version control repository, and the resulting resources show up in the Cloud User Portal. Setup is split between Terraform Enterprise, your VCS and ServiceNow. Here’s the order we do it in.

Prerequisites

  • An account on a Terraform Enterprise or Terraform Cloud organisation. Access in Terraform Cloud is team based, so the user you use must belong to a team with the right permissions.
  • A ServiceNow instance with Cloud Management (Cloud Provisioning and Governance). A developer instance from developer.servicenow.com works for a trial.
  • A supported version control system with read access to the repositories that hold your Terraform configuration. We use GitHub below.
  • A private Git repository to host the integration.

Step 1: create a VCS provider in Terraform

This connects GitHub, where the cloud templates live, to Terraform, where runs and applies happen.

  1. In terraform.io choose your organisation, open Settings, select VCS Providers and click Add VCS Provider.
  2. Select GitHub, then GitHub.com (Custom).

The Add VCS Provider page in Terraform Cloud with GitHub.com (Custom) selected

  1. In a new tab, open GitHub and register a new OAuth application. Copy the application name, homepage URL and authorisation callback URL that Terraform displays into the GitHub form and register the application.

Registering a GitHub OAuth application using the values shown by Terraform

  1. Copy the client ID and client secret from GitHub back into Terraform and click Connect and continue.

Copying the GitHub client ID and client secret into the Terraform VCS provider form

Terraform can now see your repositories.

Step 2: install the Terraform connector in ServiceNow

In the ServiceNow Store, search for “terraform” and install Cloud Management: Terraform Connector (sn_cmp_terraform).

The Cloud Management Terraform Connector listing in the ServiceNow Store

Step 3: create a credential for Terraform

  1. Open the Cloud Admin Portal and go to Manage > Credentials > New > API Key Credentials.
  2. Generate an API token in terraform.io (a team token is the usual choice) and paste it into the API Key field.
  3. Create a credential alias of type Credentials in the Connection and Credential Aliases table and link it to the record.

An API Key Credential record in ServiceNow holding the Terraform team token

Step 4: create the config provider and discover repositories

  1. In the Cloud Admin Portal go to Manage > Config Management > New.
  2. Fill in the provider details: provider Terraform Enterprise, your Terraform organisation name, URL https://app.terraform.io/api/v2, server type Cloud, the credential from step 3 and the Terraform version. Save.

The config provider form for Terraform Cloud with organisation, URL and credential

  1. Select the new config provider and click Discover Now. This discovery isn’t schedulable, so run it by hand.
  2. When it completes, open the TFE VCS record and select the VCS provider you created in step 1.
  3. Create a second API key credential, this time for GitHub. Generate a personal access token under GitHub > Settings > Developer settings with the scopes you need, and store it the same way as in step 3.
  4. Attach the GitHub credential to the VCS record, save, and click Find Branches and Repositories.

The Terraform Enterprise VCS provider record with discovered GitHub repositories listed under Related Items

Every repository in the GitHub account should now appear under Related Items.

Step 5: design the catalogue item

  1. In the Cloud Admin Portal go to Design > Cloud Catalog Item > New.
  2. Give it a name and short description, set the catalogue type to Provision, the source to Configuration Management Template, the provider type to Terraform Enterprise and the provider to your config provider. Submit.

A Cloud Catalog Item configured for Terraform Enterprise provisioning

  1. Open the record, go to Cloud Template > New and select the configuration installable that was discovered in step 4 (the repository and branch holding your template). Submit.
  2. Check that the template validates. The validation status should read Success.

A cloud template record showing the validation message “Template is valid and saved”

  1. Parameters and a variable set are created from the template’s variables. Review them and set defaults where it makes sense, such as the VM size.

Template parameters generated from the Terraform variables, including region, resource group and VM size

  1. Tick Active on the catalogue item and update it. It’s now available in the Cloud User Portal.

Step 6: order a VM from the Cloud User Portal

Open the Cloud User Portal, select the catalogue item, fill in the order details and submit. You should see three things happen:

  • A flow triggers in ServiceNow and the request moves through policy, approval and quota checks.
  • A workspace is created in Terraform Enterprise and a webhook is registered in GitHub.
  • Terraform runs and applies the configuration, and the VM is provisioned. The stack and its resources appear in the portal.

The Cloud User Portal activities view with a request completed and the stack resources discovered

Once this works for one template, adding further cloud providers or environments is mostly a matter of adding repositories and catalogue items. The connector does the heavy lifting, and the time goes into writing good Terraform.


CloudTerraformCloud ManagementITOMProvisioning
Talk to an expert

Tell us what you want ServiceNow to do next

One of our senior experts will get back to you. No commitment, and no preparation needed on your side.