Skip to content

Creates a Terratest Docker Container for running Terratest

License

Notifications You must be signed in to change notification settings

austincloudguru/docker-terratest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-terratest

CI

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

Building the Container

Checkout the repository.

git clone git@github.com:austincloudguru/docker-terratest

Build the Docker Image:

 docker build -t austincloud/terratest .

Usage:

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

Authors

Module is maintained by Mark Honomichl.

License

MIT Licensed. See LICENSE for full details

About

Creates a Terratest Docker Container for running Terratest

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages