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

-out switch writes plan file to temp dir #274

Open robinbowes opened 7 years ago

robinbowes commented 7 years ago

When using the -out switch, eg -out=my_plan, the my_plan file is written to the temp working directory rather than the current dir when the terragrunt command is run.

Of course, a workaround is to use an absolute path, but I think terragrunt should either munge the out file path when passing it to terraform, or copy it from the temp dir to the current working dir.

dmlemos commented 7 years ago

I think it is a security risk to leave the terraform plan file lying around on the tmp folder.

My thought is to have a parameter to remove the plan file after apply. For instance: terragrunt apply -rm-plan=$plan_file

Where $plan_file is relative to the working directory.