Skip to main content
This lesson explains AWS CloudHSM: what it is, how it works, and when to choose it. CloudHSM provides managed Hardware Security Modules (HSMs) inside your VPC so you can centralize and protect cryptographic keys while retaining direct control over key material and cryptographic operations.

Why centralize keys and use an HSM

Encryption protects data by transforming it into an unreadable format. Keys perform encryption and decryption, and as the number of keys grows across systems it becomes easier to accidentally expose a key — allowing attackers to decrypt sensitive data. A Hardware Security Module (HSM) helps solve this by acting as a dedicated, tamper-resistant device that generates, stores, and uses keys inside a hardened boundary. Because key material never leaves the HSM in plaintext, you reduce the risk of key leakage and avoid managing keys across many insecure locations. Key points about HSMs:
  • Keys are generated, stored, and used inside the HSM.
  • Cryptographic operations (signing, encryption, decryption) are executed by the HSM.
  • Plaintext key material does not leave the HSM, minimizing exposure.

What is AWS CloudHSM

CloudHSM is a managed AWS service that provisions and operates HSM instances in the cloud. Instead of buying and maintaining on‑prem HSM hardware, AWS creates and manages HSMs inside your VPC. Your applications can call CloudHSM with lower latency and higher availability compared to remote datacenter HSMs.
A CloudHSM architecture diagram showing a VPC with an HSM cluster connected to the AWS Cloud, a user, and an EC2 instance. Arrows indicate management and communication paths between the user, CloudHSM client on EC2, the application, and the HSMs.
Typically you deploy CloudHSM instances as a cluster inside your VPC for scale and resilience. Applications — on EC2, containers, or on‑premises servers — interact with the cluster through the CloudHSM client. The client forwards cryptographic requests to the HSMs over secure connections. Because HSMs reside in the same AWS region and VPC as your resources, you get lower latency than calling an on‑prem device. How CloudHSM interaction typically works:
  1. Install the CloudHSM client on the host that will call the HSM (EC2 or on‑prem server).
  2. The application uses the client to send cryptographic requests.
  3. The HSM cluster executes the operation and returns the result; key material stays inside the HSM.

CloudHSM vs AWS KMS

Both CloudHSM and AWS KMS provide cryptographic services, but they serve different needs. CloudHSM gives you exclusive control of HSM instances and direct access to cryptographic APIs and key material. KMS is a fully managed key service with deep AWS integration and a simpler control plane; behind the scenes KMS uses AWS-managed HSMs.
KMS and CloudHSM are complementary. Use KMS when you want a fully managed key service tightly integrated with AWS. Use CloudHSM when you need exclusive HSM control, direct cryptographic APIs, or specific compliance requirements that demand dedicated HSMs.

Main features and benefits

  • Dedicated HSM instances in the cloud, providing isolated hardware security.
  • Full control over key material and cryptographic operations inside HSMs you manage.
  • Scalability: start with a single HSM and add more to the cluster for higher throughput.
  • High availability: deploy HSMs across multiple Availability Zones for resilience.
  • Integration: use CloudHSM alongside other AWS services to protect data and keys.
  • Compliance: helps meet regulatory requirements that mandate dedicated HSMs or specific cryptographic controls.
A slide titled "Features" with four numbered panels, each containing a colorful circular icon. The panels list: "Dedicated Hardware Security", "Full Control Over Keys", "Scalability and Resilience", and "Integration With AWS Services."

When to choose CloudHSM

Choose CloudHSM when you need:
  • Direct control over HSM instances and key material.
  • Access to low-level cryptographic APIs or custom crypto libraries.
  • FIPS 140-2 Level 3 validated HSMs or other strict compliance requirements.
  • To centralize cryptographic operations to reduce key sprawl and improve security posture.

Watch Video