<?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 BrianAAlleyne on Medium]]></title>
        <description><![CDATA[Stories by BrianAAlleyne on Medium]]></description>
        <link>https://medium.com/@brianaalleyne?source=rss-81e0c486cff8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*khokLbsOnR67cFOdl7KS5w.jpeg</url>
            <title>Stories by BrianAAlleyne on Medium</title>
            <link>https://medium.com/@brianaalleyne?source=rss-81e0c486cff8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 12:44:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@brianaalleyne/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[AWS 3-Availability Zone WordPress Site Deployment]]></title>
            <link>https://medium.com/@brianaalleyne/aws-3-availability-zone-wordpress-site-deployment-6cb4b695f212?source=rss-81e0c486cff8------2</link>
            <guid isPermaLink="false">https://medium.com/p/6cb4b695f212</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[load-balancing]]></category>
            <category><![CDATA[cloudwatch]]></category>
            <dc:creator><![CDATA[BrianAAlleyne]]></dc:creator>
            <pubDate>Wed, 30 Jul 2025 01:41:12 GMT</pubDate>
            <atom:updated>2025-07-30T01:41:12.471Z</atom:updated>
            <content:encoded><![CDATA[<p>How I deployed a highly available WordPress infrastructure across three AWS availability zones and what I learned about real-world cloud architecture.</p><p>When I set out to learn AWS beyond the basics, I knew I needed a project that would mirror real production environments. After completing a comprehensive 3-availability zone WordPress deployment, I can confidently say this project transformed my understanding of cloud architecture, high availability patterns, and the trade-offs that come with building resilient systems.</p><h4><strong>Why 3 Availability Zones Matter</strong></h4><p>Most tutorials focus on single-AZ deployments or basic 2-AZ setups, but production environments demand more resilience. A 3-AZ architecture provides:</p><ul><li>Accurate High Availability: Can survive the complete failure of an entire availability zone</li><li>Better Load Distribution: Traffic spreads across three geographic locations</li><li>Future-Ready Architecture: Easier to implement advanced patterns like blue-green deployments</li><li>Real-World Experience: Mirrors what you’ll encounter in enterprise environments</li></ul><h4>The Architecture I Built</h4><p>My final infrastructure included:</p><p><strong>Network Layer:</strong> Custom VPC with 6 subnets (3 public, 3 private) spanning us-west-2a, us-west-2b, and us-west-2c, each with dedicated NAT Gateways for proper isolation.</p><p><strong>Application Layer:</strong> WordPress instances are deployed across all three private subnets, managed by an Application Load Balancer that automatically distributes traffic and handles health checks.</p><p><strong>Database Layer:</strong> RDS MySQL instance with Multi-AZ deployment capability, using a database subnet group spanning all three availability zones.</p><p><strong>Security:</strong> Layered security groups controlling traffic flow between the ALB, EC2 instances, and RDS database with least-privilege access principles.</p><p><strong><em>AWS 3-AZ WordPress Architecture Diagram:</em></strong><em> Complete 3-Availability Zone WordPress deployment showing high availability across us-west-2a, us-west-2b, and us-west-2c with dedicated NAT Gateways, Application Load Balancer, and RDS Multi-AZ database deployment.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N6EG-CMaCu4IXFlnrWYlMg.jpeg" /></figure><p><strong>Key Implementation Challenges and Solutions</strong></p><h4>Challenge 1: Managing Sessions Across Multiple Instances</h4><p>Running WordPress on multiple servers immediately revealed the session management problem. Users would log in to one instance, then be routed to another instance that didn’t recognize their session.</p><p><strong>Solution:</strong> I explored multiple approaches:</p><ul><li>Database-based sessions (simple but add DB load)</li><li>ElastiCache Redis clusters (production-ready)</li><li>ALB sticky sessions (quick fix, but reduces load balancing effectiveness)</li></ul><p>For production environments, ElastiCache with Redis proved to be the most scalable solution.</p><h4><strong>Challenge 2: Shared File Storage</strong></h4><p>WordPress uploads (images, media files) needed to be accessible from all instances. Local storage wasn’t sufficient.</p><p>Solution: Implemented Amazon EFS (Elastic File System) mounted across all WordPress instances. This created a shared file system that all servers could read and write to simultaneously.</p><p>Challenge 3: Database Connection Management</p><p>With multiple WordPress instances connecting to the same RDS database, connection pooling and optimization became critical.</p><p>Solution: Configured WordPress with connection limits and implemented proper database optimization practices. For larger deployments, RDS Proxy would be the next evolution.</p><p><strong>Real-World Learning Outcomes</strong></p><p>This project taught me several crucial lessons about production cloud architecture:</p><p><strong>Cost vs. Availability Trade-offs</strong></p><p>Running 3 NAT Gateways costs approximately $135/month compared to $45 for a single gateway. However, the single gateway creates a critical point of failure. This taught me that high availability isn’t just about technical design — it’s about business requirements and risk tolerance.</p><p><strong>Cross-AZ Communication Costs</strong></p><p>I learned that data transfer between availability zones incurs charges. Optimizing for same-AZ communication where possible became an important consideration for cost management.</p><p><strong>Monitoring and Observability</strong></p><p>With infrastructure spread across three AZs, comprehensive monitoring became essential. I implemented CloudWatch alarms for:</p><ul><li>Instance health across all AZs</li><li>ALB target group health</li><li>Database performance metrics</li><li>NAT Gateway utilization</li></ul><p><strong>Failure Testing</strong></p><p>Perhaps the most valuable learning experience was deliberately failing components to understand system behavior:</p><ul><li>Terminating instances to test auto-scaling</li><li>Simulating AZ failures to test traffic routing</li><li>Testing database failover scenarios</li></ul><p><strong>The Technical Implementation</strong></p><p>VPC and Networking</p><p>The foundation started with a properly architected VPC using the 10.0.0.0/16 CIDR block:</p><p><strong>Availability Zone A (us-west-2a)</strong>:</p><p>Public Subnet: 10.0.1.0/24</p><p>Private Subnet: 10.0.4.0/24</p><p>NAT Gateway A</p><p><strong>Availability Zone B (us-west-2b):</strong></p><p>Public Subnet: 10.0.2.0/24</p><p>Private Subnet: 10.0.5.0/24</p><p>NAT Gateway B</p><p><strong>Availability Zone C (us-west-2c):</strong></p><p>Public Subnet: 10.0.3.0/24</p><p>Private Subnet: 10.0.6.0/24</p><p>NAT Gateway C</p><p><strong>Application Load Balancer Configuration</strong></p><p>The ALB proved to be more sophisticated than I initially realized. Key configurations included:</p><p><em>Cross-zone load balancing:</em> Ensures even distribution across all AZs</p><p><em>Health checks:</em> Custom health check paths for WordPress</p><p><em>Target group management: </em>Automatic registration/deregistration of instances</p><p><strong>Auto Scaling Integration</strong></p><p>Implementing Auto Scaling Groups across three AZs revealed the complexity of capacity planning. I configured:</p><ul><li>Minimum: 3 instances (one per AZ)</li><li>Desired: 3 instances</li><li>Maximum: 6 instances</li><li>Scale-out triggers based on CPU and request count</li></ul><p><strong>Performance and Monitoring Insights</strong></p><p>Once deployed, monitoring revealed interesting patterns:</p><ul><li>Latency variations between AZs were minimal but measurable</li><li>Cross-AZ database connections added approximately 1–2ms latency</li><li>Load balancing efficiency improved significantly with three targets</li><li>Failure recovery time averaged 2–3 minutes for instance replacement</li></ul><h4><strong>Security Considerations</strong></h4><p>The 3-AZ deployment required careful security planning:</p><p>Network Security: Private subnets with no direct internet access, communication only through NAT Gateways and the load balancer.</p><p>Security Groups: Layered approach with specific rules for ALB-to-EC2 and EC2-to-RDS communication.</p><p>Database Security: RDS deployed in private subnets with access restricted to WordPress instances only.</p><h4>Cost Management Lessons</h4><p>The complete 3-AZ deployment cost approximately $195/month, broken down as:</p><ul><li>NAT Gateways: $135/month (the largest expense)</li><li>EC2 instances: $25/month</li><li>RDS database: $15/month</li><li>Application Load Balancer: $20/month</li></ul><p>This taught me that high availability has real financial implications that business requirements must justify.</p><h4>What I’d Do Differently</h4><p>Looking back, here’s how I’d approach it next time:</p><ul><li>Start with Infrastructure as Code: Use CloudFormation or Terraform from day one</li><li>Implement monitoring earlier: Set up CloudWatch dashboards before deployment</li><li>Plan for secrets management: Use AWS Secrets Manager for database credentials</li><li>Consider containers: ECS or EKS would simplify multi-instance management</li></ul><h4>Skills Developed</h4><p>This project significantly advanced my AWS knowledge:</p><ul><li>VPC design and subnet planning</li><li>Load balancer configuration and optimization</li><li>Auto Scaling Group management</li><li>RDS Multi-AZ deployments</li><li>Security group design patterns</li><li>CloudWatch monitoring and alerting</li><li>Cost optimization strategies</li></ul><h4>Conclusion</h4><p>Building a 3-AZ WordPress deployment was far more educational than any single tutorial or course I&#39;ve taken. It forced me to grapple with real production challenges: high availability, cost management, security, monitoring, and failure scenarios.</p><p>The key insight? Production cloud architecture isn’t just about following best practices — it’s about understanding trade-offs and making informed decisions based on business requirements.</p><p>For anyone looking to advance their AWS skills beyond basic tutorials, I highly recommend taking on a multi-AZ project. The complexity will challenge you, but the learning outcomes are invaluable for real-world cloud engineering roles.</p><p>The infrastructure continues running in my AWS account as a learning lab, where I experiment with new services and patterns. Every month brings new insights about optimizing, monitoring, and maintaining production-grade cloud infrastructure.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6cb4b695f212" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Migration of a Workload running in a Corporate Data Center to AWS using the Amazon EC2 and RDS…]]></title>
            <link>https://medium.com/@brianaalleyne/migration-of-a-workload-running-in-a-corporate-data-center-to-aws-using-the-amazon-ec2-and-rds-d12b9e9dee3d?source=rss-81e0c486cff8------2</link>
            <guid isPermaLink="false">https://medium.com/p/d12b9e9dee3d</guid>
            <category><![CDATA[aws-migration-services]]></category>
            <category><![CDATA[amazon-virtual-cloud]]></category>
            <category><![CDATA[amazon-rds]]></category>
            <category><![CDATA[aws-internet-gateway]]></category>
            <category><![CDATA[amazon-web-services]]></category>
            <dc:creator><![CDATA[BrianAAlleyne]]></dc:creator>
            <pubDate>Fri, 21 Feb 2025 16:30:15 GMT</pubDate>
            <atom:updated>2025-02-21T16:30:15.496Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Migration of a Workload running in a Corporate Data Center to AWS using the Amazon EC2 and RDS service.</strong></h3><p>In this real-world project scenario, my role as a Cloud Engineer involved migrating a workload running in a Corporate Data Center to AWS. The application and database were successfully migrated to AWS using the Lift &amp; Shift (rehost) model, utilizing services such as Amazon EC2, S3, and RDS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-ORghHfzBnUmCil_7AIHCw.png" /></figure><p>To complete this process, I followed some migration steps:</p><p>· Planning (sizing, prerequisites, resource naming)</p><p>· Execution (resource provisioning, best practices)</p><p>· Go-live (validation test — Dry-run, final migration — Cutover)</p><p>· Post Go-live (ensuring the operation of the application and user access).</p><p><strong>Here is an overview of the steps and technologies employed at each phase:</strong></p><p><strong>1)Planning: </strong>Maintaining organization is key during project implementation, especially when transitioning from on-premise infrastructure to the cloud. Tracking compute specifications, AWS resources, and application requirements ensures a smoother migration. An Asset Inventory spreadsheet helps document essential details like RAM, CPU count, storage, server names, and network configurations for better planning and execution.</p><p>After gathering details about the physical infrastructure and hardware, verifying the software requirements of the on-prem servers is crucial. This includes documenting installed software, consulting the development team for their needs, and reviewing application documentation or server configurations. Record this information in the spreadsheet, review it thoroughly, and make the necessary preparations for migration.</p><p><strong>2)Execution: </strong>Various AWS resources were configured within a Virtual Private Cloud (VPC) using the AWS Console during the setup. Amazon VPC offers complete control over the virtual networking environment, including resource placement, connectivity, and security. A crucial step is defining a CIDR block for the VPC while ensuring it does not overlap with existing on-premises or cloud networks, especially in multicloud environments.</p><p><strong>Creating VPC and the Subnets:</strong></p><p>In this project, I created an Amazon VPC named “<em>vpc-bootcamp</em>” and (3) subnets inside the VPC: one public and two private subnets. The public subnet hosted an AWS EC2 instance for deploying on-premises application server files, while the private subnets were designated for RDS instances. Placing the RDS servers in private subnets enhanced security by restricting public access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eV_malxSx6xahO3XSH2usA.png" /><figcaption><strong>VPC and the Subnets | Public and Private</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BqzhmwvKsVx6aDJD1gXW_Q.png" /><figcaption>RDS Instance — awsuse1db01</figcaption></figure><p><strong>Create an Internet Gateway:</strong></p><p>We have created an Internet Gateway and associated with the VPC. Inside the IGW, we create a route table pointing to the internet gateway to allow traffic for clients to access the EC2 instance and let the EC2 instance access the internet to download packages, software, updates, etc.</p><p>To add routes to the routing table, navigate to <strong>VPC-bootcamp Route Table</strong> → <strong>Routes</strong> → <strong>Edit Routes</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DtsshKy0rYeTw3c9O24kvw.png" /><figcaption>Routing tables successfully updated</figcaption></figure><p><strong>Creating a Security Group for RDS:</strong></p><p>AWS security groups function similarly to firewall rules. In this configuration, I set the EC2toRDS-sg to permit only inbound connections from the EC2 instance’s private IP address.</p><p>After associating the Security Group (<strong>EC2toRDS-sg) to the RDS instance (awsuse1db01)</strong>, I downloaded the Application and Dump files to the EC2 server, created a database on the RDS server, and imported data. The data included articles that will be used for testing during the <strong>Go-Live session</strong>.</p><p><strong>3)Go Live:</strong> The Go-Live session focused on verifying the success of the migration. The Python-based web application was successfully deployed to the cloud, and I added a new record, “I’m conquering the MultiCloud Universe!” to the EC2 web application dashboard. Connectivity and functionality were confirmed as the EC2 server successfully retrieved and displayed old and new records from the RDS database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eQxnJb-t_GvjNKJVM-3s_A.png" /><figcaption>Evidence or Articles: old &amp; new</figcaption></figure><p><strong>4) Post-Go Live: </strong>The Post-Go-Live phase is essential for smooth cloud migration, ensuring applications and data function properly while addressing any issues. Key tasks include monitoring performance, identifying overlooked problems, and implementing security, maintenance, and updates.</p><p>This project provided hands-on experience migrating a web application and SQL database to AWS using EC2, VPC, RDS, S3, and more. Thanks to the Cloud Bootcamp, I’m building MultiCloud expertise. I look forward to sharing my next AWS project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/69/1*xXrDmjJBOi1TMC9IcyZPkQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d12b9e9dee3d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automated user migration and management of AWS Identity and Access Management (IAM) resources]]></title>
            <link>https://medium.com/@brianaalleyne/automated-user-migration-and-management-of-aws-identity-and-access-management-iam-resources-954eb7ad0ad4?source=rss-81e0c486cff8------2</link>
            <guid isPermaLink="false">https://medium.com/p/954eb7ad0ad4</guid>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[oracle-cloud]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[BrianAAlleyne]]></dc:creator>
            <pubDate>Fri, 21 Feb 2025 01:45:17 GMT</pubDate>
            <atom:updated>2025-02-21T01:45:17.040Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jdK6qaygPGSPH-ajQu82ow.png" /></figure><p>In this project, which was based on a real-world scenario, I acted as a Cloud Specialist with the mission of migrating users in an automated way and managing AWS IAM (Identity and Access Management) resources. 100 users needed to be migrated and have MFA (Multi-factor authentication) enabled on their accounts, as this is a security best practice. I needed to automate the processes to avoid repetitive and manual tasks in the AWS console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AE_ZAX_PBZlbp9eByk9L8g.png" /></figure><p>Using GitBash with AWS CLI and Shell Script, I wrote a script that enabled me to create user accounts, quickly assign them to IAM Groups with the appropriate permissions, and enable MFA for each user very quickly. In addition, users are forced to change their password after first login. Whether you have 20, 400, or 1000 users, you can efficiently automate these tasks within minutes.</p><p>Some additional tasks included: 1. Organizing user information to import Usernames and assigned Users, 2. Create the appropriate permissions for each User group, 3. Create scripts in AWS Cloud Shell to import user information and assign users to user groups:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fpYWcOsrg4BJUUqXZFh8uw.png" /></figure><p>4. Enable MFA for each user and allow users to reset his/her password when logging in the first time, 5. Run the scripts, and 6. Test the results to verify automation of User Group assignment and MFA.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x15x0FJF0M_q9MztlI4HCA.png" /><figcaption>User Group Assignments</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*B_ScBs9-zN79xbwLxwWvxA.png" /></figure><p>You will also want to test if users are required to create a new password after first sign in.</p><p>I enjoyed this hands-on experience. As an AWS Cloud Engineer, learning to automate user migration and manage AWS Identity and Access Management (IAM) resources is invaluable. Automation significantly streamlines AWS resource access, reducing setup time from hours to minutes compared to the tedious manual process in the AWS Console — especially when onboarding 20, 30, or even 100+ users.</p><p>I look forward to sharing more projects with you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=954eb7ad0ad4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementation of a set of EC2 instances using Terraform and AWS Systems Manager configuration with…]]></title>
            <link>https://medium.com/@brianaalleyne/implementation-of-a-set-of-ec2-instances-using-terraform-and-aws-systems-manager-configuration-with-26cfa5064669?source=rss-81e0c486cff8------2</link>
            <guid isPermaLink="false">https://medium.com/p/26cfa5064669</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws-systems-manager]]></category>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[BrianAAlleyne]]></dc:creator>
            <pubDate>Fri, 19 Apr 2024 15:51:41 GMT</pubDate>
            <atom:updated>2024-04-19T15:51:41.911Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>Implementation of a set of EC2 instances using Terraform and AWS Systems Manager configuration with Amazon Simple Notification Service for automated installation of security officers</em></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vKdof7cu7jfz9EzF6PRNpw.png" /></figure><p>In a project emulating a real-world scenario, I served as a DevSecOps Engineer, where I automated the deployment of EC2 instances and infrastructure with Terraform (Infrastructure as Code — IaC). Additionally, I automated the installation of a specific security agent on all instances.</p><p>After provisioning the infrastructure, I utilized AWS Systems Manager and its Command Run feature to install the security agents. I then used Amazon Simple Notification Service (SNS) to send an email informing the whole process status.</p><p><strong>Part 1: Terraform</strong></p><p>Terraform is an open-source infrastructure as code (IaC) tool that allows users to define and provision a cloud infrastructure using a high-level configuration language. It is created by HashiCorp and written in the Go programming language.</p><p>With Terraform, you can manage your AWS (Amazon Web Services) infrastructure by writing code in configuration files that describe the AWS resources you want to create and manage. These resources could include things like virtual machines (EC2 instances), storage buckets (S3 buckets), networking interfaces, and more. Terraform interprets the configuration files and translates the instructions into API calls to AWS to set up or modify the described infrastructure.</p><p>Through this Infrastructure as Code (IaC) strategy, Terraform streamlines the creation of repeatable and scalable cloud infrastructures. It enhances infrastructure management by integrating version control, ensures uniformity and reliability across deployment environments, and significantly lowers the risk of human error in manual configurations.</p><p>Here’s a basic workflow of how Terraform is used in this project:</p><ol><li><strong>Write Configuration:</strong> I outlined the required infrastructure using Visual Studio Code (VSCode), a powerful editor that integrates seamlessly with Terraform. Within this setup, I utilized VSCode to download and manage configuration files, including the pivotal main.tf, which specifies the resources and their settings for our infrastructure. To replicate this environment, download VSCode and install the Terraform extension from <a href="https://code.visualstudio.com/download"><em>this link</em></a>.</li><li><strong>Modify the Terraform files in VSCode:</strong> After downloading and unzipping the Terraform files, you’ll need to modify the main.tf file to match your infrastructure&#39;s default VPC_id and Subnet_id.</li></ol><p>First, check your AWS console to ensure the Default VPC_id and Subnet_id and verify your VPC setup are correct, and then edit these values in Visual Studio Code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*7Sa5pPttFKw7pZ536EcE7g.png" /><figcaption>VPC ID in the AWS Console</figcaption></figure><p>3. <strong>Generate an SSH key pair</strong> to enable secure SSH access to your EC2 instances. For this project, I used sshkey1 for the key_name. Key format will be .pem</p><p><strong>4. Review the Terraform and verify the information is correct:</strong></p><p>1. Vpc_id = default vpc_id in the aws console</p><p>2. Subnet_id = default subnet in the aws console</p><p>3. SSHkey1 = Newly created SSHkey1 in the aws console</p><figure><img alt="VP_id, Subnet_id and SSH Key Pair" src="https://cdn-images-1.medium.com/max/1024/1*HdNRMdZLLLpK3Esa2JJw1g.png" /><figcaption>VPC_id, Subnet_id and Key_name modified</figcaption></figure><p>5. C<strong>reate a zip file with the updated information included: </strong>Default VPI_id, Subnet_id &amp; SSHkey1</p><p>6. <strong>Install Terraform on AWS Cloud Shell.</strong> We’ll streamline the process by using Terraform within the AWS Cloud Shell, which is a recommended approach to minimize potential bugs or issues. This strategy allows us to use Terraform commands directly without the need for local installation. <strong>Copy and run Bash code commands below on the AWS Cloud Shell to install Terraform</strong></p><p>sudo yum install -y yum-utils</p><p>sudo yum-config-manager — add-repo</p><p><a href="https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo">https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo</a></p><p>sudo yum -y install terraform</p><p>terraform -v</p><p>Run the commands. After all the commands run, Terraform will show that it has been successfully completed.</p><p>7. Upload your zip file with the edited terraform code to AWS Cloud Shell and unzip it.</p><p>8. Run <strong>ls — ltr </strong>command to verify the zip files are there. You can run ls -ltr command to verify the zip files are there:</p><p>9. After <strong>uploading the Terraform script to AWS CloudShell</strong>, I <strong>executed</strong> the <strong>Terraform commands to create</strong> the associated infrastructure: two EC2 instances (web servers), including security groups and other components:</p><p><em>$ terraform init</em></p><p><em>$ terraform plan</em></p><p><em>$ terraform apply</em></p><p><strong>a. Initiating:</strong> Running terraform init initializes the working directory containing Terraform configuration files. This command also downloads any necessary plugins, including the AWS provider.</p><p><strong>b. Planning:</strong> By executing terraform plan, Terraform creates an execution plan. This step determines what actions are necessary to achieve the desired state specified in the configuration files.</p><p><strong>c. Applying</strong>: With terraform apply, Terraform applies the changes to AWS. It will create, update, or delete resources as needed to match the target configuration.</p><p>Webserver1 and Webserver2 were successfully created in CloudShell in 32 seconds!! Terraform created this infrastructure within seconds!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*3cbaUXcukyQE04CnTMjtIg.png" /></figure><p>These EC2 instances has also been verified in the AWS Console:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lkM-A346bAaWSpSok9H17g.png" /></figure><p>You can learn more about Terraform on <a href="https://learn.hashicorp.com/terraform">https://learn.hashicorp.com/terraform</a></p><p><strong>Part 2: AWS System Manager — </strong>Next step is to run the System Manager tool deploy a Secured Agent in our EC2 instances.</p><p>AWS Systems Manager is a service provided by Amazon Web Services that helps you manage your infrastructure on AWS. It offers a unified user interface that allows you to view and control your AWS resources. Here are a few examples of key uses of AWS Systems Manager:</p><p><strong>Resource Management:</strong> It enables you to group your resources, such as Amazon EC2 instances, Amazon S3 buckets, and Amazon RDS instances, based on their purpose, department, or environment.</p><p><strong>Patch Management: </strong>Systems Manager automates the process of patching managed instances with both security related and other types of updates.</p><p><strong>Automation:</strong> AWS Systems Manager allows you to automate common and repetitive tasks.</p><p><strong>Remote Management: </strong>It provides a secure way for administrators to remotely manage the configuration of their managed instances, without needing to log into them directly.</p><p><strong>Configuration Compliance: </strong>The service helps ensure that your resources are compliant with your company’s policies or industry regulations. It continually scans your environment and provides detailed reports on your compliance status.</p><p><strong>Running the System Manager tool deploy a Secured Agent in our EC2 instances:</strong></p><p>In a typical setup, a security agent from a third-party company, such as Symantec, is installed to safeguard instances against threats. For this exercise, however, a script was created by The Cloud Bootcamp instructors to simulate such a security agent.</p><p>This script will be deployed via the Systems Manager’s run command, automating the process for efficiency.</p><p>Additionally, the Amazon Simple Notification Service (SNS) will be utilized to send progress notifications via email, allowing for monitoring and confirmation of the process’s successful execution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l5nIFDSszczl4WNhBGpnYA.png" /></figure><ol><li>AWS Systems Manager — <strong>Create an IAM role to grant Systems Manager permissions to employ the Simple Notification Service (SNS)</strong>. This enables the Systems Manager to send email notifications via SNS</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UKriFFM4N5PtQm8-1UIKdA.png" /></figure><ul><li>Policy: <strong>AmazonSNSFullAccess</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KsoxUfSxAFwzxguipvQb2Q.png" /></figure><p>This policy will authorize the system manager to send notifications using SNS to get the email notification.</p><ul><li>Role Name: <strong>SystemsManagerToSNS</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z70Vu82d9J7ilVTsflejVA.png" /></figure><p>This role is authorizing the Systems Manager to use the Simple Notification Service (SNS). Verify that the SystemsManagerToSNS role has been created in the AWS Console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TaV1GFZtgKs-C4QPVjjvjQ.png" /></figure><p>2. <strong>Create a Notification Topic DevOpsNotification </strong>to<strong> </strong>let you know when Systems Manager makes changes to your infrastructure.</p><p>3. <strong>Set up an email subscription for the notification</strong> topic so that the Systems Manager knows the destination for the alerts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X0YzTcip_6NiRaAA2PM0bA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dPTTQ2kCPW246JwdQOapWA.png" /></figure><p>Now your subscription will receive emails coming from the SNS topic you just created.</p><p>4. Next, <strong>set up the Run Command feature in AWS Systems Manager</strong> for configuring your EC2 instances with the appropriate settings.</p><ul><li>Targets: <strong>Choose how you want to target instances</strong> | <strong>Manual</strong></li><li><strong>Select the instances created in terraform: webserver1 and webserver2</strong></li><li>Create!</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U4P3JgvvugejpNwguyyUEQ.png" /></figure><p>The Systems manager will initiate the configuration process for your host/</p><p>When you see the configuration association status is successful for 4, you can select the account and check the configuration details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F55GlgWO5YmS4cm9SHQGTA.png" /></figure><p>Select the account and click on view the details</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AopeJC6l9uaAtctlEyVGZw.png" /></figure><p>The statuses for the following associations are displayed: UpdatesSSMAgent, ScanForPatches, AttachIAMToInstance, and Enable Explorer all indicate success, which is a positive outcome.</p><p>CollectInventory is an ongoing process, and as such, it may consistently appear in a ‘Pending’ state.</p><p>5. Validate the configuration. This will make sure that Systems Manager is configured correctly.</p><p>Session Manager helps us to use the Systems Manager</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4J0B0o6tV49tdtcCenYxWg.png" /></figure><p>Select one instance and click on “<strong>Start Session</strong>” — to access the EC2 remotely from Session manager</p><p>6. Explore the Session Manager. This is a great way to SSH into your EC2 instances without having to use a separate SSH client.</p><p>7. Execute a Run Command to deploy the “security agent installation”command on your EC2 instances.</p><ul><li>Accss Quick Setup | Node Management: <strong>Run Command</strong> | <strong>Run Command</strong> [ <strong>AWS-RunShellScript</strong> ]</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mdT0HUn2gyy-QDUr28X5xw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*307BdKI3Y9UV1RVkD_IhfA.png" /></figure><pre>The last command will verify in the agent was installed successfully on this EC2 instance.</pre><pre>ls -ltr /usr/bin/security_agent</pre><p><strong>‘Run Command’ screen</strong></p><ul><li><strong>RUN | Open the Email and check the notification!</strong></li></ul><p>Refresh the page, access the instance and check the ‘output’!</p><p>The Run Command status showed successful deployment of “security agent” to the EC2 instances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jl-y_jaLS55-pO0sdu1CjQ.png" /></figure><p>I also received email notifications of the successful deployment via the Amazon SNS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NrrDQN-a9P6GrItfdQoYTg.png" /></figure><p>In summary, this practical project involved using Terraform to automate the setup of AWS resources, including security groups and EC2 instances. I used Amazon Simple Notification Service (SNS) to send an email informing the whole process status.</p><p>This was a great project.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26cfa5064669" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementation of a Scalable Web Application using the services of AWS Elastic Beanstalk, DynamoDB…]]></title>
            <link>https://medium.com/@brianaalleyne/implementation-of-a-scalable-web-application-using-the-services-of-aws-elastic-beanstalk-dynamodb-61f404e1f106?source=rss-81e0c486cff8------2</link>
            <guid isPermaLink="false">https://medium.com/p/61f404e1f106</guid>
            <category><![CDATA[cloudfront]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[elastic-beanstalk]]></category>
            <category><![CDATA[cloudwatch]]></category>
            <dc:creator><![CDATA[BrianAAlleyne]]></dc:creator>
            <pubDate>Fri, 01 Mar 2024 19:34:18 GMT</pubDate>
            <atom:updated>2024-03-01T19:34:18.852Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>Implementation of a Scalable Web Application using the services of AWS Elastic Beanstalk, DynamoDB, CloudFront and Edge Location</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vyyUmMJxKPSGow2Ns1FIsw.png" /></figure><p>In this project, which mimics a real-world scenario, my role involved deploying an application designed to handle the substantial demand of numerous users accessing it concurrently. The application supported a major conference attended by over 10,000 individuals, both in-person and online, with participants joining from across the globe.</p><p>This event was broadcasted online and in person and 10 vouchers were drawn for 3 Cloud certifications. At that moment, more than 10,000 people in the audience registered their e-mails to guarantee their participation in the raffle.</p><p>We used in AWS, Elastic Beanstalk services to deploy the web application, DynamoDB to store emails, CloudFront to cache static and dynamic files in an Edge Location close to the user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fh-2rrUNSN2eMAFC2HaBsQ.png" /></figure><p>Summary of Steps:</p><ol><li><strong>Create a DynamoDB table named “users” to archive the email addresses of conference attendees.</strong></li></ol><p>Attendees will submit their email addresses via the application, which DynamoDB will then store. DynamoDB is a NoSQL database service engineered for high-performance, large-scale internet applications, allowing developers to create contemporary, serverless applications that scale seamlessly from small to global.</p><p>DynamoDB provides automatic data duplication across various availability zones, ensuring both high availability and durability. It includes inherent security measures and monitoring functions.</p><p>For this project, the table “users” will use the Partition key as its Primary key to organize the data efficiently.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_9kaOP1CZB_gpN6qUzQytw.png" /></figure><p><strong>2. Deploy the web application using Elastic Beanstalk.</strong></p><p>Elastic Beanstalk offers a straightforward platform for deploying and scaling web applications and services. Once you upload the code, Elastic Beanstalk takes over the deployment process, managing everything from capacity provisioning and load balancing to auto-scaling. It also monitors the health of web applications while providing fully managed updates for patches and security, streamlining the entire deployment and management process.</p><p>Elastic Beanstalk runs Python to Provision its Architecture. Within the Elastic Beanstalk environment, an Elastic Load Balancer is set up to regulate the traffic directed to the Auto Scaling group of EC2 instances that host the web applications.</p><p>Also, be sure to configure service access of the “aws-elasticbeanstalk-ec2-role” with the appropriate permisions/policies to access the resources within the environment. Without the correct policies configured, the aws-elasticbeanstalk -ec2-role will not be authorized to perform “PUtItem” or add new items to the DynamoDB. To resolve this issue, you must manually attached the Amazon Dynamo DBFulll Access AWS managed policy to the aws-elasticbeanstalk-ec2-role.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5efQFbgJ9lIbDnkk6f5EOw.png" /></figure><p>Add the following Permissions policies:</p><ul><li><strong>AmazonDynamoDBFull Access</strong></li><li><strong>AWSElasticBeanstalkWebTier</strong></li><li><strong>AWSElasticBeanstalkWorkerTier</strong></li><li><strong>AWSElasticBeanstalkMulticontainerDocker</strong></li></ul><p><strong>3. Create a new Cloud Front Distribution that will give us a Route 53 DNS Entries that we can use to access our application going through the Cloud Front.</strong></p><p>Amazon CloudFront is a fast content delivery network (CDN) service that distributes data, videos, applications, and APIs to customers globally with low latency and high transfer speeds. When a user requests content, the request is routed to the edge location that provides the lowest latency (time delay), so that content is delivered with the best possible performance.</p><p>For this project, the domain name associated with the CloudFront distribution provided access to the web application. Submitted email addresses were automatically stored in DynamoDB. The web application, developed in Python, is designed to automatically adjust its capacity according to demand, scaling up to a maximum number of instances or down to a minimum as needed. The configured scaling capacity for this project allowed for a minimum of 2 instances and a maximum of 4 instances.</p><p><strong>4. Testing Cloud Front</strong></p><p>After AWS Cloudfront has bee created, it is now time to test the environment. Within the AWS console, go to Cloudfront portal. Copy the distribution Domain Name and test it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oXlPiuz2HT9_gbz3HaTGww.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pc5cUjtdjN13u-7FHg2TnQ.png" /></figure><p>I initiated a new browser tab and entered the Distribution Domain address into the browser’s address bar, which successfully launched the site.</p><p>To verify the application server’s functionality, I entered the email ‘abc@abc.com’ into the system to confirm that it would be successfully recorded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JxMI7dVtjzZJmqkNsutVww.png" /></figure><p>I entered a second email, ‘tcb-admin@tcb.com,’ to ensure that both entries would be visible in the DynamoDB table connected to the web application server (EC2). As evident, both entries have been successfully verified.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rNfsK-SHch9TBzG4uMN3Tw.png" /></figure><p>Our infrastructure is working.</p><p><strong>5. Stress/Overloading test — </strong>Checking EC2, LB, TG, AutoScaling, Elastic Beanstalk health/status</p><p>Next, we plan to test the scalability of our architecture to ensure it can automatically expand during periods of high demand and intense workload. For example, if the CPU usage on any of the EC2 instances goes above 50%, the auto-scaling feature is designed to activate and autonomously provision an extra instance.</p><p>Go to your Elastic Beanstalk environment and verify the current Health status:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1WDLFeAVszjQeGiW0733gA.png" /></figure><p><strong>Stress Testing</strong></p><p>Utilize the key pair generated during the Elastic Beanstalk setup to establish a remote connection to the EC2 instance, then confirm that the instance successfully loads the Elastic Beanstalk web page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*FdL6LfdySgdpFbOsYjsrsw.png" /></figure><p>I used the following commands to install and run the stress tool:</p><p>sudo yum install stress -y and stress -c 4</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gx4MvdrUQy7_z69ekAPJzA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R57UhmnkyigVAYGUth8iBg.png" /></figure><p>Next, check Check the Elastic Beanstalk portal to see if the status has change to Warning. The Warning message occurs because the CPU utilization of the instance is maxing out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zp_RA3wpF5KIXeOtCU3Log.png" /></figure><p>You will eventually see that the Health of the target instance in the Elastic Beanstalk portal has changed to Degraged. Autoscaling will kick in to add another instance to ensure users will have more instance available to users to access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7xF4nq1CUUxsoWUZugIyPQ.png" /></figure><p>Verify the functionality of autoscaling by examining the EC2 Instance dashboard. If autoscaling is operational, you should observe three instances running, up from the initial two, indicating that autoscaling is active and functioning correctly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5-pkz2ctntffZ7mASGDZoA.png" /></figure><p>Navigate to the Auto Scaling groups section and check the dashboard to confirm the number of instances in operation. Over time, if the CPU threshold on the third instances reaches its maximum, a fourth instance will be automatically added.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jioapj3HRMg0UiXZDETILw.png" /></figure><p>As a final test, navigate to the application’s website and attempt to create a new record.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*day7p0wh7DnZebnjjE927A.png" /></figure><p>The record has been successfully added.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ObtJt-jaBPDGwq8yq9GXbw.png" /></figure><p>Confirm that the users DynamoDB table has been updated with a new record.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SRneJwgLmDHNbsUsoN-tUw.png" /></figure><p>The new entry has been successfully added, confirming that our environment is functioning properly during the stress test. When the stress test concludes, the health status on the Elastic Beanstalk dashboard will transition from a warning state back to an ‘ok’ status.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VCS_ZcMEKTdM-zUGHa7GPg.png" /></figure><p>By selecting the health tab on the Elastic Beanstalk dashboard, you will notice a reduction in the number of instances. The Health Status should indicate ‘ok’, and any instances that are degraded will be automatically removed from the group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OJtb9Og6xvyYbJmJxgxdjg.png" /></figure><p>The AWS EC2 dashboard will reflect any updates to the number of active instances.</p><p>To sum up, this practical project involved leveraging the AWS cloud computing platform to deploy scalable web applications with an integrated database. This was achieved by utilizing a range of AWS services, including Elastic Beanstalk, CloudFront, DynamoDB, Auto Scaling group, EC2, Load Balancer, and VPC.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=61f404e1f106" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>