Git Product home page Git Product logo

azure-pipelines-terraform-output's People

Contributors

jaydenmaalouf avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

azure-pipelines-terraform-output's Issues

`TypeError: Cannot read property 'message' of undefined` when running task

What is happening

The pipeline step fails with the error:

##[error]TypeError: Cannot read property 'message' of undefined

Invocation

This is my setup:

- task: TerraformOutput@1          # https://marketplace.visualstudio.com/items?itemName=JaydenMaalouf.terraform-output
  inputs:
    outputFilePath: '$(ROOT_MODULE)/terraform-plan'
    artifactName: 'dev'

Raw logs

Click for raw logs
2023-06-15T10:24:48.0612569Z ##[section]Starting: TerraformOutput
2023-06-15T10:24:48.0615487Z ==============================================================================
2023-06-15T10:24:48.0615597Z Task         : Terraform Load Output
2023-06-15T10:24:48.0615672Z Description  : Load Terraform Output into Terraform Tab
2023-06-15T10:24:48.0615750Z Version      : 1.1.27
2023-06-15T10:24:48.0615811Z Author       : Jayden Maalouf
2023-06-15T10:24:48.0615882Z Help         : 
2023-06-15T10:24:48.0615926Z ==============================================================================
2023-06-15T10:24:49.6226854Z ##[error]TypeError: Cannot read property 'message' of undefined
2023-06-15T10:24:49.6238066Z ##[section]Finishing: TerraformOutput

Looking through the code, the only reference to <something>.message I can find is:

if (result.code != 0) {
throw `Terraform Output failed with Exit Code: ${result.code}
Error Message: ${result.error.message}`;
}

So I wonder whether my setup is raising an error that is not being returned correctly.

Is it possible to add multiple TFPlan with 1 task ?

Hello,

I am creating multiple TFPlan thoughout my Azure DevOps Releases and I would like to know if it would be possible to load every tfplan with a single task from you ?

My TFPlans are created dynamically but I can't duplicate dynamically your task.

So I want to know if it would be possible to add something like that with "*" selector :

  • task: TerraformOutput@1
    inputs:
    *outputFilePath: .tfplan
    artifactName: Staging

Regards,

Alex.

Error: Failed to read the given file as a state or plan file

I tried using the standard plan file, and the JSON file, either way, I get a complaint about the "version" missing. Confused because the documentation doesn't say anything about converting the binary output file to JSON before parsing it - or maybe it's failing it's own internal JSON parsing because of the version mismatch? I use tfenv in the pipeline to set the version for whatever the workspace is using - in this case my workspace is using 1.5.5, but it looks like the task is defaulting to whatever the latest version is.

Assuming it's just a version issue, is there a way to force the task to use a specific version? Or somehow allow it to be dynamic enough to read the currently used terraform version? I'm using the -chdir flag to hot swap workspaces within the pipeline, which, incidentally is the same as the below parameter: ${{ parameters.workspace }}

  - task: TerraformOutput@1
    displayName: Terraform Show
    inputs:
      outputFilePath: $(Build.ArtifactStagingDirectory)/output.tfplan
      artifactName: ${{ parameters.workspace }}
Starting: Terraform Show
==============================================================================
Task         : Terraform Load Output
Description  : Load Terraform Output into Terraform Tab
Version      : 1.1.34
Author       : Jayden Maalouf
Help         : 
==============================================================================
##[error]Terraform Output failed with Exit Code: 1
      Error Message: ╷
│ Error: Failed to read the given file as a state or plan file
│ 
│ State read error: Error reading /agent/_work/1/a/output.tfplan as a
│ statefile: 2 problems:
│ 
│ - Unsupported state file format: The state file could not be parsed as
│ JSON: syntax error at byte offset 1.
│ - Unsupported state file format: The state file does not have a "version"
│ attribute, which is required to identify the format version.
│ 
│ Plan read error: plan file was created by Terraform 1.5.5, but this is
│ 1.5.7; plan files cannot be transferred between different Terraform
│ versions
╵

Terraform Plan Tab Scrollbars

Terraform Plan Tab in Run Summary

In Microsoft Edge 114.0.1823.90 where a Terraform Plan is produced which has information lines wider than the tab frame this information is not visible.

Is it possible to enable horizontal scroll bars for this tab?

TF Plan not displayed in Release

Hello @JaydenMaalouf,

Sorry to bother you, I don't know if you follow the closed issues so I create another one here.

I installed your extension and now I can see the "Terraform Plan" tab in the Release stages... BUT it stays empty even with a Terraform plan executed and an output generated...

image

Can you tell me if I do something wrong or if it is an issue ?

Regards,

Work with Releases ?

Hello,

Does this plugin works with Azure Releases ? Or is it only for Azure Pipelines YAML ?

Regards,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.