-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
41cf9ff
commit 8ed7802
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
docs/automation/iac/terraform/terraform-refresh-takes-ages.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
title: Terraform refresh takes ages | ||
--- | ||
|
||
## What | ||
|
||
This can happen with both Terraform and Terragrunt, so this applies to al | ||
|
||
The issue is when running a `terraform plan` the plan will sit at the below for ages | ||
|
||
```text | ||
... | ||
google_folder.sandbox: Refreshing state... [id=folders/<>] | ||
... | ||
^CStopping operation... | ||
``` | ||
|
||
This happens because terraform sucks at walking the graph | ||
|
||
## Solution | ||
|
||
Set the [`parallelism` flag to 20](https://developer.hashicorp.com/terraform/cli/commands/apply#parallelism-n) and disable a refresh | ||
|
||
|
||
=== "Terraform" | ||
|
||
```shell | ||
terraform plan -parallelism=20 -refresh=false | ||
``` | ||
|
||
=== "Terragrunt" | ||
|
||
```shell | ||
terragrunt plan -parallelism=20 -refresh=false | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters