{"id":78590,"date":"2026-03-20T15:44:49","date_gmt":"2026-03-20T10:14:49","guid":{"rendered":"https:\/\/www.tothenew.com\/blog\/?p=78590"},"modified":"2026-03-23T22:20:50","modified_gmt":"2026-03-23T16:50:50","slug":"storing-sns-messages-in-s3-using-kinesis-data-firehose-step-by-step-implementation-with-real-world-use-cases","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/storing-sns-messages-in-s3-using-kinesis-data-firehose-step-by-step-implementation-with-real-world-use-cases\/","title":{"rendered":"Storing SNS Messages in S3 using Kinesis Data Firehose \u2013 step by step implementation with Real-World Use Cases"},"content":{"rendered":"<h1><span style=\"color: #000000;\"><strong>Introduction<\/strong><\/span><\/h1>\n<p><span style=\"color: #000000;\">We know that many applications generate large amounts of event data such as alerts, application events, logs, and notifications. This data is usually unstructured and arrives in a continuous manner.<\/span><\/p>\n<p><span style=\"color: #000000;\">The initial step in creating a data engineering pipeline is to store this event data into a reliable and long term storage system in order to be processed, analyzed, and it can be used to generate insights.<\/span><\/p>\n<p><span style=\"color: #000000;\">A common approach in AWS is:<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>Amazon SNS<\/strong> (Messages&amp;notification)<strong> &#8212;&gt; Kinesis Data Firehose<\/strong> (streaming data processing) <strong>&#8212;&gt;<\/strong> <strong>Amazon S3<\/strong> (data storage)<\/span><\/p>\n<h1><span style=\"color: #000000;\"><strong>In this architecture:<\/strong><\/span><\/h1>\n<ul>\n<li><span style=\"color: #000000;\">Firstly the applications send events to Amazon SNS.<\/span><\/li>\n<li><span style=\"color: #000000;\">Amazon Kinesis Data Firehose receives these events from SNS.<\/span><\/li>\n<li><span style=\"color: #000000;\">Firehose then automatically delivers the event\/data to Amazon S3 where this data is stored for long-term storage. Once the data is stored in S3, you can use various AWS services to process, analyze, or transform the data.<\/span><\/li>\n<li><span style=\"color: #000000;\">These services include : AWS Glue, Amazon Athena, Amazon Redshift<\/span><\/li>\n<\/ul>\n<p><span style=\"color: #000000;\">The services which are involved are :<\/span><\/p>\n<h1><span style=\"color: #000000;\"><strong>Amazon SNS<\/strong><\/span><\/h1>\n<p><span style=\"color: #000000;\">Amazon Simple Notification Service (SNS) is a fully managed messaging service that follows the publish\/subscribe (pub\/sub) model.<\/span><\/p>\n<p><span style=\"color: #000000;\">In SNS, publishers send messages to a topic, and subscribers receive those messages.<\/span><\/p>\n<p><span style=\"color: #000000;\">SNS can send messages to variuos endpoints such as: Email, AWS Lambda, SQS, Kinesis Data Firehose. It is mostly used for system notifications, application alerts, communication of micro services, SNS supports real time message delivery.<\/span><\/p>\n<h1><span style=\"color: #000000;\"><strong>Kinesis Data Firehose<\/strong><\/span><\/h1>\n<p><span style=\"color: #000000;\">Amazon Kinesis Data Firehose Amazon Kinesis Data Firehose is a fully managed service that provide the easiest way to capture, transform, and load data streams into AWS, and supports the streaming of real-time data into destinations such as- AWS S3, Amazon OpenSearch, Amazon Redshift. One of the main advantages of AWS Firehose is that no infrastructure management is required and it provide automatic scaling it also supports automatic retry. Firehose is widely used for storing event data and streaming logs.<\/span><\/p>\n<h3><span style=\"color: #000000;\">Architecture Overview<\/span><br \/>\n<span style=\"color: #000000;\">The architecture of this pipeline is simple:<\/span><\/h3>\n<p><span style=\"color: #000000;\"><span style=\"text-decoration: underline;\">Application \/ Service<\/span> &#8212;&gt; <span style=\"text-decoration: underline;\">SNS Topic<\/span> &#8212;&gt; <span style=\"text-decoration: underline;\">Kinesis Data Firehose<\/span> &#8212;&gt; <span style=\"text-decoration: underline;\">S3<\/span> &#8212;&gt; <span style=\"text-decoration: underline;\">Data Processing (Glue \/ Athena \/ Redshift)<\/span><\/span><\/p>\n<h3><span style=\"color: #000000;\"><strong>\u00a0Flow explanation:<\/strong><\/span><\/h3>\n<ul>\n<li><span style=\"color: #000000;\">Application sends events to SNS Topic<\/span><\/li>\n<li><span style=\"color: #000000;\">SNS delivers these events to Kinesis Firehose<\/span><\/li>\n<li><span style=\"color: #000000;\">Firehose collects the data and writes data into S3<\/span><\/li>\n<li><span style=\"color: #000000;\">Data can be analyzed later using analytics tools<\/span><\/li>\n<\/ul>\n<h1><span style=\"color: #000000;\"><strong>Real-World Use Cases<\/strong><\/span><\/h1>\n<p><span style=\"color: #000000;\"><strong>1. Application Event Logging<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">Many applications generate important events such as &#8211; login of user, payment information, Order placed, API request logs.<\/span><br \/>\n<span style=\"color: #000000;\">These event can be sent to SNS and kept in S3 using AWS Firehose.<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>Benefits:<\/strong><\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\">It provides centralized storage i.e all events are kept in one place.<\/span><\/li>\n<li><span style=\"color: #000000;\">It also helps in troubleshooting and debugging<\/span><\/li>\n<li><span style=\"color: #000000;\">Data can be stored for a long period for time and can be used for analysis.<\/span><\/li>\n<\/ul>\n<p><strong><span style=\"color: #000000;\">Example:<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">E-commerce App <strong>&#8212;&gt;<\/strong>\u00a0 SNS <strong>&#8212;&gt;<\/strong>\u00a0 Firehose <strong>&#8212;&gt;<\/strong> S3<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>2. Security and Audit Logging<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">Security teams store logs for compliance and to perform audits.<\/span><\/p>\n<p><span style=\"color: #000000;\">There are many events such as access denied, login failures, suspicious activity. These events can be sent to SNS and stored in S3<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>Benefits<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">It helps in storing of logs for a long period of time.<\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\">Data cannot be easily changed (immutable storage)<\/span><\/li>\n<li><span style=\"color: #000000;\">It provide immutable storage it means data cannot be changed easily<\/span><\/li>\n<li><span style=\"color: #000000;\">Useful for security investigations<\/span><\/li>\n<\/ul>\n<p><span style=\"color: #000000;\"><strong>3. Monitoring and Alert Archival<br \/>\n<\/strong><\/span><br \/>\n<span style=\"color: #000000;\">Monitoring tools generate alerts for issue such as High CPU\/Memory utilization, service down alerts, failure of API.<\/span><br \/>\n<span style=\"color: #000000;\">These alerts can be sent to SNS, then Amazon Kinesis Data Firehose stores these alerts to Amazon S3.<br \/>\n<\/span><span style=\"color: #000000;\">The data which is stored in S3 helps to keep a history of monitoring data and then this data can be used for analysis, tracking SLA performance and review of incidents.<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>Implementation<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\"><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-78598\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-02-42-16.png\" alt=\"f\" width=\"1022\" height=\"579\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-02-42-16.png 1202w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-02-42-16-300x170.png 300w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-02-42-16-1024x580.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-02-42-16-768x435.png 768w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-02-42-16-624x354.png 624w\" sizes=\"(max-width: 1022px) 100vw, 1022px\" \/><\/span><\/p>\n<h1><span style=\"color: #000000;\"><strong>Steps to Create DataFirehose with S3 destination-<\/strong><\/span><\/h1>\n<p><span style=\"color: #000000;\"><strong>Step1: Firstly go to Amazon Data Firehose and then click on Create Firehose Stream, then select Direct Put as a Source and S3 as destination.<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\"><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-78600\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-02-49-06.png\" alt=\"v\" width=\"817\" height=\"484\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-02-49-06.png 1181w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-02-49-06-300x178.png 300w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-02-49-06-1024x606.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-02-49-06-768x455.png 768w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-02-49-06-624x369.png 624w\" sizes=\"(max-width: 817px) 100vw, 817px\" \/><\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>Step2: Now go to destination settings.<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">Enter the S3 bucket details, you can switch on Dynamic partioning based on conditions,<\/span><\/p>\n<p><span style=\"color: #000000;\">Kinesis Data Firehose stores by default events into S3 using this default structure: yyyy\/mm\/dd prefix<\/span><br \/>\n<span style=\"color: #000000;\">Example &#8211; s3:\/\/bucket-name\/2026\/02\/17\/<\/span><\/p>\n<p><span style=\"color: #000000;\">In Error Output Prefix, you can define an error folder. If any message fails to process, it will be stored in this error folder<\/span><\/p>\n<p><span style=\"color: #000000;\"><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-78602\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-02-58-07.png\" alt=\"c\" width=\"773\" height=\"764\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-02-58-07.png 859w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-02-58-07-300x297.png 300w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-02-58-07-768x759.png 768w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-02-58-07-624x617.png 624w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-02-58-07-120x120.png 120w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-02-58-07-24x24.png 24w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-02-58-07-48x48.png 48w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-02-58-07-96x96.png 96w\" sizes=\"(max-width: 773px) 100vw, 773px\" \/><\/span><\/p>\n<p><span style=\"color: #000000;\">You can also enable encryption and choose the file format etc on the same page with the advanced settings.<\/span><\/p>\n<p><span style=\"color: #000000;\">After customizing the configuration, click on Create Firehose stream and enter a name of the stream.<\/span><\/p>\n<p><span style=\"color: #000000;\">Firehose setup is ready. Now the next step is to integrate this Firehose stream with SNS.<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>Step 3: Creating an IAM role that will allow SNS write to Firehose<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">To integrate SNS with Firehose, a permission role will be required firstly \u2013 For this create an IAM role with the policy AmazonKinesisFirehoseFullAccess or you can also create a custom policy<\/span><\/p>\n<p><span style=\"color: #000000;\"><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-78603\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-03-28-52.png\" alt=\"c\" width=\"843\" height=\"404\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-03-28-52.png 1169w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-03-28-52-300x144.png 300w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-03-28-52-1024x491.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-03-28-52-768x368.png 768w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-03-28-52-624x299.png 624w\" sizes=\"(max-width: 843px) 100vw, 843px\" \/><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Go to IAM roles and cick on create role. If you want to use a prebuilt policy add the \u201cAmazonKinesisFirehoseFullAccess\u201d policy to\u2002a new role:<\/span><\/p>\n<p><span style=\"color: #000000;\">you can also create a new policy \/ inline policy.<\/span><\/p>\n<p><span style=\"color: #000000;\">Once the role is created with the policy, copy the Role ARN.<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>Step 4: Connect DataFirehose to SNS\u00a0<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">Goto SNS and selec the topic that you want to use<\/span><\/p>\n<p><span style=\"color: #000000;\">Click on create subscription<\/span><\/p>\n<p><span style=\"color: #000000;\">Select Kinesis Firehose protocol from the drop down\u2002list.<\/span><\/p>\n<p><span style=\"color: #000000;\">Enter the Firehose ARN in the\u2002Endpoint field<\/span><\/p>\n<p><span style=\"color: #000000;\">In the Subscription Role ARN, Enter the IAM Role that we have created earlier<\/span><\/p>\n<p><span style=\"color: #000000;\"><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-78604\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-03-43-02.png\" alt=\"v\" width=\"839\" height=\"479\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-03-43-02.png 1138w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-03-43-02-300x172.png 300w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-03-43-02-1024x586.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-03-43-02-768x439.png 768w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-from-2026-03-17-03-43-02-624x357.png 624w\" sizes=\"(max-width: 839px) 100vw, 839px\" \/><\/span><\/p>\n<p><span style=\"color: #000000;\">Now click on create Subscription, SNS is now connected to Firehose.<\/span><\/p>\n<h1><span style=\"color: #000000;\"><strong>Conclusion<\/strong><\/span><\/h1>\n<p><span style=\"color: #000000;\">In this blog we explored how to build an event pipeline that stores messages from SNS into Amazon S3 by using Amazon Kinesis Data Firehose.<\/span><\/p>\n<p><span style=\"color: #000000;\">By this setup many organizations can collect and store large amount of event data in a reliable, scalable way. Once the data is stored in S3, it can be used for various tasks such as analytics, monitoring, compliance, and generating insights.<\/span><\/p>\n<p><span style=\"color: #000000;\">By using SNS, Firehose, and S3, organizations can create a simple event-driven data pipeline that requires less operational management and ensure efficient data collection and storage.<\/span><br \/>\n<span style=\"color: #000000;\">\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction We know that many applications generate large amounts of event data such as alerts, application events, logs, and notifications. This data is usually unstructured and arrives in a continuous manner. The initial step in creating a data engineering pipeline is to store this event data into a reliable and long term storage system in [&hellip;]<\/p>\n","protected":false},"author":1873,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":32},"categories":[5877],"tags":[248,670,7390],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/78590"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/1873"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=78590"}],"version-history":[{"count":4,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/78590\/revisions"}],"predecessor-version":[{"id":79041,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/78590\/revisions\/79041"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=78590"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=78590"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=78590"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}