Skip to content

Commit

Permalink
updating state machine to include new steps
Browse files Browse the repository at this point in the history
  • Loading branch information
namitad committed Oct 19, 2023
1 parent 838c1b5 commit f84463d
Showing 1 changed file with 49 additions and 2 deletions.
51 changes: 49 additions & 2 deletions template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -681,8 +681,53 @@ Resources:
!Sub
- |-
{
"StartAt": "ShouldRestoreClusterOrInstance",
"StartAt": "IsTaskRestoreInTargetAccountsAndRegions",
"States": {
"IsTaskRestoreInTargetAccountsAndRegions": {
"Type": "Choice",
"Choices": [{
"Variable": "$.task",
"StringEquals": "restore_rds_in_target_accounts",
"Next": "ShareRDSSnapshot"
}],
"Default": "ShouldRestoreClusterOrInstance"
},
"ShareRDSSnapshot": {
"Type": "Task",
"Resource": "${ShareSnapshotLambdaArn}",
"Next": "RestoreRDSInTargetAccountAndRegion",
"ResultPath": "$.output",
"Retry": [{
"ErrorEquals": ["AutomationExecutionLimitExceededException"],
"IntervalSeconds": 10,
"MaxAttempts": 5,
"BackoffRate": 2.0
}],
"Catch": [
{
"ErrorEquals": [ "States.ALL" ],
"Next": "FailedState"
}
]
},
"RestoreRDSInTargetAccountAndRegion": {
"Type": "Task",
"Resource": "${RestoreRDSInTargetAccountsAndRegionsLambdaArn}",
"Next": "RestorePipelineComplete",
"ResultPath": "$.output",
"Retry": [{
"ErrorEquals": ["AutomationExecutionLimitExceededException"],
"IntervalSeconds": 10,
"MaxAttempts": 5,
"BackoffRate": 2.0
}],
"Catch": [
{
"ErrorEquals": [ "States.ALL" ],
"Next": "FailedState"
}
]
},
"ShouldRestoreClusterOrInstance": {
"Type": "Choice",
"Choices": [{
Expand Down Expand Up @@ -1372,7 +1417,9 @@ Resources:
DBDeleteLambdaArn: !GetAtt DeleteInstanceLambdaFunction.Arn,
DBSnapshotExportLambdaArn: !GetAtt SnapshotExportLambdaFunction.Arn,
EmailAlertLambdaArn: !GetAtt EmailAlertLambdaFunction.Arn,
SlackAlertLambdaArn: !GetAtt SlackAlertLambdaFunction.Arn
SlackAlertLambdaArn: !GetAtt SlackAlertLambdaFunction.Arn,
ShareSnapshotLambdaArn: !GetAtt ShareSnapshotLambdaFunction.Arn,
RestoreRDSInTargetAccountsAndRegionsLambda: !GetAtt RestoreRDSInTargetAccountsAndRegionsLambdaFunction.Arn
}
RoleArn: !GetAtt StatesExecutionRole.Arn

Expand Down

0 comments on commit f84463d

Please sign in to comment.