Skip to content

Install Terraform

Actions
Installs any version of terraform to the current job environment
v2.0.0
Latest
Star (8)

install-terraform

Install Terraform to a Github Actions job environment.

GitHub Actions status

Usage

Pre-requisites

Create a workflow .yml file in your repositories .github/workflows directory. An example workflow is available below. For more information, reference the GitHub Help Documentation for Creating a workflow file.

Inputs

  • version: The version of terraform to install. Required.

Outputs

None.

Example workflow

name: Example installing Terraform

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [12.x]

    steps:
    - uses: actions/checkout@v1
    - name: Install Terraform
      uses: little-core-labs/install-terraform@v2.0.0
      with:
          version: 0.13.4
    - name: Terraform apply
      run: |
        terraform init
        terraform plan
        terraform apply -auto-approve

FAQ

Can you offer a major version tag/branch alias? I want automatic updates!

Nope! This was always weird/bad pattern of github actions. Luckily github offers a solution for this. Create a .github/dependabot.yml with, at a minimum, the following config:

# Basic dependabot.yml file with
# minimum configuration for two package managers

version: 2
updates:
  # Enable updates to github actions
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "daily"

License

The scripts and documentation in this project are released under the MIT License

Install Terraform is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Installs any version of terraform to the current job environment
v2.0.0
Latest

Install Terraform is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.