<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Anupa Supul on Medium]]></title>
        <description><![CDATA[Stories by Anupa Supul on Medium]]></description>
        <link>https://medium.com/@supulanupa?source=rss-c93ce69207e8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*FAvWLY8h0IVIPSoTussnCw.jpeg</url>
            <title>Stories by Anupa Supul on Medium</title>
            <link>https://medium.com/@supulanupa?source=rss-c93ce69207e8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 15:44:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@supulanupa/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How Do You Deploy AWS Applications Without Downtime?]]></title>
            <link>https://medium.com/@supulanupa/how-do-you-deploy-aws-applications-without-downtime-5415845550b2?source=rss-c93ce69207e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/5415845550b2</guid>
            <category><![CDATA[amazon-web-services]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Anupa Supul]]></dc:creator>
            <pubDate>Wed, 25 Nov 2026 07:36:01 GMT</pubDate>
            <atom:updated>2026-11-25T07:36:01.651Z</atom:updated>
            <content:encoded><![CDATA[<h3>How Do You Deploy AWS Applications Without Downtime? Understanding Blue/Green and Canary Deployments</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ip6_pfmbQlk5gqsot1OKPw.png" /></figure><p>Imagine you’ve built a web application, tested it, and deployed it on AWS.</p><p>Everything is working. Users are actively placing orders, uploading files, and using your application.</p><p>Now you need to release a new version.</p><p>You could stop the current application, deploy the new version, and start it again. But during that period, users may see errors or be unable to access the application.</p><p>That raises an important question:</p><p><strong>How can we release a new version without interrupting users — and reduce the risk if something goes wrong?</strong></p><p>Two deployment strategies that help solve this problem are <strong>Blue/Green Deployment</strong> and <strong>Canary Deployment</strong>.</p><p>In this article, I’ll explain how they work, how AWS supports them, and how to choose the right strategy for a production application.</p><p><em>Figure: Blue/green switches traffic between environments, while canary gradually introduces a new version to a portion of users.</em></p><h3>1. What Does “Zero-Downtime Deployment” Mean?</h3><p>A zero-downtime deployment aims to release a new application version without making the application unavailable to users.</p><p>For example, imagine your current application is running version 1.0.</p><p>You want to deploy version 2.0 with new features and bug fixes.</p><p>A traditional deployment might look like this:</p><pre>Stop Version 1.0<br>       |<br>       v<br>Deploy Version 2.0<br>       |<br>       v<br>Start Version 2.0</pre><p>If the application is unavailable during deployment, users may experience downtime.</p><p>A safer approach is to prepare the new version while the current version continues serving traffic.</p><pre>Version 1.0 serves users<br>          |<br>          v<br>Deploy Version 2.0 separately<br>          |<br>          v<br>Test Version 2.0<br>          |<br>          v<br>Shift traffic to Version 2.0</pre><p>The goal is to keep the application available throughout the release.</p><p>However, <strong>zero downtime is a goal, not an automatic guarantee</strong>. Deployment strategy, health checks, application behavior, database changes, and infrastructure configuration all affect whether users experience an interruption.</p><h3>2. What Is a Blue/Green Deployment?</h3><p>Blue/green deployment uses two separate environments:</p><ul><li><strong>Blue:</strong> The currently running production version.</li><li><strong>Green:</strong> The new version being prepared for release.</li></ul><p>The blue environment continues serving users while the green environment is deployed and tested.</p><p>Once the green environment is ready, traffic is shifted from blue to green.</p><h3>How it works</h3><pre>Users<br>                   |<br>                   v<br>             Load Balancer<br>                   |<br>          +--------+--------+<br>          |                 |<br>          v                 v<br>     Blue Environment   Green Environment<br>       Version 1.0        Version 2.0<br>          |                 |<br>          v                 v<br>       Current App       New App</pre><p>Before the switch, users are served by blue.</p><p>After the switch, users are served by green.</p><p>If the new version has a serious issue, traffic can be shifted back to blue — provided the old environment is still available and compatible with the current data and configuration.</p><h3>Example: Deploying a Node.js API on ECS</h3><p>Imagine your backend runs on Amazon ECS behind an Application Load Balancer.</p><p>You currently have version 1.0 running in one target group.</p><p>To deploy version 2.0:</p><ol><li>Build and push the new Docker image to Amazon ECR.</li><li>Deploy version 2.0 to a separate ECS task set or environment.</li><li>Wait for the new tasks to become healthy.</li><li>Run validation tests against the new version.</li><li>Shift production traffic to version 2.0.</li><li>Monitor the application and keep the previous environment available for rollback.</li></ol><p>AWS CodeDeploy can coordinate blue/green deployments for supported ECS and Lambda configurations. For ECS, it can shift traffic between target groups associated with the old and new task sets.</p><h3>Why use blue/green?</h3><ul><li>The new version can be tested before receiving production traffic.</li><li>Traffic can be switched back if the release has a problem.</li><li>The deployment can reduce the time users are exposed to an unhealthy version.</li></ul><h3>What should you consider?</h3><p>Blue/green deployments often require two environments to exist at the same time, which can increase temporary infrastructure costs.</p><p>You also need to consider database compatibility. Switching application traffic back does not automatically reverse database changes made by the new version.</p><h3>3. What Is a Canary Deployment?</h3><p>Canary deployment introduces a new application version to a small portion of production traffic before releasing it to everyone.</p><p>Instead of switching all traffic at once, you gradually increase the amount of traffic served by the new version.</p><p>For example:</p><pre>Production Traffic<br>                  |<br>          +-------+-------+<br>          |               |<br>          v               v<br>     Version 1.0      Version 2.0<br>       95% traffic      5% traffic</pre><p>If the new version performs well, you can increase its traffic.</p><p>A possible rollout might look like this:</p><pre>5%  -&gt;  10%  -&gt;  25%  -&gt;  50%  -&gt;  100%</pre><p>At each stage, you monitor the application for errors, latency, and other important signals.</p><p>If the new version performs poorly, you can stop the rollout and route traffic back to the stable version.</p><p><strong>The key idea:</strong> expose a small amount of production traffic to the new version, observe the results, and increase exposure only when it looks healthy.</p><h3>Example: Releasing a new checkout feature</h3><p>Imagine you’re updating the checkout API of an e-commerce application.</p><p>The new version has passed testing, but you want to verify how it behaves with real production traffic.</p><p>You could route 5% of requests to version 2.0 and keep 95% on version 1.0.</p><p>Then monitor:</p><ul><li>HTTP 5xx error rate</li><li>Request latency</li><li>Payment failures</li><li>Application logs</li><li>Business metrics such as completed orders</li></ul><p>If the new version behaves as expected, gradually increase its traffic.</p><p>If it causes errors, stop the rollout and return traffic to the stable version.</p><p>This reduces the number of users potentially affected by a bad release — but it does not eliminate risk entirely.</p><h3>4. Blue/Green vs. Canary Deployment</h3><p>Both strategies help release new versions more safely, but they manage traffic differently.</p><p>FeatureBlue/GreenCanaryMain ideaPrepare a separate environment, then switch trafficGradually increase traffic to the new versionInitial traffic to new versionUsually none until the switchSmall percentageTestingTest the new environment before switchingTest with a limited amount of production trafficRollbackSwitch traffic back to the old environmentStop rollout and shift traffic backInfrastructureOften requires two environments temporarilyDepends on the deployment setupUseful whenYou want a clear switch between versionsYou want to observe the new version with limited exposure</p><p>A blue/green deployment can also use gradual traffic shifting. In practice, deployment strategies can overlap depending on how they are configured.</p><p>The important distinction is the rollout approach: <strong>blue/green focuses on separate environments; canary focuses on gradually increasing exposure to the new version.</strong></p><h3>5. How AWS Supports These Deployment Strategies</h3><p>AWS provides several services that can work together to support safer releases.</p><h3>AWS CodeDeploy</h3><p>CodeDeploy automates application deployments to supported compute environments.</p><p>It supports deployment strategies such as:</p><ul><li>Blue/green deployments for supported ECS and Lambda configurations.</li><li>Traffic shifting for Lambda aliases.</li><li>Deployment configurations that control how traffic moves to a new version.</li></ul><h3>Application Load Balancer</h3><p>An Application Load Balancer can distribute requests across target groups.</p><p>In an ECS blue/green deployment, the old and new task sets can use separate target groups. Traffic shifting determines which version receives requests.</p><h3>Amazon ECS and AWS Fargate</h3><p>ECS runs your containerized application. Fargate provides the serverless compute option for running ECS tasks without managing the underlying EC2 instances.</p><p>For a blue/green release, ECS can run the new task set while the existing task set continues serving traffic.</p><h3>Amazon CloudWatch</h3><p>CloudWatch helps monitor the application during and after deployment.</p><p>You can track metrics such as:</p><ul><li>Request count</li><li>HTTP 5xx errors</li><li>Target response time</li><li>CPU and memory utilization</li><li>Application-specific metrics</li><li>These signals help determine whether the new version is behaving as expected.</li></ul><h3>Amazon CloudFormation</h3><p>CloudFormation can manage infrastructure as code, making it easier to create and update repeatable environments.</p><p>It can be part of a deployment workflow, but it does not by itself guarantee a zero-downtime application release.</p><h3>6. A Real-World AWS Deployment Architecture</h3><p>Let’s imagine a React frontend and Node.js backend running on AWS.</p><p>The frontend is delivered through CloudFront, while the backend runs on ECS Fargate behind an Application Load Balancer.</p><pre>Users<br>                       |<br>                       v<br>                   CloudFront<br>                       |<br>                       v<br>                Application Load Balancer<br>                       |<br>               +-------+-------+<br>               |               |<br>               v               v<br>         Blue Target Group  Green Target Group<br>           Version 1.0        Version 2.0<br>               |               |<br>               v               v<br>           ECS Tasks        ECS Tasks<br>               |               |<br>               +-------+-------+<br>                       |<br>                       v<br>                  Amazon RDS</pre><pre>          CodeDeploy manages traffic shifting<br>          CloudWatch monitors application health</pre><p>A simplified release process:</p><ol><li>Build the new application version and push its image to ECR.</li><li>Deploy the new ECS task set.</li><li>Wait for health checks and run validation.</li><li>Shift traffic according to the deployment strategy.</li><li>Monitor errors and latency in CloudWatch.</li><li>Complete the deployment or roll back if the new version is unhealthy.</li><li>The architecture helps reduce deployment interruption, but it still depends on correct health checks, compatible database changes, and a safe rollback plan.</li></ol><h3>7. The Database Problem: Why Rollback Is Not Always Simple</h3><p>One of the most important deployment lessons is that <strong>rolling back application code is not the same as rolling back data</strong>.</p><p>Imagine version 2.0 changes a database column from:</p><pre>customer_name</pre><p>to:</p><pre>first_name<br>last_name</pre><p>If the new version writes data using the new schema, version 1.0 may no longer understand those records.</p><p>Switching traffic back to version 1.0 could cause errors — even if the old application environment is still running.</p><p>A safer approach is to use backward-compatible database migrations.</p><p>For example:</p><ol><li>Add the new fields without immediately removing the old ones.</li><li>Update the application to support both formats.</li><li>Migrate the data gradually.</li><li>Confirm the new version works correctly.</li><li>Remove old fields only in a later release, when it is safe.</li><li>This approach is often called an <strong>expand-and-contract migration</strong>.</li></ol><p>It helps make application releases and rollbacks safer when database changes are involved.</p><h3>8. What Should You Monitor During a Deployment?</h3><p>A deployment should not be considered successful just because the new version starts.</p><p>You need to verify that it behaves correctly under real traffic.</p><p>Important signals include:</p><ul><li><strong>Error rate:</strong> Are more requests returning 5xx errors?</li><li><strong>Latency:</strong> Are users experiencing slower responses?</li><li><strong>Health checks:</strong> Are the new tasks or instances healthy?</li><li><strong>Application logs:</strong> Are exceptions or unexpected events increasing?</li><li><strong>Business metrics:</strong> Are successful orders, payments, or sign-ins decreasing?</li><li>You can use CloudWatch alarms and deployment monitoring to detect problems and support automated rollback in supported configurations.</li></ul><p>The exact metrics and thresholds depend on the application. For example, a payment service may need to monitor payment failures in addition to infrastructure metrics.</p><h3>9. What Should You Remember for the AWS SAA-C03 Exam?</h3><ul><li><strong>Blue/green deployment:</strong> Deploys a new version into a separate environment before switching traffic.</li><li><strong>Canary deployment:</strong> Gradually shifts a small percentage of traffic to a new version.</li><li><strong>AWS CodeDeploy:</strong> Automates supported deployment workflows and traffic shifting.</li><li><strong>Application Load Balancer:</strong> Can route traffic to target groups used by ECS deployments.</li><li><strong>CloudWatch:</strong> Helps monitor application and infrastructure health.</li><li><strong>Rollback:</strong> Returns traffic or deployment state to a previous version, but does not automatically reverse database changes.</li><li><strong>Health checks:</strong> Help determine whether a new version is ready to receive traffic.</li><li>For exam questions, identify what the scenario is trying to achieve:</li><li>If it asks for a separate environment and a traffic switch, think <strong>blue/green</strong>.</li><li>If it asks to release to a small percentage of users first, think <strong>canary</strong>.</li><li>If it asks to automate supported deployment strategies, consider <strong>CodeDeploy</strong>.</li></ul><h3>Final Thoughts</h3><p>Before learning about deployment strategies, I thought releasing a new application version was mainly about building the code and putting it on a server.</p><p>But production deployments require more planning.</p><p>We need to keep the application available, verify the new version, monitor its behavior, and have a safe way to respond if something goes wrong.</p><p>Blue/green and canary deployments provide different ways to reduce release risk. Neither removes the need for testing, monitoring, or careful database changes.</p><p><strong>My biggest takeaway: a successful deployment isn’t just getting the new version running — it’s getting it running safely while users continue using the application.</strong></p><p>I’m continuing my AWS learning journey and documenting the concepts that help me understand how real-world cloud applications are deployed and maintained.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5415845550b2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Lambda Can Now Run for 30 Minutes — But Should You Still Use Step Functions, SQS, or ECS?]]></title>
            <link>https://medium.com/@supulanupa/aws-lambda-can-now-run-for-30-minutes-but-should-you-still-use-step-functions-sqs-or-ecs-3ba998555bc5?source=rss-c93ce69207e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ba998555bc5</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[cloud-engineering]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Anupa Supul]]></dc:creator>
            <pubDate>Tue, 24 Nov 2026 18:13:19 GMT</pubDate>
            <atom:updated>2026-11-24T18:13:19.629Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bPACJYpriKFusHsqfh1r2w.png" /></figure><p>For years, one number followed AWS Lambda developers everywhere: <strong>15 minutes</strong>.</p><p>If a task needed more time, we had to split it into smaller pieces, coordinate those pieces with a workflow service, or consider running the workload on containers.</p><p>Now, AWS has raised the maximum timeout for on-demand Lambda Event Functions to <strong>30 minutes</strong>. That opens the door to longer-running tasks — but it also raises an important architecture question:</p><p><strong>If Lambda can run for 30 minutes, when should we still use Step Functions, SQS, or ECS?</strong></p><p>The answer isn’t simply “use Lambda for everything.” A longer timeout gives us another option. It doesn’t remove the need to choose the right execution model.</p><h3>1. What Actually Changed?</h3><p>On November 19, 2026, AWS announced that on-demand Lambda Event Functions can run for up to 30 minutes per invocation, doubling the previous 15-minute limit. The new limit applies to synchronous, asynchronous, and supported event source mapping invocations. &lt;Cite ref=”turn275724search0&quot;/&gt;</p><p>This is useful for workloads such as:</p><ul><li>Processing large media files</li><li>Generating reports from multiple data sources</li><li>Running longer AI inference tasks</li><li>Performing financial calculations</li><li>Executing ETL steps triggered by S3 or SQS events</li></ul><p>For example, imagine a function that processes a large video and takes 22 minutes to finish. A 15-minute timeout would have forced us to split the work or move it to another compute option. With the new limit, that task may fit into one Lambda invocation.</p><p>But <strong>“may fit” is not the same as “should run as one function.”</strong></p><p>A single invocation is a good fit when the work is self-contained, can safely be retried, and doesn’t need to preserve progress across multiple stages.</p><h3>2. What the Longer Timeout Does — and Doesn’t — Mean</h3><p>The timeout controls how long one Lambda invocation can run. It does not automatically make a multi-step process reliable, resumable, or inexpensive.</p><p>A longer-running function still needs to account for:</p><ul><li>Retries and duplicate event delivery</li><li>Downstream services timing out</li><li>Network connections or temporary credentials expiring</li><li>Concurrency limits</li><li>Failures that happen near the end of a long task</li></ul><p>AWS also notes that longer execution times can increase concurrency requirements. At the same request rate, a function that runs for 30 minutes can require twice the concurrency of one that runs for 15 minutes. &lt;Cite ref=”turn275724search0&quot;/&gt;</p><p>So before increasing a timeout, ask: <strong>Is this really one long task, or is it a workflow made up of several tasks?</strong></p><p>That question helps determine which AWS service pattern makes sense.</p><h3>3. When Is a Longer Lambda Invocation a Good Fit?</h3><p>Lambda is a strong option when you have a discrete task that starts from an event, runs, and finishes.</p><p>For example:</p><pre>S3 file uploaded<br>       |<br>       v<br>Lambda function<br>       |<br>       v<br>Process file<br>       |<br>       v<br>Save result</pre><p>Suppose a user uploads a large document. A Lambda function extracts its contents, performs a transformation, and saves the result.</p><p>If the task takes 20 minutes, fits within Lambda’s limits, and can safely restart after failure, the longer timeout may simplify the design.</p><p>You may not need to split the work into several smaller functions just to stay under the old 15-minute limit.</p><p>However, if the task is expensive to repeat from the beginning, consider checkpointing or splitting it into recoverable stages. A longer timeout alone does not save progress when an invocation fails.</p><h3>4. When Should You Use Step Functions?</h3><p>AWS Step Functions is useful when the work is better represented as a <strong>workflow</strong> rather than one long function.</p><p>Imagine an order-processing system:</p><pre>Receive order<br>     |<br>     v<br>Validate order<br>     |<br>     v<br>Process payment<br>     |<br>     v<br>Update inventory<br>     |<br>     v<br>Send confirmation</pre><p>Each stage may have different failure conditions, retry rules, and recovery steps.</p><p>Step Functions can coordinate those stages, including branching, parallel work, retries, and error handling. It can also invoke Lambda functions.</p><p>The 30-minute Lambda timeout does not replace Step Functions. It simply means that an individual Lambda task inside a workflow can now run longer where supported. &lt;Cite ref=”turn275724search0&quot;/&gt;</p><p><strong>Use Step Functions when the workflow itself needs coordination.</strong> Don’t add it only because a single function used to hit the 15-minute limit.</p><h3>5. When Should You Use SQS?</h3><p>Amazon SQS solves a different problem: it helps <strong>decouple work from the system that creates it</strong>.</p><p>Imagine a website where users upload documents for processing.</p><p>Without a queue, the frontend-facing backend might have to wait for processing to finish. That can make requests slow and tie up application resources.</p><p>With SQS, the backend can place a message on a queue and return a response. A worker processes the job separately.</p><pre>User uploads file<br>       |<br>       v<br>Backend API<br>       |<br>       v<br>   SQS Queue<br>       |<br>       v<br> Lambda worker<br>       |<br>       v<br>Process document</pre><p>SQS is useful when you need to buffer bursts of work, decouple producers from consumers, or process jobs asynchronously.</p><p>A longer Lambda timeout can make an SQS-triggered worker suitable for some longer tasks. But the queue configuration matters.</p><p>For SQS event source mappings, AWS recommends setting the queue’s visibility timeout to at least six times the function timeout. For a 30-minute function, that means at least <strong>three hours</strong>. &lt;Cite ref=”turn275724search0&quot;/&gt;</p><p>Also, design the worker to be idempotent: a message can be processed more than once, so repeating the operation should not accidentally create duplicate payments, records, or other side effects.</p><h3>6. When Does ECS or Fargate Make More Sense?</h3><p>AWS Lambda is not the only way to run code without managing servers directly.</p><p>Amazon ECS with AWS Fargate is a good option when you need to run containerized workloads with more control over the runtime environment.</p><p>For example, a video-processing application might need:</p><ul><li>A custom container image with specialized dependencies</li><li>A process that runs for several hours</li><li>More control over how the application starts and operates</li><li>A worker service that continuously consumes jobs</li></ul><p>A container-based architecture might look like this:</p><pre>Application<br>     |<br>     v<br>   SQS Queue<br>     |<br>     v<br>ECS Service on Fargate<br>     |<br>     v<br>Process job<br>     |<br>     v<br>Store result</pre><p>Fargate removes the need to manage the underlying EC2 instances, but you still configure and operate the ECS tasks and services. It is not automatically cheaper or simpler than Lambda; the right choice depends on workload duration, traffic patterns, dependencies, and operational needs.</p><h3>7. Quick Comparison: Lambda vs. Step Functions vs. SQS vs. ECS</h3><p>These services aren’t direct substitutes for one another. They solve different parts of an architecture.</p><p>OptionMain purposeConsider it when<strong>Lambda</strong>Run code in response to eventsA task is self-contained and fits within the execution limits<strong>Step Functions</strong>Coordinate workflow stepsYou need branching, retries, parallel stages, or workflow-level recovery<strong>SQS</strong>Queue and buffer workYou need asynchronous processing and decoupling between systems<strong>ECS/Fargate</strong>Run containerized workloadsYou need more runtime control or longer-running container processes</p><p>You can also combine them. For example, SQS can buffer jobs, ECS can process them, and Step Functions can coordinate a separate multi-stage workflow.</p><p>The goal is not to pick one AWS service for the entire system. It’s to use each service where it solves the right problem.</p><h3>8. A Practical Decision Example</h3><p>Let’s say you’re building a document-processing application.</p><p>A user uploads a file, and your system must extract text, classify the content, and save the result.</p><h3>Option A: One Lambda invocation</h3><p>Use one Lambda function if the processing is a single, retryable task that reliably finishes within the timeout.</p><h3>Option B: SQS + Lambda</h3><p>Use SQS and Lambda if uploads can arrive in bursts and you want the API to accept jobs without waiting for processing to finish.</p><h3>Option C: Step Functions + Lambda</h3><p>Use Step Functions if the process has distinct stages, such as extraction, classification, validation, and review, with different retry or recovery rules.</p><h3>Option D: ECS/Fargate worker</h3><p>Use ECS/Fargate if the processing needs a custom container environment or a runtime that doesn’t fit comfortably within Lambda’s execution model.</p><p>The 30-minute timeout may make Option A or B viable for more workloads. It doesn’t make the other options obsolete.</p><h3>9. What Should You Check Before Increasing the Timeout?</h3><p>A longer timeout can be helpful, but it deserves a quick architecture review.</p><ul><li><strong>Retries:</strong> Could a failed invocation repeat work that already completed?</li><li><strong>Idempotency:</strong> Can the same event be processed again without causing duplicate side effects?</li><li><strong>Concurrency:</strong> Will longer execution increase the number of simultaneous invocations beyond your account or function limits?</li><li><strong>Connections:</strong> Could database connections, API sessions, or credentials expire during execution?</li><li><strong>Queue settings:</strong> If SQS invokes the function, is the visibility timeout configured appropriately?</li><li><strong>Recovery:</strong> If the function fails near the end, does it need to restart from the beginning, or should the workflow preserve progress?</li></ul><p>These checks matter because a function that succeeds in a local test may behave differently under production traffic, retries, and downstream service failures.</p><h3>Final Thoughts</h3><p>The new 30-minute Lambda timeout is a useful change. It lets more workloads run as a single invocation and may remove architectural workarounds that existed only because of the old 15-minute limit.</p><p>But the bigger lesson is about architecture.</p><p><strong>A longer timeout is an option — not an architecture.</strong></p><p>Use Lambda for suitable individual tasks. Use SQS to decouple and buffer work. Use Step Functions to coordinate multi-step workflows. Use ECS/Fargate when a container-based runtime is a better fit.</p><p>As I continue learning AWS, I’m realizing that good cloud engineering isn’t just knowing what each service does. It’s understanding when to combine them — and when not to add complexity that the application doesn’t need.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ba998555bc5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Do You Monitor a Production Application on AWS?]]></title>
            <link>https://medium.com/@supulanupa/how-do-you-monitor-a-production-application-on-aws-468dab513a53?source=rss-c93ce69207e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/468dab513a53</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[amazon-web-services]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Anupa Supul]]></dc:creator>
            <pubDate>Fri, 13 Nov 2026 07:51:01 GMT</pubDate>
            <atom:updated>2026-11-13T07:51:01.507Z</atom:updated>
            <content:encoded><![CDATA[<h3>How Do You Monitor a Production Application on AWS? Understanding CloudWatch, CloudTrail &amp; Observability</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*lQaBGlbssLHFGS0kkT1cdg.png" /></figure><p>Imagine you’ve deployed a web application on AWS.</p><p>Your React frontend is running, your Node.js backend is processing requests, and your database is connected.</p><p>Everything looks perfect.</p><p>But suddenly, users start reporting that the application is slow. Some API requests are failing, and your backend CPU utilization is increasing.</p><p>Now comes an important question:</p><p><strong>How do you know what’s happening inside your AWS infrastructure?</strong></p><p>You cannot simply wait for users to report problems. You need a way to monitor your application, identify failures, investigate issues, and receive alerts before they become bigger problems.</p><p>This is where AWS monitoring and observability services become important.</p><p>In this article, I’ll explore Amazon CloudWatch, AWS CloudTrail, metrics, logs, alarms, dashboards, and how these services help engineers monitor production applications.</p><h3>1. Why Is Monitoring Important?</h3><p>When an application runs locally, troubleshooting is relatively simple. You can open your terminal, inspect the logs, and debug the code.</p><p>But production applications are different.</p><p>They may involve:</p><ul><li>Multiple EC2 instances or ECS containers.</li><li>Load balancers distributing incoming requests.</li><li>Databases processing thousands of queries.</li><li>Lambda functions executing in response to events.</li><li>Several AWS services communicating with each other.</li><li>When something goes wrong, identifying the exact problem can become difficult.</li></ul><p>For example:</p><p>ProblemWhat you need to investigateApplication is slowResponse time and latencyBackend crashesApplication logs and errorsHigh server loadCPU and memory utilizationDatabase is slowDatabase connections and performanceUnauthorized configuration changesAWS API activityRequests are failingError rates and application logs</p><p>This is why monitoring is essential in production environments.</p><h3>2. What Is Amazon CloudWatch?</h3><p>Amazon CloudWatch is an AWS monitoring and observability service that helps collect and analyze operational data from AWS resources and applications.</p><p>It provides several important capabilities:</p><ul><li>Collect metrics.</li></ul><p>Store and analyze logs.</p><ul><li>Create monitoring dashboards.</li><li>Configure alarms.</li><li>Trigger automated actions based on alarm states.</li><li>For example, imagine running a Node.js backend on Amazon ECS Fargate.</li></ul><p>CloudWatch can help monitor CPU utilization, memory utilization, application logs, and other operational information.</p><p>Instead of manually checking every container, you can use CloudWatch to understand the overall health of your application.</p><h3>3. Understanding CloudWatch Metrics</h3><p>Metrics are numerical measurements collected over time.</p><p>They help you understand how your infrastructure and applications are performing.</p><p>For example, consider an EC2 instance running your backend application.</p><p>CloudWatch can collect metrics such as:</p><ul><li>CPU utilization.</li><li>Network traffic.</li><li>Disk-related performance metrics where available.</li><li>Status check failures.</li><li>A simple example:</li></ul><pre>CPU Utilization</pre><pre>100% | <br> 80% |                *<br> 60% |          *     *<br> 40% |     *    *<br> 20% | *   *<br>  0% |____________________<br>       9  10  11  12  13<br>              Time</pre><p>If CPU utilization remains unusually high, it might indicate that your application is receiving too many requests or performing expensive operations.</p><p>However, CPU utilization alone does not tell you exactly what is wrong. You may need application logs and additional metrics to investigate further.</p><h3>What about memory utilization?</h3><p>This is an important distinction.</p><p>EC2 does not automatically provide guest operating system memory utilization as a standard metric.</p><p>To collect memory and other operating-system-level metrics, you can install and configure the <strong>Amazon CloudWatch Agent</strong>.</p><p>For ECS and other container workloads, CloudWatch Container Insights can provide additional container-level observability when configured.</p><h3>4. Understanding CloudWatch Logs</h3><p>Metrics tell us what is happening, but logs help us understand why something is happening.</p><p>CloudWatch Logs allows applications and AWS services to send log events into log groups and log streams.</p><p>For example, imagine your Node.js backend encounters an error while connecting to MongoDB.</p><p>Your application might produce:</p><pre>2026-11-11 10:15:20 INFO  Server started on port 5000</pre><pre>2026-11-11 10:15:25 INFO  Database connection successful</pre><pre>2026-11-11 10:17:42 ERROR Database connection timeout</pre><pre>2026-11-11 10:17:43 ERROR Request failed: GET /api/users</pre><p>Instead of connecting to every running container to inspect logs, you can send application logs to CloudWatch Logs.</p><p>You can then search and filter the logs to investigate errors.</p><h3>CloudWatch Log Groups and Log Streams</h3><p>Two important concepts:</p><p><strong>Log Group:</strong> A collection of log streams that usually represent the same application or resource.</p><p><strong>Log Stream:</strong> A sequence of log events from a particular source, such as an individual container or application instance.</p><p>Example:</p><pre>CloudWatch Logs<br>       |<br>       v<br>   Log Group<br>  /    |     \<br> v     v      v<br>Stream Stream Stream<br>  1      2      3</pre><p>For example, you might create a log group called:</p><p>/production/node-backend</p><p>Different ECS tasks can send their logs into streams under this log group.</p><p>You can also configure log retention periods to control how long logs are stored.</p><h3>5. What Are CloudWatch Alarms?</h3><p>Monitoring metrics is useful, but continuously watching dashboards is not practical.</p><p>This is where CloudWatch Alarms become important.</p><p>A CloudWatch Alarm monitors a metric against a defined threshold or condition.</p><p>For example:</p><p>Imagine your production EC2 instance has a CPU utilization threshold of 80%.</p><p>If CPU utilization stays above that threshold for the configured evaluation periods, the alarm can change its state.</p><p>A simplified example:</p><pre>CloudWatch Metric<br>                |<br>                v<br>        CPU Utilization<br>                |<br>                v<br>       Is CPU above 80%?<br>                |<br>          +-----+-----+<br>          |           |<br>         YES          NO<br>          |           |<br>          v           v<br>     Alarm State    Normal<br>          |<br>          v<br>     Amazon SNS<br>          |<br>          v<br>     Email Alert</pre><p>CloudWatch Alarms can trigger actions such as:</p><ul><li>Sending notifications through Amazon SNS.</li><li>Invoking supported Auto Scaling actions.</li><li>Performing supported EC2 actions.</li><li>Triggering other configured workflows.</li><li>For example, you can configure an alarm to notify your engineering team when CPU utilization remains unusually high.</li></ul><p><strong>Important:</strong> An alarm does not automatically fix every problem. It detects a configured condition and performs the actions you have defined.</p><h3>6. What Is Amazon CloudWatch Dashboard?</h3><p>CloudWatch Dashboards allow you to visualize important metrics in one place.</p><p>Instead of navigating through multiple AWS services, you can create a dashboard that displays the health of your application.</p><p>For example, a production monitoring dashboard might contain:</p><p>MetricWhat it tells usEC2 CPU utilizationProcessor usageECS CPU utilizationContainer CPU usageECS memory utilizationContainer memory usageALB request countIncoming request volumeALB target response timeBackend response latencyALB HTTP 5xx errorsServer-side request failuresRDS database connectionsActive database connectionsLambda errorsFailed function invocations</p><p>You can combine these metrics into a single dashboard.</p><p>This makes it easier to identify performance problems and understand application health.</p><h3>7. What Is AWS CloudTrail?</h3><p>Now let’s move to another important AWS service.</p><p>Amazon CloudWatch monitors operational metrics and logs.</p><p>But what if you want to know:</p><ul><li>Who deleted an EC2 instance?</li><li>Who changed an IAM policy?</li><li>Who modified an S3 bucket configuration?</li><li>When was a security group updated?</li><li>Which AWS API operation was performed?</li><li>This is where <strong>AWS CloudTrail</strong> becomes important.</li></ul><p>CloudTrail records AWS account activity and API events.</p><p>For example, imagine someone changes the permissions of an S3 bucket.</p><p>CloudTrail can help identify:</p><ul><li>Which identity performed the action.</li><li>What API operation was performed.</li><li>When the operation occurred.</li><li>Which resource was involved.</li><li>Whether the request succeeded or failed.</li><li>A simplified example:</li></ul><pre>AWS Account<br>               |<br>               v<br>       AWS API Activity<br>               |<br>               v<br>          CloudTrail<br>               |<br>               v<br>       Recorded Events<br>               |<br>          +----+----+<br>          |         |<br>          v         v<br>     Event History  S3<br>                    |<br>                    v<br>              Long-term<br>               Storage</pre><p>CloudTrail Event History provides a searchable record of recent management events, generally covering the previous 90 days per Region.</p><p>For longer-term retention, you can configure a trail to deliver events to Amazon S3 and optionally use other integrations for analysis and alerting.</p><p>CloudTrail is especially useful for security investigations, auditing, and compliance requirements.</p><h3>8. CloudWatch vs. CloudTrail</h3><p>This is one of the most important distinctions to understand.</p><p>Although both services help monitor AWS environments, they serve different purposes.</p><p>FeatureCloudWatchCloudTrailMain purposeMonitoring and observabilityAccount activity auditingFocusPerformance and operational healthAPI and account activityMetricsYesNo, not its primary purposeApplication logsYesNo, not its primary purposeAPI activityCan receive relevant service eventsRecords AWS API activityAlarmsYesCan integrate with EventBridge for alertingExampleEC2 CPU reaches 90%Someone deletes an EC2 instance</p><p>A simple way to remember:</p><p><strong>CloudWatch tells you how your application and infrastructure are performing. CloudTrail helps you understand who did what in your AWS account.</strong></p><h3>9. Monitoring a Real-World AWS Application</h3><p>Let’s bring everything together.</p><p>Imagine a MERN application deployed using:</p><ul><li>React frontend.</li><li>Application Load Balancer.</li><li>ECS Fargate backend.</li><li>Amazon RDS database.</li><li>Amazon S3 storage.</li></ul><p>How can we monitor this architecture?</p><pre>Users<br>                   |<br>                   v<br>              CloudFront<br>                   |<br>                   v<br>              React App<br>                   |<br>                   v<br>        Application Load Balancer<br>                   |<br>                   v<br>              ECS Fargate<br>              (Node.js API)<br>                   |<br>             +-----+-----+<br>             |           |<br>             v           v<br>          Amazon RDS   Amazon S3<br>             |           |<br>             +-----+-----+<br>                   |<br>                   v<br>             AWS Monitoring<br>                   |<br>          +--------+--------+<br>          |                 |<br>          v                 v<br>     CloudWatch         CloudTrail<br>          |                 |<br>          v                 v<br>    Metrics / Logs      API Activity<br>    Dashboards          Audit Events<br>    Alarms<br>          |<br>          v<br>         SNS<br>          |<br>          v<br>      Email Alert</pre><p>In this architecture:</p><p><strong>CloudWatch Metrics</strong></p><ul><li>Monitor ECS CPU and memory utilization.</li><li>Track ALB request count and response time.</li><li>Monitor RDS database connections.</li><li>Track application errors.</li></ul><p><strong>CloudWatch Logs</strong></p><ul><li>Collect Node.js backend logs.</li><li>Investigate application exceptions.</li><li>Identify failed database connections.</li><li>Troubleshoot API errors.</li></ul><p><strong>CloudWatch Alarms</strong></p><ul><li>Notify engineers when CPU utilization becomes too high.</li><li>Alert when ALB error rates increase.</li><li>Monitor database resource utilization.</li><li><strong>CloudTrail</strong></li><li>Record changes to IAM policies.</li><li>Track changes to security groups.</li><li>Investigate resource creation and deletion.</li><li>Audit AWS API activity.</li><li>This gives engineers better visibility into their production environment.</li></ul><h3>10. What Is Observability?</h3><p>Monitoring and observability are closely related, but they are not exactly the same.</p><p>Monitoring helps you track predefined metrics and detect known problems.</p><p>Observability goes further by helping you understand the internal state of a system using the information it produces.</p><p>Three commonly discussed pillars of observability are:</p><h3>Metrics</h3><p>Numerical measurements collected over time.</p><p>Examples:</p><ul><li>CPU utilization.</li><li>Request latency.</li><li>Error rate.</li><li>Request count.</li><li>Logs</li></ul><p>Timestamped records of events generated by applications and infrastructure.</p><p>Examples:</p><ul><li>Application errors.</li><li>Authentication failures.</li><li>Database connection issues.</li><li>Request processing information.</li><li>Traces</li></ul><p>Traces help follow a request as it moves through multiple services.</p><p>Imagine a user requests an order from your application.</p><pre>User Request<br>     |<br>     v<br>API Gateway<br>     |<br>     v<br>Lambda Function<br>     |<br>     v<br>DynamoDB<br>     |<br>     v<br>Response</pre><p>A distributed trace can help identify how much time each component takes to process the request.</p><p>AWS provides <strong>AWS X-Ray</strong> and CloudWatch Application Signals to help with distributed tracing and application performance monitoring.</p><p>For example, if a request takes five seconds, tracing can help determine whether the delay comes from the API, Lambda function, or database operation.</p><h3>11. What Should You Remember for the AWS SAA-C03 Exam?</h3><p>Here are some important concepts:</p><ul><li><strong>Amazon CloudWatch:</strong> Monitoring and observability service.</li><li><strong>CloudWatch Metrics:</strong> Numerical measurements collected over time.</li><li><strong>CloudWatch Logs:</strong> Stores and analyzes log events.</li><li><strong>CloudWatch Alarms:</strong> Monitors metrics and triggers configured actions.</li><li><strong>CloudWatch Dashboards:</strong> Visualizes metrics in one place.</li><li><strong>CloudWatch Agent:</strong> Collects additional system-level metrics and logs from supported environments.</li><li><strong>CloudWatch Container Insights:</strong> Provides container-level monitoring and observability.</li><li><strong>AWS CloudTrail:</strong> Records AWS account activity and API events.</li><li><strong>CloudTrail Event History:</strong> Provides recent management event history.</li><li><strong>Amazon SNS:</strong> Can send notifications when CloudWatch Alarms trigger.</li><li><strong>AWS X-Ray:</strong> Helps analyze and trace requests across distributed applications.</li><li>One important exam distinction:</li></ul><p>If a question asks you to identify <strong>who modified an AWS resource</strong>, think CloudTrail.</p><p>If it asks you to <strong>monitor CPU utilization and trigger an alert</strong>, think CloudWatch.</p><p>If it asks you to <strong>investigate application errors</strong>, think CloudWatch Logs.</p><p>If it asks you to <strong>trace a request across multiple services</strong>, think AWS X-Ray or CloudWatch Application Signals.</p><h3>Final Thoughts</h3><p>When I started learning AWS, I mainly focused on deploying applications, connecting services, and understanding cloud architecture.</p><p>But monitoring introduced another important part of cloud engineering: knowing what happens after deployment.</p><p>A production application is not complete simply because it works. Engineers also need to monitor its performance, investigate failures, identify unusual activity, and respond to problems.</p><p>Amazon CloudWatch, AWS CloudTrail, and AWS X-Ray provide different capabilities that help achieve this.</p><p>My biggest takeaway from this topic is simple:</p><p><strong>Deploying an application is only the beginning. Understanding how it behaves in production is what makes you a better cloud engineer.</strong></p><p>I’m continuing my AWS learning journey and documenting the concepts that help me understand how real-world cloud applications are built, monitored, and maintained.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=468dab513a53" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Does AWS Protect Sensitive Data? Understanding AWS KMS, Encryption & Key Management]]></title>
            <link>https://medium.com/@supulanupa/how-does-aws-protect-sensitive-data-understanding-aws-kms-encryption-key-management-838736e1ccde?source=rss-c93ce69207e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/838736e1ccde</guid>
            <category><![CDATA[amazon-web-services]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Anupa Supul]]></dc:creator>
            <pubDate>Wed, 11 Nov 2026 05:41:30 GMT</pubDate>
            <atom:updated>2026-11-11T05:41:30.904Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kFT0hgQ6QW370W-1VQy-Mw.png" /></figure><p>Imagine you’re building a web application and deploying it on AWS.</p><p>Your application stores customer information, database credentials, uploaded documents, and other sensitive data.</p><p>Now consider something important:</p><p><strong>What happens if someone gains access to the underlying storage? Can they read your data?</strong></p><p>This is where encryption becomes essential.</p><p>AWS provides several services and mechanisms to protect sensitive information. One of the most important is <strong>AWS Key Management Service (AWS KMS)</strong>.</p><p>In this article, I’ll explore how encryption works in AWS, what KMS does, how envelope encryption protects data, and how services such as Amazon S3 and AWS Secrets Manager use encryption in real-world applications.</p><h3>1. What Is Encryption?</h3><p>Encryption is the process of converting readable information (plaintext) into an unreadable format (ciphertext) using a cryptographic algorithm and key.</p><p>For example:</p><pre>Original Data (Plaintext)<br>          |<br>          v<br>      Encryption<br>          |<br>          v<br>    Encrypted Data<br>     (Ciphertext)<br>          |<br>          v<br>      Decryption<br>          |<br>          v<br> Original Data Again</pre><p>Without the appropriate decryption key, an unauthorized person should not be able to read the protected data.</p><p>Encryption is commonly used to protect:</p><ul><li>Customer information</li><li>Database records</li><li>Uploaded documents</li><li>Application credentials</li><li>Payment-related information</li><li>Communication between applications</li></ul><p>In cloud environments, encryption is generally considered in two important situations.</p><h3>Encryption at rest</h3><p>Encryption at rest protects data while it is stored.</p><p>Examples:</p><ul><li>Files stored in Amazon S3</li><li>Database storage in Amazon RDS</li><li>Volumes attached to Amazon EC2</li><li>Backups and snapshots</li></ul><p>Even if someone gains access to the underlying storage media, encrypted data remains protected without the required decryption capability.</p><h3>Encryption in transit</h3><p>Encryption in transit protects data while it travels between systems.</p><p>For example:</p><pre>User Browser<br>     |<br>     | HTTPS / TLS<br>     |<br>     v<br>Application Load Balancer<br>     |<br>     | HTTPS (if configured)<br>     |<br>     v<br>Backend Application</pre><p>HTTPS uses TLS to establish an encrypted connection between communicating parties.</p><p><strong>Remember: Encryption at rest protects stored data, while encryption in transit protects data moving across a network.</strong></p><h3>2. What Is AWS KMS?</h3><p>AWS Key Management Service (KMS) is a managed service that allows you to create and control cryptographic keys used to protect data.</p><p>Instead of building your own key management infrastructure, AWS KMS provides a managed way to create, manage, and use cryptographic keys.</p><p>KMS can integrate with many AWS services, including:</p><ul><li>Amazon S3</li><li>Amazon EBS</li><li>Amazon RDS</li><li>AWS Lambda</li><li>AWS Secrets Manager</li><li>Amazon EFS</li></ul><p>For example, when you enable SSE-KMS encryption on an S3 bucket, Amazon S3 can use a KMS key to protect the objects stored in that bucket.</p><p>The important thing is that KMS manages cryptographic keys. It does not replace the storage service where your actual application data lives.</p><h3>3. Understanding AWS KMS Keys</h3><p>A KMS key is a logical representation of a cryptographic key managed by AWS KMS.</p><p>There are several key ownership and management options.</p><h3>AWS owned keys</h3><p>These are managed by AWS and used across AWS services in supported scenarios.</p><ul><li>AWS manages the keys.</li><li>Customers cannot view or manage them directly.</li><li>There is no separate customer-facing key management charge.</li></ul><h3>AWS managed keys</h3><p>These are created and managed by AWS services in your account.</p><p>For example, an AWS service might use an AWS managed KMS key to encrypt data.</p><ul><li>AWS manages the key lifecycle.</li><li>You can view the key in your account.</li><li>You have limited control compared with customer managed keys.</li></ul><h3>Customer managed keys</h3><p>These are keys that you create and manage in AWS KMS.</p><p>You have greater control over:</p><ul><li>Key policies</li><li>IAM permissions</li><li>Key rotation options</li><li>Key disabling and deletion</li><li>Grants and access management</li></ul><p>For example, an organization may create a customer managed KMS key specifically for encrypting sensitive customer documents.</p><p>This provides greater control over how the key is used.</p><h3>4. How Does AWS KMS Encryption Work?</h3><p>Let’s imagine an application storing customer documents in Amazon S3.</p><p>When using KMS-based encryption, the application or AWS service can request cryptographic operations from KMS.</p><p>A simplified flow looks like this:</p><pre>Application<br>            |<br>            v<br>       Amazon S3<br>            |<br>            v<br>         AWS KMS<br>            |<br>            v<br>      KMS Key Used<br>       for Encryption<br>            |<br>            v<br>     Encrypted Object<br>       Stored in S3</pre><p>However, there is an important concept behind this process: <strong>Envelope Encryption</strong>.</p><h3>5. What Is Envelope Encryption?</h3><p>Envelope encryption is a method of protecting data by encrypting the actual data with one key and protecting that key with another key.</p><p>This is particularly useful when applications need to encrypt large amounts of data.</p><p>Let’s understand it step by step.</p><ol><li>AWS KMS generates a data key.</li><li>The application uses the plaintext data key to encrypt the actual data.</li><li>The encrypted data key is stored alongside the encrypted data.</li><li>The plaintext data key is removed from memory when no longer needed.</li><li>When the data needs to be decrypted, the encrypted data key is sent to KMS.</li><li>KMS decrypts the data key, allowing the application to decrypt the original data.</li></ol><p>Architecture:</p><pre>              AWS KMS<br>                 |<br>                 v<br>        Generate Data Key<br>                 |<br>          +------+------+<br>          |             |<br>          v             v<br>    Plaintext Key   Encrypted Key<br>          |             |<br>          v             |<br>    Encrypt Data         |<br>          |             |<br>          v             v<br>     Encrypted Data + Encrypted Data Key<br>                 |<br>                 v<br>             Storage</pre><p>Why is this useful?</p><p>Instead of sending large amounts of application data directly to KMS for encryption, the application can use a data key locally to encrypt the data.</p><p>KMS protects the data key.</p><p>This approach improves scalability and is widely used in cloud encryption systems.</p><h3>6. How Does Amazon S3 Protect Stored Data?</h3><p>Amazon S3 supports multiple server-side encryption options.</p><p>Let’s look at the important ones.</p><h3>SSE-S3</h3><p>Server-Side Encryption with Amazon S3 managed keys.</p><ul><li>Amazon S3 manages the encryption keys.</li><li>Encryption and decryption are handled automatically by S3.</li><li>Suitable for many standard object-storage use cases.</li></ul><h3>SSE-KMS</h3><p>Server-Side Encryption with AWS KMS keys.</p><ul><li>Uses AWS KMS to protect encryption keys.</li><li>Supports customer managed keys and AWS managed keys.</li><li>Provides additional control through KMS policies and permissions.</li><li>Can provide audit visibility through AWS logging services.</li></ul><p>This is particularly useful when organizations need more control over encryption key access.</p><h3>SSE-C</h3><p>Server-Side Encryption with Customer-Provided Keys.</p><ul><li>The customer supplies the encryption key with each relevant request.</li><li>Amazon S3 performs the encryption and decryption.</li><li>The customer is responsible for securely managing the key.</li></ul><p>For most applications, SSE-S3 or SSE-KMS is easier to manage than SSE-C.</p><h3>Quick comparison</h3><p>FeatureSSE-S3SSE-KMSSSE-CKey managementAmazon S3AWS KMSCustomerEncryptionServer-sideServer-sideServer-sideCustomer key controlLimitedGreater controlCustomer-managedKMS integrationNo customer KMS key requiredYesNo</p><p><strong>Important:</strong> S3 automatically encrypts new object uploads with SSE-S3 by default. You can configure SSE-KMS when you need KMS-based key management and additional access controls.</p><h3>7. How Does AWS Secrets Manager Protect Sensitive Information?</h3><p>Encryption is not only about files and databases. Applications also need to protect sensitive credentials.</p><p>Imagine your backend needs to connect to MongoDB or an RDS database.</p><p>A dangerous approach would be storing credentials directly inside your source code:</p><pre>const dbPassword = &quot;my-secret-password&quot;;</pre><p>If this code is pushed to GitHub, your credentials could be exposed.</p><p>Instead, AWS provides <strong>AWS Secrets Manager</strong>.</p><p>Secrets Manager helps you:</p><ul><li>Store database credentials and API keys.</li><li>Retrieve secrets securely through authorized applications.</li><li>Rotate supported secrets automatically when configured.</li><li>Integrate with AWS KMS for encryption at rest.</li></ul><p>A simplified architecture:</p><pre>         Backend Application<br>                |<br>                v<br>             IAM Role<br>                |<br>                v<br>       AWS Secrets Manager<br>                |<br>                v<br>             AWS KMS<br>                |<br>                v<br>       Encrypted Secret</pre><p>For example, an ECS task can use its task role to retrieve a specific database secret from Secrets Manager.</p><p>KMS helps protect the secret at rest, while IAM controls whether the application is authorized to retrieve it.</p><p><strong>Remember the difference:</strong></p><ul><li>IAM controls who can access a secret.</li><li>Secrets Manager stores and manages the secret.</li><li>KMS protects encryption keys used to encrypt the secret.</li></ul><h3>8. What Happens If Someone Tries to Access an Encrypted Resource?</h3><p>Encryption alone does not guarantee authorization.</p><p>AWS also uses IAM policies, KMS key policies, and other access-control mechanisms to determine whether a request is permitted.</p><p>For example, imagine a developer has permission to read an encrypted S3 object but does not have the required KMS permissions.</p><p>The developer may still be unable to decrypt and read that object.</p><p>For SSE-KMS, access generally requires the appropriate S3 permissions and KMS permissions, subject to the applicable key policy, IAM policy, grants, and other authorization rules.</p><p>This gives organizations another layer of access control.</p><h3>9. Real-World AWS Architecture Example</h3><p>Let’s bring everything together using a simple application architecture.</p><p>Imagine a React frontend and Node.js backend deployed on AWS.</p><pre>User<br>               |<br>               v<br>          CloudFront<br>               |<br>               v<br>         React Frontend<br>               |<br>               v<br>        Application API<br>               |<br>          +----+-----+<br>          |          |<br>          v          v<br>      Amazon S3   AWS Secrets<br>       Documents   Manager<br>          |          |<br>          v          v<br>       AWS KMS    AWS KMS<br>          |          |<br>          v          v<br>      Encrypted   Encrypted<br>       Objects     Secrets<br>          |<br>          v<br>       Storage</pre><pre>      HTTPS / TLS protects<br>      data in transit</pre><p>In this architecture:</p><ul><li>CloudFront delivers the frontend securely.</li><li>HTTPS/TLS protects communication in transit.</li><li>Amazon S3 stores uploaded documents.</li><li>AWS KMS protects encryption keys used for S3 encryption.</li><li>Secrets Manager stores sensitive application credentials.</li><li>IAM roles control which services can access these resources.</li></ul><p>This is a simplified example, but it demonstrates how different AWS services work together to protect application data.</p><h3>10. What Should You Remember for the AWS SAA-C03 Exam?</h3><p>Here are some important points:</p><ul><li><strong>Encryption at rest:</strong> Protects stored data.</li><li><strong>Encryption in transit:</strong> Protects data moving across networks.</li><li><strong>AWS KMS:</strong> Managed service for creating and controlling cryptographic keys.</li><li><strong>Customer managed key:</strong> Gives customers greater control over key management.</li><li><strong>AWS managed key:</strong> Managed by AWS on behalf of a customer in their account.</li><li><strong>Envelope encryption:</strong> Encrypts data using a data key and protects that data key using another key.</li><li><strong>SSE-S3:</strong> Amazon S3 manages the encryption keys.</li><li><strong>SSE-KMS:</strong> Uses AWS KMS for key management.</li><li><strong>SSE-C:</strong> Customer provides and manages the encryption key.</li><li><strong>AWS Secrets Manager:</strong> Stores and manages sensitive information such as credentials.</li><li><strong>IAM:</strong> Controls permissions to access AWS resources and use KMS keys.</li><li>One more important exam concept:</li></ul><p><strong>Disabling a KMS key prevents it from being used for cryptographic operations. Deleting a KMS key is a separate operation and can permanently make encrypted data unrecoverable if no usable copy of the key remains.</strong></p><h3>Final Thoughts</h3><p>When I started learning cloud computing, I mainly focused on deploying applications and connecting AWS services.</p><p>But understanding encryption made me realize that a production-ready application needs more than just working infrastructure.</p><p>It needs proper access control, secure communication, encryption, and responsible key management.</p><p>AWS KMS, Amazon S3, IAM, and Secrets Manager work together to provide these security capabilities.</p><p>My biggest takeaway from this topic is simple:</p><p><strong>Protecting data is not just about encrypting it. It’s also about controlling who can decrypt it and how encryption keys are managed.</strong></p><p>I’m continuing my AWS learning journey and documenting the concepts that help me understand how real-world cloud applications are built and secured.</p><p>#AWS #CloudComputing #AWSKMS #CyberSecurity #Encryption #CloudSecurity #AWSLearning</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=838736e1ccde" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Does AWS Control Who Can Access What? Understanding IAM Policies, Roles & Least Privilege]]></title>
            <link>https://medium.com/@supulanupa/how-does-aws-control-who-can-access-what-understanding-iam-policies-roles-least-privilege-0e18789201fc?source=rss-c93ce69207e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/0e18789201fc</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[amazon-web-services]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Anupa Supul]]></dc:creator>
            <pubDate>Fri, 30 Oct 2026 06:36:01 GMT</pubDate>
            <atom:updated>2026-10-30T06:36:01.457Z</atom:updated>
            <content:encoded><![CDATA[<h3>How Does AWS Control Who Can Access What? Understanding IAM Policies, Roles &amp; Least Privilege</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Me6oQUyvv42fi4HaOpDraw.png" /></figure><p>When I started learning AWS, I realized something important: creating cloud resources is only part of the job. We also need to control <strong>who can access those resources, what they can do, and which AWS services can communicate with each other.</strong></p><p>Imagine deploying a MERN application on AWS. Your backend needs to read files from S3, retrieve database credentials, and write application logs. Should we give it full access to our AWS account?</p><p>Definitely not.</p><p>This is where <strong>AWS Identity and Access Management (IAM)</strong> becomes essential.</p><p>In this article, I’ll explore IAM users, groups, roles, policies, trust policies, permission boundaries, and the principle of least privilege using practical examples.</p><h3>1. What Is AWS IAM?</h3><p>AWS IAM is a service that helps control access to AWS resources.</p><p>It answers three fundamental questions:</p><ul><li><strong>Who</strong> is making the request?</li><li><strong>What</strong> actions are they allowed to perform?</li><li><strong>Which</strong> resources can they access?</li></ul><p>For example, a developer might be allowed to view EC2 instances but not delete production databases. Meanwhile, an application running on Amazon ECS might need permission to read a specific file from S3.</p><p>IAM lets us define these permissions instead of granting everyone unrestricted access.</p><h3>2. Understanding the Main IAM Components</h3><p>There are several IAM concepts worth understanding before building a secure architecture.</p><h3>IAM users</h3><p>An IAM user represents an identity with long-term credentials, when those credentials are configured.</p><p>For example, a developer may have an IAM user that can access specific development resources.</p><p>However, for people, AWS recommends federation and temporary credentials where practical rather than creating long-term IAM user credentials for everyday access.</p><p><strong>Important:</strong> Avoid using the AWS root user for routine tasks. Protect it carefully and use it only when root-level access is specifically required.</p><h3>IAM groups</h3><p>An IAM group allows you to manage permissions for multiple IAM users together.</p><p>For example:</p><ul><li>Developers — access to development resources</li><li>Auditors — read-only access for reviewing resources</li><li>Administrators — broader administrative permissions</li></ul><p>Groups simplify permission management, but they are not a replacement for carefully designed policies.</p><h3>IAM roles</h3><p>An IAM role is an identity that provides a set of permissions and can be assumed by an authorized principal.</p><p>Roles are especially useful when AWS services need to communicate securely.</p><p>Imagine an application running on Amazon EC2 that needs to read a file from S3.</p><p>Instead of placing AWS access keys inside the application code, we can attach an appropriate IAM role to the EC2 instance. The application can then obtain temporary credentials through the AWS-provided credential mechanism.</p><p>This reduces the need to store long-term credentials in the application.</p><p>IAM roles are also used with ECS tasks, Lambda functions, and many other AWS services.</p><h3>IAM policies</h3><p>An IAM policy is a document that defines permissions.</p><p>A policy can specify:</p><ul><li><strong>Effect:</strong> Allow or Deny</li><li><strong>Action:</strong> The operation being requested</li><li><strong>Resource:</strong> The AWS resource involved</li><li><strong>Condition:</strong> Optional requirements that must be satisfied</li></ul><p>For example, an application might need permission to download objects from one S3 bucket without being allowed to delete them.</p><p>A simplified policy could look like this:</p><pre>{<br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>  &quot;Statement&quot;: [<br>    {<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Action&quot;: &quot;s3:GetObject&quot;,<br>      &quot;Resource&quot;: &quot;arn:aws:s3:::my-app-documents/*&quot;<br>    }<br>  ]<br>}</pre><p>This allows the specified GetObject operation on objects in the named bucket. It does not, by itself, grant permission to upload or delete objects.</p><p>Replace the example bucket name with your actual resource when implementing a policy.</p><h3>3. Identity-Based vs Resource-Based Policies</h3><p>AWS supports different ways of defining access.</p><p><strong>Identity-based policies</strong> attach to identities such as users, groups, and roles. They describe what those identities can do.</p><p><strong>Resource-based policies</strong> attach to supported resources and describe which principals can access them.</p><p>For example, an IAM role may have permission to read objects from an S3 bucket, while the bucket policy may also restrict which principals are allowed to access that bucket.</p><p>Both sides can matter. An Allow in one policy does not automatically override an applicable explicit Deny or other access restrictions.</p><h3>4. What Is a Trust Policy?</h3><p>This is one of the most important distinctions when learning IAM roles.</p><p>An IAM role has two separate questions to answer:</p><ol><li><strong>Trust policy:</strong> Who is allowed to assume this role?</li><li><strong>Permissions policy:</strong> What can the role do after it is assumed?</li></ol><p>Imagine an ECS task that needs to access an S3 bucket.</p><p>The task role’s trust policy establishes that the appropriate ECS tasks can assume the role. Its permissions policy grants only the required S3 actions.</p><p>These policies solve different problems. Allowing a service to assume a role does not automatically give that role permission to access S3.</p><h3>5. How IAM Works in a Real Application</h3><p>Let’s use a simplified architecture for a web application deployed on AWS.</p><pre>Developer<br>                    |<br>                    v<br>              AWS Console / CLI<br>                    |<br>                    v<br>               IAM Identity<br>                    |<br>            IAM Policies<br>                    |<br>                    v<br>             AWS Resources<br></pre><pre>          Application Running on ECS<br>                    |<br>                    v<br>               ECS Task Role<br>                    |<br>            Permissions Policy<br>                    |<br>          +---------+----------+<br>          |                    |<br>          v                    v<br>      Amazon S3        AWS Secrets Manager</pre><p>The developer accesses AWS using an authorized identity. The application accesses other AWS services through its task role.</p><p>These are separate identities with separate permissions.</p><p>For example:</p><ul><li>A developer can deploy a new application version.</li><li>An ECS task can read specific S3 objects.</li><li>The task can retrieve a particular secret if its role is authorized to do so.</li><li>Neither identity automatically needs full administrator access.</li></ul><p>This is the basic idea behind secure access control in cloud applications.</p><h3>6. What Is the Principle of Least Privilege?</h3><p>The principle of least privilege means granting only the permissions necessary to perform a task.</p><p>Suppose your application needs to read files from S3.</p><p>A poor approach would be to grant s3:* on every bucket in the account.</p><p>A better approach would be to grant only the necessary S3 actions on the specific bucket or objects the application needs.</p><p>Broad permissionLeast-privilege alternativeAll S3 actionsOnly required S3 actionsAll resourcesSpecific resource ARNs where supportedPermanent credentialsTemporary credentials where practicalAdministrator access for every developerRole-based access suited to each responsibility</p><p>Least privilege is not simply about writing smaller policies. It also means reviewing permissions regularly, removing unused access, and considering what could happen if an identity were compromised.</p><h3>7. What Are Permission Boundaries?</h3><p>Permission boundaries help set the maximum permissions that an IAM user or role can receive through identity-based policies.</p><p>Think of them as a permissions ceiling.</p><p>For example, an organization might allow a development team to create roles for its applications but require that those roles remain within a defined permissions boundary.</p><p>A boundary does not grant permissions by itself. The identity still needs applicable policies that allow the requested actions.</p><p>Also, a permissions boundary is not a universal restriction on every possible access path. Resource-based policies and other AWS authorization rules must be considered when evaluating effective access.</p><h3>8. IAM Roles vs Hardcoded Credentials</h3><p>Consider two approaches for an application that accesses AWS services.</p><p><strong>Approach A: Hardcoded credentials</strong></p><pre>const accessKey = &quot;YOUR_ACCESS_KEY&quot;;<br>const secretKey = &quot;YOUR_SECRET_KEY&quot;;</pre><p>This is unsafe. Credentials can accidentally enter Git repositories, logs, build artifacts, or shared files.</p><p><strong>Approach B: IAM role and temporary credentials</strong></p><p>Configure the application’s execution environment with the appropriate IAM role. Use the AWS SDK’s default credential provider chain to obtain credentials.</p><p>For example, with AWS SDK for JavaScript v3:</p><pre>import { S3Client, ListObjectsV2Command } from &quot;@aws-sdk/client-s3&quot;;</pre><pre>const s3 = new S3Client({<br>  region: &quot;ap-south-1&quot;<br>});</pre><pre>const response = await s3.send(<br>  new ListObjectsV2Command({<br>    Bucket: &quot;my-app-documents&quot;<br>  })<br>);</pre><pre>console.log(response.Contents);</pre><p>The SDK can obtain credentials from the supported runtime credential provider chain, including the role credentials provided in an appropriately configured AWS environment.</p><p>The example still requires permission for s3:ListBucket on the bucket. If the application only needs to download a known object, grant s3:GetObject on that object instead.</p><p><strong>Remember:</strong> Using an IAM role does not automatically make an application secure. The role must have the right trust relationship and narrowly scoped permissions.</p><h3>9. IAM and AWS Secrets Manager</h3><p>IAM and Secrets Manager work together, but they have different responsibilities.</p><ul><li><strong>IAM</strong> controls whether an identity can perform an action.</li><li><strong>AWS Secrets Manager</strong> stores and manages sensitive values such as database credentials and API keys.</li></ul><p>For example, an ECS task can use its task role to retrieve a particular database secret from Secrets Manager. The task role should not be allowed to retrieve every secret in the account unless that broader access is genuinely required.</p><p>Avoid embedding secrets in source code, Docker images, or GitHub repositories.</p><h3>10. Common IAM Mistakes to Avoid</h3><p>Here are a few mistakes worth watching for when building AWS projects:</p><ol><li>Using the root user for everyday development.</li><li>Giving applications administrator permissions.</li><li>Hardcoding AWS access keys into source code.</li><li>Confusing a role’s trust policy with its permissions policy.</li><li>Assuming a permissions boundary grants access.</li><li>Forgetting that an explicit Deny can override an Allow.</li><li>Granting access to every resource when only one resource is required.</li><li>Leaving unused users, access keys, or permissions in place.</li></ol><p>IAM policies should be tested and reviewed carefully, particularly before making changes in production.</p><h3>11. What Should You Remember for the AWS SAA-C03 Exam?</h3><p>These are useful distinctions to remember:</p><ul><li><strong>IAM user:</strong> An identity that can have long-term credentials.</li><li><strong>IAM group:</strong> Organizes IAM users for permission management.</li><li><strong>IAM role:</strong> An assumable identity commonly used for temporary credentials.</li><li><strong>IAM policy:</strong> Defines permissions.</li><li><strong>Trust policy:</strong> Defines who can assume a role.</li><li><strong>Permissions boundary:</strong> Sets a maximum permission boundary for an IAM identity.</li><li><strong>Least privilege:</strong> Grants only the access needed.</li><li><strong>Explicit Deny:</strong> Overrides an applicable Allow.</li><li><strong>Instance profile:</strong> A mechanism used to pass an IAM role to an EC2 instance.</li><li><strong>ECS task role:</strong> Grants permissions to application code running in an ECS task.</li><li><strong>ECS task execution role:</strong> Grants permissions needed by the ECS agent to perform tasks such as pulling images and sending logs, depending on configuration.</li></ul><p>That last distinction matters: <strong>the task role is for the application; the execution role is for ECS task startup and management operations.</strong></p><h3>Final Thoughts</h3><p>Learning IAM changed how I think about deploying applications on AWS. It is not enough for an application to work — it must also have the right permissions and nothing more than it needs.</p><p>Whether you’re deploying a Lambda function, running containers on ECS, or building a larger cloud architecture, IAM is one of the foundations of secure AWS development.</p><p>My biggest takeaway is simple: <strong>don’t ask only whether an application can access a resource. Ask whether it should have that access, and whether the permission can be made more specific.</strong></p><p>That’s the mindset behind least privilege.</p><p>I’m continuing my AWS learning journey and documenting the concepts that help me understand how real cloud systems are built and secured.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0e18789201fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Happens When a Serverless Workflow Has 10 Steps? Understanding AWS Step Functions]]></title>
            <link>https://medium.com/@supulanupa/what-happens-when-a-serverless-workflow-has-10-steps-understanding-aws-step-functions-dd5a2e144426?source=rss-c93ce69207e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd5a2e144426</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Anupa Supul]]></dc:creator>
            <pubDate>Thu, 29 Oct 2026 05:18:08 GMT</pubDate>
            <atom:updated>2026-10-29T05:18:08.398Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sTxPwiMcxgLHDezJzIwvfQ.png" /></figure><p>In my previous articles, I explored AWS Lambda, API Gateway, DynamoDB, SQS, SNS, and EventBridge.</p><p>Each service solves a specific problem. But as I learned more about serverless architecture, I started thinking about another challenge.</p><p><strong>What happens when an application needs to coordinate many tasks, handle failures, and decide what to do next?</strong></p><p>Imagine an online shopping application.</p><p>When a customer places an order, the system might need to validate the order, process payment, update inventory, arrange delivery, and send a confirmation.</p><p>Some steps must happen in a particular order. Some can run in parallel. Others might need to be retried if they fail.</p><p>Managing all this logic inside one large Lambda function can become difficult.</p><p>This is where <strong>AWS Step Functions</strong> becomes useful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C0VAjfUY0UhYJDVnS9bEDg.png" /></figure><h3>1. What Is AWS Step Functions?</h3><p>AWS Step Functions is a workflow orchestration service that helps coordinate multiple tasks into a defined workflow.</p><p>It uses <strong>state machines</strong> to describe how a process moves from one step to another.</p><p>A workflow can invoke Lambda functions, integrate with supported AWS services, make decisions, run tasks in parallel, and handle errors.</p><p>Instead of manually managing every transition in your application code, you define the workflow and its behavior.</p><p>Think of it this way:</p><ul><li><strong>Lambda</strong> executes a task.</li><li><strong>Step Functions</strong> coordinates the tasks.</li></ul><h3>2. How Does It Work?</h3><p>Consider a simplified order-processing workflow.</p><pre>Customer Places Order<br>         |<br>         v<br>    Validate Order<br>         |<br>         v<br>    Process Payment<br>         |<br>         v<br>   Update Inventory<br>         |<br>         v<br>   Send Confirmation<br>         |<br>         v<br>    Order Complete</pre><p>Each step performs a particular responsibility. Step Functions manages the transitions between those steps.</p><p>If payment fails, for example, the workflow can follow a defined error-handling path rather than blindly continuing to update inventory.</p><p>This makes complex business processes easier to understand and maintain.</p><h3>3. Understanding State Machines</h3><p>A state machine defines the states in a workflow and how execution moves between them.</p><p>In Step Functions, common state types include:</p><ul><li><strong>Task:</strong> Performs work, such as invoking Lambda.</li><li><strong>Choice:</strong> Selects a path based on a condition.</li><li><strong>Parallel:</strong> Executes branches concurrently.</li><li><strong>Wait:</strong> Pauses execution for a specified period.</li><li><strong>Succeed:</strong> Marks successful completion.</li><li><strong>Fail:</strong> Marks unsuccessful completion.</li><li><strong>Pass:</strong> Passes data through or provides a simple transformation.</li></ul><p>For example, after payment processing, the workflow could check the result.</p><pre>Process Payment<br>              |<br>              v<br>       Payment Successful?<br>           /       \<br>         Yes        No<br>          |          |<br>          v          v<br> Update Inventory  Handle Failure<br>          |<br>          v<br>    Confirm Order</pre><p>The workflow is not just a sequence of functions. It can include decisions, parallel tasks, waiting periods, and error-handling paths.</p><h3>4. What Happens When a Task Fails?</h3><p>Failures are normal in distributed systems. An external API might be temporarily unavailable, or a service might return an error.</p><p>Step Functions lets you define retry and error-handling behavior for supported workflow states.</p><p>For example, a task can retry a temporary failure before moving to a fallback path.</p><pre>Process Payment<br>              |<br>              v<br>          Task Failed<br>              |<br>              v<br>         Retry Task<br>              |<br>        +-----+-----+<br>        |           |<br>      Success     Failed Again<br>        |           |<br>        v           v<br>   Continue      Handle Error</pre><p>You can configure retry policies with parameters such as the error types to retry, the number of attempts, and the delay between attempts.</p><p>You can also configure catch behavior to move to another state when an error matches the configured conditions.</p><p>However, a retry does not guarantee that an operation is safe to repeat. If a payment request succeeds but the response is lost, repeating it could create a duplicate charge unless the payment operation supports appropriate idempotency.</p><p><strong>Important lesson:</strong> Workflow orchestration helps manage failures, but your application still needs correct error handling and idempotent operations.</p><h3>5. A Real-World Architecture</h3><p>Let’s connect Step Functions with the AWS services we’ve already explored.</p><pre>React Frontend<br>                    |<br>                    v<br>               API Gateway<br>                    |<br>                    v<br>                AWS Lambda<br>                    |<br>                    v<br>            AWS Step Functions<br>                    |<br>             Validate Order<br>                    |<br>                    v<br>             Process Payment<br>                    |<br>                    v<br>          +---------+---------+<br>          |                   |<br>          v                   v<br>    Update Inventory    Record Order Status<br>          |                   |<br>          +---------+---------+<br>                    |<br>                    v<br>             Send Notification<br>                    |<br>                    v<br>              Order Complete</pre><p>This is a conceptual architecture; the exact integration can vary depending on the application.</p><p>Step Functions can invoke Lambda functions or integrate directly with supported AWS services. For longer-running or asynchronous tasks, a workflow can also wait for an external task to complete using supported integration patterns.</p><p>For example, you could use:</p><ul><li><strong>API Gateway</strong> to receive the request.</li><li><strong>Lambda</strong> to validate and initiate the workflow.</li><li><strong>Step Functions</strong> to coordinate order processing.</li><li><strong>DynamoDB</strong> to store order data.</li><li><strong>SNS</strong> to distribute notifications.</li><li><strong>CloudWatch</strong> to monitor workflow activity and failures.</li></ul><p>The benefit is separation of responsibilities. Each component focuses on its job, while the workflow defines how the overall process fits together.</p><h3>6. Standard vs. Express Workflows</h3><p>AWS Step Functions offers two workflow types: Standard and Express.</p><p>FeatureStandardExpressTypical useLong-running, durable workflowsHigh-volume, short-duration workflowsMaximum durationUp to one yearUp to five minutesExecution modelExactly-once workflow execution model, with integration-specific considerationsAt-least-once or at-most-once execution, depending on the modeCommon use casesOrder processing, approvals, business workflowsHigh-volume event processing, data transformation</p><p>The execution model matters. Even when a Standard workflow has an exactly-once execution model, an external side effect may still need idempotency, especially when the workflow retries an integration or an external system’s response is uncertain.</p><p>Choose the workflow type based on the duration, throughput, reliability, and execution requirements of the process.</p><h3>7. When Should You Use AWS Step Functions?</h3><p>Step Functions is useful when:</p><ul><li>A process contains multiple dependent tasks.</li><li>You need conditional logic or parallel execution.</li><li>You want clearly defined retry and error-handling behavior.</li><li>You need to coordinate multiple AWS services.</li><li>You want a visible execution history to help troubleshoot workflows.</li></ul><p>It may be unnecessary for a simple API that only performs one short operation. A single Lambda function may be enough for that.</p><p>The goal is not to use Step Functions everywhere. It is to use it when workflow complexity makes orchestration worthwhile.</p><h3>8. My Main Takeaways</h3><p>As I continue learning AWS, I’m realizing that building cloud applications involves more than understanding individual services. It also means understanding how those services work together to implement real business processes.</p><p>My mental model is simple:</p><ul><li><strong>Lambda</strong> performs individual tasks.</li><li><strong>Step Functions</strong> coordinates workflows.</li><li><strong>SQS</strong> queues work for asynchronous processing.</li><li><strong>SNS</strong> distributes notifications.</li><li><strong>EventBridge</strong> routes events based on rules.</li><li><strong>DynamoDB</strong> stores application data.</li><li><strong>CloudWatch</strong> helps monitor the system.</li></ul><p>Each service has a different responsibility, and choosing the right combination depends on the problem you’re solving.</p><p>For me, AWS Step Functions is an important piece of the puzzle because it helps turn a collection of individual cloud services into a coordinated workflow.</p><p>I’m continuing to document my AWS learning journey one concept at a time. If you’re learning AWS too, I’d love to hear what you’re building and which services you’re exploring.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd5a2e144426" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Do Large Applications Process Work in the Background?]]></title>
            <link>https://medium.com/@supulanupa/how-do-large-applications-process-work-in-the-background-21e01098fb79?source=rss-c93ce69207e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/21e01098fb79</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[amazon-web-services]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Anupa Supul]]></dc:creator>
            <pubDate>Thu, 22 Oct 2026 07:06:01 GMT</pubDate>
            <atom:updated>2026-10-22T07:06:01.562Z</atom:updated>
            <content:encoded><![CDATA[<h3>How Do Large Applications Process Work in the Background? Understanding Amazon SQS, SNS &amp; EventBridge</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_9CUwiVBo2QqVI-0HZbZGg.png" /></figure><p>When I started learning AWS, I focused mainly on deploying applications, building APIs, and connecting databases.</p><p>But then I started thinking about something interesting.</p><p><strong>What happens when an application needs to perform several tasks at once without making the user wait for everything to finish?</strong></p><p>Imagine ordering a product from an online store. After placing the order, the system might need to update inventory, send a confirmation email, generate an invoice, and notify the delivery team.</p><p>Should the customer wait until every single task is completed?</p><p>Probably not.</p><p>This is where event-driven architecture and messaging services become useful.</p><p>In this article, I’ll explore three AWS services that help applications communicate and process work more efficiently:</p><ul><li><strong>Amazon SQS</strong> — queues messages for processing.</li><li><strong>Amazon SNS</strong> — distributes messages to multiple subscribers.</li><li><strong>Amazon EventBridge</strong> — routes events to targets based on rules.</li></ul><h3>1. Why Do Applications Need Background Processing?</h3><p>Consider a simple application where every operation happens inside one request.</p><pre>Customer places an order<br>          |<br>          v<br>      Save order<br>          |<br>          v<br>   Update inventory<br>          |<br>          v<br>   Send confirmation<br>          |<br>          v<br>   Generate invoice<br>          |<br>          v<br>   Return response</pre><p>If each operation runs sequentially, the customer may need to wait for all of them. If an external email service is slow, the entire request could take longer.</p><p>It also creates tight coupling: a problem in one dependency can affect the main request.</p><p>Instead, we can separate the immediate operation from background work.</p><pre>Customer places an order<br>          |<br>          v<br>       Save order<br>          |<br>          v<br>   Queue background work<br>          |<br>          v<br>  Return response to customer<br>          |<br>          v<br>   Process tasks separately</pre><p>Now the application can respond after completing the necessary synchronous work, while other operations happen independently.</p><p>This is one of the main ideas behind <strong>asynchronous processing</strong>.</p><h3>2. Amazon SQS — Let Messages Wait in a Queue</h3><p>Amazon Simple Queue Service (SQS) is a managed message queuing service.</p><p>Think of it as a waiting line for tasks. A producer sends a message to the queue, and a consumer retrieves and processes it.</p><p>For example:</p><pre>Order API<br>    |<br>    v<br>Amazon SQS Queue<br>    |<br>    v<br>Order Processing Worker<br>    |<br>    v<br>Update Inventory</pre><p>The API doesn’t need to wait for the worker to finish processing the message.</p><h3>Why is SQS useful?</h3><ul><li>It helps decouple application components.</li><li>Messages can wait until consumers are ready to process them.</li><li>It helps absorb temporary traffic spikes.</li><li>Failed messages can be retried.</li><li>Dead-letter queues can isolate messages that repeatedly fail.</li></ul><p>SQS offers <strong>Standard queues</strong> and <strong>FIFO queues</strong>. Standard queues provide high throughput with at-least-once delivery, so consumers should be designed to handle duplicate messages. FIFO queues support ordering within message groups and deduplication features, with their own throughput and configuration considerations.</p><p>One important concept is the <strong>visibility timeout</strong>. When a consumer receives a message, the message becomes temporarily invisible to other consumers. If processing succeeds, the consumer deletes it. If the message isn’t deleted before the visibility timeout expires, it can become available again.</p><p>That is why reliable message processing needs error handling and idempotency.</p><h3>3. Amazon SNS — Send One Message to Multiple Subscribers</h3><p>Amazon Simple Notification Service (SNS) is a managed publish/subscribe messaging service.</p><p>Instead of placing work in a queue for one consumer pattern, SNS can distribute a published message to multiple subscribers.</p><p>Imagine an order has been placed. Several systems need to react:</p><ul><li>A notification service sends a confirmation.</li><li>An analytics service records the event.</li><li>Another service starts a fulfilment workflow.</li></ul><p>SNS can help distribute the notification to these subscribers.</p><pre>Order Service<br>                    |<br>                    v<br>                 Amazon SNS<br>                    |<br>          +---------+---------+<br>          |         |         |<br>          v         v         v<br>        SQS A     Lambda    Email<br>      Queue       Function  Endpoint</pre><p>SNS supports different subscription types, including SQS queues, Lambda functions, HTTP/S endpoints, and email, depending on the configuration and use case.</p><h3>Why is SNS useful?</h3><p>SNS is a good fit when multiple subscribers need to receive a notification about the same event.</p><p>For example, an order service can publish an OrderPlaced notification without needing to know the internal implementation of every subscriber.</p><p>That reduces direct dependencies between services.</p><p>A key distinction: <strong>SNS distributes messages; it is not a general-purpose durable work queue in the same way SQS is.</strong> Combining SNS with SQS can be useful when multiple consumers need their own queues and independent processing.</p><h3>4. Amazon EventBridge — Route Events Based on Rules</h3><p>Amazon EventBridge is a serverless event bus service that routes events to targets using rules.</p><p>An event describes something that happened, such as:</p><ul><li>An order being placed.</li><li>A payment succeeding.</li><li>A file being uploaded to Amazon S3.</li><li>A scheduled task reaching its execution time.</li></ul><p>EventBridge can inspect an event and route it to the targets whose rules match.</p><p>For example:</p><pre>OrderPlaced Event<br>               |<br>               v<br>       Amazon EventBridge<br>               |<br>        +------+------+<br>        |             |<br>        v             v<br>   Order Processor  Analytics<br>       Lambda        Target</pre><p>You can define rules that match event attributes and send matching events to supported targets.</p><p>EventBridge is particularly useful for reacting to events from AWS services, your own applications, and supported SaaS integrations.</p><p>It also supports scheduled and time-based event patterns through its scheduling capabilities.</p><h3>When should you use EventBridge?</h3><p>Use it when you want to route events based on what happened, without tightly connecting the event producer to every downstream service.</p><p>For example, an application could react differently to OrderPlaced, PaymentFailed, and OrderCancelled events.</p><h3>5. SQS vs SNS vs EventBridge</h3><p>These services can work together, but they solve different problems.</p><p>FeatureAmazon SQSAmazon SNSAmazon EventBridgeMain purposeQueue messages for processingDistribute messages to subscribersRoute events using rulesCore patternQueue and consumerPublish/subscribeEvent bus and targetsTypical useBackground jobsNotifications to multiple subscribersReacting to application or AWS eventsMessage handlingConsumers poll or use supported integrationsPushes notifications to subscribersRoutes matching events to targetsUseful featureVisibility timeout and dead-letter queuesMultiple subscribers and filteringEvent pattern matching and routing</p><p>Here’s the simple mental model I use:</p><ul><li><strong>SQS:</strong> “Process this work when you’re ready.”</li><li><strong>SNS:</strong> “Send this notification to these subscribers.”</li><li><strong>EventBridge:</strong> “When this event happens, route it to the appropriate target.”</li></ul><h3>6. How They Work Together in a Real Application</h3><p>Let’s return to our online store.</p><p>After a customer places an order, the API saves the order and publishes an event. Different services can then handle different responsibilities.</p><pre>React Frontend<br>      |<br>      v<br>API Gateway<br>      |<br>      v<br>AWS Lambda<br>      |<br>      v<br>Save Order in DynamoDB<br>      |<br>      v<br>Publish OrderPlaced Event<br>      |<br>      v<br>Amazon EventBridge<br>      |<br>      +-------------------+<br>      |                   |<br>      v                   v<br>Order Processing       Analytics<br>      |<br>      v<br>Amazon SQS<br>      |<br>      v<br>Background Worker<br>      |<br>      v<br>Update Inventory / Fulfil Order</pre><p>A separate notification workflow could use SNS to distribute an order notification to multiple subscribers.</p><p>The exact architecture depends on the requirements. For example, an SQS queue can be an EventBridge target, allowing the event to be routed to a durable queue for later processing.</p><p>This architecture separates the order API from slower background tasks. It also lets different components scale and fail independently to a degree, provided that retries, error handling, and downstream dependencies are designed correctly.</p><h3>7. What Should You Remember?</h3><p>Event-driven architecture is not just about using more AWS services. It’s about designing components that can communicate without depending too heavily on one another.</p><p>When choosing between these services, start with the problem:</p><ul><li>Need to buffer work until a consumer can process it? Consider <strong>SQS</strong>.</li><li>Need to distribute a notification to multiple subscribers? Consider <strong>SNS</strong>.</li><li>Need to route events to different targets based on event content? Consider <strong>EventBridge</strong>.</li></ul><p>For production systems, also think about duplicate messages, retry behavior, dead-letter queues, monitoring, permissions, and costs.</p><p>No single service automatically solves every reliability problem. The application still needs to handle failures correctly.</p><h3>Final Thoughts</h3><p>As I continue learning AWS, I’m realizing that building a reliable application involves more than deploying a backend and connecting a database.</p><p>It also means understanding how different components communicate, how failures are handled, and how background work can be processed without slowing down the user experience.</p><p>Amazon SQS, SNS, and EventBridge provide different building blocks for that kind of architecture.</p><p>The interesting part is learning when to use each service and when combining them creates a better solution.</p><p><em>I’m documenting my AWS learning journey one concept at a time. If you’re learning cloud computing too, I’d love to hear what you’re building.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21e01098fb79" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Can You Build a Backend Without Managing Servers?]]></title>
            <link>https://medium.com/@supulanupa/can-you-build-a-backend-without-managing-servers-8b750ca580e2?source=rss-c93ce69207e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b750ca580e2</guid>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[amazon-web-services]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Anupa Supul]]></dc:creator>
            <pubDate>Tue, 20 Oct 2026 04:53:42 GMT</pubDate>
            <atom:updated>2026-10-20T04:53:42.481Z</atom:updated>
            <content:encoded><![CDATA[<h3>Can You Build a Backend Without Managing Servers? Understanding Amazon API Gateway, AWS Lambda &amp; DynamoDB</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lT_YbWCQmVGDSBIGi_d0yA.png" /></figure><p>Imagine you’re building a task management application.</p><p>Users should be able to create tasks, view their tasks, update them, and delete them. Normally, you might build a Node.js backend with Express, deploy it to EC2 or ECS, and connect it to a database.</p><p>But what if you don’t want to manage a continuously running server for your backend?</p><p>What if you could receive an HTTP request, execute your backend code, save the data, and return a response without managing the underlying servers?</p><p>This is where <strong>serverless architecture</strong> becomes interesting.</p><p>In this article, I’ll explore how Amazon API Gateway, AWS Lambda, and Amazon DynamoDB can work together to build a backend on AWS.</p><h3>1. What Does Serverless Actually Mean?</h3><p>The first thing to understand is that <em>serverless doesn’t mean there are no servers</em>.</p><p>Your application still runs on servers. The difference is that AWS manages the underlying infrastructure, so you don’t have to provision and maintain servers yourself.</p><p>With a traditional backend, you might deploy an Express application to an EC2 instance or run containers using ECS and Fargate.</p><p>With a serverless backend, you can use AWS Lambda to execute your application code when requests or events trigger it.</p><p>For example, imagine a user creates a new task in your application.</p><p>Instead of sending that request to a continuously running Express server, the request can invoke a Lambda function that processes the task and returns a response.</p><p>The simplified flow looks like this:</p><pre>Traditional Backend</pre><pre>User<br> |<br> v<br>Load Balancer<br> |<br> v<br>EC2 / ECS<br> |<br> v<br>Backend Application<br> |<br> v<br>Database</pre><p>A serverless alternative could look like this:</p><pre>Serverless Backend</pre><pre>User<br> |<br> v<br>API Gateway<br> |<br> v<br>AWS Lambda<br> |<br> v<br>DynamoDB</pre><p>Both architectures can build real applications. The difference is how the compute, request handling, and infrastructure are managed.</p><h3>2. The Three Main Services</h3><p>Before connecting everything, let’s understand the responsibility of each service.</p><h3>Amazon API Gateway — The Entry Point</h3><p>Imagine your frontend sends a request to create a task.</p><p>API Gateway provides an HTTP API endpoint that receives the request and routes it to the appropriate integration.</p><p>For example:</p><pre>POST /tasks<br>GET /tasks<br>GET /tasks/{id}<br>PUT /tasks/{id}<br>DELETE /tasks/{id}</pre><p>These endpoints represent common operations in a task management API.</p><p>API Gateway can handle HTTP requests, integrate with Lambda, apply authorization, and enforce configured throttling and other API controls.</p><p>Think of it as the managed entry point between your client application and your backend logic.</p><h3>AWS Lambda — The Backend Logic</h3><p>API Gateway receives the request, but something still needs to process it.</p><p>That’s where AWS Lambda comes in.</p><p>Lambda runs your code in response to events. You provide the function code and configure its runtime, permissions, memory, timeout, and other settings. AWS manages the underlying compute infrastructure.</p><p>For our task application, a Lambda function might:</p><ul><li>Validate the incoming request.</li><li>Check the user’s identity and permissions.</li><li>Create or retrieve a task.</li><li>Interact with DynamoDB.</li><li>Return an HTTP response through API Gateway.</li></ul><p>You can write Lambda functions in supported programming languages, including JavaScript and TypeScript using Node.js.</p><p>The important distinction is that Lambda executes your code when invoked rather than requiring you to maintain a continuously running application server.</p><h3>Amazon DynamoDB — The Database</h3><p>Our backend needs somewhere to store task data.</p><p>Amazon DynamoDB is a fully managed NoSQL database that supports key-value and document data models.</p><p>A task item might look like this:</p><pre>{<br>  &quot;userId&quot;: &quot;user-123&quot;,<br>  &quot;taskId&quot;: &quot;task-001&quot;,<br>  &quot;title&quot;: &quot;Learn AWS Lambda&quot;,<br>  &quot;completed&quot;: false,<br>  &quot;createdAt&quot;: &quot;2026-10-20&quot;<br>}</pre><p>We can design a DynamoDB table to store tasks and retrieve them using the appropriate keys.</p><p>DynamoDB handles the underlying database infrastructure and can scale to support demanding workloads when the table, access patterns, and capacity settings are designed appropriately.</p><p>However, DynamoDB is not simply a replacement for every relational database. If your application depends on complex joins, relational constraints, or SQL-based reporting, a relational database such as Amazon RDS may be more appropriate.</p><h3>3. Connecting the Architecture</h3><p>Now let’s put the three services together.</p><p>Imagine our frontend is built using React.</p><p>When a user clicks the button to create a task, the frontend sends an HTTP request to API Gateway.</p><p>API Gateway invokes the relevant Lambda function. The function validates the request, writes the task to DynamoDB, and returns a response.</p><pre>React Frontend<br>                      |<br>                      | HTTPS Request<br>                      v<br>                Amazon API Gateway<br>                      |<br>                      | Invokes<br>                      v<br>                  AWS Lambda<br>                      |<br>                      | Reads / Writes<br>                      v<br>                 Amazon DynamoDB<br>                      |<br>                      | Result<br>                      v<br>                  AWS Lambda<br>                      |<br>                      v<br>                API Gateway<br>                      |<br>                      v<br>                React Frontend</pre><p>Each service has a clear responsibility:</p><ul><li><strong>React</strong> provides the user interface.</li><li><strong>API Gateway</strong> receives and routes HTTP requests.</li><li><strong>Lambda</strong> executes backend logic.</li><li><strong>DynamoDB</strong> stores application data.</li></ul><p>This separation makes the architecture easier to understand and allows us to configure each component independently.</p><h3>4. Let’s Build a Small Example</h3><p>Let’s imagine our application needs an endpoint to create a task.</p><p>The frontend sends a request like this:</p><pre>POST /tasks<br>Content-Type: application/json</pre><p>Request body:</p><pre>{<br>  &quot;title&quot;: &quot;Learn serverless architecture&quot;<br>}</pre><p>API Gateway receives the request and invokes a Lambda function.</p><p>The function processes the request and stores the task in DynamoDB.</p><p>Here’s a simplified Node.js Lambda handler using the AWS SDK for JavaScript v3.</p><pre>import { randomUUID } from &quot;node:crypto&quot;;<br>import { DynamoDBClient } from &quot;@aws-sdk/client-dynamodb&quot;;<br>import {<br>  DynamoDBDocumentClient,<br>  PutCommand<br>} from &quot;@aws-sdk/lib-dynamodb&quot;;</pre><pre>const client = new DynamoDBClient({});</pre><pre>const dynamodb = DynamoDBDocumentClient.from(client);</pre><pre>const tableName = process.env.TASKS_TABLE;</pre><pre>export const handler = async (event) =&gt; {<br>  try {<br>    const body = JSON.parse(event.body || &quot;{}&quot;);</pre><pre>    if (<br>      typeof body.title !== &quot;string&quot; ||<br>      body.title.trim().length === 0<br>    ) {<br>      return {<br>        statusCode: 400,<br>        body: JSON.stringify({<br>          message: &quot;A task title is required.&quot;<br>        })<br>      };<br>    }</pre><pre>    const task = {<br>      taskId: randomUUID(),<br>      title: body.title.trim(),<br>      completed: false,<br>      createdAt: new Date().toISOString()<br>    };</pre><pre>    await dynamodb.send(<br>      new PutCommand({<br>        TableName: tableName,<br>        Item: task<br>      })<br>    );</pre><pre>    return {<br>      statusCode: 201,<br>      headers: {<br>        &quot;Content-Type&quot;: &quot;application/json&quot;<br>      },<br>      body: JSON.stringify({<br>        message: &quot;Task created successfully&quot;,<br>        task<br>      })<br>    };<br>  } catch (error) {<br>    console.error(&quot;Failed to create task:&quot;, error);</pre><pre>    return {<br>      statusCode: 500,<br>      body: JSON.stringify({<br>        message: &quot;Internal server error&quot;<br>      })<br>    };<br>  }<br>};</pre><p>This example assumes that the Lambda function is configured for an API Gateway HTTP API payload format compatible with event.body, that the AWS SDK packages are included in the deployment package, and that TASKS_TABLE is configured.</p><p>The DynamoDB table must also exist, and the Lambda execution role needs permission to write to it.</p><p>For a real multi-user application, we would also need authentication and authorization. The function should derive the user’s identity from a trusted authentication context rather than trusting a client-provided userId.</p><p>This is a simplified example of the backend logic, not a complete production-ready task management API.</p><h3>5. How Does Lambda Access DynamoDB Securely?</h3><p>Our Lambda function needs permission to write data to DynamoDB.</p><p>Should we put AWS access keys inside the source code?</p><p>No.</p><p>Instead, we assign an <strong>IAM execution role</strong> to the Lambda function.</p><p>That role grants the function the permissions it needs to access AWS services.</p><pre>AWS Lambda<br>                  |<br>                  v<br>          Lambda Execution Role<br>                  |<br>                  v<br>             IAM Policy<br>                  |<br>                  v<br>             DynamoDB Table</pre><p>For example, the function may need the dynamodb:PutItem permission for one specific table.</p><p>We should avoid granting broad permissions such as full access to every DynamoDB table in the account when the application only needs to write to one table.</p><p>This follows the principle of least privilege.</p><p>Lambda assumes its execution role when it runs, so the function can obtain authorized AWS credentials without hardcoding long-lived access keys.</p><p>For applications that also need database passwords or third-party API keys, AWS Secrets Manager or Systems Manager Parameter Store can provide a controlled way to manage those values.</p><h3>6. What Happens When Traffic Increases?</h3><p>Imagine your task application normally receives a few requests per minute.</p><p>Then a large number of users start using it.</p><p>With a traditional application, you may need to increase the number of EC2 instances or ECS tasks and configure load balancing and scaling policies.</p><p>Lambda can automatically scale the number of concurrent function executions within the applicable service limits and account quotas.</p><pre>API Gateway<br>                     |<br>                     v<br>                 AWS Lambda<br>                     |<br>           +---------+---------+<br>           |         |         |<br>           v         v         v<br>        Invoke 1  Invoke 2  Invoke 3<br>           |         |         |<br>           v         v         v<br>        Process   Process   Process<br>        Request   Request   Request<br>           |         |         |<br>           +---------+---------+<br>                     |<br>                     v<br>                 DynamoDB</pre><p>This is a conceptual illustration. Lambda’s actual concurrency and execution behavior depend on configuration, available capacity, account quotas, and the characteristics of the workload.</p><p>Automatic scaling does not mean unlimited scaling.</p><p>We still need to consider concurrency limits, throttling, downstream database capacity, retry behavior, and how the application handles errors.</p><p>For example, if too many requests reach a downstream dependency, that dependency may become the bottleneck even when Lambda can run additional invocations.</p><p>That’s why scaling the compute layer and designing the data layer must go together.</p><h3>7. What About Cold Starts?</h3><p>Serverless applications have trade-offs, and cold starts are one of the best-known examples.</p><p>When a Lambda function is invoked, AWS may need to initialize a new execution environment before running the handler. This additional initialization time is commonly called a <strong>cold start</strong>.</p><p>For example:</p><pre>Request Arrives<br>      |<br>      v<br>Initialize Environment<br>      |<br>      v<br>Load Application Code<br>      |<br>      v<br>Execute Function<br>      |<br>      v<br>Return Response</pre><p>If Lambda can reuse an existing execution environment, the initialization work may not be needed for that invocation.</p><p>Cold starts vary depending on factors such as runtime, package size, dependencies, and configuration.</p><p>For many applications, the performance is perfectly acceptable. For latency-sensitive workloads, we may need to optimize initialization or consider features such as provisioned concurrency.</p><p>This is one reason serverless should be chosen based on application requirements rather than simply because it requires less server management.</p><h3>8. What About Database Connections?</h3><p>This is an important consideration when combining Lambda with databases.</p><p>Suppose hundreds of Lambda invocations attempt to open database connections at the same time.</p><p>If the database cannot handle that number of concurrent connections, it may become overloaded.</p><p>With DynamoDB, applications interact with the service through its API rather than maintaining traditional relational database connections.</p><p>However, DynamoDB still has its own capacity, throttling, and access-pattern considerations.</p><p>If you use Lambda with Amazon RDS, connection management becomes especially important. Depending on the architecture, Amazon RDS Proxy can help manage database connections and reduce the connection-management burden.</p><p>The right approach depends on the database you choose.</p><p><strong>Serverless compute does not eliminate the need for thoughtful database design.</strong></p><h3>9. How Much Does Serverless Cost?</h3><p>One attractive feature of Lambda is that its pricing is based on factors such as requests and execution duration, with applicable free-tier allowances and pricing details depending on the account and region.</p><p>However, the complete application has more than one cost.</p><p>A serverless application may incur charges for:</p><ul><li>API Gateway requests.</li><li>Lambda requests and execution duration.</li><li>DynamoDB storage and read/write usage.</li><li>Data transfer.</li><li>CloudWatch logs and monitoring.</li><li>Other services used by the application.</li></ul><p>For a low-traffic application, serverless can be cost-effective because you don’t need to pay for a continuously running application server just to handle occasional requests.</p><p>But for workloads with consistently high usage, the economics can be different.</p><p>A production system should be evaluated using realistic traffic estimates, execution durations, database access patterns, and regional pricing.</p><p><strong>Serverless doesn’t automatically mean cheaper. It means a different infrastructure and pricing model.</strong></p><h3>10. Serverless vs ECS/Fargate vs EC2</h3><p>Now let’s compare the approaches we’ve explored in this AWS learning series.</p><p>FeatureEC2ECS + FargateLambdaMain abstractionVirtual serverContainer taskFunction executionServer managementYou manage the OS and instanceAWS manages the underlying Fargate infrastructureAWS manages the underlying execution infrastructureTypical useFull control over servers and softwareContainerized APIs, services and workersEvent-driven functions and APIsScalingConfigure instance scalingScale ECS tasksScale function concurrencyRuntime controlHighestHigh within container boundariesFunction-orientedLong-running workloadsSuitableSuitableHas execution-duration limitsOperational responsibilityMore infrastructure managementContainer and service configurationFunction, permissions, triggers and limits</p><p>There is no universal winner.</p><p>Choose EC2 when you need more control over the server environment or have workloads that require it.</p><p>Choose ECS with Fargate when you want to package applications as containers and manage them without maintaining the underlying EC2 hosts.</p><p>Choose Lambda when event-driven execution and reduced infrastructure management fit the workload.</p><p>It’s also possible to combine these approaches within one system.</p><p>For example, a web application might use ECS for its main API and Lambda for occasional event-driven tasks.</p><h3>11. What Does a More Complete Architecture Look Like?</h3><p>Our basic architecture is useful for learning, but a production application usually needs more than API Gateway, Lambda, and DynamoDB.</p><p>Depending on the requirements, we may add:</p><ul><li><strong>Amazon Cognito or another identity provider</strong> for user authentication.</li><li><strong>IAM</strong> for permissions between AWS services.</li><li><strong>AWS Secrets Manager</strong> for sensitive configuration.</li><li><strong>Amazon CloudWatch</strong> for logs, metrics, and alarms.</li><li><strong>AWS WAF</strong> for configured web application protections where supported by the chosen entry point.</li><li><strong>Amazon SQS</strong> for asynchronous background processing.</li><li><strong>Amazon S3</strong> for file and object storage.</li><li><strong>AWS CDK, CloudFormation, or Terraform</strong> to manage infrastructure as code.</li></ul><p>A more complete conceptual architecture might look like this:</p><pre>USERS<br>                         |<br>                         v<br>                  React Frontend<br>                         |<br>                         v<br>                   API Gateway<br>                         |<br>                         v<br>                    AWS Lambda<br>                         |<br>             +-----------+-----------+<br>             |           |           |<br>             v           v           v<br>         DynamoDB   Secrets Manager  SQS<br>         Database   Credentials      Queue<br>                                      |<br>                                      v<br>                                Worker Lambda</pre><pre>       CloudWatch monitors logs, metrics and alarms.<br>       IAM controls permissions between components.</pre><p>The diagram shows possible integrations rather than a requirement to use every service.</p><p>A smaller application may need only API Gateway, Lambda, DynamoDB, and IAM. We should introduce additional services when they solve a real requirement.</p><h3>12. Important Limitations to Understand</h3><p>Before choosing serverless, there are a few practical points worth remembering.</p><p><strong>Execution limits:</strong> Lambda functions have a maximum execution duration, so workloads that must run continuously or take longer than the permitted duration may be better suited to ECS or another compute option.</p><p><strong>Stateless execution:</strong> Lambda execution environments can be reused, but applications must not depend on local memory or temporary storage as permanent shared state.</p><p><strong>Retries and duplicate processing:</strong> Some event sources can retry failed invocations. Applications that process events should be designed to handle retries and, where necessary, duplicate operations safely.</p><p><strong>Monitoring:</strong> Logs, metrics, alarms, and tracing are important for understanding failures and performance.</p><p><strong>Permissions:</strong> Each function should receive only the AWS permissions it requires.</p><p><strong>Database design:</strong> The database must support the application’s access patterns and expected load.</p><p>Understanding these limitations helps us design systems that are reliable rather than merely easy to deploy.</p><h3>Quick Cheat Sheet</h3><p>AWS ServiceMain ResponsibilityAmazon API GatewayReceives and routes API requestsAWS LambdaExecutes backend codeAmazon DynamoDBManaged NoSQL databaseAWS IAMControls access to AWS resourcesAWS Secrets ManagerStores and manages sensitive secretsAmazon CloudWatchMonitoring, logs, metrics and alarmsAmazon SQSQueues messages for asynchronous processingAmazon S3Stores files and objectsAmazon CognitoSupports application user authenticationAmazon RDS ProxyHelps manage connections to supported relational databases</p><h3>Final Thoughts</h3><p>The most interesting part of learning serverless architecture is realizing that we can build a useful backend without managing a traditional application server.</p><p>API Gateway receives requests. Lambda executes the backend logic. DynamoDB stores the data. IAM controls access, while monitoring and other services help us operate the application responsibly.</p><p>But serverless is not a replacement for every other architecture.</p><p>The real skill is understanding the problem, choosing the right services, and knowing the trade-offs.</p><p>As I continue exploring AWS, I’m learning to look beyond individual service definitions and understand how they fit together to solve real development problems.</p><p><strong>The goal isn’t to use the most AWS services. It’s to build the simplest architecture that meets the application’s requirements reliably and securely.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b750ca580e2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop Hardcoding Secrets: How Production Applications Manage Credentials on AWS]]></title>
            <link>https://medium.com/@supulanupa/stop-hardcoding-secrets-how-production-applications-manage-credentials-on-aws-349eba76051f?source=rss-c93ce69207e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/349eba76051f</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[amazon-web-services]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Anupa Supul]]></dc:creator>
            <pubDate>Thu, 15 Oct 2026 07:51:01 GMT</pubDate>
            <atom:updated>2026-10-15T07:51:01.524Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OxgjnShmpgOjMHXw1nNwZg.png" /></figure><h3>Stop Hardcoding Secrets: How Production Applications Manage Credentials on AWS</h3><p>Imagine you’re building a Node.js backend using Express and MongoDB.</p><p>During development, you might have a .env file containing:</p><pre>PORT=5000<br>MONGO_URI=mongodb+srv://...<br>JWT_SECRET=...<br>API_KEY=...</pre><p>Your application works perfectly.</p><p>But now imagine pushing the project to GitHub, deploying it through a CI/CD pipeline, and running it on AWS.</p><p>Where should those secrets live?</p><p>Should we put them directly inside the source code? Add them to the Docker image? Store them in GitHub? Or let every developer manage their own copies?</p><p>These questions become important when an application moves from a local development environment to production.</p><p>In this article, we’ll explore how <strong>AWS Secrets Manager, Systems Manager Parameter Store, and IAM</strong> help us manage application configuration and credentials more securely.</p><h3>1. Why Hardcoding Secrets Is Dangerous</h3><p>Let’s start with a simple example.</p><pre>const dbPassword = &quot;my-super-secret-password&quot;;<br>const jwtSecret = &quot;my-jwt-secret&quot;;</pre><p>This may look convenient, but it creates a serious security problem.</p><p>Anyone who can access the source code may also be able to access the credentials.</p><p>If we push these values to a public repository, the secrets could be exposed. Even a private repository can have too many people or automated systems with access.</p><p>There is another problem: what happens when a password changes?</p><p>We may need to modify the code, rebuild the Docker image, and deploy the application again just to update a credential.</p><p><strong>Application code and sensitive configuration should be managed separately.</strong></p><p>That is the principle behind secure secrets management.</p><h3>2. What About the .env File?</h3><p>A .env file is useful during local development.</p><p>For example:</p><pre>PORT=5000<br>MONGO_URI=your_database_connection_string<br>JWT_SECRET=your_jwt_secret</pre><p>Your Node.js application can load these values using a package such as dotenv.</p><pre>require(&quot;dotenv&quot;).config();</pre><pre>const port = process.env.PORT;<br>const mongoUri = process.env.MONGO_URI;</pre><p>This keeps configuration out of the source code itself.</p><p>However, a .env file is not automatically a secure secrets management system.</p><p>For local development, we should keep it out of Git using .gitignore.</p><pre>.env<br>.env.*<br>!.env.example</pre><p>An .env.example file can document the required variable names without containing real credentials.</p><p>For production, we need a controlled way to provide those values to our running application.</p><p>That’s where AWS services come in.</p><h3>3. AWS Secrets Manager — Store Sensitive Information</h3><p><strong>AWS Secrets Manager</strong> is designed to store, retrieve, and manage sensitive information such as database credentials, API keys, and other application secrets.</p><p>For example, we could store a secret containing:</p><pre>Secret name: production/my-backend</pre><pre>MONGO_URI: ...<br>JWT_SECRET: ...<br>THIRD_PARTY_API_KEY: ...</pre><p>The application retrieves the required secret when it needs it, provided it has the appropriate IAM permissions.</p><p>A simplified architecture looks like this:</p><pre>Developer<br>    |<br>    v<br>AWS Secrets Manager<br>    |<br>    | Authorized access<br>    v<br>Application on ECS / Fargate<br>    |<br>    v<br>Connect to Database / External API</pre><p>The important point is that the sensitive values do not need to be hardcoded into our application source code or baked into the Docker image.</p><p>Secrets Manager also supports secret rotation workflows, including integrations and rotation configurations for supported services.</p><p>Rotation still needs to be configured correctly; storing a secret in Secrets Manager does not automatically mean every secret will rotate itself.</p><h3>4. Systems Manager Parameter Store — Manage Configuration</h3><p>Not every configuration value is a secret.</p><p>Consider these examples:</p><pre>APP_ENV=production<br>LOG_LEVEL=info<br>MAX_RETRIES=3<br>API_BASE_URL=https://api.example.com</pre><p>These values may need to change between development, testing, and production, but they are not necessarily confidential.</p><p><strong>AWS Systems Manager Parameter Store</strong> provides a central place to store application configuration and parameters.</p><p>It supports different parameter types, including:</p><ul><li>String — ordinary configuration values.</li><li>StringList — comma-separated string values.</li><li>SecureString — sensitive values encrypted using AWS KMS.</li></ul><p>For example:</p><pre>/my-app/production/LOG_LEVEL<br>/my-app/production/API_BASE_URL<br>/my-app/production/DB_PASSWORD</pre><p>Parameter Store can help organize configuration by application and environment.</p><p>A SecureString can be useful for encrypted parameters, while Secrets Manager is often a better fit when managed secret lifecycle and rotation features are important.</p><p>The choice depends on the requirements rather than one service being universally better.</p><h3>5. Secrets Manager vs Parameter Store</h3><p>This is where many developers get confused.</p><p>Both services can store sensitive configuration, but their strengths differ.</p><p>FeatureSecrets ManagerParameter StoreMain purposeSecret lifecycle managementConfiguration and parameter managementDatabase credentialsYesCan store encrypted valuesEncrypted valuesYesYes, using SecureStringSecret rotationBuilt-in rotation capabilities and integrationsUsually requires a separate rotation workflowOrdinary configurationPossibleA natural fitCost considerationsGenerally charged for secrets and API usageStandard parameters have a free tier; advanced features can incur charges</p><p>For example, I might choose Secrets Manager for database credentials that require a managed rotation workflow and Parameter Store for ordinary application settings.</p><p>Both can be useful in the same application.</p><h3>6. IAM — Who Is Allowed to Read the Secrets?</h3><p>Storing secrets securely is only half of the problem.</p><p>We also need to decide <strong>who or what is allowed to access them</strong>.</p><p>This is where AWS Identity and Access Management (IAM) comes in.</p><p>IAM controls access to AWS resources through identities, policies, and roles.</p><p>Imagine our Node.js backend is running as an ECS task on Fargate.</p><p>We want it to retrieve one database secret from Secrets Manager.</p><p>We should not give the application unrestricted access to every secret in the AWS account.</p><p>Instead, we can grant the task permission to retrieve only the required secret.</p><pre>ECS Task<br>   |<br>   v<br>Task Role<br>   |<br>   v<br>IAM Policy<br>   |<br>   v<br>Allowed Secret Only</pre><p>This follows the <strong>principle of least privilege</strong>: give each component only the permissions it needs.</p><p>For ECS, there are two roles worth distinguishing:</p><ul><li><strong>Task execution role:</strong> Used by ECS/Fargate for operations such as pulling private images from ECR and sending logs to supported destinations.</li><li><strong>Task role:</strong> Provides AWS permissions to the application code running inside the container.</li></ul><p>If the application itself calls Secrets Manager, its task role generally needs the appropriate permission.</p><p>If ECS retrieves secrets and injects them into a container as environment variables, the task execution role needs the relevant permissions instead.</p><p>Getting this distinction right helps avoid unnecessary permissions and deployment failures.</p><h3>7. How Does This Work with Docker and ECS?</h3><p>Let’s connect secrets management to the previous article about Docker, ECR, ECS, and Fargate.</p><p>A common mistake is putting production credentials directly into the Dockerfile.</p><p>For example, this is a bad idea:</p><pre>ENV JWT_SECRET=my-production-secret</pre><p>Why?</p><p>Because the value can become part of the image configuration and may be exposed to anyone who can inspect the image.</p><p>Instead, the image should contain the application, while production configuration is supplied separately.</p><pre>Docker Build<br>                     |<br>                     v<br>              Application Image<br>                     |<br>                     v<br>                 Amazon ECR<br>                     |<br>                     v<br>                ECS / Fargate<br>                     |<br>                     v<br>           Runtime Configuration<br>                     |<br>           +---------+----------+<br>           |                    |<br>           v                    v<br>     Secrets Manager       Parameter Store</pre><p>For example, an ECS task definition can reference a secret stored in Secrets Manager and make it available to the container at startup.</p><p>The application can then read the value through its environment.</p><p>One important detail: when ECS injects a secret into an environment variable, the value is retrieved when the container starts. If the secret changes later, an already-running container does not automatically receive the updated value. A new task deployment or restart may be needed.</p><p>Also, environment variables are convenient, but they can be exposed through debugging tools, process inspection, or logs if handled carelessly. They should never be printed unnecessarily.</p><h3>8. Example: A Node.js Backend on AWS</h3><p>Imagine we deploy a Node.js application using:</p><ul><li>GitHub Actions for CI/CD.</li><li>Docker for packaging.</li><li>Amazon ECR for storing the image.</li><li>Amazon ECS with Fargate for running the backend.</li><li>Amazon RDS for the database.</li><li>AWS Secrets Manager for database credentials.</li><li>IAM for controlling access.</li></ul><p>The application flow looks like this:</p><pre>Users<br>  |<br>  v<br>Application Load Balancer<br>  |<br>  v<br>ECS / Fargate<br>  |<br>  +-------&gt; Secrets Manager<br>  |          Database Credentials<br>  |<br>  +-------&gt; Amazon RDS<br>              Application Data</pre><p>The backend needs permission to retrieve the secret and network access to connect to the database.</p><p>The database should normally be placed in private subnets, with security group rules that allow connections only from the appropriate application tasks.</p><p>Secrets Manager handles secret storage, IAM controls authorization, and the VPC and security groups control network access.</p><p>These are separate security layers working together.</p><h3>9. What About GitHub Actions and CI/CD?</h3><p>Our previous article explained how GitHub Actions can build Docker images, push them to ECR, and deploy them to ECS.</p><p>The pipeline also needs secure access to AWS.</p><p>A recommended approach is to configure <strong>OpenID Connect (OIDC)</strong> so GitHub Actions can assume an IAM role and obtain temporary AWS credentials.</p><pre>GitHub Actions<br>       |<br>       v<br>      OIDC<br>       |<br>       v<br>    AWS IAM Role<br>       |<br>       v<br>     Amazon ECR<br>       |<br>       v<br>     Amazon ECS</pre><p>The workflow role should have only the permissions required for its deployment responsibilities.</p><p>This is different from the IAM task role used by the application after deployment.</p><p>We should also avoid printing secret values in CI logs or passing credentials through command-line arguments unnecessarily.</p><p>The goal is to secure both the deployment process and the application runtime.</p><h3>10. What Should We Choose?</h3><p>Here is a practical way to decide.</p><p><strong>Use Secrets Manager when:</strong></p><ul><li>You need centralized storage for sensitive credentials.</li><li>You need secret rotation capabilities.</li><li>Your application needs controlled access to database passwords or API keys.</li></ul><p><strong>Use Parameter Store when:</strong></p><ul><li>You need centralized application configuration.</li><li>You want to organize settings by environment.</li><li>You need encrypted parameters and don’t require the full Secrets Manager lifecycle features.</li></ul><p><strong>Use IAM when:</strong></p><ul><li>You need to control which users, services, or workloads can access AWS resources.</li><li>You want applications to use roles instead of hardcoded AWS access keys.</li><li>You want to enforce least-privilege permissions.</li></ul><p>These services are complementary, not direct replacements for one another.</p><h3>Quick Cheat Sheet</h3><p>ToolMain Responsibility.envLocal application configuration.gitignorePrevents local environment files from being committedAWS Secrets ManagerStores and manages sensitive secretsSystems Manager Parameter StoreStores configuration and parametersSecureStringEncrypted Parameter Store valueIAM RoleGrants AWS permissions to an identity or workloadECS Task RolePermissions used by application codeECS Task Execution RolePermissions used by ECS/Fargate for task startup and related operationsGitHub OIDCProvides a way for GitHub Actions to obtain temporary AWS credentialsAWS KMSManages encryption keys used by supported AWS services</p><h3>Final Thoughts</h3><p>Moving an application to AWS is not just about getting it to run.</p><p>We also need to think about where its credentials live, who can access them, how they are updated, and what happens when those credentials change.</p><p>A local .env file can be useful during development, but production applications need a more controlled approach.</p><p>Secrets Manager, Parameter Store, and IAM help separate application code from sensitive configuration and enforce controlled access.</p><p>The key lesson is simple:</p><p><strong>Don’t hardcode secrets. Don’t give every component unrestricted access. Keep configuration, permissions, and application code separate.</strong></p><p>As I continue learning AWS, I’m finding that production engineering is not only about deploying applications. It’s also about making sure they remain secure, maintainable, and reliable after deployment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=349eba76051f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Happens When You Push Code to Production?]]></title>
            <link>https://medium.com/@supulanupa/what-happens-when-you-push-code-to-production-4488b5553f8a?source=rss-c93ce69207e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/4488b5553f8a</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-services]]></category>
            <category><![CDATA[amazon-web-services]]></category>
            <dc:creator><![CDATA[Anupa Supul]]></dc:creator>
            <pubDate>Mon, 12 Oct 2026 05:41:02 GMT</pubDate>
            <atom:updated>2026-10-12T05:41:02.021Z</atom:updated>
            <content:encoded><![CDATA[<h3>What Happens When You Push Code to Production? Understanding AWS CI/CD with GitHub Actions, Docker, ECR &amp; ECS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*13tFQDZz_iCdpB16DSz1Fg.png" /></figure><p>Imagine you have finished building a Node.js backend. Everything works on your laptop, and you are ready to deploy it.</p><p>Traditionally, you might connect to a server, pull the latest code, install dependencies, restart the application, and hope nothing breaks.</p><p>But what happens when you need to do this every week? Every day? Or several times a day?</p><p>Manually repeating those steps becomes slow, error-prone, and difficult to manage.</p><p>This is where <strong>CI/CD</strong> becomes important.</p><p>After learning Docker, Amazon ECR, ECS, and Fargate, the next question is how to connect them into an automated deployment pipeline.</p><p>Let’s follow a simple example: deploying a Node.js application to AWS whenever new code is pushed to GitHub.</p><h3>1. First, What Is CI/CD?</h3><p>CI/CD is a set of practices that helps developers build, test, and deliver software more reliably.</p><p><strong>Continuous Integration (CI)</strong> means regularly integrating code changes and automatically checking whether the application still works.</p><p><strong>Continuous Delivery (CD)</strong> means keeping the application ready for release. With Continuous Deployment, changes that pass the required checks can be deployed automatically to production.</p><p>Think about a team working on the same backend.</p><p>One developer fixes a login bug. Another adds a new API endpoint. Someone else updates the database integration.</p><p>Without automation, every change needs manual checking and deployment.</p><p>With CI/CD, a pipeline can automatically test the changes, build the application, package it into a Docker image, and deploy a new version.</p><p>The basic idea is:</p><p><strong>Write code → Test it → Build it → Deploy it</strong></p><h3>2. The Complete AWS CI/CD Architecture</h3><p>Here is the architecture we will use throughout this article.</p><pre>DEVELOPER<br>                     |<br>                     v<br>                   GitHub<br>                     |<br>                     v<br>              GitHub Actions<br>                     |<br>              +------+------+<br>              |             |<br>              v             v<br>          Install         Run Tests<br>         Dependencies       |<br>              |             |<br>              +------+------+<br>                     |<br>                     v<br>               Build Docker Image<br>                     |<br>                     v<br>                Amazon ECR<br>             (Image Registry)<br>                     |<br>                     v<br>                Amazon ECS<br>                     |<br>                     v<br>                AWS Fargate<br>                     |<br>                     v<br>               Running Tasks<br>                     |<br>                     v<br>               Production App</pre><p>This pipeline separates the deployment process into clear responsibilities.</p><ul><li><strong>GitHub</strong> stores the source code.</li><li><strong>GitHub Actions</strong> automates the workflow.</li><li><strong>Docker</strong> packages the application.</li><li><strong>Amazon ECR</strong> stores the container image.</li><li><strong>Amazon ECS</strong> manages the deployment and running tasks.</li><li><strong>AWS Fargate</strong> runs the containers without requiring us to manage the underlying EC2 servers.</li></ul><p>Each component solves a different problem.</p><h3>3. Step One: Push Code to GitHub</h3><p>Let’s say we update our backend.</p><p>We add a new endpoint, fix a bug, or improve an existing feature.</p><p>After committing the changes, we push them to GitHub.</p><pre>Developer<br>    |<br>    v<br>Local Code Changes<br>    |<br>    v<br>Git Commit<br>    |<br>    v<br>Git Push<br>    |<br>    v<br>GitHub Repository</pre><p>GitHub becomes the starting point for our deployment workflow.</p><p>But pushing code to GitHub does not automatically mean that the code is safe to deploy. We still need to check it.</p><p>That is the responsibility of the next stage.</p><h3>4. Step Two: GitHub Actions Runs the Pipeline</h3><p><strong>GitHub Actions</strong> is a CI/CD automation platform built into GitHub.</p><p>We can define a workflow that runs when someone pushes code to a particular branch or opens a pull request.</p><p>For example:</p><pre>Code pushed to main<br>        |<br>        v<br>GitHub Actions starts<br>        |<br>        v<br>Install dependencies<br>        |<br>        v<br>Run automated tests<br>        |<br>        v<br>Continue if checks pass</pre><p>A workflow is defined in a YAML file inside the repository, usually under:</p><pre>.github/workflows/</pre><p>A simplified workflow might look like this:</p><pre>name: Backend CI</pre><pre>on:<br>  push:<br>    branches: [main]<br>  pull_request:<br>    branches: [main]</pre><pre>jobs:<br>  test:<br>    runs-on: ubuntu-latest</pre><pre>    steps:<br>      - name: Checkout code<br>        uses: actions/checkout@v4</pre><pre>      - name: Set up Node.js<br>        uses: actions/setup-node@v4<br>        with:<br>          node-version: 22</pre><pre>      - name: Install dependencies<br>        run: npm ci</pre><pre>      - name: Run tests<br>        run: npm test</pre><p>This example focuses on continuous integration. It checks the code and runs tests, but it does not yet build or deploy the Docker image.</p><p>If the tests fail, we can configure the pipeline to stop before deployment.</p><p>That is important because <strong>automation should prevent broken code from reaching production, not just deploy faster</strong>.</p><h3>5. Step Three: Build the Docker Image</h3><p>Once the required checks pass, the next stage is packaging the application.</p><p>This is where Docker connects with the pipeline.</p><pre>Source Code<br>     |<br>     v<br>Dockerfile<br>     |<br>     v<br>Docker Build<br>     |<br>     v<br>Docker Image</pre><p>The Docker image contains the application code, its dependencies, and the instructions needed to run it.</p><p>For example, a Node.js backend might use a Dockerfile like this:</p><pre>FROM node:22</pre><pre>WORKDIR /app</pre><pre>COPY package*.json ./<br>RUN npm ci</pre><pre>COPY . .</pre><pre>EXPOSE 3000</pre><pre>CMD [&quot;npm&quot;, &quot;start&quot;]</pre><p>This is a simplified example. A production Dockerfile should also consider security, image size, dependency management, and which files should be excluded using .dockerignore.</p><p>The important point is that the pipeline can build a new image whenever the application changes.</p><p>Instead of manually preparing a server for every release, we produce a consistent application package.</p><h3>6. Step Four: Store the Image in Amazon ECR</h3><p>Now we have a Docker image. Where should it go?</p><p><strong>Amazon Elastic Container Registry (ECR)</strong> is AWS’s managed container image registry.</p><p>GitHub Actions can authenticate with AWS, build the image, tag it, and push it to an ECR repository.</p><pre>GitHub Actions<br>      |<br>      v<br>Docker Image<br>      |<br>      v<br>Amazon ECR<br>      |<br>      v<br>Versioned Image</pre><p>For example, we might tag images using the Git commit SHA:</p><pre>my-backend:a1b2c3d<br>my-backend:d4e5f6a</pre><p>Each tag identifies a particular build. This makes it easier to identify which version is running and to deploy a previous version when needed.</p><p>For production, avoid relying only on the mutable latest tag. Use explicit version tags and, where appropriate, immutable image digests.</p><p>One important security detail: GitHub Actions needs permission to access ECR. A recommended approach is to use <strong>AWS IAM roles with GitHub Actions OpenID Connect (OIDC)</strong>, so the workflow can obtain temporary AWS credentials without storing long-lived AWS access keys in GitHub secrets.</p><h3>7. Step Five: Deploy the New Image to Amazon ECS</h3><p>The image is now stored in ECR, but it is not running yet.</p><p>We need ECS to deploy it.</p><p>Amazon ECS manages our container workloads. An ECS task definition describes how a container should run, including its image, CPU, memory, ports, and configuration.</p><p>When we deploy a new application version, the pipeline can register or reference an updated task definition and ask the ECS service to deploy it.</p><pre>New Docker Image<br>       |<br>       v<br>Amazon ECR<br>       |<br>       v<br>Updated Task Definition<br>       |<br>       v<br>Amazon ECS Service<br>       |<br>       v<br>New Running Tasks</pre><p>ECS then manages the deployment according to the service’s configuration.</p><p>If we use Fargate, AWS manages the underlying compute infrastructure for the tasks.</p><p>We still need to configure the task’s networking, IAM permissions, resource requirements, logging, and other application settings.</p><p>The benefit is that we no longer need to manually log into an EC2 instance to install the application and restart the process after every release.</p><h3>8. Step Six: How Does the New Version Reach Users?</h3><p>Imagine our backend currently has three running tasks:</p><pre>ECS SERVICE — VERSION 1</pre><pre>Task 1  ── Version 1<br>Task 2  ── Version 1<br>Task 3  ── Version 1</pre><p>Now we deploy Version 2.</p><p>ECS can use a rolling deployment to gradually replace the old tasks with new ones, according to the service’s deployment settings.</p><pre>DEPLOYMENT IN PROGRESS</pre><pre>Task 1  ── Version 2<br>Task 2  ── Version 1<br>Task 3  ── Version 1</pre><p>Then:</p><pre>Task 1  ── Version 2<br>Task 2  ── Version 2<br>Task 3  ── Version 1</pre><p>Finally:</p><pre>DEPLOYMENT COMPLETE</pre><pre>Task 1  ── Version 2<br>Task 2  ── Version 2<br>Task 3  ── Version 2</pre><p>An Application Load Balancer can route requests to healthy registered targets while the deployment progresses.</p><p>However, a rolling deployment does not automatically guarantee zero downtime. That depends on settings such as health checks, minimum healthy capacity, maximum deployment capacity, and whether the new application version is compatible with existing clients and data.</p><p>This is why deployment configuration matters just as much as the pipeline itself.</p><h3>9. What If the New Deployment Fails?</h3><p>Suppose Version 2 contains a bug.</p><p>The application starts, but an API endpoint returns errors.</p><p>A reliable deployment process should not assume that a successful Docker build means the application is healthy.</p><p>We need checks at different stages:</p><ul><li>Automated tests before building or deploying.</li><li>Container startup and health checks.</li><li>ECS service and deployment status.</li><li>Application logs and metrics.</li><li>Post-deployment smoke tests that verify important endpoints.</li></ul><p>ECS can replace unhealthy tasks, but replacing a task is not the same as detecting every application bug. A task might be running while its business logic is broken.</p><p>For deployments that fail, ECS deployment circuit breaker settings can help detect failures and optionally roll back to a previous deployment. The pipeline can also stop or trigger further action when post-deployment checks fail.</p><p>The goal is to detect problems quickly and reduce the impact on users.</p><h3>10. CI/CD Is More Than Just Deployment</h3><p>A common misconception is that CI/CD simply means automatically uploading code to a server.</p><p>A good pipeline should help us deliver changes safely and consistently.</p><p>A more complete workflow might look like this:</p><pre>Developer Pushes Code<br>          |<br>          v<br>   Automated Tests<br>          |<br>          v<br>   Code / Security Checks<br>          |<br>          v<br>    Build Docker Image<br>          |<br>          v<br>     Push Image to ECR<br>          |<br>          v<br>    Deploy to ECS<br>          |<br>          v<br>   Health / Smoke Tests<br>          |<br>          v<br>      Production</pre><p>Depending on the project, we might also include dependency vulnerability scanning, infrastructure validation, manual approval before production, and notifications when a deployment succeeds or fails.</p><p>Not every project needs the same pipeline. The right setup depends on the application’s risk, team size, compliance requirements, and deployment frequency.</p><h3>11. What About Secrets and Permissions?</h3><p>Automation needs access to AWS resources, but giving a pipeline unrestricted access is dangerous.</p><p>For example, GitHub Actions may need to push images to ECR and update an ECS service.</p><p>It should not automatically receive permission to modify every resource in the AWS account.</p><p>A safer design uses:</p><ul><li><strong>IAM:</strong> Grants only the permissions the workflow needs.</li><li><strong>GitHub OIDC:</strong> Allows GitHub Actions to assume an AWS role using temporary credentials.</li><li><strong>Secrets Manager or Parameter Store:</strong> Stores application secrets and configuration where appropriate.</li><li><strong>ECS task roles:</strong> Allow the running application to access specific AWS services.</li><li><strong>Security Groups and VPC networking:</strong> Restrict network communication between the load balancer, application tasks, and database.</li></ul><p>It is also important to distinguish the deployment pipeline’s permissions from the permissions of the running application. They serve different purposes and should be configured separately.</p><h3>12. The Complete Deployment Architecture</h3><p>Let’s connect the pieces.</p><pre>DEVELOPER<br>                        |<br>                        v<br>                      GitHub<br>                        |<br>                        v<br>                 GitHub Actions<br>                        |<br>              +---------+---------+<br>              |                   |<br>              v                   v<br>          Run Tests          Build Image<br>                                  |<br>                                  v<br>                             Amazon ECR<br>                                  |<br>                                  v<br>                             Amazon ECS<br>                                  |<br>                                  v<br>                             AWS Fargate<br>                                  |<br>                                  v<br>                          Running ECS Tasks<br>                                  |<br>                                  v<br>                                  ALB<br>                                  |<br>                                  v<br>                               USERS</pre><p>This diagram shows the deployment pipeline and the running application, but they are two different flows.</p><p><strong>Deployment flow:</strong></p><pre>Code → GitHub Actions → Docker → ECR → ECS</pre><p><strong>Application request flow:</strong></p><pre>Users → ALB → ECS Tasks → RDS / S3 / Other Services</pre><p>In a complete web application, Route 53 and CloudFront can sit in front of the application, while networking, security, monitoring, and scaling support the system.</p><p>The CI/CD pipeline changes how we deliver application versions. It doesn’t replace the architecture that serves user requests.</p><h3>13. GitHub Actions vs AWS CodePipeline</h3><p>One question worth asking is whether we must use AWS CodePipeline.</p><p>No.</p><p>GitHub Actions can handle CI/CD workflows directly from a GitHub repository. It can run tests, build Docker images, push them to ECR, and trigger ECS deployments.</p><p>AWS CodePipeline is another option for orchestrating release workflows using AWS services.</p><p>The choice depends on the existing development workflow and operational requirements.</p><p>GitHub ActionsAWS CodePipelineIntegrated with GitHub repositoriesIntegrated with AWS deployment workflowsUses workflow YAML filesUses pipeline stages and actionsCan build and deploy to AWSCan orchestrate AWS and supported external actionsConvenient when source code is already on GitHubUseful when a team wants an AWS-centered pipeline</p><p>Neither is automatically the better choice. A team should consider its existing tools, access controls, deployment process, and maintenance needs.</p><h3>The Mental Model I Keep Now</h3><p>Before learning CI/CD, my deployment mental model was:</p><pre>Write Code<br>    |<br>    v<br>Deploy Manually<br>    |<br>    v<br>Restart Application</pre><p>Now I think about the process as:</p><pre>Code<br> |<br> v<br>GitHub<br> |<br> v<br>Automated Checks<br> |<br> v<br>Docker Image<br> |<br> v<br>Amazon ECR<br> |<br> v<br>Amazon ECS<br> |<br> v<br>AWS Fargate<br> |<br> v<br>Production</pre><p>Each stage has a responsibility.</p><p>GitHub stores the code. GitHub Actions automates the workflow. Docker packages the application. ECR stores the image. ECS manages the deployment. Fargate runs the containers.</p><p>That is the connection between development and production.</p><h3>Quick Cheat Sheet</h3><p>TechnologyMain ResponsibilityGitHubSource code managementGitHub ActionsCI/CD workflow automationCIIntegrate changes and run checksCDPrepare or deliver changes to productionDockerPackage the applicationECRStore container imagesECSManage container workloads and deploymentsTask DefinitionDescribes how a task should runECS ServiceMaintains desired tasks and manages deploymentsFargateRuns containers without managing EC2 hostsALBRoutes requests to healthy targetsCloudWatchLogs, metrics, dashboards, and alarmsIAM + OIDCControl pipeline access to AWS</p><h3>Final Thoughts</h3><p>The biggest lesson for me is that deploying an application shouldn’t depend on someone remembering a long list of manual steps.</p><p>A well-designed CI/CD pipeline makes those steps repeatable, testable, and easier to monitor.</p><p>It also connects the tools developers use every day with the AWS services that run their applications in production.</p><p>Docker taught me how to package an application. ECR gave that package a place to live. ECS and Fargate showed me how to run it on AWS.</p><p><strong>CI/CD connects all of them into a repeatable delivery process.</strong></p><p>And that’s an important step toward understanding not just cloud infrastructure, but how modern software is delivered and operated.</p><p><em>The next time you push code to GitHub, think about everything that could happen automatically before that code reaches your users.</em></p><p><strong>Code → Test → Build → Package → Deploy → Verify.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4488b5553f8a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>