Hardcoded AWS account ID in resource argument
What it checks
Hardcoded AWS account ID in resource argument
Where it applies
Terraform: aws_iam_role, aws_iam_policy, aws_lambda_function, aws_iam_role_policy
CloudFormation: AWS::IAM::Role, AWS::IAM::ManagedPolicy, AWS::Lambda::Function
How to fix it
- Replace with `data.aws_caller_identity.current.account_id` or pass via variable. Use string interpolation in the policy doc.
Frameworks
- AWS Well-Architected OPS.5
These mappings are advisory, not an attestation of compliance.