This repo contains a docker image used to test Terraform resources with Terratest. The container is run with the user
terratest, uid = 1000 so that any terraform related files are not created as root.
GoLang Version: 1.22
Terraform Version: Same as the docker tag
Checkout the repository.
git clone [email protected]:austincloudguru/docker-terratest
Build the Docker Image:
docker build -t austincloud/terratest .
You will need to pass the terraform directory to the container as well as AWS credentials. By default, the container assumes that tests are in the test
directory. If your tests are in a different directory, you can add the -w /go/src/app/$TEST_DIR
to your docker command.
Running it with AWS environmental variables
docker run --rm -it \
-v $PWD:/go/src/app \
--env-file <(env | grep "^AWS") \
austincloud/terratest go test -v
Running it using AWS credential files
docker run --rm -it \
-v $PWD:/go/src/app \
-v $(cd ~ && pwd)/.aws:/terratest/.aws \
-e AWS_PROFILE=dev \
austincloud/terratest go test -v
Module is maintained by Mark Honomichl.
MIT Licensed. See LICENSE for full details