A Cloud Architect Company
RDS snapshot
Amazon Web Services

How to share RDS Snapshot from an AWS Account to another AWS account and restoring it

AWS offers a database service called RDS(Relational Database Service). In AWS we can create a snapshot from an existing database and restore it to create a new database. But when it comes to sharing the snapshot to a different AWS account, there is a little procedure to make this work. So here we are going to know about how to share a RDS snapshot from an AWS Account to another AWS Account.

Preparing the RDS snapshot to share

  • Login to your AWS account which contains your RDS database.
  • Go to RDS and snapshots and click the Automated section, you are able to see your RDS snapshot.
  • Select the snapshot you want to share and click Actions.
  • As you can see in the picture below, you are not able to click the Share snapshot button.
  • If you want to share your snapshot to another account, you need to create a KMS key with some permissions to the another aws account.

Share RDS snapshot different account Select Snapshot

Creating KMS Key

  • Let’s take this account as Account A and the other account as Account B.
  • So now we are going to create a KMS key and add the IAM user of Account A. Because we have to give full authority on the KMS key to our user.
  • Go to the KMS key and click on the Customer managed keys section, then click the Create key button.

Share RDS snapshot different account Create KMS Key

Select the options in the first page as default like the picture below. Click Next.

Share RDS snapshot different account Configure KMS Key

Enter an alias name to your KMS key and give a description and click Next.

 

Also Read: How to setup RDS auto scaling in AWS within 15 minutes

 

Share RDS snapshot different account Add Lables KMS Key

Now we need to add the IAM users which is used to maintain the KMS keys which we are creating and also enable the Allow key administrators to delete this key and then click on Next

Share RDS snapshot different account Add Admin Permissions in KMS Key

Now Click on Add Another AWS account.

Share RDS snapshot different account Add Another Account in KMS Key

Add the Account B’s account ID like the below screenshot. Then click the Next button.

Share RDS snapshot different account Add Another Account ID KMS Key

And finally click Finish to complete the creation of the KMS key.

Share RDS snapshot different account Add Key Policy KMS Key

Copy the Snapshot and Add KMS key

  • Navigate to the RDS snapshot which we look at the starting stage of this article.
  • Select the snapshot and click the Actions, then click the Copy snapshot.

Share RDS snapshot different account Copy Snapshot

  • Select the Destination Region. For now I select the same region that we are working in now.
  • In the New DB Snapshot identifier window, provide a name for your new snapshot.

Share RDS snapshot different account Copy Snapshot Name

  • Scroll down to the bottom and Click the Enable Encryption check box and add the KMS key which we created just a few minutes ago.
  • Finally click copy snapshot to create a new snapshot.

Share RDS snapshot different account Copy Snapshot Enable ENcryption

Sharing the RDS snapshot with Account B

  • Inside the snapshots sections go to the Manual section and you can see a newly created database snapshot.
  • Select the snapshot and click the Actions button.
  • Now you are able to see the Share snapshot option. Click it.

Share RDS snapshot different account Share Snapshot

Here please input your Account B’s Account ID and click Add then click Save.

Share RDS snapshot different account Add Account B ID

Restore the snapshot in Account B

  • Login to the AWS console of Account B.
  • Go to the RDS and Snapshots section and  select Shared with me.
  • Here you can see the RDS snapshot from Account A.
  • Select the snapshot, click Actions and click Copy snapshot.

Share RDS snapshot different account Copy Snapshot in Account B

Enter a name for a new snapshot.

Share RDS snapshot different account Copy Snapshot in Account B with Name

Add the default KMS key and then click Copy snapshot.

Share RDS snapshot different account Copy Snapshot in Account B Add key

Once the copying the snapshot is completed you can find the snapshot in under the Manual section.

Share RDS snapshot different account Restore Snapshot in Account B

Select the RDS snapshot and click Actions and click the Restore snapshot to Create a new RDS Database from the snapshot.

This is a simplest and a secured way to share a RDS database snapshot from an AWS account to another AWS Account.

 

Article written by:

Jerin is working as a Junior Cloud Automation Engineer at EasyDeploy Technologies Pvt. Ltd. He is writing terraform scripts that creates services on AWS cloud. He can able to handle CI-CD process using AWS CodePipeline.

Leave a Reply

Your email address will not be published. Required fields are marked *

back to top

Contact Us to save your AWS bill by 40%

X