New to Kestra?
Use blueprints to kickstart your first workflows.
Build an event-aware AWS S3 ingestion pipeline with Kestra using Git, Python, Apache Iceberg, AWS Glue, and Amazon Athena. Automate lakehouse ETL on schedule.
This blueprint automates incremental data ingestion into an AWS S3 data lakehouse built on Apache Iceberg, AWS Glue, and Amazon Athena. It solves a common ETL problem: detecting newly landed raw files, transforming them with versioned Python code from Git, merging them into Iceberg tables, and compacting the result, all without manual intervention or a standing data pipeline service. The flow keeps your transformation logic reproducible by cloning it fresh from a Git repository on every run.
list_objects (io.kestra.plugin.aws.s3.List) scans the configured bucket and prefix for new raw CSV files.check (io.kestra.plugin.core.flow.If) evaluates outputs.list_objects.objects and only proceeds when new files exist.process_new_objects (io.kestra.plugin.core.flow.WorkingDirectory) wraps the transformation step. Inside it, clone_repository (io.kestra.plugin.git.Clone) pulls the ETL scripts from GitHub, then ingest_to_datalake (io.kestra.plugin.scripts.python.Commands) runs etl/aws_iceberg_fruit.py in a Docker taskRunner with awswrangler and kestra installed, writing cleaned data into the Iceberg lake.merge_query (io.kestra.plugin.aws.athena.Query) runs a MERGE INTO statement to upsert raw rows into the target Iceberg table.optimize (io.kestra.plugin.aws.athena.Query) runs OPTIMIZE ... REWRITE DATA USING BIN_PACK to compact small files.move_to_archive (io.kestra.plugin.aws.cli.AwsCLI) moves processed files to an archive/ prefix so they are not reprocessed.A Schedule trigger (@hourly, shipped disabled) drives the cadence.
MERGE INTO, with automatic table compaction.AWS scheduling primitives like EventBridge or Glue triggers can start a job, but they do not give you a single declarative pipeline that conditionally branches on detected files, clones versioned code, runs containerized Python, and chains Athena queries with built-in retries and full execution lineage. Kestra expresses the whole flow as readable YAML, captures inputs, outputs, and logs per task, and lets you swap the disabled schedule for event triggers or webhook triggers without rewriting the logic.
github.com/kestra-io/scripts).AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_DEFAULT_REGIONbucket, prefix, and database variables to match your environment.clone_repository at your own scripts repo and command if needed.hourly_schedule trigger.Schedule trigger with an S3 event or webhook trigger for near-real-time ingestion.merge_query.