Skip to content

Instantly share code, notes, and snippets.

@aliartiza75
Created June 18, 2021 07:51
Show Gist options
  • Save aliartiza75/772ee8d4ef3e912695b5684275e08def to your computer and use it in GitHub Desktop.
Save aliartiza75/772ee8d4ef3e912695b5684275e08def to your computer and use it in GitHub Desktop.
It contains state machine definition for RDS snapshot creation and migration lambda.
{
"Comment": "Migrate RDS snapshots for disaster recovery",
"StartAt": "MigrateRDSSnapshots",
"States": {
"MigrateRDSSnapshots": {
"Type": "Task",
"Resource": "arn:aws:lambda:XX-XXXX-2:XXXXXX:function:migrate-rds-snapshots",
"Retry": [
{
"ErrorEquals": [
"Lambda.ServiceException",
"Lambda.AWSLambdaException",
"Lambda.SdkClientException"
],
"IntervalSeconds": 2,
"MaxAttempts": 6,
"BackoffRate": 2
}
],
"InputPath": "$",
"ResultPath": "$",
"Comment": "It will create RDS snapshots and migrate(copy) to another region.",
"Next": "CheckSnapshotsMigrated"
},
"CheckSnapshotsMigrated": {
"Type": "Choice",
"Choices": [
{
"Variable": "$.MigrationCompleted",
"BooleanEquals": false,
"Next": "MigrateRDSSnapshots"
}
],
"Default": "Done"
},
"Done": {
"Type": "Pass",
"End": true
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment