From 849ce3937659e271fd2ad246322ece1fdbd380e4 Mon Sep 17 00:00:00 2001 From: Thierry de Pauw Date: Wed, 2 Feb 2022 14:24:41 +0100 Subject: [PATCH] Bump terraform to v1.1.4 and tflint to v0.34.1 (#2) --- .tflint.hcl.source | 10 ++++++++++ Dockerfile | 12 +++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 .tflint.hcl.source diff --git a/.tflint.hcl.source b/.tflint.hcl.source new file mode 100644 index 0000000..913256a --- /dev/null +++ b/.tflint.hcl.source @@ -0,0 +1,10 @@ +config { + module = true + force = false +} + +plugin "aws" { + enabled = true + version = "${TFLINT_AWS_RULESET_VERSION}" + source = "github.com/terraform-linters/tflint-ruleset-aws" +} diff --git a/Dockerfile b/Dockerfile index 1b191be..5b9d789 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,9 @@ FROM alpine:3.13 ARG PLATFORM=linux_amd64 -ARG TF_VERSION=0.14.10 -ARG TFLINT_VERSION=0.20.3 +ARG TF_VERSION=1.1.4 +ARG TFLINT_VERSION=0.34.1 +ARG TFLINT_AWS_RULESET_VERSION=0.12.0 ARG TF_DIST_FILENAME="terraform_${TF_VERSION}_${PLATFORM}.zip" ARG TF_DIST_CHECKSUM_FILENAME="terraform_${TF_VERSION}_SHA256SUMS" @@ -13,6 +14,8 @@ LABEL org.opencontainers.image.description="Hashicorp Packer with Ansible" \ org.opencontainers.image.source="git@github.com:thinkinglabs/docker-terraform.git" \ org.opencontainers.image.licenses="MIT" +COPY .tflint.hcl.source /root/ + RUN wget https://releases.hashicorp.com/terraform/${TF_VERSION}/${TF_DIST_FILENAME} \ && wget https://releases.hashicorp.com/terraform/${TF_VERSION}/${TF_DIST_CHECKSUM_FILENAME} \ && set -o pipefail && grep ${PLATFORM} ${TF_DIST_CHECKSUM_FILENAME} | sha256sum -c - \ @@ -23,4 +26,7 @@ RUN wget https://releases.hashicorp.com/terraform/${TF_VERSION}/${TF_DIST_FILENA && set -o pipefail && grep ${PLATFORM} checksums.txt | sha256sum -c - \ && unzip tflint_${PLATFORM}.zip -d /usr/local/bin \ && rm tflint_${PLATFORM}.zip checksums.txt \ - && apk update && apk --no-cache add make + && apk update && apk --no-cache add make gettext \ + && envsubst < /root/.tflint.hcl.source > /root/.tflint.hcl \ + && tflint --init \ + && apk del gettext