Last active
November 21, 2020 10:35
-
-
Save rhosys-service-account/43bd1f774be877766303db2d22101321 to your computer and use it in GitHub Desktop.
Step Function execution example including error handling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Example used to support creating custom domains with https://authress.io */ | |
const stepFunctionResource = { | |
"Type": "AWS::StepFunctions::StateMachine", | |
"Properties": { | |
"StateMachineName": { | |
"Fn::Sub": "${AWS::StackName}-CustomDomain" | |
}, | |
"LoggingConfiguration": { | |
"Destinations": [{ | |
"CloudWatchLogsLogGroup": { | |
"LogGroupArn": { | |
"Fn::Sub": "${CloudWatchLambdaLogGroup.Arn}" | |
} | |
} | |
}], | |
"IncludeExecutionData": true, | |
"Level": "FATAL" | |
}, | |
"DefinitionString": { | |
"Fn::Sub": JSON.stringify({ | |
"StartAt": "Start", | |
"States": { | |
"Start": { | |
"Type": "Task", | |
"Resource": "${ProductionAlias}", | |
"Parameters": { | |
"context.$": "$$" | |
}, | |
"ResultPath": "$.executionResult", | |
"Next": "Verify", | |
"Retry": [{ | |
"ErrorEquals": ["States.ALL"], | |
"IntervalSeconds": 10, | |
"MaxAttempts": 18, | |
"BackoffRate": 2 | |
}] | |
}, | |
"Verify": { | |
"Type": "Task", | |
"Resource": "${ProductionAlias}", | |
"Parameters": { | |
"context.$": "$$" | |
}, | |
"ResultPath": "$.executionResult", | |
"End": true, | |
"Retry": [{ | |
"ErrorEquals": ["States.ALL"], | |
"IntervalSeconds": 10, | |
"MaxAttempts": 18, | |
"BackoffRate": 2 | |
}] | |
} | |
} | |
}) | |
}, | |
"RoleArn": { "Fn::GetAtt": ["StepFunctionRole", "Arn"] } | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment