Encrypting an Unencrypted Amazon RDS Database using a Snapshot and a Customer-Managed KMS Key

Encrypting an Unencrypted Amazon RDS Database using a Snapshot and a Customer-Managed KMS Key

Introduction

Table of contents

No heading

No headings in the article.

One of the major concerns for organizations when dealing with data in the cloud is ensuring data is secure and compliant with industry and government regulations. Amazon RDS provides several layers of security for your databases, including the ability to encrypt data at rest using keys you manage through AWS Key Management Service (KMS). However, if your existing database was set up without encryption, you might want to convert it to an encrypted state. This article will guide you through the process of encrypting an unencrypted RDS database using a snapshot and a customer-managed KMS key.

Prerequisites

  • An AWS account

  • Basic knowledge of AWS RDS and KMS

  • An existing unencrypted RDS database

Step 1: Creating a Snapshot of Your Unencrypted Database

  1. Open the Amazon RDS console, and then choose "Databases" from the navigation pane.

  2. Choose the name of the unencrypted DB instance that you want to encrypt.

  3. Choose "Take snapshot" from "Actions".

  4. For "Snapshot name", type a name for the DB snapshot.

  5. Choose "Take Snapshot".

Step 2: Creating a Customer-Managed KMS Key

While the snapshot is being created, you can create a new customer-managed KMS key:

  1. Open the AWS KMS console, then choose "Customer managed keys" from the navigation pane.

  2. Choose "Create key".

  3. Follow the prompts to add an alias, description, and necessary key administrative and usage permissions.

  4. Review and edit the key policy as needed, then finish creating the key.

Step 3: Creating a Copy of the Snapshot and Encrypting it with the KMS Key

After the snapshot is ready, you can create an encrypted copy of it:

  1. Open the Amazon RDS console, then choose "Snapshots" from the navigation pane.

  2. Choose the snapshot you created earlier.

  3. Choose "Copy snapshot" from "Actions".

  4. In the "KMS key ID" section, select the customer-managed key that you created earlier.

  5. Choose "Copy Snapshot".

Step 4: Restoring the Encrypted Snapshot to a New DB Instance

Once the encrypted snapshot copy is ready, you can restore it to a new DB instance:

  1. Open the Amazon RDS console, then choose "Snapshots" from the navigation pane.

  2. Choose the encrypted snapshot you created earlier.

  3. Choose "Restore snapshot" from "Actions".

  4. Specify the DB instance details as needed.

  5. Choose "Restore DB Instance".

Conclusion

You've successfully encrypted an unencrypted Amazon RDS database using a snapshot and a customer-managed KMS key. Remember to update any applications or services to use the new encrypted DB instance. Finally, ensure you follow best practices for key management, including regularly rotating and securely storing keys.