Skip to main content

Mimiron a CLI tool whose purpose is to be the glue between your tfvars and Terraform config.

Project description

# Mimiron

[![Build Status](](
[![PyPI version](](

**Welcome to mimiron!**

> [Mimiron]( is one of the Titanic Watchers. He once resided at the Temple of Invention, but is absent during the time of Loken's rebellion.

Mimiron a CLI tool whose purpose is to be the glue between your tfvars and Terraform config.

When all of your Terraform config is completely modular, the only sane way to manage variables is to store them inside a `variables.tfvars` file and pass that along when you run `terraform apply`... but where do you store `variables.tfvars`?

Our MVP approach is to store variables inside a separate git repository. Inside the Terraform deployments repo, create a link between the two via `git submodules`, making sure to specify the commit SHA.

This approach is super simple and works but it can be quite cumbersome when you want to make updates. Mimiron provides a few commands to help automate the cumbersome tasks away.

## Installation

$ pip install mimiron

You also need to specify a few environment variables to let Mimiron know where your terraform and tfvar repos are located:

export TF_DEPLOYMENT_PATH="~/workspace/terraform"
export TF_VARS_STAGING_PATH="~/workspace/tfvars-staging"
export TF_VARS_PRODUCTION_PATH="~/workspace/tfvars-prod"
export DOCKER_ORG=""
export EDITOR="vi"

## Usage

>>> mim --help

mim deploy [<artifact>|<service>] [<env>]
mim set-sha <env> [--no-push]
mim set-var <env>
mim sync
mim edit <env>

deploy update ami/sha and auto-deploy after update
set-sha update tfvars commit sha in deployments and push to remote
set-var commit and pushes tfvars for <env> based on changes found
sync calls git fetch on all associated git repos
edit opens the tfvar config in the default editor

<artifact> the deployment artifact we are pushing (e.g. Docker image/AMI)
<service> the application/microservice we're targeting
<env> the environment we want to change

--no-push make local changes without pushing to remote

-h --help shows this
-v --version shows version

**Example workflows:**

$ mim sync
$ mim edit staging
$ mim set-var staging
$ mim set-sha staging

$ mim sync
$ mim deploy

$ mim sync
$ mim deploy my-service

$ mim sync
$ mim set-var staging
$ mim set-sha staging --no-push
$ git add . -A
$ git commit --amend --no-edit
$ git push

## Development

Clone the project:

$ git clone

Setup your virtualenv:

$ mkvirtualenv mimiron

Attach mim to your shell:

$ python develop

## Deployment

Create a `~/.pypirc` and replace the username and password with real credentials:

index-servers =


Register this package to the Cheeseshop:

$ python register -r mimiron

Build a distributable and upload:

$ python sdist upload -r mimiron

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for mimiron, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size mimiron-0.1.2.tar.gz (8.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page