Skip to content

Commit 7efd408

Browse files
authored
fix: revert module Terraform 0.13.x version upgrade (#186)
1 parent 1318e24 commit 7efd408

File tree

10 files changed

+65
-31
lines changed

10 files changed

+65
-31
lines changed

.github/workflows/pre-commit.yml

+56-16
Original file line numberDiff line numberDiff line change
@@ -7,55 +7,95 @@ on:
77
- master
88

99
jobs:
10-
getBaseVersion:
11-
name: Get min/max versions
12-
runs-on: ubuntu-latest
10+
# Min Terraform version(s)
11+
getDirectories:
12+
name: Get root directories
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
- name: Install Python
18+
uses: actions/setup-python@v2
19+
- name: Build matrix
20+
id: matrix
21+
run: |
22+
DIRS=$(python -c "import json; import glob; print(json.dumps([x.replace('/versions.tf', '') for x in glob.glob('./**/versions.tf', recursive=True)]))")
23+
echo "::set-output name=directories::$DIRS"
24+
outputs:
25+
directories: ${{ steps.matrix.outputs.directories }}
1326

27+
preCommitMinVersions:
28+
name: Min TF validate
29+
needs: getDirectories
30+
runs-on: ubuntu-latest
31+
strategy:
32+
matrix:
33+
directory: ${{ fromJson(needs.getDirectories.outputs.directories) }}
1434
steps:
1535
- name: Checkout
1636
uses: actions/checkout@v2
37+
- name: Install Python
38+
uses: actions/setup-python@v2
39+
- name: Terraform min/max versions
40+
id: minMax
41+
uses: clowdhaus/[email protected]
42+
with:
43+
directory: ${{ matrix.directory }}
44+
- name: Install Terraform v${{ steps.minMax.outputs.minVersion }}
45+
uses: hashicorp/setup-terraform@v1
46+
with:
47+
terraform_version: ${{ steps.minMax.outputs.minVersion }}
48+
- name: Install pre-commit dependencies
49+
run: pip install pre-commit
50+
- name: Execute pre-commit
51+
# Run only validate pre-commit check on min version supported
52+
if: ${{ matrix.directory != '.' }}
53+
run:
54+
pre-commit run terraform_validate --color=always --show-diff-on-failure --files ${{ matrix.directory }}/*
55+
- name: Execute pre-commit
56+
# Run only validate pre-commit check on min version supported
57+
if: ${{ matrix.directory == '.' }}
58+
run:
59+
pre-commit run terraform_validate --color=always --show-diff-on-failure --files $(ls *.tf)
60+
1761

62+
# Max Terraform version
63+
getBaseVersion:
64+
name: Module max TF version
65+
runs-on: ubuntu-latest
66+
steps:
67+
- name: Checkout
68+
uses: actions/checkout@v2
1869
- name: Terraform min/max versions
1970
id: minMax
2071
uses: clowdhaus/[email protected]
2172
outputs:
2273
minVersion: ${{ steps.minMax.outputs.minVersion }}
2374
maxVersion: ${{ steps.minMax.outputs.maxVersion }}
2475

25-
preCommit:
26-
name: Pre-commit check
76+
preCommitMaxVersion:
77+
name: Max TF pre-commit
2778
runs-on: ubuntu-latest
2879
needs: getBaseVersion
2980
strategy:
3081
fail-fast: false
3182
matrix:
3283
version:
33-
- ${{ needs.getBaseVersion.outputs.minVersion }}
3484
- ${{ needs.getBaseVersion.outputs.maxVersion }}
35-
3685
steps:
3786
- name: Checkout
3887
uses: actions/checkout@v2
39-
4088
- name: Install Python
4189
uses: actions/setup-python@v2
42-
4390
- name: Install Terraform v${{ matrix.version }}
4491
uses: hashicorp/setup-terraform@v1
4592
with:
4693
terraform_version: ${{ matrix.version }}
47-
4894
- name: Install pre-commit dependencies
4995
run: |
5096
pip install pre-commit
5197
curl -L "$(curl -s https://api.github.com/repos/terraform-docs/terraform-docs/releases/latest | grep -o -E "https://.+?-linux-amd64" | head -n1)" > terraform-docs && chmod +x terraform-docs && sudo mv terraform-docs /usr/bin/
5298
curl -L "$(curl -s https://api.github.com/repos/terraform-linters/tflint/releases/latest | grep -o -E "https://.+?_linux_amd64.zip")" > tflint.zip && unzip tflint.zip && rm tflint.zip && sudo mv tflint /usr/bin/
53-
54-
- name: Execute pre-commit
55-
# Run only validate pre-commit check on min version supported
56-
if: ${{ matrix.version == needs.getBaseVersion.outputs.minVersion }}
57-
run: pre-commit run --color=always --show-diff-on-failure --all-files terraform_validate
58-
5999
- name: Execute pre-commit
60100
# Run all pre-commit checks on max version supported
61101
if: ${{ matrix.version == needs.getBaseVersion.outputs.maxVersion }}

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: git://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.46.0
3+
rev: v1.47.0
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_validate

README.md

+1-7
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ Depending on which SCM system you use, Github repositories or Gitlab projects ha
1717

1818
See `README.md` in `examples` for Github or Gitlab for complete details.
1919

20-
## Terraform versions
21-
22-
Terraform 0.12 or newer. Pin module version to `~> v2.0`. Submit pull-requests to `master` branch.
23-
24-
Terraform 0.11. Pin module version to `~> v1.0`.
25-
2620
### Before using Atlantis and the code in this repository please make sure that you have read and understood the security implications described in [the official Atlantis documentation](https://www.runatlantis.io/docs/security.html).
2721

2822
## How to use this?
@@ -166,7 +160,7 @@ allow_github_webhooks = true
166160

167161
| Name | Version |
168162
|------|---------|
169-
| terraform | >= 0.13 |
163+
| terraform | >= 0.12.26 |
170164
| aws | >= 2.68 |
171165
| random | >= 2.0 |
172166

examples/github-complete/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Go to https://eu-west-1.console.aws.amazon.com/ecs/home?region=eu-west-1#/settin
2929

3030
| Name | Version |
3131
|------|---------|
32-
| terraform | >= 0.13 |
32+
| terraform | >= 0.12.26 |
3333
| aws | >= 2.68 |
3434
| github | >= 2.4.1 |
3535

examples/github-complete/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
terraform {
2-
required_version = ">= 0.13"
2+
required_version = ">= 0.12.26"
33

44
required_providers {
55
aws = {

examples/github-repository-webhook/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Note that this example may create resources which cost money. Run `terraform des
2121

2222
| Name | Version |
2323
|------|---------|
24-
| terraform | >= 0.13 |
24+
| terraform | >= 0.12.26 |
2525
| aws | >= 2.68 |
2626
| github | >= 2.4.1 |
2727

examples/github-repository-webhook/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
terraform {
2-
required_version = ">= 0.13"
2+
required_version = ">= 0.12.26"
33

44
required_providers {
55
aws = {

modules/github-repository-webhook/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
| Name | Version |
77
|------|---------|
8-
| terraform | >= 0.13 |
8+
| terraform | >= 0.12.26 |
99
| github | >= 2.4.1 |
1010

1111
## Providers

modules/github-repository-webhook/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
terraform {
2-
required_version = ">= 0.13"
2+
required_version = ">= 0.12.26"
33

44
required_providers {
55
github = {

versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
terraform {
2-
required_version = ">= 0.13"
2+
required_version = ">= 0.12.26"
33

44
required_providers {
55
aws = {

0 commit comments

Comments
 (0)