AWS KMS: key types

Machine-translated page

This English version was produced by automatic AI translation. Only the French version is reviewed by the author, so it remains the authoritative reference. Spotted a mistake or an awkward turn of phrase? Please report it by opening a pull request. Contributions are welcome.

KMS (Key Management Service) is AWS’s cryptographic key management service. A KMS key can be one of three types:

  • AWS owned key
  • AWS managed key
  • Customer Managed Key (CMK)

An HSM (Hardware Security Module) is a dedicated piece of hardware, physically protected against tampering, that generates, stores and uses cryptographic keys without ever exposing them in plaintext outside the device. The HSMs used by KMS are FIPS 140-3 Security Level 3 certified.

AWS owned key#

An AWS owned key never leaves KMS. It is stored in the KMS HSMs. It is used to encrypt the data of some services (e.g. DynamoDB, which is encrypted at rest by default with an AWS owned key). It does not live in the customer’s AWS account: the customer can neither see it, nor view its key policy (the document that defines who is allowed to use the key), nor manage it. Its rotation is handled by AWS, on a schedule that varies from service to service. Its usage cannot be audited. The key is therefore used by AWS, and the same key may be used to encrypt the data of several customer accounts.

AWS managed key#

An AWS managed key never leaves KMS. It is stored in the KMS HSMs. It is used by default to encrypt the data of some services, without having to specify anything. Each service has its own, identified by an alias of the form aws/<service> (e.g. aws/ebs for EBS, aws/rds for RDS). Its key policy can be viewed but not modified. The key cannot be deleted, and its rotation is automatic: every year, with no way to change that schedule. Its usage can be audited. It belongs to a single AWS account. Since 2021, AWS no longer creates AWS managed keys for new services, which use an AWS owned key by default instead. You will therefore mostly come across them with older services, such as EBS or RDS.

Customer Managed Key (CMK)#

A CMK is a key that customers create themselves in their AWS account. They control its key policy and can schedule its deletion, with a waiting period of 7 to 30 days (deletion is irreversible: data encrypted under the key can no longer be decrypted). They can also enable or disable its automatic rotation and choose the rotation period (365 days by default), but only for symmetric keys whose key material is generated by KMS (AWS_KMS origin, see below).

For a CMK, there are several options for the origin of the key material:

OriginWhere the material is generatedDoes it leave KMS?
AWS_KMS (default)In the KMS HSMsNever
EXTERNAL (import, BYOK)On your side, then imported into KMSYou keep a copy outside AWS
AWS_CLOUDHSM (custom key store)In your CloudHSM clusterIt stays in your CloudHSM
EXTERNAL_KEY_STORE (XKS)In your external key manager, outside AWS (hardware or software)It never enters KMS

Example: encrypting an EBS volume#

The other AWS services used in this example:

  • EC2 (Elastic Compute Cloud): AWS virtual machines, called “instances”.
  • EBS (Elastic Block Store): block storage volumes attached to EC2 instances, in other words their virtual hard drives.
  • RDS (Relational Database Service): AWS’s managed relational database service (MySQL, PostgreSQL…). For most engines, the data and logs of an RDS instance are stored on EBS volumes.

Nitro cards are electronic cards designed by AWS (through Annapurna Labs, a company Amazon acquired in 2015). They equip new-generation EC2 instances, starting with the C5 instances launched in 2017. They play several roles; in our example, they present EBS volumes to the VM (the RDS or EC2 instance) as local NVMe disks, even though the volumes actually sit on the network.

In this example, I do not cover the older instance families based on the Xen hypervisor (prior to the 2017 C5 instances).

To encrypt the EBS volume of an EC2 or RDS instance, the service asks KMS to generate a data key. A data key is a random key that is encrypted under the chosen KMS key (AWS managed key or CMK). This encrypted data key is stored in the metadata of the EBS volume or RDS instance: if it is stolen, it is useless without permission to use the KMS key that encrypted it. The service (EC2 or RDS) calls KMS to decrypt the data key and keeps it in plaintext only in the memory of the Nitro card, for as long as the volume is attached to the instance. The Nitro card encrypts and decrypts blocks on the fly.

This mechanism is called envelope encryption: the data is encrypted with a data key, and that data key is itself encrypted under another key, here the KMS key. The encrypted data key can therefore be safely stored alongside the data it protects, and KMS is only called to decrypt the data key, not for every block of the volume.

Sources and references#

Suggest an edit

By Yanal-Yves FARGIALLA • Updated on November 22, 2026 (AI-assisted writing, final review by the author)
Unless otherwise noted, this content is licensed under CC BY-SA 4.0. CC BY-SA 4.0