The IAM Account Alias data source allows access to the account alias for the effective account in which Terraform is working.
data "aws_iam_account_alias" "current" {}
output "account_id" {
value = data.aws_iam_account_alias.current.account_alias
}
There are no arguments available for this data source.
This data source exports the following attributes in addition to the arguments above:
account_alias
- Alias associated with the AWS account.id
- Alias associated with the AWS account.