Giter Club home page Giter Club logo

terraform-terragrunt-skeleton's Introduction

terraform-terragrunt-skeleton pre-commit

This repository implements a skeleton repository for teams to use when first getting started with terraform. It uses terragrunt as a workflow tool.

For a step-by-step guide for how this repo was built, the why behind it, and how to use it, see this blog series:

https://thirstydeveloper.io/series/tf-skeleton

Prerequisites

You will need:

  1. An AWS account for storing remote state in S3
  2. An IAM user in that account with
    1. Administrative access
    2. An IAM user tag of Terraformer set to Admin
  3. Credentials for the above IAM user configured in the terminal used for running terraform and terragrunt commands

If you prefer to work from a very basic version of this skeleton that instead uses the local filesystem backend, use branch release/1.1.

This project uses:

  • tfenv for managing terraform versions
  • tgenv for managing terragrunt versions
  • pre-commit for running syntax, semantic, and style checks on git commit

After installing those tools run tfenv install and tgenv install from the clone of this repository to install the configured versions of terraform and terragrunt. Then, run pre-commit install to install the pre-commit hooks.

Initialization

  1. Create an AWS credentials profile named tf-admin-account
  2. Run make init-admin to deploy a CloudFormation stack to that account containing the infrastructure terraform needs to run

Usage

Run terragrunt commands from directories under deployments/ containing terragrunt.hcl files.

terragrunt *-all commands can be run from the repository root, or the deployments/ and any directory underneath it. For instance:

  • Run terragrunt plan-all from the repository root to generate terraform plans for all deployments.
  • Run terragrunt plan-all from deployments/app/dev to generate plans for all app/dev deployments.

For additional guidance, see the companion blog series:

https://thirstydeveloper.io/series/tf-skeleton

terraform-terragrunt-skeleton's People

Contributors

thirstydeveloper 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.