gruntwork-io / terragrunt

Terragrunt is a flexible orchestration tool that allows Infrastructure as Code written in OpenTofu/Terraform to scale.
https://terragrunt.gruntwork.io/
MIT License
7.97k stars 967 forks source link

dependency init check and auto-init check are different #2764

Open dctrwatson opened 11 months ago

dctrwatson commented 11 months ago

Describe the bug The way terragrunt determines if it needs to run auto-init and how the dependency code determines if a stack has already been init-ed are different mechanisms. The latter only does a very naive check for .terraform existence.

Expected behavior The dependency init check to match the auto-init check.

Versions

Additional context We cache .terraform/modules for CI/CD since downloading modules can be quite unreliable. However, if we try filter what stacks are run, we have the issue where terragrunt tries to use terraform output -json for dependent stacks that aren't auto-init'd (even with FetchDependencyOutputFromState enabled.)

dctrwatson commented 2 months ago

Still an issue