<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gerlie Ann Katherine Daga-as</title>
    <description>The latest articles on DEV Community by Gerlie Ann Katherine Daga-as (@kaths3cdev).</description>
    <link>https://dev.to/kaths3cdev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2531474%2F5460186d-aef2-4bd4-94b8-eda7a95e5cbc.jpg</url>
      <title>DEV Community: Gerlie Ann Katherine Daga-as</title>
      <link>https://dev.to/kaths3cdev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kaths3cdev"/>
    <language>en</language>
    <item>
      <title>Beyond the Default: Building a Cost-Optimized Hybrid AWS Architecture</title>
      <dc:creator>Gerlie Ann Katherine Daga-as</dc:creator>
      <pubDate>Tue, 17 Mar 2026 04:51:52 +0000</pubDate>
      <link>https://dev.to/kaths3cdev/beyond-the-default-building-a-cost-optimized-hybrid-aws-architecture-4a1h</link>
      <guid>https://dev.to/kaths3cdev/beyond-the-default-building-a-cost-optimized-hybrid-aws-architecture-4a1h</guid>
      <description>&lt;p&gt;In the world of AWS, "default" settings are often the fastest way to an expensive monthly bill. Recently, a Senior DevOps Engineer dropped a strategic hint on one of my posts that challenged the standard EC2-only approach:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Lightsail is cheaper for the public-facing interface. You don't get much CPU, but enough SSD for cache. Then connect to your EC2."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I didn’t just read the comment. I built the system myself. I used AWS Lightsail for predictable costs and EC2 for extra computing power, creating a setup that greatly reduces Data Transfer Out (DTO) costs.&lt;/p&gt;

&lt;h2&gt;
  
  
  The "Aha!" Moment: Fighting the $0.09/GB Trap
&lt;/h2&gt;

&lt;p&gt;Most developers realize too late that AWS charges roughly $0.09 per GB for outbound data from EC2 (after the first 100GB). If your site pushes 1TB of traffic, that’s roughly a $90 bill for bandwidth alone.&lt;/p&gt;

&lt;p&gt;That’s when the "Aha!" moment hit me: AWS Lightsail isn’t just for beginners. Its $5/month plan includes 1TB of outbound data transfer. By using Lightsail as an Nginx reverse proxy, you’re essentially buying a "bandwidth insurance policy."&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb5y63tuo606wp1a3k55g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb5y63tuo606wp1a3k55g.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The strategy: route public-facing traffic through the Lightsail “front door” and keep the connection to your EC2 backend over a Lightsail VPC peering connection. This traffic stays on AWS’s private network, keeping your costs predictable while shielding your backend from the public internet.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Build &amp;amp; Technical Insights
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Compute Strategy: Optimized Frontend, Scalable Backend&lt;/strong&gt;&lt;br&gt;
Frontends rarely need heavy CPU. Lightsail’s burstable CPU is perfect for an Nginx reverse proxy, while EC2 handles the heavy lifting. Use Auto Scaling Groups and instance types optimized for your workload to ensure backend performance without overpaying for the frontend.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Networking: The VPC Peering Bridge&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Setting up Lightsail → EC2 connectivity requires a VPC peering connection. Key detail: both route tables need manual updates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lightsail Side: Add a route for the EC2 VPC CIDR pointing to the peering connection.&lt;/li&gt;
&lt;li&gt;EC2 Side: Add a route for the Lightsail VPC CIDR pointing back.
This ensures traffic flows privately between Lightsail and EC2.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;. &lt;strong&gt;Troubleshooting Masterclass: Traceroute is King&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When initial curl requests timed out, I didn’t guess I traced the packets:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;traceroute 172.31.x.x
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Packets left the instance but died after two hops, revealing a routing table gap rather than a misconfigured Nginx. One command saved me an hour of troubleshooting.&lt;/p&gt;

