{
  "id": "policy/gcp-resource-location-restriction-violation",
  "signature": "Resource 'projects/my-project/global/images/my-image' was disallowed by policy. Policy: 'constraints/compute.restrictNonCompliantResource'. Reason: 'The resource location 'eastus2' is not allowed for this project.'",
  "signature_zh": "资源 'projects/my-project/global/images/my-image' 被策略禁止。策略：'constraints/compute.restrictNonCompliantResource'。原因：资源位置 'eastus2' 不允许用于此项目。",
  "regex": "Resource.*was disallowed by policy.*constraints/compute\\.restrictNonCompliantResource",
  "domain": "policy",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "A Google Cloud Organization Policy constraint restricts resource creation to specific locations (e.g., only us-central1), but the resource is being created in a non-compliant region like eastus2.",
  "root_cause_type": "generic",
  "root_cause_zh": "Google Cloud 组织策略约束限制了资源创建到特定位置（例如仅 us-central1），但资源正在非合规区域（如 eastus2）创建。",
  "versions": [
    {
      "version": "Google Cloud SDK 450.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Google Cloud Console 2024-03",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The policy applies to all resources in the project; only allowed locations will succeed.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The same policy will block the creation again.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The policy may be inherited from the organization level and apply to all projects.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Check the allowed locations for the project using: gcloud resource-manager org-policies describe constraints/compute.restrictNonCompliantResource --project=my-project, then create the resource in an allowed region.",
      "success_rate": 0.9,
      "how": "Check the allowed locations for the project using: gcloud resource-manager org-policies describe constraints/compute.restrictNonCompliantResource --project=my-project, then create the resource in an allowed region.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Update the organization policy to add the desired location using: gcloud resource-manager org-policies set-policy --project=my-project policy.yaml, where policy.yaml includes the allowed locations.",
      "success_rate": 0.85,
      "how": "Update the organization policy to add the desired location using: gcloud resource-manager org-policies set-policy --project=my-project policy.yaml, where policy.yaml includes the allowed locations.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If the policy is inherited from the organization, request an exception from the GCP admin to allow the specific location.",
      "success_rate": 0.7,
      "how": "If the policy is inherited from the organization, request an exception from the GCP admin to allow the specific location.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "检查项目允许的位置：gcloud resource-manager org-policies describe constraints/compute.restrictNonCompliantResource --project=my-project，然后在允许的区域创建资源。",
    "更新组织策略以添加所需位置：gcloud resource-manager org-policies set-policy --project=my-project policy.yaml，其中 policy.yaml 包含允许的位置。",
    "如果策略从组织继承，请向 GCP 管理员请求异常以允许特定位置。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://cloud.google.com/resource-manager/docs/organization-policy/restricting-locations",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2024-01-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}