Skip to content

Commit

Permalink
feat: add -plan @ tf console
Browse files Browse the repository at this point in the history
  • Loading branch information
tcarreira committed Sep 4, 2024
1 parent a49f822 commit 8187dd3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion terrabutler/click.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,15 +212,23 @@ def tf_apply_cli(ctx, auto_approve, destroy, input, lock, lock_timeout,
"interactive command prompt")
@click.option("-state", help="Legacy option for the local backend only."
" See the local backend's documentation for more information.")
@click.option("-plan", is_flag=True, default=False,
help="Create a new plan (as if running \"terraform plan\") and"
" then evaluate expressions against its planned state,"
" instead of evaluating against the current state."
" You can use this to inspect the effects of configuration"
" changes that haven't been applied yet..")
@click.option("-var", multiple=True,
help="Set a variable in the Terraform configuration. "
"This flag can be set multiple times.")
@click.pass_context
def tf_console_cli(ctx, state, var):
def tf_console_cli(ctx, state, plan, var):
options = []

if state:
options.append(f"-state={state}")
if plan:
options.append("-plan")
if var:
for name in var:
options.append(f"-var='{name}'")
Expand Down

0 comments on commit 8187dd3

Please sign in to comment.