Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit 15b52e7

Browse files
committed
terraform: add version wrapper
Adds a wrapper function in order to support a specific older TF version
1 parent 0c42ffe commit 15b52e7

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

terraform/terraform

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,30 @@
88

99
set -eu
1010

11+
# Wrapper for a specific Terraform version, as currently it's using an older version
12+
TOP=$(pwd)
13+
14+
update_terraform()
15+
{
16+
export TFVERS=0.11.15
17+
export PATH=$TOP/.bin:$PATH
18+
if [ ! -x $TOP/.bin/terraform_${TFVERS} ]
19+
then
20+
(
21+
mkdir -p $TOP/.bin/
22+
cd $TOP/.bin
23+
wget -q https://releases.hashicorp.com/terraform/${TFVERS}/terraform_${TFVERS}_linux_amd64.zip
24+
unzip -o terraform_${TFVERS}_linux_amd64.zip
25+
mv terraform terraform_${TFVERS}
26+
chmod a+x terraform_${TFVERS}
27+
ln -sf terraform_${TFVERS} terraform
28+
rm terraform_${TFVERS}_linux_amd64.zip
29+
)
30+
fi
31+
}
32+
33+
update_terraform
34+
1135
environment=$1
1236
re="^(testing|staging|production|shared)$"
1337
if [[ ! $environment =~ $re ]]

0 commit comments

Comments
 (0)