Cache Updating


Every time you run terragrunt, it needs to have external data which it downloads when the .terragrunt-cache folder does not exist. If the folder exists, it uses the data from that folder. So if your source changes, terragrunt won't know so you have to run terragrunt with the --terragrunt-source-update flag to redownload the data from scratch. This takes additional time but is worth doing during development. After you are done with whatever you are doing, you can then clear the cache either through the Makefile - make clear-cache or running these commands directly.

find . -type d -name ".terragrunt-cache" -prune -exec rm -rf {} \\; \\
find . -type d -name ".terraform" -prune -exec rm -rf {} \\;  

Moving State


Whenever you run a module, the state is persisted in S3 with a lock-table entry in DynamoDB that points to the state object in S3. If you move the module in the repo structure, you then need to move the associated state in S3 and delete the lock table entry in DynamoDB. Be careful not to delete the state file (terraform.tfstate) as you will then need to import each resource individually into state (terraform import <id of resource>)