&lt;h2&gt;
  
  
  Production Optimizations
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Web Server &amp;amp; Static Assets&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;OpenLiteSpeed (OLS): For WordPress or PHP apps, OLS handles concurrent users better than Apache and is more resource-efficient.&lt;/li&gt;
&lt;li&gt;CloudFront: Offload static assets to a CDN. Free tier: 1TB per month for the first 12 months. Reduces load on your Lightsail proxy.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Security &amp;amp; Traffic Management&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cloudflare: DNS, WAF, and DDoS protection hide your Lightsail public IP and add resilience.&lt;/li&gt;
&lt;li&gt;TLS Termination: Offload HTTPS at Cloudflare or Lightsail to reduce backend CPU usage.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Email &amp;amp; Notifications&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AWS SES: Send up to 62,000 free emails/month from EC2 instances during the free tier perfect for transactional mail and app notifications.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Hardware Efficiency&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ARM (t4g / Graviton2): ~20% better price-to-performance than x86 Intel for many workloads.&lt;/li&gt;
&lt;li&gt;AMD (t3a): ~10% cheaper than Intel for x86 workloads sensitive to micro-latency.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9bjbrdf30swv88mhq0uz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9bjbrdf30swv88mhq0uz.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;With this setup (Cloudflare + CloudFront + Lightsail + EC2 + SES), you can run a robust, scalable stack for ~$15/month, assuming moderate traffic and efficient use of free tiers.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Production Readiness Notes&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Monitoring &amp;amp; Logging: Use CloudWatch for EC2 metrics and Lightsail logs. Monitor Nginx access/error logs.&lt;/li&gt;
&lt;li&gt;High Availability: Lightsail is single-AZ. For mission-critical apps, consider multi-region failover.&lt;/li&gt;
&lt;li&gt;Auto Scaling: Keep EC2 backends in Auto Scaling Groups to handle traffic spikes.&lt;/li&gt;
&lt;li&gt;Backup Strategy: Snapshot EC2 and Lightsail instances regularly.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This project proved that in DevOps, curiosity pays off. A single comment led me to a hybrid architecture that optimizes costs, improves scalability, and demonstrates professional-grade cloud engineering. Thank you sir Harith!&lt;/p&gt;

&lt;p&gt;I’ve documented the full lab guide, including the Nginx configs and peering steps, in my GitHub repository here: &lt;a href="https://github.com/gakhd625/aws-lightsail-nginx-lab" rel="noopener noreferrer"&gt;aws-lightsail-nginx-lab&lt;/a&gt;&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>aws</category>
      <category>cloud</category>
      <category>devops</category>
    </item>
    <item>
      <title>Breaking Free from "Click-Ops" with Terraform</title>
      <dc:creator>Gerlie Ann Katherine Daga-as</dc:creator>
      <pubDate>Mon, 22 Dec 2025 10:10:41 +0000</pubDate>
      <link>https://dev.to/kaths3cdev/breaking-free-from-click-ops-with-terraform-3ka1</link>
      <guid>https://dev.to/kaths3cdev/breaking-free-from-click-ops-with-terraform-3ka1</guid>
      <description>&lt;p&gt;Today marks the beginning of my #30daysofawsterraform challenge! I spent Day 01 diving into the fundamentals of Infrastructure as Code (IaC) with Piyush Sachdeva.&lt;/p&gt;

&lt;p&gt;If you've ever spent hours clicking through the AWS Console only to realize you made a typo in a security group, this journey is for you.&lt;/p&gt;

&lt;p&gt;📺 Reference Video&lt;br&gt;


  &lt;iframe src="https://www.youtube.com/embed/s5fwSG_00P8"&gt;
  &lt;/iframe&gt;


&lt;/p&gt;

&lt;h2&gt;
  
  
  🏗️ What is Infrastructure as Code (IaC)?
&lt;/h2&gt;

&lt;p&gt;In simple terms, IaC is the process of managing and provisioning your technology stack through software (code) rather than manual hardware configuration or interactive configuration tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why do we need it?
&lt;/h2&gt;

&lt;p&gt;Piyush explained a scenario that really hit home: The Scalability Trap.&lt;br&gt;
Manual Setup: Provisioning a 3-tier app (Web, App, DB) takes ~2 hours.&lt;br&gt;
The Problem: In an enterprise, you need multiple environments (Dev, SIT, QA, Prod).&lt;br&gt;
The Math: 2 hours x 6 environments = 12 hours of manual clicking!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpdk9blnk26v8s65qyvf8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpdk9blnk26v8s65qyvf8.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  🔑 Key Takeaways from Day 01
&lt;/h3&gt;

&lt;p&gt;Eliminating Configuration Drift: Manual setups lead to "it works in Dev but not in Prod." Terraform ensures every environment is an exact replica of the code.&lt;/p&gt;

&lt;p&gt;The Power of Git: Because infrastructure is code, we can store it in GitHub. This gives us a history of every change made to our cloud.&lt;/p&gt;

