Updated on 2025-11-06 GMT+08:00

Key Management Service (KMS)

IAM provides system-defined identity policies to define typical cloud service permissions. You can also create custom identity policies using the actions supported by cloud services for more refined access control.

In addition to IAM, the Organizations service also provides Service Control Policies (SCPs) to set access control policies.

SCPs do not actually grant any permissions to an entity. They only set the permissions boundary for the entity. When SCPs are attached to an organizational unit (OU) or a member account, the SCPs do not directly grant permissions to that OU or member account. Instead, the SCPs only determine what permissions are available for that member account or those member accounts under that OU. The granted permissions can be applied only if they are allowed by the SCPs.

To learn more about how IAM is different from Organizations for access control, see How IAM Is Different from Organizations for Access Control?.

This section describes the elements used by IAM custom identity policies and Organizations SCPs. The elements include actions, resources, and conditions.

Actions

Actions are specific operations that are allowed or denied in an identity policy.

  • The Access Level column describes how the action is classified (List, Read, or Write). This classification helps you understand the level of access that an action grants when you use it in an identity policy.
  • The Resource Type column indicates whether the action supports resource-level permissions.
    • You can use a wildcard (*) to indicate all resource types. If this column is empty (-), the action does not support resource-level permissions and you must specify all resources ("*") in your identity policy statements.
    • If this column includes a resource type, you must specify the URN in the Resource element of your identity policy statements.
    • Required resources are marked with asterisks (*) in the table. If you specify a resource in a statement using this action, then it must be of this type.

    For details about the resource types defined by KMS, see Resources.

  • The Condition Key column contains keys that you can specify in the Condition element of an identity policy statement.
    • If the Resource Type column has values for an action, the condition key takes effect only for the listed resource types.
    • If the Resource Type column is empty (-) for an action, the condition key takes effect for all resources that action supports.
    • If the Condition Key column is empty (-) for an action, the action does not support any condition keys.

    For details about the condition keys defined by KMS, see Conditions.

  • The Alias column lists the policy actions that are configured in identity policies. With these actions, you can use APIs for policy-based authorization. For details, see Policies and Identity Policies.

The following table lists the actions that you can define in identity policy statements for KMS.

Table 1 Actions supported by KMS

Action

Description

Access Level

Resource Type (*: required)

Condition Key

Alias

kms:cmk:create

Grants permission to create KMS keys.

Write

KeyId *

-

-

kms:cmk:list

Grants permission to View All KMS Key Information.

List

KeyId *

-

-

-

g:EnterpriseProjectId

kms:cmk:enable

Grants permission to change the status of a KMS key to Enabled.

Write

KeyId *

-

kms:cmk:disable

Grants permission to disable KMS keys.

Write

KeyId *

-

kms:cmk:get

Grants permission to view details about KMS keys.

Read

KeyId *

-

-

kms:cmk:createDataKey

Grants permission to use KMS keys to generate data keys.

Write

KeyId *

  • kms:dek:create

-

kms:cmk:createDataKeyWithoutPlaintext

Grants permission to use KMS keys to generate data keys that do not contain plaintext versions.

Write

KeyId *

  • kms:dek:create

-

kms:cmk:encryptDataKey

Grants permission to encrypt the data key.

Write

KeyId *

  • kms:dek:crypto
  • kms:dek:encrypt

-

kms:cmk:decryptDataKey

Grants permission to decrypt the data key.

Write

KeyId *

  • kms:dek:crypto
  • kms:dek:decrypt

-

kms:cmk:encryptData

Grants permission to use the specified KMS key to encrypt small data.

Write

KeyId *

  • kms:cmk:crypto
  • kms:cmk:encrypt

-

kms:cmk:decryptData

Grants permission to decrypt data using the specified KMS key.

Write

KeyId *

  • kms:cmk:crypto
  • kms:cmk:decrypt

-

kms::generateRandom

Grants permission to generate secure random strings.

Write

-

kms:RecipientAttestation

  • kms:cmk:generate

kms:cmk:sign

Grants permission to generate digital signatures for.

Write

KeyId *

-

-

kms:cmk:verify

Grants permission to use the specified KMS key to verify the digital signature.

Write

KeyId *

-

-

kms:cmk:generateMac

Grants permission to generate a MAC.

Write

KeyId *

-

-

kms:cmk:verifyMac

Grants permission to verify a MAC using a specified KMS key.

Write

KeyId *

-

-

kms:cmk:getPublicKey

Grants permission to query the KMS key and public key.

Read

KeyId *

-

-

kms::getVersions

Grants permission to query service versions.

Read

-

-

-

kms::getVersion

Grants permission to query the service key API version.

Read

-

-

-

kms::getInstance

Grants permission to query the number of key instances to the user.

Read

-

-

  • kms:cmk:getInstance

kms::getQuota

Grants permission to query user quotas.

Read

-

-

  • kms:cmk:getQuota

kms:cmk:scheduleKeyDeletion

Grants permission to periodically delete KMS keys.

Write

KeyId *

  • kms:cmk:update

-

kms:ScheduleKeyDeletionPendingWindowInDays

kms:cmk:cancelKeyDeletion

Grants permission to cancel the scheduled deletion of KMS keys.

Write

KeyId *

  • kms:cmk:update

kms:cmk:updateKeyAlias

Grants permission to change key aliases.

Write

KeyId *

  • kms:cmk:update

kms:cmk:updateKeyDescription

Grants permission to change the key description.

Write

KeyId *

  • kms:cmk:update

kms:cmk:createGrant

Grants permission to a specific key creation authorization.

Permission_management

KeyId *

  • kms:grant:create

-

kms:cmk:listGrants

Grants permission to query the list of granted permissions for a specific key.

List

KeyId *

  • kms:grant:list

kms::listRetirableGrants

Grants permission to query the list of authorizations that can be retired for keys.

List

-

-

  • kms:grant:list

kms:cmk:retireGrant

Grants permission to a specific key retiring authorization.

Permission_management

KeyId *

g:ResourceTag/<tag-key>

  • kms:grant:retire

kms:cmk:revokeGrant

Grants permission to revoke authorization for a specific key.

Permission_management

KeyId *

  • kms:grant:revoke

kms:cmk:getMaterial

Grants permission to obtain key import parameters.

Read

KeyId *

-

-

kms:WrappingAlgorithm

kms:cmk:importMaterial

Grants permission to import key materials.

Write

KeyId *

-

-

kms:ExpirationTime

kms:cmk:deleteMaterial

Grants permission to delete key materials.

Write

KeyId *

-

kms:cmk:enableRotation

Grants permission to enable rotation of a specified key.

Write

KeyId *

-

kms:cmk:updateRotation

Grants permission to change the specified key rotation period.

Write

KeyId *

-

kms:cmk:disableRotation

Grants permission to disable key rotation.

Write

KeyId *

-

kms:cmk:getRotation

Grants permission to query the rotation status of a specified key.

Read

KeyId *

-

kms:keystore:create

Grants permission to create a dedicated keystore.

Write

keystore *

-

-

kms:keystore:delete

Grants permission to delete the dedicated keystore.

Write

keystore *

-

-

kms:keystore:enable

Grants permission to enable the dedicated keystore.

Write

keystore *

-

-

kms:keystore:disable

Grants permission to disable the dedicated keystore.

Write

keystore *

-

-

kms:keystore:list

Grants permission to query the list of dedicated keystore.

List

keystore *

-

-

kms:keystore:get

Grants permission to obtain the dedicated keystore.

Read

keystore *

-

-

kms:cmk:createTag

Grants permission to add tags to a specified CMK.

Tagging

KeyId *

  • kms:cmkTag:create

-

kms:cmk:createTags

Grants permission to add or delete tags in batches for a specified CMK.

Tagging

KeyId *

  • kms:cmkTag:batch

-

kms:cmk:listKeysByTag

Grants permission to query a specified key instance.

List

KeyId *

-

  • kms:cmkTag:listInstance

kms:cmk:deleteTag

Grants permission to delete a specified key tag.

Tagging

KeyId *

  • kms:cmkTag:delete

-

g:TagKeys

kms:cmk:getTags

Grants permission to query a specified key tag.

Read

KeyId *

  • kms:cmkTag:list

kms::listAllTags

Grants permission to query the label of a specified key project.

List

-

-

-

kms:cmk:replicate

Grants permission to replicate KMS keys.

Write

KeyId *

-

kms:cmk:updatePrimaryRegion

Grants permission to update primary region of KMS keys.

Write

KeyId *

-

-

kms:PrimaryRegion

kms:alias:create

Grants permission to update primary region of KMS keys.

Write

KeyId *

-

alias *

-

kms:alias:delete

Grants permission to update primary region of KMS keys.

Write

KeyId *

-

alias *

-

kms:alias:list

Grants permission to update primary region of KMS keys.

List

-

-

-

kms:alias:associate

Grants permission to update primary region of KMS keys.

Write

KeyId *

-

alias *

-

Each API of KMS usually supports one or more actions. Table 2 lists the supported actions and dependencies.

Table 2 Actions and dependencies supported by KMS APIs

API

Action

Dependencies

POST /v1.0/{project_id}/kms/create-key

kms:cmk:create

-

-

kms:cmk:create

-

POST /v1.0/{project_id}/kms/list-keys

kms:cmk:list

-

-

kms:cmk:list

-

POST /v1.0/{project_id}/kms/enable-key

kms:cmk:enable

-

POST /v1.0/{project_id}/kms/disable-key

kms:cmk:disable

-

POST /v1.0/{project_id}/kms/describe-key

kms:cmk:get

-

-

kms:cmk:get

-

POST /v1.0/{project_id}/kms/create-datakey

kms:cmk:createDataKey

-

-

kms:cmk:createDataKey

-

POST /v1.0/{project_id}/kms/create-datakey-without-plaintext

kms:cmk:createDataKeyWithoutPlaintext

-

POST /v1.0/{project_id}/kms/encrypt-datakey

kms:cmk:encryptDataKey

-

POST /v1.0/{project_id}/kms/decrypt-datakey

kms:cmk:decryptDataKey

-

-

kms:cmk:decryptDataKey

-

POST /v1.0/{project_id}/kms/encrypt-data

kms:cmk:encryptData

-

POST /v1.0/{project_id}/kms/decrypt-data

kms:cmk:decryptData

-

POST /v1.0/{project_id}/kms/gen-random

kms::generateRandom

-

POST /v1.0/{project_id}/kms/sign

kms:cmk:sign

-

POST /v1.0/{project_id}/kms/verify

kms:cmk:verify

-

POST /v1.0/{project_id}/kms/generate-mac

kms:cmk:generateMac

-

POST /v1.0/{project_id}/kms/verify-mac

kms:cmk:verifyMac

-

POST /v1.0/{project_id}/kms/get-publickey

kms:cmk:getPublicKey

-

GET /

kms::getVersions

-

GET /{version_id}

kms::getVersion

-

POST /v1.0/{project_id}/kms/schedule-key-deletion

kms:cmk:scheduleKeyDeletion

-

POST /v1.0/{project_id}/kms/cancel-key-deletion

kms:cmk:cancelKeyDeletion

-

GET /v1.0/{project_id}/kms/user-instances

kms::getInstance

-

GET /v1.0/{project_id}/kms/user-quotas

kms::getQuota

-

POST /v1.0/{project_id}/kms/update-key-alias

kms:cmk:updateKeyAlias

-

POST /v1.0/{project_id}/kms/update-key-description

