From 9ebf7fbd351998c6350b646fe63b47be718c936d Mon Sep 17 00:00:00 2001 From: spengreb Date: Wed, 12 Jun 2019 11:58:25 +0200 Subject: [PATCH 1/2] Upgrade to terraform 12.1 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a59771c..874d43b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM ubuntu:xenial RUN apt-get update -y && apt-get install -y python3 wget unzip git -RUN wget -O /tmp/terraform.zip https://releases.hashicorp.com/terraform/0.12.0/terraform_0.12.0_linux_amd64.zip +RUN wget -O /tmp/terraform.zip https://releases.hashicorp.com/terraform/0.12.1/terraform_0.12.1_linux_amd64.zip RUN unzip /tmp/terraform.zip RUN mv terraform /usr/bin/ From 85b111328059f833871c2538871297026ed27244 Mon Sep 17 00:00:00 2001 From: spengreb Date: Fri, 26 Jul 2019 11:58:27 +0200 Subject: [PATCH 2/2] Update readme --- README.md | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8559cea..f0486fb 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,19 @@ Atmos is a thin wrapper for managing Terraform Workspaces easily. Using the work # Quick Start +## Local Use + +Atmos requires terraform to be installed on your system. + +- Clone this atmos project +- Symlink atmos.py to your /usr/bin/ `$ ln -s $(pwd)/atmos.py /usr/bin/atmos` +- Set up your `~/.aws/credentials` to include a `[default]` stanza which is where your S3 backend storage is. +- Setup other stanzas in your credentials file for each environment you want. For example `[dev]` with your dev account IAM credentials +- You can also setup environment variables and use the -e flag. See below for more. +- Use `$ atmos apply/plan/destroy` to run terraform apply whilst maintaining environment context + +## CI/DE + - Build the atmos image - Use atmos as the build image in your CI/CD - Include switching/creating terraform workspaces @@ -73,4 +86,24 @@ This requires a `shared_credentials_file` variable on the top level. To support # atmos -m -Adding `-m` flag will set to manual mode. It will not try to automatically switch workspace per branch. It will adhere to whatever you last set the workspace to. \ No newline at end of file +Adding `-m` flag will set to manual mode. It will not try to automatically switch workspace per branch. It will adhere to whatever you last set the workspace to. + +# atmos -p + +Adding `-p` flag will set the project prefix when looking for credentials. + +Example: +` $ atmos -e -p PROJ plan` + +Will make atmos look for environment vars with the prefix 'VER' selecting the following env vars. + +``` +PROJ_DEV_ACCESS_KEY_ID +PROJ_DEV_SECRET_ACCESS_KEY +``` + +Note this also works on the `.aws/credentials` file + +# atmos -v + +Verbose output mode, will show the vars atmos has selected and some environment context \ No newline at end of file