Lesson 3 of 5 Centralized Security and Encryption

Designing a KMS Key Strategy Across Accounts and Regions

This lesson explains how encryption key design affects security boundaries, disaster recovery and day-to-day operations, in the cross-account and multi-Region scenarios that professional-level questions test.

Learning outcomes

After completing this lesson, you will be able to:

  • Choose key granularity and separate key duties.
  • Explain what cross-account key use requires.
  • Explain how multi-Region keys and rotation support disaster recovery.
  • Choose strict custody options such as CloudHSM or external key stores.

Key granularity and duties

How many keys to create is a design decision. Keys can be created per application, per data classification, per environment or per account. More keys give finer control, a smaller blast radius if a key policy is misconfigured, and clearer audit trails, at the cost of more policies to manage; fewer keys are easier to manage but put more data behind each policy. A common middle ground is one key per application and environment, with separate keys for the most sensitive data.

Key policies should separate duties. Key administrators can manage keys, change policies, enable rotation and schedule deletion, but cannot use the keys to encrypt or decrypt data; key users can use keys but cannot change them. No single role then has both the power to read the data and the power to change who else can.

Cross-account use

Using a key from another account needs both the key policy, which must allow the other account or a specific role in it, and IAM permissions in the using account, which must allow its principal to use the key. AWS services that act for a principal, such as EBS attaching an encrypted volume, often use grants, which give temporary, delegated permissions for specific operations.

Conditions narrow cross-account use further. kms:ViaService allows use only through a named service, such as S3 in one Region; kms:CallerAccount limits which accounts may call; and the encryption context, key-value pairs bound to each ciphertext and visible in CloudTrail, can be required to match, for example so a key can decrypt only objects from one bucket.

Multi-Region keys and rotation

Multi-Region keys, whose IDs begin with mrk-, are related keys in several Regions that share the same key ID and key material, each with its own key policy. Data encrypted in one Region can be decrypted in another without calling the primary Region, which matters for disaster recovery: data replicated by S3 Cross-Region Replication, DynamoDB global tables, Aurora Global Database or AWS Backup copies, or encrypted client-side, remains readable in the recovery Region even if the primary Region is unavailable.

Symmetric keys whose material AWS generates support automatic rotation, with a period from 90 days to about seven years, and on-demand rotation. Rotation creates new key material for new encryptions while keeping the old material to decrypt existing data, and the key ID stays the same, so applications and policies need no changes and nothing needs to be re-encrypted. Keys with imported material cannot rotate automatically, but since June 2025 they can be rotated on demand after new material is imported into the same key.

Strict custody options

Standard KMS keys are generated and held in AWS's multi-tenant HSMs, and some regulations require stricter custody. AWS CloudHSM provides single-tenant HSMs that you control, used directly by applications. A KMS custom key store backed by CloudHSM keeps the KMS API and its service integrations, while the key material lives in your CloudHSM cluster. An external key store (XKS) keeps the key material outside AWS altogether, in your own key manager. Imported key material lets you generate the material yourself and supply it to KMS, and you can delete it immediately, making the data unreadable at once. The following table summarises the options.

OptionKey material
CloudHSMSingle-tenant HSMs you control
KMS custom key storeBacked by CloudHSM
External key store (XKS)Stays outside AWS
Imported key materialYou supply it and can delete it immediately
Worked example

A key policy with separated duties and a DR replica

An application's data key must be administered by the platform team, used only by the application role, and usable in the DR Region without re-encrypting replicated data. The key policy separates administration from use:

{
  "Version": "2012-10-17",
  "Statement": [
    { "Sid": "EnableIAMPolicies", "Effect": "Allow",
      "Principal": { "AWS": "arn:aws:iam::111111111111:root" }, "Action": "kms:*", "Resource": "*" },
    { "Sid": "KeyAdministrators", "Effect": "Allow",
      "Principal": { "AWS": "arn:aws:iam::111111111111:role/PlatformKeyAdmin" },
      "Action": ["kms:Create*", "kms:Describe*", "kms:Enable*", "kms:List*", "kms:Put*", "kms:Update*",
                 "kms:Revoke*", "kms:Disable*", "kms:Get*", "kms:Delete*", "kms:TagResource",
                 "kms:UntagResource", "kms:ScheduleKeyDeletion", "kms:CancelKeyDeletion",
                 "kms:ReplicateKey"],
      "Resource": "*" },
    { "Sid": "KeyUsers", "Effect": "Allow",
      "Principal": { "AWS": "arn:aws:iam::111111111111:role/OrdersApp" },
      "Action": ["kms:Encrypt", "kms:Decrypt", "kms:ReEncrypt*", "kms:GenerateDataKey*", "kms:DescribeKey"],
      "Resource": "*",
      "Condition": { "StringEquals": { "kms:ViaService": ["s3.eu-west-1.amazonaws.com", "dynamodb.eu-west-1.amazonaws.com"] } } }
  ]
}
aws kms create-key --multi-region --description "orders data" --policy file://orders-key-policy.json
aws kms replicate-key --key-id mrk-1234abcd12ab34cd56ef1234567890ab --replica-region eu-central-1

The replica in eu-central-1 has the same key ID and key material, so data replicated by DynamoDB global tables or S3 Cross-Region Replication decrypts there even if eu-west-1, and its KMS, is unavailable. Each replica has its own key policy, which must be kept consistent, typically by managing both through infrastructure as code.

Check yourself

Why use separate KMS keys per application or data classification rather than one key per account?

Show answer

Each key policy can then allow only the roles that need that data, and disabling or auditing a key affects only that data, which limits the blast radius.

Exam Tips

Remember for the exam

  • To decrypt replicated data in the disaster recovery Region without re-encrypting it, use multi-Region keys.
  • Using a key across accounts requires the key policy and IAM permissions in the other account.
  • When keys must be held outside AWS, use an external key store.
  • To restrict a key to one service, use the kms:ViaService condition.
  • Separate key administrators from key users in key policies.