AWS Certified DevOps Engineer – Professional
KMS key rotation: automatic, on-demand, manual, multi-Region
AWS KMS rotates key material automatically only for symmetric encryption keys whose material KMS generated. The KMS Developer Guide says the default rotation period is 365 days. Asymmetric keys, HMAC keys and keys in custom key stores must be rotated manually, by creating a new key and pointing an alias at it.
Automatic vs on-demand vs manual rotation
Automatic rotation is optional for customer managed keys and is supported only on symmetric encryption keys with AWS_KMS origin. If you do not set RotationPeriodInDays, the period is 365 days. AWS managed keys are rotated every year and you cannot turn that on or off.
On-demand rotation starts a rotation immediately, whether or not automatic rotation is enabled, and does not change the automatic schedule. It is supported on symmetric encryption keys with AWS_KMS origin and on those with imported key material.
Rotation changes the key material only. AWS KMS keeps the older material, and when you decrypt it picks the material that encrypted the ciphertext, so nothing needs re-encrypting. A key that is disabled or pending deletion is not rotated.
How does manual rotation work?
Asymmetric KMS keys, HMAC KMS keys and keys in custom key stores support neither automatic nor on-demand rotation. Manual rotation means creating a new KMS key and using it in place of the current one.
The original key must stay enabled, because only it can decrypt or verify what it produced. Applications should refer to the key through an alias, so that rotation is a change of the alias target instead of a code change. Aliases work for cryptographic operations such as GenerateMac, VerifyMac, Sign and Encrypt, but not for operations that manage keys, such as DisableKey or ScheduleKeyDeletion.
For manually rotated symmetric encryption keys, omit KeyId when calling Decrypt. AWS KMS finds the key that encrypted the ciphertext.
What is different for multi-Region keys and deletion?
Related multi-Region keys share the same key ID and key material, so data encrypted in one Region can be decrypted in another without re-encrypting. Key rotation is a shared property. You enable automatic rotation, or start on-demand rotation, only on the primary key. AWS KMS copies the setting and the new key material to every replica.
Other properties are not shared. A replica key has its own key policy, grants, aliases and tags, and you manage each key independently. Multi-Region keys are not global: AWS never replicates one into a Region for you.
Deleting a key is irreversible. ScheduleKeyDeletion sets a waiting period of 7 to 30 days, 30 by default. During it the key is in the Pending deletion state and cannot be used in any cryptographic operation, and you can still cancel the deletion. A primary key is not deleted until all of its replica keys are deleted. AWS suggests disabling a key instead when you might need it again.
Where the exam catches people
- Believing automatic rotation can be enabled on an HMAC or asymmetric key: those need manual rotation with a new key and an alias.
- Believing the old key can be disabled after a manual rotation: it must stay enabled to decrypt or verify what it produced.
- Believing rotation must be enabled on each replica of a multi-Region key: it is set on the primary only and copied to the replicas.
- Believing a replica key inherits the primary key's key policy: each replica has its own key policy.
- Believing a key pending deletion can still decrypt: it cannot be used in any cryptographic operation during the waiting period.