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.01k stars 971 forks source link

Need new get_aws_account_aliases() built-in function #2483

Open dod38fr opened 1 year ago

dod38fr commented 1 year ago

Hello

I'm using terragrunt in a company where the account alias is used to create the name of the tfstate bucket.

Currently, we are running an external aws command to list the accounts alias from terragrunt.hcl, but this is brittle.

To be able to get rid of this brittle code, I need a way to get the list of aliases with a builtin function.

Could you add a new function similar to get_aws_account_id to get the list of account aliases ?

All the best

dod38fr commented 1 year ago

Note that an account can only have one alias at a time (see doc). So I guess that the new function could be named get_aws_account_alias even if the underlying SDK function is named ListAccountAliases