CPG Terraform Provider - Discovered Templates Loaded Single Line

Nazul
Giga Contributor

Hi,

 

We are implementing Cloud Provisioning and Governance and the Terraform provider (using Terraform CLI). We were using ServiceNow Tokio, and everything was working fine. However, when the instance was migrated to Tokio, we realize the Terraform files for all our templates are being imported as one single line and instead of line breaks, we just see the "n" character.

 

This also happens in a fresh developer instance, and it only happens when using Terraform in a Windows environment, if we use Linux environment, it doesn't fail this way.

 

We double-checked the .tf files end of lines, and it doesn't matter if we use CRLF or LF, if the selected Terraform provider is Windows, the files are not being imported correctly. Any line ending works using Linux.

 

Example. It should work like this:

Nazul_0-1693515741636.png

 

Instead, we see this:

Nazul_1-1693515914584.png

 

Steps to reproduce:

  • Request a new dev instance
  • Install CPG
  • Log into the new dev instance
  • Install Terraform provider plugin
  • Add a new MID server (Windows)
  • Add a new service account for Terraform provider
  • Add a new Terraform provider (Windows, using the new service account)
  • Run as discover (this works fine without visible)
  • Examinate the imported templates
  • All .tf files from the discovered templates will have the issue with the end of lines not parsed correctly

 

Again, this didn't happen to us using Tokio, but using Vancouver always happens.

 

Any ideas how to fix this (using a Windows-based Terraform provider)? We need to make this works not just for Linux but for Windows servers too.

0 REPLIES 0