kms:cmk:updateKeyDescription

-

POST /v1.0/{project_id}/kms/create-grant

kms:cmk:createGrant

-

POST /v1.0/{project_id}/kms/list-grants

kms:cmk:listGrants

-

POST /v1.0/{project_id}/kms/list-retirable-grants

kms::listRetirableGrants

-

POST /v1.0/{project_id}/kms/retire-grant

kms:cmk:retireGrant

-

POST /v1.0/{project_id}/kms/revoke-grant

kms:cmk:revokeGrant

-

POST /v1.0/{project_id}/kms/get-parameters-for-import

kms:cmk:getMaterial

-

POST /v1.0/{project_id}/kms/import-key-material

kms:cmk:importMaterial

-

POST /v1.0/{project_id}/kms/delete-imported-key-material

kms:cmk:deleteMaterial

-

POST /v1.0/{project_id}/kms/enable-key-rotation

kms:cmk:enableRotation

-

POST /v1.0/{project_id}/kms/update-key-rotation-interval

kms:cmk:updateRotation

-

POST /v1.0/{project_id}/kms/disable-key-rotation

kms:cmk:disableRotation

-

POST /v1.0/{project_id}/kms/get-key-rotation-status

kms:cmk:getRotation

-

POST /v1.0/{project_id}/keystores

kms:keystore:create

-

DELETE /v1.0/{project_id}/keystores/{keystore_id}

kms:keystore:delete

-

POST /v1.0/{project_id}/keystores/{keystore_id}/enable

kms:keystore:enable

-

POST /v1.0/{project_id}/keystores/{keystore_id}/disable

kms:keystore:disable

-

GET /v1.0/{project_id}/keystores

kms:keystore:list

-

GET /v1.0/{project_id}/keystores/{keystore_id}

kms:keystore:get

-

POST /v1.0/{project_id}/kms/{key_id}/tags

kms:cmk:createTag

-

POST /v1.0/{project_id}/kms/{key_id}/tags/action

kms:cmk:createTags

-

POST /v1.0/{project_id}/kms/{resource_instances}/action

kms:cmk:listKeysByTag

-

DELETE /v1.0/{project_id}/kms/{key_id}/tags/{key}

kms:cmk:deleteTag

-

GET /v1.0/{project_id}/kms/{key_id}/tags

kms:cmk:getTags

-

GET /v1.0/{project_id}/kms/tags

kms::listAllTags

-

POST /v2/{project_id}/kms/keys/{key_id}/replicate

kms:cmk:replicate

-

PUT /v2/{project_id}/kms/keys/{key_id}/update-primary-region

kms:cmk:updatePrimaryRegion

-

POST /v1.0/{project_id}/kms/aliases

kms:alias:create

-

DELETE /v1.0/{project_id}/kms/aliases

kms:alias:delete

-

GET /v1.0/{project_id}/kms/aliases

kms:alias:list

-

POST /v1.0/{project_id}/kms/alias/associate

kms:alias:associate

-

POST /v1.0/{project_id}/kms/create-pin

kms:cmk:createDataKey

-

Resources

A resource type indicates the resources that an identity policy applies to. If you specify a resource type for any action in Table 3, the resource URN must be specified in the identity policy statements using that action, and the identity policy applies only to resources of this type. If no resource type is specified, the Resource element is marked with an asterisk (*) and the identity policy applies to all resources. You can also set condition keys in an identity policy to define resource types.

The following table lists the resource types that you can define in identity policy statements for KMS.

Table 3 Resource types supported by KMS

Resource Type

URN

KeyId

kms:<region>:<account-id>:KeyId:<cmk-id>

alias

kms:<region>:<account-id>:alias:<alias-name>

keystore

kms:<region>:<account-id>:keystore:<keystore-id>

Conditions

Condition Key Overview

