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.
In addition to all arguments above, the following attributes are exported:
account_alias - The alias associated with the AWS account.
© 2018 HashiCorpLicensed under the MPL 2.0 License.
https://www.terraform.io/docs/providers/aws/d/iam_account_alias.html