You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have a different root prod/terragrunt.hcl and non-prod/terragrunt.hcl, each with different iam_role setting, that all the child modules include.
Have a single root terragrunt.hcl that uses generate to generate a provider block with an assume_role block within. The assume_role block can set role_arn to a variable, which in prod envs you set to a different value than non-prod envs.
I am making use of direnv (https://direnv.net) for which I create .envrc files in the different account folders. This is what I include: export TERRAGRUNT_IAM_ROLE=arn:aws:iam::ACCOUNTID:role/ROLE and other env variables as needed.
I am then able to go into the directory with the right role assumed and then being able to run Terragrunt.
How do I set different iam_role for prod and non-prod folders?
considering this PR from 2018 => https://github.com/gruntwork-io/terragrunt/pull/599/files#diff-04c6e90faac2675aa89e2176d2eec7d8 it seems that I can configure a specific iam_role to be used by terragrunt (and terraform).
My goal is to have a CI/CD (Atlantis) to assume roles when executing the terragrunt command.
How can I set up one role for non-prod folder and a different one for the prod folder?
The text was updated successfully, but these errors were encountered: