Amazon EventBridge to AWS Step Functions to Amazon S3

Amazon EventBridge → Step Functions

Create an AWS Step Functions workflow to export CloudWatch Logs to S3.

This template creates an AWS Step Functions workflow used to orchestrate the export of CloudWatch LogGroups with matching tags to S3 on a monthly schedule for archival purposes. The workflow is triggered using EventBridge rules. It also creates IAM execution roles with permissions to invoke Lambda functions, write to an S3 bucket, as well as the S3 bucket into which logs will be exported.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/sfn-log-export

Deploy

sam deploy --guided


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

1. Delete the stack: sam delete --stack-name STACK_NAME.
2. Confirm the stack has been deleted: aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus"

Created by:

Dmytro Protsiv

Dmytro Protsiv

Cloud Application Architect at AWS.