# Resource 'projects/my-project/global/images/my-image' was disallowed by policy. Policy: 'constraints/compute.restrictNoncompliantImages'. Reason: 'The resource location is not allowed.'

- **ID:** `policy/gcp-resource-location-restricted`
- **Domain:** policy
- **Category:** config_error
- **Error Code:** `403`
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

Google Cloud Organization Policy restricts compute resources to specific locations, but the image is in a global or non-compliant location.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| GCP Compute Engine | active | — | — |
| Organization Policy Service | active | — | — |

## Workarounds

1. **Copy the image to a compliant region using gcloud compute images create with --source-image and --source-image-project, specifying a compliant region like us-central1. Example: 'gcloud compute images create my-image-us --source-image=my-image --source-image-project=my-project --region=us-central1'.** (85% success)
   ```
   Copy the image to a compliant region using gcloud compute images create with --source-image and --source-image-project, specifying a compliant region like us-central1. Example: 'gcloud compute images create my-image-us --source-image=my-image --source-image-project=my-project --region=us-central1'.
   ```
2. **Contact your GCP organization admin to update the policy to allow the required location or add an exception for the specific project.** (75% success)
   ```
   Contact your GCP organization admin to update the policy to allow the required location or add an exception for the specific project.
   ```

## Dead Ends

- **** — The constraint restricts the location where the image can be used, not stored; moving the image does not resolve the policy violation. (85% fail)
- **** — The policy applies to all compute resources; recreating in a non-compliant location will still fail. (90% fail)
- **** — Requires org admin privileges and may violate compliance requirements; not a practical fix for most users. (70% fail)
