Skip to main content

IAM Password Policy

๐Ÿ“ฆ Overviewโ€‹

This Terraform module provisions a custom IAM password policy for your AWS account, enabling enforcement of strict password requirements to align with security best practices.


โœ… Key Featuresโ€‹

  • Enforces password complexity, length, and rotation policies
  • Prevents password reuse and supports hard expiration options
  • Fully customizable through input variables
  • Aligns with CIS, NIST, and ISO standards

๐Ÿ’ผ Use Casesโ€‹

  • Enforce minimum password strength requirements
  • Meet compliance standards for regulated industries
  • Lock down IAM accounts with secure access policies
  • Strengthen your baseline IAM security posture

๐Ÿ“ฅ Input Variablesโ€‹

NameTypeDescription
regionstringAWS region for deployment
minimum_password_lengthnumberMinimum required password length
require_lowercase_charactersboolWhether to require lowercase characters
require_numbersboolWhether to require numeric digits
require_symbolsboolWhether to require symbols
require_uppercase_charactersboolWhether to require uppercase characters
allow_users_to_changeboolWhether users are allowed to change their own password
password_reuse_preventionnumberNumber of previous passwords disallowed for reuse
max_password_agenumberMaximum number of days a password is valid before expiration
environmentstringEnvironment tag for visibility (e.g., dev, staging, prod)

๐Ÿ“ค Outputsโ€‹

NameDescription
password_policy_idA generated identifier for tracking the policy

๐Ÿš€ Deployment Readinessโ€‹

  • โœ… Compatible with Terraform 1.0+
  • โœ… Requires AWS Provider 5.x+
  • ๐Ÿ” IAM permissions required: iam:UpdateAccountPasswordPolicy, iam:DeleteAccountPasswordPolicy, iam:GetAccountPasswordPolicy

๐Ÿ› ๏ธ Example Usageโ€‹

module "iam_password_policy_deployment" {
source = "git::ssh://git@github.com/archiphire/aws-level-1-modules.git//identity/iam-password-policy?ref=v1.0.0"

region = "us-east-1"
minimum_password_length = 14
require_lowercase_characters = true
require_numbers = true
require_symbols = true
require_uppercase_characters = true
allow_users_to_change = true
password_reuse_prevention = 5
max_password_age = 90
environment = "prod"
}
terraform init
terraform plan
terraform apply

or

tofu init
tofu plan
tofu apply

๐Ÿงน Cleanupโ€‹

Terraform Destroy:

terraform destroy

or

tofu destroy

Manual Deletion (for Production):

aws iam delete-account-password-policy

๐Ÿ›ก๏ธ Notesโ€‹

This is a Level 1 identity hardening module.
To fully secure your IAM environment, pair this module with IAM groups, users, and policy modules across your identity infrastructure.


๐Ÿ”’ Deployment Package Noticeโ€‹

This module is part of the Level 1 AWS License Tier.
To access the full deployment package and source code, subscribe to Archiphire.