suzuki-shunsuke / tfaction

Framework for Monorepo to build high level Terraform Workflows by GitHub Actions
https://suzuki-shunsuke.github.io/tfaction/docs/
MIT License
278 stars 40 forks source link

Support stop using plan files when applying changes #2057

Open suzuki-shunsuke opened 5 days ago

suzuki-shunsuke commented 5 days ago

Feature Overview

Support running terraform apply without a plan file.

Why is the feature needed?

You can't pass input variables to terraform apply when you use a plan file.

$ terraform apply -var foo=foo plan.out
╷
│ Error: Can't set variables when applying a saved plan
│ 
│ The -var and -var-file options cannot be used when applying a saved plan file, because a saved plan includes the variable
│ values that were set when it was created.
╵

This is inconvenient if you want to use input variables to change provider's authentication settings. For example, if you want to change AWS IAM Role by terraform plan and apply dynamically, this issue would be a blocker.

Example Code

tfaction.yaml

apply_with_plan_file: false

Note

No response