MauAraujo / terraform-example

DRY, multi-environment Terraform configuration sample, using Terragrunt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

terraform-example

This repo is my own implementation of the architecture found on Terraform: Up & Running. I made changes based on my own ideas and personal experience working with Terraform.

This repo leverages Terragrunt to avoid code repetition, and to create a multi-environment configuration that is maintainable, and not too cumbersome or difficult to understand.

The code is divided in live and modules directories. The ideal structure would be to keep them in separate repositories so that the code found in modules can be versioned and pulled by the live repository. However, for simplicity I will keep them together in this repo.

Architecture

This is a simple example that serves an API server on an Auto-Scaling group, and uses RDS for a postgresql database with a Redis cluster for caching frequently accessed data. The implementation details are left out since this is an architecture exercise.

image

Usage

For deploying the infrastructure found in this repo:

  1. Install Terragrunt
  2. Install the AWS CLI and setup your account
  3. Clone this repository
  4. Run cd live && terragrunt run-all apply --terragrunt-source ~/repo-location/modules

About

DRY, multi-environment Terraform configuration sample, using Terragrunt

License:GNU General Public License v3.0


Languages

Language:HCL 100.0%