Skip to content

DRY, multi-environment Terraform configuration sample, using Terragrunt

License

Notifications You must be signed in to change notification settings

MauAraujo/terraform-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages