jason-johnson / azure-pipelines-tasks-terraform

Azure Pipelines extension for Terraform
MIT License
124 stars 53 forks source link

Unable to see multiple plan outputs #331

Closed riemers closed 11 months ago

riemers commented 1 year ago

Describe the bug If i have multiple plan outputs it doesn't show in the tab. It says nothing. If i only have 1 workspace output it works as designed.

To Reproduce Have multiple tasks that produce a 'publishPlanResult' with different names and no output will be shown.

Expected behavior Some sort of dropdown all collection of all changes under the Plan Output Tab

Screenshots image Is empty when using things like:

  - ${{ each tfWorkspaceName in parameters.workspaceList }}:
    - task: TerraformCLI@0
      displayName: "Terraform Plan"
      allowTelemetryCollection: false
      inputs:
        backendType: 'azurerm'
        command: 'plan'
        environmentServiceNameAzureRM: $(subscriptionName)
        publishPlanResults: ${{ tfWorkspaceName }}
      env:
        TF_WORKSPACE: ${{ tfWorkspaceName }}

Pipeline Logs No output no logs :)

Agent Configuration Latest configs used, latest az cli etc. Default :)

Additional context Might be that this just is not supported, or there needs to be a way to get the terraform output in seperate pages somehow?

jmyers82 commented 1 year ago

to solve this I think you need to give each plan a unique name. Can you tack on - to the end of the plan name. I am assuming the tfWorkspaceName is unique in this case? So this should work as you have it? hmm...

raman-nbg commented 11 months ago

Could you solve the issue? If yes, how did you configure the task?

@jmyers82: -<some_random_var> is not known to tf.

riemers commented 11 months ago

@raman-nbg, i have yet find the time since i am in the middle of another rewrite. But what he means is to add something random to the plan in the pipeline. Presume he means below as example.

- task: TerraformCLI@0
  displayName: "Terraform Plan" <- unique name
  inputs:
    provider: 'azurerm'
    command: 'plan'
    workingDirectory: '../terraform' # by default we are in the /s folder.
    environmentServiceNameAzureRM: '${{ parameters.environment.resourceGroupName }}'
jason-johnson commented 11 months ago

This will be resolved with #339