runatlantis / atlantis

Terraform Pull Request Automation
https://www.runatlantis.io
Other
7.76k stars 1.05k forks source link

Print Terraform logs to Atlantis log output #1074

Open tjarjoura opened 4 years ago

tjarjoura commented 4 years ago

I was wondering if this was an option supported by atlantis? I know that the logs get sent back to the PR as a comment but it can helpful in cases of an error or long-running plan/apply to see what is going on.

jpreese commented 4 years ago

This has been mentioned in a couple conversations on our end as well. Before Atlantis, we ran our terraform plans and applies in a pipeline where we could watch the progress. We lost that when moving to Atlantis. While it's not a huge concern in most cases, we have had some instances where a plan takes 10minutes+ and it would be nice to see whats going on.

Though even if we did just implement this, users would have to have access to the cluster, as well as pod logs. So maybe in addition to the above, also adding in a periodic message to the PR (once a minute? every 3?) with the last 10 log lines--or something similar.

MPV commented 4 years ago

I do see why Hashicorp might not work too much on adding this, given this description of how Atlantis relates to Terraform Cloud:

Using Atlantis with Terraform Cloud or Terraform Enterprise gives you access to features like:

  • Real-time streaming output
  • [...]

But maybe us as an open source community could collaborate on finding ways to add this?

mwarkentin commented 4 years ago

The free terraform cloud plan does offer remote runs/applies (for up to 5 users) - so that could be an option for some.

ghostsquad commented 4 years ago

possible duplicate of #185

ghostsquad commented 4 years ago

I can't use TFE for streaming output, as I'm using the custom workflows functionality of Atlantis, that TFE doesn't support. Specifically terragrunt & doing jsonnet render to .tf.json files prior to running init, etc.