Rotation, grants and encryption context
Rotation, aliases and irreversible loss
Rotation of an eligible KMS key changes the material used for new operations while retaining material for older ciphertext. It does not re-encrypt old data or revoke a compromised credential. Automatic and on-demand rotation support varies by key origin, type and store; verify eligibility. An alias is a regional name pointing to a key; changing the target does not migrate ciphertext. Deleting a key can permanently prevent decryption, including backups. Protect deletion permissions, inventory dependencies and test restoration before any approved lifecycle change. Incident recovery may require containment, credential revocation, new keys and controlled re-encryption, not merely rotation.
Constrain grants and bind context
A KMS grant can allow selected operations to a grantee on one key. Limit CreateGrant authority because it can delegate use; service integrations may need narrowly constrained grants. For symmetric encryption, encryption context is additional authenticated data: non-secret key-value metadata that must match when decrypting. It can also constrain key policies and grants. Example: a fictional report encrypted with app=reports and stage=demo must use the same context at decrypt. A grant constrained by EncryptionContextEquals also rejects an extra field; EncryptionContextSubset can allow additional fields. Context can appear in logs, so never put personal data or secrets in it. Context alone does not grant authorization.
Certificates have their own lifecycle
ACM provides certificates for TLS; public certificates establish public trust while AWS Private CA issues certificates for private trust hierarchies. A client must trust the appropriate CA and validate the hostname and expiry. For an internal reports endpoint, use a supported certificate integration and distribute the approved private trust anchor where required. Managed renewal applies only to eligible ACM certificates; imported certificates, direct Private CA issuance and ACM ACME workflows need their respective renewal processes. Verify actual deployment of renewed certificates, monitor expiry and budget for CA operation and issuance. Certificate rotation is separate from KMS key rotation.
Offline review: predict before acting
The synthetic fixture below models a narrow decrypt decision and promotion eligibility. Predict the result if the context changes, permission is absent, the key is unavailable or the pending credential has not passed a target test. The expected original result is allow and eligible to promote. This model performs no encryption, evaluates no actual policies, and changes no credentials. It does not establish that a previous credential remains valid or that a real rotation is safe. Run the offline tests and explain why a matching context and a tested pending version are different controls.
{ "keyAvailable": true, "authorized": true, "storedContext": { "app": "reports", "stage": "demo" }, "requestContext": { "app": "reports", "stage": "demo" }, "targetUpdated": true, "targetTestPassed": true, "pendingVersion": "version-demo-2", "currentVersion": "version-demo-1"}Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Rotation, grants and encryption context — knowledge check
Reason about synthetic encryption and credential lifecycle cases.
What does eligible KMS key rotation do to old ciphertext?
Which encryption context is suitable?
What does EncryptionContextEquals require in a grant?
Does changing a key alias migrate encrypted backups?
Which certificate requires its own renewal process rather than ACM managed renewal?