<?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 Oluwajuwon Ajana on Medium]]></title>
        <description><![CDATA[Stories by Oluwajuwon Ajana on Medium]]></description>
        <link>https://medium.com/@oluwajuwonajana?source=rss-4632e826cff7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*mOg6JJ3GtjysH-R3ZGG_XA@2x.jpeg</url>
            <title>Stories by Oluwajuwon Ajana on Medium</title>
            <link>https://medium.com/@oluwajuwonajana?source=rss-4632e826cff7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 16:03:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@oluwajuwonajana/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[Pt2 — Building a Cloud Operations Platform: Week 1 and Week 2 Technical Walkthrough]]></title>
            <link>https://medium.com/@oluwajuwonajana/cloud-operations-platform-technical-walkthrough-pt2-f1142ff22b5f?source=rss-4632e826cff7------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1142ff22b5f</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Oluwajuwon Ajana]]></dc:creator>
            <pubDate>Mon, 07 Sep 2026 18:36:41 GMT</pubDate>
            <atom:updated>2026-09-07T18:36:41.407Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*26GYSlgUDJ3bCxx75TEVtA.png" /></figure><p><em>This is Part 2 of the cloud-ops-platform build series. For the project overview, goals, and alignment with the Well-Architected Framework, see </em><a href="https://medium.com/@oluwajuwonajana/building-a-production-grade-cloud-operations-platform-e7140996afdb"><strong><em>Part 1</em></strong></a><em>.</em></p><p><strong><em>GitHub repo: </em></strong><a href="https://github.com/AjanaLarry/cloud-ops-platform"><strong><em>github.com/cloud-ops-platform</em></strong></a></p><h3>What this article covers</h3><p>The exact steps taken to build the Week 1 and Week 2 infrastructure for the cloud-ops-platform project, including every console step, every CLI command, every challenge encountered, and how it was resolved.</p><p>This is not a polished tutorial. It is a working journal of what actually happened, including blockers that arise in a real build and never appear in the documentation.</p><p><strong>Week 1 — VPC foundation:</strong> VPC · subnets · internet gateway · NAT gateways · route tables · account hardening</p><p><strong>Week 2 — Compute, database, storage, monitoring:</strong> Security groups · EC2 + nginx · RDS PostgreSQL · S3 bucket · CloudWatch alarm</p><h3>Before starting — account setup and hardening</h3><p>Every new AWS account ships in a minimal, unsecured state. Before creating any infrastructure resources, the account needs to be hardened. This takes about 30 minutes and prevents the most common account compromise and runaway cost scenarios.</p><h3>Root user security</h3><p>The root user has unrestricted access to everything in the account, including billing, account closure, and support plan changes. The first thing to do on any new account:</p><ol><li><strong>Enable MFA on root:</strong> go to Security Credentials → Multi-factor authentication → Assign MFA device → Authenticator app → scan QR code with Google Authenticator or Authy</li><li><strong>Delete root access keys:</strong> Security Credentials → Access keys → Delete any that exist</li><li>Store the root password in a password manager and never use it for daily work again</li></ol><h3>IAM users</h3><p>Two IAM users are created following least privilege:</p><p><strong>Admin user (</strong><strong>name-admin): </strong>full AWS access with MFA required. Policies attached: AdministratorAccess + Billing. Used for console work.</p><p><strong>Dev user (</strong><strong>name-dev): </strong>scoped permissions for infrastructure work only. Policies attached: PowerUserAccess VPC, EC2, RDS, S3, DynamoDB, CloudWatch, IAM, KMS. Access keys only, no console access. Used for CLI and Terraform.</p><h3>Billing protection</h3><p>Four controls are set up before any resources are created:</p><ul><li><strong>Enable IAM access to billing:</strong> Account → IAM user and role access to Billing → Activate</li><li><strong>Enable CloudWatch billing alerts: </strong>Billing Preferences → Receive CloudWatch billing alerts</li><li>Create billing alarm at $10 USD — CloudWatch in us-east-1 (billing metrics are global, only in us-east-1)</li><li>Create an AWS Budget at $10/month with 80% alert threshold</li></ul><p><strong>Challenge encountered:</strong> Billing metrics did not initially appear in CloudWatch.</p><ul><li><strong>Root cause: </strong>Billing alerts must be explicitly enabled in Billing Preferences — they are off by default. Additionally, billing is a global service, and metrics are only available in us-east-1, regardless of which region your workload runs in.</li><li><strong>Fix:</strong> Enable billing alerts in Billing Preferences, switch console region to us-east-1, wait 15 minutes for metrics to populate, create the alarm, switch back to ca-central-1.</li></ul><h3>Security services</h3><p>Two services are enabled immediately on account creation:</p><p><strong>CloudTrail: </strong>records every API call in the account. Created a trail logging to S3. Without CloudTrail, if something goes wrong (unexpected charges, accidental deletion, a security incident), there is no way to know what happened.</p><p><strong>GuardDuty: </strong>ML-powered threat detection watching CloudTrail logs, VPC Flow Logs, and DNS logs for anomalies. One button to enable, 30-day free trial on every new account.</p><h3>Week 1 — VPC foundation</h3><h3>Architecture being built</h3><pre>Internet<br>    │<br>    ▼<br>Internet Gateway (cloud-ops-platform-igw-dev)<br>    │<br>    ├─────────────────────────────────────┐<br>    ▼                                     ▼<br>Public Subnet A (10.0.1.0/24)     Public Subnet B (10.0.2.0/24)<br>ca-central-1a                      ca-central-1b<br>NAT Gateway A · Elastic IP         NAT Gateway B · Elastic IP<br>    │                                     │<br>    ▼                                     ▼<br>Private App A (10.0.11.0/24)      Private App B (10.0.12.0/24)<br>ca-central-1a                      ca-central-1b</pre><p>All resources tagged with: Project=cloud-ops-platform, Environment=dev, ManagedBy=console, Owner=juwon</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n4o74fuMxglBUixEiPkqZw.png" /></figure><h3>VPC</h3><p>Created via VPC console → Create VPC → VPC only (not the wizard — the wizard creates things you do not understand yet).</p><ul><li>Name: cloud-ops-platform-vpc-dev</li><li>CIDR: 10.0.0.0/16 — gives 65,536 addresses for subnets to carve into</li><li>DNS hostnames: Enabled</li><li>DNS resolution: Enabled</li></ul><p>Both DNS settings must be explicitly enabled after creation. Without DNS hostnames, EC2 instances do not get public DNS names. Without DNS resolution, AWS service endpoints cannot be resolved by name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*tXAw-P-6SuUVE8027ejk1g.png" /></figure><h3>Subnets</h3><p>Four subnets created in one session (Add new subnet button adds multiple subnets without closing the form):</p><p>Subnet CIDR AZ Tier:</p><p>cloud-ops-platform-public-subnet-1a 10.0.1.0/24 ca-central-1a Public cloud-ops-platform-public-subnet-1b 10.0.2.0/24 ca-central-1b Public cloud-ops-platform-private-app-1a 10.0.11.0/24 ca-central-1a Private cloud-ops-platform-private-app-1b 10.0.12.0/24 ca-central-1b Private</p><p>To leave room for additional subnet tiers (data subnets, management subnets) without renumbering, I added the gap between 10.0.2.x and 10.0.11.x. Renumbering a live VPC is expensive and disruptive.</p><p>Auto-assign public IPv4 enabled on both public subnets. Never enable this on private subnets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*qyUvpHzw8z_TNZ_5vbU-kw.png" /></figure><h3>Internet Gateway</h3><p>Created and immediately attached to the VPC. The attach step is separate from the create step — a common place to miss. The status must show Attached before proceeding.</p><h3>Elastic IPs and NAT Gateways</h3><p>Two Elastic IPs allocated, one per NAT Gateway, one per AZ.</p><p><strong>Challenge encountered:</strong> The NAT Gateway creation interface included new fields not documented: Availability mode (Regional vs Zonal) and Method of EIP allocation (Automatic vs Manual).</p><p>Decision made: Zonal + Manual for both NAT Gateways.</p><p>The reason: Zonal provides explicit per-AZ control, which aligns with AWS Well-Architected reliability best practices. If AZ-A fails and the NAT Gateway is there, AZ-B traffic should not lose outbound connectivity. Regional mode manages this automatically, but obscures the failure-domain logic (understanding failure domains is the point of this build). Manual EIP allocation assigns the specific IPs you already allocated.</p><p>Both NAT Gateways take 2–3 minutes to show as Available. Do not create route tables until both show as Available — the NAT GW IDs are needed as targets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*zjmx5J28kABE-GDxq0FIfw.png" /></figure><h3>Route tables</h3><p>Three route tables created:</p><ul><li><strong>Public route table:</strong> one 0.0.0.0/0 route pointing to the IGW. Associated with both public subnets.</li><li><strong>Private route table A: </strong>one 0.0.0.0/0 route pointing to NAT GW A. Associated with private-app-1a only.</li><li><strong>Private route table B</strong>: one 0.0.0.0/0 route pointing to NAT GW B. Associated with private-app-1b only.</li></ul><p>The per-AZ private route table pattern means private subnet A routes outbound traffic through NAT GW A in the same AZ. If AZ-A fails, private subnet B still has outbound connectivity through NAT GW B — the traffic never crosses AZ boundaries unnecessarily.</p><p><strong>Verification:</strong> VPC → Resource map tab shows all subnets, route tables, and network connections visually connected. This is the fastest way to confirm the architecture is correct before touching the CLI.</p><p>CLI verification:</p><pre>aws ec2 describe-route-tables \<br>  --filters &quot;Name=tag:Project,Values=cloud-ops-platform&quot; \<br>  --query &quot;RouteTables[*].{Name:Tags[?Key==&#39;Name&#39;].Value|[0],Routes:Routes[*].{Dest:DestinationCidrBlock,Target:GatewayId||NatGatewayId}}&quot; \<br>  --output json \<br>  --region ca-central-1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PpYI8okUAifyEucV-kL6Rg.png" /></figure><h3>Week 2 — Compute, database, storage, monitoring</h3><h3>Security groups — built first</h3><p>Security groups must exist before launching EC2 or RDS, as you cannot attach a group that does not exist.</p><p><strong>EC2 security group (</strong><strong>cloud-ops-platform-ec2-sg):</strong></p><p>Type Port Source:</p><ul><li>HTTP 80 0.0.0.0/0</li><li>HTTPS 443 0.0.0.0/0</li><li>SSH 22 My IP (your current public IP as /32)</li></ul><p><strong>Challenge encountered:</strong> The SSH source “My IP” in the AWS console shows your public internet IP (e.g., 142.113.205.119/32) and not your local private IP (192.168.x.x) visible in Mac network settings.</p><ul><li>Home routers use NAT, which means your Mac has a private IP on the local network but presents a single public IP to the internet.</li></ul><p>AWS can only see the public IP. The /32 prefix means exactly that one address.</p><p><strong>Additional gotcha:</strong> home ISP IPs are typically dynamic — they change on router restart. If SSH stops working with a connection timed out, run curl ifconfig.me to check your current public IP and update the security group rule.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FTIFAr8D8hk37j7rlqgMWg.png" /></figure><p><strong>RDS security group (</strong><strong>cloud-ops-platform-rds-sg):</strong></p><p>Type Port Source:</p><ul><li>PostgreSQL 5432 cloud-ops-platform-ec2-sg (the SG ID, not an IP)</li></ul><p>This is security group chaining. The inbound source is not an IP range; it is the EC2 security group ID. Any EC2 instance in that group is automatically granted access. Any instance not attached is automatically denied, even from within the same VPC. This is the correct production pattern for service-to-service communication (IP-based rules break when instances are replaced, scaled, or get new addresses).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7vcNWenEYBiPhvzorgnZhQ.png" /></figure><h3>EC2 — key pair and launch</h3><p><strong>Key pair created first:</strong></p><ul><li>Name: cloud-ops-platform-key</li><li>Type: ED25519 (modern elliptic curve and it’s more secure and shorter than RSA 2048)</li><li>Format: .pem (for macOS Terminal)</li></ul><p><strong>Challenge encountered:</strong> ~/.ssh directory did not exist on a fresh Mac.</p><p><strong>Fix:</strong></p><pre>mkdir -p ~/.ssh<br>chmod 700 ~/.ssh<br>mv ~/Downloads/cloud-ops-platform-key.pem ~/.ssh/<br>chmod 400 ~/.ssh/cloud-ops-platform-key.pem</pre><p>SSH enforces strict permission checks. If the key file or the .ssh directory has permissions that are too open, SSH exits with &quot;permissions are too open&quot; and refuses to connect. chmod 400 means only the owner can read — no write, no execute for anyone.</p><p><strong>EC2 launch configuration:</strong></p><ul><li>AMI: Amazon Linux 2023 (AWS-maintained, free, SSM Agent pre-installed)</li><li>Instance type: t2.micro (free tier eligible)</li><li>Subnet: public-subnet-1a</li><li>Auto-assign public IP: Enable</li><li>Security group: cloud-ops-platform-ec2-sg</li><li>Key pair: cloud-ops-platform-key</li></ul><p><strong>User data script that installs nginx automatically at first boot:</strong></p><pre>#!/bin/bash<br>dnf update -y<br>dnf install -y nginx<br>systemctl start nginx<br>systemctl enable nginx<br>cat &gt; /usr/share/nginx/html/index.html &lt;&lt; &#39;EOF&#39;<br>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>&lt;head&gt;&lt;title&gt;cloud-ops-platform&lt;/title&gt;&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;h1&gt;cloud-ops-platform&lt;/h1&gt;<br>  &lt;p&gt;EC2 · ca-central-1a · Week 2 · nginx is running&lt;/p&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;<br>EOF<br>echo &quot;User data completed at $(date)&quot; &gt;&gt; /var/log/user-data-complete.log</pre><p>User data runs exactly once (on first boot only). The systemctl enable nginx line ensures nginx starts automatically on every subsequent reboot without needing the user data script to run again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*buxBD7Npz4EPU4Qru52sIg.png" /></figure><p><strong>SSH and verification:</strong></p><pre># Wait for 2/2 status checks to pass before SSHing<br>ssh -i ~/.ssh/cloud-ops-platform-key.pem ec2-user@YOUR_PUBLIC_IP</pre><pre># Inside the instance<br>sudo systemctl status nginx<br>cat /var/log/user-data-complete.log</pre><p>Nginx welcome page confirmed in the browser at <a href="http://your_public_ip./">http://YOUR_PUBLIC_IP.</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CE9f91xEuoL7d0t29_fHPg.png" /></figure><h3>RDS PostgreSQL</h3><p><strong>DB subnet group created first</strong>: RDS requires a subnet group spanning at least two AZs before launch. This is not optional, even on the free tier.</p><ul><li>Name: cloud-ops-platform-db-subnet-group</li><li>VPC: cloud-ops-platform-vpc-dev</li><li>Subnets: private-app-1a + private-app-1b (both AZs)</li></ul><p><strong>RDS instance:</strong></p><ul><li>Engine: PostgreSQL 16</li><li>Template: Free tier (db.t3.micro, single AZ, 20 GiB)</li><li>DB identifier: cloud-ops-platform-postgres-dev</li><li>Master username: postgres</li><li>VPC: cloud-ops-platform-vpc-dev</li><li>Subnet group: cloud-ops-platform-db-subnet-group</li><li>Public access: <strong>No</strong> (this is the single most important RDS security setting)</li><li>Security group: cloud-ops-platform-rds-sg (removed the default SG)</li><li>Initial database name: cloudopsdb</li><li>Backup retention: 7 days</li><li>Storage encryption: Enabled</li><li>Deletion protection: Enabled</li></ul><p>RDS takes 5–10 minutes to provision. Start it, then build S3 in a separate tab while waiting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*Ur_KlxSowru5H1L4jlG75Q.png" /></figure><p><strong>Connectivity test from EC2:</strong></p><pre># SSH into EC2 first<br>ssh -i ~/.ssh/cloud-ops-platform-key.pem ec2-user@YOUR_EC2_IP</pre><pre># Install PostgreSQL client<br>sudo dnf install -y postgresql16</pre><pre># Connect to RDS<br>psql --host=YOUR_RDS_ENDPOINT --port=5432 \<br>     --username=postgres --dbname=cloudopsdb</pre><pre># Inside psql — create and query a test table<br>CREATE TABLE week2_test (id SERIAL PRIMARY KEY, message TEXT);<br>INSERT INTO week2_test (message) VALUES (&#39;Week 2 RDS build complete&#39;);<br>SELECT * FROM week2_test;<br>\q</pre><p><strong>This proves the full chain:</strong> Mac → SSH → EC2 (public subnet) → psql → RDS (private subnet). The EC2-to-RDS traffic uses the VPC local route, so it never touches the NAT Gateway and never leaves the VPC.</p><h3>S3 bucket</h3><ul><li>Name: cloud-ops-platform-app-assets-ACCOUNTID</li><li>Region: ca-central-1</li><li>Block all public access: all four options checked</li><li>Versioning: Enabled</li><li>Default encryption: SSE-S3 (AES-256) with Bucket Key enabled</li></ul><p><strong>Lifecycle rule (archive-to-glacier):</strong></p><ul><li>Current versions: transition to Glacier Flexible Retrieval after 30 days</li><li>Noncurrent versions: transition to Glacier Flexible Retrieval after 7 days</li></ul><p><strong>Cost impact:</strong> Glacier Flexible Retrieval costs ~$0.004/GB/month vs S3 Standard at ~$0.025/GB/month (approximately 84% cheaper for data you rarely access). Old log files, archived assets, and previous object versions are good candidates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U7eU5GArweV52_06jjPtyg.png" /></figure><p><strong>Important about versioning:</strong> Deleting a versioned object adds a delete marker, but the object is not actually gone. All previous versions still exist and are still charged. The lifecycle rule handles this by archiving noncurrent versions to Glacier after 7 days rather than leaving them in Standard storage indefinitely.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o9okNEFYjSm_liqHhdulvQ.png" /></figure><h3>CloudWatch CPU alarm</h3><ul><li>Metric: CPUUtilization · namespace AWS/EC2 · your instance ID</li><li>Statistic: Average</li><li>Period: 5 minutes</li><li>Threshold: Greater than 80</li><li>Datapoints to alarm: 2 out of 2</li><li>Action: notify billing-alerts SNS topic</li></ul><p>The 2-out-of-2 data-point setting means that 10 consecutive minutes above 80% CPU trigger the alarm, and not a single 5-minute spike. This dramatically reduces false alerts while still catching genuine sustained load.</p><p>New alarms always start in the INSUFFICIENT_DATA state because CloudWatch needs at least 2 evaluation periods (10 minutes) of data before it can determine OK or ALARM. This is expected behavior, not an error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/1*kvll_FRmOxk_laUXXLhhTA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MTuSd-7Q1eGoFqrbq88ZUw.png" /></figure><h3>Cost management during development</h3><p>NAT Gateways charge $0.045 USD/hour each (regardless of traffic), which is approximately $66 CAD/month for two running continuously. During development, delete them after each session and recreate them when returning.</p><p><strong>Important gotcha when recreating NAT Gateways:</strong> New NAT Gateways get new resource IDs. Private route tables still point to the old deleted IDs. After recreating, always update both private route tables with the new NAT GW IDs; otherwise, private subnets silently lose outbound connectivity.</p><p>This is the exact problem Terraform solves in Week 3: resource recreation and dependency updates are handled automatically, and there is no manual route table hunting.</p><h3>GitHub repo</h3><p>Every week produces a commit with:</p><ul><li>Console screenshots in docs/screenshots/weekN/</li><li>Updated README build log</li><li>New entries in ops/CHALLENGES.md</li><li>Updated the architecture diagram in docs/</li></ul><p><strong><em>Repo: </em></strong><a href="https://github.com/AjanaLarry/cloud-ops-platform"><strong><em>github.com/cloud-ops-platform</em></strong></a></p><h3>What is next</h3><p><strong>Week 3 — Terraform:</strong> Everything built manually in Weeks 1 and 2 gets rebuilt as Terraform code. VPC, subnets, IGW, NAT Gateways, EC2, RDS, S3, and CloudWatch are all defined as modules with remote state stored in S3 with DynamoDB locking. The console build was for understanding. Terraform is for depth.</p><p><em>Part of the cloud-ops-platform public build journal.</em> <em>Part 1: </em><a href="https://medium.com/@oluwajuwonajana/building-a-production-grade-cloud-operations-platform-e7140996afdb"><em>Building a Production-Grade Cloud Operations Platform</em></a>. <em>GitHub: </em><a href="https://github.com/AjanaLarry/cloud-ops-platform"><em>github.com/cloud-ops-platform</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1142ff22b5f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Production-Grade Cloud Operations Platform: Here’s Exactly How I’m Thinking About It]]></title>
            <link>https://medium.com/@oluwajuwonajana/building-a-production-grade-cloud-operations-platform-e7140996afdb?source=rss-4632e826cff7------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7140996afdb</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Oluwajuwon Ajana]]></dc:creator>
            <pubDate>Mon, 07 Sep 2026 17:04:00 GMT</pubDate>
            <atom:updated>2026-09-07T18:39:53.481Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why certifications alone don’t prove you can build</h3><p>I held five cloud certifications at one point. AWS Solutions Architect Associate, AWS Developer Associate, Azure Developer, Azure DevOps Expert, Terraform Associate. I studied hard, passed the exams, and added the badges to my LinkedIn profile.</p><p>Then someone asked me: “Tell me about a cloud system you built and owned end-to-end.”</p><p>I didn’t have a good answer. Not a real one.</p><p>That’s the gap nobody talks about when they sell you the certification path. The cert proves you can read documentation and pass a multiple-choice exam. It also gets you past the ATS filter; however, what it doesn’t prove (and what actually matters when you’re working in Cloud or DevOps) is whether you can build, operate, and reason about a real system under pressure.</p><p>So I’m doing something different this time. I’m building a production-grade Cloud Operations Platform on AWS, spanning networking foundations, Kubernetes, CI/CD, observability, and AI-assisted incident response.</p><p>This article is the overview of what I’m building and why I’m building it this way. If you want the actual technical walkthrough of Week 1 and Week 2 (the VPC, EC2, RDS, S3, and CloudWatch setup), that’s in <strong>Part 2 of this series</strong>.</p><h3>Why one deep project beats ten tutorial exercises</h3><p>The question that actually reveals whether someone can do the work isn’t “what certifications do you hold?” It’s “walk me through a system you built.”</p><p>That question needs a 20-minute answer. It needs a GitHub link. It needs an architecture diagram you can pull up and explain. It needs a postmortem document that shows you’ve considered what broke and why.</p><p>A list of certifications doesn’t answer it. Neither does a collection of disconnected tutorial projects where you followed someone’s YouTube guide and deployed a hello-world app. Those aren’t systems, they’re exercises.</p><p>One layered, real platform does answer it. Because you can pull up the repo and say: “Here’s the system. Here’s the networking decision I made and why. Here’s what broke in week three and how I fixed it. Here’s how I’d operate this if it were running production traffic.”</p><p>That’s what builds real depth.</p><p>The certifications still matter as a foundation. Here’s how I’m sequencing them alongside the build:</p><ol><li><strong>AWS Solutions Architect Associate: </strong>recertification alongside Month 1–2</li><li><strong>Certified Kubernetes Administrator (CKA): </strong>Month 3, when I’m actually running Kubernetes</li><li><strong>AWS DevOps Engineer Professional: </strong>Month 5–6, after CI/CD and observability are live</li></ol><p>The timing is deliberate. Study for the cert while you’re building the thing the cert covers. The concepts stick because you’re applying them the same week you’re learning them.</p><h3>What I’m building and why it’s structured this way</h3><p>The project is called <strong>cloud-ops-platform</strong>, and it lives at <a href="https://github.com/AjanaLarry/cloud-ops-platform"><strong>github.com/cloud-ops-platform</strong></a><strong>.</strong></p><p>Instead of six disconnected tutorial projects, everything connects into one system. Each month adds a layer on top of what already exists. By the end, you have one cohesive platform you can explain from the network layer up to the application layer, which is exactly what a Platform Engineering or SRE team owns in production.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*8BznYegs7AkbBOu6.png" /></figure><p><strong>Why this order?</strong> You can’t run containers on infrastructure you don’t understand. You can’t debug a Kubernetes networking issue if you’ve never set up a VPC. You can’t write meaningful runbooks for systems you haven’t operated. The foundation has to come first, not because it’s more important, but because everything else depends on it being solid.</p><p>By Month 6, the platform will have:</p><ul><li>A production-grade AWS environment built entirely as Terraform code, which means no manual console changes</li><li>A Kubernetes cluster running containerized workloads with auto-scaling</li><li>Full observability: metrics, alerts, dashboards, and SLO tracking</li><li>An AI-powered incident summariser that takes CloudWatch log anomalies, sends them through Lambda to the GPT API, and delivers readable summaries to Slack so you’re not parsing raw logs at 2 a.m.</li><li>A security posture aligned to the CIS AWS Foundations Benchmark</li><li>A GitHub repo that tells the whole story, commit by commit</li></ul><h3>The design framework: AWS Well-Architected</h3><p>Every decision in this build is made against the AWS Well-Architected Framework. If you haven’t encountered it yet, here’s the short version: AWS publishes six design pillars that describe how production systems should be built. Senior Cloud and DevOps engineers think in these terms constantly. Learning to reason through them is one of the fastest ways to close the gap between “I took the course” and “I can design systems.”</p><p>Here’s how each pillar is shaping the build with the reasoning behind each decision, not just the decision itself:</p><p><strong>Operational Excellence:</strong> Everything is infrastructure-as-code from day one. No manual console changes after the initial build. Why? Because if you click through the console to create resources, you can’t reproduce them, you can’t review them, and you can’t audit what changed. GitHub Actions runs lint → plan → apply on every commit. CloudTrail logs every API call. Systems Manager replaces SSH, so there are no keys to manage, and every session is automatically audited.</p><p><strong>Security:</strong> Defense in depth at every layer. WAF and Shield at the edge. Security groups and NACLs at the network level. KMS encryption for all data at rest. Secrets Manager for credentials with automatic 30-day rotation. GuardDuty for ML-powered threat detection. The principle: no single misconfiguration should expose the entire system.</p><p><strong>Reliability:</strong> The platform is designed to survive an Availability Zone failure. Two AZs, two NAT Gateways, RDS Multi-AZ, Auto Scaling Group, cross-zone load balancing. If AWS loses an entire data center, the system keeps running. This sounds advanced, but the underlying concepts are things you can understand and explain by Month 1.</p><p><strong>Performance Efficiency:</strong> CloudFront at the edge reduces load on the origin servers. Auto Scaling adds capacity when demand spikes and removes it when demand drops. VPC Gateway Endpoints route S3 and DynamoDB traffic through the AWS backbone rather than the NAT Gateway, making it both faster and cheaper. Small decisions like this one are what separate people who’ve built real systems from people who’ve only followed tutorials.</p><p><strong>Cost Optimization:</strong> AWS Budgets alerts at 80% of $10/month. This is the first thing I set up, and I’d recommend you do the same. Your first unexpected bill will happen not because you did something wrong, but because you forgot to stop an RDS instance over the weekend. VPC Endpoints eliminate NAT Gateway data charges for S3 and DynamoDB. EC2 and RDS are stopped between dev sessions. S3 Lifecycle rules archive logs to Glacier after 90 days at 84% lower storage cost.</p><p><strong>Sustainability:</strong> Auto Scaling scales to minimum capacity after hours, so no idle compute runs overnight. Managed services like RDS run at substantially higher fleet utilization rates than running the same workload on an EC2 instance you manage yourself. Knowing this pillar exists and being able to reason through it signals the kind of systems thinking that experienced engineers care about.</p><h3>What I’ve built so far</h3><p><strong>Week 1 — VPC foundation (complete)</strong></p><p>A production-grade Virtual Private Cloud in an AWS region ca-central-1 with:</p><ul><li>Four subnets across two Availability Zones, public and private in each AZ</li><li>Internet Gateway for inbound web traffic</li><li>Two NAT Gateways, one per AZ, for outbound private traffic. Two NAT Gateways cost more than one, but with one, your private subnets lose internet access if that AZ goes down. That’s the trade-off.</li><li>Three route tables wiring everything together correctly</li><li>Full account hardening, root MFA enabled, IAM admin and dev users created, billing alerts set, CloudTrail and GuardDuty activated</li></ul><p><strong>Week 2 — Compute, database, storage, and monitoring (complete)</strong></p><ul><li>EC2 instance running nginx, installed automatically via user data script so the server configures itself on boot, which is how you’d do it in a real environment</li><li>RDS PostgreSQL is deployed into the private subnet, connectivity verified from EC2; the database is never directly accessible from the internet</li><li>S3 bucket with versioning enabled, SSE-S3 encryption, and a Glacier lifecycle rule. Versioning means nothing is ever truly deleted; you can always recover a previous state.</li><li>CloudWatch CPU alarm with SNS email notification, tested end-to-end. A simple alarm now, full SLO tracking by Month 4.</li></ul><p>Every resource is tagged consistently. This sounds like a minor detail until you get your first AWS bill with 40 line items and no idea which resource is costing you money.</p><h3>What’s next</h3><p>Week 3 is Terraform, converting everything built manually in Weeks 1 and 2 into infrastructure as code. This is where the platform starts to look like something a real team would actually maintain. No more clicking through the console; every resource is declared, version-controlled, and reproducible from a single terraform apply.</p><p>Week 4 delves deeper into the hands-on build: IAM roles, CloudWatch log groups, Bash health-check scripts, and the Month 1 capstone review. The technical walkthrough of all four weeks, every step, every command, every mistake, will be in the follow-up articles in this series.</p><p>The GitHub repo is public: <a href="https://github.com/AjanaLarry/cloud-ops-platform"><strong><em>github.com/cloud-ops-platform</em></strong></a></p><p>The technical walkthrough of Week 1 and Week 2, every console step, every CLI command, every challenge encountered, is in <a href="https://medium.com/@oluwajuwonajana/cloud-operations-platform-technical-walkthrough-pt2-f1142ff22b5f"><strong>Part 2</strong></a><strong> </strong>of this series.</p><p>If you’re working in Cloud or DevOps and want to exchange ideas, connect with me on <a href="https://www.linkedin.com/in/oluwajuwon-ajana/">LinkedIn</a>. I’m not here to collect followers, I’m here to connect with people who are actually building.</p><p><em>Building cloud-ops-platform · AWS · Terraform · Kubernetes · ca-central-1</em> <em>Weekly build updates with real screenshots, real challenges, real progress.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7140996afdb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Micro-blogging Platform on AWS]]></title>
            <link>https://medium.com/@oluwajuwonajana/building-a-micro-blogging-platform-part-1-947e31e3ba6f?source=rss-4632e826cff7------2</link>
            <guid isPermaLink="false">https://medium.com/p/947e31e3ba6f</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[projects]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Oluwajuwon Ajana]]></dc:creator>
            <pubDate>Sat, 25 Feb 2023 08:12:15 GMT</pubDate>
            <atom:updated>2023-02-25T08:12:15.176Z</atom:updated>
            <content:encoded><![CDATA[<p>Are you a techie, or are you starting a career in cloud computing? Starting a career in the cloud can be a rewarding and challenging journey. In today’s cloud-based world, there are so many technology and cloud platforms to choose from that it gets complicated to know where to begin. The first step is to choose a cloud services provider, such as Amazon Web Services (AWS), Microsoft Azure, or Google Cloud Platform. Once you have selected a platform, it is essential to familiarize yourself with the different services and tools available. One way to do this is to start with small, simple projects and gradually progress to more complex applications.</p><p>Recently, I was privileged to join a Free Cloud Project Bootcamp organized by <a href="https://www.linkedin.com/in/andrew-wc-brown/"><strong>Andrew Brown</strong></a> (AWS Community Hero) and his team at ExamPro. This Bootcamp is a 14/15 weeks-long cloud development project series live on YouTube and has a community on Discord. I will be creating weekly articles here as we progress to serve as a guide, and also I have attached <a href="https://www.youtube.com/watch?v=SG8blanhAOg&amp;list=PLBfufR7vyJJ7k25byhRXJldB5AiwgNnWv&amp;index=13"><strong>Week_0 videos</strong></a> here.</p><p>In this series, we will build a micro-blogging platform (similar to Twitter but emphasizing privacy and time-to-live capabilities) using AWS cloud services and other 3rd party software. Whether you are a seasoned developer or just starting with cloud computing, AWS provides a wealth of resources and tools to help you build, deploy, and scale your applications. This week, we will explore some considerations for starting a project on AWS, including choosing the right services, configuring your environment, and optimizing for performance and cost-effectiveness.</p><h3>Learning Objectives</h3><p>Here are some learning objectives for this series:</p><ul><li>Gain an understanding of cloud computing and its benefits, including scalability, reliability, and cost-effectiveness.</li><li>Learn how to configure and manage security and compliance in the cloud, including user access, network security, and identity and access management.</li><li>Learn how to containerize frontend and backend web applications (using Docker), also working with serverless containers in AWS (AWS Fargate and Amazon Elastic Container Registry).</li><li>Learn the basics of data modeling for NoSQL (Amazon DynamoDB) and SQL (Amazon RDS) databases.</li><li>Set up CI/CD pipeline using AWS CodeBuild, CodeDeploy, and CodePipeline.</li><li>Implementing Infrastructure as Code (IaC) using CloudFormation</li><li>DNS resolution using hosted zones</li></ul><h3>Pre-requisite Technology</h3><p>Here are some of the technologies that will be utilized during this series:</p><ul><li><strong>AWS Account:</strong> this will be our Cloud Service Provider. AWS has a free tier but requires a credit card to activate your account.</li><li><strong>GitHub Account</strong>: this will be used to store the application (frontend and backend) codebase.</li><li><strong>Gitpod Account</strong>: this will be used as our Cloud Developer Environment. We will be working in Gitpod to write code as we integrate cloud services into the provided web applications.</li><li><strong>Custom Domain Name</strong>: this is required for the backend to talk to the frontend application via the web browser. You can find domains under a single dollar for the first year at <a href="https://tld-list.com/"><strong>TLD-List</strong></a>. Ensure the domain provider allows you to update the name servers since we will point the domain to AWS Namespaces to enable Amazon Route 53 to manage the domain name.</li><li><strong>Lucid Charts</strong>: this is a diagramming application to create various kinds of charts. It will be used to build our Architecture diagram.</li><li><strong>Momento Account</strong>: this is a serverless cache with a generous free tier. To build more scalability and keep our costs down, we will cache our DynamoDB requests using Momento.</li><li><strong>HoneyComb</strong>: is an observability tool for distributed tracing. It shows the patterns and outliers of how users experience your code in a complex environment.</li><li><strong>Rollbar Account</strong>: this is a bug-tracking tool that can capture application crashes, uncaught errors, and slow responses to make it easily debug production applications.</li></ul><h3>Week 0 — Billing and Architecture (Part 1)</h3><p>The first week focuses on understanding AWS billing and the logical architecture design for the proposed project. Below are some of the tasks covered this week;</p><h4>Conceptual Architectural Diagram on Napkin</h4><p>I created a conceptual architectural diagram of the Cruddur micro-blogging platform, similar to the movie — Glass Onion 😄.</p><figure><img alt="Conceptual Architectural Diagram on Napkin" src="https://cdn-images-1.medium.com/max/1024/1*J6hSCJ63JdCmBoJz8joarg.jpeg" /></figure><h4>Logical Architectural Diagram Using Lucid Chart</h4><p>Below is the logical architectural diagram of the Cruddur micro-blogging platform. It shows the connectivity between applications and the flow between components. Find the link to this design at <a href="https://lucid.app/lucidchart/83d7f5f3-ebad-4212-a410-9e40489685a7/edit?viewport_loc=-716%2C-116%2C3072%2C1596%2C0_0&amp;invitationId=inv_cd46e4bd-5edb-4a51-8066-be435f870049">Lucid Charts Shared Link</a>.</p><figure><img alt="Logical Architectural Diagram Using Lucid Chart" src="https://cdn-images-1.medium.com/max/1024/1*zme93jrz1Wewuduulf3uGA.png" /></figure><h4>AWS Account Setup and Best Practices</h4><p><strong>Security</strong> in the cloud is a shared responsibility. We are responsible for enforcing and maintaining security for resources we create in the cloud. The following were implemented to ensure account security best practices:</p><ul><li>Enforced MFA on the root account.</li><li>Created an Admin User to enable console login, attaching Administrator access, and enabled password rotation rules.</li></ul><figure><img alt="AWS Admin User Creation" src="https://cdn-images-1.medium.com/max/1024/1*iEViQN70s2nY4tZk2EJ7Rw.png" /></figure><ul><li>Printed put account credentials using the aws sts get-caller-identity command on CloudShell.</li></ul><figure><img alt="Using AWS Cloudshell" src="https://cdn-images-1.medium.com/max/1024/1*3xJ5NqpxYtrcWjXOAwjehg.png" /></figure><ul><li>We generated AWS Credentials for the Admin user to allow interaction with AWS resources using aws-cli.</li></ul><figure><img alt="AWS Credential for Admin User" src="https://cdn-images-1.medium.com/max/1024/1*IFnj3xJBsZKiygHSv-rsbg.png" /></figure><ul><li>Integrated Gitpod with my GitHub account and configured Gitpod provider permissions.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gCdesz8OQjXUkiEJDhbPxA.png" /></figure><p><strong>Cost Optimization</strong> is critical in the cloud and is a factor driving businesses migrating workloads to the cloud. AWS enables you to take control of cost and continuously optimize your spending while building modern, scalable applications to meet your needs. The following strategies were implemented to ensure effective management cost:</p><ul><li>Created an AWS Budget to help track cost, usage, and coverage at a budget threshold of 10 CAD Monthly.</li></ul><figure><img alt="AWS Budget" src="https://cdn-images-1.medium.com/max/1024/1*deq5rWeVit0MAxL_jYP0cA.png" /></figure><ul><li>I created a Billing Alarm that monitors and sends an email when the set threshold of 10 CAD is reached at 70% utilization.</li></ul><figure><img alt="AWS Billing Alarm" src="https://cdn-images-1.medium.com/max/1024/1*bnznMKGSFiWIau-K4tGcLA.png" /></figure><ul><li>Finally, I created a tag-based resource group to efficiently organize and consolidate resources based on criteria specified in tags.</li></ul><h4>Install and Verify AWS CLI on Gitpod</h4><p>The AWS Command Line Interface (AWS CLI) is a unified tool that simplifies the management of your AWS resources. It enables you to automate multiple AWS services through scripts and control them from the command line.</p><p>Using the bash terminal on Gitpod CDE, I followed these steps from the command line to install the AWS CLI on Linux:</p><pre>$ curl &quot;https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip&quot; -o &quot;awscliv2.zip&quot;<br>unzip awscliv2.zip<br>sudo ./aws/install</pre><p>Upon successful installation, I tested and interacted with my AWS account using aws-cli commands.</p><figure><img alt="AWS CLI Installation 1" src="https://cdn-images-1.medium.com/max/1024/1*Qc7YolVQzuZAs_qhYvIj_Q.png" /></figure><figure><img alt="AWS CLI Installation 2" src="https://cdn-images-1.medium.com/max/1024/1*VOxXUb78X27nmnR5wQZ_Dg.png" /></figure><p>I updated the Gitpod environment variables and committed the gitpod.yml file to ensure aws-cli is installed upon starting the CDE. Finally, I used gitpod to push the file to my git repository.</p><h3>Conclusion</h3><p>We just concluded part 1 of 14 of this series 👏. In this article, I successfully created an admin user on AWS, enabled MFA, enforced the password rotation rule, generated access keys/credentials, created cost monitoring alarms, set a budget threshold to track cloud spending, and installed aws cli on gitpod CDE.</p><p>Now that our environment is ready, we can containerize the frontend and backend applications using Docker in part 2 of this series.</p><p>Learning comes with its failures and obstacles, so I encourage you to have a growth mindset and grit. Grit does not only mean having a strong personality but includes other characteristics such as discipline, perseverance, focus, and a growth mindset.</p><p><strong><em>Heroes are never perfect, but they’re brave, they’re authentic, they’re courageous, determined, discreet, and they’ve got grit. — Wade Davis</em></strong></p><h3>Thanks for reading!</h3><p>If you enjoyed reading this post, follow me on <a href="https://twitter.com/LarryKodes"><strong>Twitter</strong></a> and <a href="https://medium.com/@oluwajuwonajana"><strong>Medium</strong></a> for more content. Please, If you have any feedback, suggestions, or something you want to see in a future post. Kindly leave them in the comments below. Thanks!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=947e31e3ba6f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hosting a Vue.js Single Page Application (SPA) on AWS Simple Storage Service (S3)]]></title>
            <link>https://medium.com/@oluwajuwonajana/hosting-a-vue-js-single-page-application-spa-on-aws-simple-storage-service-s3-734829a41361?source=rss-4632e826cff7------2</link>
            <guid isPermaLink="false">https://medium.com/p/734829a41361</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[s3]]></category>
            <dc:creator><![CDATA[Oluwajuwon Ajana]]></dc:creator>
            <pubDate>Fri, 05 Aug 2022 07:19:13 GMT</pubDate>
            <atom:updated>2022-08-05T08:38:29.194Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xlyNoG9c6ysnEEVhCAAfCQ.png" /></figure><p>Recently, I was responsible for deploying and hosting a Vue.js frontend application on AWS. This project required HTTPS, a custom domain, a hosting service for the deployment files, and a content delivery network. As such, I decided to share the process as a step-by-step tutorial to help others who may need it.</p><h4>Objectives</h4><p>In this tutorial, we will do the following:</p><ul><li>Set up a custom domain name</li><li>Set up an S3 bucket to store and host our application file</li><li>Set up an SSL Certificate, and redirect all HTTP traffic to HTTPS</li><li>Create an IAM policy, a user, and access credentials</li><li>Programmatically access AWS using <strong><em>aws-cli</em></strong> command and deploy files to S3</li><li>Set up a CloudFront distribution and resolve it to our custom domain name</li><li>Set up a bucket policy to restrict access to bucket content</li></ul><h4>Requirements</h4><p>We need an AWS account to be able to host and secure our single-page application in the cloud. To accomplish our objectives, we will use the following services:</p><ul><li><strong>AWS S3:</strong> since our application is static, we can host the files in an S3 bucket. In addition to being highly scalable, reliable, and delivering high performance, S3 is also highly secure.</li><li><strong>AWS Certificate Manager: </strong>this allows us to generate a custom SSL certificate for our distribution and redirect all HTTP traffic to HTTPS.</li><li><strong>CloudFront:</strong> is a Content Delivery Network (CDN) that securely delivers content globally, offering low latency and high transfer speed. It provides distribution for our site at edge locations worldwide.</li><li><strong>IAM: </strong>is used to create temporary credentials that programmatically access and deploy our files to AWS S3.</li><li><strong>Route 53:</strong> this provides domain registration, DNS &amp; traffic management services. We’ll set up Route 53 to point to our CloudFront distribution.</li></ul><p>Some of the benefits of using the above choice of services are:</p><ul><li>They are serverless</li><li>Cost efficient and employs a pay-as-you-go model</li><li>Scalable and high performance</li><li>Ease of use and maintenance</li><li>No upfront cost</li></ul><p>See below the architecture pattern for our hosted single-page application on AWS Cloud.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nz_jsLj23s-O9cH_cX5Wmg.png" /></figure><p>By the end of this tutorial, you will have successfully hosted your application on AWS, and it will be globally available. Alright, let’s get started.</p><h4>Step 1: Build the Site for Production</h4><p>Depending on how you’ve created your site, I’ll leave it to you to build the production codebase. I used Vue Cli to code my web application, so I will use the <strong><em>npm run build</em></strong> command to compile my production site.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/0*fbihMrf8rZC9Y5u2.png" /></figure><p>We have successfully built the web application, and this created a <strong>dist</strong> directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nTpLGrgSKXxAsVwQ.png" /></figure><h4>Step 2: Set up a Domain in Route 53</h4><ol><li><strong>Register a domain: myexample.com </strong>on AWS</li></ol><ul><li>Navigate to Route 53 dashboard. Click on <strong>Register domain</strong></li><li>Enter a <strong>domain name. </strong>Check for availability, add to <strong>cart</strong>, then click on <strong>continue.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Le0Q0Z-sy0H0ZVTGEO9SjA.png" /></figure><ul><li>Fill out the contact details for the domain registrant, then click on <strong>continue.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rvt7hNMbjvszBl8SU3QWww.png" /></figure><ul><li>Accept terms and conditions to proceed. Click <strong>complete order</strong></li><li>Your domain will appear as a pending request. You will receive an email confirmation with a verification link from Amazon Registrar.</li></ul><p>2. <strong>Create a Hosted Zone in AWS</strong></p><ul><li>Navigate to Route 53 dashboard<strong>. </strong>Click on <strong>create hosted zone</strong></li><li>Enter your <strong>domain name,</strong> and leave the type as <strong>Public hosted zone. </strong>Click on <strong>create hosted zone</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*H9euXpU-xsZx76gquy_tNQ.png" /></figure><p><strong>3. Change registrar DNS</strong></p><p>This change allows Route 53 to handle DNS. Set the DNS servers to the values in the NS record in the Hosted Zone you created in Route 53.</p><ul><li>Navigate to your hosted zone. Copy the value of the <strong>NS record</strong> created with the hosted zone</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h4gWIsxyoT5VdAl9Ejjjsg.png" /></figure><ul><li>Replace the DNS servers with the hosted zone <strong>NS record values</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GFr7S6AN1wGReyT_icsKhg.png" /></figure><h4>Step 3: Host the single-page application in S3</h4><ol><li><strong>Create a bucket</strong></li></ol><ul><li>Navigate to Amazon S3. Click on<strong> Create bucket</strong></li><li>Enter your unique bucket name (<strong>my-example-bucket</strong>)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l8WMdvUUh0VUetkHJlQkRA.png" /></figure><ul><li>Disable <strong>Access Control List, t</strong>hen uncheck <strong>Block Public Access settings </strong>(this grants public read access to this bucket)<strong>.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*sQMkTztSowV419KtuToKVg.png" /></figure><ul><li>Click <strong>Create bucket.</strong></li></ul><p>2. <strong>Turn on static website hosting</strong></p><ul><li>Navigate to the <strong>properties tab</strong></li><li>Scroll down, then click on <strong>Edit static website hosting</strong></li><li><strong>Enable</strong> static website hosting, then set both the index and error document to <strong>index.html</strong> (this tells S3 where the root of the web application lies)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*3ZqFWb_DgRKcg_32dB-Mxw.png" /></figure><ul><li><strong>Upload Files</strong>: copy in the built website files (including your index.html, favicon, JS, CSS, and any images)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8kSuaSzhuNVcKmjNnxubmw.png" /></figure><ul><li>Navigate to the properties tab to get the <strong>URL endpoint</strong> to your website.</li><li>Open the URL in a new tab to see the hosted web application. It will output an error as we are yet to set an explicit bucket policy.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ff4XysHlOFsAio-uDBZmqw.png" /></figure><p>3. <strong>Configure the bucket policy</strong></p><p>In the permissions tab, set the bucket policy to allow public access to the bucket.</p><ul><li>Navigate to the <strong>permissions tab, </strong>then<strong> </strong>Click <strong>Edit Bucket policy</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tHwmfVBuTENxHtcPL7D08g.png" /></figure><ul><li>Paste the JSON policy, replacing <strong>BUCKET-NAME-GOES-HERE</strong> with the name of your S3 bucket:</li></ul><pre>{ <br>  &quot;Version&quot;:&quot;2012-10-17&quot;, <br>  &quot;Statement&quot;:[{ <br>    &quot;Sid&quot;:&quot;PublicReadGetObject&quot;, <br>    &quot;Effect&quot;:&quot;Allow&quot;, <br>    &quot;Principal&quot;: &quot;*&quot;, <br>    &quot;Action&quot;:[&quot;s3:GetObject&quot;], <br>    &quot;Resource&quot;:[&quot;arn:aws:s3:::BUCKET-NAME-GOES-HERE/*&quot;] <br>   }]<br>}</pre><ul><li>Click on <strong>Save changes</strong>.</li></ul><p>Now, our bucket is ready to be served up.</p><h4>Step 4: Set up IAM User for Programmatic Access to the S3 Bucket</h4><p>This process enables us to programmatically access AWS S3 from our local machine using the aws-cli. We will use the credentials to show that we are authorized to make changes to the S3 bucket. To accomplish this, we need to create an IAM policy and user.</p><ol><li>Navigate to the<strong> IAM dashboard</strong>, then select <strong>policies</strong></li><li>On the policy page, click on <strong>Create policy</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QA9xDVsHgUXJv679bRJnvA.png" /></figure><p>3. Click on the<strong> JSON tab</strong>. Paste in the JSON code, then replace <strong>BUCKET-NAME-GOES-HERE</strong> with your bucket name</p><pre>{ <br>  &quot;Version&quot;: &quot;2012-10-17&quot;, <br>  &quot;Statement&quot;: [ <br>    { <br>      &quot;Sid&quot;: &quot;VisualEditor0&quot;,    <br>      &quot;Effect&quot;: &quot;Allow&quot;, <br>      &quot;Action&quot;: [ <br>         &quot;s3:PutObject&quot;, <br>         &quot;s3:GetObject&quot;, <br>         &quot;s3:ListBucket&quot;, <br>         &quot;s3:DeleteObject&quot;, <br>         &quot;s3:GetBucketPolicy&quot; <br>      ],    <br>      &quot;Resource&quot;: [ <br>        &quot;arn:aws:s3:::BUCKET-NAME-GOES-HERE&quot;,      <br>        &quot;arn:aws:s3:::BUCKET-NAME-GOES-HERE/*&quot; <br>      ] <br>    } <br>  ] <br>}</pre><p>This policy grants read and write access to our S3 bucket.</p><p>4. Click on <strong>Review Policy</strong>, then provide a name for your policy. Proceed to click on <strong>Create Policy</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Rn1D1vNcSTWYKqgza-Z_g.png" /></figure><p>5. Next, we’ll create an IAM user and attach this policy to its set of permissions. We will use this user’s credentials to access S3 using <strong>aws-cli</strong>.</p><p>6. Navigate back to the <strong>IAM dashboard</strong>, and click on <strong>users</strong>. Then, click on <strong>Add users</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fKqQgMHPQrPntIrBIZSMTg.png" /></figure><p>7. Enter a name for your user, then check the<strong> <em>Access Type</em></strong><em> </em>box for <strong>Programmatic access.</strong> Click on <strong>Next: Permission</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bx4CTHIFIpd1AHxoztj66A.png" /></figure><p>8. Add the policy that we created above. Click on the option <strong>Attach existing policies directly</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W3i7-EW_gdRe7NVMMi6jVQ.png" /></figure><p>9. Click on <strong>Next: Tags</strong>. We don’t need to do anything here. Click on <strong>Next: Review</strong>.</p><p>10. Click on <strong>Create user </strong>to finish. This step will create the user’s credentials and output an <strong><em>Access key ID</em></strong> and a <strong><em>Secret access key</em></strong><em> </em>(we will use these keys to access our S3 bucket).</p><h4>Step 5: Deploy to S3 Bucket from the CLI</h4><p>We’ll set up a local AWS profile using <strong><em>aws configure</em></strong> command with the credentials generated from the above step:</p><pre>~/$ <strong>aws configure --profile S3-VueJs-User1</strong><br>AWS Access Key ID [************]: <strong>PASTE ACCESS KEY ID FROM AWS</strong><br>AWS Secret Access Key [********]: <strong>PASTE SECRET ACCESS KEY FROM AWS</strong><br>Default region name [None]: <strong>us-east-1</strong><br>Default output format [None]: None</pre><p>Running <strong><em>aws configure</em></strong> sets up credentials in a file stored at <strong>~/.aws/credentials</strong>. After setting up the AWS profile, we can proceed to access our S3 bucket from the CLI.</p><ol><li>Run the below command to list all objects in the created bucket (replace <strong>BUCKET-NAME-GOES-HERE</strong> with your bucket name)</li></ol><pre>~/$ aws --region us-east-1 --profile S3-VueJs-User1 s3 ls s3://BUCKET-NAME-GOES-HERE</pre><p>2. The above command should do nothing as our bucket is currently empty. It means we now have access to the S3 bucket (the IAM user and permissions were correct).</p><p>3. Now proceed to deploy the production server (<strong>./dist </strong>) to our S3 bucket using the sync command (replace <strong>BUCKET-NAME-GOES-HERE</strong> with your bucket name)</p><pre>~/$ aws --region us-east-1 --profile S3-VueJs-User1 s3 sync ./dist s3://BUCKET-NAME-GOES-HERE –delete</pre><p>4. The command above would upload each of the files in the <strong>./dist</strong> folder to the S3 bucket</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*bvRJZtnXNXDSaB_ksGF6fA.png" /></figure><p>5. On the AWS console, navigate to the S3 and confirm the uploaded files are in the created bucket</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Deo-PiivwhdzQqrd0ZG0aA.png" /></figure><p>6. Next, click on the properties tab for the S3 bucket. Scroll down to static website hosting to locate the bucket website endpoint URL. Open the URL in your browser, and you will see that your application is live.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ozFPkzkclbp5peQZk56Mqw.png" /></figure><p><strong>Note:</strong> One of the limitations of static web hosting is that S3 website endpoints do not support HTTPS.</p><h4>Step 6: Request SSL Certificate using AWS Certificate Manager (ACM)</h4><p>ACM offers free public certificates to provide Secure Socket Layer (SSL) and Transport Layer Security (TSL) encryption for your websites over the internet.</p><ol><li>Navigate to <strong>ACM, </strong>then click <strong>Request a certificate</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U8QZaNNqX8mzPhVBuirH-A.png" /></figure><p>2. Set the domain name to your registered domain name(<strong>myexample.com</strong>)</p><p>3. Click <strong>DNS validation,</strong> and click on<strong> Request</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*Ssahrt0mU3DXDn6GmscGJA.png" /></figure><p>4. Click <strong>Create a record in Route53</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*Ja3C2zmJ7KrL2Ga2DpFAJw.png" /></figure><p>5. This creates a CNAME record in the DNS settings for your domain, according to the values given to you here, and verifies that your own the domain. Check ACM to confirm the status of the issued certificate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jq5kb3AMdIDOYvxSQ1qMzw.png" /></figure><h4>Step 7: Set up our CloudFront Distribution</h4><p>CloudFront is a Content Delivery Network (CDN) that caches and serves copies of our websites at edge locations, thereby making our website faster to access. CloudFront also enables us to configure HTTPS while improving the performance of our site.</p><ol><li><strong>Create the First Distribution</strong></li></ol><ul><li>Navigate to <strong>Amazon CloudFront</strong>, then click on<strong> Create a CloudFront distribution</strong></li><li>Configure the <strong>Origin Domain Name</strong> to your S3 bucket URL endpoint (<strong>my-example-bucket.s3.us-east-1.amazonaws.com</strong>)</li><li>Click <strong>Create new origin access identity (OAI): </strong>CloudFront will use the OAI to access the content of our S3 bucket.</li><li>Click on <strong>Yes, update the bucket policy.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*qVgp__-35JZG3YiqM5IcDA.png" /></figure><ul><li>Change the <strong>Viewer Protocol Policy</strong> to <strong>Redirect HTTP to HTTPS</strong></li><li>Set <strong>CNAME</strong> to your primary domain name (<strong>myexample.com</strong>)</li><li>Select the<strong> custom SSL Certificate</strong> earlier created with ACM</li><li>Select a <strong>Security policy</strong>: <strong>TLSv1.2_2021 (recommended)</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*Qqb1ZUz_bNKL238_wOXjjg.png" /></figure><ul><li>Set <strong>default root object</strong> for distribution to<strong> index.html</strong></li></ul><p><strong>2. Create the Second Distribution</strong></p><ul><li>Replicate step 1 to step 5 as shown in the first distribution</li><li>Set <strong>CNAME</strong> to your primary domain name (<strong>www.myexample.com</strong>)</li><li>Replicate step 7 to step 9 as shown in the first distribution</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZSePD7Cmy5xCAbfzCQfxjg.png" /></figure><p><strong>3. Set up Error Page redirects to index.html</strong></p><p>This setting will redirect all error responses to index.html, letting the single-page application handle routing.</p><ul><li>Navigate to the distribution<strong> Error page tab.</strong></li><li>We will create two custom error responses (403 Forbidden and 404 Not Found). Click on <strong>Create custom error response.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6-7oD1AJGpS1V4jE0P7Y1A.png" /></figure><ul><li>Set <strong>HTTP Error Code</strong> to <strong>403/404</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*DhPBaBaPhfi_hTtmune3OA.png" /></figure><ul><li>Set <strong>Error caching minimum TTL</strong> to <strong>0</strong> seconds</li><li>Set <strong>Customized error response</strong> to <strong>Yes</strong></li><li>Set <strong>Response Page Path</strong> to <strong>/index.html</strong></li><li>Set <strong>HTTP Response code</strong> to <strong>200: OK</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*MRE78C5JIvaHUssJ9AgF8A.png" /></figure><ul><li>Repeat the above steps for the second distribution</li></ul><h4>Step 8: Configure Route53 DNS record</h4><p>This configuration points Route53 to our CloudFront distribution. We will create an <strong>A Record</strong>, which will serve as an alias that resolves our custom domain name to our CloudFront distribution.</p><ol><li>Navigate to <strong>Route 53</strong>, then click on the created <strong>hosted zone</strong></li><li>Click on <strong>Create record (Root Domain)</strong></li></ol><ul><li>Keep the <strong>record name</strong> blank to create a record for your root domain (<strong>myexample.com</strong>)</li><li>Set the <strong>record type</strong> to<strong> A-IPv4 address</strong></li><li>Set <strong>Alias</strong> to <strong>Yes</strong></li><li>Set <strong>Alias target</strong> to your <strong>First CloudFront distribution </strong>from the dropdown</li><li>Click on <strong>Create</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bvG5_8ilCZot02niakPIUw.png" /></figure><p>3. Click on <strong>Create record (Sub-Domain)</strong></p><ul><li>For the <strong>record name,</strong> input <strong>www</strong> to create a record for your sub-domain (<strong>www.myexample.com</strong>)</li><li>Repeat steps 2 and 3 above</li><li>Set <strong>Alias target</strong> to your <strong>Second CloudFront distribution </strong>from the dropdown</li><li>Click on <strong>Create</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EjSvI5m1V5DSvJ3w4QjU0Q.png" /></figure><h4>Step 9: Modify S3 Bucket Policy</h4><p>Lastly, we will navigate to our S3 bucket to remove the bucket policy added in Step 3 above. This modification removes public access to our S3 bucket and grants access to CloudFront only.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*h1_kYF8LoFdbzXmF.png" /></figure><p><strong>Note:</strong> Making changes to your SPA can take some time to propagate. However, you can create a CloudFront Invalidation to clear the cache for CloudFront when testing new configurations.</p><p>That’s it for today, great work. Now, if you try accessing the URL, you should see that your site is live. Also, let’s check if the HTTPS configuration is working and if HTTP redirects to HTTPS.</p><h4>Conclusion</h4><p>The goal of this tutorial was to guide us through the steps of deploying a Vue.js application to AWS for hosting and making the necessary changes to allow HTTPS and a custom domain name.</p><h4>Thanks for reading!</h4><p>If you enjoyed reading this post, follow on <a href="http://twitter.com/nigerian_boi"><strong>Twitter</strong></a> and <a href="https://medium.com/@oluwajuwonajana"><strong>Medium</strong></a> for more content. Please, If you have any feedback, suggestions, or something you’d like to see in a future post. Kindly leave them in the comments below, and I’ll do my best to get back to you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=734829a41361" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Use Docker Containers on AWS EC2 Instance using SSM(System Sessions Manager)]]></title>
            <link>https://medium.com/@oluwajuwonajana/how-to-use-docker-containers-on-aws-ec2-instance-using-ssm-system-sessions-manager-51f39cc9ffde?source=rss-4632e826cff7------2</link>
            <guid isPermaLink="false">https://medium.com/p/51f39cc9ffde</guid>
            <category><![CDATA[aws-ec2]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Oluwajuwon Ajana]]></dc:creator>
            <pubDate>Sun, 17 Jul 2022 20:54:14 GMT</pubDate>
            <atom:updated>2022-07-17T20:54:14.351Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Docker on AWS Banner" src="https://cdn-images-1.medium.com/max/1024/1*bJu5lG3HNQpoOaav7Ygbeg.png" /></figure><p>This article is perfect for people migrating their applications to the cloud or starting their cloud learning journey. I try to answer the question ‘How do I install and test docker on Amazon EC2(Linus 2) over a system session manager (SSM)’.</p><p><strong>Objectives</strong></p><p>In this article, we are going to look at the following:</p><ul><li>Launch and access your EC2 instance using SSM</li><li>How to install Docker</li><li>How to pull Docker images from Dockerhub</li><li>How to create a Docker image using a Dockerfile</li><li>How to push Docker images to Amazon ECR (Elastic Container Registry)</li></ul><p>By the end of this article, you will be able to access docker on your EC2 instance, just like it would work on a Linux computer. Okay, let’s get started.</p><p><strong>1.</strong> <strong>Launch your EC2 instance</strong></p><p>Set up an AWS account and Create an IAM user with Administrator access. Then proceed to launch the EC2 instance from the AWS console:</p><ul><li>Click on Launch Instance</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/1*6NaobiClBe04HDvXAgatnQ.png" /></figure><ul><li>Choose Amazon Machine Image (AMI): <strong><em>Amazon Linux 2 AMI (Free Tier Eligible)</em></strong><em>. Click next</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f7y1MizL4Rzr_gdzN80sdw.png" /></figure><ul><li>Choose instance type: <strong><em>t2.micro (Free Tier Eligible)</em></strong><em>. Click next</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2D4T2yDEhSRTIBpOufY2hg.png" /></figure><ul><li>Configure instance details: <strong><em>add IAM role SSMEC2ServiceRole</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EnCkuVIyrMVVnDgxtmSY_Q.png" /></figure><ul><li><em>In a new tab, </em><strong><em>create an IAM Role</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K9uDIdjyAs5r7cqGHD-TqA.png" /></figure><ul><li><em>Add Permissions (</em><strong><em>Policy name — AmazonEC2RoleforSSM</em></strong><em>) to the role. Click next</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YELCAFPI0yySLfDGz2NC6w.png" /></figure><ul><li><em>Name the role </em><strong><em>‘SSMEC2ServiceRole’</em></strong><em>. Click create role</em></li><li><em>Attached created role from the EC2 IAM role dropdown</em></li><li>Add storage: <strong><em>default setting.</em></strong><em> Click next</em></li><li>Add Tags: <strong>Name: <em>EC2 Docker Instance</em></strong><em>. Click next</em></li><li>Configure Security Group: <strong><em>Add Rule (Type: HTTPS, Port: 443, Source: 0.0.0.0/0)</em></strong><em>. Click review and launch</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V6n84XsPQnYSRL0LG1KC4A.png" /></figure><ul><li>Proceed without a key pair and check the acknowledge box. Click launch instance</li><li>An instance will be running with 2/2 status checks passed after some time.</li></ul><p><strong>2.</strong> <strong>How to install Docker</strong></p><p>It is pretty easy to install Docker on an Amazon Linux 2 AMI. Let’s connect to our instance using the Session Manager:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s_6zF_FH99zozXlp3uRQXQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*ScxKO0HM4CeV-XLy3DRV5w.png" /></figure><ul><li>Update the packages on your instance. Enter:<em> </em><strong><em>sudo yum update -y</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ilThWvPPJpkbKsPSQ1mocw.png" /></figure><ul><li>Install the most recent docker package. Enter:<em> </em><strong><em>sudo amazon-linux-extras install docker</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tybl8gcuFseywjrj2Vuw4w.png" /></figure><ul><li>Start the service docker. Enter:<em> </em><strong><em>sudo service docker start</em></strong></li><li>To ensure that the Docker daemon starts after each system reboot (Optional). Enter:<em> </em><strong><em>sudo systemctl enable docker</em></strong></li><li>Add ec2-user to the docker group so you can execute Docker commands without using sudo. Enter:<em> </em><strong><em>sudo usermod -a -G docker ec2-user</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DnzhtxQiXeVwGlJOWJeVPA.png" /></figure><ul><li>You need to log out and log back in for the change to take effect</li><li>Check the docker version. Enter<em> </em><strong><em>docker –version</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eK0GyOZsK3HVMu5xPcQgOw.png" /></figure><p><strong>3.</strong> <strong>How to pull Docker images from Docker-hub</strong></p><p>Docker Hub is a public docker repository containing millions of docker images. Follow the steps below:</p><ul><li>Visit <a href="http://hub.docker.com/"><strong><em>hub.docker.com</em></strong></a></li><li>Search for <strong><em>docker/whalesay</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JjOhlw-rUWLqCFw5a7v9LA.png" /></figure><ul><li>Copy and enter “<strong><em>sudo docker run docker/whalesay cowsay Hello World</em></strong>”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1p-Yp0NL6Cd8ePCvDY6eDw.png" /></figure><p>The docker image is pulled from Dockerhub, and “Hello World!” is outputted after the container was created.</p><p><strong>4.</strong> <strong>How to create a Docker image using a Dockerfile</strong></p><p>A Dockerfile is a manifest that describes the base image to use for your Docker image, and what you want to be installed and running on it.</p><ul><li>Make a new Dockerfile: <strong><em>sudo touch Dockerfile</em></strong></li><li>Edit Dockerfile using vim command: <strong><em>sudo vim Dockerfile</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*q2XnhJmrmzlGAWZ1qi0SqQ.png" /></figure><ul><li>Append the following config:</li></ul><p><strong><em>FROM ubuntu:18.04</em></strong></p><p><strong><em># Install dependencies</em></strong></p><p><strong><em>RUN apt-get update &amp;&amp; \</em></strong></p><p><strong><em>apt-get -y install apache2</em></strong></p><p><strong><em># Install apache and write a hello world message</em></strong></p><p><strong><em>RUN echo ‘Hello World!’ &gt; /var/www/html/index.html</em></strong></p><p><strong><em># Configure apache</em></strong></p><p><strong><em>RUN echo ‘. /etc/apache2/envvars’ &gt; /root/run_apache.sh &amp;&amp; \</em></strong></p><p><strong><em>echo ‘mkdir -p /var/run/apache2’ &gt;&gt; /root/run_apache.sh &amp;&amp; \</em></strong></p><p><strong><em>echo ‘mkdir -p /var/lock/apache2’ &gt;&gt; /root/run_apache.sh &amp;&amp; \</em></strong></p><p><strong><em>echo ‘/usr/sbin/apache2 -D FOREGROUND’ &gt;&gt; /root/run_apache.sh &amp;&amp; \</em></strong></p><p><strong><em>chmod 755 /root/run_apache.sh</em></strong></p><p><strong><em>EXPOSE 80</em></strong></p><p><strong><em>CMD /root/run_apache.sh</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nqQsdI7n_skxOcNE4vBWLA.png" /></figure><ul><li>Build the Docker image using your Dockerfile:</li></ul><p><strong><em>docker build -t hello-world .</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uXdbEOZZQCA-9x8cNGZ4GA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ngObFq_Aag8pXwkWPGXRMg.png" /></figure><ul><li>Run docker images to verify that the image was created correctly:</li></ul><p><strong><em>docker images — filter reference=hello-world</em></strong></p><ul><li>Map exposed port on the container to port 80 on the host system:</li></ul><p><strong><em>docker run -t -i -p 80:80 hello-world</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*geGdPLjfkJEcmRwSGEsDVg.png" /></figure><ul><li>Open a browser and point to the server that is running Docker and hosting your container. If you are using an EC2 instance, this is the Public DNS value for the server</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*W4O-eXEZah1q0SMUF3_7zQ.png" /></figure><ul><li>Make sure that the security group for your instance allows inbound traffic on port 80.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2xBFjSVcRcMhvqLPgq604Q.png" /></figure><p><strong>5.</strong> <strong>How to push Docker images to Amazon ECR</strong></p><p>Amazon ECR is a managed AWS Docker registry service. You can use the Docker CLI to push, pull, and manage images in your Amazon ECR repositories.</p><ul><li>Create an Amazon ECR repository to store your hello-world image. Note the repository URI in the output. Substitute region, with your AWS Region, for example, us-east-1:</li></ul><p><strong><em>aws ecr create-repository — repository-name hello-repository — region &lt;region&gt;</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Xt9-L-Zcjxlqk_ufnVYNQ.png" /></figure><ul><li>Tag the hello-world image with the repository URI value from the previous step:</li></ul><p><strong><em>docker tag hello-world &lt;aws_account_id&gt;.dkr.ecr.&lt;region&gt;.amazonaws.com/hello-repository:latest</em></strong></p><ul><li>Run the <strong>aws ecr get-login-password</strong> command. Specify the registry URI you want to authenticate:</li></ul><p><strong><em>aws ecr get-login-password –region &lt;region&gt; | docker login — username AWS — password-stdin &lt;aws_account_id&gt;.dkr.ecr.&lt;region&gt;.amazonaws.com</em></strong></p><ul><li>Output:<strong> Login Succeeded</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XJ99JJCP83UO9caQFyVnjA.png" /></figure><ul><li>Push the image to Amazon ECR with the repository URI value from the earlier step:</li></ul><p><strong><em>docker push aws_account_id.dkr.ecr.region.amazonaws.com/hello-repository</em></strong></p><ul><li>Check the ECR repository to see pushed image as shown below.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F2bII2h2to1--Jg7oIIL0g.png" /></figure><p><strong>Note</strong>: I received the following error message when trying to authenticate in step 3 — <strong><em>permission denied while trying to connect to the docker daemon socket at unix:///var/run/docker.sock: post “http://%2fvar%2frun%2fdocker.sock/v1.24/auth”: dial unix /var/run/docker.sock: connect: permission denied.</em></strong></p><p>I had to install a Docker Credential Helper for Amazon Linux 2. See link <a href="https://github.com/awslabs/amazon-ecr-credential-helper#Configuration">https://github.com/awslabs/amazon-ecr-credential-helper#Configuration .</a></p><p>Wow!! Congratulations you made it.</p><p><strong>Clean Up</strong></p><p>When you are done experimenting with your Amazon ECR image, you can delete the repository so you are not charged for image storage:</p><p><strong><em>aws ecr delete-repository — repository-name hello-repository — region region –force</em></strong></p><p>Then proceed to terminate the EC2 instance.</p><p><strong>Summary</strong></p><ul><li>You can run Docker containers on AWS EC2 by installing Docker</li><li>You need to set up an AWS account and create an IAM user as an administrator</li><li>You can pull Docker images from Docker Hub and when you run those containers you should expose them on port 80</li><li>You need to add a security group rule for HTTP for accessing publicly</li><li>You should use AWS ECS if you want to launch a fleet of instances.</li></ul><p><strong>Conclusion</strong></p><p>In this article, we successfully set up an EC2 instance, installed Docker, pulled a Docker image from DockerHub, created an image from a Docker File, and pushed the image to Amazon ECR. You can use this approach if you want to run Docker containers quickly on Linux. Consider using AWS ECS for production use.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51f39cc9ffde" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>