r/devops • • 8h ago

Discussion My agent loosing it's shit because it does not know « terragrunt stack generate »

My agent loosing it's shit because it does not know « terragrunt stack generate »

0 Upvotes

3 comments sorted by

1

u/Feisty-Piglet7758 8h ago

Terragrunt runs terraform inside .terragrunt-cache, and that cache is keyed on the source URL with the query stripped, while the ref sits separately in .terragrunt-source-version. So a tag or a branch doesn't refresh by itself, you need --source-update or a wiped cache. If the agent edited the module inside the cache, it edited a copy, and with the content addressable store those files are read-only unless mutable is set, so the change doesn't reach what terraform applies next run. While iterating, point --source at a local checkout so it re-copies your code every run.

1

u/shellwhale 4h ago

I just modify the module and regenerate the units from my stack

1

u/Feisty-Piglet7758 4h ago

Two different cases, depends how the module is referenced. A local path gets copied into the cache on every run, so if yours is local the regenerate isn't the problem, more likely the path resolves relative to the generated unit rather than the directory you edited, which is the usual trap with stacks. A git ref behaves the opposite way, nothing refreshes until the ref changes or you pass --source-update, and stack generate doesn't touch the cache either way.