Skip to content

calebHankins/lapis-lazuli

Repository files navigation

lapis-lazuli

GitHub Actions Version

This project aims to provide a thin wrapping container around cloud infrastructure and kubernetes management tools.

For cloud infrastructure, primarily focusing on enabling: HashiCorp's Terraform, Gruntwork.io's terragrunt, and the aws-cli.

For k8s support: helm, kubectl, eksctl.

Build

Run these commands from the same folder as this readme. Tweak the Dockerfile to meet your needs.

# Build w/ project defaulted tool versions
docker build --pull --rm -t lapis-lazuli .

There are also hooks for specifying specific base images and tool versions, check out the Dockerfile for available build args.

# Build for the latest released terraform version
docker build --pull --rm --build-arg BASE_IMAGE=hashicorp/terraform:latest -t lapis-lazuli .

Pre-Built

A pre-built version can also be pulled from docker hub:

docker pull calebhankins/lapis-lazuli
docker tag  calebhankins/lapis-lazuli lapis-lazuli

A Note Concerning Self-Signed Certificates

If you are in a corporate env or for some other reason have self-signed certificates in your chain, the tools will fail with SSL errors. To mitigate this, the build will ping a site over ssl and trust the certs in the chain. If you wish to not do this, comment out the 'Trust self-signed certs' code in the Dockerfile prior to building.

If you pulled from docker hub instead of building, you may need to run the code related to self-signed certs after starting your image to trust your self-signed certs.

Run

# Explore
docker run --rm -it lapis-lazuli
# / # terragrunt --version
# terragrunt version v0.23.23

More involved example, execute a particular tool using an env file and mounts:

# Load an env file that contains key=val pairs needed for Terragrunt
# Mount the current working directory as '/workspace' in the container
# Set the current working directory in the container to be '/workspace'
# Set the entrypoint app to be 'terragrunt'
# Run the image tagged as 'lapis-lazuli'
# Supply the entrypoint app (terragrunt) with the command line options '...'
docker run --rm -it \
--env-file ~/terragrunt_envs/sampleEnv.env
-v ~/terragrunt_envs:/root/terragrunt_envs \
-v $(pwd):/workspace \
--workdir /workspace \
--entrypoint terragrunt \
lapis-lazuli \
plan -out ./plans/sampleEnv_tf -var-file='/root/terragrunt_envs/sampleEnv.tfvars'