Skip to content

tf-plan/tf-apply: allow extra Terraform CLI arguments such as -refresh=false #170

Open

Description

@swibrow

What

tf-plan.yaml and tf-apply.yaml have no input for extra Terraform CLI arguments, so a caller cannot pass -refresh=false (or -target, -parallelism, ...) to the plan and apply.

Where

  • .github/workflows/tf-plan.yaml (tf-plan-v0): the plan step uses dflook/terraform-plan; the only hook is tf_pre_run, evaluated inside the action before Terraform runs.
  • .github/workflows/tf-apply.yaml (tf-apply-v0): the same for dflook/terraform-apply.

Why it matters

In DND-IT/tamedia-ai-platform, a version promotion only changes one pin in a stack's environments/<env>.tfvars, but every apply refreshes the whole stack (stacks/agentcore, about 150 resources and modules), which is most of a 3 to 14 minute run. Skipping the refresh for pin-only changes would cut that substantially. See DND-IT/tamedia-ai-platform#541 for the rest of the promotion speed-up.

Suggested fix

Add an optional input, e.g. tf_cli_args, to both workflows and pass it through to the plan and apply, either as an action input if dflook/terraform-plan / terraform-apply support one, or as TF_CLI_ARGS_plan / TF_CLI_ARGS_apply in the step environment. Check that dflook/terraform-apply's comparison against the pull request's plan still matches when both sides skip the refresh.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions