How listentolearn/aws-event-driven-architecture works
This repository is not an application runtime; it is a small infrastructure/policy repo for an AWS event-driven pipeline. Its purpose is to define the access and routing rules that let events move through the system safely and with loose coupling.
The target architecture described in the README is:
• Event producer: Amazon S3
• Event ingestion / topic layer: Amazon SNS
• Event buffering / stream-like handoff: Amazon SQS
• Event consumer: AWS Lambda
The main architectural idea is decoupling. S3 emits object events, but it does not talk directly to the consumer. Instead, events are published to SNS, which fans them out to one or more subscribers. SQS sits between SNS and Lambda to absorb bursts, preserve messages, and reduce direct dependency between producer and consumer availability.
The repo contains four policy artifacts that support this flow:
• sns-access-policy.json: permissions for publishing to or interacting with the SNS topic
• sqs-access-policy.json: permissions for sending to or consuming from the SQS queue
• subscription-filter-policy.json: SNS subscription filtering so only matching events are forwarded to a given subscription
• lambda-policy.json: IAM permissions for the Lambda execution role
The subscription filter policy is an important boundary in the design. It means the SNS topic can carry many event types, while each downstream queue/consumer can receive only the subset it cares about. That lets multiple consumers share the same topic without each receiving irrelevant traffic.
The SQS queue acts as the operational buffer between event ingestion and processing. This is the point where backpressure and retry behavior are handled: SNS delivers messages to SQS, and Lambda later polls or is triggered from the queue. This is what makes the system resilient to temporary consumer slowdown or failure.
The Lambda policy represents the final execution boundary. It grants the function the permissions it needs to operate in this architecture, typically including reading messages from SQS and writing logs or other AWS-side side effects. The function itself is not present in this repo; only the IAM policy needed to run it is.
There is no application business logic, database layer, or UI in this repository. The architectural scope is limited to event-routing, access control, and subscription filtering for an AWS-based asynchronous pipeline.
For an architecture diagram, the important elements to show are:
• S3 as the producer
• SNS as the central event distribution layer
• SQS as the durable handoff queue
• Lambda as the consumer
• Policy documents as the security/routing glue between those AWS services
In short: this repo defines the infrastructure permissions and subscription rules for an S3 → SNS → SQS → Lambda event-driven design, with SNS filtering and IAM policies enforcing the boundaries between components.
Main entry points: sns-access-policy.json SNS policy · sqs-access-policy.json SQS policy · lambda-policy.json Lambda policy · subscription-filter-policy.json Filter policy
Components 8
AWS flow
Event producer, distribution, buffering, and consumer components.
- S3 · Emits object events that start the pipeline.
- SNS · Central fanout layer for incoming events.
- SQS · Durable handoff that absorbs bursts and decouples delivery.
- Lambda · Downstream processor for queued events.
Repo policies
Policy artifacts that control access and routing for the AWS event path.
- SNS policy · Permissions for publishing to or interacting with the SNS topic.
sns-access-policy.json - SQS policy · Permissions for sending to or consuming from the SQS queue.
sqs-access-policy.json - Filter policy · Routes only matching SNS events to a subscription.
subscription-filter-policy.json - Lambda policy · Execution-role permissions for the Lambda consumer.
lambda-policy.json
Connections 10
- S3 → SNS: publish events · S3 object events enter the topic layer.
- SNS → SQS: fanout · SNS delivers matching notifications to the queue.
- SQS → Lambda: trigger / poll · Lambda consumes buffered messages from SQS.
- Filter policy → SNS: subscription rules · Constrains which events are forwarded to this subscription.
- SNS policy → SNS: access control · Defines permitted SNS interactions.
- SQS policy → SQS: access control · Defines permitted queue interactions.
- Lambda policy → Lambda: execution perms · Defines what the function can do when processing messages.
- SNS policy → S3: publish permission · Allows the producer side to publish into the topic.
- SQS policy → SNS: queue subscribe · Supports SNS-to-SQS delivery path.
- Lambda policy → SQS: read messages · Supports Lambda consumption from the queue.