&lt;p&gt;Speed: With one command, we can spin up or destroy entire environments. This is a lifesaver for saving costs on non-prod environments.&lt;/p&gt;

&lt;h3&gt;
  
  
  🐧 My Linux Setup
&lt;/h3&gt;

&lt;p&gt;Since I am using a Linux machine for this challenge, I spent today getting my environment ready. Here is how I set up Terraform:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Installation (Ubuntu/Debian)
I followed the official HashiCorp steps to add the repository and install the CLI:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install dependencies&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; gnupg software-properties-common

&lt;span class="c"&gt;# Add HashiCorp GPG key&lt;/span&gt;
wget &lt;span class="nt"&gt;-O-&lt;/span&gt; https://apt.releases.hashicorp.com/gpg | &lt;span class="se"&gt;\&lt;/span&gt;
gpg &lt;span class="nt"&gt;--dearmor&lt;/span&gt; | &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nb"&gt;sudo tee&lt;/span&gt; /usr/share/keyrings/hashicorp-archive-keyring.gpg

&lt;span class="c"&gt;# Add the repository&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;
https://apt.releases.hashicorp.com &lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;lsb_release &lt;span class="nt"&gt;-cs&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt; main"&lt;/span&gt; | &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nb"&gt;sudo tee&lt;/span&gt; /etc/apt/sources.list.d/hashicorp.list

&lt;span class="c"&gt;# Install Terraform&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install &lt;/span&gt;terraform
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Verification
To make sure everything was correct, I ran:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;terraform &lt;span class="nt"&gt;-version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Productivity Hack: Alias
A great tip for Linux users—adding an alias to save time:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;tf&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'terraform'&lt;/span&gt;
&lt;span class="c"&gt;# Now I can just type 'tf init' instead of the full word!&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fchnhodfzwusmscpkxng1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fchnhodfzwusmscpkxng1.png" alt="terraform version"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  ⚙️ The Terraform Workflow
&lt;/h3&gt;

&lt;p&gt;I learned that Terraform doesn't just "do it." It follows a logical path:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;tf init&lt;/code&gt;: Initializes the working directory and downloads providers.&lt;br&gt;
&lt;code&gt;tf plan&lt;/code&gt;: The "Preview" mode. It shows you what will happen before you commit.&lt;br&gt;
&lt;code&gt;tf apply&lt;/code&gt;: Executes the code and creates the resources in AWS.&lt;br&gt;
&lt;code&gt;tf destroy&lt;/code&gt;: Cleans up everything to avoid unnecessary AWS bills.&lt;/p&gt;

&lt;h3&gt;
  
  
  Final Thoughts
&lt;/h3&gt;

&lt;p&gt;Day 01 was all about the "Why." Understanding that Terraform is a tool for reliability and consistency is the foundation for everything else we will learn. I'm ready for Day 02!&lt;/p&gt;

&lt;h3&gt;
  
  
  Let's Connect!
&lt;/h3&gt;

&lt;p&gt;If you're also taking the #30daysofawsterraform challenge, let's connect!&lt;br&gt;
&lt;strong&gt;LinkedIn&lt;/strong&gt;: &lt;a href="https://www.linkedin.com/in/gerlie-ann-daga-as-326554305/" rel="noopener noreferrer"&gt;Profile link&lt;/a&gt;&lt;/p&gt;

</description>
      <category>terraform</category>
      <category>aws</category>
      <category>devops</category>
      <category>30daysofawsterraform</category>
    </item>
    <item>
      <title>Mastering Cloud Security: A Strategic Guide to Securing Your AWS Environment</title>
      <dc:creator>Gerlie Ann Katherine Daga-as</dc:creator>
      <pubDate>Wed, 17 Dec 2025 02:53:06 +0000</pubDate>
      <link>https://dev.to/kaths3cdev/mastering-cloud-security-a-strategic-guide-to-securing-your-aws-environment-17lg</link>
      <guid>https://dev.to/kaths3cdev/mastering-cloud-security-a-strategic-guide-to-securing-your-aws-environment-17lg</guid>
      <description>&lt;p&gt;In today’s digital landscape, a single security breach can be catastrophic leading to data loss, financial impact, and reputational damage. For developers and cloud engineers, security cannot be an afterthought; it must be the foundation upon which we build.&lt;/p&gt;

