Giter Site home page Giter Site logo

tfe-run's People

Contributors

dependabot[bot] avatar kvrhdn avatar nicole-ashley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tfe-run's Issues

Setup failed: failed unpacking terraform config: lstat

TFC Run triggered using this GH Action fail with below issue.
Same error does not happen when I Queue plan manually from the Terraform Cloud UI.

Terraform v1.0.0
on linux_amd64

Setup failed: failed unpacking terraform config: lstat /tmp/terraform-build-worker01234676/slug: no such file or directory

I've tried configure the workspace with both UI/VCS-driven and API-driven workflows. Same issue in both cases.

Action step:

       - name: Terraform Cloud Run
         uses: kvrhdn/[email protected]
         with:
           token: ${{ secrets.TFC_ACCESS_TOKEN }}
           organization: MyOpg
           workspace: my-workspace
           type: apply
           wait-for-completion: true
           message: |
             Run triggered using tfe-run (commit: ${{ github.SHA }})
         id: tfe-run

Output of the run shows sensitive outputs

Because the output of the run is being got directly from the state it prints sensitive output values to the github action log.

Would be good to suppress this like the CLI does or at least make it an option.

Don't fail the workflow if no statefile is available

Follow up from #22: in a new Terraform workspace when no statefile has been added yet, every speculative run will fail when attempting to fetch the outputs.

We should either:

  • fetch the outputs from the statefile that is created by the plan (if this is possible with the API?)
  • not fail when the statefile does not exist (i.e. log a warning and do not return any outputs)

support for enteprise

terraform enterprise makes use of the same API as native terraform cloud.

Therefore, It would be nice if we can pass a hostname for an org terraform enterprise server in GitHub actions so that it doesn't use the default "app.terraform.io" for all api calls.

Error: could not parse state: json: cannot unmarshal array into Go struct field terraformOutput.outputs.value of type string

I hit the following issue when I added a Terraform output of type array.

Terraform Cloud Plan & Apply passes successfully and I can see array output.
But kvrhdn/tfe-run action fails with

Run kvrhdn/[email protected]
...
Run has been applied!
Error: could not parse state: json: cannot unmarshal array into Go struct field terraformOutput.outputs.value of type string

My Terraform output

terraform output
name = [
  "my-name",
]

Command Line and Environment Argument Parsing

Would you be open to a pull request for optionally passing as arguments and environment variables? I'm new to go and found your project when I was working through how to create a run through the SDK. Your much better implementation has given me a lot of great example content on how to do this.

I'm using in azure devops pipelines right now and was considering enhancing to support not just json but also env/cli args. If that's within scope let me know and I'll see if I can make a contribution and get some feedback for you. Cheers and thanks for this project!

Unable to run on Terraform Cloud when specifying tf-vars

Terraform Cloud gives me an error regarding the variables that have been uploaded to the run. Apparently they're missing a trailing newline, and nothing I've tried in the yaml will force the variable definition to include one.

image

I would expect that updating tfe-run or go-tfe-run to ensure there's a newline at the end of the vars file would fix this.

Runs failing with TLS handshake timeout

EDIT 6 Sept.: original title was Segmentation violation during monitoring of the run


The past day two runs failed with the same error message. It's unclear what is causing this error (whether it's a bug in our code or weird responses coming from the API), but we should try to fix it anyway.

Error message:

...
Run status: apply queued
Run status: applying
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x6d00d3]

goroutine 1 [running]:
github.com/kvrhdn/go-tfe-run.Run(0x803d80, 0xc00001c078, 0xc00002400c, 0x5a, 0xc00001e053, 0x6, 0xc0000200a0, 0x13, 0xc000012e10, 0x0, ...)
	/go/pkg/mod/github.com/kvrhdn/[email protected]/tferun.go:188 +0x1483
main.main()
	/app/main.go:52 +0x31f

The runs on Terraform Cloud where not impact and completed successfully.

Occurences

Integration run 30 Aug. 10:21 UTC: https://github.com/kvrhdn/tfe-run/runs/1047358751?check_suite_focus=true#step:9:51
Integration run 30 Aug. 14:16 UTC: https://github.com/kvrhdn/tfe-run/runs/1047790479?check_suite_focus=true#step:9:51
Integration run 30 Aug, 23:15 UTC https://github.com/kvrhdn/tfe-run/runs/1048796083?check_suite_focus=true#step:9:51

Error: could not get current state: resource not found

Any ideas on this error?

For a Pull Request I'm using the action to run a Speculative Plan so type is set to plan

      - name: Terraform Cloud Speculative Plan 
        uses: kvrhdn/[email protected]
        with:
          token: ${{ secrets.TFC_ACCESS_TOKEN }}
          organization: MyOrg
          workspace: networking-workspace
          directory: networking/
          type: plan
          wait-for-completion: true
          message: |
            ${{ github.head_ref }} - ${{ github.event.commits[0].message }} #${{ github.run_number }} (commit: ${{ steps.slug.outputs.sha8 }})

From Terraform Cloud the speculative-plan finished successfully but the tfe-run action fails

Run status: pending
Run status: plan queued
Run status: planning
Run status: planned and finished
Run is planned and finished.
::set-output name=run-url::https://app.terraform.io/app/XXXX
##[debug]='https://app.terraform.io/app/XXXXX'
::set-output name=has-changes::true
##[debug]='true'
Error: could not get current state: resource not found
##[debug]Docker Action run completed with exit code 1

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.