Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atlantis and TFE integration is broken. Again... #4573

Open
widogg opened this issue May 17, 2024 · 0 comments
Open

Atlantis and TFE integration is broken. Again... #4573

widogg opened this issue May 17, 2024 · 0 comments
Labels
bug Something isn't working Stale

Comments

@widogg
Copy link

widogg commented May 17, 2024

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Overview of the Issue

I did a fresh Atlantis install using Helm charts. I'm using Terraform Cloud agent/remote execution.

The workspace I'm using is configured for terraform ~1.8.

The error I get is the same that has been reported multiple times, like in #704, #1628, #1687, #4196, etc.

The previous fixes can be found here and inthe next couple of lines

Reproduction Steps

Deploy a new Atlantis instance using Helm from scratch. Use a new Terraform Cloud workspace with Agent execution mode (with terraform ~1.8)

Logs

running "/home/atlantis/atlantis-data/bin/terraform1.8.1 plan -input=false -refresh -out \"/home/atlantis/atlantis-data/repos/<redacted>/terraform-azure-policies/2/default/default.tfplan\"" in "/home/atlantis/atlantis-data/repos/<redacted>/terraform-azure-policies/2/default": exit status 1
╷
│ Error: Saving a generated plan is currently not supported
│ 
│ The "remote" backend does not support saving the generated execution plan
│ locally at this time.
╵

Additional Context

Sorry if don't understand the reasons why this keeps happening. From what I could understand, the "easiest" way to work with Terraform cloud remote execution is to try to make it run, wait for it to fail, capture the error and if matches the string, run again.

This seems very convuluted and error prone, like chasing the rabbit.

Proposal

Would it be possible to assume if you are using Terraform Cloud (or enterprise) you are going to be using remote execution by default (and local as an excemption)?

If this assumption is correct, then if the tfe-token flag is defined, you skip the first run with the -save option that will fail anyway.

If, instead, you use local execution mode, then Atlantis already has a flag for that and you can run with the save option.

With this proposal, you remove the string matching, so you actually prevent future issues. Instead, you only rely on the already existing flag to know if you are using local or remote execution, and act accordingly

@widogg widogg added the bug Something isn't working label May 17, 2024
@dosubot dosubot bot added the Stale label Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

No branches or pull requests

1 participant