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

Prevent terraform init command from parallel running if plugin cache is used #2698

Merged
merged 4 commits into from
Sep 1, 2023

Conversation

levkohimins
Copy link
Contributor

@levkohimins levkohimins commented Sep 1, 2023

Description

Prevent terraform init command from parallel running if the terraform plugin cache is used.

Related Issues

Fixes #1212
Fixes #1087
Related to #2542

@levkohimins levkohimins changed the title Bug/parallel terraform init Prevent init command from parallel running if plugin cache is used Sep 1, 2023
@lorengordon
Copy link
Contributor

This is a very cool solution!

@levkohimins levkohimins marked this pull request as ready for review September 1, 2023 16:48
@levkohimins
Copy link
Contributor Author

@denis256 Thanks for the review!

@levkohimins
Copy link
Contributor Author

This is a very cool solution!

Thanks, I hope this PR solves the issue.

@levkohimins levkohimins merged commit ba56d84 into master Sep 1, 2023
@levkohimins levkohimins changed the title Prevent init command from parallel running if plugin cache is used Prevent terraform init command from parallel running if plugin cache is used Sep 1, 2023
@denis256 denis256 deleted the bug/parallel-terraform-init branch September 2, 2023 08:57
hugorut pushed a commit to infracost/terragrunt that referenced this pull request Oct 10, 2023
…runtwork-io#2698)

* fix: prevent terraform `init` from running in parallel

* chore: docs update

* chore: docs update

* chore: improved plugin cache detection
hugorut pushed a commit to infracost/terragrunt that referenced this pull request Oct 10, 2023
…runtwork-io#2698)

* fix: prevent terraform `init` from running in parallel

* chore: docs update

* chore: docs update

* chore: improved plugin cache detection
@atheiman
Copy link

@levkohimins - is there a way to override this? I understand the limitations of the cache, but i still want my terragrunt run-all init command to run in parallel and use the cache. I have other protections in place that get around the problems of the cache, and I init > 100 terragrunt modules in my ci/cd pipeline. I need the init to run in parallel (~5 min) vs sequentially (>30 min).

@levkohimins
Copy link
Contributor Author

levkohimins commented Aug 30, 2024

@atheiman, Starting with v0.56.4, in which we implemented Terragrunt Provider Cache this is no longer relevant (this code has been removed), namely init commands run in parallel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants