Terraform é uma ferramenta IaC (infraestrutura como código) de código aberto que fornece um fluxo de trabalho consistente na CLI para gerenciar centenas de serviços em nuvem. Terraform converte APIs de nuvem em arquivos de configuração declarativos.
, , , . Terraform, , .

. .
. . — . Terraform .
Terraform — IaC, , .
.
— 1
terraform.tfvars. , .
. , . outputs.tf, providers.tf, variables.tf . . terraform : init, plan, apply
.
( 1)
:
- ,
- .
:
- ;
- , .
— 2
, terraform.tfvars. , .
main.tf variables.tf , terraform . , , :
// Dev Environment terraform plan --var-file="tfvars/environment/dev.tfvars" // QA Environment terraform plan --var-file="tfvars/environment/qa.tfvars" // Prod Environment terraform plan --var-file="tfvars/environment/prod.tfvars"
( 2)
:
- ;
- , .
:
- ;
- , .
Terraform default. , , , . , , default.
terraform workspace
. . , terraform workspace new
.
— , . Terraform — root-. Root- , .tf .
, . , . , .
. , .
Terragrunt
Terragrunt — , DRY , Terraform .
- Terraform — - IaC, CLI .
- , , , .
- Terraform.
- — . .
- Terraform default. , , , .
- — , . , .
- Terragrunt — , DRY , Terraform .
, Terraform. . .