Trigger AWS StepFunction using S3 Bucket Event

Adesh Kotgirwar
AWS Tip
Published in
Apr 17, 2023

Here’s an code that includes a S3 bucket, an S3 event rule, and an event target that triggers the Step Function when a new file is added to the bucket:

In this example, we first define our S3 bucket (bucket) and two Lambda functions (lambda1 and lambda2) using the s3.Bucket and lambda.Function classes, respectively.

We then add a S3 event notification to the bucket using the bucket.addEventNotification method. This notification triggers an SNS topic whenever a new object is created in the bucket that matches the specified suffix.

Next, we define our Step Function and add our Lambda functions as individual steps using the tasks.LambdaInvoke class, just like in the previous example.

Finally, we define a CloudWatch Events.

Thank You for Reading….

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Published in AWS Tip

Best AWS, DevOps, Serverless, and more from top Medium writers .

Written by Adesh Kotgirwar

Software engineer, passion for technology and its potential to solve real-world problems has driven me to pursue a career in software engineering.

No responses yet

Write a response