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
8.01k stars 971 forks source link

Terragrunt cache folder still contains deleted files in source folder #571

Open Sprinkle opened 6 years ago

Sprinkle commented 6 years ago

When using terragrunt, we noticed that if we renamed a source file or deleted a source file, the working folder still contains the original file / deleted file in its worker folder.

It seems that the copy files operation performed by Terragrunt does not do a sync, but just copy modified or new files.

brikis98 commented 6 years ago

Hm, it should delete all *.tf files: https://github.com/gruntwork-io/terragrunt/blob/master/cli/download_source.go#L322

Are you referring to other file types?

Sprinkle commented 6 years ago

Oh yeah, we have some .yaml files and some template files being referenced in our .tf files.

Can we make it configurable such that it will sync all files against the working folder?

brikis98 commented 6 years ago

PRs for improving how Terragrunt does copying are welcome. There are several requests around this functionality:

  1. Clean up all files/folders, not just .tf.
  2. Copy some hidden files and folders, but not all (e.g., not .git). See https://github.com/gruntwork-io/terragrunt/issues/394.