<?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 Rofiat Adewunmi on Medium]]></title>
        <description><![CDATA[Stories by Rofiat Adewunmi on Medium]]></description>
        <link>https://medium.com/@rofiaadeola?source=rss-9f5705b7cbb8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Ve4jQoYkbqhskCUaYJB1og.jpeg</url>
            <title>Stories by Rofiat Adewunmi on Medium</title>
            <link>https://medium.com/@rofiaadeola?source=rss-9f5705b7cbb8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 17:38:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rofiaadeola/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[Terraform 101 — Getting Started with Infrastructure Automation (Part 2)]]></title>
            <link>https://medium.com/@rofiaadeola/terraform-101-getting-started-with-infrastructure-automation-part-2-772250857df0?source=rss-9f5705b7cbb8------2</link>
            <guid isPermaLink="false">https://medium.com/p/772250857df0</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[cloud-automation]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Rofiat Adewunmi]]></dc:creator>
            <pubDate>Mon, 06 Apr 2026 17:19:31 GMT</pubDate>
            <atom:updated>2026-04-07T02:26:40.042Z</atom:updated>
            <content:encoded><![CDATA[<h3>Build &amp; Deploy: Provisioning EC2 with Terraform</h3><p><em>Write your first Terraform configuration, use the HashiCorp Registry, and deploy a real EC2 instance on AWS. Then watch Terraform manage every change after that.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/503/1*0hiSsN32h1JU-4JVjX0zUw.png" /><figcaption>Image generated by AI</figcaption></figure><p>In Part 1, we covered the <em>why</em> behind Terraform: why ClickOps breaks at scale, what infrastructure as code actually means, and how to get your Windows machine set up with Terraform and the AWS CLI. If you have not read that yet, start <a href="https://medium.com/@rofiaadeola/terraform-101-infrastructure-automation-part-1-d948576800e5">there</a>. This part picks up directly from where it left off.</p><p>Here, we get hands-on. By the end of this article, you will have written real Terraform configuration files, initialised a project, deployed an EC2 instance to AWS without touching the console, and seen firsthand how Terraform tracks and manages every change you make.</p><blockquote><strong>Picking up from Part 1?</strong> Make sure you have Terraform and the AWS CLI installed, and that aws configure has been run with a valid IAM user. If terraform -v and aws --version both return version numbers in your terminal, you are ready.</blockquote><h3>Finding Your Resources: The HashiCorp Registry</h3><p>Before writing a single line of code, there is a tool you should know about, and it makes writing Terraform significantly easier. The <strong>HashiCorp Terraform Registry</strong> is the official library of providers and resource documentation for Terraform.</p><p>Every resource type Terraform can create (EC2 instances, S3 buckets, security groups, VPCs) has a documented page in the Registry. It shows you the exact syntax, every available argument, and working examples. You do not need to memorise anything. You look it up, copy the structure, and fill in your values.</p><blockquote>Browse the full AWS provider documentation, find resource arguments, and copy working examples directly into your project.<br><a href="https://registry.terraform.io/providers/hashicorp/aws/latest/docs">registry.terraform.io → AWS Provider Docs →</a></blockquote><p>For this article, we will be using the aws_instance resource. Before writing code, visit the Registry page for this resource. It documents every argument and shows example configurations that you can adapt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vCrS39x5uerYYTNHmNj-3A.png" /></figure><h3>Setting Up Your Project</h3><p>Create a new folder for this project. Call it something like terraform-ec2. Open it in VS Code. Inside, we will create three files. Each has a specific role, and together they make up a complete, working Terraform configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q2Gg9CjBJCCgiHtWcVllgA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*l3TQTHtSnDH2a1o6olZpKg.png" /></figure><p><strong>Project Structure</strong></p><pre>terraform-ec2/<br>├── main.tf         # Provider config + resources<br>├── variables.tf    # Reusable input values<br>└── outputs.tf      # Values exposed after deployment</pre><blockquote><strong>Why three files?</strong> Terraform would work with everything in a single file. But separating concerns (resources, variables, outputs) is a widely adopted convention. It makes configs easier to read, maintain, and hand off to others.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*biJsmGZGznpxbZkLulb7rQ.png" /></figure><h3>Adding the AWS Provider</h3><p>Before writing any resources, Terraform needs to know which cloud platform it is working with. This is done through a <strong>provider block</strong>, and the place to get the exact syntax for it is the HashiCorp Registry.</p><p>Head to <a href="https://registry.terraform.io/providers/hashicorp/aws/latest/docs">registry.terraform.io</a>, search for the AWS provider, and look for the “Use Provider” button at the top right of the page. It will give you the exact terraform block to copy into your main.tf, including the source and a recommended version constraint. This is how you will approach every new provider you use going forward — not from memory, from the docs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nq89B6vD9eJuhRS0Di7SQw.png" /></figure><p>Paste the provider block into main.tf, then add the provider &quot;aws&quot; configuration block below it. The Registry&#39;s Getting Started section shows this exact pattern. Your region value can reference a variable, which we will define next.</p><blockquote><strong>Get comfortable with this habit.</strong> Even experienced Terraform users keep the Registry open while writing configs. It documents every argument, shows which ones are required versus optional, and includes working examples for common setups. You do not need to memorise syntax — you need to know where to look it up.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WRcP4bxknkf5nZkpYa0Omw.png" /></figure><h3>Defining Your Variables</h3><p>Open variables.tf. Note that variables are not in the Registry — they are a core language feature, so the reference lives at <a href="https://developer.hashicorp.com/terraform/language/values/variables">developer.hashicorp.com/terraform/language/values/variables</a>. The docs show the full block structure. For this project you need three: your AWS region, the AMI ID, and the instance type.</p><p>For the AMI ID, go to your AWS Console, navigate to EC2 → Instances → Launch an Instance, and filter by “Amazon Linux 2023” in your chosen region. Copy the AMI ID from there — AMI IDs are region-specific, so the one you use must match the region in your provider block.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m85nQyfkwr7ZCZvz_psN5A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eE52KLcYiZcFlJe23V2KsQ.png" /></figure><h3>Writing the EC2 Resource Block</h3><p>Now for the main event. Back in main.tf, below the provider block, you will add the resource block that defines your EC2 instance. Do not type it from scratch — go to the Registry.</p><p>On the AWS provider page, use the left-hand navigation to find <strong>Resources → aws_instance</strong>. This page is your complete reference. Scroll to the <strong>Example Usage</strong> section at the top, it shows a working resource block you can copy directly. Then scroll to the <strong>Argument Reference</strong> section to understand what each argument does and which ones are required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SKuzdL_7IPXbYVzXcW6eBg.png" /></figure><p>For this tutorial, the two required arguments are ami and instance_type. Point both of these at the variables you defined in variables.tf using the var. syntax. Then add a tags block — this is optional but a good habit, as it keeps your AWS Console organised and makes it immediately obvious which resources Terraform manages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dez2FCkyY9UpHKCvHZl4Xg.png" /></figure><blockquote><strong>This is the workflow for every resource you will ever write.</strong> Find the resource in the Registry, read the Example Usage, check the Argument Reference for anything you need beyond the basics, and build your block from there. The Registry covers hundreds of AWS resources — once you are comfortable with this process, none of them are out of reach.</blockquote><h3>Filling in outputs.tf</h3><p>Open outputs.tf. Like variables, outputs are documented in the language reference at <a href="https://developer.hashicorp.com/terraform/language/values/outputs">developer.hashicorp.com/terraform/language/values/outputs</a>. Add two: one for the instance ID and one for the public IP, both referencing your aws_instance resource by name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*dFck1cbliWiZcEIHe3QlQg.png" /></figure><h3>Initialising Terraform &amp; Deploying</h3><p><em>Press </em><em>Ctrl + S on each open file in VS Code. Terraform reads directly from your saved files, so anything unsaved will not be picked up.</em></p><p>With all three files in place, open a terminal in VS Code (Ctrl + `), make sure you are in the project folder, and run through the three core Terraform commands.</p><h3>Step 1 — Initialise</h3><p>This downloads the AWS provider plugin and prepares the working directory. Run it once when you create a new project, or whenever you add a new provider.</p><pre>terraform init</pre><p>You will see Terraform download the AWS provider and print “Terraform has been successfully initialized.” A new .terraform folder and .terraform.lock.hcl file will appear in your project. Do not edit these manually.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EJIrYTLicZRPC2Ixv8BRJQ.png" /></figure><h3>Step 2 — Plan</h3><p>This is Terraform’s killer feature compared to manual processes. Before touching a single resource, Terraform reads your code, compares it against current state, and prints a detailed preview of exactly what it will create, change, or destroy. Nothing has happened in AWS yet.</p><pre>terraform plan</pre><p>Look for the green + lines, which show resources Terraform will create. Read through the plan and confirm it matches what you expect before proceeding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rsk52VAGUgtWbDM9Wby9PA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r3Y7nNVmhPCPcml1Aizb3A.png" /></figure><h3>Step 3 — Apply</h3><p>This executes the plan. Terraform will print the plan one more time and ask you to type yes to confirm. After confirmation, it provisions the EC2 instance and prints your outputs (instance ID and public IP) when complete.</p><pre>terraform apply</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*29P3R0zq0qMKFJr5R0YdFg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FtCDi5pvzohtFK_CynK28Q.png" /></figure><blockquote><strong>Notice the tags in the console.</strong> The Name you wrote in code is now visible in the AWS Console exactly as declared. This is the essence of IaC: the code is the truth, and the infrastructure reflects it.</blockquote><h3>How Terraform Manages Changes</h3><p>Deploying infrastructure is only half the story. What happens after the first apply is where Terraform really proves its value. Every time you run terraform apply, Terraform compares your code to the live state of your infrastructure and only changes what is different.</p><p>This means your code is always the source of truth. Adding something to your .tf files adds it to AWS. Removing something from your files removes it from AWS. Changing a value updates it.</p><h3>See It in Action: Adding a Tag</h3><p>Let’s make a small, observable change. Open main.tf and add the ‘environment’ and ‘mangedby’ tags to your EC2 instance:</p><pre>tags = {<br>    Name        = &quot;terraform-101&quot;<br>    Environment = &quot;learning&quot;<br>    ManagedBy   = &quot;Terraform&quot;</pre><p>(remember ctrl + sto save your file)</p><p>Now run terraform plan. You will see a change diff with the new tag shown in green and everything else unchanged. Run terraform apply and the tag appears in the AWS Console within seconds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kdjV7LYCgGyh-_JJBpmq_A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zvvQyEFMjz39NVKVnl7Dqw.png" /></figure><blockquote><strong>This is infrastructure drift prevention in practice.</strong> If someone manually adds or removes a tag in the AWS Console (or changes any other setting), the next terraform plan will detect the drift and show you exactly what drifted. Running terraform apply restores everything to what the code declares.</blockquote><h3>Tearing Down Cleanly</h3><p>When you are done, remove everything Terraform created with a single command. No clicking through the console, no risk of leaving a forgotten resource running and accumulating charges.</p><pre>terraform destroy</pre><p>Terraform shows you what it will remove and asks for confirmation. Type yes and it handles the rest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IacFPPy0tY6uTydcJfd4hg.png" /></figure><h3>From One Instance to a Fleet</h3><p>Everything we have done in this article provisions a single EC2 instance. But one of the most compelling things about Terraform is how little changes when you need more.</p><p>Imagine provisioning ten identical servers for a load-balanced web application, a test cluster, or a staging environment that mirrors production exactly. With ClickOps, that means repeating the same steps ten times, with ten opportunities for inconsistency. With Terraform, it means changing one number.</p><h3>Wrapping Up</h3><p>Over these two articles, you have gone from understanding why ClickOps has limits to setting up a complete Terraform environment on Windows to writing real configuration files and deploying actual infrastructure on AWS, all without touching the console.</p><p>More importantly, you have seen how Terraform manages change. Not just creation, but modification, removal, and drift correction. That ongoing relationship between your code and your infrastructure is what makes Terraform so much more than a deployment tool.</p><p><strong><em>If you found this useful, share it with someone who is still clicking through the AWS Console wondering if there is a better way. There is, and now you have the proof.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=772250857df0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Terraform 101 — Getting Started with Infrastructure Automation (Part 1)]]></title>
            <link>https://medium.com/@rofiaadeola/terraform-101-infrastructure-automation-part-1-d948576800e5?source=rss-9f5705b7cbb8------2</link>
            <guid isPermaLink="false">https://medium.com/p/d948576800e5</guid>
            <category><![CDATA[terraform-provider]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[infrastructure-automation]]></category>
            <dc:creator><![CDATA[Rofiat Adewunmi]]></dc:creator>
            <pubDate>Sun, 29 Mar 2026 16:51:21 GMT</pubDate>
            <atom:updated>2026-03-29T17:26:20.102Z</atom:updated>
            <content:encoded><![CDATA[<h3>Understanding Terraform &amp; Setting Up Your Environment</h3><p><em>Why ClickOps breaks at scale, what Terraform actually is, and how to get your Windows machine ready to write infrastructure as code.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*Mf-1eN0EZc5imx7VHpsoMA.png" /><figcaption><em>Image Generated by AI</em></figcaption></figure><p>If you have been following my previous articles, you already know I have walked through setting up AWS infrastructure the old-fashioned way: logging into the console, clicking through menus, filling in forms, and hoping everything was configured the same way it was last time. That workflow, called <strong>ClickOps</strong>, is how most people start with AWS. It is visual, immediate, and forgiving when you are learning.</p><p>But here is what nobody warns you about: the moment you need to do it again, for a new environment, a new team member, or a slightly different project — the cracks start to show. Did you select the right region? Did you configure the security group exactly as before? Is your staging environment actually mirroring production, or has it quietly drifted into something different over the past three weeks?</p><p>These are not hypothetical concerns. They are the everyday friction of managing infrastructure by hand. And they cost time, cause incidents, and make scaling a team genuinely painful.</p><p>That friction is exactly what pushed me toward Terraform. Terraform is that tool that provides a more relaible, repeatable way to manage infrastructure.</p><p>This is Part 1 of a two-part series. Here, we focus on the <em>why</em> and the <em>setup</em>: understanding what Terraform is, how it compares to ClickOps, and getting your Windows machine configured to write infrastructure as code. In Part 2, we will use everything we set up here to actually provision an EC2 instance on AWS, explore how Terraform manages changes, and close with a look at how the same approach can scale to a fleet of servers.</p><blockquote><strong>Who is this for?</strong> Anyone who has set up AWS resources through the console before and is curious about a better approach. You do not need to be a developer, just comfortable opening a terminal and following along.</blockquote><h3>ClickOps vs Terraform — The Real Difference</h3><p>To understand why Terraform matters, it helps to be honest about what ClickOps actually looks like in practice, not just the first time, but the fifth time, across three environments, with a team of four people who all click slightly differently.</p><p>ClickOps is not inherently bad. The AWS Console is well-designed, and for learning or one-off experiments, it is the right tool. The problems emerge when you try to scale it: in complexity, in team size, or simply in repetition.</p><p>The clearest way I can put it: ClickOps is a process that lives in your head. Terraform is a process that lives in a file; one that can be read, reviewed, shared, and version-controlled.</p><h3>What is Terraform?</h3><p>Terraform is an open-source Infrastructure as Code tool built by HashiCorp. It lets you describe your cloud infrastructure (servers, networks, databases, permissions) in plain configuration files, and then provision or update that infrastructure with a single command.</p><p>A few things set it apart from other tools in this space:</p><p>It is <strong>cloud-agnostic</strong>, meaning the same tool works with AWS, Azure, Google Cloud, and dozens of other providers. You learn one workflow, and it travels with you.</p><p>It is <strong>declarative</strong>, meaning you write what you want to exist, not a step-by-step script for how to create it. Terraform figures out the steps.</p><p>It is <strong>state-aware</strong>. Terraform keeps a record of everything it has built. When you make a change, it compares your new code against that record and only touches what needs to change. Nothing is recreated unnecessarily.</p><h3>Four Core Concepts</h3><p>You will see these terms throughout both parts of this series. Worth understanding them now before the code appears</p><h4>Provider</h4><p>The plugin that connects Terraform to a platform. For us, that is AWS. Providers are declared in your code and downloaded automatically on initialisation.</p><h4>Resource</h4><p>The actual thing you are creating: an EC2 instance, an S3 bucket, a VPC. Each resource maps to something real in your cloud account.</p><h4>State</h4><p>A file Terraform maintains to track what it has built. This is how it knows what to change, what to leave alone, and what to remove.</p><h4>Plan → Apply</h4><p>Before touching anything, Terraform shows you a preview of what it will do. You review it, then approve. No surprises, no silent changes.</p><blockquote><strong>What language does Terraform use?</strong> Terraform configuration is written in HCL — HashiCorp Configuration Language. It looks a little like JSON but is much more readable. You will pick it up quickly, even without a programming background.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G0JKCojtZ1n2MjcNEo96_Q.png" /></figure><h3>Choosing a Code Editor</h3><p>Before installing Terraform, you need somewhere to write your configuration files. Terraform files are plain text with a .tf extension - any text editor works. But some editors make the experience meaningfully better with syntax highlighting, autocomplete, and error hints.</p><p>Here are the main options worth knowing about:</p><p><strong>VS Code (Recommended)</strong></p><p>Free, lightweight, and has an excellent official HashiCorp Terraform extension that adds syntax highlighting, formatting, and autocomplete for .tf files. This is what I use and what the screenshots in this series will show.</p><p><strong>Atom</strong></p><p>A free, open-source editor from GitHub. Has community packages for Terraform support. Solid choice if you are already familiar with it, though VS Code has a larger ecosystem and more active development.</p><p><strong>IntelliJ / JetBrains</strong></p><p>Excellent Terraform support via the HashiCorp plugin, and tightly integrated with other JetBrains tools. Best suited if you are already in the JetBrains ecosystem — overkill if you are just getting started.</p><p><strong>Notepad / Any Text Editor</strong></p><p>Works in a pinch, Terraform only cares about the file content, not which editor produced it. But without syntax highlighting you will spend extra time debugging simple formatting issues.</p><p><strong>For this series, we will use VS Code</strong>. If you already have it installed, great. If not, download it from <a href="https://code.visualstudio.com/">code.visualstudio.com</a> and run the installer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/1*9Lfae54Hzd1sdUF5e1y_7g.png" /></figure><h3>Install the HashiCorp Terraform Extension</h3><p>Once VS Code is open, install the official Terraform extension for syntax support and formatting. Open the Extensions panel (Ctrl + Shift + X), search for <strong>HashiCorp Terraform</strong>, and click Install.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PvLzbjbfi1spfvnpXjK9Jg.png" /></figure><h3>Installing Terraform on Windows</h3><p>Download the Windows ZIP package from <a href="https://developer.hashicorp.com/terraform/install">developer.hashicorp.com/terraform/install</a>. Extract the terraform.exe file and move it to a folder that is on your system PATH - for example C:\terraform\. Then add that folder to your PATH environment variable (covered in the next section).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G_8vwHzYKaLQZdCRfRU2Tw.png" /></figure><h3>Verify the Installation</h3><p>Close and reopen your terminal, then navigate to the executable path. Run <em>terraform</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5qgKb3uAnjQ6BjMm0Rv3Dg.png" /></figure><h3>Setting Up the PATH Environment Variable</h3><p>When you type terraform in a terminal (when you are not in the installation folder), Windows needs to know where to find that program. It does this by looking through a list of folders called the <strong>PATH</strong>. If Terraform&#39;s folder is not on the PATH, Windows cannot find it even though the file is there.</p><p>In the screenshot below, you can see that the terraform command works when executed from the folder where the Terraform executable resides. However, when running the same command from a different directory, it is not recognized.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4CfxBTY_hA7c5CcL24998w.png" /></figure><p>This happens because the system can only execute commands that are either in the current directory or listed in the system’s PATH environment variable. To make Terraform accessible from anywhere, you need to add the folder containing the Terraform binary to your PATH.</p><ol><li><strong>Open Environment Variables</strong></li></ol><p>Press Win + S and search for <strong>Edit the system environment variables</strong>. Click it to open System Properties, then click the <strong>Environment Variables</strong> button at the bottom.</p><p>2. <strong>Edit the Path Variable</strong></p><p>Under <strong>System variables</strong>, find the variable named Path and click <strong>Edit</strong>. Click <strong>New</strong> and add the full path to the folder containing terraform.exe - in this caseC:\Binaries</p><p>3. <strong>Save and Restart your Terminal</strong></p><p>Click OK on all dialogs. Close any open terminal windows and open a fresh one; changes to environment variables only take effect in new sessions.</p><p>4. <strong>Verify it Worked</strong></p><p>Run terraformagain. The version number should now print without errors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mL-ziOZcxVXxsgFN4K-GIw.png" /></figure><h3>Installing the AWS CLI</h3><p>Terraform needs to communicate with your AWS account to create resources. It does this through the <strong>AWS CLI</strong>, a tool that authenticates your machine to AWS using credentials you provide. Think of it as the handshake between your local setup and the cloud.</p><h3>Install on Windows</h3><p>Download the official Windows installer from <a href="https://aws.amazon.com/cli/">aws.amazon.com/cli</a>. Run the .msi installer and follow the prompts - it handles the PATH setup automatically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ksywqWjUIciOzFkphWmetQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*zdnemvQJSdIjBzbxDq9vvw.png" /></figure><h3>Verify the Installation</h3><p>Run<em> </em>the below command on<em> </em>PowerShell / Command Prompt</p><pre>aws --version </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QVdudBJlz2mKKmpZaUN_gA.png" /></figure><h3>Configure Your AWS Credentials</h3><p>Run the following and enter the credentials for your IAM user when prompted:</p><pre>aws configure</pre><p>You will be prompted for four values:</p><ul><li><strong>AWS Access Key ID</strong>- from your IAM user’s security credentials</li><li><strong>AWS Secret Access Key</strong>- generated alongside the access key</li><li><strong>Default region name</strong>- e.g.us-east-1</li><li><strong>Default output format</strong>- enterjson</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UPqfLy_ogQjAA8c6X3ZafQ.png" /></figure><blockquote><strong>Use an IAM user, not your root account.</strong> Log into the AWS Console, navigate to <strong>IAM → Users</strong>, create a user with programmatic access, and attach the AmazonEC2FullAccess policy. Never use root account credentials in the CLI.</blockquote><p>Once configured, your credentials are stored in C:\Users\[YourName]\.aws\credentials. Terraform will automatically pick these up when it runs - no extra configuration needed,</p><h3>You Are Ready</h3><p>That is everything you need before writing a single line of Terraform. VS Code is set up, Terraform is installed and reachable from your terminal, and your AWS CLI is configured with credentials that Terraform will automatically pick up. You also now have a clear picture of why this whole approach exists and what makes it different from clicking through the console.</p><p>The setup phase is done. Part 2 is where things get real.</p><p>We will open up the HashiCorp Registry, write our first .tf files, and walk through the full init, plan, and apply workflow to deploy an actual EC2 instance on AWS without touching the console once. We will also look at what happens when you change your code after the first deployment, and how Terraform keeps your infrastructure in sync with whatever your files say.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d948576800e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Securing Grafana on AWS ECS with ALB and NAT Gateway]]></title>
            <link>https://medium.com/@rofiaadeola/securing-grafana-on-aws-ecs-with-alb-and-nat-gateway-db544e34eb24?source=rss-9f5705b7cbb8------2</link>
            <guid isPermaLink="false">https://medium.com/p/db544e34eb24</guid>
            <dc:creator><![CDATA[Rofiat Adewunmi]]></dc:creator>
            <pubDate>Sat, 03 Jan 2026 05:30:39 GMT</pubDate>
            <atom:updated>2026-01-03T05:30:39.117Z</atom:updated>
            <content:encoded><![CDATA[<p>Monitoring is an essential part of running applications in the cloud. Whether you’re tracking infrastructure metrics, visualizing logs, or exploring application performance, <strong>Grafana</strong> remains one of the most powerful open-source dashboarding tools available today.</p><p>In my previous article, I walked through <a href="https://medium.com/@rofiaadeola/deploying-grafana-on-aws-ecs-fargate-a-beginner-friendly-guide-8fdb51e0c2b5">deploying Grafana on <strong><em>AWS ECS Fargate</em></strong></a>, exposing it directly via a public subnet. That setup was intentionally simple and beginner-friendly — perfect for learning ECS networking and running quick demos.</p><p>However, that architecture is not production-secure.</p><p>In this follow-up, I’ll walk through an improved and more secure architecture, where:</p><ul><li>Grafana runs in a <strong>private subnet</strong></li><li>Access is controlled through an <strong>Application Load Balancer (ALB)</strong></li><li>A <strong>NAT Gateway</strong> provides outbound internet access for image pulls and logging</li></ul><p>This article focuses on why these changes matter and how to implement them step by step.</p><h3>Recap: The Previous Architecture (Public Subnet)</h3><p>In the previous setup, Grafana was deployed using:</p><ul><li>A VPC with a public subnet</li><li>An Internet Gateway</li><li>An ECS Fargate task running the Grafana container</li><li>A security group allowing inbound traffic on port 3000</li><li>Direct access to Grafana via the task’s public IP</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FjdEF35hVf_AVtA8.png" /><figcaption>Previous Architecture</figcaption></figure><p>This architecture was great for:</p><ul><li>Learning ECS Fargate</li><li>Understanding AWS VPC networking</li><li>Quick testing and experimentation</li></ul><p>But it had major limitations:</p><ul><li>Grafana was <strong><em>directly exposed to the internet</em></strong></li><li>No centralized access control</li><li>No separation between application and edge traffic</li><li>Larger attack surface</li></ul><h3>The Improved Architecture: Private Subnet + ALB + NAT Gateway</h3><p>In this article, we improve the design by introducing three key components:</p><ol><li><strong>Private Subnets</strong> for the Grafana ECS task</li><li><strong>Application Load Balancer (ALB)</strong> for controlled inbound access</li><li><strong>NAT Gateway</strong> for secure outbound internet access</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/1*UrvPCx5i97Y8i43fW9z9_w.png" /><figcaption>Proposed Architecture</figcaption></figure><h3>What this architecture achieves</h3><ul><li>Grafana is no longer directly accessible from the internet</li><li>All inbound traffic flows through the ALB</li><li>Security groups enforce least privilege access</li><li>Outbound access is allowed without exposing the container</li><li>The design is closer to production-ready patterns</li></ul><h3>Why These Additions Matter (Security Perspective)</h3><h3>Private Subnet</h3><p>Placing Grafana in a private subnet ensures:</p><ul><li>No public IP is assigned to the container</li><li>The service cannot be reached directly from the internet</li><li>Only explicitly allowed internal resources (like the ALB) can reach it</li></ul><h3>Application Load Balancer (ALB)</h3><p>The ALB:</p><p>Acts as the single entry point</p><ul><li>Handles health checks and routing</li><li>Enables future improvements like HTTPS, WAF, authentication, and access logging.</li></ul><h3>NAT Gateway</h3><p>Private subnets cannot access the internet by default.</p><p>The NAT Gateway is required so Grafana can:</p><ul><li>Pull the container image (grafana/grafana) from Docker Hub</li><li>Send logs and metrics to Amazon CloudWatch</li><li>Communicate with AWS APIs when needed</li></ul><p>Crucially, the NAT Gateway allows <strong>outbound-only traffic, </strong>inbound internet access is still blocked.</p><h3>Step-by-Step Guide: Secure Grafana Deployment</h3><h3>1. Move Grafana to a Private Subnet</h3><p>Ensure your VPC has:</p><ul><li>At least one <strong>private subnet</strong> (no route to Internet Gateway)</li><li>At least two <strong>public subnets</strong> (for ALB high availability)</li></ul><p>Your Grafana ECS task will later be launched <strong>only in the private subnet</strong>.</p><h3>2. Create a NAT Gateway</h3><h4>Allocate an Elastic IP</h4><ul><li>Go to <strong>VPC → Elastic IPs</strong></li><li>Allocate a new Elastic IP</li><li>Leave defaults and allocate</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hsb16pQ1BxhYuOo-lMjU1Q.png" /></figure><h4>Create the NAT Gateway</h4><ul><li>Go to <strong>VPC → NAT Gateways → Create</strong></li><li>Availability mode:</li><li>If using <strong>Regional</strong>, you don’t need to select a subnet</li><li>Select the Elastic IP you created</li><li>Ensure the NAT Gateway is associated with an AZ that has a <strong>public subnet</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tcxofy29a1iGhEagRY36RA.png" /></figure><h3>3. Update Private Subnet Route Table</h3><ul><li>Edit the route table associated with the <strong>private subnet.</strong></li></ul><p>Add a route:</p><ul><li>Destination: 0.0.0.0/0</li><li>Target: NAT Gateway</li><li>This enables outbound internet access for private resources.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CLt2x43T7MTbnAK5tIRm1w.png" /></figure><h3>4. Security Groups</h3><h4>ALB Security Group</h4><p>Inbound:</p><ul><li>HTTP (80) from 0.0.0.0/0</li><li>HTTPS (443) if using a certificate</li></ul><p>Outbound:</p><ul><li>Allow all</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1uJOFM4JgcroZCBGW4Uhhg.png" /></figure><h4>Grafana ECS Task Security Group</h4><p>Inbound:</p><ul><li>TCP 3000 <strong>from ALB security group only</strong></li></ul><p>Outbound:</p><ul><li>Allow all</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TM-wMFY5ymMqn_PKvZgnDg.png" /></figure><p>This ensures Grafana can only be reached through the ALB.</p><h3>5. Create the Task Definition</h3><ul><li>Launch type: <strong>Fargate</strong></li><li>Task execution role: required</li><li>Container image: grafana/grafana</li><li>Container port: 3000</li><li>Protocol: TCP</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l1rQ6q8GZfV0TBOtx1_AQw.png" /></figure><h3>6. Create an ECS Cluster</h3><ul><li>Infrastructure: <strong>Fargate</strong></li><li>Default settings</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6D0G4kV9iOduTceLV-jCFA.png" /></figure><h3>7. Create a Target Group</h3><ul><li>Target type: <strong>IP</strong></li><li>Protocol: HTTP</li><li>Port: 3000</li><li>IP address type: IPv4</li><li>VPC: select your VPC</li></ul><p>Health check:</p><ul><li>Leave defaults</li><li>Change <strong>Success codes</strong> to 200-399</li></ul><p>Remove the incomplete IP under “Specify IPs and ports”</p><ul><li>Port: 3000</li><li>Create target group</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M0Ys84HJwusCDrkdJGKyYw.png" /></figure><h3>8. Create the Application Load Balancer</h3><ul><li>EC2 → Load Balancers → Create ALB</li><li>Internet-facing</li><li>IPv4</li><li>Select your VPC</li><li>Select <strong>at least two public subnets in different AZs</strong></li><li>Attach ALB security group</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*by5itmsmdUrM5w3etLSv7w.png" /></figure><p>Listeners:</p><ul><li>HTTP :80 → forward to target group (select your target group)</li><li>HTTPS :443 (optional)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tP_2VDaavLt8QRNczdt18Q.png" /></figure><p>Create load balancer.</p><h3>9. Create the ECS Service</h3><ul><li>Select your task definition family</li><li>Launch type: <strong>Fargate (LATEST)</strong></li><li>Health check grace period: <strong>60–120 seconds</strong></li></ul><p>Networking:</p><ul><li>VPC: select your VPC</li><li>Subnets: <strong>private subnet only</strong></li><li>Auto-assign public IP: <strong>DISABLED</strong></li><li>Security group: Grafana SG</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lTi_t60rGHAGFZHdKClDxA.png" /></figure><p>Load balancing:</p><ul><li>Container: grafana 3000:3000</li><li>Use existing ALB</li><li>Listener: HTTP :80</li><li>Target group: existing one</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lNX2hz8TXTbefYvYPSP1LQ.png" /></figure><p>Create service.</p><h3>10. Access Grafana</h3><p>Once deployment completes:</p><ul><li>Deployment status: <strong>Success</strong></li><li>Task: <strong>Running</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-WkyzvJGEEZQPxg1BME-yQ.png" /></figure><ul><li>Target Group Health Check: <strong>Healthy</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ldf2oFu0ljf7sIZ3hiTWgQ.png" /></figure><p>Copy the <strong>ALB DNS name</strong> and open it in your browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qr7JU9R1-vdmDMKMOZ8Xjg.png" /></figure><h3>Conclusion</h3><p>By moving Grafana into a private subnet and introducing an ALB and NAT Gateway, we significantly improve the security posture of the deployment:</p><ul><li>No direct internet exposure</li><li>Controlled ingress via ALB</li><li>Secure outbound access through NAT</li><li>Clear separation of responsibilities</li><li>A foundation for HTTPS, authentication, and WAF</li></ul><p>This architecture is a strong baseline for <strong>production-ready containerized workloads on AWS ECS</strong>.</p><p>In future articles, I’ll explore:</p><ul><li>HTTPS with ACM</li><li>IAM roles</li><li>Persistent storage</li><li>Restricting access with authentication and WAF</li></ul><p>Stay tuned 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db544e34eb24" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Aws Bill That Taught Me Cost Management The Hard Way]]></title>
            <link>https://medium.com/@rofiaadeola/the-aws-bill-that-taught-me-cost-management-the-hard-way-77807b19eb6f?source=rss-9f5705b7cbb8------2</link>
            <guid isPermaLink="false">https://medium.com/p/77807b19eb6f</guid>
            <dc:creator><![CDATA[Rofiat Adewunmi]]></dc:creator>
            <pubDate>Mon, 15 Dec 2025 05:02:57 GMT</pubDate>
            <atom:updated>2025-12-15T05:02:57.258Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>If you build on AWS, there’s a good chance this will sound familiar.</em></strong></p><p>There’s a very specific kind of pain that comes with seeing an AWS bill you <em>weren’t expecting</em>.</p><p>Not the kind where someone else messed up. Not the kind where you can escalate or blame a bug.</p><p>The kind where you look at the number… pause… refresh… and then realize:</p><p>“<strong><em>Ah. I did this to myself</em></strong>.”</p><p>I had spun up services casually, focused on getting things to <em>work</em>. I skimmed through pricing pages, nodded at words like <em>per hour</em>, <em>per GB</em>, <em>per request</em>, and told myself I’d “check later.” <strong><em>Later</em></strong> came with interest.</p><p>When the bill landed, my heart did that small shiver it does when reality hits. You know when people say <em>experience is the best teacher</em>? AWS cost management taught me that lesson loudly.</p><p>Trust me, <strong><em>It still ringsss in my head.</em></strong></p><p>Since then, I’ve developed a slightly traumatic habit: I constantly visit the <strong>Billing and Cost Management</strong> dashboard. Not because I enjoy it, but because I respect it now.</p><p>This article is about that lesson, and why <strong><em>costing is not optional when building on AWS</em></strong>.</p><h3>Why Cost Management Matters on AWS</h3><p>AWS gives you incredible power:</p><ul><li>Spin up infrastructure in minutes</li><li>Scale globally</li><li>Pay only for what you use</li></ul><p>That last point is both the <strong><em>magic</em></strong> and the <strong><em>danger</em></strong>.</p><p>AWS will not stop you from spending money. If your architecture is inefficient, your configurations are loose, or you simply forget to turn things off… AWS will happily keep running them.</p><p>Cost management is not just a finance concern. It’s an <strong><em>engineering responsibility</em></strong>.</p><h3>Understanding the AWS Billing &amp; Cost Management Dashboard</h3><p>The Billing dashboard is your first line of defense. It answers the most important questions:</p><ul><li>How much am I spending?</li><li>What services are costing me the most?</li><li>Is this expected?</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a2NrbLce3TT17hJU37tdwg.png" /><figcaption>The Billing dashboard gives you a high-level view of how much you’re spending</figcaption></figure><p>Here you’ll find:</p><ul><li>Current month-to-date spend</li><li>Forecasted costs based on usage trends</li><li>Service-level breakdowns</li></ul><p>If you only check your bill at the end of the month, <strong><em>you are already late</em></strong>…</p><h3>Cost Explorer: Where the Real Learning Happens</h3><p>AWS Cost Explorer is where cost management becomes practical.</p><p>It allows you to:</p><ul><li>Visualize costs over time</li><li>Group spending by service, account, region, or tag</li><li>Identify usage patterns and spikes</li></ul><p>This was where I truly understood <em>what</em> was draining my wallet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5yowJS_g2dcsH2xnaeUqQA.png" /></figure><p>Seeing a bar chart tell you that one “small” service accounted for most of your bill is a humbling experience.</p><p>With Cost Explorer, you can:</p><ul><li>Compare daily vs monthly trends</li><li>Identify unused or underutilized resources</li><li>Validate whether recent deployments increased costs</li></ul><p>If you’re building on AWS and not using Cost Explorer, <strong><em>you might just be driving with your eyes closed</em></strong>…</p><h3>Cost Analysis: Asking the Right Questions</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wbCKLbYgUxwWLw2vFVRV6w.png" /><figcaption>Filtering and drilling down helps turn vague costs into specific decisions.</figcaption></figure><p>Cost analysis is less about tools and more about <strong><em>intentional thinking</em></strong>.</p><p>Some questions I now ask regularly:</p><ul><li>Do I actually need this service running 24/7?</li><li>Is this the right pricing model (On-Demand vs Savings Plans vs Reserved Instances)?</li><li>Can this workload be optimized or right-sized?</li><li>Are there duplicate resources doing the same job?</li></ul><p>Cost analysis turns architecture reviews into cost-aware conversations.</p><h3>Cost Anomalies: Catching Problems Early</h3><p>One feature I wish I paid attention to earlier is Cost Anomaly Detection.</p><p>AWS can automatically:</p><ul><li>Learn your normal spending patterns</li><li>Detect unusual spikes</li><li>Alert you when costs exceed expected thresholds</li></ul><p>This is incredibly useful for:</p><ul><li>Unexpected traffic surges</li><li>Misconfigured services</li><li>Forgotten resources quietly running</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HljBQ0YBh0C2BAdDhHSXpQ.png" /></figure><p>It’s much easier to respond to a $3 spike than a $700 surprise at month-end.</p><h3>Dashboards: Making Cost Visibility a Habit</h3><p>Creating cost dashboards changed my behavior entirely.</p><p>Dashboards allow you to:</p><ul><li>Track key cost metrics at a glance</li><li>Monitor daily spend</li><li>Compare environments (dev vs prod)</li></ul><p>When cost visibility becomes part of your routine, decision-making improves.</p><p>You stop asking <em>“</em><strong><em>Can I deploy this?</em></strong><em>”</em> and start asking <em>“</em><strong><em>What will this cost me if I do?</em></strong><em>”</em></p><h3>Cost Is Part of Architecture</h3><p>The biggest mindset shift for me was this:</p><p><strong><em>If cost is not part of your design, it will become part of your problem.</em></strong></p><p>Every architectural decision has a cost implication:</p><ul><li>Instance types</li><li>Storage classes</li><li>Data transfer</li><li>Scaling strategies</li></ul><p>Good AWS architecture is guided by the <strong><em>AWS Well-Architected Framework</em></strong>, which is built on six pillars:</p><ul><li>Operational Excellence</li><li>Security</li><li>Reliability</li><li>Performance Efficiency</li><li><strong>Cost Optimization</strong></li><li>Sustainability</li></ul><h3>Wrapping It Up with the AWS Well-Architected Framework</h3><p>That unexpected AWS bill was annoying, yes. But it was also valuable.</p><p>Looking back, it didn’t just teach me to watch my spending, it forced me to rethink how I build on AWS.</p><p>The AWS Well-Architected Framework talks about building systems using six pillars, and one of them, often underestimated is the <strong>Cost Optimization Pillar</strong>.</p><p>Cost optimization isn’t about being cheap. It’s about:</p><ul><li>Understanding where your money is going</li><li>Choosing the right resource types and pricing models</li><li>Eliminating waste</li><li>Continuously reviewing and improving</li></ul><p>That framework made one thing very clear to me: <strong><em>cost is a first-class architectural concern</em></strong>, just like security, reliability, and performance.</p><p>When you design workloads with the Well-Architected Framework in mind, you naturally start asking better questions:</p><ul><li>Is this workload right-sized?</li><li>Can this scale dynamically instead of running constantly?</li><li>Do I have visibility into usage and spend?</li><li>How will this behave as usage grows?</li></ul><p>My unexpected AWS bill was painful, but it aligned me with this mindset early.</p><p>Today, visiting the Cost Management dashboard isn’t driven by fear.. it’s part of a deliberate, Well-Architected review process. Cost Explorer, anomaly detection, and dashboards are not afterthoughts; they are tools that support intentional design.</p><p>If you’re building on AWS, especially in your early stages, learn this lesson sooner than I did.</p><p>Use the AWS Well-Architected Framework as your guide. Because when cost is considered from the start, the bill stops being a surprise, and becomes just another metric you understand and control.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77807b19eb6f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying Grafana on AWS ECS Fargate: A Beginner-Friendly Guide]]></title>
            <link>https://medium.com/@rofiaadeola/deploying-grafana-on-aws-ecs-fargate-a-beginner-friendly-guide-8fdb51e0c2b5?source=rss-9f5705b7cbb8------2</link>
            <guid isPermaLink="false">https://medium.com/p/8fdb51e0c2b5</guid>
            <dc:creator><![CDATA[Rofiat Adewunmi]]></dc:creator>
            <pubDate>Mon, 08 Dec 2025 01:20:13 GMT</pubDate>
            <atom:updated>2026-03-29T16:27:22.604Z</atom:updated>
            <content:encoded><![CDATA[<p>Monitoring is an essential part of running applications in the cloud. Whether you’re tracking infrastructure metrics, visualizing logs, or exploring application performance, Grafana remains one of the most powerful open-source dashboards available today.</p><p>In this guide, I’ll walk you through how I deployed Grafana on AWS ECS (Elastic Container Service) using the Fargate launch type. This approach is ideal for beginners because it removes the need to manage servers, patch operating systems, or think about container orchestrator complexity.</p><p>This setup uses a very simple public-facing architecture, which makes it perfect for learning, testing, and experimenting. However, it is not production-secure, and I’ll publish a separate article soon detailing improved security (private subnets, load balancers, HTTPS, IAM roles etc.).</p><h3>Why ECS + Fargate?</h3><p>Before diving into the steps, here’s what each service brings to the architecture:</p><h3>Amazon ECS (Elastic Container Service)</h3><p>ECS is AWS’s fully managed container orchestration service. It helps you run Docker containers without managing Kubernetes clusters or control planes.<br>ECS handles:</p><ul><li>Scheduling where tasks run</li><li>Networking and scaling</li><li>Restarting unhealthy containers</li><li>Integrations with CloudWatch, IAM, ECR, etc.</li></ul><h3>AWS Fargate</h3><p>Fargate is a serverless compute engine for containers.<br> It removes the need to manage:</p><ul><li>EC2 instances</li><li>Clusters</li><li>Patching</li><li>Capacity provisioning</li></ul><p>You only define:</p><ul><li>How much CPU/memory your container needs</li><li>The Docker image</li><li>The networking configuration</li></ul><p>AWS handles the rest.</p><h3>Grafana</h3><p>Grafana is a visualization and dashboarding tool used by engineers, SREs, DevOps teams, and security analysts to monitor metrics and logs.<br> Common use cases include:</p><ul><li>Viewing metrics from Prometheus, CloudWatch, InfluxDB, Loki</li><li>Creating dashboards for infrastructure or application monitoring</li><li>Alerting based on thresholds</li><li>Observability and troubleshooting</li></ul><h3>What this architecture achieves</h3><p>In this article, we deploy Grafana on AWS using a simple architecture:</p><ul><li>A VPC with a public subnet</li><li>An Internet Gateway (so the task is reachable)</li><li>An ECS Fargate task running the Grafana container</li><li>A security group allowing access on port 3000</li><li>Public access to Grafana through the task’s public IP address</li></ul><p>This is perfect for:</p><ul><li>Learning AWS networking</li><li>Understanding ECS task networking (awsvpc mode)</li><li>Deploying your first container on AWS</li><li>Running quick tests or demos</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*miqwBTbYrF17HCuVOzs6iQ.png" /><figcaption><strong>Architecture Diagram</strong></figcaption></figure><h3>Step-by-Step Guide: Deploying Grafana on ECS Fargate</h3><p>Below is the exact process I followed.</p><h3>1. Create a VPC with a Public Subnet</h3><p>Create a VPC (you can use the VPC wizard or manually create one)<br> Include:</p><ul><li>One public subnet</li><li>An Internet Gateway (IGW) attached to the VPC</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rdwRML4WALkm7p75rO80Mg.png" /></figure><p>This allows inbound and outbound internet traffic.</p><h3>2. Create a Route Table</h3><p>Create a new route table and add:</p><ul><li>Destination: 0.0.0.0/0</li><li>Target: Internet Gateway</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s3tVCNqdJsj7gjTmMfTnLA.png" /></figure><p>This ensures traffic can reach the internet.</p><h3>3. Associate the Route Table with the Public Subnet</h3><p>Select your public subnet and associate it with the route table you created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZMU3mSJfq8gIYpLySFNmZQ.png" /></figure><p>This converts the subnet into a <em>true</em> public subnet.</p><h3>4. Create a Security Group</h3><p>Create a security group allowing traffic to the Grafana UI:</p><ul><li><strong>Inbound:</strong></li><li>Port: 3000</li><li>Source: 0.0.0.0/0 (open to the internet — again, not production secure)</li><li><strong>Outbound:</strong></li><li>Allow all traffic (default)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RXK-jdNVl9WtbRz7CWh6jw.png" /></figure><h3>5. Create an ECS Cluster (Fargate)</h3><p>Navigate to ECS → Clusters → Create cluster.<br> Choose:</p><ul><li>Fargate</li><li>Default settings</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WtTeZnnSE-tLui6r3lDthQ.png" /></figure><h3>6. Create a Task Definition</h3><p>Go to Task Definitions → Create New<br> Select:</p><ul><li>Fargate launch type</li><li>Specify CPU/memory (e.g., 0.25 vCPU, 1GB RAM)</li></ul><p>Add a container:</p><ul><li>Image: grafana/grafana</li><li>Port Mapping: 3000 (container port)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NSZKQviq7sk01xu31AXvQQ.png" /></figure><p>Save the task definition.</p><h3>7. Run the Task</h3><p>Now run your Grafana container:</p><ul><li>ECS → Cluster → Run Task</li><li>Launch type: Fargate</li><li>VPC: select the one you created</li><li>Subnet: public subnet</li><li>Security group: the SG created in step 4</li><li>Auto-assign public IP: ENABLED</li></ul><p>Run the task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lsbJ8dHJdAXmJ4cgGh4mEQ.png" /></figure><h3>8. Access Grafana UI</h3><p>Once the task is running:</p><ol><li>Open the task details</li><li>Scroll down to the network section</li><li>Copy the public IPv4 address</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NHW4tdSYkznA0LkBGCGSfg.png" /></figure><p>Open in browser: http://&lt;public-ip&gt;:3000</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C6tun0ruxGKxs0-wDMPA_A.png" /></figure><p>Default login credentials:</p><p>Username: admin, Password: admin</p><h3>Conclusion</h3><p>This deployment approach is intentionally simple and perfect for learning. It helps you understand:</p><ul><li>How ECS Fargate tasks are networked</li><li>How containers run serverlessly on AWS</li><li>How to expose an application publicly</li><li>Basic AWS VPC + subnet setup</li></ul><p>However, <strong>this setup is not production secure</strong>.<br>It exposes Grafana directly to the internet, has no authentication boundaries, and does not preserve Grafana data long-term.</p><p>In my follow up article, I cover a more secure and production-ready architecture. Click <a href="https://medium.com/@rofiaadeola/securing-grafana-on-aws-ecs-with-alb-and-nat-gateway-db544e34eb24">here</a> to read.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8fdb51e0c2b5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>