<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>AWS SAM on {O}</title>
    <link>https://omarmakled.com/tags/aws-sam/</link>
    <description>Recent content in AWS SAM on {O}</description>
    <generator>Hugo -- 0.151.1</generator>
    <language>en-us</language>
    <atom:link href="https://omarmakled.com/tags/aws-sam/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Serverless Image Processing with AWS SAM: Uploads, Thumbnails &amp; S3 Events</title>
      <link>https://omarmakled.com/posts/sam-s3-event/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://omarmakled.com/posts/sam-s3-event/</guid>
      <description>&lt;p&gt;This example demonstrates a robust serverless architecture on AWS for handling file uploads and automated thumbnail generation. It leverages &lt;strong&gt;AWS SAM (Serverless Application Model)&lt;/strong&gt;, &lt;strong&gt;Lambda functions&lt;/strong&gt;, &lt;strong&gt;API Gateway&lt;/strong&gt;, and &lt;strong&gt;S3 event notifications&lt;/strong&gt; to create a streamlined and scalable image processing pipeline.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&#34;project-structure&#34;&gt;Project Structure&lt;/h3&gt;
&lt;p&gt;Here&amp;rsquo;s a quick overview of the project&amp;rsquo;s key components:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;functions/&lt;/code&gt;&lt;/strong&gt;: Contains the core Lambda function code:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;event.mjs&lt;/code&gt;: Handles S3 event notifications, triggering the thumbnail generation process.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;upload.mjs&lt;/code&gt;: Manages the initial file upload through API Gateway.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;layers/nodejs/&lt;/code&gt;&lt;/strong&gt;: A Lambda layer containing shared code and dependencies for the functions:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;lib/utils.mjs&lt;/code&gt;: Common utility functions.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;package.json&lt;/code&gt; &amp;amp; &lt;code&gt;package-lock.json&lt;/code&gt;: Node.js dependencies for the layer.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;template.yaml&lt;/code&gt;&lt;/strong&gt;: The AWS SAM template defining the serverless resources: Lambda functions, API Gateway endpoints, S3 buckets, and their respective permissions and event triggers.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&#34;how-it-works&#34;&gt;How It Works&lt;/h3&gt;
&lt;p&gt;The workflow is straightforward and efficient:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Customizing Cognito Emails with AWS SAM and Lambda</title>
      <link>https://omarmakled.com/posts/sam-cognito-custom-message/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://omarmakled.com/posts/sam-cognito-custom-message/</guid>
      <description>&lt;p&gt;This example shows how to use &lt;strong&gt;AWS SAM&lt;/strong&gt; to create a user sign-up system (&lt;strong&gt;Cognito&lt;/strong&gt;) and change the automatic emails it sends, like account verification or password reset emails. This is a great method if you want your application&amp;rsquo;s messages to match your brand&amp;rsquo;s style.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&#34;project-components&#34;&gt;Project Components&lt;/h3&gt;
&lt;p&gt;The project has two main files:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;cognito-email/index.js&lt;/code&gt;&lt;/strong&gt;: This file contains a simple &lt;strong&gt;Lambda&lt;/strong&gt; function. Its job is to change the content of the emails.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;template.yaml&lt;/code&gt;&lt;/strong&gt;: This file tells AWS what to build. It includes:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Cognito User Pool&lt;/strong&gt;: The place where user data is saved.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lambda Function&lt;/strong&gt;: A simple function that runs when needed.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Permissions&lt;/strong&gt;: These allow Cognito to call the Lambda function.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&#34;how-it-works&#34;&gt;How It Works&lt;/h3&gt;
&lt;p&gt;This setup customizes the email messages that Cognito sends in different user flows, such as:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Serverless API Monitoring with AWS SAM: Lambda, API Gateway &amp; CloudWatch Alarms</title>
      <link>https://omarmakled.com/posts/sam-api-alaram/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://omarmakled.com/posts/sam-api-alaram/</guid>
      <description>&lt;p&gt;This example demonstrates how to build a lightweight, serverless API using &lt;strong&gt;AWS SAM (Serverless Application Model)&lt;/strong&gt; while integrating real-time error monitoring and email alerts using &lt;strong&gt;CloudWatch Alarms&lt;/strong&gt; and &lt;strong&gt;SNS&lt;/strong&gt;. This pattern is ideal for production-ready serverless applications that need observability without heavy tooling.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&#34;project-structure&#34;&gt;Project Structure&lt;/h3&gt;
&lt;p&gt;The project includes the following core components:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;functions/&lt;/code&gt;&lt;/strong&gt;: Contains the Lambda function that handles HTTP requests:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;app.mjs&lt;/code&gt;: Returns a simple response (e.g., &amp;ldquo;Hello World&amp;rdquo;).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;template.yaml&lt;/code&gt;&lt;/strong&gt;: The SAM template defining resources including:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Lambda Function&lt;/strong&gt; (hello handler)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;API Gateway&lt;/strong&gt; (to expose the function via HTTP)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CloudWatch Alarm&lt;/strong&gt; (monitors API 5XX errors)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SNS Topic &amp;amp; Subscription&lt;/strong&gt; (sends email alerts)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&#34;how-it-works&#34;&gt;How It Works&lt;/h3&gt;
&lt;p&gt;This architecture sets up an API and monitors its availability in real time:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