A Condition element lets you specify conditions for when an identity policy is in effect. It contains condition keys and operators.

  • The condition key that you specify can be a global condition key or a service-specific condition key.
    • Global condition keys (with the g: prefix) apply to all actions. Cloud services do not need to provide user identity information. Instead, the system automatically obtains such information and authenticates users. For details, see Global Condition Keys.
    • Service-specific condition keys (with the abbreviation of a service name plus a colon as the prefix, for example, kms) apply only to operations of the xx service. For details, see Table 4.
    • The number of values associated with a condition key in the request context of an API call makes the condition key single-valued or multivalued. Single-valued condition keys have at most one value in the request context of an API call. Multivalued condition keys can have multiple values in the request context of an API call. For example, a request can originate from at most one VPC endpoint, so g:SourceVpce is a single-valued condition key. You can tag resources and include multiple tag key-value pairs in a request, so g:TagKeys is a multivalued condition key.
  • A condition operator, condition key, and a condition value together constitute a complete condition statement. An identity policy can be applied only when its request conditions are met. For supported condition operators, see operators.

Service-specific condition keys supported by KMS

The following table lists the condition keys that you can define in identity policies for KMS. You can include these condition keys to specify conditions for when your identity policy is in effect.

Table 4 Service-specific condition keys supported by KMS

Service-specific Condition Key

Type

Single-valued/Multivalued

Description

kms:EncryptionAlgorithm

string

Single-valued

Filters access to encryption/decryption operations based on the encryption/decryption algorithm value in the request.

kms:GranteePrincipalType

string

Single-valued

Filters access to the CreateGrant operation based on the authorization principal type constraint in the request.

kms:GrantOperations

string

Multivalued

Filters access to the CreateGrant operation based on the operation to be authorized.

kms:GranteePrincipal

string

Single-valued

Filters access to the CreateGrant operation based on the authorized party principal in the authorization.

kms:KeyOrigin

string

Single-valued

Filters access to an API operation based on the origin attribute of the KMS key created or used for the operation.

kms:KeySpec

string

Single-valued

Filters access to API operations based on the key_spec attribute that created or used the operation KMS key.

kms:KeyUsage

string

Single-valued

Filters access to API operations based on the key_usage attribute of the KMS key created or used for the operation.

kms:MessageType

string

Single-valued

Filters access to signing and verifying signature operations based on the value of the message_type parameter in the request.

kms:RetiringPrincipal

string

Single-valued

Filters access to CreateGrant operations based on retiring_principal in authorization.

kms:SigningAlgorithm

string

Single-valued

Filters access to signing and verifying operations based on signing_algorithm in the request.

kms:ExpirationTime

date

Single-valued

Filters access to the ImportKeyMaterial operation based on the value of the expiration_time parameter in the request.

kms:WrappingAlgorithm

string

Single-valued

Filters access to the CreateParametersForImport operation based on the value of the wrapping_algorithm parameter in the request.

kms:RecipientAttestation

string

Single-valued

Filters access to the CreateDatakey, DecryptData, DecryptDatakey, and CreateRandom operations based on the Platform Configuration Register (PCR) value of the attestation document in the request.

kms:MacAlgorithm

string

Single-valued

Filters access to MAC generation and verification operations based on mac_algorithm in the request.

kms:RequestAlias

string

Single-valued

Filters access to MAC generation and verification operations based on mac_algorithm in the request.

kms:ResourceAliases

string

Multivalued

Filters access to MAC generation and verification operations based on mac_algorithm in the request.

kms:MultiRegionKeyType

string

Single-valued

Filters access to API operations based on MultiRegionKeyType in the KMS key field.

kms:PrimaryRegion

string

Single-valued

Filters access to API operations based on primary_region in the request.

kms:EncryptionContext

string

Single-valued

Filters access to API operations based on additional_authenticated_data in the request.

kms:ScheduleKeyDeletionPendingWindowInDays

numeric

Single-valued

Filters access to API operations based on pending_days in the request.