gruntwork-io / terragrunt

Terragrunt is a flexible orchestration tool that allows Infrastructure as Code written in OpenTofu/Terraform to scale.
https://terragrunt.gruntwork.io/
MIT License
8.04k stars 975 forks source link

[feature] all in one yaml file #1098

Closed ozbillwang closed 4 years ago

ozbillwang commented 4 years ago

When I managed the terraform codes, terragrunt gives big help and make the task easy at project mode. But when start supporting these instruction as code, it is hard to manage multiple accounts easily, to get upgraded,especially the more than 50+ aws accounts in your lilst.

Because the file terraform.hcl are everywhere.

Could we have a single of truth to save all details in one file, such as a manifest.yaml

It could be like this:

cat manifest.yaml

_global: 
   key: value
account-1:
  dev:
    us-east-2
      vpc: 
         module: xxx
         version: xxxx
         variables: 
            cidr: xxx
           private_subnets: xxxx
       ecs:
         module: xxx
         version: xxxx
account-2:
  sit:
    us-east-2
      vpc: 
         module: xxx
         version: xxxx
         variables: 
            cidr: xxx
           private_subnets: xxxx
       eks:
         module: xxx
         version: xxxx

It will be better to support ${local.variable} in it.

yorinasub17 commented 4 years ago

I think you can achieve what you want by feeding the yaml through templatefile and then yamldecode in each child terragrunt.hcl config. If not, can you be more specific by specifying here what your ideal interface would be by providing a minimal desired terragrunt.hcl config structure?

ozbillwang commented 4 years ago

Good suggestion. I never used this new feature in terraform.

Let me take a try.