&lt;p&gt;As I deepen my focus on cloud security, I’ve synthesized the core pillars of a secure AWS environment. Whether you are launching your first EC2 instance or architecting a complex microservices application, these are the actionable steps effectively used to secure the cloud.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ravtujk1hkwqh0fmpzm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ravtujk1hkwqh0fmpzm.png" alt=" " width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  1. The Foundation: Understanding the Shared Responsibility Model
&lt;/h3&gt;

&lt;p&gt;The most common misconception in cloud computing is assuming that "being on the cloud" means you are automatically secure. It is crucial to understand the Shared Responsibility Model.&lt;/p&gt;

&lt;p&gt;Think of your cloud environment like a boat.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AWS (The Provider)&lt;/strong&gt; is the Captain. They ensure the boat is seaworthy, the engines run, and the hull is intact. They are responsible for the security of the cloud (physical data centers, cabling, and virtualization hardware).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You (The Customer)&lt;/strong&gt; are the Passenger. Once you are on the boat, your safety is your responsibility. You must wear a life jacket and follow the rules. You are responsible for security in the cloud (your customer data, identity management, operating systems, and firewall configurations).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the boat sinks, that’s on AWS. If you trip and fall because you weren't careful, that is on you. Understanding where the line is drawn whether you are using IaaS, PaaS, or SaaS is the first step to a secure architecture.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. The Gatekeeper: Strong Identity and Access Management (IAM)
&lt;/h3&gt;

&lt;p&gt;If your AWS account is a building, IAM is the security system at the front door. It controls who enters, which elevators they can use, and which rooms they can unlock.&lt;/p&gt;

&lt;p&gt;To effectively manage identity, follow these three rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Enforce MFA (Multi-Factor Authentication):&lt;/strong&gt; A password is a key that can be stolen. MFA is biometrics or a code that proves you are who you say you are. Enable this immediately for the root user and all IAM users.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Principle of Least Privilege:&lt;/strong&gt; Do not give everyone the "Master Key." Give users the absolute minimum permissions required to do their job. If an account is compromised, this limits the blast radius.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Role-Based Access Control (RBAC)&lt;/strong&gt;:Assign permissions to roles (e.g., "Developer," "Admin," "Auditor") rather than individual users. This keeps your permissions clean and manageable as your team scales.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Fortifying the Architecture: Network Security
&lt;/h3&gt;

&lt;p&gt;Imagine your AWS network as a bustling city. You don't want unauthorized traffic wandering into residential neighborhoods.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Virtual Private Cloud (VPC):&lt;/strong&gt; This is your gated community. It isolates your resources from other tenants.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Segmentation&lt;/strong&gt;:Divide your "city" into districts using Subnets. Keep public-facing web servers in a Public Subnet (Downtown) and sensitive databases in a Private Subnet (Residential).&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Security Groups &amp;amp; NACLs:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Security Groups&lt;/strong&gt; act as the doorman for specific buildings (instances), controlling traffic at the resource level.&lt;/li&gt;
&lt;li&gt;**Network Access Control Lists (NACLs) **act as checkpoints between districts, controlling traffic at the subnet level.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;WAF (Web Application Firewall):&lt;/strong&gt; For public-facing resources, a WAF acts as border control, inspecting incoming traffic to block SQL injection, cross-site scripting, and other common web exploits.&lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Locking the Safe: Data Encryption
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Data is the gold inside your city. You must protect it whether it is sitting in a vault or being transported in an armored truck.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Encryption in Transit: Use HTTPS/TLS for all data moving across networks. This prevents interception.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Encryption at Rest:&lt;/strong&gt; Encrypt your data where it is stored (S3 buckets, EBS volumes, RDS databases).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Key Management:&lt;/strong&gt; utilize &lt;strong&gt;AWS KMS (Key Management Service)&lt;/strong&gt;. Ideally, use &lt;strong&gt;Customer Managed Keys&lt;/strong&gt;rather than AWS-managed keys. This ensures you retain control over the keys to your data, allowing you to rotate them regularly for enhanced security.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. The Watchtower: Monitoring and Logging
&lt;/h3&gt;

