Skip to content

Instantly share code, notes, and snippets.

@kjlape
Created May 27, 2017 21:44
Show Gist options
  • Select an option

  • Save kjlape/ddbb428379e5f8508d6f92debffb478a to your computer and use it in GitHub Desktop.

Select an option

Save kjlape/ddbb428379e5f8508d6f92debffb478a to your computer and use it in GitHub Desktop.
Docker container to validate a terraform config with multiple/nested modules
version: "3"
services:
validate:
build: .
working_dir: /src
volumes:
- ".:/src"
FROM hashicorp/terraform:light
MAINTANER "Kaleb Lape <[email protected]>"
RUN apk add --update bash
ENTRYPOINT bash -c 'find . -type f -name "*.tf" -print0 | xargs -0 -n 1 dirname | sort | uniq | xargs -t -n 1 terraform validate'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment