Skip to content
This repository was archived by the owner on May 6, 2020. It is now read-only.
This repository was archived by the owner on May 6, 2020. It is now read-only.

Run terraform apply with terraform plan output file #105

@alexbde

Description

@alexbde

I try to run terraform apply using output file from terraform plan. How could this be done?

Prerequisite: terraform plan -out example.tfplan.

Running

  - uses: hashicorp/terraform-github-actions@master
    env:
      TF_CLI_ARGS_apply: example.tfplan
      TF_LOG: TRACE
    with:
      tf_actions_version: ${{ env.TF_VERSION }}
      tf_actions_subcommand: 'apply'

Causes error Too many command line arguments. Configuration path expected.

In TRACE log I can see cause for this error is

[INFO] TF_CLI_ARGS_apply value: "example.tfplan"
[INFO] CLI command args: []string{"apply", "example.tfplan", "-auto-approve", "-input=false"}

example.tfplan must be last argument but TF_CLI_ARGS_apply sets it first (as stated in the docs).

How can I achieve running terraform apply with input file example.tfplan via GitHub Actions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions