How do I modify the for-production infrastructure-live example for a single-account setup? Do I need an accounts.hcl? #21
-
This message was extracted from a discussion that originally took place in Gruntwork Community Slack. Names and URLs have been removed where appropriate From a customer Hey guys, There was a technical issue I was wondering about: The reason I ask is because it seems weird for me to save what my account numbers are (which feels like state), in a code repo. It feels weird both on a security side (but im a novice there) and also from a separation of code and data side. What are your recommendations? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
From a grunt The That is, This is also used in the infra CI/CD pipeline in a similar manner, to ensure the CI server authenticates to the right account (since assume role requires knowing the ARN, which requires knowing the account ID). |
Beta Was this translation helpful? Give feedback.
From a grunt
The
accounts.hcl
is actually a guard rail to ensure you don’t accidentally touch the wrong account. Since there is no way for terragrunt to know from the code if you are authenticated to the right/intended account, we need to tell it which account which folders should apply to.That is,
terragrunt
uses this information to construct theaws
provider blocks in a way that tells terraform to make sure when one applies to thedev
account, they are actually authenticated to thedev
account.This is also used in the infra CI/CD pipeline in a similar manner, to ensure the CI server authenticates to the right account (since assume role requires knowing the ARN, which requires knowing …