How Gruntwork Pipelines works in a multi-account, multi-region model with terragrunt? #416
-
|
Hello, I am trying to understand how the gruntwork pipelines framework will interact with an AWS multi-account, multi-region topology.
This decentralized model sounds great but leads me to some questions. Considering that we have the live repository with Let's say we have the following structure: .
└── live
├── sandbox-account-backend # <---- Where my microservices are *deployed*
│ ├── _global
│ │ └── iam
│ ├── eu-west-1
│ │ ├── eks
│ │ └── mgmt
│ │ ├── ecs-deploy-runner # <---- My multi-region module for this account
│ │ └── networking
│ │ └── vpc
│ └── eu-west-3
│ ├── eks
│ └── mgmt
│ └── networking # <---- Still needed as we don't have a "multi-region" module for VPC Mgmt
│ └── vpc
├── sandbox-account-networking
│ ├── _global
│ │ ├── dns
│ │ └── iam
│ ├── eu-west-1
│ │ ├── apigateway # <---- Where my microservices are *exposed*
│ │ └── mgmt
│ │ ├── ecs-deploy-runner
│ │ └── networking
│ │ └── vpc
│ └── eu-west-3
│ ├── apigateway
│ └── mgmt
│ └── networking
│ └── vpc
└── shared
└── eu-west-1
├── _regional
│ └── ecr-repos
└── mgmt
├── ecs-deploy-runner
└── networkingLet's consider I create a new PR modifying the EKS cluster in Which |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
The primary way to handle this is by routing with a lookup table and using heuristics with the folder structure to guide you on which entry in the table to get. For example, in the Reference Architecture, we handle this by checking for all the terragrunt folders that changed (in this line), and then for each one, extracting out the first folder in the path and using that to lookup the AWS Account ID that corresponds to the folder by matching the folder name to the entry in the accounts.json file, and then using the ID to construct the IAM Role ARN to assume and assume that (see this function). We are not very familiar with the GitLab OIDC integration for assuming a role, but presumably you can use similar logic to identify the IAM Role you need to assume in the workflow, and then extract that out as a step output to feed into the OIDC mechanism. Hope this helps! |
Beta Was this translation helpful? Give feedback.
The primary way to handle this is by routing with a lookup table and using heuristics with the folder structure to guide you on which entry in the table to get.
For example, in the Reference Architecture, we handle this by checking for all the terragrunt folders that changed (in this line), and then for each one, extracting out the first folder in the path and using that to lookup the AWS Account ID that corresponds to the folder by matching the folder name to the entry in the accounts.json file, and then using the ID to construct the IAM Role ARN to assume and assume that (see this function).
We are not very familiar with the GitLab OIDC integration for assuming a role, but presumably yo…