ciberado / automation-workshop

1 stars 1 forks source link

Terraform scratch file #2

Open nicojaraiz opened 1 week ago

nicojaraiz commented 1 week ago

What would be the command to be able to view the draft created before using the "terraform apply" when finishing a "plan"

Captura

ciberado commented 6 days ago

Here it is the relevant doc! https://developer.hashicorp.com/terraform/cli/commands/plan#out-filename. I will keep this issue opened until I find the time to update the lab :) Thanks!

-out=FILENAME - Writes the generated plan to the given filename in an opaque file format that you can later pass to terraform apply to execute the planned changes, and to some other Terraform commands that can work with saved plan files

nicojaraiz commented 4 days ago

Thanks for the comment Ciberado! I find it interesting to say the least, to be clear, before performing the "apply" I enter the command attached in your comment so I can preview what is configured, right?

ciberado commented 3 days ago

Yes :) Plan will always help you to preview what's going to happen. But if you use out the changelog will be stored in a file, so it can be directly applied later without recalculating anything. It is a way of ensuring that what you checked in the plan will be the actual mutation run by apply.