Skip to content

Commit

Permalink
Merge pull request #154 from montblu/tfplan-out
Browse files Browse the repository at this point in the history
add -out to tf plan
  • Loading branch information
MiguelNdeCarvalho authored Sep 9, 2024
2 parents 66eaabc + 332f0a1 commit cb053a1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion terrabutler/click.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,9 +526,12 @@ def tf_output_cli(ctx, no_color, json, raw):
help="Set a value for one of the input variables in the"
" root module of the configuration. Use this option"
" more than once to set more than one variable.")
@click.option("-out",
help="Write a plan file to the given path. This can be"
" used as input to the \"apply\" command.")
@click.pass_context
def tf_plan_cli(ctx, destroy, input, lock, lock_timeout, no_color,
refresh_only, refresh, target, var):
refresh_only, refresh, target, var, out):
options = []

if destroy:
Expand All @@ -551,6 +554,8 @@ def tf_plan_cli(ctx, destroy, input, lock, lock_timeout, no_color,
if var:
for v in var:
options.append(f"-var={v}")
if out:
options.append(f"-out={out}")

terraform_command_runner("plan", ctx.obj['SITE'], options=options,
needed_options="var")
Expand Down

0 comments on commit cb053a1

Please sign in to comment.