Problem
The ServiceNow plugin for HCP Terraform and Terraform Enterprise (version 2.1.1 and earlier) includes three default polling workers. One of these, the Worker Poll Apply Run, periodically sends API requests to apply active runs in all associated workspaces. This default behavior can cause two issues:
- Unexpected Applies: The poller may apply Terraform runs before your expected workflow initiates the apply operation, leading to premature or unintended infrastructure changes.
-
Excessive API Calls: The poller makes continuous API calls to apply runs, even to runs in terminal states (e.g.,
applied,errored), creating unnecessary API traffic.
Prerequisites
- You have an existing ServiceNow workflow that provides an alternative method for applying Terraform runs, making the
Worker Poll Apply Runpoller redundant.
Cause
The Worker Poll Apply Run is designed to automate the apply process for runs that are in a ready state. However, this automated behavior conflicts with customized workflows that manage the apply step through other means.
Solution
To prevent the poller from applying runs automatically, you must deactivate the Worker Poll Apply Run scheduled job within your ServiceNow instance. This action ensures that runs are only applied by your designated workflow.
Outcome
After deactivating the poller, you should observe the following improvements:
- Terraform apply operations are performed only by your intended workflows.
- The volume of unnecessary API calls from ServiceNow to HCP Terraform or Terraform Enterprise decreases significantly.