This utility is to automatize recovery of EC2's or On-Prem VM's(which are registered in AWS DRS) to AWS . We have adhered to best practices of AWS Lambda + AWS DRS services.
- Automate recovery of applications hosted in Ec2 during an event of disaster. (Recovery can be Point-In-time or Latest)
- Perform DR drills of applications
- AWS DRS agent installed and configured in your EC2 or VM,visit Source server registrtion
- AWS DRS EC2 launch template configured,visit DRS Launch Template
- Recovery instance launch settings,visit Ec2 Launch Settings
- S3 bucket
- This repository uses CloudFormation template to launch the resources in AWS.Below are the services launched by CFT
- AWS Lambda with Python 3.9 Runtime.
- IAM Role with IAM policy required to restore servers using AWS DRS
- Lambda function uses Boto3 to make AWS DRS API calls to perform recovery opertaions.
- Upload drs-repl.zip to an S3 bucket and note the path
- Create a CloudFormation Stack using the lambda.yaml template
- Event to be passed to AWS Lambda:
- For Point In Time Recovery (use Snapshot ID):
{ "IsDrill": "False", "SourceId": "s-xyzx1231sadasd231", "Snapshot_Id": "snap-0ewasd12342121o" }
- Recover application servers from LATEST data (Don't pass any snapshot ID):
{ "IsDrill": "False", "SourceId": "s-xyzx1231sadasd231", "Snapshot_Id": "" }
- For Point In Time Recovery (use Snapshot ID):
- You can invocate your lambda in multiple ways, visit Invoking Lambda functions
- pLambdaFnName - Valid name of the Lambda function
- pBucketName - S3 bucket name where lambda deployment (.zip) file is uploaded
- pZipFilepath - Exact path of lambda deployment (.zip) file is uploaded (ex:lambda/backend.zip )