Skip to content

Latest commit

 

History

History
71 lines (45 loc) · 2.96 KB

README.md

File metadata and controls

71 lines (45 loc) · 2.96 KB

Infrastructure code for "arscrift"

This repository contains infrastructure as Terraform configurations.

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. Overview
  2. Quick start
  3. Configure access to AWS account
  4. Create and manage your infrastructure
  5. References

Overview

Infrastructure overview

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=us-east-1
$ export AWS_ACCESS_KEY_ID=...
$ export AWS_SECRET_ACCESS_KEY=...

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

Create and manage your infrastructure

Infrastructure consists of multiple layers (rds, autoscaling_2, autoscaling_1, ...) 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 us-east-1
$ terragrunt apply-all
  • As a single layer (faster&granular). Run this command to create infrastructure in a single layer (eg, rds):
$ cd us-east-1/rds
$ terragrunt apply

After the confirmation your infrastructure should be created.

References

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