Terraform Best Practices
Terraform consultingTwitter @antonbabenkoTerraform Weekly
English
English
  • Welcome
  • Key concepts
  • Code structure
  • Code structure examples
    • Terragrunt
    • Terraform
      • Small-size infrastructure with Terraform
      • Medium-size infrastructure with Terraform
      • Large-size infrastructure with Terraform
  • Naming conventions
  • Code styling
  • FAQ
  • References
  • Writing Terraform configurations
  • Workshop
Powered by GitBook
On this page
  • Terraform code structures
  • Terragrunt code structures
Export as PDF

Code structure examples

PreviousCode structureNextTerragrunt

Last updated 3 years ago

Terraform code structures

These examples are showing AWS provider but the majority of principles shown in the examples can be applied to other public cloud providers as well as other kinds of providers (DNS, DB, Monitoring, etc)

Type
Description
Readiness

Few resources, no external dependencies. Single AWS account. Single region. Single environment.

Yes

Several AWS accounts and environments, off-the-shelf infrastructure modules using Terraform.

Yes

Many AWS accounts, many regions, urgent need to reduce copy-paste, custom infrastructure modules, heavy usage of compositions. Using Terraform.

WIP

very-large

Several providers (AWS, GCP, Azure). Multi-cloud deployments. Using Terraform.

No

Terragrunt code structures

Type
Description
Readiness

medium

Several AWS accounts and environments, off-the-shelf infrastructure modules, composition pattern using Terragrunt.

No

large

Many AWS accounts, many regions, urgent need to reduce copy-paste, custom infrastructure modules, heavy usage of compositions. Using Terragrunt.

No

very-large

Several providers (AWS, GCP, Azure). Multi-cloud deployments. Using Terragrunt.

No

small
medium
large