microsoft / azure-pipelines-terraform

Azure Pipelines tasks for installing Terraform and running Terraform commands in a build or release pipeline.
MIT License
95 stars 59 forks source link

Feature request: Enable debug logs #179

Open rikat-ms opened 10 months ago

rikat-ms commented 10 months ago

Terraform has a feature to get debug log by the environment variable which name is TF_LOG with the value "DEBUG" as described below. https://developer.hashicorp.com/terraform/internals/debugging

However, the TerraformTask task doesn't have any option to enable this setting and even though the environment variable is enabled like this, this setting is not used by this task.

image

So, it would be great if debug log is enabled when system.debug predefined variable is set true. Or if there is another way to enable the debug log, it would be helpful.

mericstam commented 10 months ago

Hi, not really sure how to do this. I don’t think it will be enough with setting values in bash profile. perhaps setting env in Node.js

mericstam commented 8 months ago

Hi again, perhaps you could pass environment variables, like this:

- task: TerraformTaskV4@4
        displayName: "Terraform_plan"
        inputs:
          command: plan
          environmentServiceNameAzureRM: "(REMOVED)"
        env:
          TF_LOG: "DEBUG"