•  


GitHub - tkh/terragrunt-reference-architecture: Terragrunt Reference Architecture
Skip to content

tkh/terragrunt-reference-architecture

 
 

Repository files navigation

Acme's Infrastructure - Terragrunt Reference Architecture

This repository contains rather complete infrastructure configurations where Terragrunt is used to manage infrastructure for Acme Corporation .

By the way!

This code is very close to the one produced by modules.tf - open-source infrastructure as code generator from visual diagrams created with Cloudcraft.co .

Introduction

Acme has several environments (prod, staging and dev) entirely separated by AWS accounts.

Infrastructure in each environment consists of multiple layers (autoscaling, alb, vpc, ...) where each layer is configured using one of Terraform AWS modules with arguments specified in terraform.tfvars in layer's directory.

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

Environments

Primary AWS region for all environments is eu-central-1 (Frankfurt) :

  • acme-prod - Production configurations (AWS account - 111111111111)

  • acme-staging - Staging configurations (AWS account - 444444444444)

  • acme-master - Master AWS account (333333333333) contains:

    • AWS Organizations
    • IAM entities (users, groups)
    • ECR repositories
    • Route53 zones

Pre-requirements

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

$ brew install terraform terraform-docs terragrunt pre-commit direnv
$ brew install https://raw.githubusercontent.com/antonbabenko/tfvars-annotations/master/HomebrewFormula/tfvars-annotations.rb

AWS accounts and IAM relations

Acme has dedicated AWS account where IAM users, groups and roles are managed. This AWS account is used as a jump account, where IAM users are logged in and then they assume role in other AWS account.

AWS access credentials should be set using environment variables:

$ export AWS_DEFAULT_REGION=eu-central-1
$ export AWS_ACCESS_KEY_ID=...
$ export AWS_SECRET_ACCESS_KEY=...

aws-vault , vaulted or other tool can be used to manage your AWS credentials securely locally and switch roles.

How to use it?

Go to directory for the environment and region you want to work with:

$ cd acme-staging/eu-central-1

Initialize the dependencies (download providers and modules). This command is enough to run once:

$ terragrunt init

To create infrastructure in all layers in a single region:

$ terragrunt apply-all

Alternatively, you can create infrastructure in a single layer (eg, vpc ):

$ cd vpc
$ terragrunt apply

See official Terragrunt documentation for all available commands and features.

Authors

This project is created and maintained by Anton Babenko .

Maintained by Anton Babenko @antonbabenko

License

This work is licensed under MIT License. See LICENSE for full details.

Copyright (c) 2019 Anton Babenko

About

Terragrunt Reference Architecture

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HCL 98.7%
  • Shell 1.3%
- "漢字路" 한글한자자동변환 서비스는 교육부 고전문헌국역지원사업의 지원으로 구축되었습니다.
- "漢字路" 한글한자자동변환 서비스는 전통문화연구회 "울산대학교한국어처리연구실 옥철영(IT융합전공)교수팀"에서 개발한 한글한자자동변환기를 바탕하여 지속적으로 공동 연구 개발하고 있는 서비스입니다.
- 현재 고유명사(인명, 지명등)을 비롯한 여러 변환오류가 있으며 이를 해결하고자 많은 연구 개발을 진행하고자 하고 있습니다. 이를 인지하시고 다른 곳에서 인용시 한자 변환 결과를 한번 더 검토하시고 사용해 주시기 바랍니다.
- 변환오류 및 건의,문의사항은 juntong@juntong.or.kr로 메일로 보내주시면 감사하겠습니다. .
Copyright ⓒ 2020 By '전통문화연구회(傳統文化硏究會)' All Rights reserved.
 한국   대만   중국   일본