AWS IAM Account Alias

This page shows how to write Terraform for IAM Account Alias and write them securely.

aws_iam_account_alias (Terraform)

The Account Alias in IAM can be configured in Terraform with the resource name aws_iam_account_alias. The following sections describe 4 examples of how to use the resource and its parameters.

Example Usage from GitHub

resource "aws_iam_account_alias" "alias" {
  account_alias                  = var.account_alias

resource "aws_iam_account_password_policy" "strict" {
  minimum_password_length        = 12
resource "aws_iam_account_alias" "alias" {
  account_alias = "blooper"

resource "aws_iam_user" "terraform" {
  name = "terraform"
resource "aws_iam_account_alias" "account_alias" {
  account_alias = "alfie-salomon-organization-name"

resource "aws_iam_account_password_policy" "strict" {
  minimum_password_length        = 8
resource "aws_iam_account_alias" "this" {
  account_alias = var.account_alias

resource "aws_iam_account_password_policy" "this" {
  count = var.create_account_password_policy ? 1 : 0


Explanation in Terraform Registry

-> Note: There is only a single account alias per AWS account. Manages the account alias for the AWS Account.

CloudFormation Example

CloudFormation code does not have the related resource.

Frequently asked questions

What is AWS IAM Account Alias?

AWS IAM Account Alias is a resource for IAM of Amazon Web Service. Settings can be wrote in Terraform.

Where can I find the example code for the AWS IAM Account Alias?

For Terraform, the ctschuster/aws-infra, blooper05/toward-the-terra and alfiesal/terraform-examples source code examples are useful. See the Terraform Example section for further details.


Scan your IaC problem in 3 minutes for free

You can keep your IaC security for free. No credit card required.