Giter Site home page Giter Site logo

tamsky / terrabase Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 93 KB

Terrabase combines terragrunt with terraform in an opinionated way to allow the creation and re-use of application blueprints across environments, with many options at each layer to inject overrides and new values.

License: BSD 3-Clause "New" or "Revised" License

HCL 68.28% Makefile 11.33% Shell 20.40%

terrabase's Introduction

Quick overview

Per-account directory layout:

[email protected]=123456789012/:

  • account-specific resources are placed within an AWS account directory.
  • directory’s name is the root account email + “=” + 12-digit AWS account number.
  • Per-account directories track both the account # and the root email address, because, when combined, it provides a unique identifier for an AWS account. (AWS does not enforce a global uniqueness requirement on the root account’s email addresses.)

Example/test usage of this repository and layout:

# cd terrabase/[email protected]=123456789012/prod/core
# make plan
[ plan output ]
# make apply-saved-plan
[ apply output ]

Examining //[email protected]=123456789012/prod/core, we can see there are very few unique files:

# ls -l [email protected]=123456789012/prod/core

lrwxr-xr-x  1 user  group   11 Jun 10  2018 Makefile@ -> ../Makefile
lrwxr-xr-x  1 user  group   22 Apr 10 01:54 environment.tf.json@ -> ../environment.tf.json
lrwxr-xr-x  1 user  group   39 Apr 10 01:54 global-global-remote-state.tf@ -> ../../global/global/lib/remote-state.tf
lrwxr-xr-x  1 user  group   36 Apr 10 01:54 global-iam-remote-state.tf@ -> ../../global/iam/lib/remote-state.tf
lrwxr-xr-x  1 user  group   40 Apr 10 01:54 global-route53-remote-state.tf@ -> ../../global/route53/lib/remote-state.tf
drwxr-xr-x  6 user  group  192 Apr 10 01:54 key_pairs/
lrwxr-xr-x  1 user  group   18 Jun 10  2018 requirements.tf@ -> ../requirements.tf
-rw-r--r--  1 user  group  184 Apr 10 01:54 terraform.tfvars

All state is derived from:

# cat terraform.tfvars 
terragrunt = {
    include = {
        path = "../terragrunt-${get_env("USE_LOCAL_SOURCE","default")}-config.tfvars"
    }
    dependencies = {
        paths = [ "key_pairs" ]
    }
}

Which includes the terragrunt file via ../terragrunt-default-config.tfvars:

terraform {
    # Deploy from github repo, 'master' branch:
    source = "git::[email protected]:tamsky/terrabase//aws-blueprints/${path_relative_to_include()}?ref=master"

}

Which imports all files in //terrabase/aws-blueprints/core.

Helpers

  • ./tf (helper script wrapper for ‘terraform’)
  • ./lib (Makefile library files used by all environments)

This README is meant as an introduction, not complete documentation of this framework.

terrabase's People

Contributors

tamsky avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.