{
  "id": "policy/aws-iam-policy-size-exceeded",
  "signature": "Error: Error putting IAM policy: LimitExceeded: Cannot exceed quota for PolicySize: 6144",
  "signature_zh": "错误：放置 IAM 策略时出错：LimitExceeded：不能超过 PolicySize 的配额：6144",
  "regex": "LimitExceeded.*PolicySize.*6144",
  "domain": "policy",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "AWS IAM policy size limit is 6144 characters for customer managed policies; the policy document exceeds this due to too many statements, long ARNs, or verbose conditions.",
  "root_cause_type": "generic",
  "root_cause_zh": "AWS IAM 策略大小限制为客户管理策略 6144 个字符；策略文档因语句过多、ARN 过长或条件冗长而超出此限制。",
  "versions": [
    {
      "version": "AWS IAM API 2010-05-08",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "AWS CLI v2.15.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Terraform AWS Provider v5.40.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Removing whitespace or minifying JSON does not reduce the character count significantly; the error is about logical size, not formatting.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Splitting the policy into multiple inline policies on the same role still counts toward the total role policy size limit (10240 characters).",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Using a wildcard instead of listing individual resources may violate least-privilege policies and still hit size limits if the condition is verbose.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Consolidate multiple statements with overlapping actions into a single statement using a list of actions and resources. For example, combine 's3:GetObject' and 's3:PutObject' into one statement with 's3:GetObject', 's3:PutObject'.",
      "success_rate": 0.8,
      "how": "Consolidate multiple statements with overlapping actions into a single statement using a list of actions and resources. For example, combine 's3:GetObject' and 's3:PutObject' into one statement with 's3:GetObject', 's3:PutObject'.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use policy variables like ${aws:username} to reduce hardcoded ARN length, and remove redundant conditions.",
      "success_rate": 0.75,
      "how": "Use policy variables like ${aws:username} to reduce hardcoded ARN length, and remove redundant conditions.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Split the policy into multiple managed policies attached to the same role; each managed policy has its own 6144 character limit.",
      "success_rate": 0.85,
      "how": "Split the policy into multiple managed policies attached to the same role; each managed policy has its own 6144 character limit.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "将具有重叠操作的多个语句合并为一个语句，使用操作和资源列表。例如，将 's3:GetObject' 和 's3:PutObject' 合并为一个语句，包含 's3:GetObject', 's3:PutObject'。",
    "使用策略变量如 ${aws:username} 减少硬编码 ARN 长度，并删除冗余条件。",
    "将策略拆分为多个托管策略附加到同一角色；每个托管策略有自己的 6144 字符限制。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-quotas-entity",
  "official_doc_section": null,
  "error_code": "LimitExceeded",
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-03-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}