AWS, Cloud Computing

4 Mins Read

Integrate Amazon SQS with AWS Lambda using Amazon EventBridge Pipes

Voiced by Amazon Polly

Introduction

Now easily stitch AWS services together with Amazon EventBridge Pipes. We used to use the AWS Glue to communicate between the different services, which can be a time-consuming manual exercise but an easier way to connect AWS services called Amazon EventBridge Pipes.

event

Amazon EventBridge Pipes is an AWS service that can receive events from various AWS services like AWS SQS, AWS Kinesis, and Amazon DynamoDB. To reduce costs, filter patterns can be configured during the filtering step to exclude unnecessary events from further processing. In the enrichment step, data from the source can be enhanced using built-in transformations or advanced transformations performed by AWS Lambda, API Gateway, or Step Functions.

Enrichments are invoked synchronously, ensuring the timely availability of the enhanced data. Pipes serve as conduits to send events or data to targets such as AWS Lambda, API Gateway, ECS Cluster, CloudWatch Log, Kinesis Stream, or API destinations. Transformers can be written in the Target step to specify how data should be sent to the targets.

Amazon EventBridge Pipes supports both synchronous and asynchronous invocation of targets based on their requirements. Pipes can be activated or deactivated as needed, and Amazon CloudTrail and Amazon CloudWatch can be used to monitor EventBridge Pipes.

AWS CloudTrail tracks Pipe invocations and their details, while Amazon CloudWatch provides metrics to monitor the health status of Pipes.

Pioneers in Cloud Consulting & Migration Services

  • Reduced infrastructural costs
  • Accelerated application deployment
Get Started

Amazon SQS

Amazon SQS is a managed message queuing service that enables asynchronous communication between cloud application components. It supports two types of message queues(Standard and FIFO) and provides reliable, scalable, and decoupled messaging infrastructure for building cloud-based applications and microservices.

AWS Lambda

AWS Lambda is a serverless computing service provided by Amazon Web Services (AWS) that allows developers to run code without managing servers or infrastructure.

Amazon Lambda lets you execute your code in response to events such as changes in data, user actions, or file uploads. You can use Lambda to build custom APIs, process data streams, run ETL jobs, and automate tasks.

Steps on how Amazon SQS and AWS Lambda are integrated by using Amazon EventBridge Pipes

Step 1: Create source Amazon SQS

step1

Step 2: Create AWS Lambda for Enrichment during the Amazon EventBridge Pipe

step2

Step 3: Create Destination AWS Lambda

step3

Step 4:  Select the source as Amazon SQS

step4

You can choose the Batch size and window for Amazon SQS messages.

step4b

Add filtering of your choice, here, as you can see, there is an event pattern called anything but matching hi text what it does is that it tries to find the hi text from Amazon SQS. If it’s in the message, it will filter out this and skips sending it to the next step, and apart from hi, whichever messages will come in will go to the next step.

step4c

Select enrichment-sqs-msg AWS Lambda

step4d

Choose destination AWS Lambda

step4e

Now send the message except hi.

step4f

As we can see below, the event has arrived in the AWS CloudWatch logs of AWS Lambda.

step4i

Conclusion

Amazon EventBridge Pipes offer a simple, efficient, and cost-effective way to configure advanced integrations with enhanced security, reliability, scalability, and the ability to monitor their performance using CloudTrail and CloudWatch. Amazon EventBridge Pipes provides a convenient and streamlined approach for connecting AWS services. It eliminates the need for manual and time-consuming communication setups using AWS Glue.

Empowering organizations to become ‘data driven’ enterprises with our Cloud experts.

  • Reduced infrastructure costs
  • Timely data-driven decisions
Get Started

About CloudThat

CloudThat is an award-winning company and the first in India to offer cloud training and consulting services worldwide. As a Microsoft Solutions Partner, AWS Advanced Tier Training Partner, and Google Cloud Platform Partner, CloudThat has empowered over 850,000 professionals through 600+ cloud certifications winning global recognition for its training excellence including 20 MCT Trainers in Microsoft’s Global Top 100 and an impressive 12 awards in the last 8 years. CloudThat specializes in Cloud Migration, Data Platforms, DevOps, IoT, and cutting-edge technologies like Gen AI & AI/ML. It has delivered over 500 consulting projects for 250+ organizations in 30+ countries as it continues to empower professionals and enterprises to thrive in the digital-first world.

FAQs

1. Is Amazon EventBridge Pipes free?

ANS: – No, based on the number of requests entering a Pipe and payload size. For more info, refer to AWS Amazon EventBridge Pipes pricing.

2. What are the Source services available in Amazon EventBridge Pipes?

ANS: – The available Sources services in Amazon EventBridge Pipes are Amazon DynamoDB stream, Amazon Kinesis stream, Amazon MQ broker, Amazon MSK stream, Self-managed Apache Kafka stream, and Amazon SQS queue.

WRITTEN BY Suresh Kumar Reddy

Suresh is a highly skilled and results-driven Generative AI Engineer with over three years of experience and a proven track record in architecting, developing, and deploying end-to-end LLM-powered applications. His expertise covers the full project lifecycle, from foundational research and model fine-tuning to building scalable, production-grade RAG pipelines and enterprise-level GenAI platforms. Adept at leveraging state-of-the-art models, frameworks, and cloud technologies, Suresh specializes in creating innovative solutions to address complex business challenges.

Share

Comments

    Click to Comment

Get The Most Out Of Us

Our support doesn't end here. We have monthly newsletters, study guides, practice questions, and more to assist you in upgrading your cloud career. Subscribe to get them all!