This Banner is For Sale !!
Get your ad here for a week in 20$ only and get upto 15k traffic Daily!!!

How to use AWS Backup cross-account backup to copy and restore DynamoDB tables between AWS accounts


On this article, I’m going to point out you tips on how to copy and restore DynamoDB tables utilizing AWS Backup – cross-account backup between 2 AWS accounts.

To ensure that the cross-account to work, you need to add your 2 accounts (Supply Account A and Goal Account B) to the identical Group within the Group Service.

DynamoDB is a key-value, non-relational database that makes use of a easy key-value technique to retailer information. A key-value database shops information as a set of key-value pairs during which a key serves as a singular identifier, which known as the Main Key. Also called Partition Key / Hash Key.

DynamoDB is totally built-in with AWS Backups. You should use the DynamoDB console, API, and AWS Command Line Interface (AWS CLI) to allow computerized backups and restore to your DynamoDB tables.

As per AWS, “AWS Backup is a fully-managed service that makes it simple to centralize and automate information safety throughout AWS providers, within the cloud, and on premises. Utilizing this service, you possibly can configure backup insurance policies and monitor exercise to your AWS sources in a single place. It lets you automate and consolidate backup duties that had been beforehand carried out service-by-service, and removes the necessity to create customized scripts and handbook processes.”

You should use AWS Backup to handle your backups throughout all AWS accounts. AWS Backup helps backing up and restoring Amazon DynamoDB tables.

Cross-account backups are helpful for safety causes. In case your unique information backup from the Supply account acquired deleted by mistake, you possibly can at all times copy and sync the backup from its vacation spot account after which do a restore. A standard use case can be to repeat your information from Manufacturing surroundings to the Growth, and Testing environments.

  • 2 accounts (Supply Account A and Goal Account B) must be in the identical Group.
  • Activate AWS Backup options within the Supply Account A and Goal Account B
  • Create backup vaults within the Supply Account A and Goal Account B
  • In Supply Account A, Create the DynamoDB desk and Create a backup within the AWS Backup backup vault.
  • From the Supply Account A, Provoke and duplicate the backup to the backup vault within the Goal account B.
  • Within the Goal account B, restore the DynamoDb desk utilizing the backup from the goal account backup vault.
  • Check the set-up
  • Cleanup
  • Entry to Amazon Administration Console with an AWS IAM consumer Account
    (not root account).
  • Cloud9 IDE with AWS CLI.

1. Creating backups of DynamoDB tables with AWS Backup {https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/CreateBackupAWS.html}
2. Creating backup copies throughout AWS accounts {https://docs.aws.amazon.com/aws-backup/latest/devguide/create-cross-account-backup.html}

Let’s get began

Please go to my GitHub Repository for DynamoDB articles on numerous subjects being up to date on fixed foundation.

Within the Supply Account A and the Goal Account B:

  • On AWS Backup console / Settings / Underneath Superior options for Amazon DynamoDB backups / Superior options – Enabled

  • Underneath Cross-account administration / Cross-account backup / Flip On Allow

Supply Account A – Advance Options Enabled

Image description

Supply Account A – Cross-account backup Enabled

Image description

Goal Account B – Advance Options Enabled

Image description

Goal Account B – Cross-account backup Enabled

Image description



Create backup vaults within the Supply Account A and Goal Account B

Supply Account A – Create Backup vault

  • On AWS Backup console / Backup vaults / Create Backup vault (aside from Default)

Backup vault title: AccountA-Backupvault
Encryption key: From drop-down – choose (default) aws backup
Create backup vault

Image description

  • From the Backup vaults / Select – AccountA-Backupvault
  • Entry Coverage / Add permissions / Permit entry to a Backup vault from group.
  • Subsequent web page – Add permissions: Permit entry to a Backup vault from group / Entry Coverage Particulars / ought to see – “Permit” backup:CopyIntoBackupVault
  • Save coverage

Image description

Goal Account B – Create Backup vault

  • On AWS Backup console / Backup vaults / Create Backup vault (aside from Default)

Backup vault title: AccountB-Backupvault
Encryption key: From drop-down – choose (default) aws backup
Create backup vault

Image description

  • From the Backup vaults / Select – AccountB-Backupvault
  • Entry Coverage / Add permissions / Permit entry to a Backup vault from group.
  • Subsequent web page – Add permissions: Permit entry to a Backup vault from group / Entry Coverage Particulars / ought to see – “Permit” backup:CopyIntoBackupVault
  • Save coverage

Image description

  • Copy the Amazon Useful resource Title (ARN) of the backup vaults of Supply Account A and Goal Account B and reserve it on a notepad.

These are required whenever you copy the DynamoDB desk backup between the supply account and the goal account.



In Supply Account A, Create the DynamoDB desk and Create a backup within the AWS Backup backup vault

Supply Account A – Create a DynamoDB desk

aws dynamodb create-table 
    --table-name Well-known-Motion pictures 
    --attribute-definitions 
        AttributeName=Title,AttributeType=S 
    --key-schema 
        AttributeName=Title,KeyType=HASH 
    --provisioned-throughput 
        ReadCapacityUnits=10,WriteCapacityUnits=5
aws dynamodb wait table-exists --table-name Well-known-Motion pictures
Enter fullscreen mode

Exit fullscreen mode

aws dynamodb describe-table --table-name Well-known-Motion pictures | grep TableStatus
Enter fullscreen mode

Exit fullscreen mode

Image description

Image description

Supply Account A – Create a backup within the AWS Backup backup vault

On the AWS Backup Dashboard web page / Select Create on-demand backup / Underneath Create on-demand backup / Underneath Settings

Useful resource kind: choose DynamoDB
Desk title: choose DynamoDB Desk that you simply simply now created – Well-known-Motion pictures
Retention interval: At all times
Backupvault dropdown checklist: choose the backup vault that you simply created within the Supply Account A – AccountABackupvault.
Create on-demand backup

Standing Backup in progress for desk/Well-known-Motion pictures.
Relying on the scale of the useful resource, this may take a number of hours. For standing updates, refresh the web page.
Standing Accomplished

Image description



From the Supply Account A, Provoke and duplicate the backup to the backup vault within the Goal account B.

  • On the AWS Backup Dashboard web page / Backup vaults / Select AccountA-Backupvault
  • Underneath AccountA-Backupvault / Restoration factors / choose the Restoration level ID of the backup you wish to copy
  • Underneath Actions drop-down / choose copy
  • Underneath Copy 1fe84698-b652-4c84-a784-52a9ed042761 – DynamoDB / Copy configuration / Copy to vacation spot / Enter the AWS Area of the goal account – US-East (N.Virginia)
  • Select Copy to a different account’s vault – turns “blue” when chosen
  • Exterior vault ARN – enter the ARN of the backup vault of Goal Account B
  • Permit Backup vault entry – Permit entry to the account 664233888553 to repeat backups to your Backup vault “AccountA-Backupvault” ——> Permit
  • Permit Backup vault entry?
    Permit the account “664233888553” to repeat information again into your account by including permissions to your Backup vault “AccountA-Backupvault” entry coverage. Permissions may be edited on the Backup vault element web page ——> Permit
  • Backup restoration has been enabled in your vault “AccountA-Backupvault”
    Modifications to your Backup vault’s entry coverage may be made in your vault’s element web page – Checked
    **Copy
  • Standing – Copy in progress for 1fe84698-b652-4c84-a784-52a9ed042761
    Relying on the scale of the useful resource, this course of might take a number of hours

Standing
Accomplished

Image description



Within the Goal account B, restore the DynamoDb desk utilizing the backup from the goal account backup vault.

Goal Account B

  • On the AWS Backup console / choose Backup vaults – AccountB-backupvault
  • Underneath AccountB-Backupvault / underneath Restoration factors / choose Restoration level ID
  • Actions drop-down – choose Restore
  • Underneath Restore backup / Settings / New desk title – Enter the brand new title of the goal DynamoDB desk that you simply wish to restore – Well-known-Motion pictures-New
  • Click on Restore
  • Underneath Restore in progress for 3bbce81d-50e6-4845-9d5f-1c1ed81c61af
    This will likely take a number of hours. For standing updates and to view the useful resource, go to the DynamoDB console

Standing
Accomplished

Image description

On the DynamoDB Console / Tables / Title

Image description

New DynamoDB desk is restored and created – Well-known-Motion pictures-New

Supply Account A

  • Delete DynamoDB desk – Well-known-Motion pictures
  • Underneath AWS Backups / Settings – Disable Superior options for DynamoDB Backups
  • Disable cross-account backup
  • Underneath Restoration Factors / delete Restoration level ID
  • Delete Backup vault – AccountA-Backupvault

Goal Account B

  • Delete DynamoDB desk – Well-known-Motion pictures-New
  • Underneath AWS Backups / Settings – Disable Superior options for DynamoDB Backups
  • Disable cross-account backup
  • Underneath Restoration Factors / delete Restoration level ID
  • Delete Backup vault – AccountB-Backupvault

Efficiently demonstrated tips on how to create, copy and restore DynamoDB tables between 2 AWS accounts in an Group utilizing AWS Backup cross-account backup.

The Article was Inspired from tech community site.
Contact us if this is inspired from your article and we will give you credit for it for serving the community.

This Banner is For Sale !!
Get your ad here for a week in 20$ only and get upto 10k Tech related traffic daily !!!

Leave a Reply

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

Want to Contribute to us or want to have 15k+ Audience read your Article ? Or Just want to make a strong Backlink?