processing-s3-uploads-with-step-functions

Deploy an event-driven Step Functions workflow routing S3 uploads to Lambda or Fargate by file size.

Updated Sep 8, 2026
One-click install
npx skills add https://github.com/dennisvink/yolomancer --skill processing-s3-uploads-with-step-functions-dennisvink
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: processing-s3-uploads-with-step-functions
Source: https://github.com/dennisvink/yolomancer/tree/main/skills/aws/specialized-skills/serverless-skills/processing-s3-uploads-with-step-functions
Command: npx skills add https://github.com/dennisvink/yolomancer --skill processing-s3-uploads-with-step-functions-dennisvink

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires boto3, and includes scripts (resource) and references (resource) components.

What problem does it solve? Processing S3 uploads often requires different compute depending on file size: Lambda is cost-effective for small files but cannot handle large ones. This Skill automates the full AWS deployment of an event-driven pipeline where EventBridge triggers a Step Functions state machine on S3 uploads, routing small files to Lambda and large files to a Fargate task. ## Core Features & Use Cases - Size-Based Routing: A Step Functions Choice state sends files up to 6 MB to a Python 3.12 Lambda function and larger files to an ECS Fargate task. - Complete Infrastructure Provisioning: Creates the S3 bucket with EventBridge notifications and KMS encryption, ECR repository, ECS cluster and task definition, VPC networking with scoped security group egress, and least-privilege IAM roles. - Built-In Observability: Configures a CloudWatch Logs group with KMS encryption, an SQS dead-letter queue for failed EventBridge invocations, and a CloudWatch alarm on Step Functions execution failures. - Use Case: A data engineering team receives mixed-size uploads from partners and needs small CSVs processed instantly in Lambda while multi-gigabyte archives run as containerized Fargate jobs, all orchestrated automatically. ## Quick Start Ask the assistant to deploy the S3 upload processing workflow with Step Functions, providing a bucket name, AWS region, ECR repository name, and state machine name.

Frequently Asked Questions about processing-s3-uploads-with-step-functions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I route S3 uploads to Lambda or Fargate based on file size?

Enable EventBridge notifications on the S3 bucket, trigger a Step Functions state machine on Object Created events, and use a Choice state on $.detail.object.size. Files over 6 MB invoke ecs:runTask on Fargate; smaller files invoke Lambda.

How do I trigger Step Functions from S3 upload events?

Enable EventBridge notifications on the bucket with put-bucket-notification-configuration, then create an EventBridge rule matching source aws.s3 and detail-type Object Created. Add the state machine as a target with an IAM role allowing states:StartExecution.

When should I use Fargate instead of Lambda for file processing?

Use Fargate when files exceed Lambda's limits, such as the 6 MB threshold used here or workloads needing more memory and longer runtimes. Lambda remains the better choice for small files due to faster startup and lower cost.

Why is my EventBridge rule not triggering Step Functions on S3 uploads?

Verify EventBridge notifications are enabled on the bucket with get-bucket-notification-configuration, confirm the rule exists with aws events describe-rule, and check the target has the correct state machine ARN and an IAM role with states:StartExecution permission.

Why does a Step Functions Fargate task get stuck in PROVISIONING?

Fargate tasks stall when subnets lack auto-assign public IP or the route table has no 0.0.0.0/0 route to an internet gateway. Verify the security group allows outbound HTTPS and DNS so the task can pull the ECR image and write logs.

What are the limitations of this S3 file processing workflow?

It is not suited for real-time streaming, where Kinesis is a better fit, and adds unnecessary orchestration if all files are small enough for direct S3-to-Lambda triggers. It also requires Docker to build and push the Fargate container image.