I'm trying to get the AWS Account Name to be able to use it later in my Terraform Code. I only have Account access so I not am able to use resources that need Organization privileges.
I thought this would work:
data "aws_iam_account_alias" "current" {}
output "account_id" {
value = data.aws_iam_account_alias.current.account_alias
}
But it returns an empty list as the Account has no Aliases (turns out Account Name is different from Account Alias).
Is there any similar way to get the Account Name using Terraform? (having full account permission but no organization permission)