This page provides supplemental information about [organization policy](https://docs.cloud.google.com/resource-manager/docs/organization-policy/overview)
constraints that let you enforce limitations for Cloud Key Management Service. You can use these
constraints to limit resource locations or allowed protection levels for
Cloud KMS keys across an entire project or organization.

You can also use [CMEK organization policies](https://docs.cloud.google.com/kms/docs/cmek-org-policy.md.txt) to enforce the use of CMEK in
your organization and use organization policies to
[control key destruction](https://docs.cloud.google.com/kms/docs/control-key-destruction.md.txt).

## Cloud KMS constraints

The following constraints can be applied to an organization policy and relate
to Cloud Key Management Service.

### Enforce resource locations

**API Name** : `constraints/gcp.resourceLocations`

When you apply the `resourceLocations` constraint, you specify one or more
[locations](https://docs.cloud.google.com/kms/docs/locations.md.txt#location_types). Once set, creation of new resources (e.g key rings, keys,
key versions) is limited to the specified locations.

Keys in other locations, created or imported before the constraint was
applied, will remain usable. However, [key rotation](https://docs.cloud.google.com/kms/docs/key-rotation.md.txt) (automated creation of
a new primary key version) will fail if the result would be a new
key version in a disallowed location.

> [!NOTE]
> **Note:** Enabling or disabling `resourceLocations` may take up to 10 minutes to go into effect.

### Allowed protection levels

**API Name** : `constraints/cloudkms.allowedProtectionLevels`

When you apply the `allowedProtectionLevels` constraint, you specify one or
more [protection levels](https://docs.cloud.google.com/kms/docs/algorithms.md.txt#protection_levels). Once set, new keys, key versions, and
import jobs must use one of the specified protection levels.

Keys with other protection levels, created before the constraint was
applied, will remain usable. However, [key rotation](https://docs.cloud.google.com/kms/docs/key-rotation.md.txt) (automated creation of
a new primary key version) will fail if the result would be a new
key version with a disallowed protection level.

> [!NOTE]
> **Note:** Enabling or disabling `allowedProtectionLevels` may take up to 10 minutes to go into effect.

## What's next

- Learn about [CMEK organization policies](https://docs.cloud.google.com/kms/docs/cmek-org-policy.md.txt) and using organization policies to [control key destruction](https://docs.cloud.google.com/kms/docs/control-key-destruction.md.txt).
- Learn about the [resource hierarchy](https://docs.cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy.md.txt#resource-hierarchy-detail) that applies to organization policies.
- See [Creating and managing organization policies](https://docs.cloud.google.com/resource-manager/docs/organization-policy/creating-managing-policies) for instructions on working with constraints and organization policies in the Google Cloud console.
- See [Using constraints](https://docs.cloud.google.com/resource-manager/docs/organization-policy/using-constraints) for instructions on working with constraints and organization policies in the gcloud CLI.
- See the Resource Manager API [reference documentation](https://docs.cloud.google.com/resource-manager/reference/rest.md.txt) for relevant API methods, such as [`projects.setOrgPolicy`](https://docs.cloud.google.com/resource-manager/reference/rest/v1/projects/setOrgPolicy.md.txt).