<?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>S3 on {O}</title>
    <link>https://omarmakled.com/tags/s3/</link>
    <description>Recent content in S3 on {O}</description>
    <generator>Hugo -- 0.151.1</generator>
    <language>en-us</language>
    <atom:link href="https://omarmakled.com/tags/s3/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>Host Static Website on AWS with Terraform, S3, and CloudFront</title>
      <link>https://omarmakled.com/posts/s3-cloudfront/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://omarmakled.com/posts/s3-cloudfront/</guid>
      <description>&lt;p&gt;This example outlines a method for deploying static websites on &lt;strong&gt;Amazon Web Services (AWS)&lt;/strong&gt; using &lt;strong&gt;Terraform&lt;/strong&gt; for infrastructure as code, &lt;strong&gt;Amazon S3&lt;/strong&gt; for content storage, and &lt;strong&gt;Amazon CloudFront&lt;/strong&gt; for global content delivery. The deployment process is fully automated.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&#34;project-structure&#34;&gt;Project Structure&lt;/h3&gt;
&lt;p&gt;Below is an overview of the project&amp;rsquo;s key directories and files:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;public/&lt;/code&gt;&lt;/strong&gt;: Contains the static website assets, such as &lt;code&gt;index.html&lt;/code&gt; and &lt;code&gt;404.html&lt;/code&gt;. These are the files that will be served to users.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;terraform/&lt;/code&gt;&lt;/strong&gt;: This directory holds all the Terraform configuration files (&lt;code&gt;.tf&lt;/code&gt;) responsible for provisioning and managing AWS resources.
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;main.tf&lt;/code&gt;: Defines the core AWS resources, including the S3 bucket and CloudFront distribution.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;variables.tf&lt;/code&gt;: Contains input variables to parameterize the Terraform configuration (e.g., bucket names, domain names).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;outputs.tf&lt;/code&gt;: Specifies output values that are useful after Terraform applies the configuration, such as the CloudFront distribution domain name.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;deploy.sh&lt;/code&gt;: A shell script to execute the Terraform plan and apply the infrastructure, including uploading static files to S3.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;destroy.sh&lt;/code&gt;: A shell script to tear down all provisioned AWS resources.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Project Repository:&lt;/strong&gt; &lt;a href=&#34;https://github.com/OmarMakled/aws-terraform-s3&#34;&gt;https://github.com/OmarMakled/aws-terraform-s3&lt;/a&gt;&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
