{
  "id": "terraform/invalid-aws-account-id-in-provider",
  "signature": "Error: Invalid provider configuration: The given AWS account ID is not valid",
  "signature_zh": "错误：无效的提供程序配置：给定的 AWS 账户 ID 无效",
  "regex": "Invalid provider configuration: The given AWS account ID is not valid",
  "domain": "terraform",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The allowed_account_ids or forbidden_account_ids in the AWS provider configuration contains a malformed or incorrect AWS account ID.",
  "root_cause_type": "generic",
  "root_cause_zh": "AWS 提供程序配置中的 allowed_account_ids 或 forbidden_account_ids 包含格式错误或不正确的 AWS 账户 ID。",
  "versions": [
    {
      "version": "1.5.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.6.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.7.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.8.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Remove the allowed_account_ids line entirely without checking the account ID format.",
      "why_fails": "This removes a security safeguard and may allow operations on unintended accounts.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a random 12-digit number as the account ID.",
      "why_fails": "The account ID must match the actual AWS account being used. Random numbers will fail validation.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    },
    {
      "action": "Switch to using IAM roles without specifying account IDs.",
      "why_fails": "This only works if the role is correctly set up; the error is about the account ID format, not the role.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Verify the correct AWS account ID using AWS CLI: aws sts get-caller-identity --query Account. Then update the provider block: provider \"aws\" { allowed_account_ids = [\"123456789012\"] }",
      "success_rate": 0.95,
      "how": "Verify the correct AWS account ID using AWS CLI: aws sts get-caller-identity --query Account. Then update the provider block: provider \"aws\" { allowed_account_ids = [\"123456789012\"] }",
      "condition": "",
      "sources": []
    },
    {
      "action": "If using environment variables, ensure AWS_ACCOUNT_ID is set correctly: export AWS_ACCOUNT_ID=123456789012. Then reference it in provider: allowed_account_ids = [var.aws_account_id]",
      "success_rate": 0.9,
      "how": "If using environment variables, ensure AWS_ACCOUNT_ID is set correctly: export AWS_ACCOUNT_ID=123456789012. Then reference it in provider: allowed_account_ids = [var.aws_account_id]",
      "condition": "",
      "sources": []
    },
    {
      "action": "Remove the allowed_account_ids or forbidden_account_ids line if account restriction is not needed, and rely on IAM policies instead.",
      "success_rate": 0.85,
      "how": "Remove the allowed_account_ids or forbidden_account_ids line if account restriction is not needed, and rely on IAM policies instead.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "使用 AWS CLI 验证正确的 AWS 账户 ID：aws sts get-caller-identity --query Account。然后更新提供程序块：provider \"aws\" { allowed_account_ids = [\"123456789012\"] }",
    "如果使用环境变量，请确保正确设置 AWS_ACCOUNT_ID：export AWS_ACCOUNT_ID=123456789012。然后在提供程序中引用它：allowed_account_ids = [var.aws_account_id]",
    "如果不需要账户限制，请删除 allowed_account_ids 或 forbidden_account_ids 行，并依赖 IAM 策略。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://registry.terraform.io/providers/hashicorp/aws/latest/docs#allowed_account_ids",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.82,
  "fix_success_rate": 0.88,
  "resolvable": "true",
  "first_seen": "2024-01-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}