
Do You Really Need Lambda for Every AWS Integration? Exploring EventBridge Pipes
A simple look at how Amazon EventBridge Pipes connects AWS services using filtering, transformation, and enrichment without requiring custom integration code.
Do You Really Need Lambda for Every AWS Integration?
When two AWS services need to communicate with each other, one approach that often comes to mind is using AWS Lambda.
For example:
SQS → Lambda → another AWS service
Lambda is extremely useful, but sometimes we don't actually need custom code between the two services.
This is where Amazon EventBridge Pipes caught my attention.
EventBridge Pipes provides a way to connect a supported event source directly to a target, with optional filtering, transformation, and enrichment in between.
What is EventBridge Pipes?
At its simplest, an EventBridge Pipe is a connection between a source and a target.
The basic flow looks like:
Source → Filter → Enrichment → Target
The filtering and enrichment steps are optional.
This makes Pipes useful when we want to move events between services without building a separate integration layer ourselves.
Why Would We Need It?
Imagine an application that stores orders in a queue.
Every time an order arrives, we want to send certain orders to another service for processing.
One way would be to write a Lambda function that:
- Reads the message
- Checks whether it should be processed
- Changes the data
- Calls another service
That works, but now we have code to maintain.
With EventBridge Pipes, some of this integration logic can be configured directly in the pipe.
The architecture can become:
SQS → Filter → Target
No custom Lambda function is required just to perform the routing.
Sources
EventBridge Pipes supports several types of event sources.
Some examples include:
- Amazon SQS
- DynamoDB Streams
- Amazon Kinesis
- Amazon MQ
- Amazon MSK
- Apache Kafka
This makes Pipes useful for both queue-based and stream-based applications.
For example, a DynamoDB Stream can act as the source of a pipe, allowing changes in a database to be forwarded to another service.
Filtering Events
One of the features I found particularly useful is event filtering.
We don't necessarily want every event from a source to reach the target.
For example, suppose a DynamoDB stream contains events for:
- INSERT
- MODIFY
- REMOVE
But our application only needs newly created records.
Instead of sending everything to the target, we can configure a filter that only allows the relevant events through.
This means the pipe processes only the subset of events that matches the filter.
AWS also notes that you're charged for events that match the filter, which makes filtering useful from a cost perspective as well.
Enrichment
Filtering answers:
"Should this event continue?"
Enrichment answers:
"Can we add more information before sending it?"
Suppose an event contains only an order ID.
The target service needs the complete customer information as well.
An enrichment step can retrieve additional information before the event reaches the target.
EventBridge Pipes supports enrichment using services such as:
- AWS Lambda
- Amazon API Gateway
- API destinations
- AWS Step Functions
This is where Pipes becomes more than just a simple connection between two services.
Input Transformation
Another useful feature is input transformation.
The data produced by the source may not have exactly the structure that the target expects.
Instead of writing code just to reshape the payload, an input transformer can select values from the original event and create a new structure.
A Simple Example
Imagine an online store.
An order is placed and a message is added to an SQS queue.
We could create a pipe like this:
SQS → Filter → Enrichment → Step Functions
The flow could work like this:
- An order arrives in SQS.
- The pipe checks whether the event matches the required conditions.
- An enrichment step retrieves additional customer information.
- The resulting data is sent to Step Functions.
- Step Functions continues the order workflow.
The interesting part is that the pipe handles the movement and processing between these components.
Pipes vs Event Buses
EventBridge has another important feature called event buses, so it is worth understanding the difference.
Event buses are useful when we have many-to-many event routing.
For example:
Many sources → Event Bus → Many targets
Pipes are more focused on point-to-point integrations:
One source → One target
This makes Pipes useful when we already know exactly where an event needs to go.
In some architectures, both can be used together.
For example:
DynamoDB Stream → Pipe → Event Bus → Multiple Targets
The pipe handles the initial processing, while the event bus handles broader event routing.
Where Could EventBridge Pipes Be Useful?
Database Change Processing
A DynamoDB Stream can trigger a pipe whenever database records change.
Queue Processing
Messages from SQS can be filtered and forwarded to another service.
Data Processing
Events can be transformed before reaching their destination.
Microservices
Pipes can connect different components without requiring custom integration code for every connection.
Event-Driven Workflows
Events can be enriched and then passed into Step Functions or another target.
What I Found Interesting
The main idea I found interesting about EventBridge Pipes is how much integration logic can be handled through configuration.
When I first think about connecting two services, my instinct is usually:
"I'll write a Lambda function."
But not every integration needs custom code.
If the requirement is simply:
Receive → Filter → Transform → Send
then a managed pipe can sometimes be a much cleaner solution.
Lambda is still extremely useful when we need custom business logic.
The point isn't that Pipes replaces Lambda.
It's that we don't necessarily need Lambda for every connection between AWS services.
Things to Keep in Mind
Pipes are not designed to replace every event-driven architecture.
They are particularly suited to point-to-point integrations.
If we need complex many-to-many event routing, an EventBridge event bus may be a better fit.
We also need to think about permissions carefully because the pipe needs an IAM execution role with access to the source, enrichment components, and target as appropriate.
And if the transformation or processing logic becomes complicated, custom code may still be the better option.
Final Thoughts
EventBridge Pipes is one of those AWS features that can be easy to overlook.
It doesn't try to replace services such as Lambda, SQS, or EventBridge event buses.
Instead, it sits between them and makes certain integrations simpler.
The idea I found most interesting is:
Not every connection between two services needs a Lambda function in the middle.
Sometimes a managed pipe is enough.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article