Skip to content

Commit

Permalink
add -out to tf plan
Browse files Browse the repository at this point in the history
  • Loading branch information
tcarreira committed Sep 9, 2024
1 parent a49f822 commit 332f0a1
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 @@ -518,9 +518,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 @@ -543,6 +546,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 332f0a1

Please sign in to comment.