&lt;p&gt;You cannot protect what you cannot see. A secure environment requires constant vigilance.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Enable Logging:&lt;/strong&gt; Turn on logging for all critical resources (CloudTrail for API calls, VPC Flow Logs for network traffic).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Centralize and Analyze:&lt;/strong&gt; Don't let logs sit in silos. Aggregate them in a central location.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automate Alerts:&lt;/strong&gt;Use tools (like AWS CloudWatch or SIEM solutions) to detect anomalies. If a root user logs in from an unknown IP at 3 AM, you should receive an alert immediately not find out about it two weeks later during an audit.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Securing the cloud is not a "&lt;strong&gt;one-and-done&lt;/strong&gt;" task; it is a continuous cycle of assessment, monitoring, and improvement. By implementing a strong foundation based on the Shared Responsibility Model and rigorously applying best practices in IAM, Network, Encryption, and Monitoring, you can build with confidence.&lt;/p&gt;

&lt;p&gt;As I continue my journey in the AWS ecosystem, these principles remain my North Star. Security isn't just about preventing hacks; it's about enabling innovation safely.&lt;/p&gt;

&lt;h3&gt;
  
  
  Want to Go Deeper? Check These Out 👇
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;AWS Shared Responsibility Model
&lt;a href="https://aws.amazon.com/compliance/shared-responsibility-model/" rel="noopener noreferrer"&gt;https://aws.amazon.com/compliance/shared-responsibility-model/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;AWS Well-Architected Framework (Security Pillar)
&lt;a href="https://docs.aws.amazon.com/wellarchitected/latest/security-pillar/welcome.html" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/wellarchitected/latest/security-pillar/welcome.html&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;IAM Best Practices
&lt;a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;VPC Security Best Practices
&lt;a href="https://docs.aws.amazon.com/vpc/latest/userguide/vpc-security-best-practices.html" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/vpc/latest/userguide/vpc-security-best-practices.html&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;AWS KMS Best Practices
&lt;a href="https://docs.aws.amazon.com/kms/latest/developerguide/best-practices.html" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/kms/latest/developerguide/best-practices.html&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Logging &amp;amp; Monitoring on AWS
&lt;a href="https://docs.aws.amazon.com/whitepapers/latest/logging-monitoring-aws/welcome.html" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/whitepapers/latest/logging-monitoring-aws/welcome.html&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>security</category>
      <category>aws</category>
      <category>cloud</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Practical Cloud Security Wins for New AWS Teams (Even If You’re Just Getting Started)</title>
      <dc:creator>Gerlie Ann Katherine Daga-as</dc:creator>
      <pubDate>Mon, 01 Dec 2025 09:35:57 +0000</pubDate>
      <link>https://dev.to/kaths3cdev/practical-cloud-security-wins-for-new-aws-teams-even-if-youre-just-getting-started-21hn</link>
      <guid>https://dev.to/kaths3cdev/practical-cloud-security-wins-for-new-aws-teams-even-if-youre-just-getting-started-21hn</guid>
      <description>&lt;p&gt;What if cloud security didn’t have to feel overwhelming? You don’t need a huge budget, a full security team, or a complicated architecture to feel confident about your AWS setup. These small, highly-impactful wins work extremely well for early-stage teams just starting their cloud security journey&lt;/p&gt;

&lt;p&gt;AWS provides built-in, cost-efficient services for early visibility into potential issues. Enable these at minimum:&lt;/p&gt;

&lt;h3&gt;
  
  
  Turn On the Security Tools AWS Already Gives You
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7ctg62kz55difb63q5xe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7ctg62kz55difb63q5xe.png" alt=" " width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;CloudTrail: Records every API change across your account. Huge value&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;GuardDuty: Continuously monitors your environment and excels at identifying suspicious or malicious events.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;IAM Access Analyzer: Helps you spot unintended public access, cross-account sharing, or overly open policies&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These detect unusual login attempts, risky IAM permissions, public resources, and strange network behavior problems many teams skip until too late&lt;/p&gt;

&lt;h3&gt;
  
  
  Stop Leaving Resources Public by Accident
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4e9y122sdxlfkcuzybpb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4e9y122sdxlfkcuzybpb.png" alt=" " width="500" height="500"&gt;&lt;/a&gt;&lt;br&gt;
Accidental exposure like public buckets or open ports causes most beginner breaches. Prevent them with these fixes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Turn on S3 Block Public Access (this alone prevents SO many issues)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add a deny rule for 0.0.0.0/0 on sensitive ports&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Tighten your default VPC Security Group instead of leaving it open&lt;br&gt;
These guardrails catch "oops" moments before they become incidents.&lt;/p&gt;
&lt;h3&gt;
  
  
  Audit Your IAM Access
&lt;/h3&gt;

