As stated in the doc while configuring terraform plan step, we need to enter a unique value in Provisioner Identifier which identifies the provisioning done in one terraform plan step and we would use this identifier in additional steps to refer to the provisioning done in this step.
This article talks about an issue that was reported in the field when configuring the same provisioner identifier in terraform plan step of multiple parallel stages within a pipeline.
The pipeline that was getting into this issue was having multiple custom stages and they all were using the same pipeline template with a TF plan step where the provisioner identifier was the same. During execution, TF plan step in the first stage got executed successfully, however, the TF plan step of the other parallel stages were failing stating that the TF config folder is missing in the delegate.
For each TF plan step execution, we locally download the TF code files to the delegate into the below path.
/opt/harness-delegate/./terraform-working-dir/<accountId>/<orgID>/<projected>/<provisioner identifier>/script-repository/<folder path>
After executing TF plan step, we delete the local directory named with provisioner identifier.
When we have the same provisioner identifier in the TF plan steps of multiple parallel stages, the local directory where the TF codes are saved is getting deleted after the execution of the first TF plan step in any parallel stage hence the TF code directory would not be available for the TF plan steps of the other parallel stages.
To prevent this from happening, we need to make sure that we use a unique provisioner identifier in the TF plan step of parallel stages or configure the provisioner identifier with the runtime input value in a template if we use this template across multiple parallel stages within a pipeline.