Blue Clouds
Blue Clouds

Reputation: 8153

use of terraform -out parameter

After running a terraform plan it said

Note: You didn't specify an "-out" parameter to save this plan, so Terraform can't guarantee that exactly these actions will be performed if "terraform apply" is subsequently run.

What does the -out mean and how and why should I use it in Azure DevOps pipeline.

Upvotes: 5

Views: 5492

Answers (2)

Krzysztof Madej
Krzysztof Madej

Reputation: 40553

-out will create a file with plan for you. You can push that as pipeline artifact and then use it in deployment job. If you do that, and you will add manual approval on your env you can ask there to review that plan before applying it to your env. It can make sense for production deployment to have an eye on this before applying changes.

Here you have shown the concept for releases. But you are capable to do the same with multi stage yaml pipelines.

Upvotes: 1

4c74356b41
4c74356b41

Reputation: 72151

it means - save the output to a file (and later you can reuse that file with terraform apply if you want to). you don't have to use it at all in the pipelines. In fact, since its a pipeline, I don't think there is any merit to it at all, because in the pipeline, you can be sure that the plan and apply are run against the same code.

Upvotes: 6

Related Questions