Skip to content

Instantly share code, notes, and snippets.

@koladilip
Created June 21, 2018 10:40
Show Gist options
  • Save koladilip/4d28311e0fff6962dbdc0d92d58610bf to your computer and use it in GitHub Desktop.
Save koladilip/4d28311e0fff6962dbdc0d92d58610bf to your computer and use it in GitHub Desktop.
State machine definition for step function to export cloudwatch logs to S3 using lambda: https://gist.github.com/koladilip/780643318b5fba48abc026d9992d8e36
{
"Comment": "Cloudwatch logs to S3 export task",
"StartAt": "CreateExportTask",
"States": {
"CreateExportTask": {
"Type": "Task",
"Resource": "arn:aws:lambda:eu-west-1:<awws-account-id>:function:CloudwatchLogsToS3Exporter",
"Next": "IsAllLogsExported"
},
"IsAllLogsExported": {
"Type": "Choice",
"Choices": [
{
"Variable": "$.continue",
"BooleanEquals": true,
"Next": "CreateExportTask"
}
],
"Default": "SuccessState"
},
"SuccessState": {
"Type": "Succeed"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment