Interview Databases & Caching

How do you encrypt an RDS instance at rest, and can you encrypt an existing unencrypted one?

Databases & Caching · Basic level

Answer

New RDS instances should be encrypted at creation with KMS. Existing unencrypted RDS storage cannot simply be encrypted in place; the normal method is snapshot, copy snapshot with encryption enabled, restore a new encrypted instance, validate, and cut over.

Technical explanation

Encryption covers storage and related backups/snapshots according to RDS and KMS behavior.

KMS key policy and cross-account or cross-Region permissions must be planned.

Because restore creates a new endpoint, cutover and rollback must be part of the migration plan.

Hands-on example

Encryption conversion example:

$ aws rds create-db-snapshot --db-instance-identifier legacy-orders --db-snapshot-identifier legacy-orders-pre-encryption

$ aws rds copy-db-snapshot --source-db-snapshot-identifier legacy-orders-pre-encryption --target-db-snapshot-identifier legacy-orders-encrypted --kms-key-id alias/rds-prod

$ aws rds restore-db-instance-from-db-snapshot --db-instance-identifier orders-encrypted --db-snapshot-identifier legacy-orders-encrypted

Preparing for an interview?

Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.

More Databases & Caching interview questions

← All Databases & Caching questions