[{"data":1,"prerenderedAt":84},["ShallowReactive",2],{"pattern-backup-sfn-typescript-cdk":3,"pattern-group-backup-sfn-typescript-cdk":6},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":11,"deploy":13,"description":19,"extension":20,"framework":21,"gitHub":22,"highlight":6,"introBox":26,"language":32,"level":33,"meta":34,"patternArch":35,"patternGroup":6,"patternGroupLabel":6,"resources":63,"stem":77,"testing":78,"videoId":6,"__hash__":83},"patterns\u002Fpatterns\u002Fbackup-sfn-typescript-cdk.json","AWS Backup restore testing validated by AWS Step Functions",null,{"text":8},[9,10],"Delete the recovery points in the vault first, because a vault that holds recovery points cannot be deleted. The GitHub repo has the commands.","Delete the stack: \u003Ccode>npx cdk destroy\u003C\u002Fcode>.",[12],"content\u002Fcontributors\u002Fnithin-chandran-r.json",{"text":14},[15,16,17,18],"\u003Ccode>npm install\u003C\u002Fcode>","If this account and Region have never been used with the AWS CDK, run \u003Ccode>npx cdk bootstrap\u003C\u002Fcode> once.","\u003Ccode>CRON=$(node -e 'const d=new Date(Date.now()+30*60000);console.log(`cron(${d.getUTCMinutes()} ${d.getUTCHours()} * * ? *)`)')\u003C\u002Fcode>","\u003Ccode>npx cdk deploy -c restoreTestCron=\"$CRON\"\u003C\u002Fcode>","Amazon EventBridge starts an AWS Step Functions workflow when an AWS Backup restore test completes. It checks the restored Amazon DynamoDB table and reports to AWS Backup.","json","AWS CDK",{"template":23},{"patternPath":24,"templateFile":25},"backup-sfn\u002Ftypescript\u002Fcdk","lib\u002Fbackup-sfn-stack.ts",{"headline":27,"text":28},"How it works",[29,30,31],"This pattern deploys an AWS Backup restore testing plan for an Amazon DynamoDB table and an AWS Step Functions workflow that validates each restored copy. AWS Backup restores the latest recovery point on a schedule, and checking the restored data is left to you.","When the restore job completes, an Amazon EventBridge rule starts the state machine. It takes the restored table name from the event, counts the items with a `dynamodb:Scan` SDK integration (`Select` `COUNT`, `Limit` 3) and calls the AWS Backup `PutRestoreValidationResult` API once with `SUCCESSFUL` or `FAILED`, so the result appears on the restore job. There's no AWS Lambda function.","The plan runs every day at the cron time while the stack exists. Each run restores the latest recovery point from the last day, so after the one-off backup in the README expires, the plan finds nothing to restore.","TypeScript","300",{},{"icon1":36,"icon2":41,"icon3":45,"icon4":49,"line1":53,"line2":57,"line3":60},{"x":37,"y":38,"service":39,"label":40},12,45,"backup","AWS Backup\nRestore test",{"x":42,"y":38,"service":43,"label":44},37,"eventbridge","Amazon EventBridge\nRule",{"x":46,"y":38,"service":47,"label":48},63,"sfn","AWS Step Functions\nValidation",{"x":50,"y":38,"service":51,"label":52},88,"dynamodb","Amazon DynamoDB\nRestored table",{"from":54,"to":55,"label":56},"icon1","icon2","Completed",{"from":55,"to":58,"label":59},"icon3","Start",{"from":58,"to":61,"label":62},"icon4","Scan",{"bullets":64},[65,68,71,74],{"text":66,"link":67},"Restore testing in AWS Backup","https:\u002F\u002Fdocs.aws.amazon.com\u002Faws-backup\u002Flatest\u002Fdevguide\u002Frestore-testing.html",{"text":69,"link":70},"Restore testing validation","https:\u002F\u002Fdocs.aws.amazon.com\u002Faws-backup\u002Flatest\u002Fdevguide\u002Frestore-testing-validation.html",{"text":72,"link":73},"PutRestoreValidationResult API reference","https:\u002F\u002Fdocs.aws.amazon.com\u002Faws-backup\u002Flatest\u002Fdevguide\u002FAPI_PutRestoreValidationResult.html",{"text":75,"link":76},"Call AWS SDK services from AWS Step Functions","https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fsupported-services-awssdk.html","patterns\u002Fbackup-sfn-typescript-cdk",{"text":79},[80,81,82],"Put a few items into the table, take an on-demand backup with \u003Ccode>aws backup start-backup-job\u003C\u002Fcode>, then wait for the restore test to start. The plan has no run-now call: it starts at a random time within one hour after the cron time, so plan for about two hours.","Check the result with \u003Ccode>aws backup describe-restore-job\u003C\u002Fcode>. Expected: a ValidationStatus of SUCCESSFUL and a message with the restored table name.","See the GitHub repo for the exact commands, a check of the wiring that does not need to wait, and the expected output.","s75eUb0dc7FmbmfyaMVwkpNDtcD6uBW1r3UtUUOiXbc",1795189149167]