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

Terraform apply with Environment Variables taking an eternity to finish #403

Open
yuvaraja402 opened this issue Mar 16, 2024 · 2 comments
Open
Labels
question Further information is requested

Comments

@yuvaraja402
Copy link

Description:

In my current project, I have a working directory containing a Python application and Terraform script.
As part of the deployment process, I'm using a GitHub runner to execute Terraform scripts for infrastructure provisioning.

Problem:

The deployment phase seems to be stuck after passing the client_id and client_secret from GitHub secrets.

Screenshot 2024-03-16 at 10 35 39 PM

File Structure for clarity:

The Terraform files involved in this process include:

  • variables.tf (which holds variable declarations for client_id and client_secret)
Screenshot 2024-03-16 at 10 29 22 PM
  • Github Workflow file deployment section -
Screenshot 2024-03-16 at 10 42 58 PM
@bflad
Copy link
Contributor

bflad commented Mar 19, 2024

Hi @yuvaraja402 👋 Thank you for raising this and let's see if we cannot get you unstuck here.

One thing that I am immediately noticing is that you are pointing at a quite old hashicorp/setup-terraform@v1 tag. Does anything change if you switch that to v2 or v3?

Do you see any output if you let the command run for a very long time? GitHub Actions should time it out at 6 hours, but that is also configurable with the timeout-minutes workflow configuration.

One other thing you may want to try in this case is disabling the GitHub Actions wrapper, which seems to be problematic at the moment (#395) -- that should allow Terraform CLI to output information into the GitHub Actions logs immediately, rather than potentially waiting until the command is finished for any long-running operations.

For example:

- name: Install Terraform
  uses: hashicorp/setup-terraform@v3
  with:
    terraform_wrapper: false

Hope this helps. Please let us know how it goes.

@bflad bflad added the question Further information is requested label Mar 19, 2024
@yuvaraja402
Copy link
Author

Hello @bflad 👋 Thank you for responding on this thread!

As you suggested, yes I did try with v2 and v3 for hashicorp/setup-terraform@v1 and do meet the same problem.
I haven't let the runner run for more than 2 hours since it depletes the purpose of using a Github runner if it takes long to push my changes.

I will try the GitHub Actions wrapper and will update this thread soon.

Regards, Yuva

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants