Can I programatically retrieve the location an EFS backup was restored to?

0

I'm trying to restore data in EFS from recovery points managed by AWS Backup. It seems AWS Backup does not support destructive restores and will always restore to a directory in the target EFS file system, even when creating a new one.

I would like to sync the data extracted from such a recovery point to another volume, but right now I can only do this manually as I need to lookup the directory name that is used by the start-restore-job operation (e.g. aws-backup-restore_2022-05-16T11-01-17-599Z).

Looking through the documentation I can't find either of:

  • an option to set the name of the directory used
  • the value of directory name returned in any call (either start-restore-job or describe-restore-job)

I have also checked how the name of the directory maps to the creationDate and completionDate of the restore job but it seems neither match.

Is there any way for me to do one of these two things? Both of them missing make restoring a file system from a recovery point in an automated fashion very hard.

質問済み 2年前392ビュー
1回答
0

Hi, I understand you want to programmatically retrieve the location of your restored EFS backup.

In terms of data centres, You cannot retrieve the location an EFS backup was restored to. AWS Backup ensures data integrity with its non-destructive restore approach for EFS backups. You are correct AWS Backup does not support destructive restores, for more details on this you can following below link: Restoring an Amazon EFS file system - https://docs.aws.amazon.com/aws-backup/latest/devguide/restoring-efs.html When restoring an EFS file system currently we support the below two options: Full restore option to restore the file system in its entirety including all root level folders and files to a new file system. Restore a specific file or directory, this option always creates a directory in the format aws-backup-restore_timestamp-of-restore. See below link for more details: a recovery point - https://docs.aws.amazon.com/efs/latest/ug/awsbackup.html#restoring-backup-efs When you perform a full restore, the entire file system is restored. When you perform an item-level restore, AWS Backup restores a specific file or directory. You must specify the relative path related to the mount point [1]

In terms of region, Yes you can retrieve the region’s location. Firstly, I suggest you check your AWS CloudTrail to check your events history. AWS Backup is integrated with AWS CloudTrail, a service that provides a record of actions taken by a user, role, or an AWS service in AWS Backup. CloudTrail captures all API calls for AWS Backup as events. The calls captured include calls from the AWS Backup console and code calls to the AWS Backup API operations. If you create a trail, you can enable continuous delivery of CloudTrail events to an Amazon S3 bucket, including events for AWS Backup. If you don't configure a trail, you can still view the most recent events in the CloudTrail console in Event history. Using the information collected by CloudTrail, you can determine the request that was made to AWS Backup, the IP address from which the request was made, who made the request, when it was made, and additional details [2]. On your AWS Backup log file entries, look for ‘awsRegion’.

To automate the sync of data extracted from an EFS recovery point to another volume or to perform other automated tasks related to the restored data, you can create a custom script or program that automates the process. Since AWS Backup does not provide direct access to the specific directory name used during the restore operation, you would need to perform some additional steps to achieve this [3]

With the above mentioned I suggest you perform an item-level restore instead of full restore when you want to restore your EFS backup. Item-level restores a specific file or directory. You can programatically restore an Amazon EFS file system from an AWS Backup recovery point using the AWS CLI [4]

References: [1] Restoring an Amazon EFS file system: https://docs.aws.amazon.com/aws-backup/latest/devguide/restoring-efs.html

[2] Logging AWS Backup API calls with CloudTrail: https://docs.aws.amazon.com/aws-backup/latest/devguide/logging-using-cloudtrail.html

[3] Configuring AWS DataSync transfers with Amazon EFS, https://docs.aws.amazon.com/datasync/latest/userguide/create-efs-location.html

[4] Restore an Amazon EFS file system from an AWS Backup recovery point using the AWS CLI: https://repost.aws/knowledge-center/aws-backup-restore-efs-file-system-cli

AWS
回答済み 9ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン