Skip to content
hannctl
PDF

field-notes E7-terragrunt-dry-iac.md

E7 · Com2us Platform · Feb 2023 – Feb 2026

One codebase instead of copied infrastructure code

Moved live infrastructure into code, removed duplication, and cut deployment time 40%

  • Terraform
  • Terragrunt
  • IaC
  • AWS
  • GCP
  • -40% deploy time

Summary

Moved live infrastructure into code and replaced copied Terraform with a shared Terragrunt structure, cutting deployment time 40%.
TerraformCopied codeTerraformCopied codeTerraformCopied codeTerraformCopied codeTerraformCopied codeTerraformCopied codeNeeds fixNeeds fixNeeds fixNeeds fixNeeds fixEditedCommon moduleSecurity defaultsdevDifferencesstgDifferencesprodDifferences-40%
The clock at the bottom shrinks: -40%.

Background

I moved live infrastructure, including StarSeed: Asnia Trigger (AWS, 50 servers and 20 databases), into IaC (managing infrastructure as code).

The same restructuring was applied to the Summoners War: Sky Arena environment.

Problem

Each environment (dev, staging, production) and each game used nearly identical Terraform code, copied by hand.

One change meant editing many places, and settings slowly drifted apart between environments.

What I did

I restructured the code with Terragrunt (a tool for reusing Terraform across environments without repetition).

  • Shared modules and common settings (state storage location, cloud connection settings) are inherited from one place
  • Each environment keeps only what differs

Structure example (for illustration)

infra/
├── modules/                 # shared modules (with security defaults)
│   ├── network/
│   ├── security-group/
│   └── server/
├── terragrunt.hcl           # common settings (state location, etc.)
└── game-a/
    ├── dev/
    │   └── terragrunt.hcl   # only what differs in dev
    ├── stg/
    │   └── terragrunt.hcl
    └── prod/
        └── terragrunt.hcl

Result

Deployment time dropped 40%.

A security default added to a shared module now applies to every environment at once.

Links

© 2026 Kim JunHyun · Built with Astro · The infrastructure behind this site is code too

↑↓ move · Enter open · Esc close

Choose a theme

Click a badge to switch to that theme on the same content. Dragging only swings it.

Back to the front page →