&lt;p&gt;IAM feels intimidating, but start with visibility via IAM Access Advisor. Check for:&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Roles unused for 90+ days&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Roles with wildcard admin (:) permissions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Service accounts that don’t need programmatic access anymore.&lt;br&gt;
Removing old roles and rotating access keys reduces massive risk with small effort&lt;/p&gt;
&lt;h3&gt;
  
  
  Secure Your Developer Workstations
&lt;/h3&gt;

&lt;p&gt;Cloud breaches often start on developer laptops deploying to AWS. Set this minimum baseline:&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enable MFA for AWS logins&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use password managers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Require disk encryption (BitLocker, FileVault).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use a hardware key or authenticator app.&lt;br&gt;
Attackers steal credentials from endpoints more than breaking into AWS directly.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Encrypt Everything
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2h5hmhxt3nbowebuvlis.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2h5hmhxt3nbowebuvlis.webp" alt=" " width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enable encryption at rest on EBS, RDS, S3, EKS volumes.&lt;/li&gt;
&lt;li&gt;Require TLS 1.2+ on ALBs.&lt;/li&gt;
&lt;li&gt;Use customer-managed KMS keys for sensitive workloads.
It provides an essential safety net if compromise occurs.
###Clean Up Unused Resources (A Security + Cost Win)
Unused resources remain unpatched, forgotten, and exposed. Add monthly housekeeping:&lt;/li&gt;
&lt;li&gt;Delete unused IAM roles&lt;/li&gt;
&lt;li&gt;Remove abandoned EC2 instances.&lt;/li&gt;
&lt;li&gt;Clean up old S3 buckets.&lt;/li&gt;
&lt;li&gt;Purge leftover AMIs and snapshots.
This dual win improves security and cuts costs.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Document Your Cloud and Decisions (The Habit That Prevents Future Mistakes)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4op4t7spgeod0vx2cyco.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4op4t7spgeod0vx2cyco.webp" alt=" " width="800" height="553"&gt;&lt;/a&gt;&lt;br&gt;
Security isn’t just tools and configs it’s knowing why things exist and how they’re meant to behave. Keep lightweight documentation for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which IAM roles exist and their intended purpose&lt;/li&gt;
&lt;li&gt;What each S3 bucket is used for&lt;/li&gt;
&lt;li&gt;Networking decisions (e.g., why a port was opened)&lt;/li&gt;
&lt;li&gt;Diagrams of environments and cross-account access&lt;/li&gt;
&lt;li&gt;Runbooks for onboarding/offboarding developers&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Have Something to Add?
&lt;/h3&gt;

&lt;p&gt;Cloud security is huge and these are just the lightweight, high-impact wins that early-stage teams can adopt quickly.&lt;/p&gt;

&lt;p&gt;If you use other simple practices that have helped your AWS security posture, drop them in the comments!&lt;br&gt;
I’d love to hear what tools, guardrails, or habits you found effective.&lt;/p&gt;

&lt;h3&gt;
  
  
  References &amp;amp; Further Reading
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/wellarchitected/latest/security-pillar/welcome.html" rel="noopener noreferrer"&gt;AWS Well-Architected Framework – Security Pillar&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/whitepapers/latest/aws-security-best-practices/welcome.html" rel="noopener noreferrer"&gt;AWS Security Best Practices (Official Whitepaper):&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/awscloudtrail/latest/awscloudtrail-ug.pdf" rel="noopener noreferrer"&gt;AWS CloudTrail Documentation:&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_settingup.html" rel="noopener noreferrer"&gt;AWS GuardDuty Documentation:&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>security</category>
      <category>cloud</category>
      <category>developer</category>
    </item>
    <item>
      <title>"Building a Serverless Image Processing Pipeline with AWS Lambda, S3, and API Gateway"</title>
      <dc:creator>Gerlie Ann Katherine Daga-as</dc:creator>
      <pubDate>Thu, 19 Dec 2024 13:16:23 +0000</pubDate>
      <link>https://dev.to/kaths3cdev/building-a-serverless-image-processing-pipeline-with-aws-lambda-s3-and-api-gateway-32od</link>
      <guid>https://dev.to/kaths3cdev/building-a-serverless-image-processing-pipeline-with-aws-lambda-s3-and-api-gateway-32od</guid>
      <description>&lt;p&gt;In this blog, we’ll explore how to build a serverless image processing pipeline using AWS Lambda, Amazon S3, and API Gateway. We will walk you through the technical details, provide relevant code snippets, and include architectural diagrams to make the explanation clear and easy to follow.&lt;/p&gt;

