This repository contains a GitHub action that sets up all the tooling required for running Terraform in CDS CI/CD flows.
It currently download the following tool version, although each can be overriden with an environment variable:
Tool | Version | ENV name |
---|---|---|
conftest | 0.36.0 | CONFTEST_VERSION |
terraform | 1.3.6 | TERRAFORM_VERSION |
terragrunt | 0.42.5 | TERRAGRUNT_VERSION |
TF Summarize | 0.2.3 | TF_SUMMARIZE_VERSION |
To use the action you can invoke it in the following way:
on: [push]
jobs:
my_ci_flow:
runs-on: ubuntu-latest
steps:
- name: setup terraform tools
uses: cds-snc/terraform-tools-setup@v1
env: # In case you want to override default versions
CONFTEST_VERSION: 0.30.0
TERRAFORM_VERSION: 1.1.7
TERRAGRUNT_VERSION: 0.36.3
TF_SUMMARIZE_VERSION: 0.2.3
To test the script you can run ./test_script.sh
.
If you would like to update the default versions, you need to update the following lines in both get_tools.sh
and test_script.sh
CONFTEST_VERSION="${CONFTEST_VERSION:-0.30.0}"
TERRAFORM_VERSION="${TERRAFORM_VERSION:-1.1.7}"
TERRAGRUNT_VERSION="${TERRAGRUNT_VERSION:-0.36.3}"
TF_SUMMARIZE_VERSION="${TF_SUMMARIZE_VERSION:-0.2.3}"