Skip to content
Real demo (updated 5.11.2019)
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
web_app_reference_architecture_complete/eu-west-1 Updated pre-commit and hclfmt Nov 19, 2019
Web App Reference Architecture (complete).png

Infrastructure code for "Web App Reference Architecture (complete)"

This repository contains infrastructure as Terraform configurations which were automatically generated from blueprint created using

Original infrastructure

Web App Reference Architecture (complete)

Terragrunt is used to work with Terraform configurations which allows to orchestrate dependent layers, update arguments dynamically and keep configurations DRY.

Table of Contents

  1. Quick start
  2. Configure access to AWS account
  3. Create and manage your infrastructure
  4. References
  5. About

Quick start

  1. Install Terraform 0.12 or newer
  2. Install Terragrunt 0.19 or newer
  3. Optionally, install pre-commit hooks to keep Terraform formatting and documentation up-to-date.

If you are using macOS you can install all dependencies using Homebrew:

$ brew install terraform terragrunt pre-commit

Configure access to AWS account

The recommended way to configure access credentials to AWS account is using environment variables:

$ export AWS_DEFAULT_REGION=eu-west-1
$ export AWS_ACCESS_KEY_ID=...

Alternatively, you can edit common/ and use another authentication mechanism as described in AWS provider documentation.

Create and manage your infrastructure

Infrastructure consists of multiple layers (rds_2, rds_1, autoscaling_2, ...) where each layer is described using one Terraform module with inputs arguments specified in terragrunt.hcl in respective layer's directory.

Navigate through layers to review and customize values inside inputs block.

There are two ways to manage infrastructure (slower&complete, or faster&granular):

  • Region as a whole (slower&complete). Run this command to create infrastructure in all layers in a single region:
$ cd eu-west-1
$ terragrunt apply-all
  • As a single layer (faster&granular). Run this command to create infrastructure in a single layer (eg, rds_2):
$ cd eu-west-1/rds_2
$ terragrunt apply

After the confirmation your infrastructure should be created.


About is an open-source project by Anton Babenko, and, yes, you can contribute, too:

  1. Questions, bugs and feature-requests - open an issue.
  2. Become a sponsor to @antonbabenko.
  3. You are always welcome to share, star, like, tweet, follow!

@antonbabenko @antonbabenko

All content, including Terraform AWS modules used in these configurations, is released under the MIT License.

You can’t perform that action at this time.