&lt;p&gt;By the end of this blog, you'll understand how these AWS services work together to process images uploaded to an S3 bucket, resize the images, and make them available via a RESTful API powered by API Gateway.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;br&gt;
Before diving into the setup, make sure you have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;An AWS account (if you don’t, you can sign up for the free tier)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Basic understanding of AWS Lambda, API Gateway, and Amazon S3&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Familiarity with AWS IAM (Identity and Access Management) roles and policies&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;An editor for writing Python or Node.js code (we’ll use Python in this example)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuw5uxlo76gmolkks2u10.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuw5uxlo76gmolkks2u10.png" alt=" " width="651" height="487"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;1.&lt;strong&gt;_ Frontend (Client):_&lt;/strong&gt; A client (such as a web app or mobile app) sends an HTTP request to the API Gateway endpoint, which will trigger an AWS Lambda function.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;API Gateway:&lt;/em&gt;&lt;/strong&gt; API Gateway serves as a frontend interface to handle the HTTP requests from the client and forwards them to the Lambda function.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;AWS Lambda:&lt;/strong&gt;&lt;/em&gt; The Lambda function receives the image from the client, processes it (resizing, compressing), and stores it back to an S3 bucket.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Amazon S3:&lt;/strong&gt;&lt;/em&gt; The resized image is stored in an S3 bucket.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;CloudWatch Logs:&lt;/em&gt;&lt;/strong&gt; CloudWatch is used to log events, such as successful image processing or errors.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step-by-Step Implementation&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Setting Up an S3 Bucket for Image Uploads&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
First, we need to create an S3 bucket where images will be uploaded.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Log into the AWS Management Console and go to the S3 service.&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F59r2rxx5pm8kqqf7h056.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F59r2rxx5pm8kqqf7h056.png" alt=" " width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpyrl1wz1bm1u7hqyr11x.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpyrl1wz1bm1u7hqyr11x.jpg" alt=" " width="800" height="370"&gt;&lt;/a&gt;&lt;br&gt;
   2.&lt;strong&gt;Click Create Bucket&lt;/strong&gt;, and give it a name like serverless-bucket-uploaded-images&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcufh5meedvgp34x0xht1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcufh5meedvgp34x0xht1.jpg" alt=" " width="800" height="375"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvfcqu9pzwbx0w5wvnbp9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvfcqu9pzwbx0w5wvnbp9.png" alt=" " width="800" height="436"&gt;&lt;/a&gt;&lt;br&gt;
  3.&lt;strong&gt;In the Bucket Settings&lt;/strong&gt;, ensure versioning is enabled (this helps with version control of uploaded images).&lt;br&gt;
   4.&lt;strong&gt;Set permissions for the bucket&lt;/strong&gt; (for security, it’s recommended to restrict public access unless necessary).&lt;/p&gt;

&lt;p&gt;Once the bucket is created, it will be used to store the original images and the resized ones.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Creating an AWS Lambda Function to Process Images&lt;/strong&gt;&lt;br&gt;
Next, let’s create the Lambda function that will process the images uploaded to the S3 bucket.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;em&gt;&lt;strong&gt;Go to AWS Lambda and click Create Function.&lt;/strong&gt;&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Select Author from Scratch&lt;/em&gt;&lt;/strong&gt;, name your function (e.g., 
ImageResizeFunction), and choose Python latest version as the runtime.
3.For the execution role, select an existing role or create a new one with the following policies:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AmazonS3FullAccess&lt;/strong&gt; (to access S3 objects)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AWSLambdaBasicExecutionRole&lt;/strong&gt; (to enable CloudWatch logging)
Now, let's write the code to resize the uploaded image using Python. We'll use the Pillow library for image processing, so the first step is to add the library to the Lambda deployment package.
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;pip&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="n"&gt;pillow&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;package&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;boto3&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;PIL&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Image&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;io&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;BytesIO&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;lambda_handler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# Extract bucket and object key from the event
&lt;/span&gt;    &lt;span class="n"&gt;bucket_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Records&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s3&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;bucket&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;name&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;object_key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Records&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s3&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;object&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;key&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

    &lt;span class="n"&gt;s3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;boto3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;client&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s3&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Get the original image from S3
