Introduction
Problem: When a workspace is ordered and a Terraform run is triggered through the ServiceNow catalog, the run does not auto-apply as expected.
Prerequisites (if applicable):
Access to ServiceNow
Access to HCP Terraform (Terraform Cloud)
Cause:
The Terraform run will not auto-apply if the Auto Apply setting is disabled in the workspace settings.
Although admins may customize the default Create Workspace catalog item in ServiceNow, the system still requires the correct type and value to be passed during workspace creation to ensure that Auto Apply is enabled.
Overview of possible solutions (if applicable)
Solutions:
Verify Auto Apply in HCP Terraform
Go to the workspace settings in HCP Terraform.
Confirm whether Auto Apply is enabled.
If it is disabled, the run will not auto-apply.
2. Validate Inputs from the ServiceNow Catalog
Ensure that the catalog item is passing the correct parameters (type and value) required for enabling Auto Apply during workspace creation.
3. Check the Create Workspace Catalog Flow in ServiceNow
Open ServiceNow Studio.
Navigate to the Flows section and open the Create Workspace catalog flow.
Verify that the auto_apply field is correctly configured and checked.
If not, update the flow and save the changes.
4. Test the Workflow
Order a new workspace from ServiceNow.
Trigger the run.
The run should now be automatically applied, confirming that Auto Apply is properly enabled.
Outcome: The run would get auto applied.
Additional Information:
https://developer.hashicorp.com/terraform/cloud-docs/integrations/service-now/service-catalog-terraform/service-catalog-config#provision-infrastructure