{
  "id": "policy/terraform-aws-iam-policy-size-limit",
  "signature": "Error: Error putting IAM policy: LimitExceeded: Cannot exceed quota for PolicySize: 5120",
  "signature_zh": "错误：放置 IAM 策略时出错：LimitExceeded：不能超过 PolicySize 配额：5120",
  "regex": "Error putting IAM policy.*LimitExceeded.*PolicySize: 5120",
  "domain": "policy",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "AWS IAM policy document has a maximum size of 5120 characters (including whitespace), and the generated policy exceeds this limit due to many resource ARNs or conditions.",
  "root_cause_type": "generic",
  "root_cause_zh": "AWS IAM 策略文档最大大小为 5120 个字符（包括空格），生成的策略因资源 ARN 或条件过多而超出此限制。",
  "versions": [
    {
      "version": "AWS IAM",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Terraform v1.5+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "This increases the policy size further, making the error worse.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Inline policies have the same 5120 character limit and are harder to manage at scale.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Split the policy into multiple managed policies and attach them to the same role or user.",
      "success_rate": 0.85,
      "how": "Split the policy into multiple managed policies and attach them to the same role or user.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use wildcards in resource ARNs to reduce policy size (if security allows).",
      "success_rate": 0.7,
      "how": "Use wildcards in resource ARNs to reduce policy size (if security allows).",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "将策略拆分为多个托管策略，并附加到同一角色或用户。",
    "如果安全允许，使用资源 ARN 中的通配符来减小策略大小。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html",
  "official_doc_section": null,
  "error_code": "LimitExceeded",
  "verification_tier": "ai_generated",
  "confidence": 0.9,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-07-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}