AWS · Comparison

KMS vs CloudHSM

Should encryption keys live in AWS KMS, or in dedicated CloudHSM hardware that I control?

Decision summary

Use KMS by default: it is fully managed, integrates with almost every AWS service, logs every key use and costs little. Choose CloudHSM when a regulation or contract requires single-tenant HSMs under your exclusive control, or when applications need standard HSM interfaces such as PKCS #11. You can combine them: a KMS custom key store backed by CloudHSM lets AWS services use keys held in your own HSMs.

Best fit for each option

KMS

Encryption at rest for AWS services, envelope encryption in apps, key policies and full audit with CloudTrail.

CloudHSM

Single-tenant HSMs in your VPC, PKCS #11, JCE or CNG applications, TLS offload, your own certificate authority.

Side by side

 KMSCloudHSM
Best forManaged keys for AWS services and appsDedicated HSMs you operate
SecurityMulti-tenant FIPS-validated HSMs; AWS manages them; key policies control useSingle-tenant; only you manage users and keys
Operational complexityFully managed, automatic rotation availableYou manage users, keys, clients and backups
AvailabilityRegional service; multi-Region keys for DRRun HSMs in two or more zones per cluster
CostPer key per month plus per requestPer HSM per hour

Scaling and topology

KMS keynever leaves KMSGenerateDataKeyreturns 2 copiesPlaintext data keyuse, then discardEncrypted data keystore with the dataYour 2 GB fileencrypted locally (AES)encryptsStored togetherciphertext + encrypted keyTo decrypt: send the encrypteddata key to KMS (kms:Decrypt),get the plaintext key back.
Envelope encryption: KMS protects a small data key; the data key encrypts the large data locally

Limits and constraints

ItemValueContextSource
KMS symmetric cryptographic requests per second (default) 10,000
Can be raised with a quota request
Source
checked
CloudHSM HSMs per cluster 28
Fixed limit
Source
checked

Quotas and limits change. Check the linked source before designing around a number.

When to avoid each option

KMS

  • Rules that demand single-tenant HSMs under your sole control.

CloudHSM

  • Ordinary encryption needs, where you would take on HSM operations for no gain.

Example scenarios

SituationChooseWhy
Encrypt S3 and RDS data and audit who decrypts it.KMSCustomer managed keys with CloudTrail logging.
A rule requires single-tenant hardware with keys that AWS cannot access.CloudHSMCloudHSM keys are under your exclusive control.

Exam cues

  • Managed, integrated, auditable: KMS. Dedicated, single-tenant, you control everything: CloudHSM.
  • AWS services using keys in your own HSMs: a KMS custom key store.

Service pages

Related

Courses and lessons

Services, comparisons and patterns

Sources

Independent study material, not affiliated with or endorsed by Amazon Web Services.

Last reviewed · By the ByteCamel team · How we write content

Was this page helpful?

Report a mistake