&lt;/span&gt;    &lt;span class="n"&gt;original_image&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_object&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Bucket&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;bucket_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;object_key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;image_data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;original_image&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Body&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="c1"&gt;# Process the image (resize)
&lt;/span&gt;    &lt;span class="n"&gt;image&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;BytesIO&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image_data&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="n"&gt;image&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;resize&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# Resize to 200x200 pixels
&lt;/span&gt;
    &lt;span class="c1"&gt;# Save the resized image to a new S3 object
&lt;/span&gt;    &lt;span class="n"&gt;output_key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;resized/&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;object_key&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="nb"&gt;buffer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;BytesIO&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;save&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;PNG&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nb"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;seek&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;put_object&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Bucket&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;bucket_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;output_key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Body&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;statusCode&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;body&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Image &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;object_key&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; resized and saved as &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;output_key&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation of the Lambda function:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The function triggers whenever an image is uploaded to the S3 bucket (as part of an event notification).&lt;/li&gt;
&lt;li&gt;It fetches the image from S3, resizes it using the Pillow library, and then stores the resized image back into a separate resized/ folder in the S3 bucket.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Setting Up API Gateway to Trigger Lambda&lt;/strong&gt;&lt;br&gt;
Now, let's set up an API Gateway to receive HTTP requests from the frontend (e.g., a web or mobile app) to trigger the image upload.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Go to API Gateway in the AWS Console&lt;/em&gt;&lt;/strong&gt; and create a new REST API.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Create a new resource&lt;/em&gt;&lt;/strong&gt; (e.g., /upload-image) under the API.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Under this resource&lt;/em&gt;&lt;/strong&gt;, create a POST method&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;In the Integration type&lt;/em&gt;&lt;/strong&gt;, select Lambda Function and choose the ImageResizeFunction Lambda function you just created.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;_Enable CORS _&lt;/strong&gt;if you want to allow requests from web browsers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Deploy the API&lt;/em&gt;&lt;/strong&gt; to a new or existing stage.
Once the API is deployed, you’ll receive an API endpoint URL that the frontend can use to trigger image uploads.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;4. Testing the Entire Flow&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1.Upload an image to the S3 bucket through your frontend, which sends a POST request to the API Gateway endpoint.
2. The API Gateway triggers the Lambda function.
3. Lambda resizes the image and saves it back to S3 under the resized/ folder.
4. You can check the resized image in the S3 bucket and monitor the Lambda function’s logs in CloudWatch.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Best Practices and Considerations&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Error Handling:&lt;/em&gt;&lt;/strong&gt; Implement proper error handling in the Lambda function (e.g., try/except blocks) to log and handle potential failures.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;&lt;strong&gt;Lambda Timeout:&lt;/strong&gt;&lt;/em&gt; Set an appropriate timeout for your Lambda function (e.g., 3–5 seconds for resizing).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Security&lt;/em&gt;:&lt;/strong&gt; Use fine-grained IAM roles for Lambda functions and S3 buckets to limit access only to necessary resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Scalability&lt;/em&gt;:&lt;/strong&gt; Lambda automatically scales to handle multiple requests, but ensure the S3 bucket is correctly configured to handle large traffic loads.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;AWS Lambda&lt;/strong&gt; offers a powerful and efficient way to run code in response to events without the need to manage servers. By combining Lambda with other AWS services like S3 and API Gateway, you can build scalable, event-driven applications with minimal overhead. Whether you’re processing images, handling webhooks, or automating tasks, Lambda simplifies infrastructure management and reduces operational complexity.&lt;/p&gt;

&lt;p&gt;As serverless technologies continue to evolve, AWS Lambda remains a key tool for modern cloud applications. Start small with a simple use case, and explore how you can scale and optimize your serverless architecture as your needs grow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Additional Resources&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;AWS Lambda Documentation&lt;/em&gt;&lt;/strong&gt; &lt;a href="https://docs.aws.amazon.com/lambda/latest/dg/welcome.html" rel="noopener noreferrer"&gt;Lambda Documentation&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Amazon S3 Documentation:&lt;/strong&gt; &lt;a href="https://docs.aws.amazon.com/s3/" rel="noopener noreferrer"&gt;S3 Documentation&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;API Gateway Documentation&lt;/em&gt;&lt;/strong&gt;:&lt;a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/welcome.html" rel="noopener noreferrer"&gt;API Gateway Documentation&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;If something is missing or you have any suggestions, feel free to let me know in the comments section below!&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
